@treasuredata/tdx 2026.3.23 → 2026.3.25

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 (203) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/auth-login-command.js +1 -1
  11. package/dist/commands/chat-command.js +1 -1
  12. package/dist/commands/claude-command.js +1 -1
  13. package/dist/commands/claude-statusline-command.js +1 -1
  14. package/dist/commands/claude-usage-command.js +1 -1
  15. package/dist/commands/command.js +1 -1
  16. package/dist/commands/connection-command.js +1 -1
  17. package/dist/commands/databases.js +1 -1
  18. package/dist/commands/delivery-command.js +1 -1
  19. package/dist/commands/describe.js +1 -1
  20. package/dist/commands/engage-campaign-pull-command.js +1 -1
  21. package/dist/commands/engage-campaign-push-command.js +1 -1
  22. package/dist/commands/engage-campaign-validate-command.js +1 -1
  23. package/dist/commands/engage-command.js +1 -1
  24. package/dist/commands/engage-template-pull-command.js +1 -1
  25. package/dist/commands/engage-template-push-command.js +1 -1
  26. package/dist/commands/engage-template-validate-command.js +1 -1
  27. package/dist/commands/job-command.js +1 -1
  28. package/dist/commands/journey-command.js +1 -1
  29. package/dist/commands/journey-validate-command.js +1 -1
  30. package/dist/commands/llm-command.js +1 -1
  31. package/dist/commands/mcp-command.js +1 -1
  32. package/dist/commands/parent-segment-command.js +1 -1
  33. package/dist/commands/policy-command.js +1 -1
  34. package/dist/commands/profile-command.js +1 -1
  35. package/dist/commands/profiles-command.js +1 -1
  36. package/dist/commands/query-command.js +1 -1
  37. package/dist/commands/schedule-command.js +1 -1
  38. package/dist/commands/segment-command.js +1 -1
  39. package/dist/commands/segment-create-command.js +1 -1
  40. package/dist/commands/segment-fields-command.js +1 -1
  41. package/dist/commands/segment-pull-command.js +1 -1
  42. package/dist/commands/segment-push-command.js +1 -1
  43. package/dist/commands/segment-update-command.js +1 -1
  44. package/dist/commands/segment-use-command.js +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/status-command.js +1 -1
  49. package/dist/commands/tables.js +1 -1
  50. package/dist/commands/unset-command.js +1 -1
  51. package/dist/commands/upgrade-command.js +1 -1
  52. package/dist/commands/use-command.js +1 -1
  53. package/dist/commands/user-command.js +1 -1
  54. package/dist/commands/workflow-command.js +1 -1
  55. package/dist/core/auth.js +1 -1
  56. package/dist/core/command-output.js +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/oauth-keychain.js +1 -1
  64. package/dist/core/oauth.js +1 -1
  65. package/dist/core/profile.js +1 -1
  66. package/dist/core/project-config.js +1 -1
  67. package/dist/core/session.js +1 -1
  68. package/dist/core/user-cache.js +1 -1
  69. package/dist/core/version.js +1 -1
  70. package/dist/index.js +1 -1
  71. package/dist/mcp/server.js +1 -1
  72. package/dist/mcp/tools/index.js +1 -1
  73. package/dist/mcp/tools/tdx-run.js +1 -1
  74. package/dist/mcp/tools/tdx-search.js +1 -1
  75. package/dist/mcp/utils.js +1 -1
  76. package/dist/proxy/claude-usage-tracker.js +1 -1
  77. package/dist/proxy/passthrough-server.js +1 -1
  78. package/dist/proxy/sse-usage-parser.js +1 -1
  79. package/dist/sdk/agent/agent-config.js +1 -1
  80. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  81. package/dist/sdk/agent/agent-yaml.js +1 -1
  82. package/dist/sdk/agent/test/evaluator.js +1 -1
  83. package/dist/sdk/agent/test/executor.js +1 -1
  84. package/dist/sdk/agent/test/index.js +1 -1
  85. package/dist/sdk/agent/test/output.js +1 -1
  86. package/dist/sdk/agent/test/parser.js +1 -1
  87. package/dist/sdk/agent/tool-target-registry.js +1 -1
  88. package/dist/sdk/api.js +1 -1
  89. package/dist/sdk/client/cdp-api-client.js +1 -1
  90. package/dist/sdk/client/delivery-api-client.js +1 -1
  91. package/dist/sdk/client/endpoints.js +1 -1
  92. package/dist/sdk/client/engage-api-client.js +1 -1
  93. package/dist/sdk/client/http-client.js +1 -1
  94. package/dist/sdk/client/llm-api-client.js +1 -1
  95. package/dist/sdk/client/oauth-refresh.js +1 -1
  96. package/dist/sdk/client/rate-limiter.js +1 -1
  97. package/dist/sdk/client/td-api-client.js +1 -1
  98. package/dist/sdk/client/trino-api-client.js +1 -1
  99. package/dist/sdk/client/workflow-client.js +1 -1
  100. package/dist/sdk/connection-validator.js +1 -1
  101. package/dist/sdk/connection.js +1 -1
  102. package/dist/sdk/delivery.js +1 -1
  103. package/dist/sdk/engage/campaign-pull.js +1 -1
  104. package/dist/sdk/engage/campaign-push.js +1 -1
  105. package/dist/sdk/engage/campaign-validator.js +1 -1
  106. package/dist/sdk/engage/campaign-yaml.js +1 -1
  107. package/dist/sdk/engage/template-pull.js +1 -1
  108. package/dist/sdk/engage/template-push.js +1 -1
  109. package/dist/sdk/engage/template-validator.js +1 -1
  110. package/dist/sdk/engage/template-yaml.js +1 -1
  111. package/dist/sdk/engage/types/campaign-def.js +1 -1
  112. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  113. package/dist/sdk/engage/types/template-schema.js +1 -1
  114. package/dist/sdk/engage.js +1 -1
  115. package/dist/sdk/errors.js +1 -1
  116. package/dist/sdk/index.js +1 -1
  117. package/dist/sdk/io/index.js +1 -1
  118. package/dist/sdk/io/node-filesystem.js +1 -1
  119. package/dist/sdk/job.js +1 -1
  120. package/dist/sdk/journey.js +1 -1
  121. package/dist/sdk/llm/chat-cache.js +1 -1
  122. package/dist/sdk/llm/index.js +1 -1
  123. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  124. package/dist/sdk/llm/model-factors.js +1 -1
  125. package/dist/sdk/personalization.js +1 -1
  126. package/dist/sdk/policy.js +1 -1
  127. package/dist/sdk/query/index.js +1 -1
  128. package/dist/sdk/query/sql-parser.js +1 -1
  129. package/dist/sdk/realtime.js +1 -1
  130. package/dist/sdk/schedule.js +1 -1
  131. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  132. package/dist/sdk/segment/fields-display.js +1 -1
  133. package/dist/sdk/segment/file-discovery.js +1 -1
  134. package/dist/sdk/segment/journey-utils.js +1 -1
  135. package/dist/sdk/segment/journey-validator.js +1 -1
  136. package/dist/sdk/segment/journey-yaml.js +1 -1
  137. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  138. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  139. package/dist/sdk/segment/pull-workflow.js +1 -1
  140. package/dist/sdk/segment/push-recovery.js +1 -1
  141. package/dist/sdk/segment/push-workflow.js +1 -1
  142. package/dist/sdk/segment/resolution-context.js +1 -1
  143. package/dist/sdk/segment/segment-path-parser.js +1 -1
  144. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  145. package/dist/sdk/segment/segment-validator.js +1 -1
  146. package/dist/sdk/segment/target-resolution.js +1 -1
  147. package/dist/sdk/segment/tdx-config.js +1 -1
  148. package/dist/sdk/segment/types/activation-schema.js +1 -1
  149. package/dist/sdk/segment/types/journey-def.js +1 -1
  150. package/dist/sdk/segment/types/journey-schema.js +1 -1
  151. package/dist/sdk/segment/types/segment-def.js +1 -1
  152. package/dist/sdk/segment/types/segment-schema.js +1 -1
  153. package/dist/sdk/segment/validate-files.js +1 -1
  154. package/dist/sdk/segment/yaml-validator.js +1 -1
  155. package/dist/sdk/segment.js +1 -1
  156. package/dist/sdk/types/index.js +1 -1
  157. package/dist/sdk/types/progress.js +1 -1
  158. package/dist/sdk/user.js +1 -1
  159. package/dist/sdk/util/format-detector.js +1 -1
  160. package/dist/sdk/util/formatters.js +1 -1
  161. package/dist/sdk/util/index.js +1 -1
  162. package/dist/sdk/util/paginate.js +1 -1
  163. package/dist/sdk/util/tree-formatter.js +1 -1
  164. package/dist/sdk/workflow/archive-validation.js +1 -1
  165. package/dist/sdk/workflow/clone-workflow.js +1 -1
  166. package/dist/sdk/workflow/index.js +1 -1
  167. package/dist/sdk/workflow/pull-workflow.js +1 -1
  168. package/dist/sdk/workflow/push-workflow.js +1 -1
  169. package/dist/sdk/workflow/tdx-config.js +1 -1
  170. package/dist/sdk/workflow/workflow-utils.js +1 -1
  171. package/dist/test-utils/command-runner.js +1 -1
  172. package/dist/test-utils/factories.js +1 -1
  173. package/dist/test-utils/fixtures.js +1 -1
  174. package/dist/test-utils/http-mock.js +1 -1
  175. package/dist/test-utils/index.js +1 -1
  176. package/dist/utils/async.js +1 -1
  177. package/dist/utils/colors.js +1 -1
  178. package/dist/utils/diff.js +1 -1
  179. package/dist/utils/file-permissions.js +1 -1
  180. package/dist/utils/file-reader.js +1 -1
  181. package/dist/utils/github-releases.js +1 -1
  182. package/dist/utils/global-cache.js +1 -1
  183. package/dist/utils/json-loader.js +1 -1
  184. package/dist/utils/local-cache.js +1 -1
  185. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  186. package/dist/utils/logger/formatters/index.js +1 -1
  187. package/dist/utils/logger/handlers/console-handler.js +1 -1
  188. package/dist/utils/logger/handlers/file-handler.js +1 -1
  189. package/dist/utils/logger/handlers/index.js +1 -1
  190. package/dist/utils/logger/handlers/null-handler.js +1 -1
  191. package/dist/utils/logger/index.js +1 -1
  192. package/dist/utils/logger/logger.js +1 -1
  193. package/dist/utils/logger/types.js +1 -1
  194. package/dist/utils/option-validation.js +1 -1
  195. package/dist/utils/process.js +1 -1
  196. package/dist/utils/prompt.js +1 -1
  197. package/dist/utils/spinner.js +1 -1
  198. package/dist/utils/sse-parser.js +1 -1
  199. package/dist/utils/string-utils.js +1 -1
  200. package/dist/utils/table-ref-parser.js +1 -1
  201. package/dist/utils/tdx-logger.js +1 -1
  202. package/dist/utils/version-check.js +1 -1
  203. package/package.json +1 -1
@@ -1 +1 @@
1
- const a30_0x1c117e=a30_0x30b0;function a30_0x3340(){const _0x467222=['tdx\x20ps\x20preview\x20','start','List\x20available\x20fields\x20for\x20segmentation','\x20parent\x20segment\x20\x27','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Fetching\x20parent\x20segment\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','✔\x20Query\x20completed:\x20Processed\x20','segment:parent:push','\x5c$&','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','jobId','Listing\x20parent\x20segments\x20matching\x20\x27','segment:parent:list','verbose','\x20Added\x20personalization\x20template\x20to\x20','\x20kill','70288sTycLR','/\x20→\x20','jsonl','stop','To\x20view\x20sample\x20data:','listFields','formatSchemaJson','behaviorsFile','{\x0a\x20\x20\x22database\x22:\x20\x22','toLowerCase','join','filter','personalization_services','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20','SQL\x20query:\x0a','schemaError','indexOf','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','No\x20parent\x20segments\x20found','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','parent_segment','Rows:','segment:parent:sql','trim','json','table','Coverage:','345834gwTuYc','number','string','foreignKey','Created','1cfHsWx','label','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Show\x20parent\x20segment\x20details','segment:parent:validate','length','ps:pz:init','valid','459490VbbVNH','customerGroupFile','Creating\x20parent\x20segment\x20\x27','/sessions/','\x0a⚠️\x20\x20Migrating:\x20','Usage:\x20tdx\x20ps\x20rt\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20RT\x20config\x20(requires\x20context)\x0a','Audience\x20ID:','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','sourceTableError','displayMasterInfo','\x20--attribute\x20\x22','personalizationServices','errors','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','setJobId','attributes','.customers)','\x20tdx\x20wf\x20attempt\x20','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','Name:\x20','Personalization:','\x20\x20Note:\x20','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','Behavior:','displaySummary','ps:pz:list','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','/app/workflows/','getBehaviorNames','FINISHED','/\x20and\x20','124010JVwLDD','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','No\x20RT-enabled\x20parent\x20segments\x20found','validateParentYaml','page_view','collectSchema','Error:\x20--behavior\x20requires\x20a\x20name\x0a','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','coveragePercent','Listing\x20RT-enabled\x20parent\x20segments\x20matching\x20\x27','Creating','\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20','\x22\x20}','`\x20to\x20download\x20the\x20configuration\x20first','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','sampleData','Error\x20reading\x20file:\x20','personalization','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','\x20\x20\x20','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','realtime_enabled','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','log','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','Site:\x20','sections','66UZoeCg','✔\x20Created\x20parent\x20segment\x20\x27','displayPreviewResults','\x0aUsage:\x20tdx\x20ps\x20preview\x20','behaviors','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','Output\x20file:\x20','\x20RT-enabled\x20parent\x20segment','customerPercent','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20rt\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20RT\x20config\x20for\x20specific\x20parent\x20segment','✔\x20Found\x20','\x20=\x20','Usage:\x20tdx\x20ps\x20pz\x20init\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Add\x20PZ\x20template\x20(requires\x20context)\x0a','events','green','utf-8','text','/app/dw/parentSegments/','ignore','Analyzing\x20changes...','Overwrite\x20\x27','\x20--interval\x20','\x27\x20with\x20ID:\x20','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','\x20\x20Columns:\x20','✔\x20No\x20changes\x20-\x20\x27','message','true','List\x20parent\x20segments','allValid','enriched','customersWithEvents','\x20[Job\x20ID:\x20','Status:','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','Listing\x20personalization\x20services\x20for\x20\x27','-1d','\x20service(s)\x20configured','\x27\x20and\x20run\x20workflow?','Join\x20on:','map','apply','Options:\x0a','query','\x20\x20Tables:\x201\x20customers\x20+\x20','segment:parent:desc','segment:parent:show','\x20Context\x20set:\x20','Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20all\x20tables\x20(requires\x20context)\x0a','double','Parent\x20segment:\x20','customers','\x20--behavior\x20\x22','\x0a\x20\x20]\x0a}\x0a','test','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','Fetching\x20customers\x20schema...','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','segment:parent:update','getParentSQL','RT\x202.0:','repeat','description','Updating\x20parent\x20segment\x20\x27','Next\x20steps:','Fetching\x20sample\x20data...','\x20configured','workflowId','in\x20','open','dim','✘\x20Failed\x20to\x20rename\x20directory:\x20','Usage:\x20tdx\x20ps\x20pz\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20PZ\x20services\x20(requires\x20context)\x0a','session','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20all\x20tables\x20for\x20parent\x20segment\x0a\x0a','\x20service','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20PZ\x20services\x20for\x20specific\x20parent\x20segment','win32','/\x20directory.\x0a','resolveParentId','Resolving\x20parent\x20segment\x20\x27','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','Output\x20Database:','\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22','Add\x20template\x20personalization\x20section\x20to\x20parent\x20segment\x20YAML','Attribute:','198888iuyIsN','attribute','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','isDirectory','workflowSessionId','pushParentYaml','812791wOENEd','columns','sourceTableValid','localeCompare','No\x20parent\x20segments\x20match\x20pattern:\x20','segment:parent:run','addBehaviorsFile','Source:','segment:parent:preview','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','Behaviors','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','Fetching\x20current\x20configuration\x20for\x20\x27','user_id','bold','Error:','152fJzoet','scheduleType','\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)','toFixed','<database>.<table>','push','displayAttributesStats','Show\x20parent\x20segment\x20schema\x20(column\x20types)','Aborted.','Error\x20parsing\x20YAML:\x20','column_name','column_type','%)\x20','behavior_','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','limit','error','Get\x20SQL\x20query\x20for\x20parent\x20segment','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','\x20Opening\x20','schemaValid','\x0aChanges\x20to\x20\x27','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','To\x20cancel:','keys','match','Options:','RT\x202.0\x20Validate:','\x0aNew\x20parent\x20segment\x20\x27','execute','timezone','Master:','No\x20personalization\x20services\x20configured','behavior','\x20\x202.\x20Run\x20','Columns:','List\x20personalization\x20services\x20for\x20a\x20parent\x20segment','\x20Configuration\x20is\x20valid','displayPreviewHints','\x20behaviors','Found\x20YAML\x20file:\x20','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','yellow','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','information_schema','Attempt:','primaryKey','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','displayRealtimeInfo','\x27...','\x20trigger=','Create\x20parent\x20segment\x20\x27','\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22','segment','attributesFile','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','Table:\x20','Error:\x20--database\x20and\x20--table\x20are\x20required','cyan','Database:\x20','toLocaleString','Default','Personalization\x20service\x20description','\x0a\x20\x20\x20\x20]','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20init\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Add\x20PZ\x20template\x20for\x20specific\x20parent\x20segment','ps:rt:validate','type','⚡\x20Not\x20enabled','single','Fetching\x20SQL\x20for\x20\x27','red','rowCount','Preview:','dirname','replace','✔\x20Updated\x20parent\x20segment\x20\x27','sort','/attempt/','matchedCount','Session:','getParentFull','Schema\x20saved\x20to\x20','\x20--behavior\x20\x22<name>\x22','customerGroup','\x20\x20\x20\x20','Available\x20behaviors:','master','\x0aChanges\x20to\x20apply\x20to\x20\x27','web','output','ID\x20Stitching:','data','name','Join:','Events:','Error:\x20Parent\x20segment\x20name\x20is\x20required','processedRows','SELECT\x20*\x20FROM\x20(\x0a','\x20--enriched','runParent','/{name}.yml\x0a','elapsedTimeMillis','ps:rt:list','population','\x20is\x20already\x20up\x20to\x20date','\x20total','addAttributes','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','Errors:','all','\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22','interval','site','17136SMHPTt','displaySampleData','Updated','yes','realtime:','preview','\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22','\x0a⚠️\x20\x20Both\x20','database','run','\x20+\x20[','displayBehaviorsStats','\x0aError:','addAttributesFile','⚡\x20Enabled','Updating','displayColumns','\x20rows\x20','stitchingKeys','.yml','\x20\x20Database:\x20','totalEvents','last_page_viewed','listParents','idStitching','segment:parent:pull','tdx\x20ps\x20push\x20','.yaml','\x20section','Validating\x20configuration...','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Apply\x20changes\x20to\x20\x27','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','YAML\x20file:\x20','18KAsFGb','segment:parent:create','\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)','parentSegment','unref','td_client_id','format','👥\x20','Listing\x20parent\x20segments...','Fetching\x20behavior\x20list...','\x20RT\x20configuration\x20is\x20valid','\x0aNo\x20sample\x20data\x20available','audienceId','scheduleOption','use','realtime','Attributes:','column','workflowAttemptId','joinKey','getOutputDatabaseName','\x0a\x20\x20\x20\x20}','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','endsWith','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','\x20Added\x20RT\x202.0\x20template\x20section','previewParentYaml','Error:\x20--attribute\x20requires\x20a\x20name\x0a','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','addBehaviors'];a30_0x3340=function(){return _0x467222;};return a30_0x3340();}(function(_0x5daf52,_0x57a627){const _0xbd2ef5=a30_0x30b0,_0x267b5d=_0x5daf52();while(!![]){try{const _0x44f6ef=parseInt(_0xbd2ef5(0x29d))/0x1*(-parseInt(_0xbd2ef5(0x298))/0x2)+parseInt(_0xbd2ef5(0x24d))/0x3*(parseInt(_0xbd2ef5(0x27c))/0x4)+parseInt(_0xbd2ef5(0x132))/0x5+parseInt(_0xbd2ef5(0x1a4))/0x6+-parseInt(_0xbd2ef5(0x1aa))/0x7+parseInt(_0xbd2ef5(0x1ba))/0x8*(-parseInt(_0xbd2ef5(0x22b))/0x9)+-parseInt(_0xbd2ef5(0x2a5))/0xa*(-parseInt(_0xbd2ef5(0x14d))/0xb);if(_0x44f6ef===_0x57a627)break;else _0x267b5d['push'](_0x267b5d['shift']());}catch(_0xd2c34e){_0x267b5d['push'](_0x267b5d['shift']());}}}(a30_0x3340,0x1bcce));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a30_0x7edf6c from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,createCommandSpinner,formatElapsed}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{getConsoleUrl,getConsoleNextUrl}from'../sdk/client/endpoints.js';import{formatRows,formatAsTable,hyperlink}from'../sdk/util/formatters.js';import{parseDef,serializeDef}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';function a30_0x30b0(_0x5c2052,_0x490405){_0x5c2052=_0x5c2052-0x11c;const _0x334017=a30_0x3340();let _0x30b021=_0x334017[_0x5c2052];return _0x30b021;}import a30_0x2ac4a6 from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../sdk/segment/fields-display.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';const PARENT_SEGMENT_DIR='parent_segments',LEGACY_PARENT_SEGMENT_DIR=a30_0x1c117e(0x291);function openBrowser(_0x29dbe6){const _0x1678c5=a30_0x1c117e,_0x20f164=process['platform'],_0x149a92=_0x20f164==='darwin'?_0x1678c5(0x193):_0x20f164===_0x1678c5(0x19b)?_0x1678c5(0x26c):'xdg-open';spawn(_0x149a92,[_0x29dbe6],{'detached':!![],'stdio':_0x1678c5(0x15f)})[_0x1678c5(0x251)]();}function migrateLegacyDirectory(){const _0x3f0b41=a30_0x1c117e;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x3b29f9=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x3b29f9[_0x3f0b41(0x1a7)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x3f0b41(0x1ca)](a30_0x2ac4a6[_0x3f0b41(0x1e4)](_0x3f0b41(0x232)+LEGACY_PARENT_SEGMENT_DIR+_0x3f0b41(0x131)+PARENT_SEGMENT_DIR+'/\x20directories\x20exist.')),console[_0x3f0b41(0x1ca)](a30_0x2ac4a6[_0x3f0b41(0x194)](_0x3f0b41(0x123)+LEGACY_PARENT_SEGMENT_DIR+_0x3f0b41(0x19c))),![];console[_0x3f0b41(0x1ca)](a30_0x2ac4a6['yellow'](_0x3f0b41(0x2a9)+LEGACY_PARENT_SEGMENT_DIR+_0x3f0b41(0x27d)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console['error'](a30_0x2ac4a6[_0x3f0b41(0x15b)]('✔\x20Renamed\x20directory\x20to\x20'+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x32bf1b){const _0x5f3fbd=_0x32bf1b instanceof Error?_0x32bf1b[_0x3f0b41(0x168)]:String(_0x32bf1b);return console[_0x3f0b41(0x1ca)](a30_0x2ac4a6[_0x3f0b41(0x200)](_0x3f0b41(0x195)+_0x5f3fbd+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a30_0x1c117e(0x234)](_0x4ff9a1){const _0x1f4816=a30_0x1c117e;return migrateLegacyDirectory(),super[_0x1f4816(0x234)](_0x4ff9a1);}}function resolveYamlFile(_0x598880){const _0x586d6c=a30_0x1c117e;if(_0x598880[_0x586d6c(0x264)]('.yml')||_0x598880[_0x586d6c(0x264)](_0x586d6c(0x246)))return _0x598880;return a30_0x7edf6c[_0x586d6c(0x286)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x598880)+_0x586d6c(0x23e));}function formatProgressMessage(_0x202183){const _0xab719a=a30_0x1c117e,_0x838882=_0x202183[_0xab719a(0x1d3)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x838882){const [,_0x159d44,_0x3dca4b,_0x21d1e0='']=_0x838882;return a30_0x2ac4a6[_0xab719a(0x194)](_0x159d44+':')+'\x20'+_0x3dca4b+a30_0x2ac4a6['dim'](_0x21d1e0);}return a30_0x2ac4a6[_0xab719a(0x194)](_0x202183);}function showFileNotFoundError(_0x151a98,_0xd1e482){const _0x149f58=a30_0x1c117e;console[_0x149f58(0x1ca)](a30_0x2ac4a6[_0x149f58(0x200)]('Error:\x20File\x20not\x20found:\x20'+_0x151a98+'\x0a')),console[_0x149f58(0x1ca)](a30_0x2ac4a6[_0x149f58(0x1f4)](_0x149f58(0x124)+_0xd1e482+_0x149f58(0x13f)));}function displayRealtimeValidation(_0x2ba4cf){const _0x3ae889=a30_0x1c117e;if(!_0x2ba4cf[_0x3ae889(0x25c)])return;const _0x5cb52d=_0x2ba4cf[_0x3ae889(0x25c)],_0x2d18c9=_0x5cb52d['enabled']?a30_0x2ac4a6['green'](_0x3ae889(0x239)):a30_0x2ac4a6[_0x3ae889(0x1e4)](_0x3ae889(0x1fd));console[_0x3ae889(0x1ca)]('\x0a'+a30_0x2ac4a6[_0x3ae889(0x194)](_0x3ae889(0x18a))+'\x20'+_0x2d18c9);if(_0x5cb52d['events']&&_0x5cb52d[_0x3ae889(0x15a)][_0x3ae889(0x2a2)]>0x0){console[_0x3ae889(0x1ca)]('\x20\x20'+a30_0x2ac4a6[_0x3ae889(0x194)](_0x3ae889(0x218))+'\x20'+_0x5cb52d['events'][_0x3ae889(0x2a2)]+_0x3ae889(0x190));for(const _0xf52d60 of _0x5cb52d['events']){const _0x46e0df=_0xf52d60[_0x3ae889(0x1ac)]===![]?a30_0x2ac4a6['red']('✘'):a30_0x2ac4a6['green']('✔');console['error'](_0x3ae889(0x20e)+_0x46e0df+'\x20'+_0xf52d60[_0x3ae889(0x216)]),_0xf52d60['sourceTableError']&&console['error']('\x20\x20\x20\x20\x20\x20'+a30_0x2ac4a6[_0x3ae889(0x200)](_0xf52d60[_0x3ae889(0x2ad)]));}}if(_0x5cb52d[_0x3ae889(0x120)]&&_0x5cb52d[_0x3ae889(0x120)][_0x3ae889(0x2a2)]>0x0){console[_0x3ae889(0x1ca)]('\x20\x20'+a30_0x2ac4a6[_0x3ae889(0x194)](_0x3ae889(0x25d))+'\x20'+_0x5cb52d[_0x3ae889(0x120)][_0x3ae889(0x2a2)]+_0x3ae889(0x190));for(const _0x24996d of _0x5cb52d['attributes']){const _0x4dab2e=_0x24996d[_0x3ae889(0x2a4)]?a30_0x2ac4a6[_0x3ae889(0x15b)]('✔'):a30_0x2ac4a6[_0x3ae889(0x200)]('✘');console[_0x3ae889(0x1ca)](_0x3ae889(0x20e)+_0x4dab2e+'\x20'+_0x24996d[_0x3ae889(0x216)]+'\x20'+a30_0x2ac4a6[_0x3ae889(0x194)]('('+_0x24996d[_0x3ae889(0x1fc)]+')'));}}if(_0x5cb52d['idStitching']){const _0x2b079a=_0x5cb52d[_0x3ae889(0x243)]['stitchingKeys']?.['length']?_0x3ae889(0x235)+_0x5cb52d[_0x3ae889(0x243)][_0x3ae889(0x23d)][_0x3ae889(0x286)](',\x20')+']':'';console['error']('\x20\x20'+a30_0x2ac4a6[_0x3ae889(0x194)](_0x3ae889(0x214))+'\x20'+_0x5cb52d[_0x3ae889(0x243)][_0x3ae889(0x1e8)]+_0x2b079a);}if(_0x5cb52d['personalizationServices']&&_0x5cb52d[_0x3ae889(0x11c)]['length']>0x0){console[_0x3ae889(0x1ca)]('\x20\x20'+a30_0x2ac4a6['dim'](_0x3ae889(0x126))+'\x20'+_0x5cb52d[_0x3ae889(0x11c)][_0x3ae889(0x2a2)]+_0x3ae889(0x199)+(_0x5cb52d['personalizationServices'][_0x3ae889(0x2a2)]!==0x1?'s':''));for(const _0x192c07 of _0x5cb52d[_0x3ae889(0x11c)]){console[_0x3ae889(0x1ca)]('\x20\x20\x20\x20-\x20'+_0x192c07['name']);}}}function showParentSegmentNotSetError(_0x7b4da4){const _0x468364=a30_0x1c117e;console[_0x468364(0x1ca)](a30_0x2ac4a6[_0x468364(0x1e4)](_0x468364(0x139))),console[_0x468364(0x1ca)](_0x7b4da4);}export class ParentSegmentListCommand extends BaseCommand{['name']=a30_0x1c117e(0x278);['description']=a30_0x1c117e(0x16a);async[a30_0x1c117e(0x1d7)](_0x36b21e){const _0x1451de=a30_0x1c117e,{options:_0x129da9,args:_0x352daf,tdx:_0x3e81d0}=_0x36b21e,_0x279f21=_0x352daf[0x0];_0x129da9[_0x1451de(0x279)]&&(console[_0x1451de(0x1ca)](_0x1451de(0x14b)+_0x129da9[_0x1451de(0x22a)]),_0x279f21&&console[_0x1451de(0x1ca)]('Pattern:\x20'+_0x279f21));const _0x4f5314=await withSpinner(_0x279f21?_0x1451de(0x277)+_0x279f21+'\x27...':_0x1451de(0x255),()=>_0x3e81d0[_0x1451de(0x1ef)][_0x1451de(0x242)](),{'verbose':_0x129da9[_0x1451de(0x279)]});let _0x4d4895=_0x4f5314[_0x1451de(0x215)];if(_0x279f21){const _0xbacc7c=_0x279f21[_0x1451de(0x204)](/[.+^${}()|[\]\\]/g,_0x1451de(0x274))[_0x1451de(0x204)](/\*/g,'.*')[_0x1451de(0x204)](/\?/g,'.'),_0x2a7bd5=new RegExp('^'+_0xbacc7c+'$','i');_0x4d4895=_0x4d4895['filter'](_0x340df1=>_0x2a7bd5[_0x1451de(0x184)](_0x340df1['attributes'][_0x1451de(0x216)]));}_0x4d4895[_0x1451de(0x206)]((_0x3ffc7c,_0x291655)=>_0x3ffc7c[_0x1451de(0x120)][_0x1451de(0x216)][_0x1451de(0x1ad)](_0x291655[_0x1451de(0x120)][_0x1451de(0x216)])),console['error'](_0x1451de(0x157)+_0x4d4895['length']+'\x20parent\x20segment'+(_0x4d4895[_0x1451de(0x2a2)]!==0x1?'s':''));const _0x5a2cde=_0x3da991=>{const _0x539bf8=_0x1451de;return getConsoleNextUrl(_0x129da9[_0x539bf8(0x22a)],_0x539bf8(0x15e)+_0x3da991);};if(_0x129da9[_0x1451de(0x253)]===_0x1451de(0x295)||_0x129da9[_0x1451de(0x253)]===_0x1451de(0x27e)){const _0x5d19fd=_0x4d4895[_0x1451de(0x176)](_0x5e77d1=>({..._0x5e77d1,'url':_0x5a2cde(_0x5e77d1['id'])}));await handleSDKOutput(_0x5d19fd,_0x129da9);}else{if(_0x4d4895[_0x1451de(0x2a2)]===0x0)_0x279f21?console[_0x1451de(0x149)](_0x1451de(0x1ae)+_0x279f21):console[_0x1451de(0x149)](_0x1451de(0x28f));else for(const _0xf6251e of _0x4d4895){const _0x29778c=_0xf6251e[_0x1451de(0x120)]['population']?a30_0x2ac4a6['dim']('\x20('+formatRows(_0xf6251e[_0x1451de(0x120)][_0x1451de(0x221)])+')'):'',_0x28f791=hyperlink(_0xf6251e[_0x1451de(0x120)][_0x1451de(0x216)],_0x5a2cde(_0xf6251e['id']));console[_0x1451de(0x149)](_0x1451de(0x254)+_0x28f791+_0x29778c);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a30_0x1c117e(0x216)]=a30_0x1c117e(0x24e);[a30_0x1c117e(0x18c)]='Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]';async[a30_0x1c117e(0x1d7)](_0x1b5077){const _0x50dfa7=a30_0x1c117e,{options:_0x3c6db0,args:_0x2d91de,tdx:_0x508e60}=_0x1b5077;console['error']('\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a'+_0x50dfa7(0x1f1)+_0x50dfa7(0x185));const _0x424293=_0x3c6db0;if(_0x2d91de[_0x50dfa7(0x2a2)]===0x0)return console[_0x50dfa7(0x1ca)](a30_0x2ac4a6['red']('Error:\x20Parent\x20segment\x20name\x20is\x20required')),console[_0x50dfa7(0x1ca)](_0x50dfa7(0x24b)),0x1;const _0x5c8457=_0x2d91de[0x0];if(!_0x424293[_0x50dfa7(0x233)]||!_0x424293['table'])return console[_0x50dfa7(0x1ca)](_0x50dfa7(0x1f3)),console[_0x50dfa7(0x1ca)]('Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>'),0x1;_0x424293[_0x50dfa7(0x279)]&&(console['error'](_0x50dfa7(0x14b)+_0x424293['site']),console[_0x50dfa7(0x1ca)](_0x50dfa7(0x125)+_0x5c8457),console[_0x50dfa7(0x1ca)](_0x50dfa7(0x1f5)+_0x424293[_0x50dfa7(0x233)]),console[_0x50dfa7(0x1ca)](_0x50dfa7(0x1f2)+_0x424293[_0x50dfa7(0x296)]));const _0x13a2ee=await loadJSONFromOptions(_0x424293[_0x50dfa7(0x120)],_0x424293[_0x50dfa7(0x1f0)]),_0x2a71b7=await loadJSONFromOptions(_0x424293[_0x50dfa7(0x151)],_0x424293[_0x50dfa7(0x283)]),_0x6f25be=await loadJSONFromOptions(_0x424293[_0x50dfa7(0x20d)],_0x424293[_0x50dfa7(0x2a6)]),_0x32870b={'name':_0x5c8457,'description':_0x424293[_0x50dfa7(0x18c)],'scheduleType':_0x424293['scheduleType'],'scheduleOption':_0x424293[_0x50dfa7(0x25a)],'timezone':_0x424293[_0x50dfa7(0x1d8)],'master':{'parentDatabaseName':_0x424293[_0x50dfa7(0x233)],'parentTableName':_0x424293[_0x50dfa7(0x296)]},'attributes':_0x13a2ee,'behaviors':_0x2a71b7,'customerGroup':_0x6f25be},_0x4740e2=await withSpinner(_0x50dfa7(0x2a7)+_0x5c8457+_0x50dfa7(0x1eb),()=>_0x508e60['segment']['createParent'](_0x32870b),{'verbose':_0x3c6db0[_0x50dfa7(0x279)]}),_0x559047=_0x4740e2[_0x50dfa7(0x215)];return console[_0x50dfa7(0x1ca)](_0x50dfa7(0x14e)+_0x559047[_0x50dfa7(0x216)]+_0x50dfa7(0x163)+_0x559047['id']),await handleSDKOutput([_0x559047],_0x3c6db0),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a30_0x1c117e(0x216)]=a30_0x1c117e(0x188);[a30_0x1c117e(0x18c)]=a30_0x1c117e(0x269);async[a30_0x1c117e(0x1d7)](_0xbbb8eb){const _0x5e0184=a30_0x1c117e,{options:_0x5e1b47,args:_0x59070c,tdx:_0x3cce7b}=_0xbbb8eb;console[_0x5e0184(0x1ca)](_0x5e0184(0x290)+_0x5e0184(0x1f1)+_0x5e0184(0x185));const _0x5e4aad=_0x5e1b47;if(_0x59070c['length']===0x0)return console[_0x5e0184(0x1ca)](a30_0x2ac4a6[_0x5e0184(0x200)](_0x5e0184(0x219))),console[_0x5e0184(0x1ca)](_0x5e0184(0x1a6)),0x1;const _0x30ae2d=_0x59070c[0x0];_0x5e4aad[_0x5e0184(0x279)]&&(console[_0x5e0184(0x1ca)](_0x5e0184(0x14b)+_0x5e4aad[_0x5e0184(0x22a)]),console['error']('Parent\x20segment:\x20'+_0x30ae2d));const _0x88b050=await withSpinner(_0x5e0184(0x1b6)+_0x30ae2d+_0x5e0184(0x1eb),()=>_0x3cce7b[_0x5e0184(0x1ef)][_0x5e0184(0x20a)](_0x30ae2d),{'verbose':_0x5e4aad['verbose']}),_0x48fae8=_0x88b050[_0x5e0184(0x215)],_0x25981a=await loadJSONFromOptions(_0x5e4aad[_0x5e0184(0x224)],_0x5e4aad[_0x5e0184(0x238)]),_0x2ca58b=await loadJSONFromOptions(_0x5e4aad[_0x5e0184(0x26a)],_0x5e4aad[_0x5e0184(0x1b0)]),_0x4cd269={'name':_0x48fae8[_0x5e0184(0x216)],'description':_0x5e4aad[_0x5e0184(0x18c)]!==undefined?_0x5e4aad[_0x5e0184(0x18c)]:_0x48fae8[_0x5e0184(0x18c)],'scheduleType':_0x5e4aad[_0x5e0184(0x1bb)]!==undefined?_0x5e4aad[_0x5e0184(0x1bb)]:_0x48fae8[_0x5e0184(0x1bb)],'scheduleOption':_0x5e4aad[_0x5e0184(0x25a)]!==undefined?_0x5e4aad[_0x5e0184(0x25a)]:_0x48fae8[_0x5e0184(0x25a)],'timezone':_0x5e4aad[_0x5e0184(0x1d8)]!==undefined?_0x5e4aad[_0x5e0184(0x1d8)]:_0x48fae8[_0x5e0184(0x1d8)],'master':_0x48fae8[_0x5e0184(0x210)],'attributes':_0x25981a?[..._0x48fae8[_0x5e0184(0x120)]||[],..._0x25981a]:_0x48fae8[_0x5e0184(0x120)],'behaviors':_0x2ca58b?[..._0x48fae8[_0x5e0184(0x151)]||[],..._0x2ca58b]:_0x48fae8[_0x5e0184(0x151)],'customerGroup':_0x48fae8['customerGroup']},_0x45b1b0=await withSpinner(_0x5e0184(0x18d)+_0x30ae2d+'\x27...',()=>_0x3cce7b[_0x5e0184(0x1ef)]['updateParent'](_0x30ae2d,_0x4cd269),{'verbose':_0x5e4aad[_0x5e0184(0x279)]}),_0x42f711=_0x45b1b0[_0x5e0184(0x215)];return console['error'](_0x5e0184(0x205)+_0x42f711[_0x5e0184(0x216)]+'\x27'),await handleSDKOutput([_0x42f711],_0x5e4aad),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a30_0x1c117e(0x216)]=a30_0x1c117e(0x244);[a30_0x1c117e(0x18c)]=a30_0x1c117e(0x128);async[a30_0x1c117e(0x1d7)](_0xc43359){const _0x3d6a68=a30_0x1c117e,{options:_0x45208d,args:_0x489e75,tdx:_0xaff340}=_0xc43359,_0x4dfde2=_0x45208d,_0x1f8b39=_0x489e75[0x0]||_0x45208d[_0x3d6a68(0x250)];if(!_0x1f8b39)return showParentSegmentNotSetError(_0x3d6a68(0x2ac)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment'),0x1;if(_0x4dfde2[_0x3d6a68(0x25b)]&&_0x4dfde2[_0x3d6a68(0x213)])return console[_0x3d6a68(0x1ca)](a30_0x2ac4a6[_0x3d6a68(0x200)](_0x3d6a68(0x1c8))),console['error'](a30_0x2ac4a6[_0x3d6a68(0x194)](_0x3d6a68(0x1e9))),console['error'](a30_0x2ac4a6[_0x3d6a68(0x194)]('using\x20the\x20default\x20path:\x20'+PARENT_SEGMENT_DIR+_0x3d6a68(0x21e))),console['error'](a30_0x2ac4a6[_0x3d6a68(0x1f4)](_0x3d6a68(0x1cc))),0x1;const _0x5259fe=_0x4dfde2[_0x3d6a68(0x213)]||a30_0x7edf6c['join'](PARENT_SEGMENT_DIR,sanitizeFileName(_0x1f8b39)+_0x3d6a68(0x23e));_0x4dfde2[_0x3d6a68(0x279)]&&(console[_0x3d6a68(0x1ca)](_0x3d6a68(0x14b)+_0x4dfde2[_0x3d6a68(0x22a)]),console['error']('Parent\x20segment:\x20'+_0x1f8b39),console[_0x3d6a68(0x1ca)](_0x3d6a68(0x153)+_0x5259fe));const _0x16feba=await withSpinner(_0x3d6a68(0x270)+_0x1f8b39+_0x3d6a68(0x1eb),()=>_0xaff340[_0x3d6a68(0x1ef)]['pullParentYaml'](_0x1f8b39),{'verbose':_0x4dfde2[_0x3d6a68(0x279)]}),_0x1ecef5=_0x16feba[_0x3d6a68(0x215)];if(existsSync(_0x5259fe)){const _0x58f971=readFileSync(_0x5259fe,_0x3d6a68(0x15c)),_0x17d19d=generateDiff(_0x58f971,_0x1ecef5);if(!hasChanges(_0x17d19d))console[_0x3d6a68(0x1ca)](a30_0x2ac4a6['green']('✔')+'\x20No\x20changes\x20-\x20'+a30_0x2ac4a6[_0x3d6a68(0x1f4)](_0x5259fe)+_0x3d6a68(0x222));else{console[_0x3d6a68(0x1ca)](_0x3d6a68(0x1cf)+_0x5259fe+'\x27:'),console[_0x3d6a68(0x1ca)]('─'[_0x3d6a68(0x18b)](0x3c)),console[_0x3d6a68(0x1ca)](formatDiffWithColors(_0x17d19d)),console[_0x3d6a68(0x1ca)]('─'[_0x3d6a68(0x18b)](0x3c));if(!_0x4dfde2[_0x3d6a68(0x22e)]){if(!isInteractive())return console[_0x3d6a68(0x1ca)](a30_0x2ac4a6[_0x3d6a68(0x200)](_0x3d6a68(0x237)),_0x3d6a68(0x26f)),console['error'](a30_0x2ac4a6[_0x3d6a68(0x194)](_0x3d6a68(0x249))),0x1;const _0x484f35=await confirmKey(_0x3d6a68(0x161)+_0x5259fe+'\x27?');if(!_0x484f35)return console['error'](a30_0x2ac4a6[_0x3d6a68(0x1e4)](_0x3d6a68(0x1c2))),0x1;}writeFileSync(_0x5259fe,_0x1ecef5,_0x3d6a68(0x15c)),console[_0x3d6a68(0x1ca)](a30_0x2ac4a6['green']('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a30_0x2ac4a6[_0x3d6a68(0x1f4)](_0x5259fe));}}else{const _0x20af30=a30_0x7edf6c[_0x3d6a68(0x203)](_0x5259fe);!existsSync(_0x20af30)&&mkdirSync(_0x20af30,{'recursive':!![]}),writeFileSync(_0x5259fe,_0x1ecef5,_0x3d6a68(0x15c)),console[_0x3d6a68(0x1ca)](a30_0x2ac4a6[_0x3d6a68(0x15b)]('✔')+_0x3d6a68(0x148)+a30_0x2ac4a6[_0x3d6a68(0x1f4)](_0x5259fe));}return saveSessionContext({'parent_segment':_0x1f8b39},_0x4dfde2[_0x3d6a68(0x197)]),console[_0x3d6a68(0x1ca)](a30_0x2ac4a6[_0x3d6a68(0x15b)]('✔')+_0x3d6a68(0x17d)+a30_0x2ac4a6[_0x3d6a68(0x194)](_0x3d6a68(0x291))+_0x3d6a68(0x158)+a30_0x2ac4a6['cyan'](_0x1f8b39)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a30_0x1c117e(0x216)]=a30_0x1c117e(0x273);[a30_0x1c117e(0x18c)]=a30_0x1c117e(0x164);async[a30_0x1c117e(0x1d7)](_0x4ab833){const _0x5783f7=a30_0x1c117e,{options:_0x39d8f0,args:_0x597ebc,tdx:_0x4bd923}=_0x4ab833,_0x197f32=_0x39d8f0,_0x336a89=_0x597ebc[0x0]||_0x39d8f0[_0x5783f7(0x250)];if(!_0x336a89)return showParentSegmentNotSetError(_0x5783f7(0x14a)+_0x5783f7(0x165)),0x1;const _0x2aaed8=resolveYamlFile(_0x336a89);if(!existsSync(_0x2aaed8))return showFileNotFoundError(_0x2aaed8,_0x336a89),0x1;_0x197f32[_0x5783f7(0x279)]&&(console['error'](_0x5783f7(0x14b)+_0x197f32['site']),console[_0x5783f7(0x1ca)]('YAML\x20file:\x20'+_0x2aaed8));let _0xf66db6;try{_0xf66db6=readFileSync(_0x2aaed8,_0x5783f7(0x15c));}catch(_0x202d14){const _0x1a4dd5=_0x202d14 instanceof Error?_0x202d14['message']:String(_0x202d14);return console[_0x5783f7(0x1ca)](_0x5783f7(0x142)+_0x1a4dd5),0x1;}const _0x15a230=await withSpinner('Analyzing\x20changes...',()=>_0x4bd923[_0x5783f7(0x1ef)]['pushParentYaml'](_0xf66db6),{'verbose':_0x197f32[_0x5783f7(0x279)]}),_0x1af5ec=_0x15a230[_0x5783f7(0x215)],{isNew:_0x44db63,name:_0x378d0f,hasChanges:_0x339d29,diffFormatted:_0x2c70f8}=_0x1af5ec;if(!_0x339d29)return console[_0x5783f7(0x1ca)]('✔\x20No\x20changes\x20-\x20\x27'+_0x378d0f+'\x27\x20is\x20already\x20up\x20to\x20date'),0x0;_0x44db63?console['error'](_0x5783f7(0x1d6)+_0x378d0f+'\x27:'):console['error'](_0x5783f7(0x211)+_0x378d0f+'\x27:');console[_0x5783f7(0x1ca)]('─'[_0x5783f7(0x18b)](0x3c)),console[_0x5783f7(0x1ca)](_0x2c70f8),console[_0x5783f7(0x1ca)]('─'[_0x5783f7(0x18b)](0x3c));const _0x32e5e8=_0x44db63?_0x5783f7(0x1ed)+_0x378d0f+'\x27?':_0x5783f7(0x24a)+_0x378d0f+'\x27?';if(!_0x197f32[_0x5783f7(0x22e)]){if(!isInteractive())return console[_0x5783f7(0x1ca)](a30_0x2ac4a6[_0x5783f7(0x200)](_0x5783f7(0x237)),_0x5783f7(0x26f)),console[_0x5783f7(0x1ca)](a30_0x2ac4a6['dim'](_0x5783f7(0x249))),0x1;const _0x2603c6=await confirmKey(_0x32e5e8);if(!_0x2603c6)return console[_0x5783f7(0x1ca)](a30_0x2ac4a6[_0x5783f7(0x1e4)](_0x5783f7(0x1c2))),0x1;}const _0x2817d5=_0x44db63?_0x5783f7(0x13c):_0x5783f7(0x23a),_0x46867e=await withSpinner(_0x2817d5+_0x5783f7(0x26e)+_0x378d0f+_0x5783f7(0x1eb),()=>_0x1af5ec[_0x5783f7(0x177)](),{'verbose':_0x197f32[_0x5783f7(0x279)]}),_0x17523e=_0x46867e[_0x5783f7(0x215)],_0x330d21=getConsoleNextUrl(_0x197f32[_0x5783f7(0x22a)],'/app/dw/parentSegments/'+_0x17523e['id']),_0x34243e=_0x44db63?'Created':'Updated';return console['error']('✔\x20'+_0x34243e+'\x20parent\x20segment\x20\x27'+_0x17523e[_0x5783f7(0x216)]+'\x27'),console['error']('\x20\x20'+_0x330d21),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a30_0x1c117e(0x216)]=a30_0x1c117e(0x2a1);[a30_0x1c117e(0x18c)]=a30_0x1c117e(0x1b5);async[a30_0x1c117e(0x1d7)](_0x68f875){const _0x67c729=a30_0x1c117e,{options:_0x31c385,args:_0x5093ed,tdx:_0x3bf105}=_0x68f875,_0x545387=_0x31c385,_0x408999=_0x5093ed[0x0]||_0x31c385[_0x67c729(0x250)];if(!_0x408999)return showParentSegmentNotSetError(_0x67c729(0x152)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a'+_0x67c729(0x178)+'\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a'+_0x67c729(0x140)+_0x67c729(0x11e)),0x1;const _0x3e7caf=resolveYamlFile(_0x408999);if(!existsSync(_0x3e7caf))return showFileNotFoundError(_0x3e7caf,_0x408999),0x1;_0x545387[_0x67c729(0x279)]&&(console[_0x67c729(0x1ca)](_0x67c729(0x14b)+_0x545387[_0x67c729(0x22a)]),console[_0x67c729(0x1ca)](_0x67c729(0x24c)+_0x3e7caf));let _0x1c9f19;try{_0x1c9f19=readFileSync(_0x3e7caf,_0x67c729(0x15c));}catch(_0x314e88){const _0x4c6be1=_0x314e88 instanceof Error?_0x314e88[_0x67c729(0x168)]:String(_0x314e88);return console[_0x67c729(0x1ca)]('Error\x20reading\x20file:\x20'+_0x4c6be1),0x1;}const _0x39a54b=createCommandSpinner(a30_0x2ac4a6[_0x67c729(0x194)](_0x67c729(0x248)),{'verbose':_0x545387[_0x67c729(0x279)]});_0x39a54b['start']();const _0x36d5d6={'onProgress':_0x275beb=>{_0x39a54b['text']=formatProgressMessage(_0x275beb);}};if(_0x545387[_0x67c729(0x210)])_0x36d5d6[_0x67c729(0x210)]=!![];if(_0x545387['enriched'])_0x36d5d6['enriched']=!![];_0x545387['attribute']&&(_0x36d5d6[_0x67c729(0x1a5)]=_0x545387[_0x67c729(0x1a5)]);_0x545387[_0x67c729(0x1db)]&&(_0x36d5d6[_0x67c729(0x1db)]=_0x545387['behavior']);if(_0x545387['interval'])_0x36d5d6['interval']=_0x545387[_0x67c729(0x229)];let _0xf1974a;try{_0xf1974a=await _0x3bf105[_0x67c729(0x1ef)][_0x67c729(0x135)](_0x1c9f19,_0x36d5d6),_0x39a54b[_0x67c729(0x27f)]();}catch(_0x5b304a){_0x39a54b[_0x67c729(0x27f)]();throw _0x5b304a;}const _0x39869f=_0x545387[_0x67c729(0x229)]||'-1d';return this['displayValidateResults'](_0xf1974a,_0x36d5d6,_0x3e7caf,_0x39869f),_0xf1974a[_0x67c729(0x16b)]?0x0:0x1;}['displayValidateResults'](_0x27f51e,_0x16f8f2,_0x5e0dc0,_0x42f143){const _0x332ca8=a30_0x1c117e;console['error']('\x0a'+a30_0x2ac4a6[_0x332ca8(0x1b8)]('Validate:')+'\x20'+_0x27f51e['name']),console[_0x332ca8(0x1ca)]('═'[_0x332ca8(0x18b)](0x3c)),this[_0x332ca8(0x2ae)](_0x27f51e);if(typeof _0x16f8f2[_0x332ca8(0x1a5)]===_0x332ca8(0x29a)){this[_0x332ca8(0x1c0)](_0x27f51e),this['displaySummary'](_0x27f51e),this['displayPreviewHints'](_0x5e0dc0,_0x42f143,'attribute',_0x16f8f2[_0x332ca8(0x1a5)]);return;}if(_0x16f8f2[_0x332ca8(0x1a5)]===!![]){this[_0x332ca8(0x1c0)](_0x27f51e),this[_0x332ca8(0x12b)](_0x27f51e),this[_0x332ca8(0x1e0)](_0x5e0dc0,_0x42f143,_0x332ca8(0x120));return;}if(typeof _0x16f8f2[_0x332ca8(0x1db)]==='string'){this[_0x332ca8(0x236)](_0x27f51e,_0x42f143),this[_0x332ca8(0x12b)](_0x27f51e),this[_0x332ca8(0x1e0)](_0x5e0dc0,_0x42f143,_0x332ca8(0x1db),_0x16f8f2[_0x332ca8(0x1db)]);return;}if(_0x16f8f2[_0x332ca8(0x1db)]===!![]){this['displayBehaviorsStats'](_0x27f51e,_0x42f143),this[_0x332ca8(0x12b)](_0x27f51e),this['displayPreviewHints'](_0x5e0dc0,_0x42f143,_0x332ca8(0x151));return;}this['displayAttributesStats'](_0x27f51e),this[_0x332ca8(0x236)](_0x27f51e,_0x42f143),this[_0x332ca8(0x1ea)](_0x27f51e),this['displaySummary'](_0x27f51e),this[_0x332ca8(0x1e0)](_0x5e0dc0,_0x42f143,'all');}[a30_0x1c117e(0x1ea)](_0x3b6fd5){displayRealtimeValidation(_0x3b6fd5);}[a30_0x1c117e(0x1e0)](_0x2c9931,_0x2b15ae,_0x1a111b,_0x49228b){const _0x55e9c1=a30_0x1c117e;console[_0x55e9c1(0x1ca)]('\x0a'+a30_0x2ac4a6[_0x55e9c1(0x194)](_0x55e9c1(0x280)));const _0x314bd4=_0x2b15ae!==_0x55e9c1(0x172)?_0x55e9c1(0x162)+_0x2b15ae:'';if(_0x1a111b==='attribute'&&_0x49228b)console[_0x55e9c1(0x1ca)]('\x20\x20'+a30_0x2ac4a6[_0x55e9c1(0x194)](_0x55e9c1(0x26b)+_0x2c9931+_0x55e9c1(0x2af)+_0x49228b+'\x22'+_0x314bd4));else{if(_0x1a111b===_0x55e9c1(0x1db)&&_0x49228b)console[_0x55e9c1(0x1ca)]('\x20\x20'+a30_0x2ac4a6[_0x55e9c1(0x194)](_0x55e9c1(0x26b)+_0x2c9931+_0x55e9c1(0x182)+_0x49228b+'\x22'+_0x314bd4));else(_0x1a111b===_0x55e9c1(0x120)||_0x1a111b===_0x55e9c1(0x227))&&console['error']('\x20\x20'+a30_0x2ac4a6[_0x55e9c1(0x194)](_0x55e9c1(0x26b)+_0x2c9931+'\x20--attribute\x20\x22<name>\x22'+_0x314bd4));}(_0x1a111b===_0x55e9c1(0x151)||_0x1a111b===_0x55e9c1(0x227))&&console[_0x55e9c1(0x1ca)]('\x20\x20'+a30_0x2ac4a6[_0x55e9c1(0x194)]('tdx\x20ps\x20preview\x20'+_0x2c9931+_0x55e9c1(0x20c)+_0x314bd4)),_0x1a111b===_0x55e9c1(0x227)&&console['error']('\x20\x20'+a30_0x2ac4a6[_0x55e9c1(0x194)]('tdx\x20ps\x20preview\x20'+_0x2c9931+_0x55e9c1(0x21c)+_0x314bd4));}['displayMasterInfo'](_0x10f9ef){const _0x410ec0=a30_0x1c117e,{master:_0x4e8b6d}=_0x10f9ef,_0x54651f=_0x4e8b6d[_0x410ec0(0x1ce)]?a30_0x2ac4a6['green']('✔'):a30_0x2ac4a6[_0x410ec0(0x200)]('✘');console['error']('\x0a'+a30_0x2ac4a6['dim']('Master\x20Table')),console[_0x410ec0(0x1ca)](_0x54651f+'\x20'+a30_0x2ac4a6[_0x410ec0(0x1b8)](_0x4e8b6d['database']+'.'+_0x4e8b6d[_0x410ec0(0x296)])),_0x4e8b6d[_0x410ec0(0x1ce)]?_0x4e8b6d[_0x410ec0(0x201)]!==undefined&&console[_0x410ec0(0x1ca)]('\x20\x20'+a30_0x2ac4a6[_0x410ec0(0x194)](_0x410ec0(0x292))+'\x20'+a30_0x2ac4a6['cyan'](formatRows(_0x4e8b6d[_0x410ec0(0x201)]))):console[_0x410ec0(0x1ca)]('\x20\x20'+a30_0x2ac4a6['red'](_0x410ec0(0x1b9))+'\x20'+_0x4e8b6d[_0x410ec0(0x28c)]);}['displayAttributesStats'](_0x3ff55c){const _0x2f1a0b=a30_0x1c117e;if(_0x3ff55c[_0x2f1a0b(0x120)][_0x2f1a0b(0x2a2)]===0x0)return;console[_0x2f1a0b(0x1ca)]('\x0a'+a30_0x2ac4a6[_0x2f1a0b(0x194)]('Attributes'));for(const _0x5c9b68 of _0x3ff55c[_0x2f1a0b(0x120)]){const _0x1e48d2=_0x5c9b68[_0x2f1a0b(0x1ce)]?a30_0x2ac4a6[_0x2f1a0b(0x15b)]('✔'):a30_0x2ac4a6['red']('✘');let _0x2545bf='';if(_0x5c9b68[_0x2f1a0b(0x1ce)]&&_0x5c9b68['matchedCount']!==undefined&&_0x5c9b68[_0x2f1a0b(0x13a)]!==undefined){const _0x41e404=_0x5c9b68[_0x2f1a0b(0x13a)][_0x2f1a0b(0x1bd)](0x1),_0x23477e=_0x5c9b68[_0x2f1a0b(0x13a)]>=0x50?a30_0x2ac4a6[_0x2f1a0b(0x15b)]:_0x5c9b68[_0x2f1a0b(0x13a)]>=0x32?a30_0x2ac4a6['yellow']:a30_0x2ac4a6[_0x2f1a0b(0x200)];_0x2545bf='\x20'+a30_0x2ac4a6[_0x2f1a0b(0x194)](_0x2f1a0b(0x297))+'\x20'+_0x23477e(_0x41e404+'%')+'\x20('+formatRows(_0x5c9b68[_0x2f1a0b(0x208)])+'\x20rows)';}console[_0x2f1a0b(0x1ca)](_0x1e48d2+'\x20'+a30_0x2ac4a6[_0x2f1a0b(0x1b8)](_0x5c9b68[_0x2f1a0b(0x216)])+_0x2545bf),console[_0x2f1a0b(0x1ca)]('\x20\x20'+a30_0x2ac4a6[_0x2f1a0b(0x194)](_0x2f1a0b(0x1b1))+'\x20'+a30_0x2ac4a6[_0x2f1a0b(0x1b8)](_0x5c9b68['database']+'.'+_0x5c9b68[_0x2f1a0b(0x296)]));const _0x137bae=_0x5c9b68['joinKey']===_0x5c9b68[_0x2f1a0b(0x29b)]?a30_0x2ac4a6[_0x2f1a0b(0x194)](_0x2f1a0b(0x175))+'\x20'+_0x5c9b68[_0x2f1a0b(0x260)]:a30_0x2ac4a6['dim']('Join:')+'\x20'+_0x5c9b68['joinKey']+'\x20=\x20'+_0x5c9b68[_0x2f1a0b(0x29b)];console[_0x2f1a0b(0x1ca)]('\x20\x20'+_0x137bae),console['error']('\x20\x20'+a30_0x2ac4a6[_0x2f1a0b(0x194)](_0x2f1a0b(0x1dd))),this[_0x2f1a0b(0x23b)](_0x5c9b68[_0x2f1a0b(0x1ab)]),!_0x5c9b68[_0x2f1a0b(0x1ce)]&&console['error']('\x20\x20'+a30_0x2ac4a6[_0x2f1a0b(0x200)](_0x2f1a0b(0x1b9))+'\x20'+_0x5c9b68[_0x2f1a0b(0x28c)]);}}[a30_0x1c117e(0x236)](_0x3fed77,_0x577998){const _0x2e615e=a30_0x1c117e;if(_0x3fed77['behaviors'][_0x2e615e(0x2a2)]===0x0)return;console[_0x2e615e(0x1ca)]('\x0a'+a30_0x2ac4a6[_0x2e615e(0x194)](_0x2e615e(0x1b4))+'\x20'+a30_0x2ac4a6['dim']('('+_0x577998+')'));for(const _0x1249f2 of _0x3fed77[_0x2e615e(0x151)]){const _0x29cdd1=_0x1249f2[_0x2e615e(0x1ce)]?a30_0x2ac4a6[_0x2e615e(0x15b)]('✔'):a30_0x2ac4a6[_0x2e615e(0x200)]('✘');let _0x50a96d='';if(_0x1249f2[_0x2e615e(0x1ce)]&&_0x1249f2[_0x2e615e(0x16d)]!==undefined&&_0x1249f2[_0x2e615e(0x240)]!==undefined){const _0x11737b=_0x1249f2[_0x2e615e(0x155)]?.[_0x2e615e(0x1bd)](0x1)||'?',_0x4c75b4=(_0x1249f2[_0x2e615e(0x155)]??0x0)>=0x32?a30_0x2ac4a6[_0x2e615e(0x15b)]:(_0x1249f2[_0x2e615e(0x155)]??0x0)>=0x14?a30_0x2ac4a6[_0x2e615e(0x1e4)]:a30_0x2ac4a6['red'];_0x50a96d='\x20'+a30_0x2ac4a6[_0x2e615e(0x194)]('Customers:')+'\x20'+_0x4c75b4(formatRows(_0x1249f2['customersWithEvents']))+'\x20('+_0x11737b+_0x2e615e(0x1c6)+a30_0x2ac4a6['dim'](_0x2e615e(0x218))+'\x20'+a30_0x2ac4a6[_0x2e615e(0x1f4)](formatRows(_0x1249f2[_0x2e615e(0x240)]));}console['error'](_0x29cdd1+'\x20'+a30_0x2ac4a6[_0x2e615e(0x1b8)](_0x1249f2[_0x2e615e(0x216)])+_0x50a96d),console[_0x2e615e(0x1ca)]('\x20\x20'+a30_0x2ac4a6[_0x2e615e(0x194)](_0x2e615e(0x1b1))+'\x20'+a30_0x2ac4a6[_0x2e615e(0x1b8)](_0x1249f2[_0x2e615e(0x233)]+'.'+_0x1249f2[_0x2e615e(0x296)]));const _0x143a6a=_0x1249f2[_0x2e615e(0x260)]===_0x1249f2[_0x2e615e(0x29b)]?a30_0x2ac4a6[_0x2e615e(0x194)](_0x2e615e(0x175))+'\x20'+_0x1249f2['joinKey']:a30_0x2ac4a6[_0x2e615e(0x194)](_0x2e615e(0x217))+'\x20'+_0x1249f2[_0x2e615e(0x260)]+_0x2e615e(0x158)+_0x1249f2[_0x2e615e(0x29b)];console[_0x2e615e(0x1ca)]('\x20\x20'+_0x143a6a),console['error']('\x20\x20'+a30_0x2ac4a6[_0x2e615e(0x194)](_0x2e615e(0x1dd))),this[_0x2e615e(0x23b)](_0x1249f2[_0x2e615e(0x1ab)]),!_0x1249f2[_0x2e615e(0x1ce)]&&console['error']('\x20\x20'+a30_0x2ac4a6[_0x2e615e(0x200)](_0x2e615e(0x1b9))+'\x20'+_0x1249f2[_0x2e615e(0x28c)]);}}[a30_0x1c117e(0x23b)](_0x41c820){const _0x1baae0=a30_0x1c117e;for(const _0x583ae0 of _0x41c820){_0x583ae0[_0x1baae0(0x29e)]===_0x583ae0['column']||_0x583ae0[_0x1baae0(0x25e)]==='*'?console['error']('\x20\x20\x20\x20-\x20'+_0x583ae0[_0x1baae0(0x29e)]):console[_0x1baae0(0x1ca)]('\x20\x20\x20\x20-\x20'+_0x583ae0[_0x1baae0(0x29e)]+'\x20'+a30_0x2ac4a6[_0x1baae0(0x194)]('('+_0x583ae0['column']+')'));}}['displaySummary'](_0x3206d8){const _0x1559f3=a30_0x1c117e;console[_0x1559f3(0x1ca)]('─'[_0x1559f3(0x18b)](0x3c));if(_0x3206d8[_0x1559f3(0x11d)][_0x1559f3(0x2a2)]>0x0){console[_0x1559f3(0x1ca)]('\x0a'+a30_0x2ac4a6['red'](_0x1559f3(0x226)));for(const _0x1537d6 of _0x3206d8[_0x1559f3(0x11d)]){console[_0x1559f3(0x1ca)]('\x20\x20'+a30_0x2ac4a6[_0x1559f3(0x200)]('•')+'\x20'+_0x1537d6);}}_0x3206d8[_0x1559f3(0x16b)]&&console[_0x1559f3(0x1ca)]('\x0a'+a30_0x2ac4a6[_0x1559f3(0x15b)]('✔')+_0x1559f3(0x1df));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a30_0x1c117e(0x216)]=a30_0x1c117e(0x1b2);[a30_0x1c117e(0x18c)]=a30_0x1c117e(0x275);async[a30_0x1c117e(0x1d7)](_0x36ce5b){const _0x59ce07=a30_0x1c117e,{options:_0x433dad,args:_0x37ebb9,tdx:_0x354af1}=_0x36ce5b,_0x13290a=_0x433dad,_0x6d17ef=_0x37ebb9[0x0]||_0x433dad[_0x59ce07(0x250)];if(!_0x6d17ef)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a'+_0x59ce07(0x271)+'Options\x20(one\x20required):\x0a'+_0x59ce07(0x1b3)+_0x59ce07(0x146)+_0x59ce07(0x19f)+_0x59ce07(0x263)+_0x59ce07(0x11e)),0x1;if(!_0x13290a[_0x59ce07(0x210)]&&!_0x13290a['attribute']&&!_0x13290a[_0x59ce07(0x1db)]&&!_0x13290a['enriched'])return console[_0x59ce07(0x1ca)](a30_0x2ac4a6[_0x59ce07(0x200)](_0x59ce07(0x289))),console['error'](_0x59ce07(0x187)),console[_0x59ce07(0x1ca)](_0x59ce07(0x1d4)),console[_0x59ce07(0x1ca)]('\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data'),console['error'](_0x59ce07(0x1d0)),console[_0x59ce07(0x1ca)](_0x59ce07(0x170)),console[_0x59ce07(0x1ca)](_0x59ce07(0x12d)),0x1;const _0x38a32b=resolveYamlFile(_0x6d17ef);if(!existsSync(_0x38a32b))return showFileNotFoundError(_0x38a32b,_0x6d17ef),0x1;_0x13290a[_0x59ce07(0x279)]&&(console[_0x59ce07(0x1ca)](_0x59ce07(0x14b)+_0x13290a[_0x59ce07(0x22a)]),console[_0x59ce07(0x1ca)](_0x59ce07(0x24c)+_0x38a32b));let _0x474990;try{_0x474990=readFileSync(_0x38a32b,_0x59ce07(0x15c));}catch(_0x5b1e8c){const _0x2445c8=_0x5b1e8c instanceof Error?_0x5b1e8c[_0x59ce07(0x168)]:String(_0x5b1e8c);return console['error']('Error\x20reading\x20file:\x20'+_0x2445c8),0x1;}let _0x2253ed;try{_0x2253ed=parseDef(_0x474990);}catch(_0xf36718){const _0x4d2294=_0xf36718 instanceof Error?_0xf36718[_0x59ce07(0x168)]:String(_0xf36718);return console[_0x59ce07(0x1ca)](a30_0x2ac4a6[_0x59ce07(0x200)]('Error\x20parsing\x20YAML:\x20'+_0x4d2294)),0x1;}if(_0x13290a[_0x59ce07(0x1a5)]===!![]||_0x13290a[_0x59ce07(0x1a5)]===''){const _0x5dce93=_0x2253ed[_0x59ce07(0x120)]?.[_0x59ce07(0x176)](_0x334734=>_0x334734['name'])||[];if(_0x5dce93[_0x59ce07(0x2a2)]===0x0)console[_0x59ce07(0x1ca)](a30_0x2ac4a6[_0x59ce07(0x200)]('Error:\x20No\x20attributes\x20defined\x20in\x20configuration'));else{console[_0x59ce07(0x1ca)](a30_0x2ac4a6[_0x59ce07(0x200)](_0x59ce07(0x268))),console[_0x59ce07(0x1ca)]('Available\x20attributes:');for(const _0x54f557 of _0x5dce93){console[_0x59ce07(0x1ca)]('\x20\x20'+a30_0x2ac4a6[_0x59ce07(0x1f4)](_0x54f557));}console[_0x59ce07(0x1ca)](_0x59ce07(0x150)+_0x6d17ef+_0x59ce07(0x2af)+_0x5dce93[0x0]+'\x22');}return 0x1;}if(_0x13290a[_0x59ce07(0x1db)]===!![]||_0x13290a[_0x59ce07(0x1db)]===''){const _0x2d011a=_0x2253ed['behaviors']?.['map'](_0x109761=>_0x109761[_0x59ce07(0x216)])||[];if(_0x2d011a[_0x59ce07(0x2a2)]===0x0)console['error'](a30_0x2ac4a6[_0x59ce07(0x200)](_0x59ce07(0x133)));else{console['error'](a30_0x2ac4a6[_0x59ce07(0x200)](_0x59ce07(0x138))),console['error'](_0x59ce07(0x20f));for(const _0x47076b of _0x2d011a){console[_0x59ce07(0x1ca)]('\x20\x20'+a30_0x2ac4a6[_0x59ce07(0x1f4)](_0x47076b));}console['error'](_0x59ce07(0x150)+_0x6d17ef+_0x59ce07(0x182)+_0x2d011a[0x0]+'\x22');}return 0x1;}const _0x487c52=createCommandSpinner(a30_0x2ac4a6['dim'](_0x59ce07(0x18f)),{'verbose':_0x13290a[_0x59ce07(0x279)]});_0x487c52[_0x59ce07(0x26c)]();const _0x22c849={'onProgress':_0x422924=>{const _0x1fdc6c=_0x59ce07;_0x487c52[_0x1fdc6c(0x15d)]=formatProgressMessage(_0x422924);}};if(_0x13290a[_0x59ce07(0x210)])_0x22c849[_0x59ce07(0x210)]=!![];if(_0x13290a[_0x59ce07(0x1a5)]&&typeof _0x13290a[_0x59ce07(0x1a5)]==='string')_0x22c849[_0x59ce07(0x1a5)]=_0x13290a[_0x59ce07(0x1a5)];if(_0x13290a[_0x59ce07(0x1db)]&&typeof _0x13290a['behavior']==='string')_0x22c849[_0x59ce07(0x1db)]=_0x13290a[_0x59ce07(0x1db)];if(_0x13290a[_0x59ce07(0x16c)])_0x22c849[_0x59ce07(0x16c)]=!![];if(_0x13290a[_0x59ce07(0x229)])_0x22c849[_0x59ce07(0x229)]=_0x13290a[_0x59ce07(0x229)];let _0x5ba8f1;try{_0x5ba8f1=await _0x354af1['segment'][_0x59ce07(0x267)](_0x474990,_0x22c849),_0x487c52[_0x59ce07(0x27f)]();}catch(_0x44671c){_0x487c52['stop']();throw _0x44671c;}return await this['displayPreviewResults'](_0x5ba8f1,{'master':_0x13290a[_0x59ce07(0x210)],'attribute':typeof _0x13290a[_0x59ce07(0x1a5)]===_0x59ce07(0x29a)?_0x13290a['attribute']:undefined,'behavior':typeof _0x13290a[_0x59ce07(0x1db)]===_0x59ce07(0x29a)?_0x13290a['behavior']:undefined,'enriched':_0x13290a[_0x59ce07(0x16c)]}),_0x5ba8f1[_0x59ce07(0x16b)]?0x0:0x1;}async[a30_0x1c117e(0x14f)](_0x41a14c,_0x563c2c){const _0x52b1b5=a30_0x1c117e;console[_0x52b1b5(0x1ca)]('\x0a'+a30_0x2ac4a6[_0x52b1b5(0x1b8)](_0x52b1b5(0x202))+'\x20'+_0x41a14c[_0x52b1b5(0x216)]),console[_0x52b1b5(0x1ca)]('═'[_0x52b1b5(0x18b)](0x3c));if(_0x563c2c[_0x52b1b5(0x210)]&&_0x41a14c[_0x52b1b5(0x141)]){const _0x5d0192=a30_0x2ac4a6[_0x52b1b5(0x194)](_0x52b1b5(0x1d9))+'\x20'+a30_0x2ac4a6[_0x52b1b5(0x1b8)](_0x41a14c['master'][_0x52b1b5(0x233)]+'.'+_0x41a14c[_0x52b1b5(0x210)]['table']);await this[_0x52b1b5(0x22c)](_0x5d0192,_0x41a14c[_0x52b1b5(0x141)]);}else{if(_0x563c2c['attribute']&&_0x41a14c['sampleData']){const _0x1e4f3b=a30_0x2ac4a6[_0x52b1b5(0x194)](_0x52b1b5(0x1a3))+'\x20'+a30_0x2ac4a6[_0x52b1b5(0x1b8)](_0x563c2c['attribute']);await this['displaySampleData'](_0x1e4f3b,_0x41a14c[_0x52b1b5(0x141)]);}else{if(_0x563c2c[_0x52b1b5(0x1db)]&&_0x41a14c['sampleData']){const _0x5f1cfb=a30_0x2ac4a6[_0x52b1b5(0x194)](_0x52b1b5(0x12a))+'\x20'+a30_0x2ac4a6[_0x52b1b5(0x1b8)](_0x563c2c['behavior']);await this[_0x52b1b5(0x22c)](_0x5f1cfb,_0x41a14c[_0x52b1b5(0x141)]);}else{if(_0x563c2c[_0x52b1b5(0x16c)]&&_0x41a14c[_0x52b1b5(0x141)]){const _0x5c919d=a30_0x2ac4a6[_0x52b1b5(0x194)]('Enriched:')+'\x20'+a30_0x2ac4a6['bold']('Master\x20+\x20Attributes');await this[_0x52b1b5(0x22c)](_0x5c919d,_0x41a14c[_0x52b1b5(0x141)]);}else!_0x41a14c[_0x52b1b5(0x141)]&&console['error'](_0x52b1b5(0x258));}}}if(_0x41a14c[_0x52b1b5(0x11d)][_0x52b1b5(0x2a2)]>0x0){console[_0x52b1b5(0x1ca)]('─'['repeat'](0x3c)),console[_0x52b1b5(0x1ca)]('\x0a'+a30_0x2ac4a6[_0x52b1b5(0x200)](_0x52b1b5(0x226)));for(const _0x4175be of _0x41a14c[_0x52b1b5(0x11d)]){console[_0x52b1b5(0x1ca)]('\x20\x20'+a30_0x2ac4a6[_0x52b1b5(0x200)]('•')+'\x20'+_0x4175be);}}}async[a30_0x1c117e(0x22c)](_0x102b60,_0x47cbf9){const _0x96c92c=a30_0x1c117e;if(_0x47cbf9[_0x96c92c(0x2a2)]===0x0){console['error']('\x0a'+_0x102b60),console['error']('\x20\x20No\x20sample\x20data\x20available');return;}console[_0x96c92c(0x1ca)]('\x0a'+_0x102b60);const _0x5ccadd=Object[_0x96c92c(0x1d2)](_0x47cbf9[0x0])[_0x96c92c(0x176)](_0x40f5a6=>({'name':_0x40f5a6,'type':typeof _0x47cbf9[0x0][_0x40f5a6]===_0x96c92c(0x299)?_0x96c92c(0x17f):'varchar'})),_0x5233d0={'queryId':_0x96c92c(0x230),'columns':_0x5ccadd,'data':_0x47cbf9,'stats':{'state':_0x96c92c(0x130),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x47cbf9[_0x96c92c(0x2a2)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x11b7a2=formatAsTable(_0x5233d0,_0x47cbf9[_0x96c92c(0x2a2)],!![]);await writeOutput(_0x11b7a2,undefined,_0x96c92c(0x296));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{['name']=a30_0x1c117e(0x1af);[a30_0x1c117e(0x18c)]=a30_0x1c117e(0x1e5);async[a30_0x1c117e(0x1d7)](_0x2be449){const _0x16337f=a30_0x1c117e,{options:_0x4ce94e,args:_0x12eed6,tdx:_0x3ecf4d}=_0x2be449,_0x6a08b3=_0x4ce94e,_0xe7903c=_0x12eed6[0x0]||_0x4ce94e['parentSegment'];if(!_0xe7903c)return showParentSegmentNotSetError(_0x16337f(0x225)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment'),0x1;const _0x49a9e2=resolveYamlFile(_0xe7903c);if(existsSync(_0x49a9e2)){_0x6a08b3['verbose']&&console['error'](_0x16337f(0x1e2)+_0x49a9e2);let _0x18046a;try{_0x18046a=readFileSync(_0x49a9e2,_0x16337f(0x15c));}catch(_0x5d6dbc){const _0x34c832=_0x5d6dbc instanceof Error?_0x5d6dbc[_0x16337f(0x168)]:String(_0x5d6dbc);return console['error'](_0x16337f(0x142)+_0x34c832),0x1;}const _0x39ce6d=await withSpinner(_0x16337f(0x160),()=>_0x3ecf4d[_0x16337f(0x1ef)][_0x16337f(0x1a9)](_0x18046a),{'verbose':_0x6a08b3[_0x16337f(0x279)]}),_0x4c90b7=_0x39ce6d[_0x16337f(0x215)],{isNew:_0x17fd16,name:_0x298bf0,hasChanges:_0x57932d,diffFormatted:_0x5ccb51}=_0x4c90b7;if(_0x57932d){_0x17fd16?console[_0x16337f(0x1ca)](_0x16337f(0x1d6)+_0x298bf0+'\x27:'):console[_0x16337f(0x1ca)](_0x16337f(0x211)+_0x298bf0+'\x27:');console['error']('─'[_0x16337f(0x18b)](0x3c)),console[_0x16337f(0x1ca)](_0x5ccb51),console[_0x16337f(0x1ca)]('─'[_0x16337f(0x18b)](0x3c));const _0x4745e6=_0x17fd16?_0x16337f(0x1ed)+_0x298bf0+_0x16337f(0x174):_0x16337f(0x24a)+_0x298bf0+'\x27\x20and\x20run\x20workflow?';if(!_0x6a08b3[_0x16337f(0x22e)]){if(!isInteractive())return console[_0x16337f(0x1ca)](a30_0x2ac4a6[_0x16337f(0x200)](_0x16337f(0x237)),_0x16337f(0x26f)),console[_0x16337f(0x1ca)](a30_0x2ac4a6['dim'](_0x16337f(0x249))),0x1;const _0x303a80=await confirmKey(_0x4745e6);if(!_0x303a80)return console[_0x16337f(0x1ca)](a30_0x2ac4a6[_0x16337f(0x1e4)](_0x16337f(0x1c2))),0x1;}const _0x41493d=_0x17fd16?_0x16337f(0x13c):'Updating';await withSpinner(_0x41493d+'\x20parent\x20segment\x20\x27'+_0x298bf0+_0x16337f(0x1eb),()=>_0x4c90b7[_0x16337f(0x177)](),{'verbose':_0x6a08b3[_0x16337f(0x279)]});const _0x32ce39=_0x17fd16?_0x16337f(0x29c):_0x16337f(0x22d);console[_0x16337f(0x1ca)]('✔\x20'+_0x32ce39+'\x20parent\x20segment\x20\x27'+_0x298bf0+'\x27');}else console[_0x16337f(0x1ca)](_0x16337f(0x167)+_0x298bf0+'\x27\x20is\x20up\x20to\x20date');}const _0x49c6b8=await withSpinner('Running\x20parent\x20segment\x20workflow\x20for\x20\x27'+_0xe7903c+_0x16337f(0x1eb),()=>_0x3ecf4d[_0x16337f(0x1ef)][_0x16337f(0x21d)](_0xe7903c),{'verbose':_0x6a08b3[_0x16337f(0x279)]}),_0x5af587=_0x49c6b8[_0x16337f(0x215)],_0x9e98ac=getConsoleUrl(_0x6a08b3[_0x16337f(0x22a)],_0x16337f(0x12e)+_0x5af587[_0x16337f(0x191)]+_0x16337f(0x2a8)+_0x5af587[_0x16337f(0x1a8)]+_0x16337f(0x207)+_0x5af587['workflowAttemptId']);return console['error']('\x0a✔\x20Workflow\x20started'),console[_0x16337f(0x1ca)]('\x20\x20'+a30_0x2ac4a6[_0x16337f(0x194)](_0x16337f(0x2ab))+'\x20'+_0x5af587[_0x16337f(0x259)]),console[_0x16337f(0x1ca)]('\x20\x20'+a30_0x2ac4a6[_0x16337f(0x194)](_0x16337f(0x16f))+'\x20'+_0x5af587['status']),console['error']('\x20\x20'+a30_0x2ac4a6[_0x16337f(0x194)](_0x16337f(0x209))+'\x20'+_0x5af587[_0x16337f(0x1a8)]),console[_0x16337f(0x1ca)]('\x20\x20'+a30_0x2ac4a6[_0x16337f(0x194)](_0x16337f(0x1e7))+'\x20'+_0x5af587[_0x16337f(0x25f)]),console['error']('\x20\x20'+_0x9e98ac),console['error']('\x0a'+a30_0x2ac4a6[_0x16337f(0x194)](_0x16337f(0x1d1))+_0x16337f(0x122)+_0x5af587[_0x16337f(0x25f)]+_0x16337f(0x27b)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a30_0x1c117e(0x216)]='segment:parent:fields';[a30_0x1c117e(0x18c)]=a30_0x1c117e(0x26d);async[a30_0x1c117e(0x1d7)](_0x21ca97){const _0x617bce=a30_0x1c117e,{options:_0xe4f68d,args:_0x2ed864,tdx:_0x14d6e1}=_0x21ca97,_0x3a5d64=_0x2ed864[0x0]||_0xe4f68d[_0x617bce(0x250)];if(!_0x3a5d64)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment'),0x1;_0xe4f68d['verbose']&&(console[_0x617bce(0x1ca)](_0x617bce(0x14b)+_0xe4f68d[_0x617bce(0x22a)]),console[_0x617bce(0x1ca)]('Parent\x20segment:\x20'+_0x3a5d64));const _0x57d912=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x3a5d64+_0x617bce(0x1eb),()=>_0x14d6e1[_0x617bce(0x1ef)][_0x617bce(0x281)](_0x3a5d64),{'verbose':_0xe4f68d[_0x617bce(0x279)]}),_0x54263f=_0x57d912[_0x617bce(0x215)];console[_0x617bce(0x1ca)]('✔\x20Found\x20'+_0x54263f[_0x617bce(0x2a2)]+'\x20field'+(_0x54263f[_0x617bce(0x2a2)]!==0x1?'s':''));if(_0xe4f68d['json']||_0xe4f68d[_0x617bce(0x27e)])return await handleSDKOutput(_0x54263f,_0xe4f68d),0x0;return displayFieldsHumanReadable(_0x54263f,_0x3a5d64),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a30_0x1c117e(0x216)]='segment:parent:view';['description']=a30_0x1c117e(0x2a0);async['execute'](_0xe41aff){const _0x510e48=a30_0x1c117e,{options:_0x22fd4c,args:_0x4d0417,tdx:_0x164859}=_0xe41aff,_0x106cd7=_0x22fd4c,_0x16937d=_0x4d0417[0x0]||_0x22fd4c[_0x510e48(0x250)];if(!_0x16937d)return showParentSegmentNotSetError(_0x510e48(0x1e3)+_0x510e48(0x265)+_0x510e48(0x178)+_0x510e48(0x28e)),0x1;_0x22fd4c[_0x510e48(0x279)]&&(console[_0x510e48(0x1ca)]('Site:\x20'+_0x22fd4c[_0x510e48(0x22a)]),console[_0x510e48(0x1ca)](_0x510e48(0x180)+_0x16937d));const _0x548533=await withSpinner(_0x510e48(0x270)+_0x16937d+_0x510e48(0x1eb),()=>_0x164859[_0x510e48(0x1ef)][_0x510e48(0x20a)](_0x16937d),{'verbose':_0x22fd4c[_0x510e48(0x279)]}),_0x597bf5=_0x548533['data'];if(_0x106cd7[_0x510e48(0x212)]){const _0x33352e=getConsoleNextUrl(_0x106cd7[_0x510e48(0x22a)],_0x510e48(0x15e)+_0x597bf5['id']);return console[_0x510e48(0x1ca)](a30_0x2ac4a6[_0x510e48(0x15b)]('✔')+_0x510e48(0x1cd)+a30_0x2ac4a6[_0x510e48(0x1f4)](_0x33352e)),openBrowser(_0x33352e),0x0;}return await handleSingleObjectOutput(_0x597bf5,_0x22fd4c),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a30_0x1c117e(0x216)]=a30_0x1c117e(0x17b);[a30_0x1c117e(0x18c)]=a30_0x1c117e(0x1c1);async['execute'](_0x797cd7){const _0x195e69=a30_0x1c117e,{options:_0x5e603d,args:_0x40b94,tdx:_0x22ece1}=_0x797cd7,_0x416156=_0x5e603d,_0x4fc75a=_0x40b94[0x0]||_0x5e603d[_0x195e69(0x250)];if(!_0x4fc75a)return showParentSegmentNotSetError(_0x195e69(0x17e)+_0x195e69(0x198)+_0x195e69(0x178)+'\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path'),0x1;_0x5e603d[_0x195e69(0x279)]&&(console['error'](_0x195e69(0x14b)+_0x5e603d[_0x195e69(0x22a)]),console[_0x195e69(0x1ca)]('Parent\x20segment:\x20'+_0x4fc75a));const _0x397297=await withSpinner(_0x195e69(0x19e)+_0x4fc75a+_0x195e69(0x1eb),()=>_0x22ece1['segment'][_0x195e69(0x19d)](_0x4fc75a),{'verbose':_0x5e603d['verbose']}),_0x3c55e1=_0x397297[_0x195e69(0x215)],_0x4e7091=_0x22ece1[_0x195e69(0x1ef)][_0x195e69(0x261)](_0x3c55e1);if(_0x416156['output']){const _0x5af9ed=await this['collectSchema'](_0x797cd7,_0x4fc75a,_0x3c55e1,_0x4e7091),_0x38bdb9=this[_0x195e69(0x282)](_0x5af9ed);writeFileSync(_0x416156[_0x195e69(0x213)],_0x38bdb9);const _0x5e8509=_0x5af9ed[_0x195e69(0x181)][_0x195e69(0x1ab)][_0x195e69(0x2a2)]+_0x5af9ed[_0x195e69(0x151)]['reduce']((_0x32a598,_0x380196)=>_0x32a598+_0x380196[_0x195e69(0x1ab)][_0x195e69(0x2a2)],0x0),_0x4ad6e3=_0x5af9ed[_0x195e69(0x151)][_0x195e69(0x287)](_0x6dd7f0=>_0x6dd7f0[_0x195e69(0x1ab)][_0x195e69(0x2a2)]===0x0)['length'];return console[_0x195e69(0x149)](_0x195e69(0x20b)+_0x416156[_0x195e69(0x213)]),console[_0x195e69(0x149)](_0x195e69(0x23f)+_0x4e7091),console[_0x195e69(0x149)](_0x195e69(0x17a)+_0x5af9ed[_0x195e69(0x151)][_0x195e69(0x2a2)]+_0x195e69(0x1e1)),console['log'](_0x195e69(0x166)+_0x5e8509+_0x195e69(0x223)),_0x4ad6e3>0x0&&console[_0x195e69(0x149)](_0x195e69(0x127)+_0x4ad6e3+_0x195e69(0x1bc)),0x0;}console['error']('\x0a'+a30_0x2ac4a6[_0x195e69(0x1b8)](_0x195e69(0x1a0))+'\x20'+a30_0x2ac4a6[_0x195e69(0x1f4)](_0x4e7091));const _0x4519ca=await withSpinner(_0x195e69(0x186),()=>_0x22ece1[_0x195e69(0x1ef)][_0x195e69(0x189)](_0x3c55e1),{'verbose':_0x5e603d[_0x195e69(0x279)]});console[_0x195e69(0x1ca)]('\x0a'+a30_0x2ac4a6[_0x195e69(0x1b8)](_0x195e69(0x181))+'\x20'+a30_0x2ac4a6[_0x195e69(0x194)]('('+_0x4e7091+_0x195e69(0x121)));const _0x3166a8=await executeSchemaQuery(_0x4519ca[_0x195e69(0x215)],_0x22ece1,_0x5e603d);await handleQueryOutput(_0x3166a8,_0x5e603d);const _0x4235ad=await withSpinner('Fetching\x20behavior\x20list...',()=>_0x22ece1[_0x195e69(0x1ef)][_0x195e69(0x12f)](_0x3c55e1),{'verbose':_0x5e603d[_0x195e69(0x279)]});for(const _0x3c2828 of _0x4235ad[_0x195e69(0x215)]){const _0x39fa75=_0x195e69(0x1c7)+_0x3c2828['toLowerCase']()[_0x195e69(0x204)](/\s+/g,'_'),_0x4d7dad='SELECT\x20*\x20FROM\x20'+_0x4e7091+'.'+_0x39fa75;console[_0x195e69(0x1ca)]('\x0a'+a30_0x2ac4a6['bold'](_0x3c2828)+'\x20'+a30_0x2ac4a6[_0x195e69(0x194)]('('+_0x4e7091+'.'+_0x39fa75+')'));try{const _0x3248d=await executeSchemaQuery(_0x4d7dad,_0x22ece1,_0x5e603d);await handleQueryOutput(_0x3248d,_0x5e603d);}catch{console[_0x195e69(0x1ca)](a30_0x2ac4a6[_0x195e69(0x1e4)](_0x195e69(0x24f)));}}return 0x0;}async[a30_0x1c117e(0x137)](_0x187f12,_0xe66b28,_0x4309d1,_0x20cd42){const _0x1e8b50=a30_0x1c117e,{options:_0x3e01f7,tdx:_0x2fa52a}=_0x187f12,_0x4cf86c=await withSpinner('Fetching\x20customers\x20schema...',()=>_0x2fa52a[_0x1e8b50(0x1ef)]['getParentSQL'](_0x4309d1),{'verbose':_0x3e01f7[_0x1e8b50(0x279)]}),_0x232f48=await executeSchemaQuery(_0x4cf86c[_0x1e8b50(0x215)],_0x2fa52a,_0x3e01f7),_0x4a191a=_0x232f48[_0x1e8b50(0x215)][_0x1e8b50(0x176)](_0x27827c=>({'name':_0x27827c[_0x1e8b50(0x1c4)],'type':_0x27827c['column_type']})),_0x4dc358=await withSpinner(_0x1e8b50(0x256),()=>_0x2fa52a[_0x1e8b50(0x1ef)]['getBehaviorNames'](_0x4309d1),{'verbose':_0x3e01f7[_0x1e8b50(0x279)]}),_0x56bf8a=[];for(const _0x46f973 of _0x4dc358[_0x1e8b50(0x215)]){const _0x32063d='behavior_'+_0x46f973[_0x1e8b50(0x285)]()[_0x1e8b50(0x204)](/\s+/g,'_'),_0x23ee58='SELECT\x20*\x20FROM\x20'+_0x20cd42+'.'+_0x32063d;let _0x99076=[];try{const _0x480531=await executeSchemaQuery(_0x23ee58,_0x2fa52a,_0x3e01f7);_0x99076=_0x480531[_0x1e8b50(0x215)][_0x1e8b50(0x176)](_0x1c5c8d=>({'name':_0x1c5c8d[_0x1e8b50(0x1c4)],'type':_0x1c5c8d[_0x1e8b50(0x1c5)]}));}catch{}_0x56bf8a[_0x1e8b50(0x1bf)]({'table':_0x32063d,'columns':_0x99076});}return{'database':_0x20cd42,'parent_segment':_0xe66b28,'parent_id':_0x4309d1,'customers':{'table':_0x1e8b50(0x181),'columns':_0x4a191a},'behaviors':_0x56bf8a};}[a30_0x1c117e(0x282)](_0x99ddbb){const _0x495e9a=a30_0x1c117e,_0xbbe50f=_0x5425d4=>{const _0x4c9b20=a30_0x30b0;if(_0x5425d4[_0x4c9b20(0x2a2)]===0x0)return'[]';const _0x36e520=_0x5425d4[_0x4c9b20(0x176)](_0x458705=>_0x4c9b20(0x1ee)+_0x458705[_0x4c9b20(0x216)]+'\x22,\x20\x22type\x22:\x20\x22'+_0x458705['type']+_0x4c9b20(0x13e));return'[\x0a'+_0x36e520[_0x4c9b20(0x286)](',\x0a')+_0x4c9b20(0x1f9);},_0x1e9b0a=_0x99ddbb[_0x495e9a(0x151)][_0x495e9a(0x176)](_0x3cf8d7=>{const _0x5ee51e=_0x495e9a;return _0x5ee51e(0x1a1)+_0x3cf8d7[_0x5ee51e(0x296)]+_0x5ee51e(0x28a)+_0xbbe50f(_0x3cf8d7[_0x5ee51e(0x1ab)])[_0x5ee51e(0x204)](/^/gm,'\x20\x20')[_0x5ee51e(0x294)]()+_0x5ee51e(0x262);})[_0x495e9a(0x286)](',\x0a');return _0x495e9a(0x284)+_0x99ddbb['database']+_0x495e9a(0x228)+_0x99ddbb[_0x495e9a(0x291)]+'\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22'+_0x99ddbb['parent_id']+_0x495e9a(0x231)+_0x99ddbb[_0x495e9a(0x181)][_0x495e9a(0x296)]+_0x495e9a(0x13d)+_0xbbe50f(_0x99ddbb['customers'][_0x495e9a(0x1ab)])[_0x495e9a(0x204)](/^/gm,'\x20\x20')['trim']()+'\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a'+_0x1e9b0a+_0x495e9a(0x183);}}export class ParentSegmentSQLCommand extends BaseCommand{['name']=a30_0x1c117e(0x293);['description']=a30_0x1c117e(0x1cb);async[a30_0x1c117e(0x1d7)](_0x4109cf){const _0x9657=a30_0x1c117e,{options:_0x25a851,args:_0x22563a,tdx:_0x14dda7}=_0x4109cf,_0x52a236=_0x22563a[0x0]||_0x25a851[_0x9657(0x250)];if(!_0x52a236)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a'+_0x9657(0x144)),0x1;_0x25a851[_0x9657(0x279)]&&(console[_0x9657(0x1ca)]('Site:\x20'+_0x25a851[_0x9657(0x22a)]),console[_0x9657(0x1ca)]('Parent\x20segment:\x20'+_0x52a236));const _0x1a4713=await withSpinner(_0x9657(0x19e)+_0x52a236+_0x9657(0x1eb),()=>_0x14dda7[_0x9657(0x1ef)]['resolveParentId'](_0x52a236),{'verbose':_0x25a851[_0x9657(0x279)]}),_0xdc9b72=_0x1a4713['data'],_0x556500=await withSpinner(_0x9657(0x1ff)+_0x52a236+_0x9657(0x1eb),()=>_0x14dda7[_0x9657(0x1ef)][_0x9657(0x189)](_0xdc9b72),{'verbose':_0x25a851[_0x9657(0x279)]}),_0x412ff3=_0x556500[_0x9657(0x215)];return _0x25a851[_0x9657(0x253)]===_0x9657(0x295)||_0x25a851[_0x9657(0x253)]===_0x9657(0x27e)?await handleSDKOutput([{'sql':_0x412ff3}],_0x25a851):console[_0x9657(0x149)](_0x412ff3),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{['name']=a30_0x1c117e(0x17c);[a30_0x1c117e(0x18c)]='Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results';async[a30_0x1c117e(0x1d7)](_0x812ac6){const _0x3d5be4=a30_0x1c117e,{options:_0x36bc08,args:_0x3f05df,tdx:_0x2aced0}=_0x812ac6,_0x1752f7=_0x3f05df[0x0]||_0x36bc08[_0x3d5be4(0x250)];if(!_0x1752f7)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a'+_0x3d5be4(0x129)),0x1;_0x36bc08[_0x3d5be4(0x279)]&&(console['error'](_0x3d5be4(0x14b)+_0x36bc08[_0x3d5be4(0x22a)]),console[_0x3d5be4(0x1ca)](_0x3d5be4(0x180)+_0x1752f7));const _0x4fed42=await withSpinner(_0x3d5be4(0x19e)+_0x1752f7+_0x3d5be4(0x1eb),()=>_0x2aced0[_0x3d5be4(0x1ef)][_0x3d5be4(0x19d)](_0x1752f7),{'verbose':_0x36bc08[_0x3d5be4(0x279)]}),_0x52c6a8=_0x4fed42[_0x3d5be4(0x215)],_0x5a3948=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x1752f7+'\x27...',()=>_0x2aced0[_0x3d5be4(0x1ef)][_0x3d5be4(0x189)](_0x52c6a8),{'verbose':_0x36bc08['verbose']});let _0x5d962f=_0x5a3948[_0x3d5be4(0x215)];const _0x27298d=resolveLimit(_0x36bc08[_0x3d5be4(0x1c9)],DEFAULT_DISPLAY_LIMIT),_0xa18436=/\bLIMIT\s+\d+/i['test'](_0x5d962f);!_0xa18436&&(_0x5d962f=_0x5d962f[_0x3d5be4(0x294)]()[_0x3d5be4(0x204)](/;+$/,''),_0x5d962f=_0x3d5be4(0x21b)+_0x5d962f+_0x3d5be4(0x29f)+_0x27298d);_0x36bc08[_0x3d5be4(0x279)]&&console[_0x3d5be4(0x1ca)](_0x3d5be4(0x28b)+_0x5d962f);const _0x9d254d=await withProgressSpinner('Executing\x20parent\x20segment\x20query...',async _0x471b41=>{const _0x22c5bc=_0x3d5be4,_0x49ace6=await _0x2aced0[_0x22c5bc(0x179)][_0x22c5bc(0x1d7)](_0x5d962f,{'catalog':'td','schema':_0x22c5bc(0x1e6),'onJobId':_0x1868d9=>{const _0x598a45=_0x22c5bc;_0x471b41[_0x598a45(0x11f)](_0x1868d9);}});return _0x49ace6;},{'verbose':_0x36bc08['verbose']}),_0x185cbe=_0x9d254d[_0x3d5be4(0x215)],_0x32c230=_0x185cbe[_0x3d5be4(0x276)]?_0x3d5be4(0x16e)+_0x185cbe[_0x3d5be4(0x276)]+']':'';return console['error'](_0x3d5be4(0x272)+_0x185cbe['stats'][_0x3d5be4(0x21a)][_0x3d5be4(0x1f6)]()+_0x3d5be4(0x23c)+(_0x3d5be4(0x192)+formatElapsed(_0x185cbe['stats'][_0x3d5be4(0x21f)])+_0x32c230)),await handleQueryOutput(_0x185cbe,_0x36bc08),0x0;}}export class PSRtListCommand extends BaseCommand{[a30_0x1c117e(0x216)]=a30_0x1c117e(0x220);[a30_0x1c117e(0x18c)]='List\x20parent\x20segments\x20with\x20RT\x202.0\x20status';async['execute'](_0x1247b1){const _0x2bfeef=a30_0x1c117e,{options:_0x41ad2d,args:_0x92c76c,tdx:_0x1e5cc1}=_0x1247b1,_0x16f27d=_0x92c76c[0x0],_0x28d880=await withSpinner(_0x16f27d?_0x2bfeef(0x13b)+_0x16f27d+_0x2bfeef(0x1eb):'Listing\x20RT-enabled\x20parent\x20segments...',()=>_0x1e5cc1[_0x2bfeef(0x25c)]['list'](),{'verbose':_0x41ad2d[_0x2bfeef(0x279)]});let _0x151b15=_0x28d880['data']['filter'](_0x2d2552=>_0x2d2552[_0x2bfeef(0x147)]);if(_0x16f27d){const _0x5136cc=_0x16f27d[_0x2bfeef(0x204)](/[.+^${}()|[\]\\]/g,_0x2bfeef(0x274))[_0x2bfeef(0x204)](/\*/g,'.*')[_0x2bfeef(0x204)](/\?/g,'.'),_0x212f32=new RegExp('^'+_0x5136cc+'$','i');_0x151b15=_0x151b15[_0x2bfeef(0x287)](_0x693657=>_0x212f32[_0x2bfeef(0x184)](_0x693657[_0x2bfeef(0x216)]));}_0x151b15[_0x2bfeef(0x206)]((_0x34f991,_0x589884)=>_0x34f991[_0x2bfeef(0x216)][_0x2bfeef(0x1ad)](_0x589884[_0x2bfeef(0x216)])),console[_0x2bfeef(0x1ca)]('✔\x20Found\x20'+_0x151b15[_0x2bfeef(0x2a2)]+_0x2bfeef(0x154)+(_0x151b15[_0x2bfeef(0x2a2)]!==0x1?'s':''));const _0x4499bc=_0x270da7=>{const _0x3f00b1=_0x2bfeef;return getConsoleNextUrl(_0x41ad2d[_0x3f00b1(0x22a)],_0x3f00b1(0x15e)+_0x270da7);};if(_0x41ad2d[_0x2bfeef(0x253)]==='json'||_0x41ad2d[_0x2bfeef(0x253)]==='jsonl'){const _0x664e94=_0x151b15['map'](_0x28a779=>({..._0x28a779,'url':_0x4499bc(_0x28a779['id'])}));await handleSDKOutput(_0x664e94,_0x41ad2d);}else{if(_0x151b15[_0x2bfeef(0x2a2)]===0x0)console['log'](_0x2bfeef(0x134));else for(const _0x489421 of _0x151b15){const _0x1386a8=_0x489421[_0x2bfeef(0x221)]?a30_0x2ac4a6[_0x2bfeef(0x194)]('\x20('+formatRows(_0x489421[_0x2bfeef(0x221)])+')'):'',_0x303c43=hyperlink(_0x489421[_0x2bfeef(0x216)],_0x4499bc(_0x489421['id']));console['log']('⚡\x20'+_0x303c43+_0x1386a8);}}return 0x0;}}export class PSRtValidateCommand extends BaseParentSegmentCommand{[a30_0x1c117e(0x216)]=a30_0x1c117e(0x1fb);[a30_0x1c117e(0x18c)]='Validate\x20RT\x202.0\x20configuration\x20from\x20parent\x20segment\x20YAML';async['execute'](_0x4f9e7c){const _0x2c7969=a30_0x1c117e,{options:_0x96b98d,args:_0x52e984,tdx:_0x4b9177}=_0x4f9e7c,_0x2cda3d=_0x52e984[0x0]||_0x96b98d[_0x2c7969(0x250)];if(!_0x2cda3d)return showParentSegmentNotSetError(_0x2c7969(0x2aa)+_0x2c7969(0x156)),0x1;const _0x852d88=resolveYamlFile(_0x2cda3d);if(!existsSync(_0x852d88))return showFileNotFoundError(_0x852d88,_0x2cda3d),0x1;let _0x477164;try{_0x477164=readFileSync(_0x852d88,_0x2c7969(0x15c));}catch(_0x133db2){const _0x569c29=_0x133db2 instanceof Error?_0x133db2[_0x2c7969(0x168)]:String(_0x133db2);return console[_0x2c7969(0x1ca)](_0x2c7969(0x142)+_0x569c29),0x1;}const _0xa4af00=createCommandSpinner(a30_0x2ac4a6[_0x2c7969(0x194)]('Validating\x20RT\x20configuration...'),{'verbose':_0x96b98d[_0x2c7969(0x279)]});_0xa4af00[_0x2c7969(0x26c)]();const _0x132a42={'realtime':!![],'onProgress':_0x34bbea=>{_0xa4af00['text']=formatProgressMessage(_0x34bbea);}};let _0x442f52;try{_0x442f52=await _0x4b9177[_0x2c7969(0x1ef)][_0x2c7969(0x135)](_0x477164,_0x132a42),_0xa4af00[_0x2c7969(0x27f)]();}catch(_0x42b41e){_0xa4af00[_0x2c7969(0x27f)]();throw _0x42b41e;}console[_0x2c7969(0x1ca)]('\x0a'+a30_0x2ac4a6[_0x2c7969(0x1b8)](_0x2c7969(0x1d5))+'\x20'+_0x442f52[_0x2c7969(0x216)]),console[_0x2c7969(0x1ca)]('═'['repeat'](0x3c)),displayRealtimeValidation(_0x442f52),console['error']('─'[_0x2c7969(0x18b)](0x3c));if(_0x442f52[_0x2c7969(0x11d)][_0x2c7969(0x2a2)]>0x0){console[_0x2c7969(0x1ca)]('\x0a'+a30_0x2ac4a6['red'](_0x2c7969(0x226)));for(const _0x3544ab of _0x442f52[_0x2c7969(0x11d)]){console[_0x2c7969(0x1ca)]('\x20\x20'+a30_0x2ac4a6['red']('•')+'\x20'+_0x3544ab);}}return _0x442f52['allValid']&&console[_0x2c7969(0x1ca)]('\x0a'+a30_0x2ac4a6[_0x2c7969(0x15b)]('✔')+_0x2c7969(0x257)),_0x442f52[_0x2c7969(0x16b)]?0x0:0x1;}}export class PSPzListCommand extends BaseCommand{[a30_0x1c117e(0x216)]=a30_0x1c117e(0x12c);['description']=a30_0x1c117e(0x1de);async[a30_0x1c117e(0x1d7)](_0x13d715){const _0x2afe31=a30_0x1c117e,{options:_0x308e43,args:_0x30f23f,tdx:_0x39e60a}=_0x13d715,_0x5eca29=_0x30f23f[0x0]||_0x308e43['parentSegment'];if(!_0x5eca29)return showParentSegmentNotSetError(_0x2afe31(0x196)+_0x2afe31(0x19a)),0x1;const _0x4d8113=await withSpinner(_0x2afe31(0x19e)+_0x5eca29+_0x2afe31(0x1eb),()=>_0x39e60a[_0x2afe31(0x1ef)][_0x2afe31(0x19d)](_0x5eca29),{'verbose':_0x308e43['verbose']}),_0x4010c5=_0x4d8113['data'],_0x11111a=await withSpinner(_0x2afe31(0x171)+_0x5eca29+'\x27...',()=>_0x39e60a[_0x2afe31(0x143)]['list'](_0x4010c5),{'verbose':_0x308e43[_0x2afe31(0x279)]}),_0x4dfbcd=_0x11111a[_0x2afe31(0x215)];console[_0x2afe31(0x1ca)](_0x2afe31(0x157)+_0x4dfbcd['length']+'\x20personalization\x20service'+(_0x4dfbcd[_0x2afe31(0x2a2)]!==0x1?'s':''));if(_0x308e43[_0x2afe31(0x253)]===_0x2afe31(0x295)||_0x308e43[_0x2afe31(0x253)]==='jsonl')await handleSDKOutput(_0x4dfbcd,_0x308e43);else{if(_0x4dfbcd['length']===0x0)console[_0x2afe31(0x149)](_0x2afe31(0x1da)),console[_0x2afe31(0x1ca)](a30_0x2ac4a6[_0x2afe31(0x1f4)]('\x0aTip:\x20Run\x20`tdx\x20ps\x20pz\x20init`\x20to\x20add\x20a\x20template\x20personalization\x20section\x20to\x20your\x20YAML'));else for(const _0x59a928 of _0x4dfbcd){const _0x3abaf1=_0x59a928[_0x2afe31(0x14c)]?.[_0x2afe31(0x2a2)]||0x0,_0x55e75f=_0x59a928['trigger_event']?a30_0x2ac4a6[_0x2afe31(0x194)](_0x2afe31(0x1ec)+_0x59a928['trigger_event']):'',_0x3452b7=a30_0x2ac4a6[_0x2afe31(0x194)]('\x20('+_0x3abaf1+_0x2afe31(0x247)+(_0x3abaf1!==0x1?'s':'')+')');console[_0x2afe31(0x149)]('\x20\x20'+_0x59a928[_0x2afe31(0x216)]+_0x55e75f+_0x3452b7),_0x59a928[_0x2afe31(0x18c)]&&console['log'](_0x2afe31(0x20e)+a30_0x2ac4a6[_0x2afe31(0x194)](_0x59a928[_0x2afe31(0x18c)]));}}return 0x0;}}export class PSPzInitCommand extends BaseParentSegmentCommand{['name']=a30_0x1c117e(0x2a3);[a30_0x1c117e(0x18c)]=a30_0x1c117e(0x1a2);async['execute'](_0x28e2ec){const _0x4ae4d8=a30_0x1c117e,{options:_0x5e85b9,args:_0x3b3b3e}=_0x28e2ec,_0x23eb9c=_0x3b3b3e[0x0]||_0x5e85b9[_0x4ae4d8(0x250)];if(!_0x23eb9c)return showParentSegmentNotSetError(_0x4ae4d8(0x159)+_0x4ae4d8(0x1fa)),0x1;const _0x48d67e=resolveYamlFile(_0x23eb9c);if(!existsSync(_0x48d67e))return showFileNotFoundError(_0x48d67e,_0x23eb9c),0x1;let _0x486bf1;try{_0x486bf1=readFileSync(_0x48d67e,_0x4ae4d8(0x15c));}catch(_0x40471c){const _0xb51e1c=_0x40471c instanceof Error?_0x40471c[_0x4ae4d8(0x168)]:String(_0x40471c);return console[_0x4ae4d8(0x1ca)](_0x4ae4d8(0x142)+_0xb51e1c),0x1;}let _0x24cec2;try{_0x24cec2=parseDef(_0x486bf1);}catch(_0x1fd96e){const _0x3f324f=_0x1fd96e instanceof Error?_0x1fd96e[_0x4ae4d8(0x168)]:String(_0x1fd96e);return console[_0x4ae4d8(0x1ca)](a30_0x2ac4a6['red'](_0x4ae4d8(0x1c3)+_0x3f324f)),0x1;}if(_0x24cec2['personalization_services']&&_0x24cec2[_0x4ae4d8(0x288)][_0x4ae4d8(0x2a2)]>0x0)return console[_0x4ae4d8(0x1ca)](a30_0x2ac4a6[_0x4ae4d8(0x1e4)]('⚠️\x20\x20personalization_services\x20section\x20already\x20exists\x20in\x20'+_0x48d67e)),console['error'](a30_0x2ac4a6['dim'](_0x4ae4d8(0x145)+_0x24cec2[_0x4ae4d8(0x288)][_0x4ae4d8(0x2a2)]+_0x4ae4d8(0x173))),0x1;!_0x24cec2[_0x4ae4d8(0x25c)]&&(_0x24cec2[_0x4ae4d8(0x25c)]={'events':[{'name':_0x4ae4d8(0x136),'source_table':_0x4ae4d8(0x1be)}],'attributes':[{'name':_0x4ae4d8(0x241),'type':_0x4ae4d8(0x1fe)}],'id_stitching':{'primary_key':_0x24cec2[_0x4ae4d8(0x210)]['table']===_0x4ae4d8(0x181)?_0x4ae4d8(0x252):_0x4ae4d8(0x1b7)}});_0x24cec2[_0x4ae4d8(0x288)]=[{'name':'My\x20Service','description':_0x4ae4d8(0x1f8),'trigger_event':_0x4ae4d8(0x136),'sections':[{'name':_0x4ae4d8(0x1f7),'criteria':_0x4ae4d8(0x169),'attributes':['last_page_viewed']}]}];const _0x29b736=serializeDef(_0x24cec2);return writeFileSync(_0x48d67e,_0x29b736,'utf-8'),console['error'](a30_0x2ac4a6[_0x4ae4d8(0x15b)]('✔')+_0x4ae4d8(0x27a)+a30_0x2ac4a6[_0x4ae4d8(0x1f4)](_0x48d67e)),(!_0x24cec2['realtime']||_0x486bf1[_0x4ae4d8(0x28d)](_0x4ae4d8(0x22f))===-0x1)&&console[_0x4ae4d8(0x1ca)](a30_0x2ac4a6['green']('✔')+_0x4ae4d8(0x266)),console['error']('\x0a'+a30_0x2ac4a6[_0x4ae4d8(0x194)](_0x4ae4d8(0x18e))),console[_0x4ae4d8(0x1ca)]('\x20\x201.\x20Edit\x20'+_0x48d67e+'\x20to\x20configure\x20your\x20personalization\x20service'),console['error'](_0x4ae4d8(0x1dc)+a30_0x2ac4a6[_0x4ae4d8(0x194)](_0x4ae4d8(0x245)+_0x23eb9c)+'\x20to\x20push\x20the\x20configuration'),0x0;}}
1
+ const a30_0x2d1bab=a30_0x5468;(function(_0x35b21d,_0x3d033b){const _0x453dc8=a30_0x5468,_0xc1ade7=_0x35b21d();while(!![]){try{const _0x10c55c=parseInt(_0x453dc8(0xfd))/0x1*(-parseInt(_0x453dc8(0x1f6))/0x2)+parseInt(_0x453dc8(0x253))/0x3*(parseInt(_0x453dc8(0x1fb))/0x4)+-parseInt(_0x453dc8(0x1f5))/0x5+-parseInt(_0x453dc8(0x14e))/0x6*(-parseInt(_0x453dc8(0x25a))/0x7)+-parseInt(_0x453dc8(0x269))/0x8+-parseInt(_0x453dc8(0x1bd))/0x9+-parseInt(_0x453dc8(0x115))/0xa*(-parseInt(_0x453dc8(0x237))/0xb);if(_0x10c55c===_0x3d033b)break;else _0xc1ade7['push'](_0xc1ade7['shift']());}catch(_0x390357){_0xc1ade7['push'](_0xc1ade7['shift']());}}}(a30_0x2faa,0x969ce));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a30_0x44ecf0 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,createCommandSpinner,formatElapsed}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{getConsoleUrl,getConsoleNextUrl}from'../sdk/client/endpoints.js';import{formatRows,formatAsTable,hyperlink}from'../sdk/util/formatters.js';import{parseDef,serializeDef}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import a30_0xc6b51f from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../sdk/segment/fields-display.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';const PARENT_SEGMENT_DIR='parent_segments',LEGACY_PARENT_SEGMENT_DIR='parent_segment';function openBrowser(_0x38c9f0){const _0x460a02=a30_0x5468,_0xb86ca2=process[_0x460a02(0x1ec)],_0x2a17af=_0xb86ca2===_0x460a02(0xf8)?'open':_0xb86ca2===_0x460a02(0x15c)?_0x460a02(0x1a4):_0x460a02(0x1eb);spawn(_0x2a17af,[_0x38c9f0],{'detached':!![],'stdio':_0x460a02(0x182)})[_0x460a02(0x169)]();}function migrateLegacyDirectory(){const _0x22dac5=a30_0x5468;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x5b6e98=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x5b6e98[_0x22dac5(0x1e6)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console['error'](a30_0xc6b51f[_0x22dac5(0x184)](_0x22dac5(0x270)+LEGACY_PARENT_SEGMENT_DIR+_0x22dac5(0x138)+PARENT_SEGMENT_DIR+_0x22dac5(0x256))),console[_0x22dac5(0x24c)](a30_0xc6b51f[_0x22dac5(0x203)](_0x22dac5(0x1c4)+LEGACY_PARENT_SEGMENT_DIR+_0x22dac5(0x14f))),![];console[_0x22dac5(0x24c)](a30_0xc6b51f[_0x22dac5(0x184)]('\x0a⚠️\x20\x20Migrating:\x20'+LEGACY_PARENT_SEGMENT_DIR+'/\x20→\x20'+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x22dac5(0x24c)](a30_0xc6b51f[_0x22dac5(0x148)]('✔\x20Renamed\x20directory\x20to\x20'+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x4101b5){const _0x4d5e57=_0x4101b5 instanceof Error?_0x4101b5['message']:String(_0x4101b5);return console['error'](a30_0xc6b51f[_0x22dac5(0x198)]('✘\x20Failed\x20to\x20rename\x20directory:\x20'+_0x4d5e57+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a30_0x2d1bab(0x104)](_0x25f3fc){const _0x87153=a30_0x2d1bab;return migrateLegacyDirectory(),super[_0x87153(0x104)](_0x25f3fc);}}function resolveYamlFile(_0x2d307b){const _0x5beb48=a30_0x2d1bab;if(_0x2d307b[_0x5beb48(0x258)](_0x5beb48(0x241))||_0x2d307b[_0x5beb48(0x258)](_0x5beb48(0x195)))return _0x2d307b;return a30_0x44ecf0[_0x5beb48(0x123)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x2d307b)+'.yml');}function a30_0x5468(_0x1e5ea2,_0x23976b){_0x1e5ea2=_0x1e5ea2-0xf0;const _0x2faa43=a30_0x2faa();let _0x5468f2=_0x2faa43[_0x1e5ea2];return _0x5468f2;}function formatProgressMessage(_0xb42b25){const _0x3d23e7=a30_0x2d1bab,_0x188f7a=_0xb42b25[_0x3d23e7(0x21c)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x188f7a){const [,_0x4c7f8e,_0x59bb4a,_0x4f59bf='']=_0x188f7a;return a30_0xc6b51f[_0x3d23e7(0x203)](_0x4c7f8e+':')+'\x20'+_0x59bb4a+a30_0xc6b51f[_0x3d23e7(0x203)](_0x4f59bf);}return a30_0xc6b51f[_0x3d23e7(0x203)](_0xb42b25);}function showFileNotFoundError(_0x163835,_0x2f97b8){const _0x3496d7=a30_0x2d1bab;console['error'](a30_0xc6b51f['red'](_0x3496d7(0x100)+_0x163835+'\x0a')),console[_0x3496d7(0x24c)](a30_0xc6b51f[_0x3496d7(0x102)]('Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20'+_0x2f97b8+_0x3496d7(0x170)));}function displayRealtimeValidation(_0x48175a){const _0x16ff74=a30_0x2d1bab;if(!_0x48175a[_0x16ff74(0x21e)])return;const _0xd9fc7b=_0x48175a[_0x16ff74(0x21e)],_0x4942ed=_0xd9fc7b[_0x16ff74(0x202)]?a30_0xc6b51f['green'](_0x16ff74(0x1a2)):a30_0xc6b51f[_0x16ff74(0x184)](_0x16ff74(0x209));console['error']('\x0a'+a30_0xc6b51f['dim'](_0x16ff74(0x139))+'\x20'+_0x4942ed);if(_0xd9fc7b[_0x16ff74(0x1c5)]&&_0xd9fc7b[_0x16ff74(0x1c5)][_0x16ff74(0x112)]>0x0){console[_0x16ff74(0x24c)]('\x20\x20'+a30_0xc6b51f[_0x16ff74(0x203)](_0x16ff74(0x21a))+'\x20'+_0xd9fc7b['events'][_0x16ff74(0x112)]+_0x16ff74(0x1e2));for(const _0x2f0d9f of _0xd9fc7b['events']){const _0xf48041=_0x2f0d9f[_0x16ff74(0x26a)]===![]?a30_0xc6b51f[_0x16ff74(0x198)]('✘'):a30_0xc6b51f[_0x16ff74(0x148)]('✔');console[_0x16ff74(0x24c)](_0x16ff74(0xf7)+_0xf48041+'\x20'+_0x2f0d9f['name']),_0x2f0d9f[_0x16ff74(0x1ba)]&&console['error']('\x20\x20\x20\x20\x20\x20'+a30_0xc6b51f[_0x16ff74(0x198)](_0x2f0d9f['sourceTableError']));}}if(_0xd9fc7b[_0x16ff74(0x20c)]&&_0xd9fc7b['attributes'][_0x16ff74(0x112)]>0x0){console['error']('\x20\x20'+a30_0xc6b51f[_0x16ff74(0x203)]('Attributes:')+'\x20'+_0xd9fc7b['attributes'][_0x16ff74(0x112)]+_0x16ff74(0x1e2));for(const _0x2c1dbf of _0xd9fc7b['attributes']){const _0x500c26=_0x2c1dbf[_0x16ff74(0x13f)]?a30_0xc6b51f[_0x16ff74(0x148)]('✔'):a30_0xc6b51f['red']('✘');console[_0x16ff74(0x24c)](_0x16ff74(0xf7)+_0x500c26+'\x20'+_0x2c1dbf[_0x16ff74(0xf1)]+'\x20'+a30_0xc6b51f[_0x16ff74(0x203)]('('+_0x2c1dbf['type']+')'));}}if(_0xd9fc7b[_0x16ff74(0x136)]){const _0x4c8aee=_0xd9fc7b[_0x16ff74(0x136)]['stitchingKeys']?.['length']?_0x16ff74(0xff)+_0xd9fc7b[_0x16ff74(0x136)][_0x16ff74(0x281)][_0x16ff74(0x123)](',\x20')+']':'';console[_0x16ff74(0x24c)]('\x20\x20'+a30_0xc6b51f[_0x16ff74(0x203)]('ID\x20Stitching:')+'\x20'+_0xd9fc7b[_0x16ff74(0x136)][_0x16ff74(0x1e8)]+_0x4c8aee);}if(_0xd9fc7b[_0x16ff74(0x1a1)]&&_0xd9fc7b['personalizationServices'][_0x16ff74(0x112)]>0x0){console['error']('\x20\x20'+a30_0xc6b51f[_0x16ff74(0x203)](_0x16ff74(0x16d))+'\x20'+_0xd9fc7b[_0x16ff74(0x1a1)]['length']+'\x20service'+(_0xd9fc7b[_0x16ff74(0x1a1)]['length']!==0x1?'s':''));for(const _0x2ca51a of _0xd9fc7b['personalizationServices']){console[_0x16ff74(0x24c)](_0x16ff74(0xfb)+_0x2ca51a[_0x16ff74(0xf1)]);}}}function showParentSegmentNotSetError(_0x24dda4){const _0x229afa=a30_0x2d1bab;console[_0x229afa(0x24c)](a30_0xc6b51f['yellow'](_0x229afa(0x20d))),console[_0x229afa(0x24c)](_0x24dda4);}export class ParentSegmentListCommand extends BaseCommand{[a30_0x2d1bab(0xf1)]=a30_0x2d1bab(0x1ee);['description']='List\x20parent\x20segments';async[a30_0x2d1bab(0x26d)](_0x4da55d){const _0x5599f0=a30_0x2d1bab,{options:_0x4b39f6,args:_0x6ff8c3,tdx:_0x44bd5c}=_0x4da55d,_0x2dcdec=_0x6ff8c3[0x0];_0x4b39f6[_0x5599f0(0xf6)]&&(console[_0x5599f0(0x24c)]('Site:\x20'+_0x4b39f6['site']),_0x2dcdec&&console[_0x5599f0(0x24c)](_0x5599f0(0x153)+_0x2dcdec));const _0x4cce35=await withSpinner(_0x2dcdec?'Listing\x20parent\x20segments\x20matching\x20\x27'+_0x2dcdec+_0x5599f0(0x27b):_0x5599f0(0x1a3),()=>_0x44bd5c[_0x5599f0(0x10a)][_0x5599f0(0x1da)](),{'verbose':_0x4b39f6['verbose']});let _0x1110d8=_0x4cce35[_0x5599f0(0x1d8)];if(_0x2dcdec){const _0x514527=_0x2dcdec[_0x5599f0(0x1f8)](/[.+^${}()|[\]\\]/g,_0x5599f0(0xfc))[_0x5599f0(0x1f8)](/\*/g,'.*')[_0x5599f0(0x1f8)](/\?/g,'.'),_0x368d01=new RegExp('^'+_0x514527+'$','i');_0x1110d8=_0x1110d8['filter'](_0x53d9fd=>_0x368d01['test'](_0x53d9fd[_0x5599f0(0x20c)][_0x5599f0(0xf1)]));}_0x1110d8[_0x5599f0(0x1de)]((_0x150aec,_0x176f79)=>_0x150aec[_0x5599f0(0x20c)]['name'][_0x5599f0(0x230)](_0x176f79[_0x5599f0(0x20c)][_0x5599f0(0xf1)])),console['error'](_0x5599f0(0x180)+_0x1110d8[_0x5599f0(0x112)]+_0x5599f0(0x263)+(_0x1110d8[_0x5599f0(0x112)]!==0x1?'s':''));const _0x2177bf=_0x1e5366=>{const _0x54c59d=_0x5599f0;return getConsoleNextUrl(_0x4b39f6[_0x54c59d(0x12f)],_0x54c59d(0x20e)+_0x1e5366);};if(_0x4b39f6[_0x5599f0(0x107)]==='json'||_0x4b39f6[_0x5599f0(0x107)]===_0x5599f0(0x1e4)){const _0x544de6=_0x1110d8[_0x5599f0(0x173)](_0x53dfce=>({..._0x53dfce,'url':_0x2177bf(_0x53dfce['id'])}));await handleSDKOutput(_0x544de6,_0x4b39f6);}else{if(_0x1110d8[_0x5599f0(0x112)]===0x0)_0x2dcdec?console[_0x5599f0(0x23f)](_0x5599f0(0x19a)+_0x2dcdec):console[_0x5599f0(0x23f)](_0x5599f0(0x119));else for(const _0x46c759 of _0x1110d8){const _0x329a89=_0x46c759[_0x5599f0(0x20c)][_0x5599f0(0x22f)]?a30_0xc6b51f[_0x5599f0(0x203)]('\x20('+formatRows(_0x46c759['attributes'][_0x5599f0(0x22f)])+')'):'',_0x2bfdbe=hyperlink(_0x46c759[_0x5599f0(0x20c)][_0x5599f0(0xf1)],_0x2177bf(_0x46c759['id']));console[_0x5599f0(0x23f)]('👥\x20'+_0x2bfdbe+_0x329a89);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a30_0x2d1bab(0xf1)]=a30_0x2d1bab(0x183);[a30_0x2d1bab(0x1f1)]=a30_0x2d1bab(0x1fa);async[a30_0x2d1bab(0x26d)](_0x57aa21){const _0x6d56a8=a30_0x2d1bab,{options:_0xa70f67,args:_0x22b9d1,tdx:_0x6f070e}=_0x57aa21;console[_0x6d56a8(0x24c)](_0x6d56a8(0x1b7)+_0x6d56a8(0x20f)+_0x6d56a8(0x1c7));const _0xfda8af=_0xa70f67;if(_0x22b9d1[_0x6d56a8(0x112)]===0x0)return console[_0x6d56a8(0x24c)](a30_0xc6b51f[_0x6d56a8(0x198)](_0x6d56a8(0x14b))),console[_0x6d56a8(0x24c)]('Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>'),0x1;const _0x277966=_0x22b9d1[0x0];if(!_0xfda8af[_0x6d56a8(0x13d)]||!_0xfda8af[_0x6d56a8(0x262)])return console[_0x6d56a8(0x24c)](_0x6d56a8(0x120)),console['error'](_0x6d56a8(0x229)),0x1;_0xfda8af[_0x6d56a8(0xf6)]&&(console[_0x6d56a8(0x24c)](_0x6d56a8(0x1ce)+_0xfda8af[_0x6d56a8(0x12f)]),console['error'](_0x6d56a8(0x19f)+_0x277966),console['error'](_0x6d56a8(0x10b)+_0xfda8af['database']),console[_0x6d56a8(0x24c)](_0x6d56a8(0x135)+_0xfda8af[_0x6d56a8(0x262)]));const _0x37ecd4=await loadJSONFromOptions(_0xfda8af[_0x6d56a8(0x20c)],_0xfda8af[_0x6d56a8(0x25c)]),_0x42c6b2=await loadJSONFromOptions(_0xfda8af[_0x6d56a8(0x218)],_0xfda8af[_0x6d56a8(0x156)]),_0x19183b=await loadJSONFromOptions(_0xfda8af['customerGroup'],_0xfda8af[_0x6d56a8(0xf2)]),_0xc56ae6={'name':_0x277966,'description':_0xfda8af[_0x6d56a8(0x1f1)],'scheduleType':_0xfda8af['scheduleType'],'scheduleOption':_0xfda8af[_0x6d56a8(0xf9)],'timezone':_0xfda8af[_0x6d56a8(0x168)],'master':{'parentDatabaseName':_0xfda8af[_0x6d56a8(0x13d)],'parentTableName':_0xfda8af[_0x6d56a8(0x262)]},'attributes':_0x37ecd4,'behaviors':_0x42c6b2,'customerGroup':_0x19183b},_0x3c1aba=await withSpinner(_0x6d56a8(0x1ac)+_0x277966+_0x6d56a8(0x27b),()=>_0x6f070e[_0x6d56a8(0x10a)][_0x6d56a8(0x167)](_0xc56ae6),{'verbose':_0xa70f67[_0x6d56a8(0xf6)]}),_0xc63a1b=_0x3c1aba[_0x6d56a8(0x1d8)];return console['error'](_0x6d56a8(0x164)+_0xc63a1b['name']+_0x6d56a8(0xf5)+_0xc63a1b['id']),await handleSDKOutput([_0xc63a1b],_0xa70f67),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a30_0x2d1bab(0xf1)]=a30_0x2d1bab(0x10f);['description']=a30_0x2d1bab(0x1b1);async[a30_0x2d1bab(0x26d)](_0x53d35b){const _0x116657=a30_0x2d1bab,{options:_0x3c9692,args:_0x3b9499,tdx:_0xe7291}=_0x53d35b;console['error'](_0x116657(0x118)+_0x116657(0x20f)+'\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a');const _0x44b27d=_0x3c9692;if(_0x3b9499[_0x116657(0x112)]===0x0)return console['error'](a30_0xc6b51f[_0x116657(0x198)](_0x116657(0x14b))),console['error'](_0x116657(0x190)),0x1;const _0xe7a0fe=_0x3b9499[0x0];_0x44b27d[_0x116657(0xf6)]&&(console['error'](_0x116657(0x1ce)+_0x44b27d['site']),console[_0x116657(0x24c)](_0x116657(0x1a6)+_0xe7a0fe));const _0x2952f0=await withSpinner(_0x116657(0x242)+_0xe7a0fe+_0x116657(0x27b),()=>_0xe7291['segment'][_0x116657(0x12b)](_0xe7a0fe),{'verbose':_0x44b27d['verbose']}),_0x40def0=_0x2952f0[_0x116657(0x1d8)],_0x3dd11b=await loadJSONFromOptions(_0x44b27d[_0x116657(0x252)],_0x44b27d[_0x116657(0x1f9)]),_0x2c553d=await loadJSONFromOptions(_0x44b27d[_0x116657(0x162)],_0x44b27d['addBehaviorsFile']),_0x4171ef={'name':_0x40def0[_0x116657(0xf1)],'description':_0x44b27d[_0x116657(0x1f1)]!==undefined?_0x44b27d[_0x116657(0x1f1)]:_0x40def0[_0x116657(0x1f1)],'scheduleType':_0x44b27d[_0x116657(0x268)]!==undefined?_0x44b27d[_0x116657(0x268)]:_0x40def0[_0x116657(0x268)],'scheduleOption':_0x44b27d['scheduleOption']!==undefined?_0x44b27d['scheduleOption']:_0x40def0[_0x116657(0xf9)],'timezone':_0x44b27d[_0x116657(0x168)]!==undefined?_0x44b27d['timezone']:_0x40def0[_0x116657(0x168)],'master':_0x40def0['master'],'attributes':_0x3dd11b?[..._0x40def0[_0x116657(0x20c)]||[],..._0x3dd11b]:_0x40def0[_0x116657(0x20c)],'behaviors':_0x2c553d?[..._0x40def0['behaviors']||[],..._0x2c553d]:_0x40def0[_0x116657(0x218)],'customerGroup':_0x40def0['customerGroup']},_0x21a1cb=await withSpinner(_0x116657(0x15b)+_0xe7a0fe+_0x116657(0x27b),()=>_0xe7291[_0x116657(0x10a)][_0x116657(0x214)](_0xe7a0fe,_0x4171ef),{'verbose':_0x44b27d[_0x116657(0xf6)]}),_0x9a2fb2=_0x21a1cb['data'];return console['error'](_0x116657(0x126)+_0x9a2fb2[_0x116657(0xf1)]+'\x27'),await handleSDKOutput([_0x9a2fb2],_0x44b27d),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{['name']=a30_0x2d1bab(0x197);[a30_0x2d1bab(0x1f1)]=a30_0x2d1bab(0x134);async['execute'](_0x517a30){const _0xc3f022=a30_0x2d1bab,{options:_0xf17de5,args:_0x3888bf,tdx:_0x29e4c3}=_0x517a30,_0x550f6b=_0xf17de5,_0x26f4ff=_0x3888bf[0x0]||_0xf17de5[_0xc3f022(0x1c8)];if(!_0x26f4ff)return showParentSegmentNotSetError(_0xc3f022(0x16c)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment'),0x1;if(_0x550f6b[_0xc3f022(0x26e)]&&_0x550f6b[_0xc3f022(0x249)])return console[_0xc3f022(0x24c)](a30_0xc6b51f[_0xc3f022(0x198)](_0xc3f022(0x275))),console[_0xc3f022(0x24c)](a30_0xc6b51f[_0xc3f022(0x203)](_0xc3f022(0x121))),console[_0xc3f022(0x24c)](a30_0xc6b51f['dim'](_0xc3f022(0x22d)+PARENT_SEGMENT_DIR+_0xc3f022(0x1ae))),console[_0xc3f022(0x24c)](a30_0xc6b51f[_0xc3f022(0x102)]('Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u')),0x1;const _0xccf6ff=_0x550f6b[_0xc3f022(0x249)]||a30_0x44ecf0[_0xc3f022(0x123)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x26f4ff)+'.yml');_0x550f6b[_0xc3f022(0xf6)]&&(console['error'](_0xc3f022(0x1ce)+_0x550f6b['site']),console[_0xc3f022(0x24c)](_0xc3f022(0x1a6)+_0x26f4ff),console[_0xc3f022(0x24c)]('Output\x20file:\x20'+_0xccf6ff));const _0x2255b9=await withSpinner(_0xc3f022(0x271)+_0x26f4ff+_0xc3f022(0x27b),()=>_0x29e4c3['segment'][_0xc3f022(0x142)](_0x26f4ff),{'verbose':_0x550f6b[_0xc3f022(0xf6)]}),_0x443b46=_0x2255b9[_0xc3f022(0x1d8)];if(existsSync(_0xccf6ff)){const _0x28578f=readFileSync(_0xccf6ff,_0xc3f022(0x24f)),_0xc3357=generateDiff(_0x28578f,_0x443b46);if(!hasChanges(_0xc3357))console['error'](a30_0xc6b51f['green']('✔')+'\x20No\x20changes\x20-\x20'+a30_0xc6b51f[_0xc3f022(0x102)](_0xccf6ff)+_0xc3f022(0x1d3));else{console[_0xc3f022(0x24c)](_0xc3f022(0x151)+_0xccf6ff+'\x27:'),console[_0xc3f022(0x24c)]('─'[_0xc3f022(0x221)](0x3c)),console[_0xc3f022(0x24c)](formatDiffWithColors(_0xc3357)),console['error']('─'[_0xc3f022(0x221)](0x3c));if(!_0x550f6b[_0xc3f022(0x1d5)]){if(!isInteractive())return console[_0xc3f022(0x24c)](a30_0xc6b51f['red'](_0xc3f022(0x1a0)),_0xc3f022(0x17c)),console[_0xc3f022(0x24c)](a30_0xc6b51f['dim'](_0xc3f022(0x10e))),0x1;const _0x5500a7=await confirmKey(_0xc3f022(0x1c9)+_0xccf6ff+'\x27?');if(!_0x5500a7)return console[_0xc3f022(0x24c)](a30_0xc6b51f[_0xc3f022(0x184)](_0xc3f022(0x131))),0x1;}writeFileSync(_0xccf6ff,_0x443b46,_0xc3f022(0x24f)),console[_0xc3f022(0x24c)](a30_0xc6b51f[_0xc3f022(0x148)]('✔')+_0xc3f022(0x194)+a30_0xc6b51f[_0xc3f022(0x102)](_0xccf6ff));}}else{const _0x37cca2=a30_0x44ecf0[_0xc3f022(0x152)](_0xccf6ff);!existsSync(_0x37cca2)&&mkdirSync(_0x37cca2,{'recursive':!![]}),writeFileSync(_0xccf6ff,_0x443b46,_0xc3f022(0x24f)),console['error'](a30_0xc6b51f[_0xc3f022(0x148)]('✔')+_0xc3f022(0x194)+a30_0xc6b51f[_0xc3f022(0x102)](_0xccf6ff));}return saveSessionContext({'parent_segment':_0x26f4ff},_0x550f6b[_0xc3f022(0x129)]),console[_0xc3f022(0x24c)](a30_0xc6b51f['green']('✔')+'\x20Context\x20set:\x20'+a30_0xc6b51f[_0xc3f022(0x203)](_0xc3f022(0x199))+_0xc3f022(0x161)+a30_0xc6b51f['cyan'](_0x26f4ff)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a30_0x2d1bab(0xf1)]='segment:parent:push';[a30_0x2d1bab(0x1f1)]=a30_0x2d1bab(0x266);async[a30_0x2d1bab(0x26d)](_0x3a054c){const _0x1d107b=a30_0x2d1bab,{options:_0x94deb,args:_0x259b46,tdx:_0x247d29}=_0x3a054c,_0x33ab80=_0x94deb,_0x1b122b=_0x259b46[0x0]||_0x94deb[_0x1d107b(0x1c8)];if(!_0x1b122b)return showParentSegmentNotSetError(_0x1d107b(0x204)+_0x1d107b(0x125)),0x1;const _0x133711=resolveYamlFile(_0x1b122b);if(!existsSync(_0x133711))return showFileNotFoundError(_0x133711,_0x1b122b),0x1;_0x33ab80[_0x1d107b(0xf6)]&&(console[_0x1d107b(0x24c)]('Site:\x20'+_0x33ab80[_0x1d107b(0x12f)]),console[_0x1d107b(0x24c)]('YAML\x20file:\x20'+_0x133711));let _0x222152;try{_0x222152=readFileSync(_0x133711,_0x1d107b(0x24f));}catch(_0x43e3c8){const _0x50cd74=_0x43e3c8 instanceof Error?_0x43e3c8['message']:String(_0x43e3c8);return console['error'](_0x1d107b(0x264)+_0x50cd74),0x1;}const _0xa0c8c5=await withSpinner(_0x1d107b(0x15a),()=>_0x247d29[_0x1d107b(0x10a)][_0x1d107b(0x1cc)](_0x222152),{'verbose':_0x33ab80[_0x1d107b(0xf6)]}),_0x2cd64d=_0xa0c8c5['data'],{isNew:_0x496015,name:_0x28c07d,hasChanges:_0x1995a0,diffFormatted:_0x5375cf}=_0x2cd64d;if(!_0x1995a0)return console[_0x1d107b(0x24c)](_0x1d107b(0x18d)+_0x28c07d+_0x1d107b(0x246)),0x0;_0x496015?console[_0x1d107b(0x24c)]('\x0aNew\x20parent\x20segment\x20\x27'+_0x28c07d+'\x27:'):console[_0x1d107b(0x24c)](_0x1d107b(0x110)+_0x28c07d+'\x27:');console['error']('─'[_0x1d107b(0x221)](0x3c)),console[_0x1d107b(0x24c)](_0x5375cf),console[_0x1d107b(0x24c)]('─'[_0x1d107b(0x221)](0x3c));const _0x380105=_0x496015?'Create\x20parent\x20segment\x20\x27'+_0x28c07d+'\x27?':'Apply\x20changes\x20to\x20\x27'+_0x28c07d+'\x27?';if(!_0x33ab80['yes']){if(!isInteractive())return console[_0x1d107b(0x24c)](a30_0xc6b51f['red']('\x0aError:'),_0x1d107b(0x17c)),console[_0x1d107b(0x24c)](a30_0xc6b51f[_0x1d107b(0x203)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x37f17e=await confirmKey(_0x380105);if(!_0x37f17e)return console['error'](a30_0xc6b51f[_0x1d107b(0x184)]('Aborted.')),0x1;}const _0x21d856=_0x496015?_0x1d107b(0x261):_0x1d107b(0x105),_0x5df73d=await withSpinner(_0x21d856+_0x1d107b(0x210)+_0x28c07d+'\x27...',()=>_0x2cd64d[_0x1d107b(0x19d)](),{'verbose':_0x33ab80['verbose']}),_0x565f6c=_0x5df73d['data'],_0x253d88=getConsoleNextUrl(_0x33ab80[_0x1d107b(0x12f)],_0x1d107b(0x20e)+_0x565f6c['id']),_0x42b0c8=_0x496015?_0x1d107b(0x144):_0x1d107b(0x10c);return console[_0x1d107b(0x24c)]('✔\x20'+_0x42b0c8+'\x20parent\x20segment\x20\x27'+_0x565f6c[_0x1d107b(0xf1)]+'\x27'),console[_0x1d107b(0x24c)]('\x20\x20'+_0x253d88),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a30_0x2d1bab(0xf1)]=a30_0x2d1bab(0x208);['description']=a30_0x2d1bab(0x1fd);async[a30_0x2d1bab(0x26d)](_0x2a8b67){const _0x3e9afe=a30_0x2d1bab,{options:_0x56bf05,args:_0x11a45e,tdx:_0xff95c4}=_0x2a8b67,_0x55697b=_0x56bf05,_0x427d58=_0x11a45e[0x0]||_0x56bf05[_0x3e9afe(0x1c8)];if(!_0x427d58)return showParentSegmentNotSetError(_0x3e9afe(0x1a5)+_0x3e9afe(0x22e)+_0x3e9afe(0x251)+_0x3e9afe(0x147)+_0x3e9afe(0x187)+_0x3e9afe(0x1dc)),0x1;const _0x1610e9=resolveYamlFile(_0x427d58);if(!existsSync(_0x1610e9))return showFileNotFoundError(_0x1610e9,_0x427d58),0x1;_0x55697b[_0x3e9afe(0xf6)]&&(console[_0x3e9afe(0x24c)](_0x3e9afe(0x1ce)+_0x55697b['site']),console[_0x3e9afe(0x24c)](_0x3e9afe(0x27d)+_0x1610e9));let _0xa51d1;try{_0xa51d1=readFileSync(_0x1610e9,_0x3e9afe(0x24f));}catch(_0x352564){const _0x50c4e6=_0x352564 instanceof Error?_0x352564['message']:String(_0x352564);return console[_0x3e9afe(0x24c)](_0x3e9afe(0x264)+_0x50c4e6),0x1;}const _0x3f5333=createCommandSpinner(a30_0xc6b51f[_0x3e9afe(0x203)](_0x3e9afe(0x201)),{'verbose':_0x55697b[_0x3e9afe(0xf6)]});_0x3f5333[_0x3e9afe(0x1a4)]();const _0x2a66b3={'onProgress':_0x40c158=>{const _0x2c1b85=_0x3e9afe;_0x3f5333[_0x2c1b85(0x1e7)]=formatProgressMessage(_0x40c158);}};if(_0x55697b[_0x3e9afe(0x24a)])_0x2a66b3[_0x3e9afe(0x24a)]=!![];if(_0x55697b[_0x3e9afe(0x27a)])_0x2a66b3['enriched']=!![];_0x55697b[_0x3e9afe(0x22b)]&&(_0x2a66b3['attribute']=_0x55697b[_0x3e9afe(0x22b)]);_0x55697b['behavior']&&(_0x2a66b3['behavior']=_0x55697b[_0x3e9afe(0x160)]);if(_0x55697b[_0x3e9afe(0x1e1)])_0x2a66b3[_0x3e9afe(0x1e1)]=_0x55697b[_0x3e9afe(0x1e1)];let _0x457ee8;try{_0x457ee8=await _0xff95c4[_0x3e9afe(0x10a)][_0x3e9afe(0x13a)](_0xa51d1,_0x2a66b3),_0x3f5333[_0x3e9afe(0x250)]();}catch(_0xb4782c){_0x3f5333[_0x3e9afe(0x250)]();throw _0xb4782c;}const _0x41b881=_0x55697b[_0x3e9afe(0x1e1)]||_0x3e9afe(0x109);return this[_0x3e9afe(0x1cd)](_0x457ee8,_0x2a66b3,_0x1610e9,_0x41b881),_0x457ee8[_0x3e9afe(0x11d)]?0x0:0x1;}[a30_0x2d1bab(0x1cd)](_0x2d5cdd,_0x580607,_0x22033c,_0x51a804){const _0x4cffb2=a30_0x2d1bab;console[_0x4cffb2(0x24c)]('\x0a'+a30_0xc6b51f[_0x4cffb2(0x18b)](_0x4cffb2(0x21b))+'\x20'+_0x2d5cdd['name']),console[_0x4cffb2(0x24c)]('═'[_0x4cffb2(0x221)](0x3c)),this[_0x4cffb2(0x1b4)](_0x2d5cdd);if(typeof _0x580607[_0x4cffb2(0x22b)]===_0x4cffb2(0x24b)){this[_0x4cffb2(0x22a)](_0x2d5cdd),this[_0x4cffb2(0x14d)](_0x2d5cdd),this[_0x4cffb2(0x1fe)](_0x22033c,_0x51a804,_0x4cffb2(0x22b),_0x580607[_0x4cffb2(0x22b)]);return;}if(_0x580607[_0x4cffb2(0x22b)]===!![]){this['displayAttributesStats'](_0x2d5cdd),this['displaySummary'](_0x2d5cdd),this[_0x4cffb2(0x1fe)](_0x22033c,_0x51a804,'attributes');return;}if(typeof _0x580607[_0x4cffb2(0x160)]===_0x4cffb2(0x24b)){this[_0x4cffb2(0x1b8)](_0x2d5cdd,_0x51a804),this[_0x4cffb2(0x14d)](_0x2d5cdd),this[_0x4cffb2(0x1fe)](_0x22033c,_0x51a804,'behavior',_0x580607[_0x4cffb2(0x160)]);return;}if(_0x580607[_0x4cffb2(0x160)]===!![]){this[_0x4cffb2(0x1b8)](_0x2d5cdd,_0x51a804),this[_0x4cffb2(0x14d)](_0x2d5cdd),this[_0x4cffb2(0x1fe)](_0x22033c,_0x51a804,_0x4cffb2(0x218));return;}this['displayAttributesStats'](_0x2d5cdd),this['displayBehaviorsStats'](_0x2d5cdd,_0x51a804),this['displayRealtimeInfo'](_0x2d5cdd),this[_0x4cffb2(0x14d)](_0x2d5cdd),this[_0x4cffb2(0x1fe)](_0x22033c,_0x51a804,'all');}[a30_0x2d1bab(0x1d9)](_0x4a3727){displayRealtimeValidation(_0x4a3727);}[a30_0x2d1bab(0x1fe)](_0x1593da,_0x163170,_0x150a19,_0x59fc1f){const _0x316122=a30_0x2d1bab;console[_0x316122(0x24c)]('\x0a'+a30_0xc6b51f['dim'](_0x316122(0x235)));const _0x50bd8a=_0x163170!==_0x316122(0x109)?_0x316122(0x174)+_0x163170:'';if(_0x150a19===_0x316122(0x22b)&&_0x59fc1f)console[_0x316122(0x24c)]('\x20\x20'+a30_0xc6b51f['dim'](_0x316122(0x103)+_0x1593da+_0x316122(0x213)+_0x59fc1f+'\x22'+_0x50bd8a));else{if(_0x150a19==='behavior'&&_0x59fc1f)console[_0x316122(0x24c)]('\x20\x20'+a30_0xc6b51f['dim'](_0x316122(0x103)+_0x1593da+_0x316122(0x18c)+_0x59fc1f+'\x22'+_0x50bd8a));else(_0x150a19===_0x316122(0x20c)||_0x150a19===_0x316122(0x114))&&console[_0x316122(0x24c)]('\x20\x20'+a30_0xc6b51f[_0x316122(0x203)](_0x316122(0x103)+_0x1593da+_0x316122(0x225)+_0x50bd8a));}(_0x150a19===_0x316122(0x218)||_0x150a19==='all')&&console[_0x316122(0x24c)]('\x20\x20'+a30_0xc6b51f[_0x316122(0x203)](_0x316122(0x103)+_0x1593da+_0x316122(0x1b0)+_0x50bd8a)),_0x150a19==='all'&&console[_0x316122(0x24c)]('\x20\x20'+a30_0xc6b51f[_0x316122(0x203)](_0x316122(0x103)+_0x1593da+_0x316122(0x158)+_0x50bd8a));}[a30_0x2d1bab(0x1b4)](_0x110b85){const _0x34ca28=a30_0x2d1bab,{master:_0xf392e1}=_0x110b85,_0xceb623=_0xf392e1[_0x34ca28(0x277)]?a30_0xc6b51f[_0x34ca28(0x148)]('✔'):a30_0xc6b51f[_0x34ca28(0x198)]('✘');console[_0x34ca28(0x24c)]('\x0a'+a30_0xc6b51f[_0x34ca28(0x203)](_0x34ca28(0x25b))),console[_0x34ca28(0x24c)](_0xceb623+'\x20'+a30_0xc6b51f[_0x34ca28(0x18b)](_0xf392e1[_0x34ca28(0x13d)]+'.'+_0xf392e1[_0x34ca28(0x262)])),_0xf392e1[_0x34ca28(0x277)]?_0xf392e1['rowCount']!==undefined&&console[_0x34ca28(0x24c)]('\x20\x20'+a30_0xc6b51f[_0x34ca28(0x203)](_0x34ca28(0x219))+'\x20'+a30_0xc6b51f['cyan'](formatRows(_0xf392e1[_0x34ca28(0x1d2)]))):console[_0x34ca28(0x24c)]('\x20\x20'+a30_0xc6b51f[_0x34ca28(0x198)](_0x34ca28(0x276))+'\x20'+_0xf392e1['schemaError']);}['displayAttributesStats'](_0x4507bc){const _0x11bdb6=a30_0x2d1bab;if(_0x4507bc['attributes'][_0x11bdb6(0x112)]===0x0)return;console[_0x11bdb6(0x24c)]('\x0a'+a30_0xc6b51f['dim'](_0x11bdb6(0x13c)));for(const _0x314ff8 of _0x4507bc[_0x11bdb6(0x20c)]){const _0x3fcac0=_0x314ff8[_0x11bdb6(0x277)]?a30_0xc6b51f[_0x11bdb6(0x148)]('✔'):a30_0xc6b51f[_0x11bdb6(0x198)]('✘');let _0xd7b9a6='';if(_0x314ff8[_0x11bdb6(0x277)]&&_0x314ff8[_0x11bdb6(0x13b)]!==undefined&&_0x314ff8[_0x11bdb6(0x25f)]!==undefined){const _0x4bf632=_0x314ff8[_0x11bdb6(0x25f)][_0x11bdb6(0x227)](0x1),_0x4e4830=_0x314ff8[_0x11bdb6(0x25f)]>=0x50?a30_0xc6b51f['green']:_0x314ff8['coveragePercent']>=0x32?a30_0xc6b51f[_0x11bdb6(0x184)]:a30_0xc6b51f[_0x11bdb6(0x198)];_0xd7b9a6='\x20'+a30_0xc6b51f[_0x11bdb6(0x203)](_0x11bdb6(0x234))+'\x20'+_0x4e4830(_0x4bf632+'%')+'\x20('+formatRows(_0x314ff8[_0x11bdb6(0x13b)])+_0x11bdb6(0x1ed);}console[_0x11bdb6(0x24c)](_0x3fcac0+'\x20'+a30_0xc6b51f[_0x11bdb6(0x18b)](_0x314ff8[_0x11bdb6(0xf1)])+_0xd7b9a6),console[_0x11bdb6(0x24c)]('\x20\x20'+a30_0xc6b51f[_0x11bdb6(0x203)](_0x11bdb6(0x25d))+'\x20'+a30_0xc6b51f[_0x11bdb6(0x18b)](_0x314ff8[_0x11bdb6(0x13d)]+'.'+_0x314ff8[_0x11bdb6(0x262)]));const _0x5a4149=_0x314ff8[_0x11bdb6(0x1a7)]===_0x314ff8['foreignKey']?a30_0xc6b51f[_0x11bdb6(0x203)]('Join\x20on:')+'\x20'+_0x314ff8[_0x11bdb6(0x1a7)]:a30_0xc6b51f[_0x11bdb6(0x203)](_0x11bdb6(0x149))+'\x20'+_0x314ff8[_0x11bdb6(0x1a7)]+_0x11bdb6(0x161)+_0x314ff8[_0x11bdb6(0x25e)];console[_0x11bdb6(0x24c)]('\x20\x20'+_0x5a4149),console[_0x11bdb6(0x24c)]('\x20\x20'+a30_0xc6b51f[_0x11bdb6(0x203)](_0x11bdb6(0x211))),this[_0x11bdb6(0x21d)](_0x314ff8[_0x11bdb6(0x1d4)]),!_0x314ff8[_0x11bdb6(0x277)]&&console[_0x11bdb6(0x24c)]('\x20\x20'+a30_0xc6b51f[_0x11bdb6(0x198)](_0x11bdb6(0x276))+'\x20'+_0x314ff8[_0x11bdb6(0x1b2)]);}}['displayBehaviorsStats'](_0x366e96,_0x538f5f){const _0x584820=a30_0x2d1bab;if(_0x366e96[_0x584820(0x218)]['length']===0x0)return;console[_0x584820(0x24c)]('\x0a'+a30_0xc6b51f[_0x584820(0x203)](_0x584820(0x24d))+'\x20'+a30_0xc6b51f[_0x584820(0x203)]('('+_0x538f5f+')'));for(const _0x1a8996 of _0x366e96[_0x584820(0x218)]){const _0x11a8da=_0x1a8996[_0x584820(0x277)]?a30_0xc6b51f['green']('✔'):a30_0xc6b51f['red']('✘');let _0x32c948='';if(_0x1a8996[_0x584820(0x277)]&&_0x1a8996[_0x584820(0x20b)]!==undefined&&_0x1a8996[_0x584820(0x12a)]!==undefined){const _0x3edfe7=_0x1a8996[_0x584820(0x228)]?.[_0x584820(0x227)](0x1)||'?',_0x597b1c=(_0x1a8996[_0x584820(0x228)]??0x0)>=0x32?a30_0xc6b51f[_0x584820(0x148)]:(_0x1a8996[_0x584820(0x228)]??0x0)>=0x14?a30_0xc6b51f[_0x584820(0x184)]:a30_0xc6b51f['red'];_0x32c948='\x20'+a30_0xc6b51f['dim']('Customers:')+'\x20'+_0x597b1c(formatRows(_0x1a8996['customersWithEvents']))+'\x20('+_0x3edfe7+_0x584820(0x196)+a30_0xc6b51f[_0x584820(0x203)](_0x584820(0x21a))+'\x20'+a30_0xc6b51f[_0x584820(0x102)](formatRows(_0x1a8996['totalEvents']));}console['error'](_0x11a8da+'\x20'+a30_0xc6b51f[_0x584820(0x18b)](_0x1a8996[_0x584820(0xf1)])+_0x32c948),console['error']('\x20\x20'+a30_0xc6b51f[_0x584820(0x203)](_0x584820(0x25d))+'\x20'+a30_0xc6b51f[_0x584820(0x18b)](_0x1a8996[_0x584820(0x13d)]+'.'+_0x1a8996['table']));const _0x55054b=_0x1a8996[_0x584820(0x1a7)]===_0x1a8996[_0x584820(0x25e)]?a30_0xc6b51f[_0x584820(0x203)](_0x584820(0xfa))+'\x20'+_0x1a8996[_0x584820(0x1a7)]:a30_0xc6b51f[_0x584820(0x203)](_0x584820(0x149))+'\x20'+_0x1a8996[_0x584820(0x1a7)]+_0x584820(0x161)+_0x1a8996[_0x584820(0x25e)];console[_0x584820(0x24c)]('\x20\x20'+_0x55054b),console[_0x584820(0x24c)]('\x20\x20'+a30_0xc6b51f[_0x584820(0x203)](_0x584820(0x211))),this['displayColumns'](_0x1a8996[_0x584820(0x1d4)]),!_0x1a8996['schemaValid']&&console[_0x584820(0x24c)]('\x20\x20'+a30_0xc6b51f['red'](_0x584820(0x276))+'\x20'+_0x1a8996[_0x584820(0x1b2)]);}}[a30_0x2d1bab(0x21d)](_0x2e356a){const _0x4cf253=a30_0x2d1bab;for(const _0x47bf59 of _0x2e356a){_0x47bf59[_0x4cf253(0x206)]===_0x47bf59['column']||_0x47bf59['column']==='*'?console[_0x4cf253(0x24c)]('\x20\x20\x20\x20-\x20'+_0x47bf59['label']):console[_0x4cf253(0x24c)]('\x20\x20\x20\x20-\x20'+_0x47bf59[_0x4cf253(0x206)]+'\x20'+a30_0xc6b51f[_0x4cf253(0x203)]('('+_0x47bf59[_0x4cf253(0x1ff)]+')'));}}[a30_0x2d1bab(0x14d)](_0x471531){const _0x307009=a30_0x2d1bab;console[_0x307009(0x24c)]('─'['repeat'](0x3c));if(_0x471531[_0x307009(0x11c)][_0x307009(0x112)]>0x0){console[_0x307009(0x24c)]('\x0a'+a30_0xc6b51f['red'](_0x307009(0x177)));for(const _0x2ffea9 of _0x471531[_0x307009(0x11c)]){console[_0x307009(0x24c)]('\x20\x20'+a30_0xc6b51f[_0x307009(0x198)]('•')+'\x20'+_0x2ffea9);}}_0x471531['allValid']&&console[_0x307009(0x24c)]('\x0a'+a30_0xc6b51f[_0x307009(0x148)]('✔')+'\x20Configuration\x20is\x20valid');}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a30_0x2d1bab(0xf1)]=a30_0x2d1bab(0xfe);['description']=a30_0x2d1bab(0x232);async[a30_0x2d1bab(0x26d)](_0x51b80a){const _0x53b7b9=a30_0x2d1bab,{options:_0x592e77,args:_0x3226db,tdx:_0x253218}=_0x51b80a,_0x4b0960=_0x592e77,_0x289714=_0x3226db[0x0]||_0x592e77[_0x53b7b9(0x1c8)];if(!_0x289714)return showParentSegmentNotSetError(_0x53b7b9(0x137)+_0x53b7b9(0x165)+_0x53b7b9(0x122)+_0x53b7b9(0x260)+'\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a'+_0x53b7b9(0x1c1)+_0x53b7b9(0x17e)+_0x53b7b9(0x1dc)),0x1;if(!_0x4b0960['master']&&!_0x4b0960['attribute']&&!_0x4b0960[_0x53b7b9(0x160)]&&!_0x4b0960[_0x53b7b9(0x27a)])return console[_0x53b7b9(0x24c)](a30_0xc6b51f[_0x53b7b9(0x198)](_0x53b7b9(0x178))),console[_0x53b7b9(0x24c)]('Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a'),console[_0x53b7b9(0x24c)]('Options:'),console['error']('\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data'),console[_0x53b7b9(0x24c)]('\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute'),console[_0x53b7b9(0x24c)](_0x53b7b9(0x116)),console[_0x53b7b9(0x24c)]('\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data'),0x1;const _0x18b301=resolveYamlFile(_0x289714);if(!existsSync(_0x18b301))return showFileNotFoundError(_0x18b301,_0x289714),0x1;_0x4b0960[_0x53b7b9(0xf6)]&&(console[_0x53b7b9(0x24c)]('Site:\x20'+_0x4b0960[_0x53b7b9(0x12f)]),console[_0x53b7b9(0x24c)]('YAML\x20file:\x20'+_0x18b301));let _0x3ab468;try{_0x3ab468=readFileSync(_0x18b301,'utf-8');}catch(_0x213da9){const _0x568598=_0x213da9 instanceof Error?_0x213da9[_0x53b7b9(0x226)]:String(_0x213da9);return console[_0x53b7b9(0x24c)]('Error\x20reading\x20file:\x20'+_0x568598),0x1;}let _0x7b62a9;try{_0x7b62a9=parseDef(_0x3ab468);}catch(_0x5992a9){const _0xc755f3=_0x5992a9 instanceof Error?_0x5992a9[_0x53b7b9(0x226)]:String(_0x5992a9);return console[_0x53b7b9(0x24c)](a30_0xc6b51f[_0x53b7b9(0x198)](_0x53b7b9(0x1c3)+_0xc755f3)),0x1;}if(_0x4b0960[_0x53b7b9(0x22b)]===!![]||_0x4b0960[_0x53b7b9(0x22b)]===''){const _0x8f06e6=_0x7b62a9[_0x53b7b9(0x20c)]?.[_0x53b7b9(0x173)](_0x37bacc=>_0x37bacc[_0x53b7b9(0xf1)])||[];if(_0x8f06e6[_0x53b7b9(0x112)]===0x0)console['error'](a30_0xc6b51f[_0x53b7b9(0x198)](_0x53b7b9(0x1df)));else{console[_0x53b7b9(0x24c)](a30_0xc6b51f[_0x53b7b9(0x198)](_0x53b7b9(0x22c))),console[_0x53b7b9(0x24c)](_0x53b7b9(0x279));for(const _0x18b775 of _0x8f06e6){console[_0x53b7b9(0x24c)]('\x20\x20'+a30_0xc6b51f[_0x53b7b9(0x102)](_0x18b775));}console[_0x53b7b9(0x24c)](_0x53b7b9(0x1cf)+_0x289714+'\x20--attribute\x20\x22'+_0x8f06e6[0x0]+'\x22');}return 0x1;}if(_0x4b0960[_0x53b7b9(0x160)]===!![]||_0x4b0960['behavior']===''){const _0x27c595=_0x7b62a9[_0x53b7b9(0x218)]?.[_0x53b7b9(0x173)](_0x43b7e1=>_0x43b7e1[_0x53b7b9(0xf1)])||[];if(_0x27c595['length']===0x0)console[_0x53b7b9(0x24c)](a30_0xc6b51f[_0x53b7b9(0x198)](_0x53b7b9(0x273)));else{console[_0x53b7b9(0x24c)](a30_0xc6b51f[_0x53b7b9(0x198)](_0x53b7b9(0xf3))),console[_0x53b7b9(0x24c)]('Available\x20behaviors:');for(const _0x2e05a1 of _0x27c595){console[_0x53b7b9(0x24c)]('\x20\x20'+a30_0xc6b51f[_0x53b7b9(0x102)](_0x2e05a1));}console[_0x53b7b9(0x24c)](_0x53b7b9(0x1cf)+_0x289714+'\x20--behavior\x20\x22'+_0x27c595[0x0]+'\x22');}return 0x1;}const _0x4fdf41=createCommandSpinner(a30_0xc6b51f[_0x53b7b9(0x203)]('Fetching\x20sample\x20data...'),{'verbose':_0x4b0960[_0x53b7b9(0xf6)]});_0x4fdf41[_0x53b7b9(0x1a4)]();const _0x1f5bd6={'onProgress':_0x1b8c05=>{const _0x7889ef=_0x53b7b9;_0x4fdf41[_0x7889ef(0x1e7)]=formatProgressMessage(_0x1b8c05);}};if(_0x4b0960['master'])_0x1f5bd6['master']=!![];if(_0x4b0960[_0x53b7b9(0x22b)]&&typeof _0x4b0960['attribute']==='string')_0x1f5bd6['attribute']=_0x4b0960['attribute'];if(_0x4b0960['behavior']&&typeof _0x4b0960[_0x53b7b9(0x160)]===_0x53b7b9(0x24b))_0x1f5bd6[_0x53b7b9(0x160)]=_0x4b0960['behavior'];if(_0x4b0960[_0x53b7b9(0x27a)])_0x1f5bd6[_0x53b7b9(0x27a)]=!![];if(_0x4b0960[_0x53b7b9(0x1e1)])_0x1f5bd6['interval']=_0x4b0960[_0x53b7b9(0x1e1)];let _0x404d90;try{_0x404d90=await _0x253218['segment'][_0x53b7b9(0x1e0)](_0x3ab468,_0x1f5bd6),_0x4fdf41[_0x53b7b9(0x250)]();}catch(_0x43957d){_0x4fdf41[_0x53b7b9(0x250)]();throw _0x43957d;}return await this['displayPreviewResults'](_0x404d90,{'master':_0x4b0960[_0x53b7b9(0x24a)],'attribute':typeof _0x4b0960[_0x53b7b9(0x22b)]===_0x53b7b9(0x24b)?_0x4b0960[_0x53b7b9(0x22b)]:undefined,'behavior':typeof _0x4b0960[_0x53b7b9(0x160)]==='string'?_0x4b0960[_0x53b7b9(0x160)]:undefined,'enriched':_0x4b0960['enriched']}),_0x404d90['allValid']?0x0:0x1;}async[a30_0x2d1bab(0x205)](_0x4ce817,_0x4e626f){const _0x11e1c2=a30_0x2d1bab;console[_0x11e1c2(0x24c)]('\x0a'+a30_0xc6b51f['bold'](_0x11e1c2(0x27e))+'\x20'+_0x4ce817['name']),console[_0x11e1c2(0x24c)]('═'[_0x11e1c2(0x221)](0x3c));if(_0x4e626f[_0x11e1c2(0x24a)]&&_0x4ce817[_0x11e1c2(0x17a)]){const _0x572cdd=a30_0xc6b51f[_0x11e1c2(0x203)](_0x11e1c2(0x21f))+'\x20'+a30_0xc6b51f[_0x11e1c2(0x18b)](_0x4ce817['master']['database']+'.'+_0x4ce817['master']['table']);await this[_0x11e1c2(0x106)](_0x572cdd,_0x4ce817['sampleData']);}else{if(_0x4e626f[_0x11e1c2(0x22b)]&&_0x4ce817[_0x11e1c2(0x17a)]){const _0x28bff8=a30_0xc6b51f[_0x11e1c2(0x203)](_0x11e1c2(0x265))+'\x20'+a30_0xc6b51f['bold'](_0x4e626f[_0x11e1c2(0x22b)]);await this[_0x11e1c2(0x106)](_0x28bff8,_0x4ce817[_0x11e1c2(0x17a)]);}else{if(_0x4e626f[_0x11e1c2(0x160)]&&_0x4ce817[_0x11e1c2(0x17a)]){const _0x202940=a30_0xc6b51f[_0x11e1c2(0x203)](_0x11e1c2(0x217))+'\x20'+a30_0xc6b51f[_0x11e1c2(0x18b)](_0x4e626f[_0x11e1c2(0x160)]);await this[_0x11e1c2(0x106)](_0x202940,_0x4ce817[_0x11e1c2(0x17a)]);}else{if(_0x4e626f[_0x11e1c2(0x27a)]&&_0x4ce817[_0x11e1c2(0x17a)]){const _0x10b873=a30_0xc6b51f['dim'](_0x11e1c2(0x132))+'\x20'+a30_0xc6b51f[_0x11e1c2(0x18b)](_0x11e1c2(0x17f));await this['displaySampleData'](_0x10b873,_0x4ce817[_0x11e1c2(0x17a)]);}else!_0x4ce817['sampleData']&&console['error'](_0x11e1c2(0x111));}}}if(_0x4ce817['errors'][_0x11e1c2(0x112)]>0x0){console[_0x11e1c2(0x24c)]('─'[_0x11e1c2(0x221)](0x3c)),console[_0x11e1c2(0x24c)]('\x0a'+a30_0xc6b51f[_0x11e1c2(0x198)](_0x11e1c2(0x177)));for(const _0x104186 of _0x4ce817['errors']){console[_0x11e1c2(0x24c)]('\x20\x20'+a30_0xc6b51f[_0x11e1c2(0x198)]('•')+'\x20'+_0x104186);}}}async[a30_0x2d1bab(0x106)](_0x465a7a,_0x39905f){const _0x204d3c=a30_0x2d1bab;if(_0x39905f[_0x204d3c(0x112)]===0x0){console['error']('\x0a'+_0x465a7a),console[_0x204d3c(0x24c)](_0x204d3c(0x1fc));return;}console[_0x204d3c(0x24c)]('\x0a'+_0x465a7a);const _0x13ddcd=Object[_0x204d3c(0x179)](_0x39905f[0x0])[_0x204d3c(0x173)](_0x3ec147=>({'name':_0x3ec147,'type':typeof _0x39905f[0x0][_0x3ec147]===_0x204d3c(0x26f)?'double':'varchar'})),_0x224e0b={'queryId':_0x204d3c(0x11a),'columns':_0x13ddcd,'data':_0x39905f,'stats':{'state':_0x204d3c(0x259),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x39905f[_0x204d3c(0x112)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x3a6141=formatAsTable(_0x224e0b,_0x39905f[_0x204d3c(0x112)],!![]);await writeOutput(_0x3a6141,undefined,_0x204d3c(0x262));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{['name']=a30_0x2d1bab(0x10d);[a30_0x2d1bab(0x1f1)]=a30_0x2d1bab(0x14a);async['execute'](_0x182e5f){const _0x7123f9=a30_0x2d1bab,{options:_0x232de2,args:_0x54caa2,tdx:_0x395b36}=_0x182e5f,_0x58a28a=_0x232de2,_0x19eb36=_0x54caa2[0x0]||_0x232de2[_0x7123f9(0x1c8)];if(!_0x19eb36)return showParentSegmentNotSetError(_0x7123f9(0x150)+_0x7123f9(0x12c)),0x1;const _0x23c965=resolveYamlFile(_0x19eb36);if(existsSync(_0x23c965)){_0x58a28a[_0x7123f9(0xf6)]&&console[_0x7123f9(0x24c)]('Found\x20YAML\x20file:\x20'+_0x23c965);let _0x542119;try{_0x542119=readFileSync(_0x23c965,'utf-8');}catch(_0x3c57d8){const _0x437b05=_0x3c57d8 instanceof Error?_0x3c57d8['message']:String(_0x3c57d8);return console[_0x7123f9(0x24c)](_0x7123f9(0x264)+_0x437b05),0x1;}const _0x421a70=await withSpinner(_0x7123f9(0x15a),()=>_0x395b36[_0x7123f9(0x10a)][_0x7123f9(0x1cc)](_0x542119),{'verbose':_0x58a28a['verbose']}),_0x39a3c7=_0x421a70[_0x7123f9(0x1d8)],{isNew:_0x241f06,name:_0x23f5a0,hasChanges:_0x3453ad,diffFormatted:_0x507c80}=_0x39a3c7;if(_0x3453ad){_0x241f06?console[_0x7123f9(0x24c)](_0x7123f9(0x1a9)+_0x23f5a0+'\x27:'):console[_0x7123f9(0x24c)]('\x0aChanges\x20to\x20apply\x20to\x20\x27'+_0x23f5a0+'\x27:');console[_0x7123f9(0x24c)]('─'[_0x7123f9(0x221)](0x3c)),console[_0x7123f9(0x24c)](_0x507c80),console[_0x7123f9(0x24c)]('─'[_0x7123f9(0x221)](0x3c));const _0x5792a3=_0x241f06?_0x7123f9(0x240)+_0x23f5a0+_0x7123f9(0x193):'Apply\x20changes\x20to\x20\x27'+_0x23f5a0+_0x7123f9(0x193);if(!_0x58a28a['yes']){if(!isInteractive())return console[_0x7123f9(0x24c)](a30_0xc6b51f[_0x7123f9(0x198)](_0x7123f9(0x1a0)),_0x7123f9(0x17c)),console['error'](a30_0xc6b51f[_0x7123f9(0x203)](_0x7123f9(0x10e))),0x1;const _0x15f6e=await confirmKey(_0x5792a3);if(!_0x15f6e)return console[_0x7123f9(0x24c)](a30_0xc6b51f[_0x7123f9(0x184)](_0x7123f9(0x131))),0x1;}const _0x3f349d=_0x241f06?_0x7123f9(0x261):_0x7123f9(0x105);await withSpinner(_0x3f349d+_0x7123f9(0x210)+_0x23f5a0+'\x27...',()=>_0x39a3c7[_0x7123f9(0x19d)](),{'verbose':_0x58a28a[_0x7123f9(0xf6)]});const _0x2a23b5=_0x241f06?_0x7123f9(0x144):_0x7123f9(0x10c);console[_0x7123f9(0x24c)]('✔\x20'+_0x2a23b5+_0x7123f9(0x210)+_0x23f5a0+'\x27');}else console['error'](_0x7123f9(0x18d)+_0x23f5a0+_0x7123f9(0x236));}const _0xcb61ff=await withSpinner(_0x7123f9(0x108)+_0x19eb36+_0x7123f9(0x27b),()=>_0x395b36[_0x7123f9(0x10a)]['runParent'](_0x19eb36),{'verbose':_0x58a28a[_0x7123f9(0xf6)]}),_0x27993c=_0xcb61ff[_0x7123f9(0x1d8)],_0x5f4527=getConsoleUrl(_0x58a28a[_0x7123f9(0x12f)],_0x7123f9(0x19e)+_0x27993c['workflowId']+_0x7123f9(0x1f0)+_0x27993c[_0x7123f9(0x1db)]+_0x7123f9(0x155)+_0x27993c[_0x7123f9(0x11f)]);return console[_0x7123f9(0x24c)](_0x7123f9(0x1a8)),console['error']('\x20\x20'+a30_0xc6b51f[_0x7123f9(0x203)]('Audience\x20ID:')+'\x20'+_0x27993c[_0x7123f9(0x18e)]),console[_0x7123f9(0x24c)]('\x20\x20'+a30_0xc6b51f[_0x7123f9(0x203)](_0x7123f9(0x20a))+'\x20'+_0x27993c[_0x7123f9(0x223)]),console[_0x7123f9(0x24c)]('\x20\x20'+a30_0xc6b51f[_0x7123f9(0x203)](_0x7123f9(0x127))+'\x20'+_0x27993c[_0x7123f9(0x1db)]),console[_0x7123f9(0x24c)]('\x20\x20'+a30_0xc6b51f[_0x7123f9(0x203)]('Attempt:')+'\x20'+_0x27993c[_0x7123f9(0x11f)]),console[_0x7123f9(0x24c)]('\x20\x20'+_0x5f4527),console[_0x7123f9(0x24c)]('\x0a'+a30_0xc6b51f[_0x7123f9(0x203)](_0x7123f9(0x27c))+_0x7123f9(0x18f)+_0x27993c[_0x7123f9(0x11f)]+_0x7123f9(0x175)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a30_0x2d1bab(0xf1)]=a30_0x2d1bab(0x133);['description']='List\x20available\x20fields\x20for\x20segmentation';async[a30_0x2d1bab(0x26d)](_0x22f84c){const _0x1ac811=a30_0x2d1bab,{options:_0xc234d4,args:_0x17c753,tdx:_0x184aaf}=_0x22f84c,_0x32194a=_0x17c753[0x0]||_0xc234d4[_0x1ac811(0x1c8)];if(!_0x32194a)return showParentSegmentNotSetError(_0x1ac811(0x23d)+_0x1ac811(0x215)),0x1;_0xc234d4[_0x1ac811(0xf6)]&&(console['error'](_0x1ac811(0x1ce)+_0xc234d4[_0x1ac811(0x12f)]),console[_0x1ac811(0x24c)](_0x1ac811(0x1a6)+_0x32194a));const _0x273ed1=await withSpinner(_0x1ac811(0x1c0)+_0x32194a+_0x1ac811(0x27b),()=>_0x184aaf[_0x1ac811(0x10a)][_0x1ac811(0x17d)](_0x32194a),{'verbose':_0xc234d4[_0x1ac811(0xf6)]}),_0x4ac106=_0x273ed1[_0x1ac811(0x1d8)];console[_0x1ac811(0x24c)]('✔\x20Found\x20'+_0x4ac106[_0x1ac811(0x112)]+_0x1ac811(0x12d)+(_0x4ac106[_0x1ac811(0x112)]!==0x1?'s':''));if(_0xc234d4['json']||_0xc234d4['jsonl'])return await handleSDKOutput(_0x4ac106,_0xc234d4),0x0;return displayFieldsHumanReadable(_0x4ac106,_0x32194a),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{['name']=a30_0x2d1bab(0x141);[a30_0x2d1bab(0x1f1)]=a30_0x2d1bab(0x1aa);async['execute'](_0x53760a){const _0x5f2184=a30_0x2d1bab,{options:_0x5ee9b7,args:_0xd1b75d,tdx:_0x440127}=_0x53760a,_0x4772f7=_0x5ee9b7,_0x149ae7=_0xd1b75d[0x0]||_0x5ee9b7[_0x5f2184(0x1c8)];if(!_0x149ae7)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a'+_0x5f2184(0x15e)+_0x5f2184(0x251)+_0x5f2184(0x181)),0x1;_0x5ee9b7[_0x5f2184(0xf6)]&&(console['error'](_0x5f2184(0x1ce)+_0x5ee9b7[_0x5f2184(0x12f)]),console[_0x5f2184(0x24c)]('Parent\x20segment:\x20'+_0x149ae7));const _0x2efd7a=await withSpinner('Fetching\x20parent\x20segment\x20\x27'+_0x149ae7+_0x5f2184(0x27b),()=>_0x440127[_0x5f2184(0x10a)]['getParentFull'](_0x149ae7),{'verbose':_0x5ee9b7['verbose']}),_0xa58393=_0x2efd7a[_0x5f2184(0x1d8)];if(_0x4772f7[_0x5f2184(0x1ab)]){const _0xc1278a=getConsoleNextUrl(_0x4772f7[_0x5f2184(0x12f)],_0x5f2184(0x20e)+_0xa58393['id']);return console[_0x5f2184(0x24c)](a30_0xc6b51f[_0x5f2184(0x148)]('✔')+'\x20Opening\x20'+a30_0xc6b51f[_0x5f2184(0x102)](_0xc1278a)),openBrowser(_0xc1278a),0x0;}return await handleSingleObjectOutput(_0xa58393,_0x5ee9b7),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a30_0x2d1bab(0xf1)]='segment:parent:desc';[a30_0x2d1bab(0x1f1)]=a30_0x2d1bab(0x238);async[a30_0x2d1bab(0x26d)](_0x5f3239){const _0x30ea44=a30_0x2d1bab,{options:_0x1c70cc,args:_0x2dc701,tdx:_0x57d747}=_0x5f3239,_0x1e65b6=_0x1c70cc,_0x12d07a=_0x2dc701[0x0]||_0x1c70cc[_0x30ea44(0x1c8)];if(!_0x12d07a)return showParentSegmentNotSetError(_0x30ea44(0x157)+_0x30ea44(0x1c6)+'Options:\x0a'+_0x30ea44(0x243)),0x1;_0x1c70cc[_0x30ea44(0xf6)]&&(console['error'](_0x30ea44(0x1ce)+_0x1c70cc[_0x30ea44(0x12f)]),console[_0x30ea44(0x24c)](_0x30ea44(0x1a6)+_0x12d07a));const _0x2aaf0f=await withSpinner(_0x30ea44(0x216)+_0x12d07a+'\x27...',()=>_0x57d747['segment']['resolveParentId'](_0x12d07a),{'verbose':_0x1c70cc[_0x30ea44(0xf6)]}),_0x458e18=_0x2aaf0f['data'],_0x22e2b6=_0x57d747['segment'][_0x30ea44(0x280)](_0x458e18);if(_0x1e65b6[_0x30ea44(0x249)]){const _0x1a1621=await this[_0x30ea44(0x272)](_0x5f3239,_0x12d07a,_0x458e18,_0x22e2b6),_0x29a3e5=this['formatSchemaJson'](_0x1a1621);writeFileSync(_0x1e65b6[_0x30ea44(0x249)],_0x29a3e5);const _0x51f515=_0x1a1621['customers'][_0x30ea44(0x1d4)][_0x30ea44(0x112)]+_0x1a1621[_0x30ea44(0x218)][_0x30ea44(0x1ad)]((_0x3f554e,_0x40680c)=>_0x3f554e+_0x40680c[_0x30ea44(0x1d4)]['length'],0x0),_0x1ce3a2=_0x1a1621[_0x30ea44(0x218)]['filter'](_0x537432=>_0x537432['columns']['length']===0x0)[_0x30ea44(0x112)];return console[_0x30ea44(0x23f)](_0x30ea44(0x146)+_0x1e65b6[_0x30ea44(0x249)]),console[_0x30ea44(0x23f)]('\x20\x20Database:\x20'+_0x22e2b6),console[_0x30ea44(0x23f)]('\x20\x20Tables:\x201\x20customers\x20+\x20'+_0x1a1621[_0x30ea44(0x218)]['length']+_0x30ea44(0x248)),console['log'](_0x30ea44(0x255)+_0x51f515+_0x30ea44(0x15f)),_0x1ce3a2>0x0&&console[_0x30ea44(0x23f)]('\x20\x20Note:\x20'+_0x1ce3a2+_0x30ea44(0x224)),0x0;}console['error']('\x0a'+a30_0xc6b51f[_0x30ea44(0x18b)](_0x30ea44(0x1e5))+'\x20'+a30_0xc6b51f[_0x30ea44(0x102)](_0x22e2b6));const _0x5a5a06=await withSpinner(_0x30ea44(0x166),()=>_0x57d747['segment'][_0x30ea44(0x1dd)](_0x458e18),{'verbose':_0x1c70cc[_0x30ea44(0xf6)]});console[_0x30ea44(0x24c)]('\x0a'+a30_0xc6b51f[_0x30ea44(0x18b)](_0x30ea44(0x128))+'\x20'+a30_0xc6b51f[_0x30ea44(0x203)]('('+_0x22e2b6+_0x30ea44(0x11e)));const _0x29966=await executeSchemaQuery(_0x5a5a06[_0x30ea44(0x1d8)],_0x57d747,_0x1c70cc);await handleQueryOutput(_0x29966,_0x1c70cc);const _0x234768=await withSpinner('Fetching\x20behavior\x20list...',()=>_0x57d747['segment'][_0x30ea44(0x247)](_0x458e18),{'verbose':_0x1c70cc[_0x30ea44(0xf6)]});for(const _0x1634a7 of _0x234768['data']){const _0xb57205=_0x30ea44(0x1cb)+_0x1634a7[_0x30ea44(0x220)]()[_0x30ea44(0x1f8)](/\s+/g,'_'),_0x2d59f5='SELECT\x20*\x20FROM\x20'+_0x22e2b6+'.'+_0xb57205;console['error']('\x0a'+a30_0xc6b51f[_0x30ea44(0x18b)](_0x1634a7)+'\x20'+a30_0xc6b51f[_0x30ea44(0x203)]('('+_0x22e2b6+'.'+_0xb57205+')'));try{const _0x29c26a=await executeSchemaQuery(_0x2d59f5,_0x57d747,_0x1c70cc);await handleQueryOutput(_0x29c26a,_0x1c70cc);}catch{console[_0x30ea44(0x24c)](a30_0xc6b51f[_0x30ea44(0x184)](_0x30ea44(0x143)));}}return 0x0;}async['collectSchema'](_0x390c73,_0x52c189,_0x3a39a4,_0x5ea8e6){const _0xb9bcc2=a30_0x2d1bab,{options:_0x302a2c,tdx:_0x64d4b2}=_0x390c73,_0x1289ee=await withSpinner('Fetching\x20customers\x20schema...',()=>_0x64d4b2[_0xb9bcc2(0x10a)]['getParentSQL'](_0x3a39a4),{'verbose':_0x302a2c[_0xb9bcc2(0xf6)]}),_0x36d9ec=await executeSchemaQuery(_0x1289ee['data'],_0x64d4b2,_0x302a2c),_0x3de49d=_0x36d9ec[_0xb9bcc2(0x1d8)][_0xb9bcc2(0x173)](_0x2dba5e=>({'name':_0x2dba5e[_0xb9bcc2(0x163)],'type':_0x2dba5e['column_type']})),_0x52ce6a=await withSpinner('Fetching\x20behavior\x20list...',()=>_0x64d4b2['segment'][_0xb9bcc2(0x247)](_0x3a39a4),{'verbose':_0x302a2c[_0xb9bcc2(0xf6)]}),_0x372204=[];for(const _0x112e10 of _0x52ce6a['data']){const _0x2d9809=_0xb9bcc2(0x1cb)+_0x112e10['toLowerCase']()[_0xb9bcc2(0x1f8)](/\s+/g,'_'),_0x46e71b=_0xb9bcc2(0x222)+_0x5ea8e6+'.'+_0x2d9809;let _0x26aab9=[];try{const _0x39635f=await executeSchemaQuery(_0x46e71b,_0x64d4b2,_0x302a2c);_0x26aab9=_0x39635f['data'][_0xb9bcc2(0x173)](_0x3dbb08=>({'name':_0x3dbb08[_0xb9bcc2(0x163)],'type':_0x3dbb08['column_type']}));}catch{}_0x372204[_0xb9bcc2(0x16f)]({'table':_0x2d9809,'columns':_0x26aab9});}return{'database':_0x5ea8e6,'parent_segment':_0x52c189,'parent_id':_0x3a39a4,'customers':{'table':'customers','columns':_0x3de49d},'behaviors':_0x372204};}['formatSchemaJson'](_0x498c45){const _0x4e2d42=a30_0x2d1bab,_0x1664e7=_0x490fb0=>{const _0x320856=a30_0x5468;if(_0x490fb0[_0x320856(0x112)]===0x0)return'[]';const _0x5a0ee5=_0x490fb0[_0x320856(0x173)](_0x28088f=>'\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22'+_0x28088f[_0x320856(0xf1)]+_0x320856(0x24e)+_0x28088f['type']+_0x320856(0x191));return'[\x0a'+_0x5a0ee5[_0x320856(0x123)](',\x0a')+_0x320856(0x176);},_0x43e897=_0x498c45[_0x4e2d42(0x218)][_0x4e2d42(0x173)](_0x2df0bb=>{const _0x343290=_0x4e2d42;return'\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22'+_0x2df0bb[_0x343290(0x262)]+'\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20'+_0x1664e7(_0x2df0bb[_0x343290(0x1d4)])[_0x343290(0x1f8)](/^/gm,'\x20\x20')[_0x343290(0x239)]()+'\x0a\x20\x20\x20\x20}';})[_0x4e2d42(0x123)](',\x0a');return _0x4e2d42(0x192)+_0x498c45[_0x4e2d42(0x13d)]+_0x4e2d42(0x185)+_0x498c45['parent_segment']+_0x4e2d42(0x16b)+_0x498c45[_0x4e2d42(0x117)]+_0x4e2d42(0x200)+_0x498c45['customers'][_0x4e2d42(0x262)]+'\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20'+_0x1664e7(_0x498c45[_0x4e2d42(0x128)]['columns'])[_0x4e2d42(0x1f8)](/^/gm,'\x20\x20')[_0x4e2d42(0x239)]()+'\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a'+_0x43e897+'\x0a\x20\x20]\x0a}\x0a';}}export class ParentSegmentSQLCommand extends BaseCommand{[a30_0x2d1bab(0xf1)]='segment:parent:sql';['description']=a30_0x2d1bab(0x1b5);async[a30_0x2d1bab(0x26d)](_0x298e1d){const _0x1cfdba=a30_0x2d1bab,{options:_0x475e40,args:_0x4b6ed0,tdx:_0x248f79}=_0x298e1d,_0x4eeaa2=_0x4b6ed0[0x0]||_0x475e40[_0x1cfdba(0x1c8)];if(!_0x4eeaa2)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a'+_0x1cfdba(0x1d7)),0x1;_0x475e40['verbose']&&(console[_0x1cfdba(0x24c)](_0x1cfdba(0x1ce)+_0x475e40[_0x1cfdba(0x12f)]),console[_0x1cfdba(0x24c)]('Parent\x20segment:\x20'+_0x4eeaa2));const _0x21d07d=await withSpinner(_0x1cfdba(0x216)+_0x4eeaa2+_0x1cfdba(0x27b),()=>_0x248f79[_0x1cfdba(0x10a)][_0x1cfdba(0x186)](_0x4eeaa2),{'verbose':_0x475e40[_0x1cfdba(0xf6)]}),_0xe91c1f=_0x21d07d['data'],_0x1e35fa=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x4eeaa2+_0x1cfdba(0x27b),()=>_0x248f79[_0x1cfdba(0x10a)][_0x1cfdba(0x1dd)](_0xe91c1f),{'verbose':_0x475e40[_0x1cfdba(0xf6)]}),_0x585c09=_0x1e35fa[_0x1cfdba(0x1d8)];return _0x475e40['format']===_0x1cfdba(0x113)||_0x475e40[_0x1cfdba(0x107)]==='jsonl'?await handleSDKOutput([{'sql':_0x585c09}],_0x475e40):console['log'](_0x585c09),0x0;}}function a30_0x2faa(){const _0x287157=['2744418thpTei','/\x20directory.\x0a','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','\x0aChanges\x20to\x20\x27','dirname','Pattern:\x20','\x20Added\x20RT\x202.0\x20template\x20section','/attempt/','behaviorsFile','Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20all\x20tables\x20(requires\x20context)\x0a','\x20--enriched','⚠️\x20\x20personalization_services\x20section\x20already\x20exists\x20in\x20','Analyzing\x20changes...','Updating\x20parent\x20segment\x20\x27','win32','Default','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','\x20total','behavior','\x20=\x20','addBehaviors','column_name','✔\x20Created\x20parent\x20segment\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','Fetching\x20customers\x20schema...','createParent','timezone','unref','filter','\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','Personalization:','limit','push','`\x20to\x20download\x20the\x20configuration\x20first','Usage:\x20tdx\x20ps\x20pz\x20init\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Add\x20PZ\x20template\x20(requires\x20context)\x0a','realtime_enabled','map','\x20--interval\x20','\x20kill','\x0a\x20\x20\x20\x20]','Errors:','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','keys','sampleData','ps:pz:list','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','listFields','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','Master\x20+\x20Attributes','✔\x20Found\x20','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','ignore','segment:parent:create','yellow','\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22','resolveParentId','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','\x20to\x20push\x20the\x20configuration','last_page_viewed','Usage:\x20tdx\x20ps\x20rt\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20RT\x20config\x20(requires\x20context)\x0a','bold','\x20--behavior\x20\x22','✔\x20No\x20changes\x20-\x20\x27','audienceId','\x20tdx\x20wf\x20attempt\x20','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','\x22\x20}','{\x0a\x20\x20\x22database\x22:\x20\x22','\x27\x20and\x20run\x20workflow?','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','.yaml','%)\x20','segment:parent:pull','red','parent_segment','No\x20parent\x20segments\x20match\x20pattern:\x20','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','Listing\x20RT-enabled\x20parent\x20segments...','apply','/app/workflows/','Name:\x20','\x0aError:','personalizationServices','⚡\x20Enabled','Listing\x20parent\x20segments...','start','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','Parent\x20segment:\x20','joinKey','\x0a✔\x20Workflow\x20started','\x0aNew\x20parent\x20segment\x20\x27','Show\x20parent\x20segment\x20details','web','Creating\x20parent\x20segment\x20\x27','reduce','/{name}.yml\x0a','Validating\x20RT\x20configuration...','\x20--behavior\x20\x22<name>\x22','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','schemaError','List\x20personalization\x20services\x20for\x20a\x20parent\x20segment','displayMasterInfo','Get\x20SQL\x20query\x20for\x20parent\x20segment','stats','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','displayBehaviorsStats','SQL\x20query:\x0a','sourceTableError','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','in\x20','6112422RSEaPP','\x20service(s)\x20configured','\x0aTip:\x20Run\x20`tdx\x20ps\x20pz\x20init`\x20to\x20add\x20a\x20template\x20personalization\x20section\x20to\x20your\x20YAML','Listing\x20fields\x20for\x20\x27','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','segment:parent:show','Error\x20parsing\x20YAML:\x20','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','events','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20all\x20tables\x20for\x20parent\x20segment\x0a\x0a','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','parentSegment','Overwrite\x20\x27','true','behavior_','pushParentYaml','displayValidateResults','Site:\x20','\x0aUsage:\x20tdx\x20ps\x20preview\x20','trigger_event','\x20to\x20configure\x20your\x20personalization\x20service','rowCount','\x20is\x20already\x20up\x20to\x20date','columns','yes','tdx\x20ps\x20push\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','data','displayRealtimeInfo','listParents','workflowSessionId','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','getParentSQL','sort','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','previewParentYaml','interval','\x20configured','\x20[Job\x20ID:\x20','jsonl','Output\x20Database:','isDirectory','text','primaryKey','Usage:\x20tdx\x20ps\x20pz\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20PZ\x20services\x20(requires\x20context)\x0a','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','xdg-open','platform','\x20rows)','segment:parent:list','✔\x20Query\x20completed:\x20Processed\x20','/sessions/','description','\x20\x202.\x20Run\x20','information_schema','Listing\x20RT-enabled\x20parent\x20segments\x20matching\x20\x27','5432500UBLrsB','579542tZCZfo','page_view','replace','addAttributesFile','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','4060268oIeQdS','\x20\x20No\x20sample\x20data\x20available','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','displayPreviewHints','column','\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22','Validating\x20configuration...','enabled','dim','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','displayPreviewResults','label','Validate\x20RT\x202.0\x20configuration\x20from\x20parent\x20segment\x20YAML','segment:parent:validate','⚡\x20Not\x20enabled','Status:','customersWithEvents','attributes','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','/app/dw/parentSegments/','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','\x20parent\x20segment\x20\x27','Columns:','list','\x20--attribute\x20\x22','updateParent','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','Resolving\x20parent\x20segment\x20\x27','Behavior:','behaviors','Rows:','Events:','Validate:','match','displayColumns','realtime','Master:','toLowerCase','repeat','SELECT\x20*\x20FROM\x20','status','\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)','\x20--attribute\x20\x22<name>\x22','message','toFixed','customerPercent','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','displayAttributesStats','attribute','Error:\x20--attribute\x20requires\x20a\x20name\x0a','using\x20the\x20default\x20path:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','population','localeCompare','Next\x20steps:','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','ps:rt:list','Coverage:','To\x20view\x20sample\x20data:','\x27\x20is\x20up\x20to\x20date','3134087HIXeMT','Show\x20parent\x20segment\x20schema\x20(column\x20types)','trim','realtime:','sections','personalization_services','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','Executing\x20parent\x20segment\x20query...','log','Create\x20parent\x20segment\x20\x27','.yml','Fetching\x20current\x20configuration\x20for\x20\x27','\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path','indexOf','SELECT\x20*\x20FROM\x20(\x0a','\x27\x20is\x20already\x20up\x20to\x20date','getBehaviorNames','\x20behaviors','output','master','string','error','Behaviors','\x22,\x20\x22type\x22:\x20\x22','utf-8','stop','Options:\x0a','addAttributes','3RLMFpE','setJobId','\x20\x20Columns:\x20','/\x20directories\x20exist.','ps:rt:validate','endsWith','FINISHED','14ScXoDg','Master\x20Table','attributesFile','Source:','foreignKey','coveragePercent','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','Creating','table','\x20parent\x20segment','Error\x20reading\x20file:\x20','Attribute:','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','Personalization\x20service\x20description','scheduleType','820616MmBAhj','sourceTableValid','personalization','Add\x20template\x20personalization\x20section\x20to\x20parent\x20segment\x20YAML','execute','use','number','\x0a⚠️\x20\x20Both\x20','Fetching\x20parent\x20segment\x20\x27','collectSchema','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','processedRows','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','Error:','schemaValid','\x20Added\x20personalization\x20template\x20to\x20','Available\x20attributes:','enriched','\x27...','To\x20cancel:','YAML\x20file:\x20','Preview:','query','getOutputDatabaseName','stitchingKeys','\x20personalization\x20service','name','customerGroupFile','Error:\x20--behavior\x20requires\x20a\x20name\x0a','\x20rows\x20','\x27\x20with\x20ID:\x20','verbose','\x20\x20\x20\x20','darwin','scheduleOption','Join\x20on:','\x20\x20\x20\x20-\x20','\x5c$&','3UXKfqV','segment:parent:preview','\x20+\x20[','Error:\x20File\x20not\x20found:\x20','\x20\x20\x20','cyan','tdx\x20ps\x20preview\x20','run','Updating','displaySampleData','format','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','-1d','segment','Database:\x20','Updated','segment:parent:run','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','segment:parent:update','\x0aChanges\x20to\x20apply\x20to\x20\x27','\x0aNo\x20sample\x20data\x20available','length','json','all','50hSDqkh','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','parent_id','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','No\x20parent\x20segments\x20found','preview','No\x20personalization\x20services\x20configured','errors','allValid','.customers)','workflowAttemptId','Error:\x20--database\x20and\x20--table\x20are\x20required','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','Options\x20(one\x20required):\x0a','join','List\x20parent\x20segments\x20with\x20RT\x202.0\x20status','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','✔\x20Updated\x20parent\x20segment\x20\x27','Session:','customers','session','totalEvents','getParentFull','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','\x20field','elapsedTimeMillis','site','user_id','Aborted.','Enriched:','segment:parent:fields','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','Table:\x20','idStitching','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','/\x20and\x20','RT\x202.0:','validateParentYaml','matchedCount','Attributes','database','single','valid','\x20RT-enabled\x20parent\x20segment','segment:parent:view','pullParentYaml','\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)','Created','RT\x202.0\x20Validate:','Schema\x20saved\x20to\x20','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','green','Join:','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','Error:\x20Parent\x20segment\x20name\x20is\x20required','test','displaySummary'];a30_0x2faa=function(){return _0x287157;};return a30_0x2faa();}export class ParentSegmentShowCommand extends BaseCommand{[a30_0x2d1bab(0xf1)]=a30_0x2d1bab(0x1c2);[a30_0x2d1bab(0x1f1)]=a30_0x2d1bab(0x19b);async[a30_0x2d1bab(0x26d)](_0xae2bb7){const _0x54d8be=a30_0x2d1bab,{options:_0x315ee7,args:_0x2f84ce,tdx:_0x56f8d1}=_0xae2bb7,_0x27d1af=_0x2f84ce[0x0]||_0x315ee7[_0x54d8be(0x1c8)];if(!_0x27d1af)return showParentSegmentNotSetError(_0x54d8be(0x1ea)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment'),0x1;_0x315ee7[_0x54d8be(0xf6)]&&(console['error'](_0x54d8be(0x1ce)+_0x315ee7[_0x54d8be(0x12f)]),console[_0x54d8be(0x24c)]('Parent\x20segment:\x20'+_0x27d1af));const _0x5cf1d2=await withSpinner(_0x54d8be(0x216)+_0x27d1af+_0x54d8be(0x27b),()=>_0x56f8d1[_0x54d8be(0x10a)][_0x54d8be(0x186)](_0x27d1af),{'verbose':_0x315ee7[_0x54d8be(0xf6)]}),_0x522fb0=_0x5cf1d2[_0x54d8be(0x1d8)],_0x434280=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x27d1af+'\x27...',()=>_0x56f8d1[_0x54d8be(0x10a)]['getParentSQL'](_0x522fb0),{'verbose':_0x315ee7[_0x54d8be(0xf6)]});let _0x267c98=_0x434280[_0x54d8be(0x1d8)];const _0x361994=resolveLimit(_0x315ee7[_0x54d8be(0x16e)],DEFAULT_DISPLAY_LIMIT),_0x5e61fc=/\bLIMIT\s+\d+/i[_0x54d8be(0x14c)](_0x267c98);!_0x5e61fc&&(_0x267c98=_0x267c98[_0x54d8be(0x239)]()['replace'](/;+$/,''),_0x267c98=_0x54d8be(0x245)+_0x267c98+_0x54d8be(0x1bb)+_0x361994);_0x315ee7[_0x54d8be(0xf6)]&&console['error'](_0x54d8be(0x1b9)+_0x267c98);const _0x206baf=await withProgressSpinner(_0x54d8be(0x23e),async _0x2c5ce8=>{const _0xed35e6=_0x54d8be,_0x29c434=await _0x56f8d1[_0xed35e6(0x27f)]['execute'](_0x267c98,{'catalog':'td','schema':_0xed35e6(0x1f3),'onJobId':_0x352fba=>{const _0xa7084=_0xed35e6;_0x2c5ce8[_0xa7084(0x254)](_0x352fba);}});return _0x29c434;},{'verbose':_0x315ee7[_0x54d8be(0xf6)]}),_0x2f9c95=_0x206baf[_0x54d8be(0x1d8)],_0x5ac229=_0x2f9c95['jobId']?_0x54d8be(0x1e3)+_0x2f9c95['jobId']+']':'';return console[_0x54d8be(0x24c)](_0x54d8be(0x1ef)+_0x2f9c95[_0x54d8be(0x1b6)][_0x54d8be(0x274)]['toLocaleString']()+_0x54d8be(0xf4)+(_0x54d8be(0x1bc)+formatElapsed(_0x2f9c95[_0x54d8be(0x1b6)][_0x54d8be(0x12e)])+_0x5ac229)),await handleQueryOutput(_0x2f9c95,_0x315ee7),0x0;}}export class PSRtListCommand extends BaseCommand{[a30_0x2d1bab(0xf1)]=a30_0x2d1bab(0x233);[a30_0x2d1bab(0x1f1)]=a30_0x2d1bab(0x124);async[a30_0x2d1bab(0x26d)](_0x50d4cd){const _0x537bfe=a30_0x2d1bab,{options:_0x189f4c,args:_0x2d12bc,tdx:_0x5e537e}=_0x50d4cd,_0x2b483c=_0x2d12bc[0x0],_0x2aa2c6=await withSpinner(_0x2b483c?_0x537bfe(0x1f4)+_0x2b483c+_0x537bfe(0x27b):_0x537bfe(0x19c),()=>_0x5e537e[_0x537bfe(0x21e)][_0x537bfe(0x212)](),{'verbose':_0x189f4c[_0x537bfe(0xf6)]});let _0x286c0c=_0x2aa2c6[_0x537bfe(0x1d8)][_0x537bfe(0x16a)](_0x259518=>_0x259518[_0x537bfe(0x172)]);if(_0x2b483c){const _0x22e764=_0x2b483c['replace'](/[.+^${}()|[\]\\]/g,'\x5c$&')['replace'](/\*/g,'.*')['replace'](/\?/g,'.'),_0x6ebf37=new RegExp('^'+_0x22e764+'$','i');_0x286c0c=_0x286c0c[_0x537bfe(0x16a)](_0x38f99c=>_0x6ebf37[_0x537bfe(0x14c)](_0x38f99c[_0x537bfe(0xf1)]));}_0x286c0c['sort']((_0x17f76a,_0x5741d4)=>_0x17f76a[_0x537bfe(0xf1)]['localeCompare'](_0x5741d4[_0x537bfe(0xf1)])),console[_0x537bfe(0x24c)](_0x537bfe(0x180)+_0x286c0c[_0x537bfe(0x112)]+_0x537bfe(0x140)+(_0x286c0c[_0x537bfe(0x112)]!==0x1?'s':''));const _0x2f6fa5=_0x24b3c6=>{const _0x1e12fd=_0x537bfe;return getConsoleNextUrl(_0x189f4c[_0x1e12fd(0x12f)],_0x1e12fd(0x20e)+_0x24b3c6);};if(_0x189f4c[_0x537bfe(0x107)]===_0x537bfe(0x113)||_0x189f4c[_0x537bfe(0x107)]===_0x537bfe(0x1e4)){const _0x437ad8=_0x286c0c['map'](_0x11da98=>({..._0x11da98,'url':_0x2f6fa5(_0x11da98['id'])}));await handleSDKOutput(_0x437ad8,_0x189f4c);}else{if(_0x286c0c['length']===0x0)console[_0x537bfe(0x23f)]('No\x20RT-enabled\x20parent\x20segments\x20found');else for(const _0xea69aa of _0x286c0c){const _0x327d4c=_0xea69aa[_0x537bfe(0x22f)]?a30_0xc6b51f[_0x537bfe(0x203)]('\x20('+formatRows(_0xea69aa['population'])+')'):'',_0xca04ad=hyperlink(_0xea69aa[_0x537bfe(0xf1)],_0x2f6fa5(_0xea69aa['id']));console['log']('⚡\x20'+_0xca04ad+_0x327d4c);}}return 0x0;}}export class PSRtValidateCommand extends BaseParentSegmentCommand{[a30_0x2d1bab(0xf1)]=a30_0x2d1bab(0x257);['description']=a30_0x2d1bab(0x207);async['execute'](_0x43c3e3){const _0x5c9854=a30_0x2d1bab,{options:_0x147b10,args:_0x2594a5,tdx:_0x29fd1d}=_0x43c3e3,_0x23892d=_0x2594a5[0x0]||_0x147b10[_0x5c9854(0x1c8)];if(!_0x23892d)return showParentSegmentNotSetError(_0x5c9854(0x18a)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20rt\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20RT\x20config\x20for\x20specific\x20parent\x20segment'),0x1;const _0x1bee68=resolveYamlFile(_0x23892d);if(!existsSync(_0x1bee68))return showFileNotFoundError(_0x1bee68,_0x23892d),0x1;let _0xc125ac;try{_0xc125ac=readFileSync(_0x1bee68,_0x5c9854(0x24f));}catch(_0x1354bd){const _0x20625e=_0x1354bd instanceof Error?_0x1354bd[_0x5c9854(0x226)]:String(_0x1354bd);return console[_0x5c9854(0x24c)](_0x5c9854(0x264)+_0x20625e),0x1;}const _0x362f37=createCommandSpinner(a30_0xc6b51f[_0x5c9854(0x203)](_0x5c9854(0x1af)),{'verbose':_0x147b10[_0x5c9854(0xf6)]});_0x362f37[_0x5c9854(0x1a4)]();const _0x185a3c={'realtime':!![],'onProgress':_0x3ebac6=>{const _0x4678da=_0x5c9854;_0x362f37[_0x4678da(0x1e7)]=formatProgressMessage(_0x3ebac6);}};let _0x4dc659;try{_0x4dc659=await _0x29fd1d[_0x5c9854(0x10a)][_0x5c9854(0x13a)](_0xc125ac,_0x185a3c),_0x362f37[_0x5c9854(0x250)]();}catch(_0x51e694){_0x362f37[_0x5c9854(0x250)]();throw _0x51e694;}console[_0x5c9854(0x24c)]('\x0a'+a30_0xc6b51f[_0x5c9854(0x18b)](_0x5c9854(0x145))+'\x20'+_0x4dc659[_0x5c9854(0xf1)]),console[_0x5c9854(0x24c)]('═'[_0x5c9854(0x221)](0x3c)),displayRealtimeValidation(_0x4dc659),console['error']('─'[_0x5c9854(0x221)](0x3c));if(_0x4dc659[_0x5c9854(0x11c)]['length']>0x0){console[_0x5c9854(0x24c)]('\x0a'+a30_0xc6b51f['red'](_0x5c9854(0x177)));for(const _0x4e2327 of _0x4dc659[_0x5c9854(0x11c)]){console[_0x5c9854(0x24c)]('\x20\x20'+a30_0xc6b51f[_0x5c9854(0x198)]('•')+'\x20'+_0x4e2327);}}return _0x4dc659[_0x5c9854(0x11d)]&&console[_0x5c9854(0x24c)]('\x0a'+a30_0xc6b51f[_0x5c9854(0x148)]('✔')+'\x20RT\x20configuration\x20is\x20valid'),_0x4dc659['allValid']?0x0:0x1;}}export class PSPzListCommand extends BaseCommand{['name']=a30_0x2d1bab(0x17b);[a30_0x2d1bab(0x1f1)]=a30_0x2d1bab(0x1b3);async[a30_0x2d1bab(0x26d)](_0x5850c6){const _0x6a0ee=a30_0x2d1bab,{options:_0x2b4882,args:_0x4ced17,tdx:_0xadbb0b}=_0x5850c6,_0x1ce40b=_0x4ced17[0x0]||_0x2b4882[_0x6a0ee(0x1c8)];if(!_0x1ce40b)return showParentSegmentNotSetError(_0x6a0ee(0x1e9)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20PZ\x20services\x20for\x20specific\x20parent\x20segment'),0x1;const _0xb891c3=await withSpinner(_0x6a0ee(0x216)+_0x1ce40b+_0x6a0ee(0x27b),()=>_0xadbb0b[_0x6a0ee(0x10a)]['resolveParentId'](_0x1ce40b),{'verbose':_0x2b4882[_0x6a0ee(0xf6)]}),_0x1d9cba=_0xb891c3[_0x6a0ee(0x1d8)],_0x4fd301=await withSpinner('Listing\x20personalization\x20services\x20for\x20\x27'+_0x1ce40b+_0x6a0ee(0x27b),()=>_0xadbb0b[_0x6a0ee(0x26b)][_0x6a0ee(0x212)](_0x1d9cba),{'verbose':_0x2b4882['verbose']}),_0x2244ce=_0x4fd301['data'];console[_0x6a0ee(0x24c)](_0x6a0ee(0x180)+_0x2244ce['length']+_0x6a0ee(0xf0)+(_0x2244ce[_0x6a0ee(0x112)]!==0x1?'s':''));if(_0x2b4882['format']===_0x6a0ee(0x113)||_0x2b4882[_0x6a0ee(0x107)]===_0x6a0ee(0x1e4))await handleSDKOutput(_0x2244ce,_0x2b4882);else{if(_0x2244ce[_0x6a0ee(0x112)]===0x0)console[_0x6a0ee(0x23f)](_0x6a0ee(0x11b)),console[_0x6a0ee(0x24c)](a30_0xc6b51f[_0x6a0ee(0x102)](_0x6a0ee(0x1bf)));else for(const _0x57011 of _0x2244ce){const _0x1a4973=_0x57011[_0x6a0ee(0x23b)]?.[_0x6a0ee(0x112)]||0x0,_0x33de71=_0x57011[_0x6a0ee(0x1d0)]?a30_0xc6b51f['dim']('\x20trigger='+_0x57011[_0x6a0ee(0x1d0)]):'',_0x390a78=a30_0xc6b51f[_0x6a0ee(0x203)]('\x20('+_0x1a4973+'\x20section'+(_0x1a4973!==0x1?'s':'')+')');console['log']('\x20\x20'+_0x57011[_0x6a0ee(0xf1)]+_0x33de71+_0x390a78),_0x57011['description']&&console[_0x6a0ee(0x23f)]('\x20\x20\x20\x20'+a30_0xc6b51f[_0x6a0ee(0x203)](_0x57011[_0x6a0ee(0x1f1)]));}}return 0x0;}}export class PSPzInitCommand extends BaseParentSegmentCommand{['name']='ps:pz:init';['description']=a30_0x2d1bab(0x26c);async['execute'](_0x508ee4){const _0x2227ad=a30_0x2d1bab,{options:_0x58c90d,args:_0x153e1d}=_0x508ee4,_0x2ac3a6=_0x153e1d[0x0]||_0x58c90d[_0x2227ad(0x1c8)];if(!_0x2ac3a6)return showParentSegmentNotSetError(_0x2227ad(0x171)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20init\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Add\x20PZ\x20template\x20for\x20specific\x20parent\x20segment'),0x1;const _0x51af08=resolveYamlFile(_0x2ac3a6);if(!existsSync(_0x51af08))return showFileNotFoundError(_0x51af08,_0x2ac3a6),0x1;let _0x31ad87;try{_0x31ad87=readFileSync(_0x51af08,_0x2227ad(0x24f));}catch(_0x467166){const _0x439790=_0x467166 instanceof Error?_0x467166[_0x2227ad(0x226)]:String(_0x467166);return console['error']('Error\x20reading\x20file:\x20'+_0x439790),0x1;}let _0x523481;try{_0x523481=parseDef(_0x31ad87);}catch(_0x54869e){const _0x1f5ddd=_0x54869e instanceof Error?_0x54869e[_0x2227ad(0x226)]:String(_0x54869e);return console[_0x2227ad(0x24c)](a30_0xc6b51f[_0x2227ad(0x198)](_0x2227ad(0x1c3)+_0x1f5ddd)),0x1;}if(_0x523481['personalization_services']&&_0x523481[_0x2227ad(0x23c)][_0x2227ad(0x112)]>0x0)return console['error'](a30_0xc6b51f[_0x2227ad(0x184)](_0x2227ad(0x159)+_0x51af08)),console['error'](a30_0xc6b51f[_0x2227ad(0x203)](_0x2227ad(0x101)+_0x523481[_0x2227ad(0x23c)][_0x2227ad(0x112)]+_0x2227ad(0x1be))),0x1;!_0x523481[_0x2227ad(0x21e)]&&(_0x523481[_0x2227ad(0x21e)]={'events':[{'name':_0x2227ad(0x1f7),'source_table':'<database>.<table>'}],'attributes':[{'name':_0x2227ad(0x189),'type':_0x2227ad(0x13e)}],'id_stitching':{'primary_key':_0x523481[_0x2227ad(0x24a)][_0x2227ad(0x262)]==='customers'?'td_client_id':_0x2227ad(0x130)}});_0x523481[_0x2227ad(0x23c)]=[{'name':'My\x20Service','description':_0x2227ad(0x267),'trigger_event':'page_view','sections':[{'name':_0x2227ad(0x15d),'criteria':_0x2227ad(0x1ca),'attributes':[_0x2227ad(0x189)]}]}];const _0x299728=serializeDef(_0x523481);return writeFileSync(_0x51af08,_0x299728,_0x2227ad(0x24f)),console[_0x2227ad(0x24c)](a30_0xc6b51f['green']('✔')+_0x2227ad(0x278)+a30_0xc6b51f[_0x2227ad(0x102)](_0x51af08)),(!_0x523481[_0x2227ad(0x21e)]||_0x31ad87[_0x2227ad(0x244)](_0x2227ad(0x23a))===-0x1)&&console[_0x2227ad(0x24c)](a30_0xc6b51f[_0x2227ad(0x148)]('✔')+_0x2227ad(0x154)),console[_0x2227ad(0x24c)]('\x0a'+a30_0xc6b51f[_0x2227ad(0x203)](_0x2227ad(0x231))),console[_0x2227ad(0x24c)]('\x20\x201.\x20Edit\x20'+_0x51af08+_0x2227ad(0x1d1)),console[_0x2227ad(0x24c)](_0x2227ad(0x1f2)+a30_0xc6b51f[_0x2227ad(0x203)](_0x2227ad(0x1d6)+_0x2ac3a6)+_0x2227ad(0x188)),0x0;}}
@@ -1 +1 @@
1
- const a31_0x2b5544=a31_0xbd0e;function a31_0x28c9(){const _0x2f16fe=['Show\x20a\x20specific\x20policy\x20details\x20and\x20permissions\x20(admin\x20only)','\x20polic','Usage:\x20tdx\x20policy\x20show\x20<policy-name-or-id>','21TSdtYY','all','execute','data','listPolicies','List\x20all\x20policies\x20in\x20the\x20account\x20(admin\x20only)','2124lMVwYQ','bold','max','✔\x20Found\x20','policy','Fetching\x20permissions...','args','(ID:\x20','join','27010bgjjVI','45330978DrmgEB','getMyPermissions','\x20\x20\x20','Show\x20current\x20user\x20policies\x20and\x20effective\x20permissions','permissions','\x20user','administrator','getCurrent','error','validate',',\x20user_id:','policy\x20list','operation','\x20—\x20','verbose','name','getPolicyPermissions','39362ElNfWh','\x20\x20No\x20policies\x20assigned','Administrator','getPolicy','entries','🔑\x20Effective\x20Permissions','5vaAvjc','938775hfwDde','description','ies','Listing\x20policies...','dim','👥\x20Assigned\x20Users','getPolicyUsers','log','policies','user','\x20\x20•\x20','28133umEYlc','5700608XuXMaZ','policy\x20show','Fetching\x20policy...','Member','map','\x20assigned','9408564PPFPIO','email','\x20\x20No\x20permissions','8eVInVk','site','length'];a31_0x28c9=function(){return _0x2f16fe;};return a31_0x28c9();}(function(_0x300e19,_0x4d973b){const _0x99fb86=a31_0xbd0e,_0x156633=_0x300e19();while(!![]){try{const _0x57c429=-parseInt(_0x99fb86(0x1ea))/0x1+parseInt(_0x99fb86(0x226))/0x2*(parseInt(_0x99fb86(0x205))/0x3)+-parseInt(_0x99fb86(0x1f6))/0x4*(parseInt(_0x99fb86(0x1e9))/0x5)+-parseInt(_0x99fb86(0x1fc))/0x6+-parseInt(_0x99fb86(0x1f5))/0x7*(parseInt(_0x99fb86(0x1ff))/0x8)+parseInt(_0x99fb86(0x20b))/0x9*(parseInt(_0x99fb86(0x214))/0xa)+parseInt(_0x99fb86(0x215))/0xb;if(_0x57c429===_0x4d973b)break;else _0x156633['push'](_0x156633['shift']());}catch(_0x54b85f){_0x156633['push'](_0x156633['shift']());}}}(a31_0x28c9,0xea6a1));import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import a31_0x318ddc from'chalk';export class PolicyCommand extends BaseCommand{[a31_0x2b5544(0x224)]=a31_0x2b5544(0x20f);['description']=a31_0x2b5544(0x218);async['execute'](_0xcc102c){const _0x243aeb=a31_0x2b5544,{options:_0x125424,tdx:_0x27b61a}=_0xcc102c,_0x59ded1=await withSpinner(_0x243aeb(0x210),async()=>{const _0x212691=_0x243aeb,[_0x3cbd1b,_0x16d92e]=await Promise['all']([_0x27b61a[_0x212691(0x1f3)][_0x212691(0x21c)](),_0x27b61a[_0x212691(0x20f)][_0x212691(0x216)]()]);return{'userInfo':_0x3cbd1b,'permissions':_0x16d92e};},{'verbose':_0x125424['verbose']}),{userInfo:_0x46979b,permissions:_0x90d394}=_0x59ded1[_0x243aeb(0x208)];if(isStructuredFormat(_0x125424))return await handleSingleObjectOutput(_0x90d394,_0x125424),0x0;const _0x50eed1=_0x46979b['account_owner']?'Account\x20Owner':_0x46979b[_0x243aeb(0x21b)]?_0x243aeb(0x1e5):_0x243aeb(0x1f9);console['log']('\x0a'+a31_0x318ddc[_0x243aeb(0x20c)]('👤')+'\x20'+a31_0x318ddc[_0x243aeb(0x20c)](_0x46979b['name'])+'\x20'+a31_0x318ddc[_0x243aeb(0x1ee)]('('+_0x46979b[_0x243aeb(0x1fd)]+')')+_0x243aeb(0x222)+_0x50eed1),console['log'](a31_0x318ddc[_0x243aeb(0x1ee)](_0x243aeb(0x217)+_0x27b61a['context'][_0x243aeb(0x200)]+':'+_0x46979b['account_id']+_0x243aeb(0x21f)+_0x46979b['id']));const _0x4f7d6a=_0x90d394[_0x243aeb(0x1f2)];console[_0x243aeb(0x1f1)]('\x0a'+a31_0x318ddc[_0x243aeb(0x20c)]('📋\x20Assigned\x20Policies')+'\x20('+_0x4f7d6a[_0x243aeb(0x201)]+'):');if(_0x4f7d6a[_0x243aeb(0x201)]===0x0)console[_0x243aeb(0x1f1)](a31_0x318ddc[_0x243aeb(0x1ee)](_0x243aeb(0x227)));else for(const _0x2f8b37 of _0x4f7d6a){console[_0x243aeb(0x1f1)](_0x243aeb(0x1f4)+_0x2f8b37[_0x243aeb(0x224)]);}return printPermissionsMap(_0x90d394[_0x243aeb(0x219)]),console[_0x243aeb(0x1f1)](),0x0;}}export class PolicyListCommand extends BaseCommand{[a31_0x2b5544(0x224)]=a31_0x2b5544(0x220);[a31_0x2b5544(0x1eb)]=a31_0x2b5544(0x20a);async[a31_0x2b5544(0x207)](_0x110160){const _0x4d509b=a31_0x2b5544,{options:_0x4ef138,tdx:_0x3d56cb}=_0x110160,_0x41a71c=await withSpinner(_0x4d509b(0x1ed),()=>_0x3d56cb[_0x4d509b(0x20f)][_0x4d509b(0x209)](),{'verbose':_0x4ef138[_0x4d509b(0x223)]}),_0x113e13=_0x41a71c[_0x4d509b(0x208)];console[_0x4d509b(0x21d)](_0x4d509b(0x20e)+_0x113e13[_0x4d509b(0x201)]+_0x4d509b(0x203)+(_0x113e13['length']!==0x1?_0x4d509b(0x1ec):'y'));if(isStructuredFormat(_0x4ef138))return await handleSDKOutput(_0x113e13,_0x4ef138),0x0;if(_0x113e13['length']===0x0)console[_0x4d509b(0x1f1)](a31_0x318ddc[_0x4d509b(0x1ee)]('No\x20policies\x20found'));else for(const _0x5757af of _0x113e13){const _0x9d7bd1=_0x5757af[_0x4d509b(0x1eb)]?a31_0x318ddc[_0x4d509b(0x1ee)]('\x20—\x20'+_0x5757af[_0x4d509b(0x1eb)]):'';console['log']('\x20\x20•\x20'+_0x5757af['name']+_0x9d7bd1);}return 0x0;}}function a31_0xbd0e(_0x248ad1,_0x39a7b8){_0x248ad1=_0x248ad1-0x1e5;const _0x28c95f=a31_0x28c9();let _0xbd0e89=_0x28c95f[_0x248ad1];return _0xbd0e89;}export class PolicyShowCommand extends BaseCommand{[a31_0x2b5544(0x224)]=a31_0x2b5544(0x1f7);[a31_0x2b5544(0x1eb)]=a31_0x2b5544(0x202);[a31_0x2b5544(0x21e)](_0x56614c){const _0xd70480=a31_0x2b5544;if(_0x56614c[_0xd70480(0x211)]['length']===0x0)return _0xd70480(0x204);return undefined;}async[a31_0x2b5544(0x207)](_0x334ada){const _0x5f209b=a31_0x2b5544,{options:_0x366ff3,tdx:_0x48df34}=_0x334ada,_0x3f5e10=_0x334ada[_0x5f209b(0x211)][0x0],_0x55f41d=await withSpinner(_0x5f209b(0x1f8),async()=>{const _0x319dce=_0x5f209b,_0x2f2ecc=await _0x48df34['policy'][_0x319dce(0x1e6)](_0x3f5e10),[_0x37cbb0,_0x4de5f7]=await Promise[_0x319dce(0x206)]([_0x48df34[_0x319dce(0x20f)][_0x319dce(0x225)](_0x2f2ecc['id']),_0x48df34[_0x319dce(0x20f)][_0x319dce(0x1f0)](_0x2f2ecc['id'])]);return{'policy':_0x2f2ecc,'perms':_0x37cbb0,'users':_0x4de5f7};},{'verbose':_0x366ff3[_0x5f209b(0x223)]}),{policy:_0x2c0abb,perms:_0x4aa508,users:_0x402184}=_0x55f41d[_0x5f209b(0x208)];if(isStructuredFormat(_0x366ff3))return await handleSingleObjectOutput({..._0x2c0abb,'permissions':_0x4aa508[_0x5f209b(0x219)],'users':_0x402184},_0x366ff3),0x0;console[_0x5f209b(0x1f1)]('\x0a'+a31_0x318ddc[_0x5f209b(0x20c)]('📋')+'\x20'+a31_0x318ddc['bold'](_0x2c0abb[_0x5f209b(0x224)])+'\x20'+a31_0x318ddc['dim'](_0x5f209b(0x212)+_0x2c0abb['id']+')'));_0x2c0abb[_0x5f209b(0x1eb)]&&console[_0x5f209b(0x1f1)]('\x20\x20\x20'+a31_0x318ddc['dim'](_0x2c0abb[_0x5f209b(0x1eb)]));console['log']('\x20\x20\x20'+_0x402184[_0x5f209b(0x201)]+_0x5f209b(0x21a)+(_0x402184['length']!==0x1?'s':'')+_0x5f209b(0x1fb)),printPermissionsMap(_0x4aa508['permissions']);if(_0x402184[_0x5f209b(0x201)]>0x0){console['log']('\x0a'+a31_0x318ddc[_0x5f209b(0x20c)](_0x5f209b(0x1ef))+':');for(const _0xa51db5 of _0x402184){const _0xce535d=_0xa51db5[_0x5f209b(0x1fd)]&&_0xa51db5[_0x5f209b(0x1fd)]!==_0xa51db5[_0x5f209b(0x224)]?a31_0x318ddc[_0x5f209b(0x1ee)]('\x20<'+_0xa51db5[_0x5f209b(0x1fd)]+'>'):'';console[_0x5f209b(0x1f1)](_0x5f209b(0x1f4)+_0xa51db5[_0x5f209b(0x224)]+_0xce535d);}}return console[_0x5f209b(0x1f1)](),0x0;}}function printPermissionsMap(_0x52843f){const _0x504679=a31_0x2b5544,_0x4ec1d3=Object[_0x504679(0x1e7)](_0x52843f);console['log']('\x0a'+a31_0x318ddc[_0x504679(0x20c)](_0x504679(0x1e8))+':');if(_0x4ec1d3[_0x504679(0x201)]===0x0){console[_0x504679(0x1f1)](a31_0x318ddc[_0x504679(0x1ee)](_0x504679(0x1fe)));return;}const _0x1ed354=Math[_0x504679(0x20d)](..._0x4ec1d3[_0x504679(0x1fa)](([_0xe37457])=>_0xe37457['length']));for(const [_0x290e20,_0x58dde]of _0x4ec1d3){const _0x2f94b0=formatOperations(_0x58dde);console[_0x504679(0x1f1)]('\x20\x20'+_0x290e20['padEnd'](_0x1ed354+0x2)+_0x2f94b0);}}function formatOperations(_0x441b23){const _0x38b3ec=a31_0x2b5544,_0xad857c=[...new Set(_0x441b23['map'](_0x24f2f1=>_0x24f2f1[_0x38b3ec(0x221)]))];return _0xad857c[_0x38b3ec(0x213)](',\x20');}
1
+ const a31_0x34e2a7=a31_0x2128;(function(_0x38f222,_0x3bb6a9){const _0x5072a3=a31_0x2128,_0x83cf2f=_0x38f222();while(!![]){try{const _0x4a969b=-parseInt(_0x5072a3(0xdd))/0x1*(parseInt(_0x5072a3(0xbf))/0x2)+parseInt(_0x5072a3(0xa6))/0x3*(parseInt(_0x5072a3(0xb7))/0x4)+parseInt(_0x5072a3(0xaa))/0x5+parseInt(_0x5072a3(0xd2))/0x6*(-parseInt(_0x5072a3(0xa5))/0x7)+-parseInt(_0x5072a3(0xbc))/0x8+parseInt(_0x5072a3(0xa7))/0x9*(-parseInt(_0x5072a3(0xde))/0xa)+-parseInt(_0x5072a3(0xb2))/0xb*(-parseInt(_0x5072a3(0xbb))/0xc);if(_0x4a969b===_0x3bb6a9)break;else _0x83cf2f['push'](_0x83cf2f['shift']());}catch(_0x4be2cc){_0x83cf2f['push'](_0x83cf2f['shift']());}}}(a31_0xf3fd,0x91788));import{BaseCommand}from'./command.js';function a31_0xf3fd(){const _0x2e60ab=['📋\x20Assigned\x20Policies','length','\x20\x20\x20','ies','policy','context','user','description','policy\x20show','1423518XEStky','args','Fetching\x20policy...','\x20assigned','\x20user','\x20—\x20','log','join','listPolicies','Account\x20Owner','\x20polic','11CMbQju','11780uYxIBf','Usage:\x20tdx\x20policy\x20show\x20<policy-name-or-id>','getMyPermissions','error',',\x20user_id:','data','getPolicyUsers','Show\x20current\x20user\x20policies\x20and\x20effective\x20permissions','entries','28DCBEBH','1091544vHdjWH','612Xaktfx','\x20\x20No\x20policies\x20assigned','policy\x20list','1996870CRzeiO','\x20\x20•\x20','validate','name','Fetching\x20permissions...','max','verbose','execute','15432087gXCPif','🔑\x20Effective\x20Permissions','all','Listing\x20policies...','policies','8ulbmVS','No\x20policies\x20found','List\x20all\x20policies\x20in\x20the\x20account\x20(admin\x20only)','administrator','24iFXJuh','9362208OWBZMh','site','(ID:\x20','206848qNdhwE','getPolicy','map','email','dim','account_owner','permissions','bold','account_id','Member'];a31_0xf3fd=function(){return _0x2e60ab;};return a31_0xf3fd();}import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import a31_0x5c140c from'chalk';export class PolicyCommand extends BaseCommand{[a31_0x34e2a7(0xad)]='policy';[a31_0x34e2a7(0xd0)]=a31_0x34e2a7(0xa3);async['execute'](_0x476fa4){const _0xa4a947=a31_0x34e2a7,{options:_0x5677c6,tdx:_0x148735}=_0x476fa4,_0x294cad=await withSpinner(_0xa4a947(0xae),async()=>{const _0x2cee4e=_0xa4a947,[_0x3fa8e9,_0x1f232f]=await Promise[_0x2cee4e(0xb4)]([_0x148735[_0x2cee4e(0xcf)]['getCurrent'](),_0x148735[_0x2cee4e(0xcd)][_0x2cee4e(0x9e)]()]);return{'userInfo':_0x3fa8e9,'permissions':_0x1f232f};},{'verbose':_0x5677c6[_0xa4a947(0xb0)]}),{userInfo:_0x46a5d7,permissions:_0x115868}=_0x294cad[_0xa4a947(0xa1)];if(isStructuredFormat(_0x5677c6))return await handleSingleObjectOutput(_0x115868,_0x5677c6),0x0;const _0x3ca617=_0x46a5d7[_0xa4a947(0xc4)]?_0xa4a947(0xdb):_0x46a5d7[_0xa4a947(0xba)]?'Administrator':_0xa4a947(0xc8);console[_0xa4a947(0xd8)]('\x0a'+a31_0x5c140c[_0xa4a947(0xc6)]('👤')+'\x20'+a31_0x5c140c[_0xa4a947(0xc6)](_0x46a5d7[_0xa4a947(0xad)])+'\x20'+a31_0x5c140c[_0xa4a947(0xc3)]('('+_0x46a5d7['email']+')')+_0xa4a947(0xd7)+_0x3ca617),console[_0xa4a947(0xd8)](a31_0x5c140c[_0xa4a947(0xc3)](_0xa4a947(0xcb)+_0x148735[_0xa4a947(0xce)][_0xa4a947(0xbd)]+':'+_0x46a5d7[_0xa4a947(0xc7)]+_0xa4a947(0xa0)+_0x46a5d7['id']));const _0x54a23a=_0x115868[_0xa4a947(0xb6)];console['log']('\x0a'+a31_0x5c140c[_0xa4a947(0xc6)](_0xa4a947(0xc9))+'\x20('+_0x54a23a[_0xa4a947(0xca)]+'):');if(_0x54a23a['length']===0x0)console[_0xa4a947(0xd8)](a31_0x5c140c[_0xa4a947(0xc3)](_0xa4a947(0xa8)));else for(const _0x40ba25 of _0x54a23a){console[_0xa4a947(0xd8)]('\x20\x20•\x20'+_0x40ba25[_0xa4a947(0xad)]);}return printPermissionsMap(_0x115868['permissions']),console[_0xa4a947(0xd8)](),0x0;}}export class PolicyListCommand extends BaseCommand{['name']=a31_0x34e2a7(0xa9);[a31_0x34e2a7(0xd0)]=a31_0x34e2a7(0xb9);async[a31_0x34e2a7(0xb1)](_0x20529f){const _0x1cf1a0=a31_0x34e2a7,{options:_0x3bd7ff,tdx:_0x162a85}=_0x20529f,_0x5229f7=await withSpinner(_0x1cf1a0(0xb5),()=>_0x162a85['policy'][_0x1cf1a0(0xda)](),{'verbose':_0x3bd7ff[_0x1cf1a0(0xb0)]}),_0x18cf52=_0x5229f7[_0x1cf1a0(0xa1)];console[_0x1cf1a0(0x9f)]('✔\x20Found\x20'+_0x18cf52['length']+_0x1cf1a0(0xdc)+(_0x18cf52[_0x1cf1a0(0xca)]!==0x1?_0x1cf1a0(0xcc):'y'));if(isStructuredFormat(_0x3bd7ff))return await handleSDKOutput(_0x18cf52,_0x3bd7ff),0x0;if(_0x18cf52[_0x1cf1a0(0xca)]===0x0)console[_0x1cf1a0(0xd8)](a31_0x5c140c[_0x1cf1a0(0xc3)](_0x1cf1a0(0xb8)));else for(const _0x33027b of _0x18cf52){const _0x475a3f=_0x33027b[_0x1cf1a0(0xd0)]?a31_0x5c140c[_0x1cf1a0(0xc3)]('\x20—\x20'+_0x33027b[_0x1cf1a0(0xd0)]):'';console[_0x1cf1a0(0xd8)](_0x1cf1a0(0xab)+_0x33027b['name']+_0x475a3f);}return 0x0;}}function a31_0x2128(_0x186962,_0x262d51){_0x186962=_0x186962-0x9d;const _0xf3fd03=a31_0xf3fd();let _0x212878=_0xf3fd03[_0x186962];return _0x212878;}export class PolicyShowCommand extends BaseCommand{['name']=a31_0x34e2a7(0xd1);[a31_0x34e2a7(0xd0)]='Show\x20a\x20specific\x20policy\x20details\x20and\x20permissions\x20(admin\x20only)';[a31_0x34e2a7(0xac)](_0x54eb04){const _0x1f1f58=a31_0x34e2a7;if(_0x54eb04[_0x1f1f58(0xd3)][_0x1f1f58(0xca)]===0x0)return _0x1f1f58(0x9d);return undefined;}async[a31_0x34e2a7(0xb1)](_0x2f61fe){const _0x5dc68f=a31_0x34e2a7,{options:_0xaa603d,tdx:_0x14cb4c}=_0x2f61fe,_0xc51686=_0x2f61fe['args'][0x0],_0x4db6a6=await withSpinner(_0x5dc68f(0xd4),async()=>{const _0x580c22=_0x5dc68f,_0x376fb0=await _0x14cb4c[_0x580c22(0xcd)][_0x580c22(0xc0)](_0xc51686),[_0x4bec15,_0x7abd63]=await Promise[_0x580c22(0xb4)]([_0x14cb4c[_0x580c22(0xcd)]['getPolicyPermissions'](_0x376fb0['id']),_0x14cb4c['policy'][_0x580c22(0xa2)](_0x376fb0['id'])]);return{'policy':_0x376fb0,'perms':_0x4bec15,'users':_0x7abd63};},{'verbose':_0xaa603d[_0x5dc68f(0xb0)]}),{policy:_0x490227,perms:_0x4d85b5,users:_0x597f79}=_0x4db6a6[_0x5dc68f(0xa1)];if(isStructuredFormat(_0xaa603d))return await handleSingleObjectOutput({..._0x490227,'permissions':_0x4d85b5[_0x5dc68f(0xc5)],'users':_0x597f79},_0xaa603d),0x0;console[_0x5dc68f(0xd8)]('\x0a'+a31_0x5c140c['bold']('📋')+'\x20'+a31_0x5c140c[_0x5dc68f(0xc6)](_0x490227['name'])+'\x20'+a31_0x5c140c[_0x5dc68f(0xc3)](_0x5dc68f(0xbe)+_0x490227['id']+')'));_0x490227[_0x5dc68f(0xd0)]&&console[_0x5dc68f(0xd8)](_0x5dc68f(0xcb)+a31_0x5c140c[_0x5dc68f(0xc3)](_0x490227[_0x5dc68f(0xd0)]));console[_0x5dc68f(0xd8)](_0x5dc68f(0xcb)+_0x597f79['length']+_0x5dc68f(0xd6)+(_0x597f79[_0x5dc68f(0xca)]!==0x1?'s':'')+_0x5dc68f(0xd5)),printPermissionsMap(_0x4d85b5[_0x5dc68f(0xc5)]);if(_0x597f79['length']>0x0){console[_0x5dc68f(0xd8)]('\x0a'+a31_0x5c140c[_0x5dc68f(0xc6)]('👥\x20Assigned\x20Users')+':');for(const _0x522a3a of _0x597f79){const _0x3bafe9=_0x522a3a[_0x5dc68f(0xc2)]&&_0x522a3a['email']!==_0x522a3a[_0x5dc68f(0xad)]?a31_0x5c140c['dim']('\x20<'+_0x522a3a[_0x5dc68f(0xc2)]+'>'):'';console['log']('\x20\x20•\x20'+_0x522a3a[_0x5dc68f(0xad)]+_0x3bafe9);}}return console[_0x5dc68f(0xd8)](),0x0;}}function printPermissionsMap(_0x25a93e){const _0x4d8ade=a31_0x34e2a7,_0x2b7913=Object[_0x4d8ade(0xa4)](_0x25a93e);console[_0x4d8ade(0xd8)]('\x0a'+a31_0x5c140c['bold'](_0x4d8ade(0xb3))+':');if(_0x2b7913['length']===0x0){console[_0x4d8ade(0xd8)](a31_0x5c140c[_0x4d8ade(0xc3)]('\x20\x20No\x20permissions'));return;}const _0x9fd05d=Math[_0x4d8ade(0xaf)](..._0x2b7913[_0x4d8ade(0xc1)](([_0xaf390a])=>_0xaf390a[_0x4d8ade(0xca)]));for(const [_0x4dcbc9,_0x428ba3]of _0x2b7913){const _0x3a723a=formatOperations(_0x428ba3);console[_0x4d8ade(0xd8)]('\x20\x20'+_0x4dcbc9['padEnd'](_0x9fd05d+0x2)+_0x3a723a);}}function formatOperations(_0x577f66){const _0x27d60b=a31_0x34e2a7,_0x409d80=[...new Set(_0x577f66[_0x27d60b(0xc1)](_0x3818f3=>_0x3818f3['operation']))];return _0x409d80[_0x27d60b(0xd9)](',\x20');}
@@ -1 +1 @@
1
- const a32_0x416cce=a32_0x2920;(function(_0x563b00,_0x59b2a0){const _0x467072=a32_0x2920,_0x27261d=_0x563b00();while(!![]){try{const _0x4a6681=-parseInt(_0x467072(0x19e))/0x1*(-parseInt(_0x467072(0x1da))/0x2)+-parseInt(_0x467072(0x1eb))/0x3+parseInt(_0x467072(0x1dc))/0x4+-parseInt(_0x467072(0x196))/0x5*(parseInt(_0x467072(0x1b6))/0x6)+parseInt(_0x467072(0x1b1))/0x7+parseInt(_0x467072(0x1ae))/0x8+parseInt(_0x467072(0x19c))/0x9*(parseInt(_0x467072(0x1bb))/0xa);if(_0x4a6681===_0x59b2a0)break;else _0x27261d['push'](_0x27261d['shift']());}catch(_0x57d712){_0x27261d['push'](_0x27261d['shift']());}}}(a32_0x54a5,0x7b52b));function a32_0x54a5(){const _0x3acdc2=['1574440JspPlS','\x20\x20tdx\x20--profile\x20','yellow','\x20API\x20key\x20saved\x20to\x20system\x20keychain','bold','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','2403KvBZLA','confirm','181JFNSme','\x20API\x20key\x20is\x20valid\x20(User:\x20','create','Removal\x20cancelled','includes','Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20use\x20<name>\x20[--default]','select','split','Choose\x20authentication\x20method:','execute','length','OAuth\x20(browser\x20login)','method','\x0aAvailable\x20profiles:','join','profile:create','1751536VbypUd','API\x20Key','Site\x20was\x20not\x20changed.','3911432lyFlDI','log','profile:remove','\x27\x20updated:\x20','\x20\x20(no\x20profiles\x20found)','12lrVAVe','profile','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20remove\x20<name>','\x20--default\x27\x20to\x20save\x20permanently','20260ePDfww','password','profile:use','Invalid\x20format.\x20Use:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20','validate','\x0aYou\x20can\x20find\x20your\x20API\x20key\x20at:','tdx:\x20profile\x20set','API\x20key\x20cannot\x20be\x20empty','Profile\x20name\x20must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20and\x20underscore','\x20API\x20key\x20removed\x20from\x20system\x20keychain','ERROR','default','profileName','You\x20can\x20now\x20use\x20tdx\x20commands\x20with\x20this\x20profile.\x20Try:','\x20Profile\x20\x27','/app/mp/ak','Set\x20a\x20profile\x20configuration\x20value','\x0aSetup\x20cancelled','green','name','dim','VALID_KEYS','Validating\x20API\x20key...','jobs','(cleared)','\x0aSetting\x20up\x20authentication\x20for\x20site:\x20','Profile\x20\x27','trim','getUserInfo','email','session','4788Gszofv','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','1006644nebQIE','Default\x20profile\x20set\x20to:\x20','Enter\x20your\x20TD\x20API\x20key:','status','red','Profile\x20was\x20not\x20created.\x20Please\x20try\x20again.','\x27\x20created','\x27\x20requires\x20API\x20key\x20validation.','tdx.json','Key=value\x20pair\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20','logLevel','message','Unknown\x20key\x20\x27','parent_segment','\x0aSaved\x20to:\x20','2606184oYoXWi','test','oauth','apiKey','error','Remove\x20a\x20profile','Set\x20session\x20profile','tdx:\x20profile\x20remove','\x27\x20removed\x20from\x20configuration','text','Are\x20you\x20sure\x20you\x20want\x20to\x20remove\x20profile\x20\x27','config','(session:\x20','\x0aTip:\x20Use\x20\x27tdx\x20profile\x20use\x20','\x20API\x20key\x20saved\x20to\x20system\x20keychain\x20(profile:\x20','llm_project','database','\x20\x20-\x20','Changing\x20site\x20to\x20\x27','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','✗\x20Validation\x20failed:\x20','\x27\x20does\x20not\x20exist.','site','warn','\x27.\x0a\x0aValid\x20keys:\x20','profile:set','description'];a32_0x54a5=function(){return _0x3acdc2;};return a32_0x54a5();}import{BaseCommand,printAuthError}from'./command.js';import{listProfiles,profileExists,saveProfileToUserConfig,removeProfileFromUserConfig,loadProfile,getActiveProfile,saveActiveProfileToUserConfig}from'../core/profile.js';import{getConfigDir}from'../core/config.js';import*as a32_0x3cef21 from'node:path';import{saveSessionContext,getSessionID,cleanExpiredSessions}from'../core/session.js';import{saveAPIKeyAsync,resolveSite}from'../core/config.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{runOAuthLoginFlow}from'./auth-login-command.js';import{isOAuthSupported}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a32_0x285a44 from'prompts';import a32_0x1028c8 from'chalk';function validateProfileName(_0x466519){const _0x114e5d=a32_0x2920;if(!_0x466519||!_0x466519[_0x114e5d(0x1d6)]())return'Profile\x20name\x20cannot\x20be\x20empty';const _0x4988d8=_0x466519[_0x114e5d(0x1d6)]();if(!/^[a-zA-Z0-9_-]+$/[_0x114e5d(0x1ec)](_0x4988d8))return _0x114e5d(0x1c3);if(profileExists(_0x4988d8))return _0x114e5d(0x1d5)+_0x4988d8+'\x27\x20already\x20exists.\x20Use\x20\x27tdx\x20profile\x20set\x27\x20to\x20modify\x20it.';return!![];}export class ProfileCreateCommand extends BaseCommand{[a32_0x416cce(0x1ce)]=a32_0x416cce(0x1ad);[a32_0x416cce(0x195)]='Create\x20a\x20new\x20profile';async[a32_0x416cce(0x1a7)](_0x55ecaa){const _0x44dc0b=a32_0x416cce,{options:_0x31a7a9,args:_0x20ce80}=_0x55ecaa;console[_0x44dc0b(0x1b2)](a32_0x1028c8[_0x44dc0b(0x19a)]('tdx:\x20profile\x20create'));let _0x5cbe44;if(_0x20ce80[_0x44dc0b(0x1a8)]>0x0&&_0x20ce80[0x0]){const _0x105288=_0x20ce80[0x0][_0x44dc0b(0x1d6)](),_0x57ece6=validateProfileName(_0x105288);if(_0x57ece6!==!![])return console[_0x44dc0b(0x1ef)](a32_0x1028c8[_0x44dc0b(0x1e0)](_0x57ece6)),0x1;_0x5cbe44=_0x105288;}else{const _0x269cb3=await a32_0x285a44({'type':_0x44dc0b(0x1f4),'name':_0x44dc0b(0x1c7),'message':'Enter\x20profile\x20name:','validate':validateProfileName});if(!_0x269cb3[_0x44dc0b(0x1c7)])return console[_0x44dc0b(0x1b2)](_0x44dc0b(0x1cc)),0x1;_0x5cbe44=_0x269cb3[_0x44dc0b(0x1c7)][_0x44dc0b(0x1d6)]();}const _0xdbf8a8=await a32_0x285a44({'type':_0x44dc0b(0x1f4),'name':'description','message':'Enter\x20description\x20(optional):'}),_0x2ad393=_0xdbf8a8[_0x44dc0b(0x195)]?.['trim']()||undefined,_0x19cddf=_0x31a7a9[_0x44dc0b(0x201)]||'us01',_0x543b9a=await promptSiteSelection(_0x19cddf,_0x5cbe44,'Setup\x20cancelled');if(!_0x543b9a)return 0x1;const _0x572640=resolveSite(_0x543b9a);if(isOAuthSupported(_0x572640)){const _0x272388=await a32_0x285a44({'type':_0x44dc0b(0x1a4),'name':_0x44dc0b(0x1aa),'message':_0x44dc0b(0x1a6),'choices':[{'title':_0x44dc0b(0x1a9),'value':_0x44dc0b(0x1ed)},{'title':_0x44dc0b(0x1af),'value':'apikey'}]});if(!_0x272388[_0x44dc0b(0x1aa)])return console[_0x44dc0b(0x1b2)](_0x44dc0b(0x1cc)),0x1;if(_0x272388['method']==='oauth'){if(_0x2ad393){const _0x1c99a5={'site':_0x572640,'description':_0x2ad393};saveProfileToUserConfig(_0x5cbe44,_0x1c99a5);}return await runOAuthLoginFlow(_0x572640,_0x5cbe44,_0x31a7a9[_0x44dc0b(0x1e6)]??LogLevel[_0x44dc0b(0x1c5)]),0x0;}}console[_0x44dc0b(0x1b2)](_0x44dc0b(0x1d4)+_0x572640),console[_0x44dc0b(0x1b2)]('You\x20can\x20find\x20your\x20API\x20key\x20at:'),console[_0x44dc0b(0x1b2)]('\x20\x20'+getConsoleUrl(_0x572640,_0x44dc0b(0x1ca)));const _0x305d78=await a32_0x285a44({'type':_0x44dc0b(0x1bc),'name':_0x44dc0b(0x1ee),'message':_0x44dc0b(0x1de),'validate':_0x460153=>{const _0x302437=_0x44dc0b;if(!_0x460153||!_0x460153['trim']())return _0x302437(0x1c2);return!![];}});if(!_0x305d78[_0x44dc0b(0x1ee)])return console[_0x44dc0b(0x1b2)](_0x44dc0b(0x1cc)),0x1;const _0x3a5c63=_0x305d78['apiKey'];console['log'](_0x44dc0b(0x1d1));try{const _0x4f99a1=TDX['create']({'site':_0x572640,'apiKey':_0x3a5c63['trim'](),'logLevel':_0x31a7a9[_0x44dc0b(0x1e6)]??LogLevel[_0x44dc0b(0x1c5)]}),_0x328106=await _0x4f99a1['jobs'][_0x44dc0b(0x1d7)]();console[_0x44dc0b(0x1b2)](a32_0x1028c8[_0x44dc0b(0x1cd)]('✓')+_0x44dc0b(0x19f)+_0x328106[_0x44dc0b(0x1d8)]+')');const _0xea40a3=await isKeychainAvailable();_0xea40a3?(await saveAPIKeyAsync(_0x3a5c63[_0x44dc0b(0x1d6)](),_0x572640,_0x5cbe44),console[_0x44dc0b(0x1b2)](a32_0x1028c8[_0x44dc0b(0x1cd)]('✓')+_0x44dc0b(0x1f9)+_0x5cbe44+')')):(console[_0x44dc0b(0x192)](a32_0x1028c8[_0x44dc0b(0x198)](_0x44dc0b(0x1fe))),console[_0x44dc0b(0x192)](a32_0x1028c8[_0x44dc0b(0x198)](_0x44dc0b(0x1db))));const _0x72bd0d={'site':_0x572640,..._0x2ad393&&{'description':_0x2ad393}};return saveProfileToUserConfig(_0x5cbe44,_0x72bd0d),console[_0x44dc0b(0x1b2)](a32_0x1028c8[_0x44dc0b(0x1cd)]('✓')+_0x44dc0b(0x1c9)+_0x5cbe44+_0x44dc0b(0x1e2)),console[_0x44dc0b(0x1b2)](),console[_0x44dc0b(0x1b2)](_0x44dc0b(0x1c8)),console[_0x44dc0b(0x1b2)](_0x44dc0b(0x197)+_0x5cbe44+_0x44dc0b(0x1b8)),console[_0x44dc0b(0x1b2)](_0x44dc0b(0x197)+_0x5cbe44+_0x44dc0b(0x19b)),0x0;}catch(_0x50b581){if(_0x50b581 instanceof HTTPClientError&&_0x50b581[_0x44dc0b(0x1df)]===0x191)return printAuthError(_0x50b581),0x1;return console[_0x44dc0b(0x1ef)](a32_0x1028c8[_0x44dc0b(0x1e0)](_0x44dc0b(0x1ff)+(_0x50b581 instanceof Error?_0x50b581['message']:String(_0x50b581)))),console[_0x44dc0b(0x1ef)](_0x44dc0b(0x1e1)),0x1;}}}export class ProfileRemoveCommand extends BaseCommand{[a32_0x416cce(0x1ce)]=a32_0x416cce(0x1b3);[a32_0x416cce(0x195)]=a32_0x416cce(0x1f0);['validate'](_0x2ad1aa){const _0x18ecda=a32_0x416cce,{args:_0x265571}=_0x2ad1aa;if(_0x265571[_0x18ecda(0x1a8)]===0x0)return _0x18ecda(0x1b9);return undefined;}async['execute'](_0x180493){const _0x3d1eeb=a32_0x416cce,{args:_0x197e3a}=_0x180493,_0x3d0ed4=_0x197e3a[0x0];console[_0x3d1eeb(0x1b2)](a32_0x1028c8['bold'](_0x3d1eeb(0x1f2)));if(!profileExists(_0x3d0ed4)){console[_0x3d1eeb(0x1ef)](a32_0x1028c8[_0x3d1eeb(0x1e0)](_0x3d1eeb(0x1d5)+_0x3d0ed4+_0x3d1eeb(0x200))),console[_0x3d1eeb(0x1b2)](_0x3d1eeb(0x1ab));const _0x3cd0d2=listProfiles();if(_0x3cd0d2[_0x3d1eeb(0x1a8)]===0x0)console['log'](_0x3d1eeb(0x1b5));else for(const _0xdb54ef of _0x3cd0d2){console[_0x3d1eeb(0x1b2)](_0x3d1eeb(0x1fc)+_0xdb54ef[_0x3d1eeb(0x1ce)]);}return 0x1;}const _0x3ca65e=await a32_0x285a44({'type':_0x3d1eeb(0x19d),'name':_0x3d1eeb(0x19d),'message':_0x3d1eeb(0x1f5)+_0x3d0ed4+'\x27?','initial':![]});if(!_0x3ca65e[_0x3d1eeb(0x19d)])return console[_0x3d1eeb(0x1b2)](_0x3d1eeb(0x1a1)),0x0;try{removeProfileFromUserConfig(_0x3d0ed4),console['log'](a32_0x1028c8[_0x3d1eeb(0x1cd)]('✓')+_0x3d1eeb(0x1c9)+_0x3d0ed4+_0x3d1eeb(0x1f3));}catch(_0x4b2c4d){return console[_0x3d1eeb(0x1ef)](a32_0x1028c8[_0x3d1eeb(0x1e0)]('Failed\x20to\x20remove\x20profile:\x20'+(_0x4b2c4d instanceof Error?_0x4b2c4d[_0x3d1eeb(0x1e7)]:String(_0x4b2c4d)))),0x1;}const _0x45bc95=await isKeychainAvailable();if(_0x45bc95){const _0x180a03=await deleteKeychainAPIKey(_0x3d0ed4);_0x180a03&&console[_0x3d1eeb(0x1b2)](a32_0x1028c8[_0x3d1eeb(0x1cd)]('✓')+_0x3d1eeb(0x1c4));}return 0x0;}}function a32_0x2920(_0x242119,_0x9c743f){_0x242119=_0x242119-0x192;const _0x54a53e=a32_0x54a5();let _0x292067=_0x54a53e[_0x242119];return _0x292067;}export class ProfileSetCommand extends BaseCommand{[a32_0x416cce(0x1ce)]=a32_0x416cce(0x194);['description']=a32_0x416cce(0x1cb);static [a32_0x416cce(0x1d0)]=['site',a32_0x416cce(0x1fb),a32_0x416cce(0x1e9),a32_0x416cce(0x1fa),'llm_agent','description'];[a32_0x416cce(0x1bf)](_0x2bbd8c){const _0x3a8245=a32_0x416cce,{args:_0x4bc066,options:_0x3aa9db}=_0x2bbd8c,_0x384649=_0x3aa9db[_0x3a8245(0x1b7)]||getActiveProfile();if(!_0x384649)return'No\x20active\x20profile.\x20Use\x20--profile\x20flag\x20or\x20set\x20session\x20profile\x20with:\x20tdx\x20profile\x20use\x20<name>\x0a\x0aUsage:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>';if(_0x4bc066['length']===0x0)return _0x3a8245(0x1e5)+ProfileSetCommand[_0x3a8245(0x1d0)]['join'](',\x20');const _0x2be1a7=_0x4bc066[0x0];if(!_0x2be1a7[_0x3a8245(0x1a2)]('='))return _0x3a8245(0x1be)+ProfileSetCommand[_0x3a8245(0x1d0)][_0x3a8245(0x1ac)](',\x20');const [_0x247da7]=_0x2be1a7[_0x3a8245(0x1a5)]('=',0x2);if(!ProfileSetCommand[_0x3a8245(0x1d0)][_0x3a8245(0x1a2)](_0x247da7))return _0x3a8245(0x1e8)+_0x247da7+_0x3a8245(0x193)+ProfileSetCommand[_0x3a8245(0x1d0)][_0x3a8245(0x1ac)](',\x20');return undefined;}async['execute'](_0x585960){const _0x23fc0d=a32_0x416cce,{args:_0x5aea77,options:_0x1f3577}=_0x585960,_0x4e7dd6=_0x1f3577[_0x23fc0d(0x1b7)]||getActiveProfile(),[_0x13d54e,..._0x5273c5]=_0x5aea77[0x0][_0x23fc0d(0x1a5)]('='),_0xd63cf1=_0x5273c5['join']('=');console['log'](a32_0x1028c8[_0x23fc0d(0x19a)](_0x23fc0d(0x1c1)));if(!profileExists(_0x4e7dd6)){const _0x49fe4a=await a32_0x285a44({'type':'confirm','name':_0x23fc0d(0x1a0),'message':_0x23fc0d(0x1d5)+_0x4e7dd6+'\x27\x20does\x20not\x20exist.\x20Create\x20it?','initial':!![]});if(!_0x49fe4a['create'])return console[_0x23fc0d(0x1b2)]('Operation\x20cancelled'),0x1;}const _0x3a2776=loadProfile(_0x4e7dd6),_0x215af0=_0x3a2776?.[_0x23fc0d(0x1f6)]||{};if(_0x13d54e==='site'){const _0x2a7ea4=resolveSite(_0xd63cf1);console[_0x23fc0d(0x1b2)](_0x23fc0d(0x1fd)+_0x2a7ea4+_0x23fc0d(0x1e3)),console[_0x23fc0d(0x1b2)](_0x23fc0d(0x1c0)),console['log']('\x20\x20'+getConsoleUrl(_0x2a7ea4,_0x23fc0d(0x1ca)));const _0x28cc8b=await a32_0x285a44({'type':'password','name':_0x23fc0d(0x1ee),'message':'Enter\x20your\x20TD\x20API\x20key\x20for\x20the\x20new\x20site:','validate':_0x37df65=>{if(!_0x37df65||!_0x37df65['trim']())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0x28cc8b[_0x23fc0d(0x1ee)])return console['log']('\x0aOperation\x20cancelled'),0x1;console[_0x23fc0d(0x1b2)](_0x23fc0d(0x1d1));try{const _0x1de368=TDX[_0x23fc0d(0x1a0)]({'site':_0x2a7ea4,'apiKey':_0x28cc8b[_0x23fc0d(0x1ee)]['trim'](),'logLevel':_0x1f3577[_0x23fc0d(0x1e6)]??LogLevel[_0x23fc0d(0x1c5)]}),_0x562823=await _0x1de368[_0x23fc0d(0x1d2)][_0x23fc0d(0x1d7)]();console[_0x23fc0d(0x1b2)](a32_0x1028c8[_0x23fc0d(0x1cd)]('✓')+'\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0x562823[_0x23fc0d(0x1d8)]+')');const _0x42829f=await isKeychainAvailable();_0x42829f?(await saveAPIKeyAsync(_0x28cc8b['apiKey'][_0x23fc0d(0x1d6)](),_0x2a7ea4,_0x4e7dd6),console[_0x23fc0d(0x1b2)](a32_0x1028c8[_0x23fc0d(0x1cd)]('✓')+_0x23fc0d(0x199))):console[_0x23fc0d(0x192)](a32_0x1028c8[_0x23fc0d(0x198)]('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),_0x215af0[_0x23fc0d(0x201)]=_0x2a7ea4;}catch(_0x8140cc){if(_0x8140cc instanceof HTTPClientError&&_0x8140cc[_0x23fc0d(0x1df)]===0x191)return printAuthError(_0x8140cc),0x1;return console['error'](a32_0x1028c8['red'](_0x23fc0d(0x1ff)+(_0x8140cc instanceof Error?_0x8140cc[_0x23fc0d(0x1e7)]:String(_0x8140cc)))),console[_0x23fc0d(0x1ef)](_0x23fc0d(0x1b0)),0x1;}}else _0x215af0[_0x13d54e]=_0xd63cf1||undefined;return saveProfileToUserConfig(_0x4e7dd6,_0x215af0),console[_0x23fc0d(0x1b2)](a32_0x1028c8[_0x23fc0d(0x1cd)]('✓')+'\x20Profile\x20\x27'+_0x4e7dd6+_0x23fc0d(0x1b4)+_0x13d54e+'='+(_0xd63cf1||_0x23fc0d(0x1d3))),0x0;}}export class ProfileUseCommand extends BaseCommand{[a32_0x416cce(0x1ce)]=a32_0x416cce(0x1bd);['description']=a32_0x416cce(0x1f1);[a32_0x416cce(0x1bf)](_0x5a5fa1){const _0x1dfebe=a32_0x416cce,{args:_0x1551fc}=_0x5a5fa1;if(_0x1551fc[_0x1dfebe(0x1a8)]===0x0)return _0x1dfebe(0x1a3);return undefined;}async[a32_0x416cce(0x1a7)](_0x572e01){const _0x3846cf=a32_0x416cce,{args:_0x39f98a,options:_0x144c47}=_0x572e01,_0x1f34c6=_0x39f98a[0x0],_0x7a352a=_0x144c47[_0x3846cf(0x1c6)];cleanExpiredSessions();if(!profileExists(_0x1f34c6)){console[_0x3846cf(0x1ef)](a32_0x1028c8[_0x3846cf(0x1e0)](_0x3846cf(0x1d5)+_0x1f34c6+_0x3846cf(0x200))),console[_0x3846cf(0x1b2)](_0x3846cf(0x1ab));const _0x1fdee7=listProfiles();if(_0x1fdee7['length']===0x0)console['log'](_0x3846cf(0x1b5));else for(const _0x4d1b17 of _0x1fdee7){console['log'](_0x3846cf(0x1fc)+_0x4d1b17[_0x3846cf(0x1ce)]);}return 0x1;}if(_0x7a352a){const _0x5c8e22=a32_0x3cef21['join'](getConfigDir(),_0x3846cf(0x1e4));return saveActiveProfileToUserConfig(_0x1f34c6),console['log'](_0x3846cf(0x1dd)+a32_0x1028c8[_0x3846cf(0x1cd)](_0x1f34c6)),console[_0x3846cf(0x1b2)](a32_0x1028c8[_0x3846cf(0x1cf)](_0x3846cf(0x1ea)+_0x5c8e22)),0x0;}const _0x4c9014=getSessionID(_0x144c47['session']);return saveSessionContext({'profile':_0x1f34c6},_0x144c47[_0x3846cf(0x1d9)]),console[_0x3846cf(0x1b2)]('Session\x20profile\x20set\x20to:\x20'+a32_0x1028c8['green'](_0x1f34c6)+'\x20'+a32_0x1028c8[_0x3846cf(0x1cf)](_0x3846cf(0x1f7)+_0x4c9014+')')),console[_0x3846cf(0x1b2)](a32_0x1028c8['dim'](_0x3846cf(0x1f8)+_0x1f34c6+_0x3846cf(0x1ba))),0x0;}}
1
+ const a32_0x2eb69e=a32_0x54bf;(function(_0x3007f8,_0x188f72){const _0x59295b=a32_0x54bf,_0x45286f=_0x3007f8();while(!![]){try{const _0xf231d1=-parseInt(_0x59295b(0xac))/0x1+-parseInt(_0x59295b(0xc8))/0x2+-parseInt(_0x59295b(0xbd))/0x3*(-parseInt(_0x59295b(0x92))/0x4)+parseInt(_0x59295b(0xe2))/0x5*(parseInt(_0x59295b(0x8f))/0x6)+parseInt(_0x59295b(0x9f))/0x7*(parseInt(_0x59295b(0xe4))/0x8)+-parseInt(_0x59295b(0xb4))/0x9*(-parseInt(_0x59295b(0x9e))/0xa)+parseInt(_0x59295b(0x9a))/0xb*(-parseInt(_0x59295b(0xb8))/0xc);if(_0xf231d1===_0x188f72)break;else _0x45286f['push'](_0x45286f['shift']());}catch(_0x28796f){_0x45286f['push'](_0x45286f['shift']());}}}(a32_0x2740,0x4df61));import{BaseCommand,printAuthError}from'./command.js';import{listProfiles,profileExists,saveProfileToUserConfig,removeProfileFromUserConfig,loadProfile,getActiveProfile,saveActiveProfileToUserConfig}from'../core/profile.js';import{getConfigDir}from'../core/config.js';import*as a32_0x2e2c98 from'node:path';import{saveSessionContext,getSessionID,cleanExpiredSessions}from'../core/session.js';import{saveAPIKeyAsync,resolveSite}from'../core/config.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';function a32_0x2740(){const _0x4bbb28=['84021RPXqDU','confirm','warn','Invalid\x20format.\x20Use:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20','join','ERROR','tdx:\x20profile\x20remove','Profile\x20name\x20cannot\x20be\x20empty','3985263TovGYI','apiKey','\x20API\x20key\x20saved\x20to\x20system\x20keychain','method','12lnYaZf','bold','Changing\x20site\x20to\x20\x27','\x20\x20tdx\x20--profile\x20','red','54qmhJud','\x27\x20updated:\x20','session','email','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','Session\x20profile\x20set\x20to:\x20','Setup\x20cancelled','Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20remove\x20<name>','dim','config','\x0aAvailable\x20profiles:','122128dZWdEH','/app/mp/ak','\x27.\x0a\x0aValid\x20keys:\x20','API\x20key\x20cannot\x20be\x20empty','Key=value\x20pair\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20','\x27\x20already\x20exists.\x20Use\x20\x27tdx\x20profile\x20set\x27\x20to\x20modify\x20it.','\x27\x20requires\x20API\x20key\x20validation.','description','You\x20can\x20find\x20your\x20API\x20key\x20at:','\x0aSetting\x20up\x20authentication\x20for\x20site:\x20','password','\x0aOperation\x20cancelled','error','\x0aSaved\x20to:\x20','✗\x20Validation\x20failed:\x20','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','Failed\x20to\x20remove\x20profile:\x20','create','Site\x20was\x20not\x20changed.','\x27\x20created','tdx:\x20profile\x20set','text','message','No\x20active\x20profile.\x20Use\x20--profile\x20flag\x20or\x20set\x20session\x20profile\x20with:\x20tdx\x20profile\x20use\x20<name>\x0a\x0aUsage:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>','split','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','3875wKePDU','Default\x20profile\x20set\x20to:\x20','118376GSqSCk','Profile\x20was\x20not\x20created.\x20Please\x20try\x20again.','default','tdx:\x20profile\x20create','test','validate','getUserInfo','profile:set','name','\x27\x20does\x20not\x20exist.','trim','\x20--default\x27\x20to\x20save\x20permanently','\x0aSetup\x20cancelled','VALID_KEYS','log','Validating\x20API\x20key...','apikey','Remove\x20a\x20profile','Set\x20a\x20profile\x20configuration\x20value','Enter\x20your\x20TD\x20API\x20key:','green','\x20API\x20key\x20is\x20valid\x20(User:\x20','select','Operation\x20cancelled','profile','\x20Profile\x20\x27','Unknown\x20key\x20\x27','OAuth\x20(browser\x20login)','status','2952CvglnL','logLevel','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','44284deRnmI','Enter\x20profile\x20name:','execute','profile:create','\x0aTip:\x20Use\x20\x27tdx\x20profile\x20use\x20','\x20\x20(no\x20profiles\x20found)','includes','Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20use\x20<name>\x20[--default]','10380623XdCqkD','Profile\x20\x27','jobs','Set\x20session\x20profile','10HaUNzU','182QscYqA','length','site','oauth','profileName','tdx.json','\x20\x20-\x20','Profile\x20name\x20must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20and\x20underscore','Choose\x20authentication\x20method:','\x27\x20removed\x20from\x20configuration','(cleared)','profile:remove','yellow'];a32_0x2740=function(){return _0x4bbb28;};return a32_0x2740();}import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{runOAuthLoginFlow}from'./auth-login-command.js';import{isOAuthSupported}from'../core/oauth.js';function a32_0x54bf(_0x59e032,_0x265758){_0x59e032=_0x59e032-0x75;const _0x274093=a32_0x2740();let _0x54bf65=_0x274093[_0x59e032];return _0x54bf65;}import{promptSiteSelection}from'../core/constants.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a32_0x4c5c7f from'prompts';import a32_0x10057f from'chalk';function validateProfileName(_0x85a606){const _0x941599=a32_0x54bf;if(!_0x85a606||!_0x85a606['trim']())return _0x941599(0xb3);const _0x214d2f=_0x85a606[_0x941599(0x7c)]();if(!/^[a-zA-Z0-9_-]+$/[_0x941599(0x76)](_0x214d2f))return _0x941599(0xa6);if(profileExists(_0x214d2f))return _0x941599(0x9b)+_0x214d2f+_0x941599(0xcd);return!![];}export class ProfileCreateCommand extends BaseCommand{[a32_0x2eb69e(0x7a)]=a32_0x2eb69e(0x95);['description']='Create\x20a\x20new\x20profile';async['execute'](_0x5a769a){const _0x4b1cbf=a32_0x2eb69e,{options:_0x38f3d2,args:_0x2183fb}=_0x5a769a;console[_0x4b1cbf(0x80)](a32_0x10057f[_0x4b1cbf(0xb9)](_0x4b1cbf(0x75)));let _0x250f52;if(_0x2183fb[_0x4b1cbf(0xa0)]>0x0&&_0x2183fb[0x0]){const _0x5c896d=_0x2183fb[0x0][_0x4b1cbf(0x7c)](),_0x289824=validateProfileName(_0x5c896d);if(_0x289824!==!![])return console[_0x4b1cbf(0xd4)](a32_0x10057f['red'](_0x289824)),0x1;_0x250f52=_0x5c896d;}else{const _0x621c40=await a32_0x4c5c7f({'type':_0x4b1cbf(0xdd),'name':_0x4b1cbf(0xa3),'message':_0x4b1cbf(0x93),'validate':validateProfileName});if(!_0x621c40['profileName'])return console['log']('\x0aSetup\x20cancelled'),0x1;_0x250f52=_0x621c40[_0x4b1cbf(0xa3)][_0x4b1cbf(0x7c)]();}const _0x1c29d3=await a32_0x4c5c7f({'type':_0x4b1cbf(0xdd),'name':_0x4b1cbf(0xcf),'message':'Enter\x20description\x20(optional):'}),_0x3615bb=_0x1c29d3[_0x4b1cbf(0xcf)]?.[_0x4b1cbf(0x7c)]()||undefined,_0x404fb0=_0x38f3d2[_0x4b1cbf(0xa1)]||'us01',_0x3a2cf9=await promptSiteSelection(_0x404fb0,_0x250f52,_0x4b1cbf(0xc3));if(!_0x3a2cf9)return 0x1;const _0x4495c2=resolveSite(_0x3a2cf9);if(isOAuthSupported(_0x4495c2)){const _0x2ebf72=await a32_0x4c5c7f({'type':_0x4b1cbf(0x88),'name':_0x4b1cbf(0xb7),'message':_0x4b1cbf(0xa7),'choices':[{'title':_0x4b1cbf(0x8d),'value':_0x4b1cbf(0xa2)},{'title':'API\x20Key','value':_0x4b1cbf(0x82)}]});if(!_0x2ebf72[_0x4b1cbf(0xb7)])return console['log'](_0x4b1cbf(0x7e)),0x1;if(_0x2ebf72[_0x4b1cbf(0xb7)]===_0x4b1cbf(0xa2)){if(_0x3615bb){const _0x5c7437={'site':_0x4495c2,'description':_0x3615bb};saveProfileToUserConfig(_0x250f52,_0x5c7437);}return await runOAuthLoginFlow(_0x4495c2,_0x250f52,_0x38f3d2[_0x4b1cbf(0x90)]??LogLevel[_0x4b1cbf(0xb1)]),0x0;}}console[_0x4b1cbf(0x80)](_0x4b1cbf(0xd1)+_0x4495c2),console[_0x4b1cbf(0x80)](_0x4b1cbf(0xd0)),console[_0x4b1cbf(0x80)]('\x20\x20'+getConsoleUrl(_0x4495c2,_0x4b1cbf(0xc9)));const _0x32db55=await a32_0x4c5c7f({'type':'password','name':_0x4b1cbf(0xb5),'message':_0x4b1cbf(0x85),'validate':_0x30f609=>{const _0x23120b=_0x4b1cbf;if(!_0x30f609||!_0x30f609[_0x23120b(0x7c)]())return _0x23120b(0xcb);return!![];}});if(!_0x32db55[_0x4b1cbf(0xb5)])return console['log'](_0x4b1cbf(0x7e)),0x1;const _0x2b6d45=_0x32db55[_0x4b1cbf(0xb5)];console[_0x4b1cbf(0x80)](_0x4b1cbf(0x81));try{const _0x4cdd96=TDX[_0x4b1cbf(0xd9)]({'site':_0x4495c2,'apiKey':_0x2b6d45['trim'](),'logLevel':_0x38f3d2[_0x4b1cbf(0x90)]??LogLevel[_0x4b1cbf(0xb1)]}),_0x444eb5=await _0x4cdd96[_0x4b1cbf(0x9c)][_0x4b1cbf(0x78)]();console['log'](a32_0x10057f[_0x4b1cbf(0x86)]('✓')+_0x4b1cbf(0x87)+_0x444eb5[_0x4b1cbf(0xc0)]+')');const _0x335faa=await isKeychainAvailable();_0x335faa?(await saveAPIKeyAsync(_0x2b6d45['trim'](),_0x4495c2,_0x250f52),console['log'](a32_0x10057f['green']('✓')+'\x20API\x20key\x20saved\x20to\x20system\x20keychain\x20(profile:\x20'+_0x250f52+')')):(console[_0x4b1cbf(0xae)](a32_0x10057f[_0x4b1cbf(0xab)](_0x4b1cbf(0x91))),console[_0x4b1cbf(0xae)](a32_0x10057f[_0x4b1cbf(0xab)](_0x4b1cbf(0xe1))));const _0x8a9d2e={'site':_0x4495c2,..._0x3615bb&&{'description':_0x3615bb}};return saveProfileToUserConfig(_0x250f52,_0x8a9d2e),console[_0x4b1cbf(0x80)](a32_0x10057f[_0x4b1cbf(0x86)]('✓')+_0x4b1cbf(0x8b)+_0x250f52+_0x4b1cbf(0xdb)),console[_0x4b1cbf(0x80)](),console[_0x4b1cbf(0x80)]('You\x20can\x20now\x20use\x20tdx\x20commands\x20with\x20this\x20profile.\x20Try:'),console[_0x4b1cbf(0x80)]('\x20\x20tdx\x20--profile\x20'+_0x250f52+_0x4b1cbf(0xd7)),console[_0x4b1cbf(0x80)](_0x4b1cbf(0xbb)+_0x250f52+_0x4b1cbf(0xc1)),0x0;}catch(_0x124d2c){if(_0x124d2c instanceof HTTPClientError&&_0x124d2c['status']===0x191)return printAuthError(_0x124d2c),0x1;return console[_0x4b1cbf(0xd4)](a32_0x10057f[_0x4b1cbf(0xbc)](_0x4b1cbf(0xd6)+(_0x124d2c instanceof Error?_0x124d2c[_0x4b1cbf(0xde)]:String(_0x124d2c)))),console[_0x4b1cbf(0xd4)](_0x4b1cbf(0xe5)),0x1;}}}export class ProfileRemoveCommand extends BaseCommand{['name']=a32_0x2eb69e(0xaa);[a32_0x2eb69e(0xcf)]=a32_0x2eb69e(0x83);[a32_0x2eb69e(0x77)](_0x4fec88){const _0x3831fc=a32_0x2eb69e,{args:_0x26034e}=_0x4fec88;if(_0x26034e[_0x3831fc(0xa0)]===0x0)return _0x3831fc(0xc4);return undefined;}async[a32_0x2eb69e(0x94)](_0x369eef){const _0x28cb96=a32_0x2eb69e,{args:_0x58c923}=_0x369eef,_0x4fc799=_0x58c923[0x0];console[_0x28cb96(0x80)](a32_0x10057f[_0x28cb96(0xb9)](_0x28cb96(0xb2)));if(!profileExists(_0x4fc799)){console['error'](a32_0x10057f['red'](_0x28cb96(0x9b)+_0x4fc799+_0x28cb96(0x7b))),console['log'](_0x28cb96(0xc7));const _0x5c966d=listProfiles();if(_0x5c966d[_0x28cb96(0xa0)]===0x0)console[_0x28cb96(0x80)](_0x28cb96(0x97));else for(const _0x2bdf9d of _0x5c966d){console[_0x28cb96(0x80)](_0x28cb96(0xa5)+_0x2bdf9d[_0x28cb96(0x7a)]);}return 0x1;}const _0x3e8f77=await a32_0x4c5c7f({'type':_0x28cb96(0xad),'name':_0x28cb96(0xad),'message':'Are\x20you\x20sure\x20you\x20want\x20to\x20remove\x20profile\x20\x27'+_0x4fc799+'\x27?','initial':![]});if(!_0x3e8f77[_0x28cb96(0xad)])return console[_0x28cb96(0x80)]('Removal\x20cancelled'),0x0;try{removeProfileFromUserConfig(_0x4fc799),console[_0x28cb96(0x80)](a32_0x10057f[_0x28cb96(0x86)]('✓')+_0x28cb96(0x8b)+_0x4fc799+_0x28cb96(0xa8));}catch(_0x32127c){return console[_0x28cb96(0xd4)](a32_0x10057f[_0x28cb96(0xbc)](_0x28cb96(0xd8)+(_0x32127c instanceof Error?_0x32127c[_0x28cb96(0xde)]:String(_0x32127c)))),0x1;}const _0x53eb02=await isKeychainAvailable();if(_0x53eb02){const _0x303549=await deleteKeychainAPIKey(_0x4fc799);_0x303549&&console[_0x28cb96(0x80)](a32_0x10057f[_0x28cb96(0x86)]('✓')+'\x20API\x20key\x20removed\x20from\x20system\x20keychain');}return 0x0;}}export class ProfileSetCommand extends BaseCommand{[a32_0x2eb69e(0x7a)]=a32_0x2eb69e(0x79);[a32_0x2eb69e(0xcf)]=a32_0x2eb69e(0x84);static [a32_0x2eb69e(0x7f)]=[a32_0x2eb69e(0xa1),'database','parent_segment','llm_project','llm_agent',a32_0x2eb69e(0xcf)];['validate'](_0x236cf5){const _0x5ba23b=a32_0x2eb69e,{args:_0x37cf72,options:_0x59c22f}=_0x236cf5,_0x5b8fb8=_0x59c22f[_0x5ba23b(0x8a)]||getActiveProfile();if(!_0x5b8fb8)return _0x5ba23b(0xdf);if(_0x37cf72['length']===0x0)return _0x5ba23b(0xcc)+ProfileSetCommand['VALID_KEYS'][_0x5ba23b(0xb0)](',\x20');const _0x30b0b1=_0x37cf72[0x0];if(!_0x30b0b1[_0x5ba23b(0x98)]('='))return _0x5ba23b(0xaf)+ProfileSetCommand['VALID_KEYS']['join'](',\x20');const [_0x4c70fb]=_0x30b0b1['split']('=',0x2);if(!ProfileSetCommand[_0x5ba23b(0x7f)]['includes'](_0x4c70fb))return _0x5ba23b(0x8c)+_0x4c70fb+_0x5ba23b(0xca)+ProfileSetCommand['VALID_KEYS']['join'](',\x20');return undefined;}async[a32_0x2eb69e(0x94)](_0x4878af){const _0x29157d=a32_0x2eb69e,{args:_0x318c67,options:_0x468e79}=_0x4878af,_0xe78e08=_0x468e79['profile']||getActiveProfile(),[_0x2aa74f,..._0x107e71]=_0x318c67[0x0][_0x29157d(0xe0)]('='),_0x1bf979=_0x107e71[_0x29157d(0xb0)]('=');console[_0x29157d(0x80)](a32_0x10057f[_0x29157d(0xb9)](_0x29157d(0xdc)));if(!profileExists(_0xe78e08)){const _0x1b6d20=await a32_0x4c5c7f({'type':_0x29157d(0xad),'name':_0x29157d(0xd9),'message':_0x29157d(0x9b)+_0xe78e08+'\x27\x20does\x20not\x20exist.\x20Create\x20it?','initial':!![]});if(!_0x1b6d20[_0x29157d(0xd9)])return console['log'](_0x29157d(0x89)),0x1;}const _0xc6cf18=loadProfile(_0xe78e08),_0x176074=_0xc6cf18?.[_0x29157d(0xc6)]||{};if(_0x2aa74f===_0x29157d(0xa1)){const _0x134c9b=resolveSite(_0x1bf979);console[_0x29157d(0x80)](_0x29157d(0xba)+_0x134c9b+_0x29157d(0xce)),console['log']('\x0aYou\x20can\x20find\x20your\x20API\x20key\x20at:'),console[_0x29157d(0x80)]('\x20\x20'+getConsoleUrl(_0x134c9b,_0x29157d(0xc9)));const _0x2d8272=await a32_0x4c5c7f({'type':_0x29157d(0xd2),'name':'apiKey','message':'Enter\x20your\x20TD\x20API\x20key\x20for\x20the\x20new\x20site:','validate':_0x2c7571=>{const _0x29f01b=_0x29157d;if(!_0x2c7571||!_0x2c7571[_0x29f01b(0x7c)]())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0x2d8272['apiKey'])return console[_0x29157d(0x80)](_0x29157d(0xd3)),0x1;console[_0x29157d(0x80)](_0x29157d(0x81));try{const _0x281b9d=TDX['create']({'site':_0x134c9b,'apiKey':_0x2d8272['apiKey']['trim'](),'logLevel':_0x468e79[_0x29157d(0x90)]??LogLevel['ERROR']}),_0x214a69=await _0x281b9d['jobs']['getUserInfo']();console[_0x29157d(0x80)](a32_0x10057f['green']('✓')+_0x29157d(0x87)+_0x214a69['email']+')');const _0x3fd82b=await isKeychainAvailable();_0x3fd82b?(await saveAPIKeyAsync(_0x2d8272['apiKey']['trim'](),_0x134c9b,_0xe78e08),console[_0x29157d(0x80)](a32_0x10057f[_0x29157d(0x86)]('✓')+_0x29157d(0xb6))):console['warn'](a32_0x10057f[_0x29157d(0xab)](_0x29157d(0x91))),_0x176074[_0x29157d(0xa1)]=_0x134c9b;}catch(_0x3ff95a){if(_0x3ff95a instanceof HTTPClientError&&_0x3ff95a[_0x29157d(0x8e)]===0x191)return printAuthError(_0x3ff95a),0x1;return console[_0x29157d(0xd4)](a32_0x10057f[_0x29157d(0xbc)]('✗\x20Validation\x20failed:\x20'+(_0x3ff95a instanceof Error?_0x3ff95a[_0x29157d(0xde)]:String(_0x3ff95a)))),console[_0x29157d(0xd4)](_0x29157d(0xda)),0x1;}}else _0x176074[_0x2aa74f]=_0x1bf979||undefined;return saveProfileToUserConfig(_0xe78e08,_0x176074),console[_0x29157d(0x80)](a32_0x10057f[_0x29157d(0x86)]('✓')+_0x29157d(0x8b)+_0xe78e08+_0x29157d(0xbe)+_0x2aa74f+'='+(_0x1bf979||_0x29157d(0xa9))),0x0;}}export class ProfileUseCommand extends BaseCommand{[a32_0x2eb69e(0x7a)]='profile:use';[a32_0x2eb69e(0xcf)]=a32_0x2eb69e(0x9d);[a32_0x2eb69e(0x77)](_0x260053){const _0x5e4905=a32_0x2eb69e,{args:_0x152833}=_0x260053;if(_0x152833[_0x5e4905(0xa0)]===0x0)return _0x5e4905(0x99);return undefined;}async[a32_0x2eb69e(0x94)](_0x11e47e){const _0x29adf8=a32_0x2eb69e,{args:_0x1ac15b,options:_0x50a845}=_0x11e47e,_0x2ae0d6=_0x1ac15b[0x0],_0x304c34=_0x50a845[_0x29adf8(0xe6)];cleanExpiredSessions();if(!profileExists(_0x2ae0d6)){console['error'](a32_0x10057f[_0x29adf8(0xbc)](_0x29adf8(0x9b)+_0x2ae0d6+_0x29adf8(0x7b))),console[_0x29adf8(0x80)]('\x0aAvailable\x20profiles:');const _0x5f5642=listProfiles();if(_0x5f5642['length']===0x0)console[_0x29adf8(0x80)]('\x20\x20(no\x20profiles\x20found)');else for(const _0x4d3e9a of _0x5f5642){console['log']('\x20\x20-\x20'+_0x4d3e9a[_0x29adf8(0x7a)]);}return 0x1;}if(_0x304c34){const _0x5b78b0=a32_0x2e2c98[_0x29adf8(0xb0)](getConfigDir(),_0x29adf8(0xa4));return saveActiveProfileToUserConfig(_0x2ae0d6),console[_0x29adf8(0x80)](_0x29adf8(0xe3)+a32_0x10057f['green'](_0x2ae0d6)),console['log'](a32_0x10057f[_0x29adf8(0xc5)](_0x29adf8(0xd5)+_0x5b78b0)),0x0;}const _0x4440ea=getSessionID(_0x50a845[_0x29adf8(0xbf)]);return saveSessionContext({'profile':_0x2ae0d6},_0x50a845[_0x29adf8(0xbf)]),console['log'](_0x29adf8(0xc2)+a32_0x10057f[_0x29adf8(0x86)](_0x2ae0d6)+'\x20'+a32_0x10057f[_0x29adf8(0xc5)]('(session:\x20'+_0x4440ea+')')),console[_0x29adf8(0x80)](a32_0x10057f[_0x29adf8(0xc5)](_0x29adf8(0x96)+_0x2ae0d6+_0x29adf8(0x7d))),0x0;}}
@@ -1 +1 @@
1
- const a33_0x5830e0=a33_0x52b3;(function(_0x24e749,_0x128d5e){const _0x5adbaa=a33_0x52b3,_0x58778e=_0x24e749();while(!![]){try{const _0x5ca684=-parseInt(_0x5adbaa(0x19c))/0x1+parseInt(_0x5adbaa(0x197))/0x2+parseInt(_0x5adbaa(0x198))/0x3*(-parseInt(_0x5adbaa(0x195))/0x4)+-parseInt(_0x5adbaa(0x19d))/0x5*(-parseInt(_0x5adbaa(0x1a1))/0x6)+-parseInt(_0x5adbaa(0x18d))/0x7*(-parseInt(_0x5adbaa(0x19e))/0x8)+parseInt(_0x5adbaa(0x193))/0x9*(parseInt(_0x5adbaa(0x194))/0xa)+-parseInt(_0x5adbaa(0x187))/0xb;if(_0x5ca684===_0x128d5e)break;else _0x58778e['push'](_0x58778e['shift']());}catch(_0x35ff08){_0x58778e['push'](_0x58778e['shift']());}}}(a33_0xbd4b,0xac40b));import{BaseCommand}from'./command.js';function a33_0x52b3(_0x31e0c2,_0x39c996){_0x31e0c2=_0x31e0c2-0x187;const _0xbd4b47=a33_0xbd4b();let _0x52b37e=_0xbd4b47[_0x31e0c2];return _0x52b37e;}import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';import{handleSDKOutput,isStructuredFormat}from'../core/command-output.js';function a33_0xbd4b(){const _0x4c3a43=['214332yKOeEG','600852zKrbjG','name','No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a','green','1016433IbJmGR','5WvMalz','8JdxUnI','\x20\x20Global:\x20~/.config/tdx/tdx.json','site','7074834unzNWh','18193021AnUtmx','error','config','dim','log','List\x20all\x20available\x20profiles','6304949iSRBMA','Error:\x20','description','length','map','execute','12502467yMbYpA','10kUoSiR','4dXrzVn','message'];a33_0xbd4b=function(){return _0x4c3a43;};return a33_0xbd4b();}import a33_0x3f7a73 from'chalk';export class ProfilesCommand extends BaseCommand{[a33_0x5830e0(0x199)]='profiles';[a33_0x5830e0(0x18f)]=a33_0x5830e0(0x18c);async[a33_0x5830e0(0x192)](_0x29497d){const _0x2ced18=a33_0x5830e0,{options:_0x101016}=_0x29497d;try{const _0x5cab63=listProfiles(),_0x5b3809=getActiveProfile();if(_0x5cab63[_0x2ced18(0x190)]===0x0)return console['log'](_0x2ced18(0x19a)),console[_0x2ced18(0x18b)]('\x20\x20Local:\x20\x20(project\x20folder)/tdx.json'),console['log'](_0x2ced18(0x19f)),0x0;const _0x32edb2=_0x5cab63[_0x2ced18(0x191)](_0x10dd79=>{const _0x31075d=_0x2ced18,_0x243848=_0x10dd79['name']===_0x5b3809,_0x3c0659=getProfileParams(_0x10dd79[_0x31075d(0x189)]);return{'name':_0x10dd79['name'],'active':_0x243848,'scope':_0x10dd79['scope'],'description':_0x10dd79[_0x31075d(0x189)][_0x31075d(0x18f)]||'','params':_0x3c0659};});if(isStructuredFormat(_0x101016))await handleSDKOutput(_0x32edb2,_0x101016);else for(const _0x56f2d5 of _0x5cab63){const _0x23726d=_0x56f2d5[_0x2ced18(0x199)]===_0x5b3809?a33_0x3f7a73[_0x2ced18(0x19b)]('\x20✓'):'',_0x223b67=_0x56f2d5[_0x2ced18(0x189)][_0x2ced18(0x1a0)]?a33_0x3f7a73[_0x2ced18(0x18a)]('\x20'+_0x56f2d5[_0x2ced18(0x189)][_0x2ced18(0x1a0)]):'',_0x1e8889=_0x56f2d5[_0x2ced18(0x189)][_0x2ced18(0x18f)]?a33_0x3f7a73[_0x2ced18(0x18a)]('\x20\x20'+_0x56f2d5[_0x2ced18(0x189)][_0x2ced18(0x18f)]):'';console[_0x2ced18(0x18b)]('👤\x20'+_0x56f2d5[_0x2ced18(0x199)]+_0x23726d+_0x223b67+_0x1e8889);}return 0x0;}catch(_0x11f5d2){return _0x11f5d2 instanceof Error&&console[_0x2ced18(0x188)](_0x2ced18(0x18e)+_0x11f5d2[_0x2ced18(0x196)]),0x1;}}}
1
+ const a33_0x35d619=a33_0x26e4;(function(_0x3b068c,_0xe9a188){const _0x1e3f4f=a33_0x26e4,_0x2604ee=_0x3b068c();while(!![]){try{const _0x1744d3=parseInt(_0x1e3f4f(0xe3))/0x1*(-parseInt(_0x1e3f4f(0xe7))/0x2)+parseInt(_0x1e3f4f(0xd9))/0x3*(-parseInt(_0x1e3f4f(0xd1))/0x4)+-parseInt(_0x1e3f4f(0xd5))/0x5*(-parseInt(_0x1e3f4f(0xcf))/0x6)+-parseInt(_0x1e3f4f(0xdd))/0x7*(-parseInt(_0x1e3f4f(0xe4))/0x8)+-parseInt(_0x1e3f4f(0xdb))/0x9+-parseInt(_0x1e3f4f(0xd6))/0xa*(-parseInt(_0x1e3f4f(0xe5))/0xb)+-parseInt(_0x1e3f4f(0xe6))/0xc*(-parseInt(_0x1e3f4f(0xe9))/0xd);if(_0x1744d3===_0xe9a188)break;else _0x2604ee['push'](_0x2604ee['shift']());}catch(_0x55b217){_0x2604ee['push'](_0x2604ee['shift']());}}}(a33_0x54f7,0x962d2));import{BaseCommand}from'./command.js';function a33_0x54f7(){const _0x481317=['message','6cByCDm','site','1618605DoSrIo','length','1097110gdugoE','scope','name','List\x20all\x20available\x20profiles','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','profiles','1049KVFNQO','40Fgqytp','67331XGpwRn','12KJCVeM','854AxsjJL','\x20\x20Global:\x20~/.config/tdx/tdx.json','1068145bxzhSc','👤\x20','Error:\x20','1812WunCqI','config','1390252Iaykck','log','execute','green','8935claDgx','870lVUetg','description'];a33_0x54f7=function(){return _0x481317;};return a33_0x54f7();}import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';import{handleSDKOutput,isStructuredFormat}from'../core/command-output.js';function a33_0x26e4(_0x1a02a2,_0x53a240){_0x1a02a2=_0x1a02a2-0xce;const _0x54f7bc=a33_0x54f7();let _0x26e425=_0x54f7bc[_0x1a02a2];return _0x26e425;}import a33_0x10220d from'chalk';export class ProfilesCommand extends BaseCommand{['name']=a33_0x35d619(0xe2);['description']=a33_0x35d619(0xe0);async[a33_0x35d619(0xd3)](_0x4acfca){const _0x1482ed=a33_0x35d619,{options:_0x3d32a9}=_0x4acfca;try{const _0x57f838=listProfiles(),_0x13be62=getActiveProfile();if(_0x57f838[_0x1482ed(0xdc)]===0x0)return console[_0x1482ed(0xd2)]('No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a'),console[_0x1482ed(0xd2)](_0x1482ed(0xe1)),console[_0x1482ed(0xd2)](_0x1482ed(0xe8)),0x0;const _0x259d3d=_0x57f838['map'](_0x3bbf48=>{const _0x3de937=_0x1482ed,_0x49f888=_0x3bbf48['name']===_0x13be62,_0x176b41=getProfileParams(_0x3bbf48[_0x3de937(0xd0)]);return{'name':_0x3bbf48[_0x3de937(0xdf)],'active':_0x49f888,'scope':_0x3bbf48[_0x3de937(0xde)],'description':_0x3bbf48[_0x3de937(0xd0)]['description']||'','params':_0x176b41};});if(isStructuredFormat(_0x3d32a9))await handleSDKOutput(_0x259d3d,_0x3d32a9);else for(const _0xad004 of _0x57f838){const _0x5d1f45=_0xad004['name']===_0x13be62?a33_0x10220d[_0x1482ed(0xd4)]('\x20✓'):'',_0x1c1107=_0xad004[_0x1482ed(0xd0)][_0x1482ed(0xda)]?a33_0x10220d['dim']('\x20'+_0xad004['config'][_0x1482ed(0xda)]):'',_0xc232ca=_0xad004[_0x1482ed(0xd0)][_0x1482ed(0xd7)]?a33_0x10220d['dim']('\x20\x20'+_0xad004[_0x1482ed(0xd0)][_0x1482ed(0xd7)]):'';console[_0x1482ed(0xd2)](_0x1482ed(0xea)+_0xad004[_0x1482ed(0xdf)]+_0x5d1f45+_0x1c1107+_0xc232ca);}return 0x0;}catch(_0x5331bb){return _0x5331bb instanceof Error&&console['error'](_0x1482ed(0xce)+_0x5331bb[_0x1482ed(0xd8)]),0x1;}}}