@treasuredata/tdx 2026.4.16 → 2026.4.18

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 (220) 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/cas-command.js +1 -1
  11. package/dist/commands/cas-segment-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/claude-statusline-command.js +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/connection-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/delivery-command.js +1 -1
  20. package/dist/commands/describe.js +1 -1
  21. package/dist/commands/engage-campaign-pull-command.js +1 -1
  22. package/dist/commands/engage-campaign-push-command.js +1 -1
  23. package/dist/commands/engage-campaign-validate-command.js +1 -1
  24. package/dist/commands/engage-command.js +1 -1
  25. package/dist/commands/engage-template-pull-command.js +1 -1
  26. package/dist/commands/engage-template-push-command.js +1 -1
  27. package/dist/commands/engage-template-validate-command.js +1 -1
  28. package/dist/commands/job-command.js +1 -1
  29. package/dist/commands/journey-command.js +1 -1
  30. package/dist/commands/journey-validate-command.js +1 -1
  31. package/dist/commands/llm-command.js +1 -1
  32. package/dist/commands/mcp-command.js +1 -1
  33. package/dist/commands/parent-segment-command.js +1 -1
  34. package/dist/commands/policy-command.js +1 -1
  35. package/dist/commands/profile-command.js +1 -1
  36. package/dist/commands/profiles-command.js +1 -1
  37. package/dist/commands/query-command.js +1 -1
  38. package/dist/commands/schedule-command.js +1 -1
  39. package/dist/commands/segment-command.js +1 -1
  40. package/dist/commands/segment-create-command.js +1 -1
  41. package/dist/commands/segment-fields-command.js +1 -1
  42. package/dist/commands/segment-pull-command.js +1 -1
  43. package/dist/commands/segment-push-command.js +1 -1
  44. package/dist/commands/segment-update-command.js +1 -1
  45. package/dist/commands/segment-use-command.js +1 -1
  46. package/dist/commands/segment-validate-command.js +1 -1
  47. package/dist/commands/segments.js +1 -1
  48. package/dist/commands/show.js +1 -1
  49. package/dist/commands/status-command.js +1 -1
  50. package/dist/commands/tables.js +1 -1
  51. package/dist/commands/unset-command.js +1 -1
  52. package/dist/commands/upgrade-command.js +1 -1
  53. package/dist/commands/use-command.js +1 -1
  54. package/dist/commands/user-command.js +1 -1
  55. package/dist/commands/work-command.js +1 -1
  56. package/dist/commands/workflow-command.js +1 -1
  57. package/dist/core/auth.js +1 -1
  58. package/dist/core/command-output.js +1 -1
  59. package/dist/core/config.js +1 -1
  60. package/dist/core/connection-cache.js +1 -1
  61. package/dist/core/constants.js +1 -1
  62. package/dist/core/credential-cache.js +1 -1
  63. package/dist/core/global-context.js +1 -1
  64. package/dist/core/keychain.js +1 -1
  65. package/dist/core/oauth-keychain.js +1 -1
  66. package/dist/core/oauth.js +1 -1
  67. package/dist/core/profile.js +1 -1
  68. package/dist/core/project-config.js +1 -1
  69. package/dist/core/session.js +1 -1
  70. package/dist/core/user-cache.js +1 -1
  71. package/dist/core/version.js +1 -1
  72. package/dist/index.js +1 -1
  73. package/dist/mcp/server.js +1 -1
  74. package/dist/mcp/tools/index.js +1 -1
  75. package/dist/mcp/tools/tdx-run.js +1 -1
  76. package/dist/mcp/tools/tdx-search.js +1 -1
  77. package/dist/mcp/tools/work-create-item.js +1 -1
  78. package/dist/mcp/utils.js +1 -1
  79. package/dist/proxy/claude-usage-tracker.js +1 -1
  80. package/dist/proxy/passthrough-server.js +1 -1
  81. package/dist/proxy/sse-usage-parser.js +1 -1
  82. package/dist/sdk/agent/agent-config.js +1 -1
  83. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  84. package/dist/sdk/agent/agent-yaml.js +1 -1
  85. package/dist/sdk/agent/test/evaluator.js +1 -1
  86. package/dist/sdk/agent/test/executor.js +1 -1
  87. package/dist/sdk/agent/test/index.js +1 -1
  88. package/dist/sdk/agent/test/output.js +1 -1
  89. package/dist/sdk/agent/test/parser.js +1 -1
  90. package/dist/sdk/agent/tool-target-registry.js +1 -1
  91. package/dist/sdk/api.js +1 -1
  92. package/dist/sdk/cas/cas-api-client.js +1 -1
  93. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  94. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  95. package/dist/sdk/cas/index.js +1 -1
  96. package/dist/sdk/cas/pull-workflow.js +1 -1
  97. package/dist/sdk/cas/push-workflow.js +1 -1
  98. package/dist/sdk/client/cdp-api-client.js +1 -1
  99. package/dist/sdk/client/delivery-api-client.js +1 -1
  100. package/dist/sdk/client/endpoints.js +1 -1
  101. package/dist/sdk/client/engage-api-client.js +1 -1
  102. package/dist/sdk/client/http-client.js +1 -1
  103. package/dist/sdk/client/llm-api-client.js +1 -1
  104. package/dist/sdk/client/oauth-refresh.js +1 -1
  105. package/dist/sdk/client/rate-limiter.js +1 -1
  106. package/dist/sdk/client/td-api-client.js +1 -1
  107. package/dist/sdk/client/trino-api-client.js +1 -1
  108. package/dist/sdk/client/workflow-client.js +1 -1
  109. package/dist/sdk/connection-validator.js +1 -1
  110. package/dist/sdk/connection.js +1 -1
  111. package/dist/sdk/delivery.js +1 -1
  112. package/dist/sdk/engage/campaign-pull.js +1 -1
  113. package/dist/sdk/engage/campaign-push.js +1 -1
  114. package/dist/sdk/engage/campaign-validator.js +1 -1
  115. package/dist/sdk/engage/campaign-yaml.js +1 -1
  116. package/dist/sdk/engage/template-pull.js +1 -1
  117. package/dist/sdk/engage/template-push.js +1 -1
  118. package/dist/sdk/engage/template-validator.js +1 -1
  119. package/dist/sdk/engage/template-yaml.js +1 -1
  120. package/dist/sdk/engage/types/campaign-def.js +1 -1
  121. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  122. package/dist/sdk/engage/types/template-schema.js +1 -1
  123. package/dist/sdk/engage.js +1 -1
  124. package/dist/sdk/errors.js +1 -1
  125. package/dist/sdk/index.js +1 -1
  126. package/dist/sdk/io/index.js +1 -1
  127. package/dist/sdk/io/node-filesystem.js +1 -1
  128. package/dist/sdk/job.js +1 -1
  129. package/dist/sdk/journey.js +1 -1
  130. package/dist/sdk/llm/chat-cache.js +1 -1
  131. package/dist/sdk/llm/index.js +1 -1
  132. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  133. package/dist/sdk/llm/model-factors.js +1 -1
  134. package/dist/sdk/personalization.js +1 -1
  135. package/dist/sdk/policy.js +1 -1
  136. package/dist/sdk/query/index.js +1 -1
  137. package/dist/sdk/query/sql-parser.js +1 -1
  138. package/dist/sdk/realtime.js +1 -1
  139. package/dist/sdk/schedule.js +1 -1
  140. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  141. package/dist/sdk/segment/fields-display.js +1 -1
  142. package/dist/sdk/segment/file-discovery.js +1 -1
  143. package/dist/sdk/segment/journey-utils.js +1 -1
  144. package/dist/sdk/segment/journey-validator.js +1 -1
  145. package/dist/sdk/segment/journey-yaml.js +1 -1
  146. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  147. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  148. package/dist/sdk/segment/pull-workflow.js +1 -1
  149. package/dist/sdk/segment/push-recovery.js +1 -1
  150. package/dist/sdk/segment/push-workflow.js +1 -1
  151. package/dist/sdk/segment/resolution-context.js +1 -1
  152. package/dist/sdk/segment/segment-path-parser.js +1 -1
  153. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  154. package/dist/sdk/segment/segment-validator.js +1 -1
  155. package/dist/sdk/segment/target-resolution.js +1 -1
  156. package/dist/sdk/segment/tdx-config.js +1 -1
  157. package/dist/sdk/segment/types/activation-schema.js +1 -1
  158. package/dist/sdk/segment/types/journey-def.js +1 -1
  159. package/dist/sdk/segment/types/journey-schema.js +1 -1
  160. package/dist/sdk/segment/types/segment-def.js +1 -1
  161. package/dist/sdk/segment/types/segment-schema.js +1 -1
  162. package/dist/sdk/segment/validate-files.js +1 -1
  163. package/dist/sdk/segment/yaml-validator.js +1 -1
  164. package/dist/sdk/segment.js +1 -1
  165. package/dist/sdk/types/index.js +1 -1
  166. package/dist/sdk/types/progress.js +1 -1
  167. package/dist/sdk/types/workspace.js +1 -1
  168. package/dist/sdk/user.js +1 -1
  169. package/dist/sdk/util/format-detector.js +1 -1
  170. package/dist/sdk/util/formatters.js +1 -1
  171. package/dist/sdk/util/index.js +1 -1
  172. package/dist/sdk/util/paginate.js +1 -1
  173. package/dist/sdk/util/tree-formatter.js +1 -1
  174. package/dist/sdk/workflow/archive-validation.js +1 -1
  175. package/dist/sdk/workflow/clone-workflow.js +1 -1
  176. package/dist/sdk/workflow/index.js +1 -1
  177. package/dist/sdk/workflow/pull-workflow.js +1 -1
  178. package/dist/sdk/workflow/push-workflow.js +1 -1
  179. package/dist/sdk/workflow/tdx-config.js +1 -1
  180. package/dist/sdk/workflow/workflow-utils.js +1 -1
  181. package/dist/sdk/workspace/access-tracker.js +1 -1
  182. package/dist/sdk/workspace/frontmatter.js +1 -1
  183. package/dist/sdk/workspace/git.js +1 -1
  184. package/dist/sdk/workspace/index.js +1 -1
  185. package/dist/sdk/workspace/templates.js +1 -1
  186. package/dist/sdk/workspace/weekly.js +1 -1
  187. package/dist/sdk/workspace/wikilinks.js +1 -1
  188. package/dist/test-utils/command-runner.js +1 -1
  189. package/dist/test-utils/factories.js +1 -1
  190. package/dist/test-utils/fixtures.js +1 -1
  191. package/dist/test-utils/http-mock.js +1 -1
  192. package/dist/test-utils/index.js +1 -1
  193. package/dist/utils/async.js +1 -1
  194. package/dist/utils/colors.js +1 -1
  195. package/dist/utils/diff.js +1 -1
  196. package/dist/utils/file-permissions.js +1 -1
  197. package/dist/utils/file-reader.js +1 -1
  198. package/dist/utils/github-releases.js +1 -1
  199. package/dist/utils/global-cache.js +1 -1
  200. package/dist/utils/json-loader.js +1 -1
  201. package/dist/utils/local-cache.js +1 -1
  202. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  203. package/dist/utils/logger/formatters/index.js +1 -1
  204. package/dist/utils/logger/handlers/console-handler.js +1 -1
  205. package/dist/utils/logger/handlers/file-handler.js +1 -1
  206. package/dist/utils/logger/handlers/index.js +1 -1
  207. package/dist/utils/logger/handlers/null-handler.js +1 -1
  208. package/dist/utils/logger/index.js +1 -1
  209. package/dist/utils/logger/logger.js +1 -1
  210. package/dist/utils/logger/types.js +1 -1
  211. package/dist/utils/option-validation.js +1 -1
  212. package/dist/utils/process.js +1 -1
  213. package/dist/utils/prompt.js +1 -1
  214. package/dist/utils/spinner.js +1 -1
  215. package/dist/utils/sse-parser.js +1 -1
  216. package/dist/utils/string-utils.js +1 -1
  217. package/dist/utils/table-ref-parser.js +1 -1
  218. package/dist/utils/tdx-logger.js +1 -1
  219. package/dist/utils/version-check.js +1 -1
  220. package/package.json +17 -2
@@ -1 +1 @@
1
- const a31_0x344d96=a31_0x2ed7;(function(_0x178abb,_0x12e2ee){const _0x3b1b25=a31_0x2ed7,_0x110131=_0x178abb();while(!![]){try{const _0xc3267b=-parseInt(_0x3b1b25(0x1ee))/0x1+parseInt(_0x3b1b25(0x1c2))/0x2+-parseInt(_0x3b1b25(0x29c))/0x3*(parseInt(_0x3b1b25(0x22d))/0x4)+parseInt(_0x3b1b25(0x322))/0x5*(-parseInt(_0x3b1b25(0x265))/0x6)+parseInt(_0x3b1b25(0x17d))/0x7*(parseInt(_0x3b1b25(0x21e))/0x8)+-parseInt(_0x3b1b25(0x261))/0x9+-parseInt(_0x3b1b25(0x2ec))/0xa*(-parseInt(_0x3b1b25(0x187))/0xb);if(_0xc3267b===_0x12e2ee)break;else _0x110131['push'](_0x110131['shift']());}catch(_0x289b19){_0x110131['push'](_0x110131['shift']());}}}(a31_0x5a67,0xf1b5b));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a31_0x4a85ff 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';function a31_0x5a67(){const _0x539407=['td_client_id','SQL\x20query:\x0a','reduce','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','createPersonalization','Master\x20+\x20Attributes','Finding\x20service\x20for\x20token...','attributes','segment:parent:view','Default','/attempt/','pullParentYaml','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','site','behavior_','Update\x20a\x20realtime\x20personalization\x20entity','displaySampleData','\x20behaviors','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','328QBuxMg','No\x20personalization\x20services\x20configured','log','✔\x20Created\x20token\x20\x27','jsonl','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','keyEventCriteria','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context','stop','Errors:','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','xdg-open','/\x20→\x20','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','validateParentYaml','4gMDMvr','\x0a⚠️\x20\x20Both\x20','\x20(paused)','\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a','includeSensitive','\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22','Create\x20a\x20personalization\x20service\x20for\x20a\x20parent\x20segment','Personalization:','\x0aNo\x20sample\x20data\x20available','segment:parent:push','true','some','double','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context','Found\x20YAML\x20file:\x20','isDirectory','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','parent_segment','segment:parent:desc','displayBehaviorsStats','workflowSessionId','My\x20Service','✔\x20Found\x20','Schema\x20saved\x20to\x20','ps:pz:service:create','updateParent','sourceTableError','(id:\x20','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','Coverage:','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','.yaml','Error:\x20Parent\x20segment\x20name\x20is\x20required','Error:\x20\x22relationships.parentFolder\x22\x20is\x20required\x20in\x20the\x20JSON\x20file.','\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20','start','Attempt:','YAML\x20file:\x20','\x0a\x20\x20]\x0a}\x0a','✔\x20Retrieved\x20RT\x20configuration\x20version','allValid','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','Attribute:','Show\x20parent\x20segment\x20schema\x20(column\x20types)','personalization_services','Get\x20SQL\x20query\x20for\x20parent\x20segment','.yml','displayRealtimeInfo','displayMasterInfo','RT\x202.0\x20Validate:','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','13865193nlfnbS','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','Source:','create','18LKGyUm','bold','customerGroupFile','errors','\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','joinKey','\x20service(s)\x20configured','enriched','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID,\x20then\x20add:','Options\x20(one\x20required):\x0a','population','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','Available\x20behaviors:','audienceId:\x20','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','\x0a\x20\x20\x20\x20]','identifier:\x20','indexOf','segment:parent:fields','personalization','ps:rt:jn:resume','\x20\x20\x22relationships\x22:\x20{\x20\x22parentFolder\x22:\x20{\x20\x22data\x22:\x20{\x20\x22id\x22:\x20\x22<id>\x22,\x20\x22type\x22:\x20\x22folder-segment\x22\x20}\x20}\x20}','\x20tdx\x20wf\x20attempt\x20','replace','getCurrentConfigVersion','displayPreviewHints','-1d','session','behaviors','test','ps:pz:service:show','output','Aborted.','Executing\x20parent\x20segment\x20query...','map','Creating\x20token\x20\x27','Usage:\x20tdx\x20ps\x20pz\x20show\x20<personalization_id>','Updating\x20parent\x20segment\x20\x27','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]\x0a','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','utf-8','\x20configured','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','Overwrite\x20\x27','jobId','personalizationServices','Show\x20personalization\x20service\x20details','\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22','Error:\x20--folder-id\x20is\x20required.\x20Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID.','idStitching','Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]','attribute','Error:\x20Service\x20ID\x20is\x20required','2752845IhVqtQ','Fetching\x20customers\x20schema...','\x20Opening\x20','getBehaviorNames','eventKind:\x20','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','value','customerPercent','Show\x20a\x20specific\x20realtime\x20personalization','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]','table','description','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20rt\x20configuration_versions\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Get\x20RT\x20config\x20version\x20for\x20specific\x20parent\x20segment','\x20--behavior\x20\x22','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','%)\x20','Validate\x20RT\x202.0\x20configuration\x20from\x20parent\x20segment\x20YAML','\x0aTip:\x20Run\x20`tdx\x20ps\x20pz\x20service\x20init`\x20to\x20add\x20a\x20template\x20personalization\x20section\x20to\x20your\x20YAML','keys','entryCriteria','allowedIps','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','sampleData','Listing\x20RT\x20journeys\x20for\x20\x27','ps:pz:service:update','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','\x27\x20for\x20service\x20\x27','Join:','\x20personalization','Creating\x20personalization\x20\x27','payload:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20PZ\x20services\x20for\x20specific\x20parent\x20segment','behaviorsFile','Master\x20Table','\x22\x20}','Pattern:\x20','addAttributesFile','No\x20parent\x20segments\x20found','createParent','⚡\x20Not\x20enabled','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22','file','\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','limit','resolveParentId','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--file\x20<path>','length','Usage:\x20tdx\x20ps\x20rt\x20jn\x20pause_activations\x20<journeyId>\x0a','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]','addAttributes','Pausing\x20activations\x20for\x20RT\x20journey\x20\x27','created:','displayValidateResults','segment:parent:show','\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path','filter','List\x20realtime\x20personalizations\x20for\x20a\x20parent\x20segment','foreignKey','Resuming\x20activations\x20for\x20RT\x20journey\x20\x27','Name:\x20','\x0aUsage:\x20tdx\x20ps\x20preview\x20','Create\x20parent\x20segment\x20\x27','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','public','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','parentFolder','keyEventId','Usage:\x20tdx\x20ps\x20pz\x20delete\x20<personalization_id>','single','parent_id','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context','audienceId:','split','List\x20available\x20fields\x20for\x20segmentation','eventKind','totalEvents','\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)','32228110IjftEl','win32','\x20field','Usage:\x20tdx\x20ps\x20pz\x20service\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20PZ\x20services\x20(requires\x20context)\x0a','Fetching\x20sample\x20data...','SELECT\x20*\x20FROM\x20(\x0a','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','✔\x20Updated\x20parent\x20segment\x20\x27','sections:','✔\x20Resumed\x20activations\x20for\x20RT\x20journey\x20\x27','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','⚡\x20Enabled','\x27\x20(id:\x20','segment:parent:create','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','realtime','\x20is\x20already\x20up\x20to\x20date','\x20\x20\x20\x20\x20\x20\x20Pass\x20null\x20to\x20place\x20in\x20the\x20root\x20folder.','\x20true','\x27...','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20rt\x20jn\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20RT\x20journeys\x20for\x20specific\x20parent\x20segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>','Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a','localeCompare','sort','page_view','updated:','Usage:\x20tdx\x20ps\x20rt\x20jn\x20resume_activations\x20<journeyId>\x0a','Customers:','/\x20directory.\x0a','Error:','number','folder-segment','\x0a\x20\x20\x20\x20}','Columns:','Validating\x20RT\x20configuration...','⚠️\x20\x20personalization_services\x20section\x20already\x20exists\x20in\x20','allowed\x20IPs:','\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','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','public:','formatSchemaJson','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','scheduleType','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','\x20\x20Database:\x20','column','RT\x20Journey\x20ID:\x20','token:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context','previewParentYaml','3069085HTlncE','toFixed','collectSchema','tdx\x20ps\x20preview\x20','\x27\x20not\x20found\x20in\x20any\x20personalization\x20service','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','endsWith','all','addBehaviorsFile','matchedCount','Error:\x20Token\x20\x27','column_type','\x0aNew\x20parent\x20segment\x20\x27','Error:\x20Personalization\x20ID\x20is\x20required','/sessions/','dirname','message','Apply\x20changes\x20to\x20\x27','red','\x20=\x20','Listing\x20RT-enabled\x20parent\x20segments\x20matching\x20\x27','scheduleOption','name','green','label','getParentFull','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','state','List\x20parent\x20segments','{\x0a\x20\x20\x22database\x22:\x20\x22','\x20\x20\x20','processedRows','Patching\x20personalization\x20\x27','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','trim','stageCount','\x20[Job\x20ID:\x20','Master:','displaySummary','Fetching\x20current\x20configuration\x20for\x20\x27','join','null','\x22,\x20\x22type\x22:\x20\x22','column_name','getPersonalization','\x0aError:','Preview:','any','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]','events','schemaValid','\x20service','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','Join\x20on:','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','ps:rt:validate','columns','launched','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','No\x20RT-enabled\x20parent\x20segments\x20found','includeSensitive:','\x27\x20and\x20run\x20workflow?','Listing\x20fields\x20for\x20\x27','Listing\x20parent\x20segments...','\x20\x20\x20\x20','segment:parent:sql','coveragePercent','customersWithEvents','RT\x202.0:','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]\x0a','\x20total','✔\x20No\x20changes\x20-\x20\x27','yes','behavior','schemaError','Delete\x20a\x20personalization\x20service','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]\x0a','timezone','Error:\x20--name\x20is\x20required','pushParentYaml','Getting\x20personalization\x20\x27','paused','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]','\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20','toLowerCase','list','✔\x20Deleted\x20personalization\x20\x27','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','varchar','identifier','web','\x20Added\x20personalization\x20template\x20to\x20','Events:','ID\x20Stitching:','\x0a✔\x20Workflow\x20started','Error:\x20Token\x20name\x20is\x20required','cyan','/{name}.yml\x0a','Analyzing\x20changes...','\x20to\x20push\x20the\x20configuration','Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]','yellow','To\x20view\x20sample\x20data:','Options:','realtime_enabled','✔\x20Created\x20personalization\x20service\x20\x27','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','Attributes:','\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22','listFields','database','ps:pz:service:token:delete','Fetching\x20personalization\x20service\x20\x27','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','No\x20personalizations\x20configured','ps:pz:init','payload','\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','Resume\x20activations\x20in\x20an\x20RT\x20journey','\x0aChanges\x20to\x20\x27','Site:\x20','Usage:\x20tdx\x20ps\x20rt\x20configuration_versions\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Get\x20RT\x20config\x20version\x20(requires\x20context)\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20personalizations\x20for\x20specific\x20parent\x20segment','ps:pz:show','listPersonalizations','232043nduPsP','data','Personalization\x20service\x20description','stitchingKeys','ps:pz:delete','Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]','user_id','Enriched:','setJobId','Getting\x20RT\x20configuration\x20version\x20for\x20\x27','11GPFSUz','Fetching\x20behavior\x20list...','getOutputDatabaseName','\x27\x20with\x20ID:\x20','Options:\x0a','customers','folderId','/app/dw/parentSegments/','master','sections','Validate:','\x20\x20Note:\x20','status','Fetching\x20parent\x20segment\x20\x27','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','\x20stage','\x20\x20\x20\x20\x20\x20','tokens','stats','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','type','format','Listing\x20personalizations\x20for\x20\x27','\x20--interval\x20','ps:pz:service:token:create','relationships','SELECT\x20*\x20FROM\x20','\x20parent\x20segment','Usage:\x20tdx\x20ps\x20pz\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20personalizations\x20(requires\x20context)\x0a','audienceId','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context','displayAttributesStats','Error\x20parsing\x20YAML:\x20','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','execute','elapsedTimeMillis','ps:pz:create','\x20\x20Columns:\x20','Listing\x20personalization\x20services\x20for\x20\x27','string','ps:rt:configuration_versions','getParentSQL','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','Error\x20reading\x20file:\x20','✔\x20Updated\x20personalization\x20service\x20\x27','Attributes','No\x20RT\x20journeys\x20found','attributesFile','`\x20to\x20download\x20the\x20configuration\x20first','Deleting\x20personalization\x20service\x20\x27','text','dim','Create\x20a\x20token\x20for\x20a\x20personalization\x20service','✔\x20Renamed\x20directory\x20to\x20','Created','Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','\x20parent\x20segment\x20\x27','✔\x20Query\x20completed:\x20Processed\x20','List\x20parent\x20segments\x20with\x20RT\x202.0\x20status','3722362AhtQCt','\x20\x20Tables:\x201\x20customers\x20+\x20','\x5c$&','keyEventId:','List\x20personalization\x20services\x20for\x20a\x20parent\x20segment','\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22','Parent\x20segment:\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','tdx\x20ps\x20push\x20','customerGroup','realtime:','Creating','segment:parent:list','segment:parent:validate','information_schema','✘\x20Failed\x20to\x20rename\x20directory:\x20','Updated','delete','repeat','Resolving\x20parent\x20segment\x20\x27','Delete\x20a\x20token\x20from\x20a\x20personalization\x20service','Show\x20parent\x20segment\x20details','ignore','/\x20directories\x20exist.','error','Deleting\x20token\x20\x27','Create\x20a\x20realtime\x20personalization\x20entity','\x20--behavior\x20\x22<name>\x22','parentSegment','interval','status:\x20','Fetching\x20SQL\x20for\x20\x27','parent_segments','json','apply','in\x20','darwin','segment:parent:preview','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','<database>.<table>','Updating','workflowAttemptId','Behaviors','verbose','1153415aEIPxY','createdAt','updatedAt','listParents','Get\x20current\x20RT\x20configuration\x20version\x20status','Status:','displayPreviewResults','Error:\x20--behavior\x20requires\x20a\x20name\x0a','rowCount','.customers)','Audience\x20ID:','displayColumns','\x20\x20\x20\x20-\x20','Next\x20steps:','\x20personalization\x20service','Database:\x20','match','\x0aChanges\x20to\x20apply\x20to\x20\x27','run','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','segment','createToken','\x20rows\x20','preview','\x20No\x20changes\x20-\x20','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','\x20--attribute\x20\x22','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a'];a31_0x5a67=function(){return _0x539407;};return a31_0x5a67();}import{loadJSONFromOptions,loadJSON}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 a31_0x251538 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=a31_0x344d96(0x1e2),LEGACY_PARENT_SEGMENT_DIR=a31_0x344d96(0x23e);function openBrowser(_0x12b4f4){const _0x3c5afa=a31_0x344d96,_0x554c72=process['platform'],_0x55b201=_0x554c72===_0x3c5afa(0x1e6)?'open':_0x554c72===_0x3c5afa(0x2ed)?_0x3c5afa(0x250):_0x3c5afa(0x229);spawn(_0x55b201,[_0x12b4f4],{'detached':!![],'stdio':_0x3c5afa(0x1d8)})['unref']();}function migrateLegacyDirectory(){const _0x5c0073=a31_0x344d96;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x1ec928=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x1ec928[_0x5c0073(0x23c)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x5c0073(0x1da)](a31_0x251538[_0x5c0073(0x387)](_0x5c0073(0x22e)+LEGACY_PARENT_SEGMENT_DIR+'/\x20and\x20'+PARENT_SEGMENT_DIR+_0x5c0073(0x1d9))),console[_0x5c0073(0x1da)](a31_0x251538['dim'](_0x5c0073(0x358)+LEGACY_PARENT_SEGMENT_DIR+_0x5c0073(0x30b))),![];console['error'](a31_0x251538[_0x5c0073(0x387)]('\x0a⚠️\x20\x20Migrating:\x20'+LEGACY_PARENT_SEGMENT_DIR+_0x5c0073(0x22a)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x5c0073(0x1da)](a31_0x251538[_0x5c0073(0x339)](_0x5c0073(0x1bc)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x442dcd){const _0x6157ef=_0x442dcd instanceof Error?_0x442dcd['message']:String(_0x442dcd);return console[_0x5c0073(0x1da)](a31_0x251538[_0x5c0073(0x334)](_0x5c0073(0x1d1)+_0x6157ef+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async['run'](_0x7ba6fa){const _0x3b5e25=a31_0x344d96;return migrateLegacyDirectory(),super[_0x3b5e25(0x200)](_0x7ba6fa);}}function resolveYamlFile(_0x3c56ee){const _0x4569b7=a31_0x344d96;if(_0x3c56ee[_0x4569b7(0x328)](_0x4569b7(0x25b))||_0x3c56ee[_0x4569b7(0x328)](_0x4569b7(0x24c)))return _0x3c56ee;return a31_0x4a85ff['join'](PARENT_SEGMENT_DIR,sanitizeFileName(_0x3c56ee)+_0x4569b7(0x25b));}function formatProgressMessage(_0x2b18dc){const _0x3ee773=a31_0x344d96,_0x55267d=_0x2b18dc[_0x3ee773(0x1fe)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x55267d){const [,_0x553d1d,_0x5281ec,_0x59cc6a='']=_0x55267d;return a31_0x251538[_0x3ee773(0x1ba)](_0x553d1d+':')+'\x20'+_0x5281ec+a31_0x251538[_0x3ee773(0x1ba)](_0x59cc6a);}return a31_0x251538[_0x3ee773(0x1ba)](_0x2b18dc);}function showFileNotFoundError(_0x33f61c,_0x103664){const _0x599f35=a31_0x344d96;console[_0x599f35(0x1da)](a31_0x251538[_0x599f35(0x334)]('Error:\x20File\x20not\x20found:\x20'+_0x33f61c+'\x0a')),console['error'](a31_0x251538['cyan'](_0x599f35(0x19a)+_0x103664+_0x599f35(0x1b7)));}function a31_0x2ed7(_0xc64dad,_0x5a33e3){_0xc64dad=_0xc64dad-0x169;const _0x5a6779=a31_0x5a67();let _0x2ed7bb=_0x5a6779[_0xc64dad];return _0x2ed7bb;}function displayRealtimeValidation(_0x3a6d74){const _0x1467c0=a31_0x344d96;if(!_0x3a6d74[_0x1467c0(0x2fd)])return;const _0x6f78e3=_0x3a6d74[_0x1467c0(0x2fd)],_0x110d89=_0x6f78e3['enabled']?a31_0x251538['green'](_0x1467c0(0x2f9)):a31_0x251538['yellow'](_0x1467c0(0x2c4));console[_0x1467c0(0x1da)]('\x0a'+a31_0x251538[_0x1467c0(0x1ba)](_0x1467c0(0x366))+'\x20'+_0x110d89);if(_0x6f78e3['events']&&_0x6f78e3[_0x1467c0(0x353)][_0x1467c0(0x2cd)]>0x0){console['error']('\x20\x20'+a31_0x251538['dim'](_0x1467c0(0x37e))+'\x20'+_0x6f78e3['events']['length']+_0x1467c0(0x28f));for(const _0x4f78a7 of _0x6f78e3[_0x1467c0(0x353)]){const _0xa6f877=_0x4f78a7['sourceTableValid']===![]?a31_0x251538[_0x1467c0(0x334)]('✘'):a31_0x251538['green']('✔');console[_0x1467c0(0x1da)](_0x1467c0(0x362)+_0xa6f877+'\x20'+_0x4f78a7['name']),_0x4f78a7['sourceTableError']&&console[_0x1467c0(0x1da)](_0x1467c0(0x197)+a31_0x251538[_0x1467c0(0x334)](_0x4f78a7[_0x1467c0(0x247)]));}}if(_0x6f78e3[_0x1467c0(0x211)]&&_0x6f78e3[_0x1467c0(0x211)][_0x1467c0(0x2cd)]>0x0){console[_0x1467c0(0x1da)]('\x20\x20'+a31_0x251538[_0x1467c0(0x1ba)](_0x1467c0(0x16b))+'\x20'+_0x6f78e3['attributes']['length']+'\x20configured');for(const _0x2eea95 of _0x6f78e3[_0x1467c0(0x211)]){const _0x1fa865=_0x2eea95['valid']?a31_0x251538[_0x1467c0(0x339)]('✔'):a31_0x251538[_0x1467c0(0x334)]('✘');console['error']('\x20\x20\x20\x20'+_0x1fa865+'\x20'+_0x2eea95[_0x1467c0(0x338)]+'\x20'+a31_0x251538[_0x1467c0(0x1ba)]('('+_0x2eea95[_0x1467c0(0x19b)]+')'));}}if(_0x6f78e3[_0x1467c0(0x297)]){const _0x42ab78=_0x6f78e3[_0x1467c0(0x297)][_0x1467c0(0x180)]?.['length']?'\x20+\x20['+_0x6f78e3['idStitching'][_0x1467c0(0x180)][_0x1467c0(0x34a)](',\x20')+']':'';console[_0x1467c0(0x1da)]('\x20\x20'+a31_0x251538['dim'](_0x1467c0(0x37f))+'\x20'+_0x6f78e3[_0x1467c0(0x297)]['primaryKey']+_0x42ab78);}if(_0x6f78e3[_0x1467c0(0x293)]&&_0x6f78e3[_0x1467c0(0x293)]['length']>0x0){console[_0x1467c0(0x1da)]('\x20\x20'+a31_0x251538[_0x1467c0(0x1ba)](_0x1467c0(0x234))+'\x20'+_0x6f78e3[_0x1467c0(0x293)]['length']+_0x1467c0(0x355)+(_0x6f78e3[_0x1467c0(0x293)]['length']!==0x1?'s':''));for(const _0x1007a1 of _0x6f78e3['personalizationServices']){console[_0x1467c0(0x1da)](_0x1467c0(0x1fa)+_0x1007a1[_0x1467c0(0x338)]);}}}function showParentSegmentNotSetError(_0x2dc399){const _0x3593ac=a31_0x344d96;console[_0x3593ac(0x1da)](a31_0x251538[_0x3593ac(0x387)](_0x3593ac(0x343))),console['error'](_0x2dc399);}export class ParentSegmentListCommand extends BaseCommand{['name']=a31_0x344d96(0x1ce);[a31_0x344d96(0x2a7)]=a31_0x344d96(0x33e);async[a31_0x344d96(0x1a9)](_0x5d2bd8){const _0x76bdc5=a31_0x344d96,{options:_0x2b1c7f,args:_0x44a2cb,tdx:_0x3d2e44}=_0x5d2bd8,_0x36ed03=_0x44a2cb[0x0];_0x2b1c7f[_0x76bdc5(0x1ed)]&&(console[_0x76bdc5(0x1da)](_0x76bdc5(0x178)+_0x2b1c7f[_0x76bdc5(0x217)]),_0x36ed03&&console[_0x76bdc5(0x1da)](_0x76bdc5(0x2c0)+_0x36ed03));const _0x284c2f=await withSpinner(_0x36ed03?'Listing\x20parent\x20segments\x20matching\x20\x27'+_0x36ed03+_0x76bdc5(0x301):_0x76bdc5(0x361),()=>_0x3d2e44[_0x76bdc5(0x202)][_0x76bdc5(0x1f1)](),{'verbose':_0x2b1c7f[_0x76bdc5(0x1ed)]});let _0x1a0127=_0x284c2f['data'];if(_0x36ed03){const _0x2138f5=_0x36ed03[_0x76bdc5(0x27d)](/[.+^${}()|[\]\\]/g,'\x5c$&')[_0x76bdc5(0x27d)](/\*/g,'.*')[_0x76bdc5(0x27d)](/\?/g,'.'),_0x1fdde8=new RegExp('^'+_0x2138f5+'$','i');_0x1a0127=_0x1a0127['filter'](_0x21064c=>_0x1fdde8[_0x76bdc5(0x283)](_0x21064c[_0x76bdc5(0x211)]['name']));}_0x1a0127[_0x76bdc5(0x306)]((_0x2f4b7f,_0x2219f9)=>_0x2f4b7f[_0x76bdc5(0x211)][_0x76bdc5(0x338)][_0x76bdc5(0x305)](_0x2219f9['attributes']['name'])),console[_0x76bdc5(0x1da)]('✔\x20Found\x20'+_0x1a0127[_0x76bdc5(0x2cd)]+_0x76bdc5(0x1a2)+(_0x1a0127[_0x76bdc5(0x2cd)]!==0x1?'s':''));const _0x384839=_0x46b95e=>{const _0x50548b=_0x76bdc5;return getConsoleNextUrl(_0x2b1c7f['site'],_0x50548b(0x18e)+_0x46b95e);};if(_0x2b1c7f['format']===_0x76bdc5(0x1e3)||_0x2b1c7f['format']===_0x76bdc5(0x222)){const _0x193b07=_0x1a0127['map'](_0x3047ce=>({..._0x3047ce,'url':_0x384839(_0x3047ce['id'])}));await handleSDKOutput(_0x193b07,_0x2b1c7f);}else{if(_0x1a0127[_0x76bdc5(0x2cd)]===0x0)_0x36ed03?console[_0x76bdc5(0x220)]('No\x20parent\x20segments\x20match\x20pattern:\x20'+_0x36ed03):console[_0x76bdc5(0x220)](_0x76bdc5(0x2c2));else for(const _0x403a11 of _0x1a0127){const _0x3cf8e4=_0x403a11['attributes']['population']?a31_0x251538[_0x76bdc5(0x1ba)]('\x20('+formatRows(_0x403a11[_0x76bdc5(0x211)]['population'])+')'):'',_0xcf1113=hyperlink(_0x403a11[_0x76bdc5(0x211)][_0x76bdc5(0x338)],_0x384839(_0x403a11['id']));console[_0x76bdc5(0x220)](_0x76bdc5(0x31b)+_0xcf1113+_0x3cf8e4);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a31_0x344d96(0x338)]=a31_0x344d96(0x2fb);[a31_0x344d96(0x2a7)]=a31_0x344d96(0x20d);async['execute'](_0x5bf65f){const _0x57142e=a31_0x344d96,{options:_0xb76178,args:_0x5c9145,tdx:_0x4a716a}=_0x5bf65f;console[_0x57142e(0x1da)](_0x57142e(0x28d)+_0x57142e(0x2c5)+_0x57142e(0x209));const _0x339933=_0xb76178;if(_0x5c9145['length']===0x0)return console['error'](a31_0x251538['red']('Error:\x20Parent\x20segment\x20name\x20is\x20required')),console[_0x57142e(0x1da)](_0x57142e(0x23d)),0x1;const _0x320e68=_0x5c9145[0x0];if(!_0x339933[_0x57142e(0x16e)]||!_0x339933[_0x57142e(0x2a6)])return console[_0x57142e(0x1da)]('Error:\x20--database\x20and\x20--table\x20are\x20required'),console['error'](_0x57142e(0x23d)),0x1;_0x339933['verbose']&&(console['error'](_0x57142e(0x178)+_0x339933['site']),console[_0x57142e(0x1da)](_0x57142e(0x2da)+_0x320e68),console[_0x57142e(0x1da)](_0x57142e(0x1fd)+_0x339933[_0x57142e(0x16e)]),console[_0x57142e(0x1da)]('Table:\x20'+_0x339933[_0x57142e(0x2a6)]));const _0x181d1c=await loadJSONFromOptions(_0x339933[_0x57142e(0x211)],_0x339933[_0x57142e(0x1b6)]),_0x5bbae6=await loadJSONFromOptions(_0x339933[_0x57142e(0x282)],_0x339933[_0x57142e(0x2bd)]),_0x137c7b=await loadJSONFromOptions(_0x339933[_0x57142e(0x1cb)],_0x339933[_0x57142e(0x267)]),_0x848b81={'name':_0x320e68,'description':_0x339933['description'],'scheduleType':_0x339933['scheduleType'],'scheduleOption':_0x339933[_0x57142e(0x337)],'timezone':_0x339933[_0x57142e(0x36f)],'master':{'parentDatabaseName':_0x339933[_0x57142e(0x16e)],'parentTableName':_0x339933[_0x57142e(0x2a6)]},'attributes':_0x181d1c,'behaviors':_0x5bbae6,'customerGroup':_0x137c7b},_0x1e47be=await withSpinner('Creating\x20parent\x20segment\x20\x27'+_0x320e68+_0x57142e(0x301),()=>_0x4a716a['segment'][_0x57142e(0x2c3)](_0x848b81),{'verbose':_0xb76178[_0x57142e(0x1ed)]}),_0x55bd07=_0x1e47be['data'];return console[_0x57142e(0x1da)]('✔\x20Created\x20parent\x20segment\x20\x27'+_0x55bd07[_0x57142e(0x338)]+_0x57142e(0x18a)+_0x55bd07['id']),await handleSDKOutput([_0x55bd07],_0xb76178),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a31_0x344d96(0x338)]='segment:parent:update';[a31_0x344d96(0x2a7)]=a31_0x344d96(0x2fc);async['execute'](_0x5b6f21){const _0x3b8ce8=a31_0x344d96,{options:_0x2ad74c,args:_0x21e103,tdx:_0x3c4d34}=_0x5b6f21;console[_0x3b8ce8(0x1da)](_0x3b8ce8(0x24b)+'\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a'+_0x3b8ce8(0x209));const _0x2295d2=_0x2ad74c;if(_0x21e103[_0x3b8ce8(0x2cd)]===0x0)return console['error'](a31_0x251538[_0x3b8ce8(0x334)](_0x3b8ce8(0x24d))),console['error'](_0x3b8ce8(0x33c)),0x1;const _0x18f436=_0x21e103[0x0];_0x2295d2[_0x3b8ce8(0x1ed)]&&(console[_0x3b8ce8(0x1da)](_0x3b8ce8(0x178)+_0x2295d2[_0x3b8ce8(0x217)]),console[_0x3b8ce8(0x1da)](_0x3b8ce8(0x1c8)+_0x18f436));const _0x4e65b4=await withSpinner(_0x3b8ce8(0x349)+_0x18f436+_0x3b8ce8(0x301),()=>_0x3c4d34[_0x3b8ce8(0x202)][_0x3b8ce8(0x33b)](_0x18f436),{'verbose':_0x2295d2[_0x3b8ce8(0x1ed)]}),_0x36ce12=_0x4e65b4[_0x3b8ce8(0x17e)],_0x16be88=await loadJSONFromOptions(_0x2295d2[_0x3b8ce8(0x2d0)],_0x2295d2[_0x3b8ce8(0x2c1)]),_0x27837d=await loadJSONFromOptions(_0x2295d2['addBehaviors'],_0x2295d2[_0x3b8ce8(0x32a)]),_0x32c4cb={'name':_0x36ce12['name'],'description':_0x2295d2[_0x3b8ce8(0x2a7)]!==undefined?_0x2295d2[_0x3b8ce8(0x2a7)]:_0x36ce12[_0x3b8ce8(0x2a7)],'scheduleType':_0x2295d2[_0x3b8ce8(0x319)]!==undefined?_0x2295d2[_0x3b8ce8(0x319)]:_0x36ce12[_0x3b8ce8(0x319)],'scheduleOption':_0x2295d2['scheduleOption']!==undefined?_0x2295d2[_0x3b8ce8(0x337)]:_0x36ce12[_0x3b8ce8(0x337)],'timezone':_0x2295d2[_0x3b8ce8(0x36f)]!==undefined?_0x2295d2[_0x3b8ce8(0x36f)]:_0x36ce12[_0x3b8ce8(0x36f)],'master':_0x36ce12[_0x3b8ce8(0x18f)],'attributes':_0x16be88?[..._0x36ce12['attributes']||[],..._0x16be88]:_0x36ce12[_0x3b8ce8(0x211)],'behaviors':_0x27837d?[..._0x36ce12[_0x3b8ce8(0x282)]||[],..._0x27837d]:_0x36ce12[_0x3b8ce8(0x282)],'customerGroup':_0x36ce12[_0x3b8ce8(0x1cb)]},_0x23bb33=await withSpinner(_0x3b8ce8(0x28b)+_0x18f436+_0x3b8ce8(0x301),()=>_0x3c4d34['segment'][_0x3b8ce8(0x246)](_0x18f436,_0x32c4cb),{'verbose':_0x2295d2['verbose']}),_0x1d8324=_0x23bb33[_0x3b8ce8(0x17e)];return console[_0x3b8ce8(0x1da)](_0x3b8ce8(0x2f5)+_0x1d8324[_0x3b8ce8(0x338)]+'\x27'),await handleSDKOutput([_0x1d8324],_0x2295d2),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a31_0x344d96(0x338)]='segment:parent:pull';[a31_0x344d96(0x2a7)]=a31_0x344d96(0x201);async['execute'](_0x4147d){const _0x429025=a31_0x344d96,{options:_0x1bd7f1,args:_0x2447f7,tdx:_0x739242}=_0x4147d,_0x1a21af=_0x1bd7f1,_0x41f734=_0x2447f7[0x0]||_0x1bd7f1[_0x429025(0x1de)];if(!_0x41f734)return showParentSegmentNotSetError(_0x429025(0x2dd)+_0x429025(0x2f4)),0x1;if(_0x1a21af['use']&&_0x1a21af[_0x429025(0x285)])return console[_0x429025(0x1da)](a31_0x251538['red'](_0x429025(0x2a1))),console[_0x429025(0x1da)](a31_0x251538[_0x429025(0x1ba)]('The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires')),console[_0x429025(0x1da)](a31_0x251538[_0x429025(0x1ba)]('using\x20the\x20default\x20path:\x20'+PARENT_SEGMENT_DIR+_0x429025(0x383))),console[_0x429025(0x1da)](a31_0x251538[_0x429025(0x382)](_0x429025(0x262))),0x1;const _0x302ac8=_0x1a21af[_0x429025(0x285)]||a31_0x4a85ff[_0x429025(0x34a)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x41f734)+_0x429025(0x25b));_0x1a21af[_0x429025(0x1ed)]&&(console['error'](_0x429025(0x178)+_0x1a21af[_0x429025(0x217)]),console['error']('Parent\x20segment:\x20'+_0x41f734),console['error']('Output\x20file:\x20'+_0x302ac8));const _0x2ddcad=await withSpinner(_0x429025(0x194)+_0x41f734+'\x27...',()=>_0x739242['segment'][_0x429025(0x215)](_0x41f734),{'verbose':_0x1a21af[_0x429025(0x1ed)]}),_0x3686d2=_0x2ddcad['data'];if(existsSync(_0x302ac8)){const _0x32d4a2=readFileSync(_0x302ac8,_0x429025(0x28e)),_0x58b60d=generateDiff(_0x32d4a2,_0x3686d2);if(!hasChanges(_0x58b60d))console[_0x429025(0x1da)](a31_0x251538['green']('✔')+_0x429025(0x206)+a31_0x251538['cyan'](_0x302ac8)+_0x429025(0x2fe));else{console[_0x429025(0x1da)](_0x429025(0x177)+_0x302ac8+'\x27:'),console['error']('─'[_0x429025(0x1d4)](0x3c)),console[_0x429025(0x1da)](formatDiffWithColors(_0x58b60d)),console['error']('─'[_0x429025(0x1d4)](0x3c));if(!_0x1a21af[_0x429025(0x36a)]){if(!isInteractive())return console[_0x429025(0x1da)](a31_0x251538[_0x429025(0x334)](_0x429025(0x34f)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x429025(0x1da)](a31_0x251538[_0x429025(0x1ba)](_0x429025(0x379))),0x1;const _0x26416e=await confirmKey(_0x429025(0x291)+_0x302ac8+'\x27?');if(!_0x26416e)return console[_0x429025(0x1da)](a31_0x251538[_0x429025(0x387)]('Aborted.')),0x1;}writeFileSync(_0x302ac8,_0x3686d2,_0x429025(0x28e)),console[_0x429025(0x1da)](a31_0x251538[_0x429025(0x339)]('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a31_0x251538[_0x429025(0x382)](_0x302ac8));}}else{const _0x145881=a31_0x4a85ff[_0x429025(0x331)](_0x302ac8);!existsSync(_0x145881)&&mkdirSync(_0x145881,{'recursive':!![]}),writeFileSync(_0x302ac8,_0x3686d2,_0x429025(0x28e)),console[_0x429025(0x1da)](a31_0x251538[_0x429025(0x339)]('✔')+_0x429025(0x1e8)+a31_0x251538[_0x429025(0x382)](_0x302ac8));}return saveSessionContext({'parent_segment':_0x41f734},_0x1a21af[_0x429025(0x281)]),console[_0x429025(0x1da)](a31_0x251538['green']('✔')+'\x20Context\x20set:\x20'+a31_0x251538['dim'](_0x429025(0x23e))+_0x429025(0x335)+a31_0x251538[_0x429025(0x382)](_0x41f734)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a31_0x344d96(0x338)]=a31_0x344d96(0x236);[a31_0x344d96(0x2a7)]='Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file';async[a31_0x344d96(0x1a9)](_0x346f71){const _0x251ee9=a31_0x344d96,{options:_0x47ddfc,args:_0x10de82,tdx:_0x146e9e}=_0x346f71,_0x16ccaa=_0x47ddfc,_0x54c882=_0x10de82[0x0]||_0x47ddfc[_0x251ee9(0x1de)];if(!_0x54c882)return showParentSegmentNotSetError(_0x251ee9(0x2ab)+_0x251ee9(0x223)),0x1;const _0x444fbd=resolveYamlFile(_0x54c882);if(!existsSync(_0x444fbd))return showFileNotFoundError(_0x444fbd,_0x54c882),0x1;_0x16ccaa[_0x251ee9(0x1ed)]&&(console[_0x251ee9(0x1da)](_0x251ee9(0x178)+_0x16ccaa[_0x251ee9(0x217)]),console[_0x251ee9(0x1da)](_0x251ee9(0x252)+_0x444fbd));let _0x3051b6;try{_0x3051b6=readFileSync(_0x444fbd,_0x251ee9(0x28e));}catch(_0x547247){const _0x453e3d=_0x547247 instanceof Error?_0x547247[_0x251ee9(0x332)]:String(_0x547247);return console['error']('Error\x20reading\x20file:\x20'+_0x453e3d),0x1;}const _0x1a30b8=await withSpinner(_0x251ee9(0x384),()=>_0x146e9e[_0x251ee9(0x202)][_0x251ee9(0x371)](_0x3051b6),{'verbose':_0x16ccaa[_0x251ee9(0x1ed)]}),_0x1a55ef=_0x1a30b8[_0x251ee9(0x17e)],{isNew:_0x6f6212,name:_0x32fdbf,hasChanges:_0xd2b2b7,diffFormatted:_0x4e50ae}=_0x1a55ef;if(!_0xd2b2b7)return console[_0x251ee9(0x1da)](_0x251ee9(0x369)+_0x32fdbf+'\x27\x20is\x20already\x20up\x20to\x20date'),0x0;_0x6f6212?console[_0x251ee9(0x1da)]('\x0aNew\x20parent\x20segment\x20\x27'+_0x32fdbf+'\x27:'):console[_0x251ee9(0x1da)]('\x0aChanges\x20to\x20apply\x20to\x20\x27'+_0x32fdbf+'\x27:');console[_0x251ee9(0x1da)]('─'['repeat'](0x3c)),console[_0x251ee9(0x1da)](_0x4e50ae),console[_0x251ee9(0x1da)]('─'['repeat'](0x3c));const _0x193423=_0x6f6212?_0x251ee9(0x2dc)+_0x32fdbf+'\x27?':_0x251ee9(0x333)+_0x32fdbf+'\x27?';if(!_0x16ccaa[_0x251ee9(0x36a)]){if(!isInteractive())return console[_0x251ee9(0x1da)](a31_0x251538[_0x251ee9(0x334)](_0x251ee9(0x34f)),_0x251ee9(0x21d)),console[_0x251ee9(0x1da)](a31_0x251538[_0x251ee9(0x1ba)](_0x251ee9(0x379))),0x1;const _0x2ae491=await confirmKey(_0x193423);if(!_0x2ae491)return console['error'](a31_0x251538[_0x251ee9(0x387)](_0x251ee9(0x286))),0x1;}const _0x6620c3=_0x6f6212?_0x251ee9(0x1cd):_0x251ee9(0x1ea),_0x2a5be0=await withSpinner(_0x6620c3+_0x251ee9(0x1bf)+_0x32fdbf+_0x251ee9(0x301),()=>_0x1a55ef[_0x251ee9(0x1e4)](),{'verbose':_0x16ccaa[_0x251ee9(0x1ed)]}),_0x33e91e=_0x2a5be0[_0x251ee9(0x17e)],_0x5d774e=getConsoleNextUrl(_0x16ccaa[_0x251ee9(0x217)],_0x251ee9(0x18e)+_0x33e91e['id']),_0x32bac9=_0x6f6212?_0x251ee9(0x1bd):'Updated';return console['error']('✔\x20'+_0x32bac9+_0x251ee9(0x1bf)+_0x33e91e[_0x251ee9(0x338)]+'\x27'),console[_0x251ee9(0x1da)]('\x20\x20'+_0x5d774e),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{['name']=a31_0x344d96(0x1cf);[a31_0x344d96(0x2a7)]=a31_0x344d96(0x2f3);async['execute'](_0x15e2ae){const _0x205ade=a31_0x344d96,{options:_0xf1cb3c,args:_0x55374c,tdx:_0x129175}=_0x15e2ae,_0x36fdf3=_0xf1cb3c,_0x2dd3f7=_0x55374c[0x0]||_0xf1cb3c['parentSegment'];if(!_0x2dd3f7)return showParentSegmentNotSetError(_0x205ade(0x2f2)+_0x205ade(0x26d)+_0x205ade(0x18b)+_0x205ade(0x16a)+_0x205ade(0x256)+_0x205ade(0x35c)),0x1;const _0x243a1d=resolveYamlFile(_0x2dd3f7);if(!existsSync(_0x243a1d))return showFileNotFoundError(_0x243a1d,_0x2dd3f7),0x1;_0x36fdf3[_0x205ade(0x1ed)]&&(console['error'](_0x205ade(0x178)+_0x36fdf3[_0x205ade(0x217)]),console['error'](_0x205ade(0x252)+_0x243a1d));let _0x245393;try{_0x245393=readFileSync(_0x243a1d,_0x205ade(0x28e));}catch(_0x458fa2){const _0x3e2c9b=_0x458fa2 instanceof Error?_0x458fa2[_0x205ade(0x332)]:String(_0x458fa2);return console[_0x205ade(0x1da)]('Error\x20reading\x20file:\x20'+_0x3e2c9b),0x1;}const _0x20c3dd=createCommandSpinner(a31_0x251538['dim']('Validating\x20configuration...'),{'verbose':_0x36fdf3[_0x205ade(0x1ed)]});_0x20c3dd['start']();const _0x33f62e={'onProgress':_0x2be8ac=>{_0x20c3dd['text']=formatProgressMessage(_0x2be8ac);}};if(_0x36fdf3[_0x205ade(0x18f)])_0x33f62e[_0x205ade(0x18f)]=!![];if(_0x36fdf3[_0x205ade(0x26c)])_0x33f62e['enriched']=!![];_0x36fdf3['attribute']&&(_0x33f62e[_0x205ade(0x29a)]=_0x36fdf3[_0x205ade(0x29a)]);_0x36fdf3[_0x205ade(0x36b)]&&(_0x33f62e[_0x205ade(0x36b)]=_0x36fdf3['behavior']);if(_0x36fdf3[_0x205ade(0x1df)])_0x33f62e[_0x205ade(0x1df)]=_0x36fdf3[_0x205ade(0x1df)];let _0x29e3cb;try{_0x29e3cb=await _0x129175[_0x205ade(0x202)][_0x205ade(0x22c)](_0x245393,_0x33f62e),_0x20c3dd[_0x205ade(0x226)]();}catch(_0x48dc83){_0x20c3dd['stop']();throw _0x48dc83;}const _0x3ccdc1=_0x36fdf3['interval']||_0x205ade(0x280);return this[_0x205ade(0x2d3)](_0x29e3cb,_0x33f62e,_0x243a1d,_0x3ccdc1),_0x29e3cb['allValid']?0x0:0x1;}[a31_0x344d96(0x2d3)](_0xafd856,_0x3e64f6,_0x1195ab,_0x5b016f){const _0x51a27c=a31_0x344d96;console[_0x51a27c(0x1da)]('\x0a'+a31_0x251538[_0x51a27c(0x266)](_0x51a27c(0x191))+'\x20'+_0xafd856[_0x51a27c(0x338)]),console[_0x51a27c(0x1da)]('═'[_0x51a27c(0x1d4)](0x3c)),this[_0x51a27c(0x25d)](_0xafd856);if(typeof _0x3e64f6[_0x51a27c(0x29a)]===_0x51a27c(0x1ae)){this[_0x51a27c(0x1a6)](_0xafd856),this[_0x51a27c(0x348)](_0xafd856),this[_0x51a27c(0x27f)](_0x1195ab,_0x5b016f,_0x51a27c(0x29a),_0x3e64f6[_0x51a27c(0x29a)]);return;}if(_0x3e64f6[_0x51a27c(0x29a)]===!![]){this['displayAttributesStats'](_0xafd856),this['displaySummary'](_0xafd856),this['displayPreviewHints'](_0x1195ab,_0x5b016f,_0x51a27c(0x211));return;}if(typeof _0x3e64f6[_0x51a27c(0x36b)]===_0x51a27c(0x1ae)){this[_0x51a27c(0x240)](_0xafd856,_0x5b016f),this['displaySummary'](_0xafd856),this[_0x51a27c(0x27f)](_0x1195ab,_0x5b016f,_0x51a27c(0x36b),_0x3e64f6['behavior']);return;}if(_0x3e64f6[_0x51a27c(0x36b)]===!![]){this[_0x51a27c(0x240)](_0xafd856,_0x5b016f),this['displaySummary'](_0xafd856),this[_0x51a27c(0x27f)](_0x1195ab,_0x5b016f,_0x51a27c(0x282));return;}this[_0x51a27c(0x1a6)](_0xafd856),this[_0x51a27c(0x240)](_0xafd856,_0x5b016f),this[_0x51a27c(0x25c)](_0xafd856),this[_0x51a27c(0x348)](_0xafd856),this[_0x51a27c(0x27f)](_0x1195ab,_0x5b016f,_0x51a27c(0x329));}['displayRealtimeInfo'](_0x39c287){displayRealtimeValidation(_0x39c287);}['displayPreviewHints'](_0x3d0aad,_0x4b2dfc,_0x2c6f02,_0x2a337e){const _0x2ea5de=a31_0x344d96;console[_0x2ea5de(0x1da)]('\x0a'+a31_0x251538['dim'](_0x2ea5de(0x388)));const _0x2976be=_0x4b2dfc!==_0x2ea5de(0x280)?_0x2ea5de(0x19e)+_0x4b2dfc:'';if(_0x2c6f02===_0x2ea5de(0x29a)&&_0x2a337e)console['error']('\x20\x20'+a31_0x251538[_0x2ea5de(0x1ba)]('tdx\x20ps\x20preview\x20'+_0x3d0aad+_0x2ea5de(0x208)+_0x2a337e+'\x22'+_0x2976be));else{if(_0x2c6f02===_0x2ea5de(0x36b)&&_0x2a337e)console[_0x2ea5de(0x1da)]('\x20\x20'+a31_0x251538['dim']('tdx\x20ps\x20preview\x20'+_0x3d0aad+'\x20--behavior\x20\x22'+_0x2a337e+'\x22'+_0x2976be));else(_0x2c6f02==='attributes'||_0x2c6f02==='all')&&console[_0x2ea5de(0x1da)]('\x20\x20'+a31_0x251538['dim']('tdx\x20ps\x20preview\x20'+_0x3d0aad+'\x20--attribute\x20\x22<name>\x22'+_0x2976be));}(_0x2c6f02===_0x2ea5de(0x282)||_0x2c6f02===_0x2ea5de(0x329))&&console[_0x2ea5de(0x1da)]('\x20\x20'+a31_0x251538[_0x2ea5de(0x1ba)](_0x2ea5de(0x325)+_0x3d0aad+_0x2ea5de(0x1dd)+_0x2976be)),_0x2c6f02===_0x2ea5de(0x329)&&console[_0x2ea5de(0x1da)]('\x20\x20'+a31_0x251538[_0x2ea5de(0x1ba)](_0x2ea5de(0x325)+_0x3d0aad+'\x20--enriched'+_0x2976be));}[a31_0x344d96(0x25d)](_0x2eb8e3){const _0x20801f=a31_0x344d96,{master:_0xbd3ca5}=_0x2eb8e3,_0x5de66c=_0xbd3ca5[_0x20801f(0x354)]?a31_0x251538[_0x20801f(0x339)]('✔'):a31_0x251538[_0x20801f(0x334)]('✘');console['error']('\x0a'+a31_0x251538['dim'](_0x20801f(0x2be))),console[_0x20801f(0x1da)](_0x5de66c+'\x20'+a31_0x251538['bold'](_0xbd3ca5[_0x20801f(0x16e)]+'.'+_0xbd3ca5[_0x20801f(0x2a6)])),_0xbd3ca5[_0x20801f(0x354)]?_0xbd3ca5['rowCount']!==undefined&&console[_0x20801f(0x1da)]('\x20\x20'+a31_0x251538[_0x20801f(0x1ba)]('Rows:')+'\x20'+a31_0x251538['cyan'](formatRows(_0xbd3ca5[_0x20801f(0x1f6)]))):console[_0x20801f(0x1da)]('\x20\x20'+a31_0x251538[_0x20801f(0x334)](_0x20801f(0x30c))+'\x20'+_0xbd3ca5['schemaError']);}[a31_0x344d96(0x1a6)](_0x35634a){const _0x31804b=a31_0x344d96;if(_0x35634a[_0x31804b(0x211)][_0x31804b(0x2cd)]===0x0)return;console[_0x31804b(0x1da)]('\x0a'+a31_0x251538['dim'](_0x31804b(0x1b4)));for(const _0x2ad894 of _0x35634a[_0x31804b(0x211)]){const _0x20c4b9=_0x2ad894[_0x31804b(0x354)]?a31_0x251538['green']('✔'):a31_0x251538['red']('✘');let _0x53f44e='';if(_0x2ad894[_0x31804b(0x354)]&&_0x2ad894[_0x31804b(0x32b)]!==undefined&&_0x2ad894[_0x31804b(0x364)]!==undefined){const _0x1a1e92=_0x2ad894[_0x31804b(0x364)][_0x31804b(0x323)](0x1),_0x3d099b=_0x2ad894['coveragePercent']>=0x50?a31_0x251538['green']:_0x2ad894[_0x31804b(0x364)]>=0x32?a31_0x251538[_0x31804b(0x387)]:a31_0x251538[_0x31804b(0x334)];_0x53f44e='\x20'+a31_0x251538[_0x31804b(0x1ba)](_0x31804b(0x24a))+'\x20'+_0x3d099b(_0x1a1e92+'%')+'\x20('+formatRows(_0x2ad894['matchedCount'])+'\x20rows)';}console[_0x31804b(0x1da)](_0x20c4b9+'\x20'+a31_0x251538['bold'](_0x2ad894[_0x31804b(0x338)])+_0x53f44e),console['error']('\x20\x20'+a31_0x251538[_0x31804b(0x1ba)](_0x31804b(0x263))+'\x20'+a31_0x251538[_0x31804b(0x266)](_0x2ad894[_0x31804b(0x16e)]+'.'+_0x2ad894['table']));const _0x4bd3d0=_0x2ad894[_0x31804b(0x26a)]===_0x2ad894[_0x31804b(0x2d8)]?a31_0x251538[_0x31804b(0x1ba)]('Join\x20on:')+'\x20'+_0x2ad894[_0x31804b(0x26a)]:a31_0x251538[_0x31804b(0x1ba)]('Join:')+'\x20'+_0x2ad894[_0x31804b(0x26a)]+_0x31804b(0x335)+_0x2ad894[_0x31804b(0x2d8)];console[_0x31804b(0x1da)]('\x20\x20'+_0x4bd3d0),console[_0x31804b(0x1da)]('\x20\x20'+a31_0x251538['dim'](_0x31804b(0x310))),this[_0x31804b(0x1f9)](_0x2ad894['columns']),!_0x2ad894[_0x31804b(0x354)]&&console[_0x31804b(0x1da)]('\x20\x20'+a31_0x251538[_0x31804b(0x334)](_0x31804b(0x30c))+'\x20'+_0x2ad894[_0x31804b(0x36c)]);}}[a31_0x344d96(0x240)](_0x5af801,_0x42a6bf){const _0x527e95=a31_0x344d96;if(_0x5af801['behaviors'][_0x527e95(0x2cd)]===0x0)return;console[_0x527e95(0x1da)]('\x0a'+a31_0x251538[_0x527e95(0x1ba)](_0x527e95(0x1ec))+'\x20'+a31_0x251538[_0x527e95(0x1ba)]('('+_0x42a6bf+')'));for(const _0x2f8ea6 of _0x5af801['behaviors']){const _0x480977=_0x2f8ea6[_0x527e95(0x354)]?a31_0x251538[_0x527e95(0x339)]('✔'):a31_0x251538['red']('✘');let _0x4ddbda='';if(_0x2f8ea6[_0x527e95(0x354)]&&_0x2f8ea6['customersWithEvents']!==undefined&&_0x2f8ea6['totalEvents']!==undefined){const _0x392c30=_0x2f8ea6[_0x527e95(0x2a3)]?.[_0x527e95(0x323)](0x1)||'?',_0x200da3=(_0x2f8ea6['customerPercent']??0x0)>=0x32?a31_0x251538['green']:(_0x2f8ea6[_0x527e95(0x2a3)]??0x0)>=0x14?a31_0x251538[_0x527e95(0x387)]:a31_0x251538[_0x527e95(0x334)];_0x4ddbda='\x20'+a31_0x251538['dim'](_0x527e95(0x30a))+'\x20'+_0x200da3(formatRows(_0x2f8ea6[_0x527e95(0x365)]))+'\x20('+_0x392c30+_0x527e95(0x2ac)+a31_0x251538[_0x527e95(0x1ba)]('Events:')+'\x20'+a31_0x251538[_0x527e95(0x382)](formatRows(_0x2f8ea6[_0x527e95(0x2ea)]));}console[_0x527e95(0x1da)](_0x480977+'\x20'+a31_0x251538[_0x527e95(0x266)](_0x2f8ea6['name'])+_0x4ddbda),console[_0x527e95(0x1da)]('\x20\x20'+a31_0x251538['dim'](_0x527e95(0x263))+'\x20'+a31_0x251538[_0x527e95(0x266)](_0x2f8ea6['database']+'.'+_0x2f8ea6[_0x527e95(0x2a6)]));const _0x251e66=_0x2f8ea6['joinKey']===_0x2f8ea6['foreignKey']?a31_0x251538[_0x527e95(0x1ba)](_0x527e95(0x357))+'\x20'+_0x2f8ea6[_0x527e95(0x26a)]:a31_0x251538[_0x527e95(0x1ba)](_0x527e95(0x2b8))+'\x20'+_0x2f8ea6[_0x527e95(0x26a)]+'\x20=\x20'+_0x2f8ea6[_0x527e95(0x2d8)];console['error']('\x20\x20'+_0x251e66),console[_0x527e95(0x1da)]('\x20\x20'+a31_0x251538['dim'](_0x527e95(0x310))),this[_0x527e95(0x1f9)](_0x2f8ea6[_0x527e95(0x35a)]),!_0x2f8ea6[_0x527e95(0x354)]&&console[_0x527e95(0x1da)]('\x20\x20'+a31_0x251538['red']('Error:')+'\x20'+_0x2f8ea6['schemaError']);}}['displayColumns'](_0x40b0b6){const _0x25b458=a31_0x344d96;for(const _0x4d9ab6 of _0x40b0b6){_0x4d9ab6[_0x25b458(0x33a)]===_0x4d9ab6[_0x25b458(0x31d)]||_0x4d9ab6[_0x25b458(0x31d)]==='*'?console['error'](_0x25b458(0x1fa)+_0x4d9ab6[_0x25b458(0x33a)]):console[_0x25b458(0x1da)](_0x25b458(0x1fa)+_0x4d9ab6[_0x25b458(0x33a)]+'\x20'+a31_0x251538['dim']('('+_0x4d9ab6[_0x25b458(0x31d)]+')'));}}[a31_0x344d96(0x348)](_0x5126b6){const _0x2c7ca3=a31_0x344d96;console[_0x2c7ca3(0x1da)]('─'['repeat'](0x3c));if(_0x5126b6['errors'][_0x2c7ca3(0x2cd)]>0x0){console['error']('\x0a'+a31_0x251538[_0x2c7ca3(0x334)](_0x2c7ca3(0x227)));for(const _0x1f2879 of _0x5126b6['errors']){console['error']('\x20\x20'+a31_0x251538[_0x2c7ca3(0x334)]('•')+'\x20'+_0x1f2879);}}_0x5126b6[_0x2c7ca3(0x255)]&&console[_0x2c7ca3(0x1da)]('\x0a'+a31_0x251538[_0x2c7ca3(0x339)]('✔')+'\x20Configuration\x20is\x20valid');}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a31_0x344d96(0x338)]=a31_0x344d96(0x1e7);['description']=a31_0x344d96(0x318);async[a31_0x344d96(0x1a9)](_0x4533e4){const _0x123e8b=a31_0x344d96,{options:_0x1e87f7,args:_0x4d4439,tdx:_0xe65702}=_0x4533e4,_0x2b17e7=_0x1e87f7,_0x7b2be3=_0x4d4439[0x0]||_0x1e87f7['parentSegment'];if(!_0x7b2be3)return showParentSegmentNotSetError(_0x123e8b(0x2b6)+_0x123e8b(0x2df)+_0x123e8b(0x26f)+_0x123e8b(0x195)+_0x123e8b(0x207)+_0x123e8b(0x22b)+_0x123e8b(0x271)+_0x123e8b(0x35c)),0x1;if(!_0x2b17e7[_0x123e8b(0x18f)]&&!_0x2b17e7[_0x123e8b(0x29a)]&&!_0x2b17e7[_0x123e8b(0x36b)]&&!_0x2b17e7[_0x123e8b(0x26c)])return console[_0x123e8b(0x1da)](a31_0x251538[_0x123e8b(0x334)](_0x123e8b(0x315))),console[_0x123e8b(0x1da)](_0x123e8b(0x1a8)),console[_0x123e8b(0x1da)](_0x123e8b(0x389)),console[_0x123e8b(0x1da)](_0x123e8b(0x228)),console[_0x123e8b(0x1da)](_0x123e8b(0x249)),console[_0x123e8b(0x1da)](_0x123e8b(0x274)),console[_0x123e8b(0x1da)](_0x123e8b(0x290)),0x1;const _0x5490fd=resolveYamlFile(_0x7b2be3);if(!existsSync(_0x5490fd))return showFileNotFoundError(_0x5490fd,_0x7b2be3),0x1;_0x2b17e7[_0x123e8b(0x1ed)]&&(console[_0x123e8b(0x1da)](_0x123e8b(0x178)+_0x2b17e7[_0x123e8b(0x217)]),console['error'](_0x123e8b(0x252)+_0x5490fd));let _0x3291b7;try{_0x3291b7=readFileSync(_0x5490fd,'utf-8');}catch(_0xa99ff8){const _0x4b32d2=_0xa99ff8 instanceof Error?_0xa99ff8[_0x123e8b(0x332)]:String(_0xa99ff8);return console[_0x123e8b(0x1da)](_0x123e8b(0x1b2)+_0x4b32d2),0x1;}let _0x3edb5a;try{_0x3edb5a=parseDef(_0x3291b7);}catch(_0x3527ae){const _0x4a0ba7=_0x3527ae instanceof Error?_0x3527ae['message']:String(_0x3527ae);return console[_0x123e8b(0x1da)](a31_0x251538['red'](_0x123e8b(0x1a7)+_0x4a0ba7)),0x1;}if(_0x2b17e7[_0x123e8b(0x29a)]===!![]||_0x2b17e7[_0x123e8b(0x29a)]===''){const _0x4fd020=_0x3edb5a[_0x123e8b(0x211)]?.[_0x123e8b(0x288)](_0x4cd787=>_0x4cd787['name'])||[];if(_0x4fd020[_0x123e8b(0x2cd)]===0x0)console[_0x123e8b(0x1da)](a31_0x251538[_0x123e8b(0x334)](_0x123e8b(0x2c9)));else{console[_0x123e8b(0x1da)](a31_0x251538['red']('Error:\x20--attribute\x20requires\x20a\x20name\x0a')),console['error']('Available\x20attributes:');for(const _0x5d5641 of _0x4fd020){console[_0x123e8b(0x1da)]('\x20\x20'+a31_0x251538[_0x123e8b(0x382)](_0x5d5641));}console[_0x123e8b(0x1da)](_0x123e8b(0x2db)+_0x7b2be3+_0x123e8b(0x208)+_0x4fd020[0x0]+'\x22');}return 0x1;}if(_0x2b17e7[_0x123e8b(0x36b)]===!![]||_0x2b17e7[_0x123e8b(0x36b)]===''){const _0x475dd0=_0x3edb5a['behaviors']?.[_0x123e8b(0x288)](_0x325d87=>_0x325d87[_0x123e8b(0x338)])||[];if(_0x475dd0[_0x123e8b(0x2cd)]===0x0)console['error'](a31_0x251538['red']('Error:\x20No\x20behaviors\x20defined\x20in\x20configuration'));else{console[_0x123e8b(0x1da)](a31_0x251538[_0x123e8b(0x334)](_0x123e8b(0x1f5))),console[_0x123e8b(0x1da)](_0x123e8b(0x272));for(const _0x1975c8 of _0x475dd0){console[_0x123e8b(0x1da)]('\x20\x20'+a31_0x251538['cyan'](_0x1975c8));}console['error'](_0x123e8b(0x2db)+_0x7b2be3+_0x123e8b(0x2a9)+_0x475dd0[0x0]+'\x22');}return 0x1;}const _0x34a352=createCommandSpinner(a31_0x251538[_0x123e8b(0x1ba)](_0x123e8b(0x2f0)),{'verbose':_0x2b17e7['verbose']});_0x34a352[_0x123e8b(0x250)]();const _0x1b887f={'onProgress':_0x10c247=>{const _0x4d00f0=_0x123e8b;_0x34a352[_0x4d00f0(0x1b9)]=formatProgressMessage(_0x10c247);}};if(_0x2b17e7[_0x123e8b(0x18f)])_0x1b887f['master']=!![];if(_0x2b17e7['attribute']&&typeof _0x2b17e7['attribute']===_0x123e8b(0x1ae))_0x1b887f[_0x123e8b(0x29a)]=_0x2b17e7[_0x123e8b(0x29a)];if(_0x2b17e7[_0x123e8b(0x36b)]&&typeof _0x2b17e7[_0x123e8b(0x36b)]===_0x123e8b(0x1ae))_0x1b887f[_0x123e8b(0x36b)]=_0x2b17e7[_0x123e8b(0x36b)];if(_0x2b17e7[_0x123e8b(0x26c)])_0x1b887f[_0x123e8b(0x26c)]=!![];if(_0x2b17e7[_0x123e8b(0x1df)])_0x1b887f[_0x123e8b(0x1df)]=_0x2b17e7['interval'];let _0x88fa6b;try{_0x88fa6b=await _0xe65702[_0x123e8b(0x202)][_0x123e8b(0x321)](_0x3291b7,_0x1b887f),_0x34a352[_0x123e8b(0x226)]();}catch(_0x4da6f1){_0x34a352[_0x123e8b(0x226)]();throw _0x4da6f1;}return await this[_0x123e8b(0x1f4)](_0x88fa6b,{'master':_0x2b17e7[_0x123e8b(0x18f)],'attribute':typeof _0x2b17e7[_0x123e8b(0x29a)]===_0x123e8b(0x1ae)?_0x2b17e7['attribute']:undefined,'behavior':typeof _0x2b17e7[_0x123e8b(0x36b)]===_0x123e8b(0x1ae)?_0x2b17e7[_0x123e8b(0x36b)]:undefined,'enriched':_0x2b17e7[_0x123e8b(0x26c)]}),_0x88fa6b[_0x123e8b(0x255)]?0x0:0x1;}async['displayPreviewResults'](_0x2a9844,_0x520f19){const _0x2b8874=a31_0x344d96;console[_0x2b8874(0x1da)]('\x0a'+a31_0x251538[_0x2b8874(0x266)](_0x2b8874(0x350))+'\x20'+_0x2a9844[_0x2b8874(0x338)]),console[_0x2b8874(0x1da)]('═'['repeat'](0x3c));if(_0x520f19[_0x2b8874(0x18f)]&&_0x2a9844[_0x2b8874(0x2b3)]){const _0x37c7ac=a31_0x251538[_0x2b8874(0x1ba)](_0x2b8874(0x347))+'\x20'+a31_0x251538[_0x2b8874(0x266)](_0x2a9844['master'][_0x2b8874(0x16e)]+'.'+_0x2a9844['master']['table']);await this[_0x2b8874(0x21a)](_0x37c7ac,_0x2a9844[_0x2b8874(0x2b3)]);}else{if(_0x520f19[_0x2b8874(0x29a)]&&_0x2a9844['sampleData']){const _0x331cb4=a31_0x251538['dim'](_0x2b8874(0x257))+'\x20'+a31_0x251538[_0x2b8874(0x266)](_0x520f19[_0x2b8874(0x29a)]);await this[_0x2b8874(0x21a)](_0x331cb4,_0x2a9844['sampleData']);}else{if(_0x520f19['behavior']&&_0x2a9844[_0x2b8874(0x2b3)]){const _0x5cf8e3=a31_0x251538[_0x2b8874(0x1ba)]('Behavior:')+'\x20'+a31_0x251538[_0x2b8874(0x266)](_0x520f19[_0x2b8874(0x36b)]);await this[_0x2b8874(0x21a)](_0x5cf8e3,_0x2a9844[_0x2b8874(0x2b3)]);}else{if(_0x520f19[_0x2b8874(0x26c)]&&_0x2a9844['sampleData']){const _0x2f01fb=a31_0x251538[_0x2b8874(0x1ba)](_0x2b8874(0x184))+'\x20'+a31_0x251538[_0x2b8874(0x266)](_0x2b8874(0x20f));await this[_0x2b8874(0x21a)](_0x2f01fb,_0x2a9844['sampleData']);}else!_0x2a9844[_0x2b8874(0x2b3)]&&console[_0x2b8874(0x1da)](_0x2b8874(0x235));}}}if(_0x2a9844['errors'][_0x2b8874(0x2cd)]>0x0){console[_0x2b8874(0x1da)]('─'[_0x2b8874(0x1d4)](0x3c)),console[_0x2b8874(0x1da)]('\x0a'+a31_0x251538[_0x2b8874(0x334)]('Errors:'));for(const _0x426efe of _0x2a9844[_0x2b8874(0x268)]){console[_0x2b8874(0x1da)]('\x20\x20'+a31_0x251538['red']('•')+'\x20'+_0x426efe);}}}async[a31_0x344d96(0x21a)](_0x28b7ad,_0x57f380){const _0x371c3e=a31_0x344d96;if(_0x57f380[_0x371c3e(0x2cd)]===0x0){console[_0x371c3e(0x1da)]('\x0a'+_0x28b7ad),console[_0x371c3e(0x1da)]('\x20\x20No\x20sample\x20data\x20available');return;}console[_0x371c3e(0x1da)]('\x0a'+_0x28b7ad);const _0x32f339=Object[_0x371c3e(0x2af)](_0x57f380[0x0])[_0x371c3e(0x288)](_0x554946=>({'name':_0x554946,'type':typeof _0x57f380[0x0][_0x554946]===_0x371c3e(0x30d)?_0x371c3e(0x239):_0x371c3e(0x37a)})),_0x22ff28={'queryId':_0x371c3e(0x205),'columns':_0x32f339,'data':_0x57f380,'stats':{'state':'FINISHED','queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x57f380[_0x371c3e(0x2cd)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x26bd44=formatAsTable(_0x22ff28,_0x57f380[_0x371c3e(0x2cd)],!![]);await writeOutput(_0x26bd44,undefined,_0x371c3e(0x2a6));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a31_0x344d96(0x338)]='segment:parent:run';['description']=a31_0x344d96(0x216);async[a31_0x344d96(0x1a9)](_0xcc1160){const _0x39e21b=a31_0x344d96,{options:_0x456652,args:_0x3753fb,tdx:_0x595eb8}=_0xcc1160,_0x14cdcb=_0x456652,_0x565440=_0x3753fb[0x0]||_0x456652[_0x39e21b(0x1de)];if(!_0x565440)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment'),0x1;const _0x5a121c=resolveYamlFile(_0x565440);if(existsSync(_0x5a121c)){_0x14cdcb[_0x39e21b(0x1ed)]&&console[_0x39e21b(0x1da)](_0x39e21b(0x23b)+_0x5a121c);let _0x740d64;try{_0x740d64=readFileSync(_0x5a121c,_0x39e21b(0x28e));}catch(_0x43ee94){const _0x567604=_0x43ee94 instanceof Error?_0x43ee94['message']:String(_0x43ee94);return console[_0x39e21b(0x1da)]('Error\x20reading\x20file:\x20'+_0x567604),0x1;}const _0x242d55=await withSpinner(_0x39e21b(0x384),()=>_0x595eb8['segment'][_0x39e21b(0x371)](_0x740d64),{'verbose':_0x14cdcb[_0x39e21b(0x1ed)]}),_0xffe702=_0x242d55['data'],{isNew:_0x2f5e62,name:_0x418737,hasChanges:_0x5c8402,diffFormatted:_0x458eee}=_0xffe702;if(_0x5c8402){_0x2f5e62?console[_0x39e21b(0x1da)](_0x39e21b(0x32e)+_0x418737+'\x27:'):console['error'](_0x39e21b(0x1ff)+_0x418737+'\x27:');console[_0x39e21b(0x1da)]('─'[_0x39e21b(0x1d4)](0x3c)),console[_0x39e21b(0x1da)](_0x458eee),console['error']('─'['repeat'](0x3c));const _0x21521a=_0x2f5e62?_0x39e21b(0x2dc)+_0x418737+_0x39e21b(0x35f):_0x39e21b(0x333)+_0x418737+_0x39e21b(0x35f);if(!_0x14cdcb[_0x39e21b(0x36a)]){if(!isInteractive())return console[_0x39e21b(0x1da)](a31_0x251538['red'](_0x39e21b(0x34f)),_0x39e21b(0x21d)),console['error'](a31_0x251538[_0x39e21b(0x1ba)](_0x39e21b(0x379))),0x1;const _0x216aa6=await confirmKey(_0x21521a);if(!_0x216aa6)return console[_0x39e21b(0x1da)](a31_0x251538[_0x39e21b(0x387)](_0x39e21b(0x286))),0x1;}const _0x2eae57=_0x2f5e62?'Creating':_0x39e21b(0x1ea);await withSpinner(_0x2eae57+_0x39e21b(0x1bf)+_0x418737+'\x27...',()=>_0xffe702[_0x39e21b(0x1e4)](),{'verbose':_0x14cdcb[_0x39e21b(0x1ed)]});const _0x278300=_0x2f5e62?'Created':_0x39e21b(0x1d2);console['error']('✔\x20'+_0x278300+_0x39e21b(0x1bf)+_0x418737+'\x27');}else console[_0x39e21b(0x1da)](_0x39e21b(0x369)+_0x418737+'\x27\x20is\x20up\x20to\x20date');}const _0x2e130e=await withSpinner(_0x39e21b(0x171)+_0x565440+_0x39e21b(0x301),()=>_0x595eb8['segment']['runParent'](_0x565440),{'verbose':_0x14cdcb[_0x39e21b(0x1ed)]}),_0x300947=_0x2e130e[_0x39e21b(0x17e)],_0x4613a3=getConsoleUrl(_0x14cdcb[_0x39e21b(0x217)],'/app/workflows/'+_0x300947['workflowId']+_0x39e21b(0x330)+_0x300947[_0x39e21b(0x241)]+_0x39e21b(0x214)+_0x300947[_0x39e21b(0x1eb)]);return console[_0x39e21b(0x1da)](_0x39e21b(0x380)),console[_0x39e21b(0x1da)]('\x20\x20'+a31_0x251538[_0x39e21b(0x1ba)](_0x39e21b(0x1f8))+'\x20'+_0x300947[_0x39e21b(0x1a4)]),console[_0x39e21b(0x1da)]('\x20\x20'+a31_0x251538[_0x39e21b(0x1ba)](_0x39e21b(0x1f3))+'\x20'+_0x300947[_0x39e21b(0x193)]),console['error']('\x20\x20'+a31_0x251538['dim']('Session:')+'\x20'+_0x300947[_0x39e21b(0x241)]),console[_0x39e21b(0x1da)]('\x20\x20'+a31_0x251538[_0x39e21b(0x1ba)](_0x39e21b(0x251))+'\x20'+_0x300947[_0x39e21b(0x1eb)]),console[_0x39e21b(0x1da)]('\x20\x20'+_0x4613a3),console[_0x39e21b(0x1da)]('\x0a'+a31_0x251538[_0x39e21b(0x1ba)]('To\x20cancel:')+_0x39e21b(0x27c)+_0x300947['workflowAttemptId']+'\x20kill'),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{['name']=a31_0x344d96(0x278);[a31_0x344d96(0x2a7)]=a31_0x344d96(0x2e8);async[a31_0x344d96(0x1a9)](_0x52f7f6){const _0x2c8ffe=a31_0x344d96,{options:_0x32b108,args:_0x11b257,tdx:_0x1a2cc9}=_0x52f7f6,_0x3dd112=_0x11b257[0x0]||_0x32b108[_0x2c8ffe(0x1de)];if(!_0x3dd112)return showParentSegmentNotSetError(_0x2c8ffe(0x2aa)+'\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;_0x32b108[_0x2c8ffe(0x1ed)]&&(console[_0x2c8ffe(0x1da)]('Site:\x20'+_0x32b108[_0x2c8ffe(0x217)]),console['error']('Parent\x20segment:\x20'+_0x3dd112));const _0x4f67d3=await withSpinner(_0x2c8ffe(0x360)+_0x3dd112+'\x27...',()=>_0x1a2cc9[_0x2c8ffe(0x202)][_0x2c8ffe(0x16d)](_0x3dd112),{'verbose':_0x32b108[_0x2c8ffe(0x1ed)]}),_0x30aae0=_0x4f67d3[_0x2c8ffe(0x17e)];console[_0x2c8ffe(0x1da)](_0x2c8ffe(0x243)+_0x30aae0['length']+_0x2c8ffe(0x2ee)+(_0x30aae0[_0x2c8ffe(0x2cd)]!==0x1?'s':''));if(_0x32b108['json']||_0x32b108['jsonl'])return await handleSDKOutput(_0x30aae0,_0x32b108),0x0;return displayFieldsHumanReadable(_0x30aae0,_0x3dd112),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a31_0x344d96(0x338)]=a31_0x344d96(0x212);[a31_0x344d96(0x2a7)]=a31_0x344d96(0x1d7);async['execute'](_0x55b11e){const _0x23272e=a31_0x344d96,{options:_0x551048,args:_0x5ebae7,tdx:_0x2f0835}=_0x55b11e,_0x19d592=_0x551048,_0x15036f=_0x5ebae7[0x0]||_0x551048[_0x23272e(0x1de)];if(!_0x15036f)return showParentSegmentNotSetError(_0x23272e(0x1b1)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a'+_0x23272e(0x18b)+_0x23272e(0x260)),0x1;_0x551048['verbose']&&(console['error'](_0x23272e(0x178)+_0x551048[_0x23272e(0x217)]),console[_0x23272e(0x1da)](_0x23272e(0x1c8)+_0x15036f));const _0x299bec=await withSpinner(_0x23272e(0x194)+_0x15036f+_0x23272e(0x301),()=>_0x2f0835[_0x23272e(0x202)]['getParentFull'](_0x15036f),{'verbose':_0x551048[_0x23272e(0x1ed)]}),_0x92d73f=_0x299bec[_0x23272e(0x17e)];if(_0x19d592[_0x23272e(0x37c)]){const _0x5906e7=getConsoleNextUrl(_0x19d592[_0x23272e(0x217)],_0x23272e(0x18e)+_0x92d73f['id']);return console[_0x23272e(0x1da)](a31_0x251538[_0x23272e(0x339)]('✔')+_0x23272e(0x29e)+a31_0x251538[_0x23272e(0x382)](_0x5906e7)),openBrowser(_0x5906e7),0x0;}return await handleSingleObjectOutput(_0x92d73f,_0x551048),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a31_0x344d96(0x338)]=a31_0x344d96(0x23f);[a31_0x344d96(0x2a7)]=a31_0x344d96(0x258);async[a31_0x344d96(0x1a9)](_0x12efc1){const _0x472170=a31_0x344d96,{options:_0x3608e7,args:_0x57c94e,tdx:_0x1a3d95}=_0x12efc1,_0x4b40fb=_0x3608e7,_0x5af1bb=_0x57c94e[0x0]||_0x3608e7[_0x472170(0x1de)];if(!_0x5af1bb)return showParentSegmentNotSetError(_0x472170(0x31a)+_0x472170(0x175)+_0x472170(0x18b)+_0x472170(0x2d5)),0x1;_0x3608e7['verbose']&&(console[_0x472170(0x1da)](_0x472170(0x178)+_0x3608e7[_0x472170(0x217)]),console[_0x472170(0x1da)](_0x472170(0x1c8)+_0x5af1bb));const _0x27351a=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x5af1bb+_0x472170(0x301),()=>_0x1a3d95[_0x472170(0x202)][_0x472170(0x2cb)](_0x5af1bb),{'verbose':_0x3608e7[_0x472170(0x1ed)]}),_0x279508=_0x27351a[_0x472170(0x17e)],_0x52edd0=_0x1a3d95[_0x472170(0x202)][_0x472170(0x189)](_0x279508);if(_0x4b40fb['output']){const _0x21a437=await this[_0x472170(0x324)](_0x12efc1,_0x5af1bb,_0x279508,_0x52edd0),_0xffa6ae=this[_0x472170(0x317)](_0x21a437);writeFileSync(_0x4b40fb[_0x472170(0x285)],_0xffa6ae);const _0x1dfb06=_0x21a437['customers'][_0x472170(0x35a)][_0x472170(0x2cd)]+_0x21a437[_0x472170(0x282)][_0x472170(0x20c)]((_0x59bf2a,_0x1088c)=>_0x59bf2a+_0x1088c[_0x472170(0x35a)][_0x472170(0x2cd)],0x0),_0x4c53c6=_0x21a437[_0x472170(0x282)]['filter'](_0x48451a=>_0x48451a[_0x472170(0x35a)][_0x472170(0x2cd)]===0x0)[_0x472170(0x2cd)];return console[_0x472170(0x220)](_0x472170(0x244)+_0x4b40fb['output']),console[_0x472170(0x220)](_0x472170(0x31c)+_0x52edd0),console['log'](_0x472170(0x1c3)+_0x21a437[_0x472170(0x282)][_0x472170(0x2cd)]+_0x472170(0x21b)),console['log'](_0x472170(0x1ac)+_0x1dfb06+_0x472170(0x368)),_0x4c53c6>0x0&&console[_0x472170(0x220)](_0x472170(0x192)+_0x4c53c6+_0x472170(0x2c8)),0x0;}console[_0x472170(0x1da)]('\x0a'+a31_0x251538[_0x472170(0x266)]('Output\x20Database:')+'\x20'+a31_0x251538['cyan'](_0x52edd0));const _0x3621b1=await withSpinner(_0x472170(0x29d),()=>_0x1a3d95[_0x472170(0x202)][_0x472170(0x1b0)](_0x279508),{'verbose':_0x3608e7['verbose']});console['error']('\x0a'+a31_0x251538[_0x472170(0x266)](_0x472170(0x18c))+'\x20'+a31_0x251538[_0x472170(0x1ba)]('('+_0x52edd0+_0x472170(0x1f7)));const _0x2e8e0c=await executeSchemaQuery(_0x3621b1[_0x472170(0x17e)],_0x1a3d95,_0x3608e7);await handleQueryOutput(_0x2e8e0c,_0x3608e7);const _0x267d23=await withSpinner('Fetching\x20behavior\x20list...',()=>_0x1a3d95[_0x472170(0x202)][_0x472170(0x29f)](_0x279508),{'verbose':_0x3608e7['verbose']});for(const _0x55246d of _0x267d23['data']){const _0x3338b7=_0x472170(0x218)+_0x55246d[_0x472170(0x376)]()['replace'](/\s+/g,'_'),_0x2c68c8=_0x472170(0x1a1)+_0x52edd0+'.'+_0x3338b7;console['error']('\x0a'+a31_0x251538[_0x472170(0x266)](_0x55246d)+'\x20'+a31_0x251538[_0x472170(0x1ba)]('('+_0x52edd0+'.'+_0x3338b7+')'));try{const _0x5115fe=await executeSchemaQuery(_0x2c68c8,_0x1a3d95,_0x3608e7);await handleQueryOutput(_0x5115fe,_0x3608e7);}catch{console[_0x472170(0x1da)](a31_0x251538['yellow'](_0x472170(0x2eb)));}}return 0x0;}async[a31_0x344d96(0x324)](_0x393fe3,_0x43d230,_0x1147c6,_0x12aeec){const _0x2944bc=a31_0x344d96,{options:_0x91f9c6,tdx:_0x18e7cb}=_0x393fe3,_0x1381c5=await withSpinner('Fetching\x20customers\x20schema...',()=>_0x18e7cb[_0x2944bc(0x202)]['getParentSQL'](_0x1147c6),{'verbose':_0x91f9c6['verbose']}),_0x329742=await executeSchemaQuery(_0x1381c5[_0x2944bc(0x17e)],_0x18e7cb,_0x91f9c6),_0x17e1af=_0x329742[_0x2944bc(0x17e)][_0x2944bc(0x288)](_0x5871ec=>({'name':_0x5871ec[_0x2944bc(0x34d)],'type':_0x5871ec['column_type']})),_0x8f4e4b=await withSpinner(_0x2944bc(0x188),()=>_0x18e7cb['segment'][_0x2944bc(0x29f)](_0x1147c6),{'verbose':_0x91f9c6['verbose']}),_0x26e0e2=[];for(const _0x3caba4 of _0x8f4e4b['data']){const _0x1e56e2=_0x2944bc(0x218)+_0x3caba4[_0x2944bc(0x376)]()[_0x2944bc(0x27d)](/\s+/g,'_'),_0x323e25='SELECT\x20*\x20FROM\x20'+_0x12aeec+'.'+_0x1e56e2;let _0x2ba536=[];try{const _0x2a23c8=await executeSchemaQuery(_0x323e25,_0x18e7cb,_0x91f9c6);_0x2ba536=_0x2a23c8['data'][_0x2944bc(0x288)](_0x545375=>({'name':_0x545375[_0x2944bc(0x34d)],'type':_0x545375[_0x2944bc(0x32d)]}));}catch{}_0x26e0e2['push']({'table':_0x1e56e2,'columns':_0x2ba536});}return{'database':_0x12aeec,'parent_segment':_0x43d230,'parent_id':_0x1147c6,'customers':{'table':_0x2944bc(0x18c),'columns':_0x17e1af},'behaviors':_0x26e0e2};}[a31_0x344d96(0x317)](_0x19bcd5){const _0x587b40=a31_0x344d96,_0x356d74=_0x5e933a=>{const _0x579987=a31_0x2ed7;if(_0x5e933a[_0x579987(0x2cd)]===0x0)return'[]';const _0x2ade2a=_0x5e933a[_0x579987(0x288)](_0x5a1d6b=>_0x579987(0x2c6)+_0x5a1d6b[_0x579987(0x338)]+_0x579987(0x34c)+_0x5a1d6b[_0x579987(0x19b)]+_0x579987(0x2bf));return'[\x0a'+_0x2ade2a[_0x579987(0x34a)](',\x0a')+_0x579987(0x275);},_0xe5f5b6=_0x19bcd5[_0x587b40(0x282)][_0x587b40(0x288)](_0x477c25=>{const _0x28ac0b=_0x587b40;return _0x28ac0b(0x1c7)+_0x477c25[_0x28ac0b(0x2a6)]+_0x28ac0b(0x24f)+_0x356d74(_0x477c25[_0x28ac0b(0x35a)])[_0x28ac0b(0x27d)](/^/gm,'\x20\x20')[_0x28ac0b(0x344)]()+_0x28ac0b(0x30f);})[_0x587b40(0x34a)](',\x0a');return _0x587b40(0x33f)+_0x19bcd5[_0x587b40(0x16e)]+_0x587b40(0x16c)+_0x19bcd5[_0x587b40(0x23e)]+_0x587b40(0x295)+_0x19bcd5[_0x587b40(0x2e4)]+_0x587b40(0x232)+_0x19bcd5[_0x587b40(0x18c)][_0x587b40(0x2a6)]+_0x587b40(0x375)+_0x356d74(_0x19bcd5['customers'][_0x587b40(0x35a)])[_0x587b40(0x27d)](/^/gm,'\x20\x20')[_0x587b40(0x344)]()+_0x587b40(0x230)+_0xe5f5b6+_0x587b40(0x253);}}export class ParentSegmentSQLCommand extends BaseCommand{['name']=a31_0x344d96(0x363);['description']=a31_0x344d96(0x25a);async[a31_0x344d96(0x1a9)](_0xe8c975){const _0x426a4c=a31_0x344d96,{options:_0x27dcb4,args:_0xd492c0,tdx:_0x56bccc}=_0xe8c975,_0x64029e=_0xd492c0[0x0]||_0x27dcb4[_0x426a4c(0x1de)];if(!_0x64029e)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'+_0x426a4c(0x1c9)),0x1;_0x27dcb4['verbose']&&(console[_0x426a4c(0x1da)](_0x426a4c(0x178)+_0x27dcb4[_0x426a4c(0x217)]),console['error'](_0x426a4c(0x1c8)+_0x64029e));const _0x4dd15e=await withSpinner(_0x426a4c(0x1d5)+_0x64029e+_0x426a4c(0x301),()=>_0x56bccc[_0x426a4c(0x202)]['resolveParentId'](_0x64029e),{'verbose':_0x27dcb4[_0x426a4c(0x1ed)]}),_0x400062=_0x4dd15e[_0x426a4c(0x17e)],_0x1293fe=await withSpinner(_0x426a4c(0x1e1)+_0x64029e+'\x27...',()=>_0x56bccc[_0x426a4c(0x202)][_0x426a4c(0x1b0)](_0x400062),{'verbose':_0x27dcb4['verbose']}),_0x59f694=_0x1293fe[_0x426a4c(0x17e)];return _0x27dcb4[_0x426a4c(0x19c)]==='json'||_0x27dcb4[_0x426a4c(0x19c)]===_0x426a4c(0x222)?await handleSDKOutput([{'sql':_0x59f694}],_0x27dcb4):console[_0x426a4c(0x220)](_0x59f694),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a31_0x344d96(0x338)]=a31_0x344d96(0x2d4);[a31_0x344d96(0x2a7)]=a31_0x344d96(0x327);async['execute'](_0x86d7ef){const _0x16f0e8=a31_0x344d96,{options:_0xa30744,args:_0x4a9235,tdx:_0x396481}=_0x86d7ef,_0x5b8c2a=_0x4a9235[0x0]||_0xa30744[_0x16f0e8(0x1de)];if(!_0x5b8c2a)return showParentSegmentNotSetError(_0x16f0e8(0x356)+_0x16f0e8(0x21c)),0x1;_0xa30744['verbose']&&(console[_0x16f0e8(0x1da)]('Site:\x20'+_0xa30744[_0x16f0e8(0x217)]),console['error']('Parent\x20segment:\x20'+_0x5b8c2a));const _0x4b0331=await withSpinner(_0x16f0e8(0x1d5)+_0x5b8c2a+_0x16f0e8(0x301),()=>_0x396481[_0x16f0e8(0x202)]['resolveParentId'](_0x5b8c2a),{'verbose':_0xa30744[_0x16f0e8(0x1ed)]}),_0x19fc63=_0x4b0331[_0x16f0e8(0x17e)],_0x460e4b=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x5b8c2a+_0x16f0e8(0x301),()=>_0x396481[_0x16f0e8(0x202)][_0x16f0e8(0x1b0)](_0x19fc63),{'verbose':_0xa30744['verbose']});let _0x2abcd5=_0x460e4b['data'];const _0x4e8f4e=resolveLimit(_0xa30744[_0x16f0e8(0x2ca)],DEFAULT_DISPLAY_LIMIT),_0x3210e1=/\bLIMIT\s+\d+/i[_0x16f0e8(0x283)](_0x2abcd5);!_0x3210e1&&(_0x2abcd5=_0x2abcd5['trim']()['replace'](/;+$/,''),_0x2abcd5=_0x16f0e8(0x2f1)+_0x2abcd5+_0x16f0e8(0x2b2)+_0x4e8f4e);_0xa30744[_0x16f0e8(0x1ed)]&&console[_0x16f0e8(0x1da)](_0x16f0e8(0x20b)+_0x2abcd5);const _0x363795=await withProgressSpinner(_0x16f0e8(0x287),async _0x4010a3=>{const _0x5d2299=_0x16f0e8,_0x14d4a7=await _0x396481['query'][_0x5d2299(0x1a9)](_0x2abcd5,{'catalog':'td','schema':_0x5d2299(0x1d0),'onJobId':_0x556448=>{const _0xcebd6d=_0x5d2299;_0x4010a3[_0xcebd6d(0x185)](_0x556448);}});return _0x14d4a7;},{'verbose':_0xa30744[_0x16f0e8(0x1ed)]}),_0x30f8b2=_0x363795['data'],_0x1ad4c6=_0x30f8b2[_0x16f0e8(0x292)]?_0x16f0e8(0x346)+_0x30f8b2[_0x16f0e8(0x292)]+']':'';return console[_0x16f0e8(0x1da)](_0x16f0e8(0x1c0)+_0x30f8b2['stats'][_0x16f0e8(0x341)]['toLocaleString']()+_0x16f0e8(0x204)+(_0x16f0e8(0x1e5)+formatElapsed(_0x30f8b2[_0x16f0e8(0x199)][_0x16f0e8(0x1aa)])+_0x1ad4c6)),await handleQueryOutput(_0x30f8b2,_0xa30744),0x0;}}export class PSRtListCommand extends BaseCommand{[a31_0x344d96(0x338)]='ps:rt:list';[a31_0x344d96(0x2a7)]=a31_0x344d96(0x1c1);async[a31_0x344d96(0x1a9)](_0x60215c){const _0x391c98=a31_0x344d96,{options:_0x5a8387,args:_0x4131cd,tdx:_0x140468}=_0x60215c,_0x2adc91=_0x4131cd[0x0],_0x1869c3=await withSpinner(_0x2adc91?_0x391c98(0x336)+_0x2adc91+_0x391c98(0x301):'Listing\x20RT-enabled\x20parent\x20segments...',()=>_0x140468['realtime'][_0x391c98(0x377)](),{'verbose':_0x5a8387['verbose']});let _0x2fc121=_0x1869c3[_0x391c98(0x17e)][_0x391c98(0x2d6)](_0x1fb800=>_0x1fb800[_0x391c98(0x38a)]);if(_0x2adc91){const _0x4978d5=_0x2adc91['replace'](/[.+^${}()|[\]\\]/g,_0x391c98(0x1c4))[_0x391c98(0x27d)](/\*/g,'.*')[_0x391c98(0x27d)](/\?/g,'.'),_0x4eeba2=new RegExp('^'+_0x4978d5+'$','i');_0x2fc121=_0x2fc121[_0x391c98(0x2d6)](_0x4417c4=>_0x4eeba2[_0x391c98(0x283)](_0x4417c4['name']));}_0x2fc121[_0x391c98(0x306)]((_0x2dcc0a,_0x455ac2)=>_0x2dcc0a[_0x391c98(0x338)][_0x391c98(0x305)](_0x455ac2[_0x391c98(0x338)])),console['error'](_0x391c98(0x243)+_0x2fc121['length']+'\x20RT-enabled\x20parent\x20segment'+(_0x2fc121[_0x391c98(0x2cd)]!==0x1?'s':''));const _0x1b6d4e=_0xa8c460=>{const _0x20b74b=_0x391c98;return getConsoleNextUrl(_0x5a8387[_0x20b74b(0x217)],'/app/dw/parentSegments/'+_0xa8c460);};if(_0x5a8387[_0x391c98(0x19c)]===_0x391c98(0x1e3)||_0x5a8387[_0x391c98(0x19c)]===_0x391c98(0x222)){const _0x542228=_0x2fc121[_0x391c98(0x288)](_0x387d01=>({..._0x387d01,'url':_0x1b6d4e(_0x387d01['id'])}));await handleSDKOutput(_0x542228,_0x5a8387);}else{if(_0x2fc121[_0x391c98(0x2cd)]===0x0)console[_0x391c98(0x220)](_0x391c98(0x35d));else for(const _0x572cf7 of _0x2fc121){const _0x551818=_0x572cf7[_0x391c98(0x270)]?a31_0x251538[_0x391c98(0x1ba)]('\x20('+formatRows(_0x572cf7['population'])+')'):'',_0x49071e=hyperlink(_0x572cf7[_0x391c98(0x338)],_0x1b6d4e(_0x572cf7['id']));console[_0x391c98(0x220)]('⚡\x20'+_0x49071e+_0x551818);}}return 0x0;}}export class PSRtValidateCommand extends BaseParentSegmentCommand{[a31_0x344d96(0x338)]=a31_0x344d96(0x359);[a31_0x344d96(0x2a7)]=a31_0x344d96(0x2ad);async[a31_0x344d96(0x1a9)](_0x3fe2fb){const _0x317371=a31_0x344d96,{options:_0x913ac2,args:_0x1d01a9,tdx:_0x559bfd}=_0x3fe2fb,_0x43b920=_0x1d01a9[0x0]||_0x913ac2['parentSegment'];if(!_0x43b920)return showParentSegmentNotSetError('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'+_0x317371(0x269)),0x1;const _0x502e1a=resolveYamlFile(_0x43b920);if(!existsSync(_0x502e1a))return showFileNotFoundError(_0x502e1a,_0x43b920),0x1;let _0x12e8d0;try{_0x12e8d0=readFileSync(_0x502e1a,'utf-8');}catch(_0x49152b){const _0x49b022=_0x49152b instanceof Error?_0x49152b[_0x317371(0x332)]:String(_0x49152b);return console['error'](_0x317371(0x1b2)+_0x49b022),0x1;}const _0x43243f=createCommandSpinner(a31_0x251538['dim'](_0x317371(0x311)),{'verbose':_0x913ac2[_0x317371(0x1ed)]});_0x43243f['start']();const _0x48d7c6={'realtime':!![],'onProgress':_0x276895=>{const _0x15a9b4=_0x317371;_0x43243f[_0x15a9b4(0x1b9)]=formatProgressMessage(_0x276895);}};let _0x408043;try{_0x408043=await _0x559bfd['segment'][_0x317371(0x22c)](_0x12e8d0,_0x48d7c6),_0x43243f[_0x317371(0x226)]();}catch(_0x59a379){_0x43243f[_0x317371(0x226)]();throw _0x59a379;}console['error']('\x0a'+a31_0x251538[_0x317371(0x266)](_0x317371(0x25e))+'\x20'+_0x408043[_0x317371(0x338)]),console[_0x317371(0x1da)]('═'[_0x317371(0x1d4)](0x3c)),displayRealtimeValidation(_0x408043),console['error']('─'[_0x317371(0x1d4)](0x3c));if(_0x408043[_0x317371(0x268)][_0x317371(0x2cd)]>0x0){console[_0x317371(0x1da)]('\x0a'+a31_0x251538[_0x317371(0x334)](_0x317371(0x227)));for(const _0x2a752b of _0x408043['errors']){console[_0x317371(0x1da)]('\x20\x20'+a31_0x251538['red']('•')+'\x20'+_0x2a752b);}}return _0x408043['allValid']&&console[_0x317371(0x1da)]('\x0a'+a31_0x251538['green']('✔')+'\x20RT\x20configuration\x20is\x20valid'),_0x408043[_0x317371(0x255)]?0x0:0x1;}}export class PSRtJnListCommand extends BaseCommand{[a31_0x344d96(0x338)]='ps:rt:jn:list';[a31_0x344d96(0x2a7)]='List\x20RT\x20journeys';async['execute'](_0x1766d3){const _0x1d44f7=a31_0x344d96,{options:_0x3c3475,args:_0x53acf2,tdx:_0x401ce9}=_0x1766d3,_0x223500=_0x53acf2[0x0]||_0x3c3475['parentSegment'];if(!_0x223500)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20rt\x20jn\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20RT\x20journeys\x20(requires\x20context)\x0a'+_0x1d44f7(0x302)),0x1;_0x3c3475[_0x1d44f7(0x1ed)]&&(console[_0x1d44f7(0x1da)](_0x1d44f7(0x178)+_0x3c3475['site']),console['error'](_0x1d44f7(0x1c8)+_0x223500));const _0x1420fb=await withSpinner(_0x1d44f7(0x1d5)+_0x223500+_0x1d44f7(0x301),()=>_0x401ce9[_0x1d44f7(0x202)][_0x1d44f7(0x2cb)](_0x223500),{'verbose':_0x3c3475[_0x1d44f7(0x1ed)]}),_0xd98937=_0x1420fb['data'],_0x204713=await withSpinner(_0x1d44f7(0x2b4)+_0x223500+_0x1d44f7(0x301),()=>_0x401ce9['realtime']['listJourneys'](_0xd98937),{'verbose':_0x3c3475['verbose']}),_0x3e3821=_0x204713[_0x1d44f7(0x17e)];console[_0x1d44f7(0x1da)](_0x1d44f7(0x243)+_0x3e3821[_0x1d44f7(0x2cd)]+'\x20RT\x20journey'+(_0x3e3821['length']!==0x1?'s':''));if(_0x3c3475[_0x1d44f7(0x19c)]===_0x1d44f7(0x1e3)||_0x3c3475['format']===_0x1d44f7(0x222))await handleSDKOutput(_0x3e3821,_0x3c3475);else{if(_0x3e3821[_0x1d44f7(0x2cd)]===0x0)console[_0x1d44f7(0x220)](_0x1d44f7(0x1b5));else for(const _0x9604f8 of _0x3e3821){const _0x31aa48=_0x9604f8['state']==='launched'?'🚀':'📝',_0x783525=_0x9604f8[_0x1d44f7(0x373)]?a31_0x251538['yellow'](_0x1d44f7(0x22f)):'',_0x289fb9=a31_0x251538[_0x1d44f7(0x1ba)]('\x20('+_0x9604f8[_0x1d44f7(0x345)]+_0x1d44f7(0x196)+(_0x9604f8[_0x1d44f7(0x345)]!==0x1?'s':'')+')');console[_0x1d44f7(0x220)](_0x31aa48+'\x20'+_0x9604f8[_0x1d44f7(0x338)]+_0x783525+_0x289fb9);}}return 0x0;}}export class PSRtJnPauseCommand extends BaseCommand{[a31_0x344d96(0x338)]='ps:rt:jn:pause';[a31_0x344d96(0x2a7)]='Pause\x20activations\x20in\x20an\x20RT\x20journey';async[a31_0x344d96(0x1a9)](_0x16ad8b){const _0xadf6a6=a31_0x344d96,{options:_0x2613e8,args:_0x39cb79,tdx:_0xb59a22}=_0x16ad8b,_0xdd82fa=_0x39cb79[0x0];if(!_0xdd82fa)return console['error'](a31_0x251538[_0xadf6a6(0x334)](_0xadf6a6(0x304))),console[_0xadf6a6(0x1da)](_0xadf6a6(0x2ce)),console[_0xadf6a6(0x1da)](a31_0x251538[_0xadf6a6(0x1ba)]('Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs')),0x1;_0x2613e8['verbose']&&(console[_0xadf6a6(0x1da)](_0xadf6a6(0x178)+_0x2613e8['site']),console[_0xadf6a6(0x1da)]('RT\x20Journey\x20ID:\x20'+_0xdd82fa));const _0xabb80e=await withSpinner(_0xadf6a6(0x2d1)+_0xdd82fa+_0xadf6a6(0x301),()=>_0xb59a22['realtime']['pauseJourney'](_0xdd82fa),{'verbose':_0x2613e8['verbose']}),_0x3a983c=_0xabb80e['data'];console[_0xadf6a6(0x1da)]('✔\x20Paused\x20activations\x20for\x20RT\x20journey\x20\x27'+_0x3a983c[_0xadf6a6(0x338)]+'\x27');if(_0x2613e8['format']===_0xadf6a6(0x1e3)||_0x2613e8['format']===_0xadf6a6(0x222))await handleSDKOutput([_0x3a983c],_0x2613e8);else{const _0x599d25=_0x3a983c[_0xadf6a6(0x33d)]===_0xadf6a6(0x35b)?'🚀':'📝',_0x9b7962=_0x3a983c[_0xadf6a6(0x373)]?a31_0x251538['yellow'](_0xadf6a6(0x22f)):'';console[_0xadf6a6(0x220)](_0x599d25+'\x20'+_0x3a983c[_0xadf6a6(0x338)]+_0x9b7962);}return 0x0;}}export class PSRtJnResumeCommand extends BaseCommand{[a31_0x344d96(0x338)]=a31_0x344d96(0x27a);['description']=a31_0x344d96(0x176);async['execute'](_0x1654be){const _0x1854c5=a31_0x344d96,{options:_0x423dea,args:_0x2e265d,tdx:_0x4d432d}=_0x1654be,_0x400373=_0x2e265d[0x0];if(!_0x400373)return console[_0x1854c5(0x1da)](a31_0x251538['red']('Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a')),console[_0x1854c5(0x1da)](_0x1854c5(0x309)),console[_0x1854c5(0x1da)](a31_0x251538['dim']('Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs')),0x1;_0x423dea[_0x1854c5(0x1ed)]&&(console[_0x1854c5(0x1da)](_0x1854c5(0x178)+_0x423dea[_0x1854c5(0x217)]),console['error'](_0x1854c5(0x31e)+_0x400373));const _0x686df0=await withSpinner(_0x1854c5(0x2d9)+_0x400373+'\x27...',()=>_0x4d432d[_0x1854c5(0x2fd)]['resumeJourney'](_0x400373),{'verbose':_0x423dea[_0x1854c5(0x1ed)]}),_0x359e52=_0x686df0[_0x1854c5(0x17e)];console[_0x1854c5(0x1da)](_0x1854c5(0x2f7)+_0x359e52['name']+'\x27');if(_0x423dea[_0x1854c5(0x19c)]===_0x1854c5(0x1e3)||_0x423dea[_0x1854c5(0x19c)]===_0x1854c5(0x222))await handleSDKOutput([_0x359e52],_0x423dea);else{const _0x235659=_0x359e52[_0x1854c5(0x33d)]===_0x1854c5(0x35b)?'🚀':'📝',_0x292fe7=_0x359e52[_0x1854c5(0x373)]?a31_0x251538[_0x1854c5(0x387)](_0x1854c5(0x22f)):'';console[_0x1854c5(0x220)](_0x235659+'\x20'+_0x359e52[_0x1854c5(0x338)]+_0x292fe7);}return 0x0;}}export class PSRtConfigVersionCommand extends BaseCommand{['name']=a31_0x344d96(0x1af);['description']=a31_0x344d96(0x1f2);async['execute'](_0x230ca1){const _0x4a43f0=a31_0x344d96,{options:_0x18e245,args:_0x1d99fe,tdx:_0x25be65}=_0x230ca1,_0x2effd5=_0x1d99fe[0x0]||_0x18e245['parentSegment'];if(!_0x2effd5)return showParentSegmentNotSetError(_0x4a43f0(0x179)+_0x4a43f0(0x2a8)),0x1;_0x18e245[_0x4a43f0(0x1ed)]&&(console[_0x4a43f0(0x1da)](_0x4a43f0(0x178)+_0x18e245[_0x4a43f0(0x217)]),console[_0x4a43f0(0x1da)](_0x4a43f0(0x1c8)+_0x2effd5));const _0x25fe29=await withSpinner(_0x4a43f0(0x1d5)+_0x2effd5+_0x4a43f0(0x301),()=>_0x25be65[_0x4a43f0(0x202)]['resolveParentId'](_0x2effd5),{'verbose':_0x18e245[_0x4a43f0(0x1ed)]}),_0x1fd7b9=_0x25fe29[_0x4a43f0(0x17e)],_0x263020=await withSpinner(_0x4a43f0(0x186)+_0x2effd5+_0x4a43f0(0x301),()=>_0x25be65[_0x4a43f0(0x2fd)][_0x4a43f0(0x27e)](_0x1fd7b9),{'verbose':_0x18e245['verbose']}),_0x555d77=_0x263020[_0x4a43f0(0x17e)];return console['error'](_0x4a43f0(0x254)),_0x18e245[_0x4a43f0(0x19c)]===_0x4a43f0(0x1e3)||_0x18e245[_0x4a43f0(0x19c)]===_0x4a43f0(0x222)?await handleSDKOutput([_0x555d77],_0x18e245):(console[_0x4a43f0(0x220)]('id:\x20'+_0x555d77['id']),console['log'](_0x4a43f0(0x273)+_0x555d77[_0x4a43f0(0x1a4)]),console[_0x4a43f0(0x220)](_0x4a43f0(0x276)+_0x555d77[_0x4a43f0(0x37b)]),console[_0x4a43f0(0x220)](_0x4a43f0(0x2a0)+_0x555d77[_0x4a43f0(0x2e9)]),console[_0x4a43f0(0x220)](_0x4a43f0(0x1e0)+_0x555d77[_0x4a43f0(0x193)])),0x0;}}export class PSPzServiceListCommand extends BaseCommand{[a31_0x344d96(0x338)]='ps:pz:service:list';[a31_0x344d96(0x2a7)]=a31_0x344d96(0x1c6);async[a31_0x344d96(0x1a9)](_0x5b5340){const _0x531b84=a31_0x344d96,{options:_0x33e686,args:_0x4ee117,tdx:_0x4df58f}=_0x5b5340,_0x4376db=_0x4ee117[0x0]||_0x33e686[_0x531b84(0x1de)];if(!_0x4376db)return showParentSegmentNotSetError(_0x531b84(0x2ef)+_0x531b84(0x2bc)),0x1;const _0x1bedb4=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x4376db+_0x531b84(0x301),()=>_0x4df58f[_0x531b84(0x202)][_0x531b84(0x2cb)](_0x4376db),{'verbose':_0x33e686[_0x531b84(0x1ed)]}),_0x2d49bb=_0x1bedb4[_0x531b84(0x17e)],_0x55bfeb=await withSpinner(_0x531b84(0x1ad)+_0x4376db+'\x27...',()=>_0x4df58f[_0x531b84(0x279)][_0x531b84(0x377)](_0x2d49bb),{'verbose':_0x33e686[_0x531b84(0x1ed)]}),_0x471a5a=_0x55bfeb[_0x531b84(0x17e)];console['error'](_0x531b84(0x243)+_0x471a5a[_0x531b84(0x2cd)]+_0x531b84(0x1fc)+(_0x471a5a[_0x531b84(0x2cd)]!==0x1?'s':''));if(_0x33e686['format']===_0x531b84(0x1e3)||_0x33e686['format']===_0x531b84(0x222))await handleSDKOutput(_0x471a5a,_0x33e686);else{if(_0x471a5a['length']===0x0)console[_0x531b84(0x220)](_0x531b84(0x21f)),console[_0x531b84(0x1da)](a31_0x251538['cyan'](_0x531b84(0x2ae)));else for(const _0x3b8a1e of _0x471a5a){console[_0x531b84(0x220)](a31_0x251538['bold'](_0x3b8a1e[_0x531b84(0x338)])+'\x20'+a31_0x251538[_0x531b84(0x1ba)](_0x531b84(0x248)+_0x3b8a1e['id']+')'));_0x3b8a1e[_0x531b84(0x2a7)]&&console[_0x531b84(0x220)]('\x20\x20'+a31_0x251538['dim'](_0x3b8a1e['description']));if(_0x3b8a1e['tokens']&&_0x3b8a1e[_0x531b84(0x198)][_0x531b84(0x2cd)]>0x0)for(const _0x5b65fd of _0x3b8a1e[_0x531b84(0x198)]){const _0x3fccb9=_0x5b65fd[_0x531b84(0x2b1)]?.[_0x531b84(0x2cd)]?_0x5b65fd[_0x531b84(0x2b1)][_0x531b84(0x34a)](',\x20'):_0x531b84(0x351);console[_0x531b84(0x220)]('\x20\x20'+a31_0x251538['cyan'](_0x531b84(0x31f))+'\x20'+_0x5b65fd['name']+'\x20'+a31_0x251538['dim'](_0x531b84(0x248)+_0x5b65fd['id']+')')),console[_0x531b84(0x220)](_0x531b84(0x362)+a31_0x251538[_0x531b84(0x1ba)](_0x531b84(0x313))+'\x20'+_0x3fccb9);}else console[_0x531b84(0x220)]('\x20\x20'+a31_0x251538['dim']('no\x20tokens\x20configured'));}}return 0x0;}}export class PSPzServiceCreateCommand extends BaseCommand{[a31_0x344d96(0x338)]=a31_0x344d96(0x245);['description']=a31_0x344d96(0x233);async[a31_0x344d96(0x1a9)](_0x3a79a3){const _0x41fc76=a31_0x344d96,{options:_0x554c99,args:_0x1432be,tdx:_0x2d8723}=_0x3a79a3,_0xbc0560=_0x554c99,_0x45926d=_0x1432be[0x0],_0x555a34=_0x1432be[0x1]||_0x554c99[_0x41fc76(0x1de)];if(!_0x45926d)return console[_0x41fc76(0x1da)]('Error:\x20Service\x20name\x20is\x20required'),console['error'](_0x41fc76(0x374)),console[_0x41fc76(0x1da)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x555a34)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]\x0a'+_0x41fc76(0x23a)),0x1;const _0x1c9953=await withSpinner(_0x41fc76(0x1d5)+_0x555a34+_0x41fc76(0x301),()=>_0x2d8723['segment'][_0x41fc76(0x2cb)](_0x555a34),{'verbose':_0x554c99[_0x41fc76(0x1ed)]}),_0x58bb4c=_0x1c9953[_0x41fc76(0x17e)],_0x34295e={'name':_0x45926d,'description':_0xbc0560[_0x41fc76(0x2a7)],'public':_0xbc0560[_0x41fc76(0x2de)]},_0x2ccb68=await withSpinner('Creating\x20personalization\x20service\x20\x27'+_0x45926d+_0x41fc76(0x301),()=>_0x2d8723[_0x41fc76(0x279)][_0x41fc76(0x264)](_0x58bb4c,_0x34295e),{'verbose':_0x554c99['verbose']}),_0x100939=_0x2ccb68['data'];return console[_0x41fc76(0x1da)](_0x41fc76(0x169)+_0x100939['name']+_0x41fc76(0x18a)+_0x100939['id']),await handleSDKOutput([_0x100939],_0x554c99),0x0;}}export class PSPzServiceShowCommand extends BaseCommand{[a31_0x344d96(0x338)]=a31_0x344d96(0x284);[a31_0x344d96(0x2a7)]=a31_0x344d96(0x294);async[a31_0x344d96(0x1a9)](_0x2a27ca){const _0x563d9a=a31_0x344d96,{options:_0x54cb22,args:_0x547f2e,tdx:_0x1d4fc5}=_0x2a27ca,_0x3d7673=_0x547f2e[0x0],_0x4ee0ce=_0x547f2e[0x1]||_0x54cb22[_0x563d9a(0x1de)];if(!_0x3d7673)return console[_0x563d9a(0x1da)](_0x563d9a(0x29b)),console['error'](_0x563d9a(0x352)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x4ee0ce)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;const _0x3d9891=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x4ee0ce+_0x563d9a(0x301),()=>_0x1d4fc5[_0x563d9a(0x202)]['resolveParentId'](_0x4ee0ce),{'verbose':_0x54cb22[_0x563d9a(0x1ed)]}),_0x257bd1=_0x3d9891[_0x563d9a(0x17e)],_0x42126f=await withSpinner(_0x563d9a(0x170)+_0x3d7673+_0x563d9a(0x301),()=>_0x1d4fc5[_0x563d9a(0x279)]['get'](_0x257bd1,_0x3d7673),{'verbose':_0x54cb22[_0x563d9a(0x1ed)]}),_0x567b6e=_0x42126f[_0x563d9a(0x17e)];if(_0x54cb22[_0x563d9a(0x1e3)]||_0x54cb22['jsonl'])await handleSDKOutput([_0x567b6e],_0x54cb22);else{console[_0x563d9a(0x220)](a31_0x251538[_0x563d9a(0x266)](_0x567b6e[_0x563d9a(0x338)])+'\x20'+a31_0x251538[_0x563d9a(0x1ba)](_0x563d9a(0x248)+_0x567b6e['id']+')'));_0x567b6e[_0x563d9a(0x2a7)]&&console['log']('\x20\x20'+a31_0x251538[_0x563d9a(0x1ba)](_0x567b6e[_0x563d9a(0x2a7)]));console[_0x563d9a(0x220)]('\x20\x20'+a31_0x251538[_0x563d9a(0x382)](_0x563d9a(0x316))+'\x20'+(_0x567b6e['public']?_0x563d9a(0x36a):'no'));if(_0x567b6e[_0x563d9a(0x198)]&&_0x567b6e[_0x563d9a(0x198)]['length']>0x0)for(const _0xc3b3c2 of _0x567b6e[_0x563d9a(0x198)]){const _0x5d45d0=_0xc3b3c2[_0x563d9a(0x2b1)]?.[_0x563d9a(0x2cd)]?_0xc3b3c2[_0x563d9a(0x2b1)][_0x563d9a(0x34a)](',\x20'):_0x563d9a(0x351);console[_0x563d9a(0x220)]('\x20\x20'+a31_0x251538[_0x563d9a(0x382)](_0x563d9a(0x31f))+'\x20'+_0xc3b3c2[_0x563d9a(0x338)]+'\x20'+a31_0x251538['dim'](_0x563d9a(0x248)+_0xc3b3c2['id']+')')),console[_0x563d9a(0x220)](_0x563d9a(0x362)+a31_0x251538[_0x563d9a(0x1ba)](_0x563d9a(0x313))+'\x20'+_0x5d45d0);}else console[_0x563d9a(0x220)]('\x20\x20'+a31_0x251538['dim']('no\x20tokens\x20configured'));}return 0x0;}}export class PSPzServiceDeleteCommand extends BaseCommand{[a31_0x344d96(0x338)]='ps:pz:service:delete';[a31_0x344d96(0x2a7)]=a31_0x344d96(0x36d);async[a31_0x344d96(0x1a9)](_0x112dfe){const _0xf836d5=a31_0x344d96,{options:_0x1d4dc4,args:_0x4ab282,tdx:_0x48333e}=_0x112dfe,_0x33d5c2=_0x4ab282[0x0],_0x3fe7b2=_0x4ab282[0x1]||_0x1d4dc4[_0xf836d5(0x1de)];if(!_0x33d5c2)return console['error'](_0xf836d5(0x29b)),console[_0xf836d5(0x1da)](_0xf836d5(0x299)),console[_0xf836d5(0x1da)](_0xf836d5(0x225)),0x1;if(!_0x3fe7b2)return showParentSegmentNotSetError(_0xf836d5(0x36e)+_0xf836d5(0x225)),0x1;const _0x4b132=await withSpinner(_0xf836d5(0x1d5)+_0x3fe7b2+_0xf836d5(0x301),()=>_0x48333e[_0xf836d5(0x202)][_0xf836d5(0x2cb)](_0x3fe7b2),{'verbose':_0x1d4dc4['verbose']}),_0x7e26=_0x4b132[_0xf836d5(0x17e)];return await withSpinner(_0xf836d5(0x1b8)+_0x33d5c2+'\x27...',()=>_0x48333e[_0xf836d5(0x279)][_0xf836d5(0x1d3)](_0x7e26,_0x33d5c2),{'verbose':_0x1d4dc4[_0xf836d5(0x1ed)]}),console[_0xf836d5(0x1da)]('✔\x20Deleted\x20personalization\x20service\x20\x27'+_0x33d5c2+'\x27'),0x0;}}export class PSPzServiceUpdateCommand extends BaseCommand{[a31_0x344d96(0x338)]=a31_0x344d96(0x2b5);[a31_0x344d96(0x2a7)]='Update\x20a\x20personalization\x20service\x20name\x20and/or\x20description';async[a31_0x344d96(0x1a9)](_0x4b6dea){const _0x246610=a31_0x344d96,{options:_0x558d76,args:_0x1cc67d,tdx:_0x1d380e}=_0x4b6dea,_0x1cff82=_0x558d76,_0x2296e4=_0x1cc67d[0x0],_0x4e3c3f=_0x1cc67d[0x1]||_0x558d76[_0x246610(0x1de)];if(!_0x2296e4)return console[_0x246610(0x1da)](_0x246610(0x29b)),console[_0x246610(0x1da)](_0x246610(0x2a5)),console[_0x246610(0x1da)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x1cff82['name'])return console[_0x246610(0x1da)](_0x246610(0x370)),console[_0x246610(0x1da)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]'),0x1;if(!_0x4e3c3f)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]\x0a'+_0x246610(0x2e5)),0x1;const _0x4842b4=await withSpinner(_0x246610(0x1d5)+_0x4e3c3f+'\x27...',()=>_0x1d380e['segment']['resolveParentId'](_0x4e3c3f),{'verbose':_0x558d76[_0x246610(0x1ed)]}),_0x367116=_0x4842b4['data'],_0x28d81b={'name':_0x1cff82['name']};_0x1cff82[_0x246610(0x2a7)]!==undefined&&(_0x28d81b[_0x246610(0x2a7)]=_0x1cff82['description']);const _0x26d784=await withSpinner('Updating\x20personalization\x20service\x20\x27'+_0x2296e4+_0x246610(0x301),()=>_0x1d380e[_0x246610(0x279)]['patch'](_0x367116,_0x2296e4,_0x28d81b),{'verbose':_0x558d76[_0x246610(0x1ed)]}),_0x189648=_0x26d784[_0x246610(0x17e)];return console[_0x246610(0x1da)](_0x246610(0x1b3)+_0x189648[_0x246610(0x338)]+'\x27'),await handleSDKOutput([_0x189648],_0x558d76),0x0;}}export class PSPzServiceTokenCreateCommand extends BaseCommand{[a31_0x344d96(0x338)]=a31_0x344d96(0x19f);['description']=a31_0x344d96(0x1bb);async['execute'](_0x1bf63f){const _0x2a9b61=a31_0x344d96,{options:_0x4f34af,args:_0x124bce,tdx:_0x105661}=_0x1bf63f,_0x4e25b7=_0x4f34af,_0x5f0e2d=_0x124bce[0x0],_0x544066=_0x124bce[0x1],_0x562c4d=_0x124bce[0x2]||_0x4f34af[_0x2a9b61(0x1de)];if(!_0x5f0e2d)return console[_0x2a9b61(0x1da)](_0x2a9b61(0x381)),console[_0x2a9b61(0x1da)](_0x2a9b61(0x2cf)),console['error'](_0x2a9b61(0x1a5)),0x1;if(!_0x544066)return console[_0x2a9b61(0x1da)](_0x2a9b61(0x29b)),console['error'](_0x2a9b61(0x2cf)),console['error'](_0x2a9b61(0x1a5)),0x1;if(!_0x562c4d)return showParentSegmentNotSetError(_0x2a9b61(0x367)+_0x2a9b61(0x1a5)),0x1;const _0x47d1b3=await withSpinner(_0x2a9b61(0x1d5)+_0x562c4d+_0x2a9b61(0x301),()=>_0x105661[_0x2a9b61(0x202)][_0x2a9b61(0x2cb)](_0x562c4d),{'verbose':_0x4f34af['verbose']}),_0x7fcd46=_0x47d1b3[_0x2a9b61(0x17e)],_0x3488bd={'name':_0x5f0e2d};_0x4e25b7[_0x2a9b61(0x2b1)]&&(_0x3488bd[_0x2a9b61(0x2b1)]=_0x4e25b7[_0x2a9b61(0x2b1)][_0x2a9b61(0x2e7)](',')[_0x2a9b61(0x288)](_0x5cd381=>_0x5cd381[_0x2a9b61(0x344)]()));_0x4e25b7[_0x2a9b61(0x2a7)]&&(_0x3488bd[_0x2a9b61(0x2a7)]=_0x4e25b7[_0x2a9b61(0x2a7)]);const _0x211a12=await withSpinner(_0x2a9b61(0x289)+_0x5f0e2d+_0x2a9b61(0x2b7)+_0x544066+_0x2a9b61(0x301),()=>_0x105661[_0x2a9b61(0x279)][_0x2a9b61(0x203)](_0x7fcd46,_0x544066,_0x3488bd),{'verbose':_0x4f34af[_0x2a9b61(0x1ed)]}),_0x298b34=_0x211a12[_0x2a9b61(0x17e)];return console[_0x2a9b61(0x1da)](_0x2a9b61(0x221)+_0x298b34[_0x2a9b61(0x338)]+_0x2a9b61(0x18a)+_0x298b34['id']),_0x298b34[_0x2a9b61(0x2a2)]&&(console[_0x2a9b61(0x1da)](a31_0x251538['yellow']('\x0a⚠\x20Save\x20this\x20token\x20value\x20-\x20it\x20will\x20not\x20be\x20shown\x20again:')),console[_0x2a9b61(0x1da)](a31_0x251538['cyan'](_0x298b34['value'])),console['error']('')),await handleSDKOutput([_0x298b34],_0x4f34af),0x0;}}export class PSPzServiceTokenDeleteCommand extends BaseCommand{[a31_0x344d96(0x338)]=a31_0x344d96(0x16f);[a31_0x344d96(0x2a7)]=a31_0x344d96(0x1d6);async[a31_0x344d96(0x1a9)](_0x4e1f48){const _0x5f3ee3=a31_0x344d96,{options:_0xfaee02,args:_0x48c8d8,tdx:_0x163ad6}=_0x4e1f48,_0x3e0665=_0x48c8d8[0x0],_0x367f98=_0x48c8d8[0x1]||_0xfaee02[_0x5f3ee3(0x1de)];if(!_0x3e0665)return console['error']('Error:\x20Token\x20ID\x20is\x20required'),console[_0x5f3ee3(0x1da)](_0x5f3ee3(0x25f)),console[_0x5f3ee3(0x1da)](_0x5f3ee3(0x320)),0x1;if(!_0x367f98)return showParentSegmentNotSetError(_0x5f3ee3(0x28c)+_0x5f3ee3(0x320)),0x1;const _0x4a6179=await withSpinner(_0x5f3ee3(0x1d5)+_0x367f98+_0x5f3ee3(0x301),()=>_0x163ad6[_0x5f3ee3(0x202)]['resolveParentId'](_0x367f98),{'verbose':_0xfaee02[_0x5f3ee3(0x1ed)]}),_0x2e81b7=_0x4a6179[_0x5f3ee3(0x17e)],_0x37741b=await withSpinner(_0x5f3ee3(0x210),()=>_0x163ad6[_0x5f3ee3(0x279)][_0x5f3ee3(0x377)](_0x2e81b7),{'verbose':_0xfaee02['verbose']}),_0x183eff=_0x37741b[_0x5f3ee3(0x17e)];let _0x5dd699;for(const _0x23a558 of _0x183eff){if(_0x23a558[_0x5f3ee3(0x198)]?.[_0x5f3ee3(0x238)](_0xfe0e5=>_0xfe0e5['id']===_0x3e0665)){_0x5dd699=_0x23a558['id'];break;}}if(!_0x5dd699)return console[_0x5f3ee3(0x1da)](_0x5f3ee3(0x32c)+_0x3e0665+_0x5f3ee3(0x326)),0x1;const _0x2ddcbb=await withSpinner(_0x5f3ee3(0x1db)+_0x3e0665+'\x27...',()=>_0x163ad6[_0x5f3ee3(0x279)]['deleteToken'](_0x2e81b7,_0x5dd699,_0x3e0665),{'verbose':_0xfaee02[_0x5f3ee3(0x1ed)]}),_0x5ead88=_0x2ddcbb[_0x5f3ee3(0x17e)];return console[_0x5f3ee3(0x1da)]('✔\x20Deleted\x20token\x20\x27'+(_0x5ead88[_0x5f3ee3(0x338)]||_0x3e0665)+'\x27'),await handleSDKOutput([_0x5ead88],_0xfaee02),0x0;}}export class PSPzListCommand extends BaseCommand{[a31_0x344d96(0x338)]='ps:pz:list';[a31_0x344d96(0x2a7)]=a31_0x344d96(0x2d7);async[a31_0x344d96(0x1a9)](_0x474f99){const _0x651b70=a31_0x344d96,{options:_0x2a1e32,args:_0x103762,tdx:_0x38446f}=_0x474f99,_0xfd8138=_0x103762[0x0]||_0x2a1e32[_0x651b70(0x1de)];if(!_0xfd8138)return showParentSegmentNotSetError(_0x651b70(0x1a3)+_0x651b70(0x17a)),0x1;const _0x582b55=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0xfd8138+_0x651b70(0x301),()=>_0x38446f[_0x651b70(0x202)][_0x651b70(0x2cb)](_0xfd8138),{'verbose':_0x2a1e32[_0x651b70(0x1ed)]}),_0x43352c=_0x582b55[_0x651b70(0x17e)],_0x21ebd1=await withSpinner(_0x651b70(0x19d)+_0xfd8138+_0x651b70(0x301),()=>_0x38446f[_0x651b70(0x279)][_0x651b70(0x17c)](_0x43352c),{'verbose':_0x2a1e32[_0x651b70(0x1ed)]}),_0x43f2bc=_0x21ebd1[_0x651b70(0x17e)];console['error'](_0x651b70(0x243)+_0x43f2bc[_0x651b70(0x2cd)]+_0x651b70(0x2b9)+(_0x43f2bc['length']!==0x1?'s':''));if(_0x2a1e32[_0x651b70(0x19c)]===_0x651b70(0x1e3)||_0x2a1e32[_0x651b70(0x19c)]===_0x651b70(0x222))await handleSDKOutput(_0x43f2bc,_0x2a1e32);else{if(_0x43f2bc[_0x651b70(0x2cd)]===0x0)console[_0x651b70(0x220)](_0x651b70(0x172));else for(const _0x19c090 of _0x43f2bc){console[_0x651b70(0x220)](a31_0x251538[_0x651b70(0x266)](_0x19c090[_0x651b70(0x338)])+'\x20'+a31_0x251538['dim']('(id:\x20'+_0x19c090['id']+')'));_0x19c090[_0x651b70(0x2a7)]&&console[_0x651b70(0x220)]('\x20\x20'+a31_0x251538['dim'](_0x19c090[_0x651b70(0x2a7)]));const _0x4178c7=_0x19c090[_0x651b70(0x190)]?.[_0x651b70(0x2cd)]||0x0;console[_0x651b70(0x220)]('\x20\x20'+a31_0x251538[_0x651b70(0x382)]('sections:')+'\x20'+_0x4178c7);if(_0x19c090[_0x651b70(0x190)]&&_0x19c090['sections']['length']>0x0)for(const _0x505f68 of _0x19c090[_0x651b70(0x190)]){console[_0x651b70(0x220)](_0x651b70(0x1fa)+_0x505f68[_0x651b70(0x338)]);}}}return 0x0;}}export class PSPzShowCommand extends BaseCommand{[a31_0x344d96(0x338)]=a31_0x344d96(0x17b);['description']=a31_0x344d96(0x2a4);async['execute'](_0xa0a67d){const _0x1e68e5=a31_0x344d96,{options:_0x3caa5d,args:_0x484df5,tdx:_0x5dcba3}=_0xa0a67d,_0x5cd3da=_0x484df5[0x0];if(!_0x5cd3da)return console['error']('Error:\x20Personalization\x20ID\x20is\x20required'),console['error'](_0x1e68e5(0x28a)),0x1;const _0x374416=await withSpinner(_0x1e68e5(0x372)+_0x5cd3da+'\x27...',()=>_0x5dcba3[_0x1e68e5(0x279)][_0x1e68e5(0x34e)](_0x5cd3da),{'verbose':_0x3caa5d['verbose']}),_0x527a2f=_0x374416[_0x1e68e5(0x17e)];console[_0x1e68e5(0x1da)]('✔\x20Found\x20personalization\x20\x27'+_0x527a2f[_0x1e68e5(0x338)]+'\x27');if(_0x3caa5d['format']===_0x1e68e5(0x1e3)||_0x3caa5d[_0x1e68e5(0x19c)]==='jsonl')await handleSDKOutput([_0x527a2f],_0x3caa5d);else{console[_0x1e68e5(0x220)](a31_0x251538[_0x1e68e5(0x266)](_0x527a2f[_0x1e68e5(0x338)])+'\x20'+a31_0x251538['dim'](_0x1e68e5(0x248)+_0x527a2f['id']+')'));_0x527a2f[_0x1e68e5(0x2a7)]&&console[_0x1e68e5(0x220)]('\x20\x20'+a31_0x251538[_0x1e68e5(0x1ba)](_0x527a2f[_0x1e68e5(0x2a7)]));_0x527a2f[_0x1e68e5(0x1a4)]&&console[_0x1e68e5(0x220)]('\x20\x20'+a31_0x251538['cyan'](_0x1e68e5(0x2e6))+'\x20'+_0x527a2f['audienceId']);console[_0x1e68e5(0x220)]('\x20\x20'+a31_0x251538['cyan'](_0x1e68e5(0x2d2))+'\x20'+_0x527a2f[_0x1e68e5(0x1ef)]),console[_0x1e68e5(0x220)]('\x20\x20'+a31_0x251538[_0x1e68e5(0x382)](_0x1e68e5(0x308))+'\x20'+_0x527a2f[_0x1e68e5(0x1f0)]);const _0x319e36=_0x527a2f[_0x1e68e5(0x190)]?.['length']||0x0;console[_0x1e68e5(0x220)]('\x20\x20'+a31_0x251538[_0x1e68e5(0x382)](_0x1e68e5(0x2f6))+'\x20'+_0x319e36);if(_0x527a2f['sections']&&_0x527a2f[_0x1e68e5(0x190)][_0x1e68e5(0x2cd)]>0x0)for(const _0x41a5e5 of _0x527a2f[_0x1e68e5(0x190)]){console['log'](_0x1e68e5(0x362)+a31_0x251538[_0x1e68e5(0x266)](_0x41a5e5['name'])+'\x20'+a31_0x251538[_0x1e68e5(0x1ba)](_0x1e68e5(0x248)+_0x41a5e5['id']+')')),_0x41a5e5['entryCriteria']&&(console['log'](_0x1e68e5(0x197)+a31_0x251538['cyan']('entryCriteria:')+'\x20'+_0x41a5e5['entryCriteria'][_0x1e68e5(0x338)]),_0x41a5e5[_0x1e68e5(0x2b0)][_0x1e68e5(0x224)]?.[_0x1e68e5(0x2e1)]&&console[_0x1e68e5(0x220)]('\x20\x20\x20\x20\x20\x20\x20\x20'+a31_0x251538[_0x1e68e5(0x382)](_0x1e68e5(0x1c5))+'\x20'+_0x41a5e5['entryCriteria']['keyEventCriteria'][_0x1e68e5(0x2e1)])),_0x41a5e5['payload']&&console[_0x1e68e5(0x220)]('\x20\x20\x20\x20\x20\x20'+a31_0x251538['cyan'](_0x1e68e5(0x2bb))+'\x20'+JSON['stringify'](_0x41a5e5[_0x1e68e5(0x174)])),_0x41a5e5[_0x1e68e5(0x231)]&&console[_0x1e68e5(0x220)]('\x20\x20\x20\x20\x20\x20'+a31_0x251538['cyan'](_0x1e68e5(0x35e))+_0x1e68e5(0x300));}}return 0x0;}}export class PSPzDeleteCommand extends BaseCommand{[a31_0x344d96(0x338)]=a31_0x344d96(0x181);['description']='Delete\x20a\x20realtime\x20personalization';async[a31_0x344d96(0x1a9)](_0x5b09ed){const _0x33f57a=a31_0x344d96,{options:_0x2b0918,args:_0x368c0a,tdx:_0x1e4af5}=_0x5b09ed,_0x46c39b=_0x368c0a[0x0];if(!_0x46c39b)return console[_0x33f57a(0x1da)]('Error:\x20Personalization\x20ID\x20is\x20required'),console[_0x33f57a(0x1da)](_0x33f57a(0x2e2)),0x1;return await withSpinner('Deleting\x20personalization\x20\x27'+_0x46c39b+_0x33f57a(0x301),()=>_0x1e4af5[_0x33f57a(0x279)]['deletePersonalization'](_0x46c39b),{'verbose':_0x2b0918[_0x33f57a(0x1ed)]}),console[_0x33f57a(0x1da)](_0x33f57a(0x378)+_0x46c39b+'\x27'),0x0;}}export class PSPzCreateCommand extends BaseCommand{[a31_0x344d96(0x338)]=a31_0x344d96(0x1ab);['description']=a31_0x344d96(0x1dc);async[a31_0x344d96(0x1a9)](_0x37a03a){const _0x45d846=a31_0x344d96,{options:_0x255547,tdx:_0x29b22a}=_0x37a03a,_0xfc13e6=_0x255547;let _0x1bbc1c;if(_0xfc13e6['file']){_0x1bbc1c=await loadJSON(_0xfc13e6[_0x45d846(0x2c7)],!![]);if(!_0x1bbc1c[_0x45d846(0x1a0)]?.[_0x45d846(0x2e0)])return console['error'](_0x45d846(0x24e)),console[_0x45d846(0x1da)](_0x45d846(0x26e)),console[_0x45d846(0x1da)](_0x45d846(0x27b)),0x1;}else{if(!_0xfc13e6[_0x45d846(0x338)])return console['error'](_0x45d846(0x1be)),console[_0x45d846(0x1da)](_0x45d846(0x182)),console['error'](_0x45d846(0x303)),0x1;if(_0xfc13e6[_0x45d846(0x2a7)]===undefined)return console['error']('Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)'),console['error'](_0x45d846(0x182)),console[_0x45d846(0x1da)](_0x45d846(0x303)),0x1;if(_0xfc13e6[_0x45d846(0x18d)]===undefined)return console[_0x45d846(0x1da)](_0x45d846(0x296)),console[_0x45d846(0x1da)](_0x45d846(0x2ff)),0x1;let _0x372f00=_0xfc13e6[_0x45d846(0x1a4)];if(!_0x372f00&&_0x255547[_0x45d846(0x1de)]){const _0x2d307a=await withSpinner(_0x45d846(0x1d5)+_0x255547[_0x45d846(0x1de)]+_0x45d846(0x301),()=>_0x29b22a[_0x45d846(0x202)][_0x45d846(0x2cb)](_0x255547[_0x45d846(0x1de)]),{'verbose':_0x255547[_0x45d846(0x1ed)]});_0x372f00=_0x2d307a['data'];}let _0x52b8ec;_0xfc13e6['sections']&&(_0x52b8ec=await loadJSON(_0xfc13e6[_0x45d846(0x190)],![]));const _0xd480f5=_0xfc13e6[_0x45d846(0x18d)]===_0x45d846(0x34b)?null:{'id':_0xfc13e6[_0x45d846(0x18d)],'type':_0x45d846(0x30e)};_0x1bbc1c={'attributes':{'name':_0xfc13e6['name'],'description':_0xfc13e6['description']||null,..._0x372f00!==undefined&&{'audienceId':_0x372f00},..._0x52b8ec!==undefined&&{'sections':_0x52b8ec}},'relationships':{'parentFolder':{'data':_0xd480f5}}};}const _0x5732f5=await withSpinner(_0x45d846(0x2ba)+(_0x1bbc1c[_0x45d846(0x211)]?.[_0x45d846(0x338)]??'')+_0x45d846(0x301),()=>_0x29b22a[_0x45d846(0x279)][_0x45d846(0x20e)](_0x1bbc1c),{'verbose':_0x255547[_0x45d846(0x1ed)]}),_0x44b3be=_0x5732f5[_0x45d846(0x17e)];return console[_0x45d846(0x1da)]('✔\x20Created\x20personalization\x20\x27'+_0x44b3be[_0x45d846(0x338)]+_0x45d846(0x18a)+_0x44b3be['id']),await handleSDKOutput([_0x44b3be],_0x255547),0x0;}}export class PSPzPatchCommand extends BaseCommand{[a31_0x344d96(0x338)]='ps:pz:patch';[a31_0x344d96(0x2a7)]=a31_0x344d96(0x219);async[a31_0x344d96(0x1a9)](_0x31c507){const _0x31d6e9=a31_0x344d96,{options:_0x7da36c,args:_0x4ae511}=_0x31c507,_0x3105c9=_0x7da36c,_0x53966e=_0x4ae511[0x0];if(!_0x53966e)return console[_0x31d6e9(0x1da)](_0x31d6e9(0x32f)),console[_0x31d6e9(0x1da)](_0x31d6e9(0x386)),console[_0x31d6e9(0x1da)](_0x31d6e9(0x2cc)),0x1;let _0xa97b72;if(_0x3105c9[_0x31d6e9(0x2c7)])_0xa97b72=await loadJSON(_0x3105c9['file'],!![]);else{if(!_0x3105c9[_0x31d6e9(0x338)])return console['error'](_0x31d6e9(0x1be)),console[_0x31d6e9(0x1da)](_0x31d6e9(0x386)),0x1;if(_0x3105c9[_0x31d6e9(0x2a7)]===undefined)return console[_0x31d6e9(0x1da)](_0x31d6e9(0x298)),console['error'](_0x31d6e9(0x386)),0x1;let _0x324a24;_0x3105c9[_0x31d6e9(0x190)]&&(_0x324a24=await loadJSON(_0x3105c9[_0x31d6e9(0x190)],![])),_0xa97b72={'attributes':{'name':_0x3105c9['name'],'description':_0x3105c9[_0x31d6e9(0x2a7)]||null,..._0x324a24!==undefined&&{'sections':_0x324a24}}};}const {tdx:_0x41abb6}=_0x31c507,_0x11659a=await withSpinner(_0x31d6e9(0x342)+_0x53966e+_0x31d6e9(0x301),()=>_0x41abb6[_0x31d6e9(0x279)]['patchPersonalization'](_0x53966e,_0xa97b72),{'verbose':_0x7da36c['verbose']}),_0x4ffbd3=_0x11659a['data'];return console[_0x31d6e9(0x1da)]('✔\x20Updated\x20personalization\x20\x27'+_0x4ffbd3['name']+_0x31d6e9(0x2fa)+_0x4ffbd3['id']+')'),await handleSDKOutput([_0x4ffbd3],_0x7da36c),0x0;}}export class PSPzInitCommand extends BaseParentSegmentCommand{['name']=a31_0x344d96(0x173);['description']='Add\x20template\x20personalization\x20section\x20to\x20parent\x20segment\x20YAML';async[a31_0x344d96(0x1a9)](_0x5dd70a){const _0x5541c3=a31_0x344d96,{options:_0x89df6e,args:_0x3102a2}=_0x5dd70a,_0x3b3819=_0x3102a2[0x0]||_0x89df6e['parentSegment'];if(!_0x3b3819)return showParentSegmentNotSetError(_0x5541c3(0x2f8)+_0x5541c3(0x314)),0x1;const _0x1a40b0=resolveYamlFile(_0x3b3819);if(!existsSync(_0x1a40b0))return showFileNotFoundError(_0x1a40b0,_0x3b3819),0x1;let _0x1a54ea;try{_0x1a54ea=readFileSync(_0x1a40b0,_0x5541c3(0x28e));}catch(_0x5a664b){const _0x185243=_0x5a664b instanceof Error?_0x5a664b[_0x5541c3(0x332)]:String(_0x5a664b);return console[_0x5541c3(0x1da)](_0x5541c3(0x1b2)+_0x185243),0x1;}let _0x17de9b;try{_0x17de9b=parseDef(_0x1a54ea);}catch(_0x27cc92){const _0xc4f15c=_0x27cc92 instanceof Error?_0x27cc92[_0x5541c3(0x332)]:String(_0x27cc92);return console['error'](a31_0x251538['red'](_0x5541c3(0x1a7)+_0xc4f15c)),0x1;}if(_0x17de9b[_0x5541c3(0x259)]&&_0x17de9b['personalization_services'][_0x5541c3(0x2cd)]>0x0)return console['error'](a31_0x251538['yellow'](_0x5541c3(0x312)+_0x1a40b0)),console[_0x5541c3(0x1da)](a31_0x251538[_0x5541c3(0x1ba)](_0x5541c3(0x340)+_0x17de9b[_0x5541c3(0x259)][_0x5541c3(0x2cd)]+_0x5541c3(0x26b))),0x1;!_0x17de9b[_0x5541c3(0x2fd)]&&(_0x17de9b[_0x5541c3(0x2fd)]={'events':[{'name':_0x5541c3(0x307),'source_table':_0x5541c3(0x1e9)}],'attributes':[{'name':'last_page_viewed','type':_0x5541c3(0x2e3)}],'id_stitching':{'primary_key':_0x17de9b[_0x5541c3(0x18f)][_0x5541c3(0x2a6)]===_0x5541c3(0x18c)?_0x5541c3(0x20a):_0x5541c3(0x183)}});_0x17de9b[_0x5541c3(0x259)]=[{'name':_0x5541c3(0x242),'description':_0x5541c3(0x17f),'trigger_event':_0x5541c3(0x307),'sections':[{'name':_0x5541c3(0x213),'criteria':_0x5541c3(0x237),'attributes':['last_page_viewed']}]}];const _0x203b37=serializeDef(_0x17de9b);return writeFileSync(_0x1a40b0,_0x203b37,_0x5541c3(0x28e)),console[_0x5541c3(0x1da)](a31_0x251538[_0x5541c3(0x339)]('✔')+_0x5541c3(0x37d)+a31_0x251538['cyan'](_0x1a40b0)),(!_0x17de9b['realtime']||_0x1a54ea[_0x5541c3(0x277)](_0x5541c3(0x1cc))===-0x1)&&console['error'](a31_0x251538['green']('✔')+'\x20Added\x20RT\x202.0\x20template\x20section'),console[_0x5541c3(0x1da)]('\x0a'+a31_0x251538['dim'](_0x5541c3(0x1fb))),console[_0x5541c3(0x1da)]('\x20\x201.\x20Edit\x20'+_0x1a40b0+'\x20to\x20configure\x20your\x20personalization\x20service'),console[_0x5541c3(0x1da)]('\x20\x202.\x20Run\x20'+a31_0x251538[_0x5541c3(0x1ba)](_0x5541c3(0x1ca)+_0x3b3819)+_0x5541c3(0x385)),0x0;}}
1
+ const a31_0x10c381=a31_0xc607;(function(_0x1fd1d9,_0x1ffd67){const _0x51c9ee=a31_0xc607,_0xdcfa11=_0x1fd1d9();while(!![]){try{const _0x20b4d0=parseInt(_0x51c9ee(0x120))/0x1*(-parseInt(_0x51c9ee(0x110))/0x2)+-parseInt(_0x51c9ee(0x26e))/0x3*(-parseInt(_0x51c9ee(0x8e))/0x4)+-parseInt(_0x51c9ee(0x7d))/0x5*(parseInt(_0x51c9ee(0x207))/0x6)+parseInt(_0x51c9ee(0x12d))/0x7*(-parseInt(_0x51c9ee(0x1c9))/0x8)+-parseInt(_0x51c9ee(0x25a))/0x9*(parseInt(_0x51c9ee(0x1b1))/0xa)+-parseInt(_0x51c9ee(0x1ea))/0xb+parseInt(_0x51c9ee(0x25f))/0xc;if(_0x20b4d0===_0x1ffd67)break;else _0xdcfa11['push'](_0xdcfa11['shift']());}catch(_0x115682){_0xdcfa11['push'](_0xdcfa11['shift']());}}}(a31_0x1457,0x52aaf));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a31_0x1ac1cb 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,loadJSON}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 a31_0x343d08 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=a31_0x10c381(0x17c),LEGACY_PARENT_SEGMENT_DIR=a31_0x10c381(0x27d);function openBrowser(_0x89c7b0){const _0x5a5e7b=a31_0x10c381,_0x59e79b=process[_0x5a5e7b(0xd8)],_0x5e9bb3=_0x59e79b===_0x5a5e7b(0x18c)?'open':_0x59e79b===_0x5a5e7b(0x249)?'start':_0x5a5e7b(0xb4);spawn(_0x5e9bb3,[_0x89c7b0],{'detached':!![],'stdio':'ignore'})[_0x5a5e7b(0x256)]();}function migrateLegacyDirectory(){const _0xcaade6=a31_0x10c381;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x3c2c03=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x3c2c03[_0xcaade6(0x132)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0xcaade6(0xdd)](a31_0x343d08[_0xcaade6(0x185)](_0xcaade6(0x142)+LEGACY_PARENT_SEGMENT_DIR+_0xcaade6(0x1a5)+PARENT_SEGMENT_DIR+_0xcaade6(0x222))),console[_0xcaade6(0xdd)](a31_0x343d08[_0xcaade6(0x1a7)]('\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20'+LEGACY_PARENT_SEGMENT_DIR+_0xcaade6(0xbf))),![];console['error'](a31_0x343d08[_0xcaade6(0x185)]('\x0a⚠️\x20\x20Migrating:\x20'+LEGACY_PARENT_SEGMENT_DIR+_0xcaade6(0x19f)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0xcaade6(0xdd)](a31_0x343d08[_0xcaade6(0x97)]('✔\x20Renamed\x20directory\x20to\x20'+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x421e28){const _0x59c778=_0x421e28 instanceof Error?_0x421e28[_0xcaade6(0x14e)]:String(_0x421e28);return console['error'](a31_0x343d08['red'](_0xcaade6(0x23e)+_0x59c778+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a31_0x10c381(0xb3)](_0x31a99c){const _0x187c15=a31_0x10c381;return migrateLegacyDirectory(),super[_0x187c15(0xb3)](_0x31a99c);}}function resolveYamlFile(_0x474569){const _0x53ef7e=a31_0x10c381;if(_0x474569[_0x53ef7e(0x1fa)](_0x53ef7e(0x1d1))||_0x474569['endsWith']('.yaml'))return _0x474569;return a31_0x1ac1cb[_0x53ef7e(0xa1)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x474569)+_0x53ef7e(0x1d1));}function formatProgressMessage(_0x3fb98b){const _0x50c57b=a31_0x10c381,_0x2c5e7b=_0x3fb98b[_0x50c57b(0x21d)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x2c5e7b){const [,_0x3ee29e,_0x2818e2,_0x3ad993='']=_0x2c5e7b;return a31_0x343d08[_0x50c57b(0x1a7)](_0x3ee29e+':')+'\x20'+_0x2818e2+a31_0x343d08[_0x50c57b(0x1a7)](_0x3ad993);}return a31_0x343d08['dim'](_0x3fb98b);}function showFileNotFoundError(_0x3c8c5a,_0x1023bb){const _0xb4bb17=a31_0x10c381;console['error'](a31_0x343d08[_0xb4bb17(0x11b)]('Error:\x20File\x20not\x20found:\x20'+_0x3c8c5a+'\x0a')),console[_0xb4bb17(0xdd)](a31_0x343d08[_0xb4bb17(0x12a)](_0xb4bb17(0x96)+_0x1023bb+'`\x20to\x20download\x20the\x20configuration\x20first'));}function displayRealtimeValidation(_0x54e068){const _0x36fd51=a31_0x10c381;if(!_0x54e068[_0x36fd51(0x193)])return;const _0x2b2d53=_0x54e068[_0x36fd51(0x193)],_0x19acbe=_0x2b2d53[_0x36fd51(0x191)]?a31_0x343d08[_0x36fd51(0x97)]('⚡\x20Enabled'):a31_0x343d08[_0x36fd51(0x185)](_0x36fd51(0xbc));console['error']('\x0a'+a31_0x343d08[_0x36fd51(0x1a7)](_0x36fd51(0x261))+'\x20'+_0x19acbe);if(_0x2b2d53[_0x36fd51(0xdc)]&&_0x2b2d53[_0x36fd51(0xdc)][_0x36fd51(0x190)]>0x0){console[_0x36fd51(0xdd)]('\x20\x20'+a31_0x343d08[_0x36fd51(0x1a7)]('Events:')+'\x20'+_0x2b2d53[_0x36fd51(0xdc)]['length']+_0x36fd51(0x135));for(const _0x85cacc of _0x2b2d53['events']){const _0x51a017=_0x85cacc[_0x36fd51(0x1f1)]===![]?a31_0x343d08[_0x36fd51(0x11b)]('✘'):a31_0x343d08[_0x36fd51(0x97)]('✔');console[_0x36fd51(0xdd)](_0x36fd51(0x263)+_0x51a017+'\x20'+_0x85cacc[_0x36fd51(0x23b)]),_0x85cacc[_0x36fd51(0x1dd)]&&console['error'](_0x36fd51(0x235)+a31_0x343d08[_0x36fd51(0x11b)](_0x85cacc['sourceTableError']));}}if(_0x2b2d53[_0x36fd51(0x166)]&&_0x2b2d53[_0x36fd51(0x166)][_0x36fd51(0x190)]>0x0){console[_0x36fd51(0xdd)]('\x20\x20'+a31_0x343d08[_0x36fd51(0x1a7)](_0x36fd51(0x170))+'\x20'+_0x2b2d53[_0x36fd51(0x166)][_0x36fd51(0x190)]+_0x36fd51(0x135));for(const _0x2108bb of _0x2b2d53[_0x36fd51(0x166)]){const _0x3c90cd=_0x2108bb['valid']?a31_0x343d08[_0x36fd51(0x97)]('✔'):a31_0x343d08['red']('✘');console[_0x36fd51(0xdd)](_0x36fd51(0x263)+_0x3c90cd+'\x20'+_0x2108bb[_0x36fd51(0x23b)]+'\x20'+a31_0x343d08['dim']('('+_0x2108bb[_0x36fd51(0x83)]+')'));}}if(_0x2b2d53['idStitching']){const _0x380698=_0x2b2d53[_0x36fd51(0x155)][_0x36fd51(0xb5)]?.[_0x36fd51(0x190)]?'\x20+\x20['+_0x2b2d53['idStitching'][_0x36fd51(0xb5)][_0x36fd51(0xa1)](',\x20')+']':'';console['error']('\x20\x20'+a31_0x343d08[_0x36fd51(0x1a7)](_0x36fd51(0x23a))+'\x20'+_0x2b2d53[_0x36fd51(0x155)]['primaryKey']+_0x380698);}if(_0x2b2d53[_0x36fd51(0x101)]&&_0x2b2d53['personalizationServices'][_0x36fd51(0x190)]>0x0){console[_0x36fd51(0xdd)]('\x20\x20'+a31_0x343d08[_0x36fd51(0x1a7)](_0x36fd51(0xac))+'\x20'+_0x2b2d53['personalizationServices']['length']+_0x36fd51(0x18a)+(_0x2b2d53['personalizationServices'][_0x36fd51(0x190)]!==0x1?'s':''));for(const _0x462e28 of _0x2b2d53[_0x36fd51(0x101)]){console[_0x36fd51(0xdd)](_0x36fd51(0x1ab)+_0x462e28[_0x36fd51(0x23b)]);}}}function showParentSegmentNotSetError(_0x471b57){const _0x3a53c0=a31_0x10c381;console[_0x3a53c0(0xdd)](a31_0x343d08[_0x3a53c0(0x185)](_0x3a53c0(0x241))),console[_0x3a53c0(0xdd)](_0x471b57);}export class ParentSegmentListCommand extends BaseCommand{['name']='segment:parent:list';['description']='List\x20parent\x20segments';async[a31_0x10c381(0xa0)](_0x3098bc){const _0x4fee57=a31_0x10c381,{options:_0x298992,args:_0x19eaf8,tdx:_0x3066c2}=_0x3098bc,_0x1e51b2=_0x19eaf8[0x0];_0x298992[_0x4fee57(0x20b)]&&(console[_0x4fee57(0xdd)](_0x4fee57(0x25d)+_0x298992[_0x4fee57(0x201)]),_0x1e51b2&&console[_0x4fee57(0xdd)](_0x4fee57(0x220)+_0x1e51b2));const _0x60d6da=await withSpinner(_0x1e51b2?_0x4fee57(0x13c)+_0x1e51b2+_0x4fee57(0x169):_0x4fee57(0x250),()=>_0x3066c2['segment'][_0x4fee57(0x1c7)](),{'verbose':_0x298992[_0x4fee57(0x20b)]});let _0x42c91a=_0x60d6da[_0x4fee57(0x8b)];if(_0x1e51b2){const _0x21f67c=_0x1e51b2[_0x4fee57(0x15f)](/[.+^${}()|[\]\\]/g,_0x4fee57(0x1f3))['replace'](/\*/g,'.*')[_0x4fee57(0x15f)](/\?/g,'.'),_0xcb71d9=new RegExp('^'+_0x21f67c+'$','i');_0x42c91a=_0x42c91a[_0x4fee57(0xe0)](_0xc7704d=>_0xcb71d9['test'](_0xc7704d[_0x4fee57(0x166)]['name']));}_0x42c91a['sort']((_0x3f5cc9,_0x2c6157)=>_0x3f5cc9['attributes'][_0x4fee57(0x23b)][_0x4fee57(0x19e)](_0x2c6157[_0x4fee57(0x166)][_0x4fee57(0x23b)])),console[_0x4fee57(0xdd)](_0x4fee57(0x227)+_0x42c91a[_0x4fee57(0x190)]+_0x4fee57(0xca)+(_0x42c91a[_0x4fee57(0x190)]!==0x1?'s':''));const _0xabf71b=_0x3831f5=>{const _0x4f3d85=_0x4fee57;return getConsoleNextUrl(_0x298992[_0x4f3d85(0x201)],'/app/dw/parentSegments/'+_0x3831f5);};if(_0x298992['format']===_0x4fee57(0x22f)||_0x298992[_0x4fee57(0x6f)]===_0x4fee57(0xd1)){const _0x42622d=_0x42c91a[_0x4fee57(0xe9)](_0x54430f=>({..._0x54430f,'url':_0xabf71b(_0x54430f['id'])}));await handleSDKOutput(_0x42622d,_0x298992);}else{if(_0x42c91a[_0x4fee57(0x190)]===0x0)_0x1e51b2?console[_0x4fee57(0x1db)](_0x4fee57(0x17a)+_0x1e51b2):console[_0x4fee57(0x1db)](_0x4fee57(0x1d5));else for(const _0x128efa of _0x42c91a){const _0x45ac87=_0x128efa['attributes'][_0x4fee57(0x19b)]?a31_0x343d08[_0x4fee57(0x1a7)]('\x20('+formatRows(_0x128efa['attributes'][_0x4fee57(0x19b)])+')'):'',_0x31536e=hyperlink(_0x128efa[_0x4fee57(0x166)]['name'],_0xabf71b(_0x128efa['id']));console['log'](_0x4fee57(0xea)+_0x31536e+_0x45ac87);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0x72);[a31_0x10c381(0x184)]=a31_0x10c381(0x15c);async[a31_0x10c381(0xa0)](_0x30d66b){const _0x45ef3d=a31_0x10c381,{options:_0x47dcb2,args:_0x53ffcd,tdx:_0x5d241e}=_0x30d66b;console['error']('\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a'+_0x45ef3d(0x22d)+_0x45ef3d(0x211));const _0x56a0f8=_0x47dcb2;if(_0x53ffcd[_0x45ef3d(0x190)]===0x0)return console[_0x45ef3d(0xdd)](a31_0x343d08[_0x45ef3d(0x11b)](_0x45ef3d(0x99))),console['error']('Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>'),0x1;const _0x2a94b3=_0x53ffcd[0x0];if(!_0x56a0f8[_0x45ef3d(0x127)]||!_0x56a0f8['table'])return console[_0x45ef3d(0xdd)](_0x45ef3d(0xfb)),console[_0x45ef3d(0xdd)](_0x45ef3d(0xf4)),0x1;_0x56a0f8[_0x45ef3d(0x20b)]&&(console['error'](_0x45ef3d(0x25d)+_0x56a0f8[_0x45ef3d(0x201)]),console['error']('Name:\x20'+_0x2a94b3),console[_0x45ef3d(0xdd)](_0x45ef3d(0x9b)+_0x56a0f8[_0x45ef3d(0x127)]),console[_0x45ef3d(0xdd)](_0x45ef3d(0x11d)+_0x56a0f8[_0x45ef3d(0x27e)]));const _0x39917c=await loadJSONFromOptions(_0x56a0f8[_0x45ef3d(0x166)],_0x56a0f8[_0x45ef3d(0x71)]),_0x581764=await loadJSONFromOptions(_0x56a0f8[_0x45ef3d(0x70)],_0x56a0f8['behaviorsFile']),_0x53e0ca=await loadJSONFromOptions(_0x56a0f8[_0x45ef3d(0x102)],_0x56a0f8['customerGroupFile']),_0x21125d={'name':_0x2a94b3,'description':_0x56a0f8['description'],'scheduleType':_0x56a0f8[_0x45ef3d(0x177)],'scheduleOption':_0x56a0f8[_0x45ef3d(0x27b)],'timezone':_0x56a0f8[_0x45ef3d(0x214)],'master':{'parentDatabaseName':_0x56a0f8['database'],'parentTableName':_0x56a0f8[_0x45ef3d(0x27e)]},'attributes':_0x39917c,'behaviors':_0x581764,'customerGroup':_0x53e0ca},_0x125ae7=await withSpinner(_0x45ef3d(0x86)+_0x2a94b3+_0x45ef3d(0x169),()=>_0x5d241e[_0x45ef3d(0x209)][_0x45ef3d(0x73)](_0x21125d),{'verbose':_0x47dcb2[_0x45ef3d(0x20b)]}),_0x36ee59=_0x125ae7[_0x45ef3d(0x8b)];return console[_0x45ef3d(0xdd)](_0x45ef3d(0x194)+_0x36ee59['name']+_0x45ef3d(0x274)+_0x36ee59['id']),await handleSDKOutput([_0x36ee59],_0x47dcb2),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0x218);['description']='Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]';async['execute'](_0x43aaf4){const _0x6bf07=a31_0x10c381,{options:_0x22ddfb,args:_0x46f3f3,tdx:_0x815c9}=_0x43aaf4;console[_0x6bf07(0xdd)](_0x6bf07(0x7f)+_0x6bf07(0x22d)+_0x6bf07(0x211));const _0x5cd3e5=_0x22ddfb;if(_0x46f3f3[_0x6bf07(0x190)]===0x0)return console['error'](a31_0x343d08[_0x6bf07(0x11b)](_0x6bf07(0x99))),console['error'](_0x6bf07(0x225)),0x1;const _0x314baf=_0x46f3f3[0x0];_0x5cd3e5[_0x6bf07(0x20b)]&&(console['error']('Site:\x20'+_0x5cd3e5['site']),console[_0x6bf07(0xdd)](_0x6bf07(0x224)+_0x314baf));const _0x5c1d31=await withSpinner(_0x6bf07(0x240)+_0x314baf+_0x6bf07(0x169),()=>_0x815c9[_0x6bf07(0x209)]['getParentFull'](_0x314baf),{'verbose':_0x5cd3e5['verbose']}),_0x2dba1f=_0x5c1d31['data'],_0x93ebbb=await loadJSONFromOptions(_0x5cd3e5['addAttributes'],_0x5cd3e5[_0x6bf07(0x180)]),_0x3b0f25=await loadJSONFromOptions(_0x5cd3e5['addBehaviors'],_0x5cd3e5[_0x6bf07(0x131)]),_0x590d80={'name':_0x2dba1f[_0x6bf07(0x23b)],'description':_0x5cd3e5[_0x6bf07(0x184)]!==undefined?_0x5cd3e5[_0x6bf07(0x184)]:_0x2dba1f[_0x6bf07(0x184)],'scheduleType':_0x5cd3e5[_0x6bf07(0x177)]!==undefined?_0x5cd3e5[_0x6bf07(0x177)]:_0x2dba1f[_0x6bf07(0x177)],'scheduleOption':_0x5cd3e5[_0x6bf07(0x27b)]!==undefined?_0x5cd3e5['scheduleOption']:_0x2dba1f[_0x6bf07(0x27b)],'timezone':_0x5cd3e5[_0x6bf07(0x214)]!==undefined?_0x5cd3e5[_0x6bf07(0x214)]:_0x2dba1f['timezone'],'master':_0x2dba1f['master'],'attributes':_0x93ebbb?[..._0x2dba1f['attributes']||[],..._0x93ebbb]:_0x2dba1f[_0x6bf07(0x166)],'behaviors':_0x3b0f25?[..._0x2dba1f[_0x6bf07(0x70)]||[],..._0x3b0f25]:_0x2dba1f[_0x6bf07(0x70)],'customerGroup':_0x2dba1f[_0x6bf07(0x102)]},_0x1458b6=await withSpinner(_0x6bf07(0x1ec)+_0x314baf+_0x6bf07(0x169),()=>_0x815c9[_0x6bf07(0x209)]['updateParent'](_0x314baf,_0x590d80),{'verbose':_0x5cd3e5[_0x6bf07(0x20b)]}),_0x3d14f5=_0x1458b6['data'];return console[_0x6bf07(0xdd)]('✔\x20Updated\x20parent\x20segment\x20\x27'+_0x3d14f5[_0x6bf07(0x23b)]+'\x27'),await handleSDKOutput([_0x3d14f5],_0x5cd3e5),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{['name']='segment:parent:pull';[a31_0x10c381(0x184)]=a31_0x10c381(0x178);async[a31_0x10c381(0xa0)](_0x5914c6){const _0x5e1418=a31_0x10c381,{options:_0x2a7f89,args:_0x16d040,tdx:_0x3e98ed}=_0x5914c6,_0x3841aa=_0x2a7f89,_0xd3e6f0=_0x16d040[0x0]||_0x2a7f89[_0x5e1418(0x113)];if(!_0xd3e6f0)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a'+_0x5e1418(0x104)),0x1;if(_0x3841aa['use']&&_0x3841aa[_0x5e1418(0x1f5)])return console[_0x5e1418(0xdd)](a31_0x343d08[_0x5e1418(0x11b)](_0x5e1418(0x24d))),console[_0x5e1418(0xdd)](a31_0x343d08[_0x5e1418(0x1a7)]('The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires')),console[_0x5e1418(0xdd)](a31_0x343d08[_0x5e1418(0x1a7)](_0x5e1418(0x95)+PARENT_SEGMENT_DIR+'/{name}.yml\x0a')),console[_0x5e1418(0xdd)](a31_0x343d08['cyan'](_0x5e1418(0x277))),0x1;const _0x2168c=_0x3841aa[_0x5e1418(0x1f5)]||a31_0x1ac1cb[_0x5e1418(0xa1)](PARENT_SEGMENT_DIR,sanitizeFileName(_0xd3e6f0)+'.yml');_0x3841aa[_0x5e1418(0x20b)]&&(console[_0x5e1418(0xdd)](_0x5e1418(0x25d)+_0x3841aa[_0x5e1418(0x201)]),console[_0x5e1418(0xdd)](_0x5e1418(0x224)+_0xd3e6f0),console[_0x5e1418(0xdd)](_0x5e1418(0x1bc)+_0x2168c));const _0x501d2c=await withSpinner(_0x5e1418(0xa9)+_0xd3e6f0+_0x5e1418(0x169),()=>_0x3e98ed[_0x5e1418(0x209)][_0x5e1418(0x159)](_0xd3e6f0),{'verbose':_0x3841aa[_0x5e1418(0x20b)]}),_0x316e1d=_0x501d2c[_0x5e1418(0x8b)];if(existsSync(_0x2168c)){const _0x53711b=readFileSync(_0x2168c,_0x5e1418(0x20f)),_0x1787d5=generateDiff(_0x53711b,_0x316e1d);if(!hasChanges(_0x1787d5))console[_0x5e1418(0xdd)](a31_0x343d08[_0x5e1418(0x97)]('✔')+_0x5e1418(0x90)+a31_0x343d08[_0x5e1418(0x12a)](_0x2168c)+'\x20is\x20already\x20up\x20to\x20date');else{console['error'](_0x5e1418(0x1b2)+_0x2168c+'\x27:'),console[_0x5e1418(0xdd)]('─'[_0x5e1418(0x1c1)](0x3c)),console[_0x5e1418(0xdd)](formatDiffWithColors(_0x1787d5)),console[_0x5e1418(0xdd)]('─'[_0x5e1418(0x1c1)](0x3c));if(!_0x3841aa[_0x5e1418(0x130)]){if(!isInteractive())return console['error'](a31_0x343d08[_0x5e1418(0x11b)](_0x5e1418(0xfd)),_0x5e1418(0x1b0)),console[_0x5e1418(0xdd)](a31_0x343d08[_0x5e1418(0x1a7)](_0x5e1418(0x182))),0x1;const _0x110ecf=await confirmKey('Overwrite\x20\x27'+_0x2168c+'\x27?');if(!_0x110ecf)return console[_0x5e1418(0xdd)](a31_0x343d08[_0x5e1418(0x185)](_0x5e1418(0x1ae))),0x1;}writeFileSync(_0x2168c,_0x316e1d,'utf-8'),console[_0x5e1418(0xdd)](a31_0x343d08[_0x5e1418(0x97)]('✔')+_0x5e1418(0x14c)+a31_0x343d08[_0x5e1418(0x12a)](_0x2168c));}}else{const _0x5b8b1e=a31_0x1ac1cb['dirname'](_0x2168c);!existsSync(_0x5b8b1e)&&mkdirSync(_0x5b8b1e,{'recursive':!![]}),writeFileSync(_0x2168c,_0x316e1d,_0x5e1418(0x20f)),console[_0x5e1418(0xdd)](a31_0x343d08[_0x5e1418(0x97)]('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a31_0x343d08[_0x5e1418(0x12a)](_0x2168c));}return saveSessionContext({'parent_segment':_0xd3e6f0},_0x3841aa['session']),console['error'](a31_0x343d08[_0x5e1418(0x97)]('✔')+_0x5e1418(0xed)+a31_0x343d08['dim'](_0x5e1418(0x27d))+'\x20=\x20'+a31_0x343d08[_0x5e1418(0x12a)](_0xd3e6f0)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a31_0x10c381(0x23b)]='segment:parent:push';[a31_0x10c381(0x184)]='Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file';async['execute'](_0x171a9d){const _0x43569e=a31_0x10c381,{options:_0x282466,args:_0x1d0c17,tdx:_0x2da1ce}=_0x171a9d,_0x54c023=_0x282466,_0xf3e4b8=_0x1d0c17[0x0]||_0x282466[_0x43569e(0x113)];if(!_0xf3e4b8)return showParentSegmentNotSetError(_0x43569e(0x6c)+_0x43569e(0x245)),0x1;const _0x94f6bc=resolveYamlFile(_0xf3e4b8);if(!existsSync(_0x94f6bc))return showFileNotFoundError(_0x94f6bc,_0xf3e4b8),0x1;_0x54c023[_0x43569e(0x20b)]&&(console['error'](_0x43569e(0x25d)+_0x54c023[_0x43569e(0x201)]),console['error']('YAML\x20file:\x20'+_0x94f6bc));let _0x4fb0c1;try{_0x4fb0c1=readFileSync(_0x94f6bc,_0x43569e(0x20f));}catch(_0x46032b){const _0x5deaca=_0x46032b instanceof Error?_0x46032b['message']:String(_0x46032b);return console[_0x43569e(0xdd)](_0x43569e(0x1cf)+_0x5deaca),0x1;}const _0x4ec2f8=await withSpinner(_0x43569e(0x1ff),()=>_0x2da1ce[_0x43569e(0x209)][_0x43569e(0xce)](_0x4fb0c1),{'verbose':_0x54c023['verbose']}),_0x4dd4ba=_0x4ec2f8['data'],{isNew:_0x4fa72,name:_0x3532f8,hasChanges:_0x5c524f,diffFormatted:_0x118c43}=_0x4dd4ba;if(!_0x5c524f)return console['error'](_0x43569e(0x1e6)+_0x3532f8+_0x43569e(0x1ce)),0x0;_0x4fa72?console[_0x43569e(0xdd)](_0x43569e(0xcb)+_0x3532f8+'\x27:'):console['error'](_0x43569e(0xfa)+_0x3532f8+'\x27:');console[_0x43569e(0xdd)]('─'[_0x43569e(0x1c1)](0x3c)),console[_0x43569e(0xdd)](_0x118c43),console['error']('─'['repeat'](0x3c));const _0x3ed510=_0x4fa72?_0x43569e(0x136)+_0x3532f8+'\x27?':_0x43569e(0xb7)+_0x3532f8+'\x27?';if(!_0x54c023['yes']){if(!isInteractive())return console[_0x43569e(0xdd)](a31_0x343d08[_0x43569e(0x11b)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x43569e(0xdd)](a31_0x343d08['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x4c3828=await confirmKey(_0x3ed510);if(!_0x4c3828)return console[_0x43569e(0xdd)](a31_0x343d08[_0x43569e(0x185)](_0x43569e(0x1ae))),0x1;}const _0x28d0c0=_0x4fa72?_0x43569e(0x147):_0x43569e(0x1a4),_0x52241c=await withSpinner(_0x28d0c0+_0x43569e(0x199)+_0x3532f8+'\x27...',()=>_0x4dd4ba[_0x43569e(0x9a)](),{'verbose':_0x54c023[_0x43569e(0x20b)]}),_0x552605=_0x52241c['data'],_0x1e14b9=getConsoleNextUrl(_0x54c023[_0x43569e(0x201)],_0x43569e(0x13d)+_0x552605['id']),_0x34ebeb=_0x4fa72?_0x43569e(0x21e):_0x43569e(0xcd);return console[_0x43569e(0xdd)]('✔\x20'+_0x34ebeb+_0x43569e(0x199)+_0x552605[_0x43569e(0x23b)]+'\x27'),console['error']('\x20\x20'+_0x1e14b9),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0xd4);[a31_0x10c381(0x184)]='Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics';async[a31_0x10c381(0xa0)](_0x135961){const _0xd78c2f=a31_0x10c381,{options:_0x38c0e8,args:_0x3c66fa,tdx:_0x1df442}=_0x135961,_0x53086f=_0x38c0e8,_0x237b8c=_0x3c66fa[0x0]||_0x38c0e8[_0xd78c2f(0x113)];if(!_0x237b8c)return showParentSegmentNotSetError(_0xd78c2f(0xef)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a'+_0xd78c2f(0x1a2)+_0xd78c2f(0x1b6)+'\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a'+_0xd78c2f(0xd9)),0x1;const _0x1ce1d9=resolveYamlFile(_0x237b8c);if(!existsSync(_0x1ce1d9))return showFileNotFoundError(_0x1ce1d9,_0x237b8c),0x1;_0x53086f[_0xd78c2f(0x20b)]&&(console[_0xd78c2f(0xdd)](_0xd78c2f(0x25d)+_0x53086f[_0xd78c2f(0x201)]),console[_0xd78c2f(0xdd)]('YAML\x20file:\x20'+_0x1ce1d9));let _0x258ce7;try{_0x258ce7=readFileSync(_0x1ce1d9,_0xd78c2f(0x20f));}catch(_0x304227){const _0x173b17=_0x304227 instanceof Error?_0x304227[_0xd78c2f(0x14e)]:String(_0x304227);return console[_0xd78c2f(0xdd)](_0xd78c2f(0x1cf)+_0x173b17),0x1;}const _0x573b64=createCommandSpinner(a31_0x343d08[_0xd78c2f(0x1a7)](_0xd78c2f(0x216)),{'verbose':_0x53086f[_0xd78c2f(0x20b)]});_0x573b64[_0xd78c2f(0x134)]();const _0x32e9e3={'onProgress':_0x61ba4f=>{_0x573b64['text']=formatProgressMessage(_0x61ba4f);}};if(_0x53086f[_0xd78c2f(0x77)])_0x32e9e3[_0xd78c2f(0x77)]=!![];if(_0x53086f[_0xd78c2f(0x27f)])_0x32e9e3[_0xd78c2f(0x27f)]=!![];_0x53086f[_0xd78c2f(0xf8)]&&(_0x32e9e3[_0xd78c2f(0xf8)]=_0x53086f[_0xd78c2f(0xf8)]);_0x53086f['behavior']&&(_0x32e9e3[_0xd78c2f(0x239)]=_0x53086f[_0xd78c2f(0x239)]);if(_0x53086f['interval'])_0x32e9e3['interval']=_0x53086f[_0xd78c2f(0x1f4)];let _0x2cb6e8;try{_0x2cb6e8=await _0x1df442[_0xd78c2f(0x209)][_0xd78c2f(0x13e)](_0x258ce7,_0x32e9e3),_0x573b64[_0xd78c2f(0xf6)]();}catch(_0x47ae22){_0x573b64['stop']();throw _0x47ae22;}const _0x3907d4=_0x53086f[_0xd78c2f(0x1f4)]||_0xd78c2f(0x206);return this[_0xd78c2f(0xf5)](_0x2cb6e8,_0x32e9e3,_0x1ce1d9,_0x3907d4),_0x2cb6e8[_0xd78c2f(0x202)]?0x0:0x1;}[a31_0x10c381(0xf5)](_0x57cabf,_0xa75c38,_0x15cac8,_0x12fd59){const _0x2ee003=a31_0x10c381;console['error']('\x0a'+a31_0x343d08['bold'](_0x2ee003(0x115))+'\x20'+_0x57cabf[_0x2ee003(0x23b)]),console[_0x2ee003(0xdd)]('═'[_0x2ee003(0x1c1)](0x3c)),this[_0x2ee003(0x1c5)](_0x57cabf);if(typeof _0xa75c38[_0x2ee003(0xf8)]===_0x2ee003(0x6d)){this[_0x2ee003(0x213)](_0x57cabf),this['displaySummary'](_0x57cabf),this['displayPreviewHints'](_0x15cac8,_0x12fd59,_0x2ee003(0xf8),_0xa75c38[_0x2ee003(0xf8)]);return;}if(_0xa75c38[_0x2ee003(0xf8)]===!![]){this[_0x2ee003(0x213)](_0x57cabf),this['displaySummary'](_0x57cabf),this[_0x2ee003(0x16c)](_0x15cac8,_0x12fd59,'attributes');return;}if(typeof _0xa75c38[_0x2ee003(0x239)]===_0x2ee003(0x6d)){this[_0x2ee003(0x1eb)](_0x57cabf,_0x12fd59),this['displaySummary'](_0x57cabf),this['displayPreviewHints'](_0x15cac8,_0x12fd59,'behavior',_0xa75c38[_0x2ee003(0x239)]);return;}if(_0xa75c38[_0x2ee003(0x239)]===!![]){this[_0x2ee003(0x1eb)](_0x57cabf,_0x12fd59),this['displaySummary'](_0x57cabf),this[_0x2ee003(0x16c)](_0x15cac8,_0x12fd59,'behaviors');return;}this[_0x2ee003(0x213)](_0x57cabf),this[_0x2ee003(0x1eb)](_0x57cabf,_0x12fd59),this[_0x2ee003(0x187)](_0x57cabf),this[_0x2ee003(0xc8)](_0x57cabf),this[_0x2ee003(0x16c)](_0x15cac8,_0x12fd59,_0x2ee003(0x1e8));}[a31_0x10c381(0x187)](_0xef9990){displayRealtimeValidation(_0xef9990);}[a31_0x10c381(0x16c)](_0xc115bf,_0x4ccd89,_0x255708,_0x3b533d){const _0x270f54=a31_0x10c381;console[_0x270f54(0xdd)]('\x0a'+a31_0x343d08[_0x270f54(0x1a7)](_0x270f54(0x1f6)));const _0x3f5906=_0x4ccd89!==_0x270f54(0x206)?_0x270f54(0x8c)+_0x4ccd89:'';if(_0x255708==='attribute'&&_0x3b533d)console[_0x270f54(0xdd)]('\x20\x20'+a31_0x343d08[_0x270f54(0x1a7)](_0x270f54(0x279)+_0xc115bf+_0x270f54(0x26b)+_0x3b533d+'\x22'+_0x3f5906));else{if(_0x255708===_0x270f54(0x239)&&_0x3b533d)console[_0x270f54(0xdd)]('\x20\x20'+a31_0x343d08[_0x270f54(0x1a7)](_0x270f54(0x279)+_0xc115bf+_0x270f54(0x13b)+_0x3b533d+'\x22'+_0x3f5906));else(_0x255708==='attributes'||_0x255708===_0x270f54(0x1e8))&&console[_0x270f54(0xdd)]('\x20\x20'+a31_0x343d08[_0x270f54(0x1a7)]('tdx\x20ps\x20preview\x20'+_0xc115bf+'\x20--attribute\x20\x22<name>\x22'+_0x3f5906));}(_0x255708==='behaviors'||_0x255708===_0x270f54(0x1e8))&&console[_0x270f54(0xdd)]('\x20\x20'+a31_0x343d08[_0x270f54(0x1a7)](_0x270f54(0x279)+_0xc115bf+_0x270f54(0x22e)+_0x3f5906)),_0x255708===_0x270f54(0x1e8)&&console['error']('\x20\x20'+a31_0x343d08[_0x270f54(0x1a7)]('tdx\x20ps\x20preview\x20'+_0xc115bf+'\x20--enriched'+_0x3f5906));}[a31_0x10c381(0x1c5)](_0x19c790){const _0x256ce5=a31_0x10c381,{master:_0x44faa4}=_0x19c790,_0x28de44=_0x44faa4[_0x256ce5(0x121)]?a31_0x343d08[_0x256ce5(0x97)]('✔'):a31_0x343d08['red']('✘');console[_0x256ce5(0xdd)]('\x0a'+a31_0x343d08['dim'](_0x256ce5(0x108))),console[_0x256ce5(0xdd)](_0x28de44+'\x20'+a31_0x343d08[_0x256ce5(0x10a)](_0x44faa4[_0x256ce5(0x127)]+'.'+_0x44faa4[_0x256ce5(0x27e)])),_0x44faa4[_0x256ce5(0x121)]?_0x44faa4[_0x256ce5(0x139)]!==undefined&&console[_0x256ce5(0xdd)]('\x20\x20'+a31_0x343d08[_0x256ce5(0x1a7)](_0x256ce5(0x16f))+'\x20'+a31_0x343d08[_0x256ce5(0x12a)](formatRows(_0x44faa4[_0x256ce5(0x139)]))):console[_0x256ce5(0xdd)]('\x20\x20'+a31_0x343d08[_0x256ce5(0x11b)](_0x256ce5(0xaa))+'\x20'+_0x44faa4[_0x256ce5(0x80)]);}['displayAttributesStats'](_0x31044a){const _0x5337eb=a31_0x10c381;if(_0x31044a[_0x5337eb(0x166)]['length']===0x0)return;console[_0x5337eb(0xdd)]('\x0a'+a31_0x343d08[_0x5337eb(0x1a7)](_0x5337eb(0x12b)));for(const _0x3fb821 of _0x31044a[_0x5337eb(0x166)]){const _0x37062b=_0x3fb821[_0x5337eb(0x121)]?a31_0x343d08[_0x5337eb(0x97)]('✔'):a31_0x343d08[_0x5337eb(0x11b)]('✘');let _0x1986a2='';if(_0x3fb821['schemaValid']&&_0x3fb821[_0x5337eb(0x111)]!==undefined&&_0x3fb821[_0x5337eb(0x14f)]!==undefined){const _0x42ba99=_0x3fb821[_0x5337eb(0x14f)][_0x5337eb(0x1de)](0x1),_0x591dbd=_0x3fb821[_0x5337eb(0x14f)]>=0x50?a31_0x343d08[_0x5337eb(0x97)]:_0x3fb821['coveragePercent']>=0x32?a31_0x343d08[_0x5337eb(0x185)]:a31_0x343d08[_0x5337eb(0x11b)];_0x1986a2='\x20'+a31_0x343d08[_0x5337eb(0x1a7)]('Coverage:')+'\x20'+_0x591dbd(_0x42ba99+'%')+'\x20('+formatRows(_0x3fb821['matchedCount'])+_0x5337eb(0x78);}console[_0x5337eb(0xdd)](_0x37062b+'\x20'+a31_0x343d08[_0x5337eb(0x10a)](_0x3fb821[_0x5337eb(0x23b)])+_0x1986a2),console[_0x5337eb(0xdd)]('\x20\x20'+a31_0x343d08[_0x5337eb(0x1a7)](_0x5337eb(0xa3))+'\x20'+a31_0x343d08[_0x5337eb(0x10a)](_0x3fb821[_0x5337eb(0x127)]+'.'+_0x3fb821[_0x5337eb(0x27e)]));const _0x3cdd2f=_0x3fb821[_0x5337eb(0x14d)]===_0x3fb821[_0x5337eb(0x20a)]?a31_0x343d08[_0x5337eb(0x1a7)](_0x5337eb(0x22c))+'\x20'+_0x3fb821[_0x5337eb(0x14d)]:a31_0x343d08[_0x5337eb(0x1a7)]('Join:')+'\x20'+_0x3fb821[_0x5337eb(0x14d)]+_0x5337eb(0x212)+_0x3fb821[_0x5337eb(0x20a)];console['error']('\x20\x20'+_0x3cdd2f),console[_0x5337eb(0xdd)]('\x20\x20'+a31_0x343d08[_0x5337eb(0x1a7)](_0x5337eb(0xd5))),this[_0x5337eb(0x114)](_0x3fb821[_0x5337eb(0x1e1)]),!_0x3fb821[_0x5337eb(0x121)]&&console[_0x5337eb(0xdd)]('\x20\x20'+a31_0x343d08['red']('Error:')+'\x20'+_0x3fb821[_0x5337eb(0x80)]);}}[a31_0x10c381(0x1eb)](_0x41b017,_0x39bfd0){const _0x7fa835=a31_0x10c381;if(_0x41b017[_0x7fa835(0x70)][_0x7fa835(0x190)]===0x0)return;console['error']('\x0a'+a31_0x343d08[_0x7fa835(0x1a7)](_0x7fa835(0xa5))+'\x20'+a31_0x343d08['dim']('('+_0x39bfd0+')'));for(const _0x16facd of _0x41b017[_0x7fa835(0x70)]){const _0x1038b1=_0x16facd[_0x7fa835(0x121)]?a31_0x343d08['green']('✔'):a31_0x343d08['red']('✘');let _0x6af501='';if(_0x16facd[_0x7fa835(0x121)]&&_0x16facd['customersWithEvents']!==undefined&&_0x16facd[_0x7fa835(0x6a)]!==undefined){const _0x1b6bc7=_0x16facd['customerPercent']?.[_0x7fa835(0x1de)](0x1)||'?',_0x273fe0=(_0x16facd[_0x7fa835(0x174)]??0x0)>=0x32?a31_0x343d08['green']:(_0x16facd[_0x7fa835(0x174)]??0x0)>=0x14?a31_0x343d08['yellow']:a31_0x343d08[_0x7fa835(0x11b)];_0x6af501='\x20'+a31_0x343d08[_0x7fa835(0x1a7)](_0x7fa835(0xe3))+'\x20'+_0x273fe0(formatRows(_0x16facd[_0x7fa835(0x266)]))+'\x20('+_0x1b6bc7+'%)\x20'+a31_0x343d08[_0x7fa835(0x1a7)](_0x7fa835(0x160))+'\x20'+a31_0x343d08['cyan'](formatRows(_0x16facd['totalEvents']));}console[_0x7fa835(0xdd)](_0x1038b1+'\x20'+a31_0x343d08['bold'](_0x16facd['name'])+_0x6af501),console[_0x7fa835(0xdd)]('\x20\x20'+a31_0x343d08[_0x7fa835(0x1a7)]('Source:')+'\x20'+a31_0x343d08[_0x7fa835(0x10a)](_0x16facd[_0x7fa835(0x127)]+'.'+_0x16facd[_0x7fa835(0x27e)]));const _0x13f23a=_0x16facd[_0x7fa835(0x14d)]===_0x16facd['foreignKey']?a31_0x343d08[_0x7fa835(0x1a7)](_0x7fa835(0x22c))+'\x20'+_0x16facd[_0x7fa835(0x14d)]:a31_0x343d08[_0x7fa835(0x1a7)](_0x7fa835(0xf9))+'\x20'+_0x16facd[_0x7fa835(0x14d)]+_0x7fa835(0x212)+_0x16facd[_0x7fa835(0x20a)];console['error']('\x20\x20'+_0x13f23a),console['error']('\x20\x20'+a31_0x343d08[_0x7fa835(0x1a7)]('Columns:')),this[_0x7fa835(0x114)](_0x16facd[_0x7fa835(0x1e1)]),!_0x16facd['schemaValid']&&console['error']('\x20\x20'+a31_0x343d08['red'](_0x7fa835(0xaa))+'\x20'+_0x16facd['schemaError']);}}[a31_0x10c381(0x114)](_0x56c907){const _0x43e2f9=a31_0x10c381;for(const _0x471d2d of _0x56c907){_0x471d2d[_0x43e2f9(0x23d)]===_0x471d2d[_0x43e2f9(0xbd)]||_0x471d2d[_0x43e2f9(0xbd)]==='*'?console[_0x43e2f9(0xdd)](_0x43e2f9(0x1ab)+_0x471d2d['label']):console[_0x43e2f9(0xdd)](_0x43e2f9(0x1ab)+_0x471d2d[_0x43e2f9(0x23d)]+'\x20'+a31_0x343d08[_0x43e2f9(0x1a7)]('('+_0x471d2d['column']+')'));}}[a31_0x10c381(0xc8)](_0x3a0d04){const _0x4767ea=a31_0x10c381;console[_0x4767ea(0xdd)]('─'[_0x4767ea(0x1c1)](0x3c));if(_0x3a0d04[_0x4767ea(0xc0)]['length']>0x0){console[_0x4767ea(0xdd)]('\x0a'+a31_0x343d08[_0x4767ea(0x11b)]('Errors:'));for(const _0x5a1673 of _0x3a0d04[_0x4767ea(0xc0)]){console[_0x4767ea(0xdd)]('\x20\x20'+a31_0x343d08[_0x4767ea(0x11b)]('•')+'\x20'+_0x5a1673);}}_0x3a0d04[_0x4767ea(0x202)]&&console['error']('\x0a'+a31_0x343d08[_0x4767ea(0x97)]('✔')+_0x4767ea(0x234));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0xdf);[a31_0x10c381(0x184)]=a31_0x10c381(0x1fd);async[a31_0x10c381(0xa0)](_0x44efa8){const _0x1458f9=a31_0x10c381,{options:_0x12c47a,args:_0x19112d,tdx:_0x1cc753}=_0x44efa8,_0x32ee13=_0x12c47a,_0x42b1c6=_0x19112d[0x0]||_0x12c47a[_0x1458f9(0x113)];if(!_0x42b1c6)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'+_0x1458f9(0x124)+'Options\x20(one\x20required):\x0a'+_0x1458f9(0x144)+'\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a'+'\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a'+_0x1458f9(0x269)+_0x1458f9(0xd9)),0x1;if(!_0x32ee13['master']&&!_0x32ee13[_0x1458f9(0xf8)]&&!_0x32ee13['behavior']&&!_0x32ee13[_0x1458f9(0x27f)])return console[_0x1458f9(0xdd)](a31_0x343d08[_0x1458f9(0x11b)](_0x1458f9(0xde))),console[_0x1458f9(0xdd)](_0x1458f9(0x237)),console[_0x1458f9(0xdd)](_0x1458f9(0x19a)),console[_0x1458f9(0xdd)](_0x1458f9(0x109)),console[_0x1458f9(0xdd)]('\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute'),console[_0x1458f9(0xdd)](_0x1458f9(0x173)),console[_0x1458f9(0xdd)]('\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data'),0x1;const _0x2488fe=resolveYamlFile(_0x42b1c6);if(!existsSync(_0x2488fe))return showFileNotFoundError(_0x2488fe,_0x42b1c6),0x1;_0x32ee13[_0x1458f9(0x20b)]&&(console['error'](_0x1458f9(0x25d)+_0x32ee13[_0x1458f9(0x201)]),console[_0x1458f9(0xdd)](_0x1458f9(0x12e)+_0x2488fe));let _0x32ed80;try{_0x32ed80=readFileSync(_0x2488fe,_0x1458f9(0x20f));}catch(_0x132a19){const _0x4503d0=_0x132a19 instanceof Error?_0x132a19[_0x1458f9(0x14e)]:String(_0x132a19);return console['error'](_0x1458f9(0x1cf)+_0x4503d0),0x1;}let _0x34607a;try{_0x34607a=parseDef(_0x32ed80);}catch(_0x247ff8){const _0x5447e3=_0x247ff8 instanceof Error?_0x247ff8[_0x1458f9(0x14e)]:String(_0x247ff8);return console[_0x1458f9(0xdd)](a31_0x343d08[_0x1458f9(0x11b)](_0x1458f9(0xb0)+_0x5447e3)),0x1;}if(_0x32ee13[_0x1458f9(0xf8)]===!![]||_0x32ee13[_0x1458f9(0xf8)]===''){const _0x2d2c17=_0x34607a['attributes']?.['map'](_0x5501f6=>_0x5501f6['name'])||[];if(_0x2d2c17[_0x1458f9(0x190)]===0x0)console[_0x1458f9(0xdd)](a31_0x343d08['red']('Error:\x20No\x20attributes\x20defined\x20in\x20configuration'));else{console[_0x1458f9(0xdd)](a31_0x343d08[_0x1458f9(0x11b)](_0x1458f9(0x183))),console[_0x1458f9(0xdd)](_0x1458f9(0x217));for(const _0x4d315a of _0x2d2c17){console[_0x1458f9(0xdd)]('\x20\x20'+a31_0x343d08['cyan'](_0x4d315a));}console[_0x1458f9(0xdd)]('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0x42b1c6+'\x20--attribute\x20\x22'+_0x2d2c17[0x0]+'\x22');}return 0x1;}if(_0x32ee13[_0x1458f9(0x239)]===!![]||_0x32ee13[_0x1458f9(0x239)]===''){const _0x3f2e3a=_0x34607a['behaviors']?.['map'](_0x6f6ba7=>_0x6f6ba7[_0x1458f9(0x23b)])||[];if(_0x3f2e3a[_0x1458f9(0x190)]===0x0)console[_0x1458f9(0xdd)](a31_0x343d08[_0x1458f9(0x11b)](_0x1458f9(0x21a)));else{console[_0x1458f9(0xdd)](a31_0x343d08[_0x1458f9(0x11b)]('Error:\x20--behavior\x20requires\x20a\x20name\x0a')),console[_0x1458f9(0xdd)]('Available\x20behaviors:');for(const _0x5b9b0c of _0x3f2e3a){console[_0x1458f9(0xdd)]('\x20\x20'+a31_0x343d08[_0x1458f9(0x12a)](_0x5b9b0c));}console[_0x1458f9(0xdd)](_0x1458f9(0x12f)+_0x42b1c6+_0x1458f9(0x13b)+_0x3f2e3a[0x0]+'\x22');}return 0x1;}const _0x32468c=createCommandSpinner(a31_0x343d08[_0x1458f9(0x1a7)](_0x1458f9(0x1b8)),{'verbose':_0x32ee13[_0x1458f9(0x20b)]});_0x32468c[_0x1458f9(0x134)]();const _0x32d7c5={'onProgress':_0xd559ca=>{const _0xbb0b11=_0x1458f9;_0x32468c[_0xbb0b11(0xf0)]=formatProgressMessage(_0xd559ca);}};if(_0x32ee13[_0x1458f9(0x77)])_0x32d7c5['master']=!![];if(_0x32ee13['attribute']&&typeof _0x32ee13['attribute']===_0x1458f9(0x6d))_0x32d7c5['attribute']=_0x32ee13[_0x1458f9(0xf8)];if(_0x32ee13[_0x1458f9(0x239)]&&typeof _0x32ee13[_0x1458f9(0x239)]==='string')_0x32d7c5[_0x1458f9(0x239)]=_0x32ee13[_0x1458f9(0x239)];if(_0x32ee13[_0x1458f9(0x27f)])_0x32d7c5[_0x1458f9(0x27f)]=!![];if(_0x32ee13[_0x1458f9(0x1f4)])_0x32d7c5[_0x1458f9(0x1f4)]=_0x32ee13['interval'];let _0x2d3e8c;try{_0x2d3e8c=await _0x1cc753[_0x1458f9(0x209)][_0x1458f9(0x1c2)](_0x32ed80,_0x32d7c5),_0x32468c[_0x1458f9(0xf6)]();}catch(_0x587d24){_0x32468c[_0x1458f9(0xf6)]();throw _0x587d24;}return await this[_0x1458f9(0x7e)](_0x2d3e8c,{'master':_0x32ee13[_0x1458f9(0x77)],'attribute':typeof _0x32ee13[_0x1458f9(0xf8)]==='string'?_0x32ee13['attribute']:undefined,'behavior':typeof _0x32ee13['behavior']==='string'?_0x32ee13[_0x1458f9(0x239)]:undefined,'enriched':_0x32ee13[_0x1458f9(0x27f)]}),_0x2d3e8c[_0x1458f9(0x202)]?0x0:0x1;}async[a31_0x10c381(0x7e)](_0x77abfe,_0x1d111d){const _0x5429ac=a31_0x10c381;console['error']('\x0a'+a31_0x343d08[_0x5429ac(0x10a)](_0x5429ac(0x1c6))+'\x20'+_0x77abfe['name']),console[_0x5429ac(0xdd)]('═'[_0x5429ac(0x1c1)](0x3c));if(_0x1d111d[_0x5429ac(0x77)]&&_0x77abfe[_0x5429ac(0x226)]){const _0x4ce067=a31_0x343d08[_0x5429ac(0x1a7)](_0x5429ac(0x242))+'\x20'+a31_0x343d08[_0x5429ac(0x10a)](_0x77abfe['master'][_0x5429ac(0x127)]+'.'+_0x77abfe[_0x5429ac(0x77)][_0x5429ac(0x27e)]);await this[_0x5429ac(0x125)](_0x4ce067,_0x77abfe['sampleData']);}else{if(_0x1d111d[_0x5429ac(0xf8)]&&_0x77abfe['sampleData']){const _0x3417c8=a31_0x343d08[_0x5429ac(0x1a7)](_0x5429ac(0x10c))+'\x20'+a31_0x343d08[_0x5429ac(0x10a)](_0x1d111d[_0x5429ac(0xf8)]);await this[_0x5429ac(0x125)](_0x3417c8,_0x77abfe['sampleData']);}else{if(_0x1d111d[_0x5429ac(0x239)]&&_0x77abfe[_0x5429ac(0x226)]){const _0x2f318d=a31_0x343d08[_0x5429ac(0x1a7)]('Behavior:')+'\x20'+a31_0x343d08[_0x5429ac(0x10a)](_0x1d111d[_0x5429ac(0x239)]);await this['displaySampleData'](_0x2f318d,_0x77abfe[_0x5429ac(0x226)]);}else{if(_0x1d111d[_0x5429ac(0x27f)]&&_0x77abfe[_0x5429ac(0x226)]){const _0x59d38e=a31_0x343d08[_0x5429ac(0x1a7)](_0x5429ac(0x85))+'\x20'+a31_0x343d08['bold']('Master\x20+\x20Attributes');await this[_0x5429ac(0x125)](_0x59d38e,_0x77abfe['sampleData']);}else!_0x77abfe[_0x5429ac(0x226)]&&console[_0x5429ac(0xdd)](_0x5429ac(0x151));}}}if(_0x77abfe[_0x5429ac(0xc0)][_0x5429ac(0x190)]>0x0){console[_0x5429ac(0xdd)]('─'[_0x5429ac(0x1c1)](0x3c)),console['error']('\x0a'+a31_0x343d08[_0x5429ac(0x11b)](_0x5429ac(0x163)));for(const _0x1d1a69 of _0x77abfe['errors']){console['error']('\x20\x20'+a31_0x343d08[_0x5429ac(0x11b)]('•')+'\x20'+_0x1d1a69);}}}async['displaySampleData'](_0x1899ea,_0x3c7bc6){const _0x3f44e2=a31_0x10c381;if(_0x3c7bc6[_0x3f44e2(0x190)]===0x0){console[_0x3f44e2(0xdd)]('\x0a'+_0x1899ea),console[_0x3f44e2(0xdd)](_0x3f44e2(0x17d));return;}console[_0x3f44e2(0xdd)]('\x0a'+_0x1899ea);const _0x1437b6=Object[_0x3f44e2(0x93)](_0x3c7bc6[0x0])['map'](_0x930ba4=>({'name':_0x930ba4,'type':typeof _0x3c7bc6[0x0][_0x930ba4]===_0x3f44e2(0x1e5)?_0x3f44e2(0x1a6):_0x3f44e2(0x9d)})),_0x835ce4={'queryId':'preview','columns':_0x1437b6,'data':_0x3c7bc6,'stats':{'state':_0x3f44e2(0x1b7),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x3c7bc6[_0x3f44e2(0x190)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x5add35=formatAsTable(_0x835ce4,_0x3c7bc6[_0x3f44e2(0x190)],!![]);await writeOutput(_0x5add35,undefined,'table');}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0x8a);[a31_0x10c381(0x184)]=a31_0x10c381(0x6b);async[a31_0x10c381(0xa0)](_0x335d89){const _0x4c169f=a31_0x10c381,{options:_0x6e259d,args:_0x51b9b7,tdx:_0x26eff8}=_0x335d89,_0x2447f8=_0x6e259d,_0xe5ca08=_0x51b9b7[0x0]||_0x6e259d[_0x4c169f(0x113)];if(!_0xe5ca08)return showParentSegmentNotSetError(_0x4c169f(0x18e)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment'),0x1;const _0x2def5b=resolveYamlFile(_0xe5ca08);if(existsSync(_0x2def5b)){_0x2447f8['verbose']&&console[_0x4c169f(0xdd)](_0x4c169f(0xd0)+_0x2def5b);let _0x18ea26;try{_0x18ea26=readFileSync(_0x2def5b,_0x4c169f(0x20f));}catch(_0x270f74){const _0x1e6b59=_0x270f74 instanceof Error?_0x270f74[_0x4c169f(0x14e)]:String(_0x270f74);return console[_0x4c169f(0xdd)]('Error\x20reading\x20file:\x20'+_0x1e6b59),0x1;}const _0x215205=await withSpinner('Analyzing\x20changes...',()=>_0x26eff8[_0x4c169f(0x209)][_0x4c169f(0xce)](_0x18ea26),{'verbose':_0x2447f8['verbose']}),_0x212929=_0x215205[_0x4c169f(0x8b)],{isNew:_0x49c254,name:_0x4c71a4,hasChanges:_0xa209f2,diffFormatted:_0x466939}=_0x212929;if(_0xa209f2){_0x49c254?console[_0x4c169f(0xdd)](_0x4c169f(0xcb)+_0x4c71a4+'\x27:'):console['error']('\x0aChanges\x20to\x20apply\x20to\x20\x27'+_0x4c71a4+'\x27:');console[_0x4c169f(0xdd)]('─'[_0x4c169f(0x1c1)](0x3c)),console[_0x4c169f(0xdd)](_0x466939),console[_0x4c169f(0xdd)]('─'[_0x4c169f(0x1c1)](0x3c));const _0x1d108e=_0x49c254?'Create\x20parent\x20segment\x20\x27'+_0x4c71a4+'\x27\x20and\x20run\x20workflow?':_0x4c169f(0xb7)+_0x4c71a4+_0x4c169f(0xee);if(!_0x2447f8['yes']){if(!isInteractive())return console['error'](a31_0x343d08[_0x4c169f(0x11b)]('\x0aError:'),_0x4c169f(0x1b0)),console[_0x4c169f(0xdd)](a31_0x343d08[_0x4c169f(0x1a7)](_0x4c169f(0x182))),0x1;const _0x36c1b4=await confirmKey(_0x1d108e);if(!_0x36c1b4)return console[_0x4c169f(0xdd)](a31_0x343d08[_0x4c169f(0x185)](_0x4c169f(0x1ae))),0x1;}const _0x1de1c5=_0x49c254?_0x4c169f(0x147):_0x4c169f(0x1a4);await withSpinner(_0x1de1c5+_0x4c169f(0x199)+_0x4c71a4+_0x4c169f(0x169),()=>_0x212929['apply'](),{'verbose':_0x2447f8[_0x4c169f(0x20b)]});const _0x270001=_0x49c254?_0x4c169f(0x21e):'Updated';console[_0x4c169f(0xdd)]('✔\x20'+_0x270001+_0x4c169f(0x199)+_0x4c71a4+'\x27');}else console[_0x4c169f(0xdd)](_0x4c169f(0x1e6)+_0x4c71a4+_0x4c169f(0xb8));}const _0xdfb9d0=await withSpinner(_0x4c169f(0x257)+_0xe5ca08+_0x4c169f(0x169),()=>_0x26eff8[_0x4c169f(0x209)][_0x4c169f(0x1d4)](_0xe5ca08),{'verbose':_0x2447f8[_0x4c169f(0x20b)]}),_0x199606=_0xdfb9d0['data'],_0x341710=getConsoleUrl(_0x2447f8['site'],_0x4c169f(0x179)+_0x199606[_0x4c169f(0xf2)]+_0x4c169f(0x10f)+_0x199606[_0x4c169f(0x172)]+_0x4c169f(0x22a)+_0x199606[_0x4c169f(0x271)]);return console[_0x4c169f(0xdd)]('\x0a✔\x20Workflow\x20started'),console['error']('\x20\x20'+a31_0x343d08[_0x4c169f(0x1a7)](_0x4c169f(0xec))+'\x20'+_0x199606[_0x4c169f(0x75)]),console[_0x4c169f(0xdd)]('\x20\x20'+a31_0x343d08[_0x4c169f(0x1a7)](_0x4c169f(0x171))+'\x20'+_0x199606[_0x4c169f(0xab)]),console[_0x4c169f(0xdd)]('\x20\x20'+a31_0x343d08['dim'](_0x4c169f(0xd2))+'\x20'+_0x199606['workflowSessionId']),console[_0x4c169f(0xdd)]('\x20\x20'+a31_0x343d08[_0x4c169f(0x1a7)](_0x4c169f(0xa8))+'\x20'+_0x199606[_0x4c169f(0x271)]),console[_0x4c169f(0xdd)]('\x20\x20'+_0x341710),console[_0x4c169f(0xdd)]('\x0a'+a31_0x343d08['dim']('To\x20cancel:')+'\x20tdx\x20wf\x20attempt\x20'+_0x199606[_0x4c169f(0x271)]+_0x4c169f(0xcc)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0x1ba);[a31_0x10c381(0x184)]=a31_0x10c381(0x105);async[a31_0x10c381(0xa0)](_0x52e1ff){const _0x2a8514=a31_0x10c381,{options:_0x30f9e3,args:_0x5e3599,tdx:_0x52078f}=_0x52e1ff,_0x221fe7=_0x5e3599[0x0]||_0x30f9e3['parentSegment'];if(!_0x221fe7)return showParentSegmentNotSetError(_0x2a8514(0x200)+_0x2a8514(0xbb)),0x1;_0x30f9e3[_0x2a8514(0x20b)]&&(console[_0x2a8514(0xdd)](_0x2a8514(0x25d)+_0x30f9e3[_0x2a8514(0x201)]),console[_0x2a8514(0xdd)](_0x2a8514(0x224)+_0x221fe7));const _0x2429e0=await withSpinner(_0x2a8514(0xa6)+_0x221fe7+_0x2a8514(0x169),()=>_0x52078f[_0x2a8514(0x209)][_0x2a8514(0x9e)](_0x221fe7),{'verbose':_0x30f9e3[_0x2a8514(0x20b)]}),_0x596ded=_0x2429e0[_0x2a8514(0x8b)];console['error'](_0x2a8514(0x227)+_0x596ded[_0x2a8514(0x190)]+_0x2a8514(0x264)+(_0x596ded[_0x2a8514(0x190)]!==0x1?'s':''));if(_0x30f9e3[_0x2a8514(0x22f)]||_0x30f9e3[_0x2a8514(0xd1)])return await handleSDKOutput(_0x596ded,_0x30f9e3),0x0;return displayFieldsHumanReadable(_0x596ded,_0x221fe7),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{['name']=a31_0x10c381(0x1d7);[a31_0x10c381(0x184)]=a31_0x10c381(0x270);async['execute'](_0x353f90){const _0x318124=a31_0x10c381,{options:_0x2bc0b0,args:_0x4aeacb,tdx:_0x480c32}=_0x353f90,_0x37defb=_0x2bc0b0,_0x8fea50=_0x4aeacb[0x0]||_0x2bc0b0[_0x318124(0x113)];if(!_0x8fea50)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'+_0x318124(0x278)+'Options:\x0a'+_0x318124(0x20c)),0x1;_0x2bc0b0['verbose']&&(console['error'](_0x318124(0x25d)+_0x2bc0b0[_0x318124(0x201)]),console[_0x318124(0xdd)](_0x318124(0x224)+_0x8fea50));const _0x4aed97=await withSpinner(_0x318124(0xa9)+_0x8fea50+'\x27...',()=>_0x480c32[_0x318124(0x209)]['getParentFull'](_0x8fea50),{'verbose':_0x2bc0b0['verbose']}),_0x2ef3b9=_0x4aed97[_0x318124(0x8b)];if(_0x37defb[_0x318124(0xa4)]){const _0x2f2274=getConsoleNextUrl(_0x37defb[_0x318124(0x201)],_0x318124(0x13d)+_0x2ef3b9['id']);return console['error'](a31_0x343d08[_0x318124(0x97)]('✔')+_0x318124(0x1fb)+a31_0x343d08[_0x318124(0x12a)](_0x2f2274)),openBrowser(_0x2f2274),0x0;}return await handleSingleObjectOutput(_0x2ef3b9,_0x2bc0b0),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{['name']='segment:parent:desc';[a31_0x10c381(0x184)]=a31_0x10c381(0x26c);async[a31_0x10c381(0xa0)](_0x4c4d50){const _0x23b122=a31_0x10c381,{options:_0x93b121,args:_0x4098ea,tdx:_0x1ecf2e}=_0x4c4d50,_0x428f7d=_0x93b121,_0x428147=_0x4098ea[0x0]||_0x93b121[_0x23b122(0x113)];if(!_0x428147)return showParentSegmentNotSetError(_0x23b122(0xd6)+_0x23b122(0x238)+'Options:\x0a'+_0x23b122(0x247)),0x1;_0x93b121[_0x23b122(0x20b)]&&(console[_0x23b122(0xdd)](_0x23b122(0x25d)+_0x93b121[_0x23b122(0x201)]),console[_0x23b122(0xdd)](_0x23b122(0x224)+_0x428147));const _0x591c0a=await withSpinner(_0x23b122(0x252)+_0x428147+_0x23b122(0x169),()=>_0x1ecf2e[_0x23b122(0x209)][_0x23b122(0x13a)](_0x428147),{'verbose':_0x93b121[_0x23b122(0x20b)]}),_0x3620f3=_0x591c0a[_0x23b122(0x8b)],_0x1e3b9c=_0x1ecf2e[_0x23b122(0x209)][_0x23b122(0x268)](_0x3620f3);if(_0x428f7d[_0x23b122(0x1f5)]){const _0x1b65b0=await this[_0x23b122(0x157)](_0x4c4d50,_0x428147,_0x3620f3,_0x1e3b9c),_0x529d39=this[_0x23b122(0x8f)](_0x1b65b0);writeFileSync(_0x428f7d[_0x23b122(0x1f5)],_0x529d39);const _0x13fdec=_0x1b65b0[_0x23b122(0x141)]['columns']['length']+_0x1b65b0[_0x23b122(0x70)]['reduce']((_0x43a1f6,_0x4fd031)=>_0x43a1f6+_0x4fd031[_0x23b122(0x1e1)][_0x23b122(0x190)],0x0),_0x362f41=_0x1b65b0[_0x23b122(0x70)][_0x23b122(0xe0)](_0x26c352=>_0x26c352[_0x23b122(0x1e1)][_0x23b122(0x190)]===0x0)['length'];return console[_0x23b122(0x1db)](_0x23b122(0xf7)+_0x428f7d[_0x23b122(0x1f5)]),console[_0x23b122(0x1db)](_0x23b122(0x10b)+_0x1e3b9c),console['log']('\x20\x20Tables:\x201\x20customers\x20+\x20'+_0x1b65b0[_0x23b122(0x70)][_0x23b122(0x190)]+_0x23b122(0x21f)),console[_0x23b122(0x1db)](_0x23b122(0xc6)+_0x13fdec+'\x20total'),_0x362f41>0x0&&console[_0x23b122(0x1db)](_0x23b122(0x14b)+_0x362f41+_0x23b122(0x228)),0x0;}console[_0x23b122(0xdd)]('\x0a'+a31_0x343d08[_0x23b122(0x10a)]('Output\x20Database:')+'\x20'+a31_0x343d08[_0x23b122(0x12a)](_0x1e3b9c));const _0x32b90c=await withSpinner(_0x23b122(0x23c),()=>_0x1ecf2e[_0x23b122(0x209)][_0x23b122(0x1c4)](_0x3620f3),{'verbose':_0x93b121[_0x23b122(0x20b)]});console[_0x23b122(0xdd)]('\x0a'+a31_0x343d08[_0x23b122(0x10a)]('customers')+'\x20'+a31_0x343d08[_0x23b122(0x1a7)]('('+_0x1e3b9c+_0x23b122(0x87)));const _0x4ebcb7=await executeSchemaQuery(_0x32b90c[_0x23b122(0x8b)],_0x1ecf2e,_0x93b121);await handleQueryOutput(_0x4ebcb7,_0x93b121);const _0x303d29=await withSpinner('Fetching\x20behavior\x20list...',()=>_0x1ecf2e[_0x23b122(0x209)][_0x23b122(0x24e)](_0x3620f3),{'verbose':_0x93b121[_0x23b122(0x20b)]});for(const _0x3e9c41 of _0x303d29[_0x23b122(0x8b)]){const _0x425d64='behavior_'+_0x3e9c41[_0x23b122(0x198)]()['replace'](/\s+/g,'_'),_0x27e650=_0x23b122(0x272)+_0x1e3b9c+'.'+_0x425d64;console[_0x23b122(0xdd)]('\x0a'+a31_0x343d08[_0x23b122(0x10a)](_0x3e9c41)+'\x20'+a31_0x343d08[_0x23b122(0x1a7)]('('+_0x1e3b9c+'.'+_0x425d64+')'));try{const _0x5f2453=await executeSchemaQuery(_0x27e650,_0x1ecf2e,_0x93b121);await handleQueryOutput(_0x5f2453,_0x93b121);}catch{console['error'](a31_0x343d08['yellow'](_0x23b122(0x19d)));}}return 0x0;}async[a31_0x10c381(0x157)](_0x4a80ab,_0xec355c,_0x402939,_0x50efad){const _0x222dc3=a31_0x10c381,{options:_0x35209c,tdx:_0x4add41}=_0x4a80ab,_0x499e5d=await withSpinner(_0x222dc3(0x23c),()=>_0x4add41[_0x222dc3(0x209)][_0x222dc3(0x1c4)](_0x402939),{'verbose':_0x35209c[_0x222dc3(0x20b)]}),_0xc67c56=await executeSchemaQuery(_0x499e5d[_0x222dc3(0x8b)],_0x4add41,_0x35209c),_0x28c57d=_0xc67c56[_0x222dc3(0x8b)][_0x222dc3(0xe9)](_0x295c8f=>({'name':_0x295c8f['column_name'],'type':_0x295c8f['column_type']})),_0x2b1700=await withSpinner(_0x222dc3(0x129),()=>_0x4add41[_0x222dc3(0x209)][_0x222dc3(0x24e)](_0x402939),{'verbose':_0x35209c['verbose']}),_0x2ee692=[];for(const _0x4d0b95 of _0x2b1700[_0x222dc3(0x8b)]){const _0x328d2f=_0x222dc3(0x1d2)+_0x4d0b95[_0x222dc3(0x198)]()[_0x222dc3(0x15f)](/\s+/g,'_'),_0x3714e9='SELECT\x20*\x20FROM\x20'+_0x50efad+'.'+_0x328d2f;let _0x1d4dc6=[];try{const _0x3f2955=await executeSchemaQuery(_0x3714e9,_0x4add41,_0x35209c);_0x1d4dc6=_0x3f2955[_0x222dc3(0x8b)][_0x222dc3(0xe9)](_0x231c0a=>({'name':_0x231c0a[_0x222dc3(0x20e)],'type':_0x231c0a[_0x222dc3(0x1f2)]}));}catch{}_0x2ee692[_0x222dc3(0x188)]({'table':_0x328d2f,'columns':_0x1d4dc6});}return{'database':_0x50efad,'parent_segment':_0xec355c,'parent_id':_0x402939,'customers':{'table':_0x222dc3(0x141),'columns':_0x28c57d},'behaviors':_0x2ee692};}['formatSchemaJson'](_0x4f71b3){const _0x557e6a=a31_0x10c381,_0x2e920e=_0x53a27c=>{const _0x3b63db=a31_0xc607;if(_0x53a27c[_0x3b63db(0x190)]===0x0)return'[]';const _0x5c9f07=_0x53a27c[_0x3b63db(0xe9)](_0x3529e0=>_0x3b63db(0x143)+_0x3529e0[_0x3b63db(0x23b)]+_0x3b63db(0x13f)+_0x3529e0['type']+_0x3b63db(0x1be));return'[\x0a'+_0x5c9f07['join'](',\x0a')+_0x3b63db(0x221);},_0x52d359=_0x4f71b3[_0x557e6a(0x70)][_0x557e6a(0xe9)](_0x20e1b3=>{const _0x402508=_0x557e6a;return _0x402508(0x1bb)+_0x20e1b3[_0x402508(0x27e)]+_0x402508(0x165)+_0x2e920e(_0x20e1b3['columns'])['replace'](/^/gm,'\x20\x20')[_0x402508(0x107)]()+'\x0a\x20\x20\x20\x20}';})[_0x557e6a(0xa1)](',\x0a');return _0x557e6a(0x259)+_0x4f71b3[_0x557e6a(0x127)]+_0x557e6a(0x24f)+_0x4f71b3[_0x557e6a(0x27d)]+_0x557e6a(0x232)+_0x4f71b3[_0x557e6a(0x84)]+_0x557e6a(0x26d)+_0x4f71b3[_0x557e6a(0x141)][_0x557e6a(0x27e)]+_0x557e6a(0xd3)+_0x2e920e(_0x4f71b3[_0x557e6a(0x141)]['columns'])[_0x557e6a(0x15f)](/^/gm,'\x20\x20')['trim']()+'\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a'+_0x52d359+_0x557e6a(0x17e);}}export class ParentSegmentSQLCommand extends BaseCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0x10e);[a31_0x10c381(0x184)]=a31_0x10c381(0x25b);async['execute'](_0x3118b8){const _0xc511a5=a31_0x10c381,{options:_0xbd78e8,args:_0x358d30,tdx:_0x104cfe}=_0x3118b8,_0x53a9de=_0x358d30[0x0]||_0xbd78e8[_0xc511a5(0x113)];if(!_0x53a9de)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'+_0xc511a5(0x21b)),0x1;_0xbd78e8[_0xc511a5(0x20b)]&&(console[_0xc511a5(0xdd)](_0xc511a5(0x25d)+_0xbd78e8[_0xc511a5(0x201)]),console['error'](_0xc511a5(0x224)+_0x53a9de));const _0x35c3c7=await withSpinner(_0xc511a5(0x252)+_0x53a9de+_0xc511a5(0x169),()=>_0x104cfe[_0xc511a5(0x209)]['resolveParentId'](_0x53a9de),{'verbose':_0xbd78e8[_0xc511a5(0x20b)]}),_0x3d1be8=_0x35c3c7[_0xc511a5(0x8b)],_0x52306f=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x53a9de+_0xc511a5(0x169),()=>_0x104cfe[_0xc511a5(0x209)][_0xc511a5(0x1c4)](_0x3d1be8),{'verbose':_0xbd78e8[_0xc511a5(0x20b)]}),_0x1d4e19=_0x52306f[_0xc511a5(0x8b)];return _0xbd78e8['format']===_0xc511a5(0x22f)||_0xbd78e8[_0xc511a5(0x6f)]===_0xc511a5(0xd1)?await handleSDKOutput([{'sql':_0x1d4e19}],_0xbd78e8):console[_0xc511a5(0x1db)](_0x1d4e19),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{['name']=a31_0x10c381(0x1ed);[a31_0x10c381(0x184)]='Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results';async[a31_0x10c381(0xa0)](_0x44cbb5){const _0x4d97b6=a31_0x10c381,{options:_0x536f51,args:_0x56e795,tdx:_0x41d497}=_0x44cbb5,_0x42bda3=_0x56e795[0x0]||_0x536f51[_0x4d97b6(0x113)];if(!_0x42bda3)return showParentSegmentNotSetError(_0x4d97b6(0x1ad)+'\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;_0x536f51[_0x4d97b6(0x20b)]&&(console[_0x4d97b6(0xdd)](_0x4d97b6(0x25d)+_0x536f51[_0x4d97b6(0x201)]),console[_0x4d97b6(0xdd)]('Parent\x20segment:\x20'+_0x42bda3));const _0x124ce2=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x42bda3+_0x4d97b6(0x169),()=>_0x41d497[_0x4d97b6(0x209)][_0x4d97b6(0x13a)](_0x42bda3),{'verbose':_0x536f51[_0x4d97b6(0x20b)]}),_0x48ca78=_0x124ce2[_0x4d97b6(0x8b)],_0x5b15a1=await withSpinner(_0x4d97b6(0x116)+_0x42bda3+_0x4d97b6(0x169),()=>_0x41d497[_0x4d97b6(0x209)][_0x4d97b6(0x1c4)](_0x48ca78),{'verbose':_0x536f51[_0x4d97b6(0x20b)]});let _0x406b20=_0x5b15a1[_0x4d97b6(0x8b)];const _0x1828e7=resolveLimit(_0x536f51[_0x4d97b6(0x244)],DEFAULT_DISPLAY_LIMIT),_0x35390c=/\bLIMIT\s+\d+/i[_0x4d97b6(0x1f7)](_0x406b20);!_0x35390c&&(_0x406b20=_0x406b20[_0x4d97b6(0x107)]()[_0x4d97b6(0x15f)](/;+$/,''),_0x406b20=_0x4d97b6(0xd7)+_0x406b20+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x1828e7);_0x536f51[_0x4d97b6(0x20b)]&&console[_0x4d97b6(0xdd)](_0x4d97b6(0x230)+_0x406b20);const _0x236f44=await withProgressSpinner(_0x4d97b6(0x106),async _0x311afb=>{const _0x5e00a6=_0x4d97b6,_0x3d2a8a=await _0x41d497[_0x5e00a6(0x27c)][_0x5e00a6(0xa0)](_0x406b20,{'catalog':'td','schema':'information_schema','onJobId':_0x513ec8=>{const _0x250ed1=_0x5e00a6;_0x311afb[_0x250ed1(0x6e)](_0x513ec8);}});return _0x3d2a8a;},{'verbose':_0x536f51[_0x4d97b6(0x20b)]}),_0xaf7573=_0x236f44[_0x4d97b6(0x8b)],_0x5cbb8e=_0xaf7573[_0x4d97b6(0x197)]?_0x4d97b6(0x1a9)+_0xaf7573['jobId']+']':'';return console['error']('✔\x20Query\x20completed:\x20Processed\x20'+_0xaf7573[_0x4d97b6(0x22b)][_0x4d97b6(0xe2)][_0x4d97b6(0x18f)]()+_0x4d97b6(0xa2)+(_0x4d97b6(0xb9)+formatElapsed(_0xaf7573[_0x4d97b6(0x22b)]['elapsedTimeMillis'])+_0x5cbb8e)),await handleQueryOutput(_0xaf7573,_0x536f51),0x0;}}export class PSRtListCommand extends BaseCommand{[a31_0x10c381(0x23b)]='ps:rt:list';[a31_0x10c381(0x184)]=a31_0x10c381(0x243);async['execute'](_0x33ffef){const _0x158950=a31_0x10c381,{options:_0x5b8526,args:_0x581243,tdx:_0x4dabc1}=_0x33ffef,_0x443136=_0x581243[0x0],_0x1e0121=await withSpinner(_0x443136?_0x158950(0x223)+_0x443136+'\x27...':_0x158950(0xc1),()=>_0x4dabc1[_0x158950(0x193)][_0x158950(0xb1)](),{'verbose':_0x5b8526[_0x158950(0x20b)]});let _0x364e25=_0x1e0121[_0x158950(0x8b)][_0x158950(0xe0)](_0xb93c79=>_0xb93c79['realtime_enabled']);if(_0x443136){const _0x2a8322=_0x443136[_0x158950(0x15f)](/[.+^${}()|[\]\\]/g,'\x5c$&')['replace'](/\*/g,'.*')['replace'](/\?/g,'.'),_0x3633a0=new RegExp('^'+_0x2a8322+'$','i');_0x364e25=_0x364e25['filter'](_0x2da970=>_0x3633a0['test'](_0x2da970[_0x158950(0x23b)]));}_0x364e25[_0x158950(0x1c3)]((_0x4c7553,_0x1d2d7c)=>_0x4c7553[_0x158950(0x23b)][_0x158950(0x19e)](_0x1d2d7c['name'])),console['error'](_0x158950(0x227)+_0x364e25[_0x158950(0x190)]+_0x158950(0x258)+(_0x364e25['length']!==0x1?'s':''));const _0x2d10b6=_0x56441b=>{const _0x297ebd=_0x158950;return getConsoleNextUrl(_0x5b8526[_0x297ebd(0x201)],_0x297ebd(0x13d)+_0x56441b);};if(_0x5b8526['format']===_0x158950(0x22f)||_0x5b8526[_0x158950(0x6f)]===_0x158950(0xd1)){const _0x5e6cac=_0x364e25[_0x158950(0xe9)](_0x50d8d7=>({..._0x50d8d7,'url':_0x2d10b6(_0x50d8d7['id'])}));await handleSDKOutput(_0x5e6cac,_0x5b8526);}else{if(_0x364e25[_0x158950(0x190)]===0x0)console[_0x158950(0x1db)](_0x158950(0x1f9));else for(const _0x595944 of _0x364e25){const _0x40ad02=_0x595944[_0x158950(0x19b)]?a31_0x343d08[_0x158950(0x1a7)]('\x20('+formatRows(_0x595944['population'])+')'):'',_0x38dc73=hyperlink(_0x595944[_0x158950(0x23b)],_0x2d10b6(_0x595944['id']));console[_0x158950(0x1db)]('⚡\x20'+_0x38dc73+_0x40ad02);}}return 0x0;}}export class PSRtValidateCommand extends BaseParentSegmentCommand{['name']=a31_0x10c381(0x76);[a31_0x10c381(0x184)]=a31_0x10c381(0x1cb);async[a31_0x10c381(0xa0)](_0x5565bf){const _0xc48a0a=a31_0x10c381,{options:_0x2181ec,args:_0x21f5c9,tdx:_0x4b618e}=_0x5565bf,_0x3e0c25=_0x21f5c9[0x0]||_0x2181ec[_0xc48a0a(0x113)];if(!_0x3e0c25)return showParentSegmentNotSetError(_0xc48a0a(0x24c)+_0xc48a0a(0x27a)),0x1;const _0x353b51=resolveYamlFile(_0x3e0c25);if(!existsSync(_0x353b51))return showFileNotFoundError(_0x353b51,_0x3e0c25),0x1;let _0x21c479;try{_0x21c479=readFileSync(_0x353b51,_0xc48a0a(0x20f));}catch(_0x1a9d2c){const _0x364746=_0x1a9d2c instanceof Error?_0x1a9d2c['message']:String(_0x1a9d2c);return console[_0xc48a0a(0xdd)](_0xc48a0a(0x1cf)+_0x364746),0x1;}const _0x1740c4=createCommandSpinner(a31_0x343d08[_0xc48a0a(0x1a7)](_0xc48a0a(0x1bf)),{'verbose':_0x2181ec[_0xc48a0a(0x20b)]});_0x1740c4[_0xc48a0a(0x134)]();const _0x4f729a={'realtime':!![],'onProgress':_0xd5f8f8=>{_0x1740c4['text']=formatProgressMessage(_0xd5f8f8);}};let _0x3ee981;try{_0x3ee981=await _0x4b618e['segment'][_0xc48a0a(0x13e)](_0x21c479,_0x4f729a),_0x1740c4['stop']();}catch(_0x4df603){_0x1740c4[_0xc48a0a(0xf6)]();throw _0x4df603;}console[_0xc48a0a(0xdd)]('\x0a'+a31_0x343d08[_0xc48a0a(0x10a)](_0xc48a0a(0x26a))+'\x20'+_0x3ee981[_0xc48a0a(0x23b)]),console[_0xc48a0a(0xdd)]('═'['repeat'](0x3c)),displayRealtimeValidation(_0x3ee981),console[_0xc48a0a(0xdd)]('─'[_0xc48a0a(0x1c1)](0x3c));if(_0x3ee981['errors']['length']>0x0){console[_0xc48a0a(0xdd)]('\x0a'+a31_0x343d08[_0xc48a0a(0x11b)](_0xc48a0a(0x163)));for(const _0x1f8311 of _0x3ee981[_0xc48a0a(0xc0)]){console['error']('\x20\x20'+a31_0x343d08['red']('•')+'\x20'+_0x1f8311);}}return _0x3ee981['allValid']&&console[_0xc48a0a(0xdd)]('\x0a'+a31_0x343d08[_0xc48a0a(0x97)]('✔')+'\x20RT\x20configuration\x20is\x20valid'),_0x3ee981[_0xc48a0a(0x202)]?0x0:0x1;}}export class PSRtJnListCommand extends BaseCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0x7c);[a31_0x10c381(0x184)]=a31_0x10c381(0xda);async[a31_0x10c381(0xa0)](_0x432e06){const _0x58c637=a31_0x10c381,{options:_0x33bd60,args:_0x572f0d,tdx:_0x2a358b}=_0x432e06,_0x445b63=_0x572f0d[0x0]||_0x33bd60['parentSegment'];if(!_0x445b63)return showParentSegmentNotSetError(_0x58c637(0x89)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20rt\x20jn\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20RT\x20journeys\x20for\x20specific\x20parent\x20segment'),0x1;_0x33bd60[_0x58c637(0x20b)]&&(console[_0x58c637(0xdd)](_0x58c637(0x25d)+_0x33bd60[_0x58c637(0x201)]),console[_0x58c637(0xdd)](_0x58c637(0x224)+_0x445b63));const _0x4f6b67=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x445b63+'\x27...',()=>_0x2a358b[_0x58c637(0x209)][_0x58c637(0x13a)](_0x445b63),{'verbose':_0x33bd60[_0x58c637(0x20b)]}),_0x24d465=_0x4f6b67[_0x58c637(0x8b)],_0x83cb45=await withSpinner(_0x58c637(0xc4)+_0x445b63+_0x58c637(0x169),()=>_0x2a358b[_0x58c637(0x193)][_0x58c637(0x162)](_0x24d465),{'verbose':_0x33bd60[_0x58c637(0x20b)]}),_0x51da20=_0x83cb45[_0x58c637(0x8b)];console[_0x58c637(0xdd)](_0x58c637(0x227)+_0x51da20[_0x58c637(0x190)]+_0x58c637(0x1f8)+(_0x51da20[_0x58c637(0x190)]!==0x1?'s':''));if(_0x33bd60[_0x58c637(0x6f)]===_0x58c637(0x22f)||_0x33bd60[_0x58c637(0x6f)]===_0x58c637(0xd1))await handleSDKOutput(_0x51da20,_0x33bd60);else{if(_0x51da20['length']===0x0)console['log'](_0x58c637(0xfe));else for(const _0x41470b of _0x51da20){const _0x1ecc40=_0x41470b[_0x58c637(0xe8)]===_0x58c637(0x1b3)?'🚀':'📝',_0x280854=_0x41470b[_0x58c637(0xae)]?a31_0x343d08[_0x58c637(0x185)]('\x20(paused)'):'',_0xd10e03=a31_0x343d08[_0x58c637(0x1a7)]('\x20('+_0x41470b[_0x58c637(0xb6)]+_0x58c637(0x246)+(_0x41470b[_0x58c637(0xb6)]!==0x1?'s':'')+')');console[_0x58c637(0x1db)](_0x1ecc40+'\x20'+_0x41470b['name']+_0x280854+_0xd10e03);}}return 0x0;}}export class PSRtJnPauseCommand extends BaseCommand{[a31_0x10c381(0x23b)]='ps:rt:jn:pause';[a31_0x10c381(0x184)]='Pause\x20activations\x20in\x20an\x20RT\x20journey';async[a31_0x10c381(0xa0)](_0x3ab82c){const _0x362d14=a31_0x10c381,{options:_0x473d74,args:_0x335bee,tdx:_0x76df46}=_0x3ab82c,_0x49487c=_0x335bee[0x0];if(!_0x49487c)return console['error'](a31_0x343d08[_0x362d14(0x11b)](_0x362d14(0x1a3))),console[_0x362d14(0xdd)](_0x362d14(0x260)),console[_0x362d14(0xdd)](a31_0x343d08['dim'](_0x362d14(0x79))),0x1;_0x473d74[_0x362d14(0x20b)]&&(console[_0x362d14(0xdd)]('Site:\x20'+_0x473d74['site']),console[_0x362d14(0xdd)]('RT\x20Journey\x20ID:\x20'+_0x49487c));const _0x11c724=await withSpinner(_0x362d14(0xe7)+_0x49487c+_0x362d14(0x169),()=>_0x76df46[_0x362d14(0x193)][_0x362d14(0xe1)](_0x49487c),{'verbose':_0x473d74[_0x362d14(0x20b)]}),_0x52cf94=_0x11c724['data'];console[_0x362d14(0xdd)](_0x362d14(0x16a)+_0x52cf94[_0x362d14(0x23b)]+'\x27');if(_0x473d74[_0x362d14(0x6f)]===_0x362d14(0x22f)||_0x473d74[_0x362d14(0x6f)]==='jsonl')await handleSDKOutput([_0x52cf94],_0x473d74);else{const _0x165614=_0x52cf94['state']===_0x362d14(0x1b3)?'🚀':'📝',_0x3a885e=_0x52cf94[_0x362d14(0xae)]?a31_0x343d08[_0x362d14(0x185)](_0x362d14(0xe6)):'';console['log'](_0x165614+'\x20'+_0x52cf94['name']+_0x3a885e);}return 0x0;}}export class PSRtJnResumeCommand extends BaseCommand{['name']=a31_0x10c381(0xeb);[a31_0x10c381(0x184)]=a31_0x10c381(0xf1);async['execute'](_0x5ced64){const _0x27b149=a31_0x10c381,{options:_0x41695e,args:_0x3a85b9,tdx:_0x3043b9}=_0x5ced64,_0x19b4b8=_0x3a85b9[0x0];if(!_0x19b4b8)return console[_0x27b149(0xdd)](a31_0x343d08[_0x27b149(0x11b)](_0x27b149(0x1a3))),console[_0x27b149(0xdd)](_0x27b149(0x149)),console[_0x27b149(0xdd)](a31_0x343d08[_0x27b149(0x1a7)](_0x27b149(0x79))),0x1;_0x41695e[_0x27b149(0x20b)]&&(console[_0x27b149(0xdd)](_0x27b149(0x25d)+_0x41695e[_0x27b149(0x201)]),console['error'](_0x27b149(0x11e)+_0x19b4b8));const _0x2252f7=await withSpinner(_0x27b149(0x203)+_0x19b4b8+_0x27b149(0x169),()=>_0x3043b9[_0x27b149(0x193)][_0x27b149(0x117)](_0x19b4b8),{'verbose':_0x41695e[_0x27b149(0x20b)]}),_0x358c47=_0x2252f7[_0x27b149(0x8b)];console['error'](_0x27b149(0x175)+_0x358c47[_0x27b149(0x23b)]+'\x27');if(_0x41695e[_0x27b149(0x6f)]===_0x27b149(0x22f)||_0x41695e[_0x27b149(0x6f)]===_0x27b149(0xd1))await handleSDKOutput([_0x358c47],_0x41695e);else{const _0x6d485b=_0x358c47[_0x27b149(0xe8)]===_0x27b149(0x1b3)?'🚀':'📝',_0x3cd1fc=_0x358c47[_0x27b149(0xae)]?a31_0x343d08[_0x27b149(0x185)](_0x27b149(0xe6)):'';console[_0x27b149(0x1db)](_0x6d485b+'\x20'+_0x358c47['name']+_0x3cd1fc);}return 0x0;}}export class PSRtConfigVersionCommand extends BaseCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0x205);[a31_0x10c381(0x184)]=a31_0x10c381(0xcf);async['execute'](_0xb83c57){const _0x4a7668=a31_0x10c381,{options:_0x44fc36,args:_0x25c781,tdx:_0x1276af}=_0xb83c57,_0x5b83d6=_0x25c781[0x0]||_0x44fc36[_0x4a7668(0x113)];if(!_0x5b83d6)return showParentSegmentNotSetError(_0x4a7668(0x12c)+_0x4a7668(0x7a)),0x1;_0x44fc36['verbose']&&(console[_0x4a7668(0xdd)](_0x4a7668(0x25d)+_0x44fc36[_0x4a7668(0x201)]),console[_0x4a7668(0xdd)](_0x4a7668(0x224)+_0x5b83d6));const _0x18efef=await withSpinner(_0x4a7668(0x252)+_0x5b83d6+'\x27...',()=>_0x1276af['segment'][_0x4a7668(0x13a)](_0x5b83d6),{'verbose':_0x44fc36[_0x4a7668(0x20b)]}),_0x2b464c=_0x18efef[_0x4a7668(0x8b)],_0x3f0844=await withSpinner(_0x4a7668(0x26f)+_0x5b83d6+_0x4a7668(0x169),()=>_0x1276af[_0x4a7668(0x193)][_0x4a7668(0x1da)](_0x2b464c),{'verbose':_0x44fc36['verbose']}),_0x26dbc3=_0x3f0844['data'];return console[_0x4a7668(0xdd)](_0x4a7668(0x1fe)),_0x44fc36['format']===_0x4a7668(0x22f)||_0x44fc36[_0x4a7668(0x6f)]===_0x4a7668(0xd1)?await handleSDKOutput([_0x26dbc3],_0x44fc36):(console[_0x4a7668(0x1db)](_0x4a7668(0x1cd)+_0x26dbc3['id']),console['log'](_0x4a7668(0xb2)+_0x26dbc3[_0x4a7668(0x75)]),console[_0x4a7668(0x1db)](_0x4a7668(0x1f0)+_0x26dbc3['identifier']),console[_0x4a7668(0x1db)]('eventKind:\x20'+_0x26dbc3['eventKind']),console[_0x4a7668(0x1db)](_0x4a7668(0x1ef)+_0x26dbc3['status'])),0x0;}}export class PSPzServiceListCommand extends BaseCommand{[a31_0x10c381(0x23b)]='ps:pz:service:list';[a31_0x10c381(0x184)]=a31_0x10c381(0x1e0);async[a31_0x10c381(0xa0)](_0x25e872){const _0x374070=a31_0x10c381,{options:_0x35257d,args:_0x14afc8,tdx:_0x1156da}=_0x25e872,_0x1acec3=_0x14afc8[0x0]||_0x35257d[_0x374070(0x113)];if(!_0x1acec3)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20PZ\x20services\x20(requires\x20context)\x0a'+_0x374070(0xc5)),0x1;const _0x4c9903=await withSpinner(_0x374070(0x252)+_0x1acec3+_0x374070(0x169),()=>_0x1156da[_0x374070(0x209)]['resolveParentId'](_0x1acec3),{'verbose':_0x35257d[_0x374070(0x20b)]}),_0x5dea0f=_0x4c9903['data'],_0x32442c=await withSpinner(_0x374070(0x196)+_0x1acec3+_0x374070(0x169),()=>_0x1156da[_0x374070(0x18b)][_0x374070(0xb1)](_0x5dea0f),{'verbose':_0x35257d['verbose']}),_0x1b38ce=_0x32442c[_0x374070(0x8b)];console['error'](_0x374070(0x227)+_0x1b38ce[_0x374070(0x190)]+_0x374070(0x25c)+(_0x1b38ce['length']!==0x1?'s':''));if(_0x35257d[_0x374070(0x6f)]===_0x374070(0x22f)||_0x35257d[_0x374070(0x6f)]===_0x374070(0xd1))await handleSDKOutput(_0x1b38ce,_0x35257d);else{if(_0x1b38ce[_0x374070(0x190)]===0x0)console[_0x374070(0x1db)](_0x374070(0x1d6)),console[_0x374070(0xdd)](a31_0x343d08[_0x374070(0x12a)](_0x374070(0x16b)));else for(const _0x120aaa of _0x1b38ce){console[_0x374070(0x1db)](a31_0x343d08[_0x374070(0x10a)](_0x120aaa['name'])+'\x20'+a31_0x343d08[_0x374070(0x1a7)]('(id:\x20'+_0x120aaa['id']+')'));_0x120aaa['description']&&console[_0x374070(0x1db)]('\x20\x20'+a31_0x343d08[_0x374070(0x1a7)](_0x120aaa[_0x374070(0x184)]));if(_0x120aaa[_0x374070(0x1d3)]&&_0x120aaa[_0x374070(0x1d3)]['length']>0x0)for(const _0x55b96d of _0x120aaa['tokens']){const _0x23f8f2=_0x55b96d['allowedIps']?.[_0x374070(0x190)]?_0x55b96d[_0x374070(0x81)][_0x374070(0xa1)](',\x20'):'any';console[_0x374070(0x1db)]('\x20\x20'+a31_0x343d08['cyan'](_0x374070(0x152))+'\x20'+_0x55b96d[_0x374070(0x23b)]+'\x20'+a31_0x343d08[_0x374070(0x1a7)]('(id:\x20'+_0x55b96d['id']+')')),console[_0x374070(0x1db)](_0x374070(0x263)+a31_0x343d08[_0x374070(0x1a7)](_0x374070(0x24a))+'\x20'+_0x23f8f2);}else console[_0x374070(0x1db)]('\x20\x20'+a31_0x343d08[_0x374070(0x1a7)](_0x374070(0x119)));}}return 0x0;}}function a31_0x1457(){const _0x3dd339=['updatedAt','Error\x20parsing\x20YAML:\x20','list','audienceId:\x20','run','xdg-open','stitchingKeys','stageCount','Apply\x20changes\x20to\x20\x27','\x27\x20is\x20up\x20to\x20date','in\x20','Error:\x20Token\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','⚡\x20Not\x20enabled','column','ps:pz:create','/\x20directory.\x0a','errors','Listing\x20RT-enabled\x20parent\x20segments...','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context','✔\x20Deleted\x20token\x20\x27','Listing\x20RT\x20journeys\x20for\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20PZ\x20services\x20for\x20specific\x20parent\x20segment','\x20\x20Columns:\x20','ps:pz:delete','displaySummary','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context','\x20parent\x20segment','\x0aNew\x20parent\x20segment\x20\x27','\x20kill','Updated','pushParentYaml','Get\x20current\x20RT\x20configuration\x20version\x20status','Found\x20YAML\x20file:\x20','jsonl','Session:','\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20','segment:parent:validate','Columns:','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','SELECT\x20*\x20FROM\x20(\x0a','platform','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','List\x20RT\x20journeys','Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]','events','error','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','segment:parent:preview','filter','pauseJourney','processedRows','Customers:','delete','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>','\x20(paused)','Pausing\x20activations\x20for\x20RT\x20journey\x20\x27','state','map','👥\x20','ps:rt:jn:resume','Audience\x20ID:','\x20Context\x20set:\x20','\x27\x20and\x20run\x20workflow?','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','text','Resume\x20activations\x20in\x20an\x20RT\x20journey','workflowId','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','displayValidateResults','stop','Schema\x20saved\x20to\x20','attribute','Join:','\x0aChanges\x20to\x20apply\x20to\x20\x27','Error:\x20--database\x20and\x20--table\x20are\x20required','Show\x20personalization\x20service\x20details','\x0aError:','No\x20RT\x20journeys\x20found','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]','Error:\x20\x22relationships.parentFolder\x22\x20is\x20required\x20in\x20the\x20JSON\x20file.','personalizationServices','customerGroup','public:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','List\x20available\x20fields\x20for\x20segmentation','Executing\x20parent\x20segment\x20query...','trim','Master\x20Table','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','bold','\x20\x20Database:\x20','Attribute:','user_id','segment:parent:sql','/sessions/','6442mWSPbu','matchedCount','ps:pz:service:token:create','parentSegment','displayColumns','Validate:','Fetching\x20SQL\x20for\x20\x27','resumeJourney','createPersonalization','no\x20tokens\x20configured','Delete\x20a\x20realtime\x20personalization','red','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]','Table:\x20','RT\x20Journey\x20ID:\x20','true','107zAegoZ','schemaValid','Update\x20a\x20realtime\x20personalization\x20entity','Deleting\x20personalization\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','displaySampleData','createToken','database','keyEventCriteria','Fetching\x20behavior\x20list...','cyan','Attributes','Usage:\x20tdx\x20ps\x20rt\x20configuration_versions\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Get\x20RT\x20config\x20version\x20(requires\x20context)\x0a','4529959uBijYq','YAML\x20file:\x20','\x0aUsage:\x20tdx\x20ps\x20preview\x20','yes','addBehaviorsFile','isDirectory','Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID,\x20then\x20add:','start','\x20configured','Create\x20parent\x20segment\x20\x27','Add\x20template\x20personalization\x20section\x20to\x20parent\x20segment\x20YAML','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context','rowCount','resolveParentId','\x20--behavior\x20\x22','Listing\x20parent\x20segments\x20matching\x20\x27','/app/dw/parentSegments/','validateParentYaml','\x22,\x20\x22type\x22:\x20\x22','create','customers','\x0a⚠️\x20\x20Both\x20','\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','Error:\x20Service\x20name\x20is\x20required','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]\x0a','Creating','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]\x0a','Usage:\x20tdx\x20ps\x20rt\x20jn\x20resume_activations\x20<journeyId>\x0a','entryCriteria:','\x20\x20Note:\x20','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','joinKey','message','coveragePercent','Personalization\x20service\x20description','\x0aNo\x20sample\x20data\x20available','token:','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]','relationships','idStitching','folder-segment','collectSchema','audienceId:','pullParentYaml','tdx\x20ps\x20push\x20','createdAt','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','personalization_services','Deleting\x20personalization\x20service\x20\x27','replace','Events:','✔\x20Updated\x20personalization\x20service\x20\x27','listJourneys','Errors:','deletePersonalization','\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20','attributes','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--file\x20<path>','deleteToken','\x27...','✔\x20Paused\x20activations\x20for\x20RT\x20journey\x20\x27','\x0aTip:\x20Run\x20`tdx\x20ps\x20pz\x20service\x20init`\x20to\x20add\x20a\x20template\x20personalization\x20section\x20to\x20your\x20YAML','displayPreviewHints','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context','\x27\x20for\x20service\x20\x27','Rows:','Attributes:','Status:','workflowSessionId','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','customerPercent','✔\x20Resumed\x20activations\x20for\x20RT\x20journey\x20\x27','keyEventId','scheduleType','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','/app/workflows/','No\x20parent\x20segments\x20match\x20pattern:\x20','patch','parent_segments','\x20\x20No\x20sample\x20data\x20available','\x0a\x20\x20]\x0a}\x0a','✔\x20Deleted\x20personalization\x20service\x20\x27','addAttributesFile','Listing\x20personalizations\x20for\x20\x27','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Error:\x20--attribute\x20requires\x20a\x20name\x0a','description','yellow','Finding\x20service\x20for\x20token...','displayRealtimeInfo','push','List\x20realtime\x20personalizations\x20for\x20a\x20parent\x20segment','\x20service','personalization','darwin','Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','toLocaleString','length','enabled','payload','realtime','✔\x20Created\x20parent\x20segment\x20\x27','null','Listing\x20personalization\x20services\x20for\x20\x27','jobId','toLowerCase','\x20parent\x20segment\x20\x27','Options:','population','Error:\x20Service\x20ID\x20is\x20required','\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)','localeCompare','/\x20→\x20','\x20\x201.\x20Edit\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context','Options:\x0a','Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a','Updating','/\x20and\x20','double','dim','(id:\x20','\x20[Job\x20ID:\x20','Error:\x20--folder-id\x20is\x20required.\x20Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID.','\x20\x20\x20\x20-\x20','ps:pz:list','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','Aborted.','keyEventId:','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','10VjCAer','\x0aChanges\x20to\x20\x27','launched','Creating\x20personalization\x20\x27','Error:\x20Token\x20name\x20is\x20required','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','FINISHED','Fetching\x20sample\x20data...','My\x20Service','segment:parent:fields','\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22','Output\x20file:\x20','\x20to\x20push\x20the\x20configuration','\x22\x20}','Validating\x20RT\x20configuration...','✔\x20Created\x20personalization\x20\x27','repeat','previewParentYaml','sort','getParentSQL','displayMasterInfo','Preview:','listParents','Error:\x20Personalization\x20ID\x20is\x20required','8UHBXwg','Usage:\x20tdx\x20ps\x20pz\x20show\x20<personalization_id>','Validate\x20RT\x202.0\x20configuration\x20from\x20parent\x20segment\x20YAML','✔\x20Found\x20personalization\x20\x27','id:\x20','\x27\x20is\x20already\x20up\x20to\x20date','Error\x20reading\x20file:\x20','\x20Added\x20RT\x202.0\x20template\x20section','.yml','behavior_','tokens','runParent','No\x20parent\x20segments\x20found','No\x20personalization\x20services\x20configured','segment:parent:view','parentFolder','sections','getCurrentConfigVersion','log','✔\x20Created\x20personalization\x20service\x20\x27','sourceTableError','toFixed','page_view','List\x20personalization\x20services\x20for\x20a\x20parent\x20segment','columns','value','payload:','last_page_viewed','number','✔\x20No\x20changes\x20-\x20\x27','Delete\x20a\x20personalization\x20service','all','listPersonalizations','1343111BulZIi','displayBehaviorsStats','Updating\x20parent\x20segment\x20\x27','segment:parent:show','Creating\x20token\x20\x27','status:\x20','identifier:\x20','sourceTableValid','column_type','\x5c$&','interval','output','To\x20view\x20sample\x20data:','test','\x20RT\x20journey','No\x20RT-enabled\x20parent\x20segments\x20found','endsWith','\x20Opening\x20','Usage:\x20tdx\x20ps\x20pz\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20personalizations\x20(requires\x20context)\x0a','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','✔\x20Retrieved\x20RT\x20configuration\x20version','Analyzing\x20changes...','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','site','allValid','Resuming\x20activations\x20for\x20RT\x20journey\x20\x27','indexOf','ps:rt:configuration_versions','-1d','78gjeVpX','\x20\x20\x20\x20\x20\x20\x20\x20','segment','foreignKey','verbose','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','updated:','column_name','utf-8','ps:pz:service:create','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','\x20=\x20','displayAttributesStats','timezone','ps:pz:service:update','Validating\x20configuration...','Available\x20attributes:','segment:parent:update','patchPersonalization','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','get','match','Created','\x20behaviors','Pattern:\x20','\x0a\x20\x20\x20\x20]','/\x20directories\x20exist.','Listing\x20RT-enabled\x20parent\x20segments\x20matching\x20\x27','Parent\x20segment:\x20','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','sampleData','✔\x20Found\x20','\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)','includeSensitive:','/attempt/','stats','Join\x20on:','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','\x20--behavior\x20\x22<name>\x22','json','SQL\x20query:\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20personalizations\x20for\x20specific\x20parent\x20segment','\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22','\x20true','\x20Configuration\x20is\x20valid','\x20\x20\x20\x20\x20\x20','\x20to\x20configure\x20your\x20personalization\x20service','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','\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','behavior','ID\x20Stitching:','name','Fetching\x20customers\x20schema...','label','✘\x20Failed\x20to\x20rename\x20directory:\x20','single','Fetching\x20current\x20configuration\x20for\x20\x27','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','Master:','List\x20parent\x20segments\x20with\x20RT\x202.0\x20status','limit','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','\x20stage','\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]\x0a','win32','allowed\x20IPs:','Next\x20steps:','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','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','getBehaviorNames','\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22','Listing\x20parent\x20segments...','Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','Resolving\x20parent\x20segment\x20\x27','Create\x20a\x20realtime\x20personalization\x20entity','Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]','created:','unref','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','\x20RT-enabled\x20parent\x20segment','{\x0a\x20\x20\x22database\x22:\x20\x22','3451383ewOKpk','Get\x20SQL\x20query\x20for\x20parent\x20segment','\x20personalization\x20service','Site:\x20','\x0a⚠\x20Save\x20this\x20token\x20value\x20-\x20it\x20will\x20not\x20be\x20shown\x20again:','22481508EuAjvb','Usage:\x20tdx\x20ps\x20rt\x20jn\x20pause_activations\x20<journeyId>\x0a','RT\x202.0:','<database>.<table>','\x20\x20\x20\x20','\x20field','\x20\x202.\x20Run\x20','customersWithEvents','Creating\x20personalization\x20service\x20\x27','getOutputDatabaseName','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','RT\x202.0\x20Validate:','\x20--attribute\x20\x22','Show\x20parent\x20segment\x20schema\x20(column\x20types)','\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22','3iiHuSw','Getting\x20RT\x20configuration\x20version\x20for\x20\x27','Show\x20parent\x20segment\x20details','workflowAttemptId','SELECT\x20*\x20FROM\x20','td_client_id','\x27\x20with\x20ID:\x20','ps:pz:service:delete','ps:pz:patch','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','tdx\x20ps\x20preview\x20','\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','scheduleOption','query','parent_segment','table','enriched','totalEvents','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','string','setJobId','format','behaviors','attributesFile','segment:parent:create','createParent','Show\x20a\x20specific\x20realtime\x20personalization','audienceId','ps:rt:validate','master','\x20rows)','Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20rt\x20configuration_versions\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Get\x20RT\x20config\x20version\x20for\x20specific\x20parent\x20segment','public','ps:rt:jn:list','165265McJbhv','displayPreviewResults','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','schemaError','allowedIps','entryCriteria','type','parent_id','Enriched:','Creating\x20parent\x20segment\x20\x27','.customers)','Create\x20a\x20token\x20for\x20a\x20personalization\x20service','Usage:\x20tdx\x20ps\x20rt\x20jn\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20RT\x20journeys\x20(requires\x20context)\x0a','segment:parent:run','data','\x20--interval\x20','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]\x0a','1568836Cajerd','formatSchemaJson','\x20No\x20changes\x20-\x20','No\x20personalizations\x20configured','folderId','keys','✔\x20Deleted\x20personalization\x20\x27','using\x20the\x20default\x20path:\x20','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','green','file','Error:\x20Parent\x20segment\x20name\x20is\x20required','apply','Database:\x20','\x20service(s)\x20configured','varchar','listFields','includeSensitive','execute','join','\x20rows\x20','Source:','web','Behaviors','Listing\x20fields\x20for\x20\x27','\x27\x20(id:\x20','Attempt:','Fetching\x20parent\x20segment\x20\x27','Error:','status','Personalization:','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]\x0a','paused'];a31_0x1457=function(){return _0x3dd339;};return a31_0x1457();}export class PSPzServiceCreateCommand extends BaseCommand{['name']=a31_0x10c381(0x210);['description']='Create\x20a\x20personalization\x20service\x20for\x20a\x20parent\x20segment';async['execute'](_0x14c081){const _0x50740a=a31_0x10c381,{options:_0x25b9a2,args:_0x2b8d4c,tdx:_0x248438}=_0x14c081,_0x2e0016=_0x25b9a2,_0x4f04ca=_0x2b8d4c[0x0],_0x1c0273=_0x2b8d4c[0x1]||_0x25b9a2[_0x50740a(0x113)];if(!_0x4f04ca)return console[_0x50740a(0xdd)](_0x50740a(0x145)),console[_0x50740a(0xdd)](_0x50740a(0x153)),console[_0x50740a(0xdd)](_0x50740a(0x1a1)),0x1;if(!_0x1c0273)return showParentSegmentNotSetError(_0x50740a(0x8d)+_0x50740a(0x1a1)),0x1;const _0x834737=await withSpinner(_0x50740a(0x252)+_0x1c0273+_0x50740a(0x169),()=>_0x248438['segment'][_0x50740a(0x13a)](_0x1c0273),{'verbose':_0x25b9a2[_0x50740a(0x20b)]}),_0x2528e1=_0x834737['data'],_0xbd2b17={'name':_0x4f04ca,'description':_0x2e0016[_0x50740a(0x184)],'public':_0x2e0016[_0x50740a(0x7b)]},_0x3ede30=await withSpinner(_0x50740a(0x267)+_0x4f04ca+'\x27...',()=>_0x248438[_0x50740a(0x18b)][_0x50740a(0x140)](_0x2528e1,_0xbd2b17),{'verbose':_0x25b9a2[_0x50740a(0x20b)]}),_0x183b9=_0x3ede30['data'];return console[_0x50740a(0xdd)](_0x50740a(0x1dc)+_0x183b9[_0x50740a(0x23b)]+_0x50740a(0x274)+_0x183b9['id']),await handleSDKOutput([_0x183b9],_0x25b9a2),0x0;}}function a31_0xc607(_0x154e97,_0x58a7cd){_0x154e97=_0x154e97-0x6a;const _0x1457f4=a31_0x1457();let _0xc60793=_0x1457f4[_0x154e97];return _0xc60793;}export class PSPzServiceShowCommand extends BaseCommand{['name']='ps:pz:service:show';[a31_0x10c381(0x184)]=a31_0x10c381(0xfc);async[a31_0x10c381(0xa0)](_0x21841b){const _0x396ddf=a31_0x10c381,{options:_0x4c5839,args:_0x4e73e0,tdx:_0x461618}=_0x21841b,_0x10fc73=_0x4e73e0[0x0],_0x526076=_0x4e73e0[0x1]||_0x4c5839[_0x396ddf(0x113)];if(!_0x10fc73)return console['error'](_0x396ddf(0x19c)),console[_0x396ddf(0xdd)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]'),console[_0x396ddf(0xdd)](_0x396ddf(0x16d)),0x1;if(!_0x526076)return showParentSegmentNotSetError(_0x396ddf(0x148)+_0x396ddf(0x16d)),0x1;const _0x2c6342=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x526076+_0x396ddf(0x169),()=>_0x461618[_0x396ddf(0x209)]['resolveParentId'](_0x526076),{'verbose':_0x4c5839[_0x396ddf(0x20b)]}),_0x5c0d24=_0x2c6342[_0x396ddf(0x8b)],_0x38f889=await withSpinner('Fetching\x20personalization\x20service\x20\x27'+_0x10fc73+_0x396ddf(0x169),()=>_0x461618[_0x396ddf(0x18b)][_0x396ddf(0x21c)](_0x5c0d24,_0x10fc73),{'verbose':_0x4c5839[_0x396ddf(0x20b)]}),_0xbc807f=_0x38f889[_0x396ddf(0x8b)];if(_0x4c5839['json']||_0x4c5839[_0x396ddf(0xd1)])await handleSDKOutput([_0xbc807f],_0x4c5839);else{console['log'](a31_0x343d08[_0x396ddf(0x10a)](_0xbc807f['name'])+'\x20'+a31_0x343d08[_0x396ddf(0x1a7)]('(id:\x20'+_0xbc807f['id']+')'));_0xbc807f[_0x396ddf(0x184)]&&console[_0x396ddf(0x1db)]('\x20\x20'+a31_0x343d08['dim'](_0xbc807f[_0x396ddf(0x184)]));console['log']('\x20\x20'+a31_0x343d08[_0x396ddf(0x12a)](_0x396ddf(0x103))+'\x20'+(_0xbc807f[_0x396ddf(0x7b)]?'yes':'no'));if(_0xbc807f[_0x396ddf(0x1d3)]&&_0xbc807f[_0x396ddf(0x1d3)][_0x396ddf(0x190)]>0x0)for(const _0x16a9de of _0xbc807f[_0x396ddf(0x1d3)]){const _0x85249=_0x16a9de[_0x396ddf(0x81)]?.[_0x396ddf(0x190)]?_0x16a9de['allowedIps'][_0x396ddf(0xa1)](',\x20'):'any';console[_0x396ddf(0x1db)]('\x20\x20'+a31_0x343d08['cyan'](_0x396ddf(0x152))+'\x20'+_0x16a9de[_0x396ddf(0x23b)]+'\x20'+a31_0x343d08['dim'](_0x396ddf(0x1a8)+_0x16a9de['id']+')')),console[_0x396ddf(0x1db)]('\x20\x20\x20\x20'+a31_0x343d08[_0x396ddf(0x1a7)](_0x396ddf(0x24a))+'\x20'+_0x85249);}else console[_0x396ddf(0x1db)]('\x20\x20'+a31_0x343d08[_0x396ddf(0x1a7)]('no\x20tokens\x20configured'));}return 0x0;}}export class PSPzServiceDeleteCommand extends BaseCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0x275);['description']=a31_0x10c381(0x1e7);async[a31_0x10c381(0xa0)](_0x354435){const _0x440070=a31_0x10c381,{options:_0x5b74cc,args:_0x13f7c4,tdx:_0x1076b2}=_0x354435,_0x1f074f=_0x13f7c4[0x0],_0x20388d=_0x13f7c4[0x1]||_0x5b74cc[_0x440070(0x113)];if(!_0x1f074f)return console['error']('Error:\x20Service\x20ID\x20is\x20required'),console[_0x440070(0xdd)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]'),console[_0x440070(0xdd)](_0x440070(0xc2)),0x1;if(!_0x20388d)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]\x0a'+_0x440070(0xc2)),0x1;const _0x5bbd9c=await withSpinner(_0x440070(0x252)+_0x20388d+_0x440070(0x169),()=>_0x1076b2[_0x440070(0x209)][_0x440070(0x13a)](_0x20388d),{'verbose':_0x5b74cc[_0x440070(0x20b)]}),_0x2fd140=_0x5bbd9c[_0x440070(0x8b)];return await withSpinner(_0x440070(0x15e)+_0x1f074f+_0x440070(0x169),()=>_0x1076b2['personalization'][_0x440070(0xe4)](_0x2fd140,_0x1f074f),{'verbose':_0x5b74cc[_0x440070(0x20b)]}),console['error'](_0x440070(0x17f)+_0x1f074f+'\x27'),0x0;}}export class PSPzServiceUpdateCommand extends BaseCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0x215);[a31_0x10c381(0x184)]='Update\x20a\x20personalization\x20service\x20name\x20and/or\x20description';async[a31_0x10c381(0xa0)](_0xf6cb19){const _0x5c2229=a31_0x10c381,{options:_0x48c980,args:_0x15a269,tdx:_0x17eb26}=_0xf6cb19,_0x30e9b7=_0x48c980,_0x235fbd=_0x15a269[0x0],_0x2076fb=_0x15a269[0x1]||_0x48c980[_0x5c2229(0x113)];if(!_0x235fbd)return console['error'](_0x5c2229(0x19c)),console[_0x5c2229(0xdd)](_0x5c2229(0xff)),console[_0x5c2229(0xdd)](_0x5c2229(0xf3)),0x1;if(!_0x30e9b7[_0x5c2229(0x23b)])return console[_0x5c2229(0xdd)]('Error:\x20--name\x20is\x20required'),console[_0x5c2229(0xdd)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]'),0x1;if(!_0x2076fb)return showParentSegmentNotSetError(_0x5c2229(0x248)+_0x5c2229(0xf3)),0x1;const _0x67486=await withSpinner(_0x5c2229(0x252)+_0x2076fb+_0x5c2229(0x169),()=>_0x17eb26[_0x5c2229(0x209)][_0x5c2229(0x13a)](_0x2076fb),{'verbose':_0x48c980[_0x5c2229(0x20b)]}),_0x2e7e0b=_0x67486[_0x5c2229(0x8b)],_0x4cb217={'name':_0x30e9b7[_0x5c2229(0x23b)]};_0x30e9b7[_0x5c2229(0x184)]!==undefined&&(_0x4cb217[_0x5c2229(0x184)]=_0x30e9b7[_0x5c2229(0x184)]);const _0x50f6ce=await withSpinner('Updating\x20personalization\x20service\x20\x27'+_0x235fbd+_0x5c2229(0x169),()=>_0x17eb26[_0x5c2229(0x18b)][_0x5c2229(0x17b)](_0x2e7e0b,_0x235fbd,_0x4cb217),{'verbose':_0x48c980[_0x5c2229(0x20b)]}),_0x2b41f3=_0x50f6ce[_0x5c2229(0x8b)];return console['error'](_0x5c2229(0x161)+_0x2b41f3[_0x5c2229(0x23b)]+'\x27'),await handleSDKOutput([_0x2b41f3],_0x48c980),0x0;}}export class PSPzServiceTokenCreateCommand extends BaseCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0x112);[a31_0x10c381(0x184)]=a31_0x10c381(0x88);async[a31_0x10c381(0xa0)](_0x3fa6a9){const _0x5c52a6=a31_0x10c381,{options:_0x458d91,args:_0x2559af,tdx:_0x2a3b3d}=_0x3fa6a9,_0x3a2569=_0x458d91,_0x39b27f=_0x2559af[0x0],_0x421fa4=_0x2559af[0x1],_0xf77ff6=_0x2559af[0x2]||_0x458d91[_0x5c52a6(0x113)];if(!_0x39b27f)return console[_0x5c52a6(0xdd)](_0x5c52a6(0x1b5)),console[_0x5c52a6(0xdd)](_0x5c52a6(0x11c)),console[_0x5c52a6(0xdd)](_0x5c52a6(0x138)),0x1;if(!_0x421fa4)return console[_0x5c52a6(0xdd)](_0x5c52a6(0x19c)),console[_0x5c52a6(0xdd)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]'),console[_0x5c52a6(0xdd)](_0x5c52a6(0x138)),0x1;if(!_0xf77ff6)return showParentSegmentNotSetError(_0x5c52a6(0xad)+_0x5c52a6(0x138)),0x1;const _0x5dc7e0=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0xf77ff6+_0x5c52a6(0x169),()=>_0x2a3b3d[_0x5c52a6(0x209)][_0x5c52a6(0x13a)](_0xf77ff6),{'verbose':_0x458d91[_0x5c52a6(0x20b)]}),_0x483253=_0x5dc7e0[_0x5c52a6(0x8b)],_0x52c4d8={'name':_0x39b27f};_0x3a2569[_0x5c52a6(0x81)]&&(_0x52c4d8['allowedIps']=_0x3a2569[_0x5c52a6(0x81)]['split'](',')['map'](_0xcded64=>_0xcded64['trim']()));_0x3a2569[_0x5c52a6(0x184)]&&(_0x52c4d8[_0x5c52a6(0x184)]=_0x3a2569['description']);const _0x1e2753=await withSpinner(_0x5c52a6(0x1ee)+_0x39b27f+_0x5c52a6(0x16e)+_0x421fa4+_0x5c52a6(0x169),()=>_0x2a3b3d[_0x5c52a6(0x18b)][_0x5c52a6(0x126)](_0x483253,_0x421fa4,_0x52c4d8),{'verbose':_0x458d91[_0x5c52a6(0x20b)]}),_0x255302=_0x1e2753['data'];return console[_0x5c52a6(0xdd)]('✔\x20Created\x20token\x20\x27'+_0x255302['name']+_0x5c52a6(0x274)+_0x255302['id']),_0x255302[_0x5c52a6(0x1e2)]&&(console[_0x5c52a6(0xdd)](a31_0x343d08[_0x5c52a6(0x185)](_0x5c52a6(0x25e))),console['error'](a31_0x343d08['cyan'](_0x255302[_0x5c52a6(0x1e2)])),console[_0x5c52a6(0xdd)]('')),await handleSDKOutput([_0x255302],_0x458d91),0x0;}}export class PSPzServiceTokenDeleteCommand extends BaseCommand{[a31_0x10c381(0x23b)]='ps:pz:service:token:delete';[a31_0x10c381(0x184)]='Delete\x20a\x20token\x20from\x20a\x20personalization\x20service';async['execute'](_0x4a4c2f){const _0x23c5a3=a31_0x10c381,{options:_0x12981c,args:_0x176bbb,tdx:_0x45abcd}=_0x4a4c2f,_0x3a97d6=_0x176bbb[0x0],_0x513424=_0x176bbb[0x1]||_0x12981c['parentSegment'];if(!_0x3a97d6)return console['error']('Error:\x20Token\x20ID\x20is\x20required'),console[_0x23c5a3(0xdd)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]'),console['error'](_0x23c5a3(0xc9)),0x1;if(!_0x513424)return showParentSegmentNotSetError(_0x23c5a3(0x146)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context'),0x1;const _0x500b6a=await withSpinner(_0x23c5a3(0x252)+_0x513424+'\x27...',()=>_0x45abcd[_0x23c5a3(0x209)][_0x23c5a3(0x13a)](_0x513424),{'verbose':_0x12981c[_0x23c5a3(0x20b)]}),_0x15c95e=_0x500b6a[_0x23c5a3(0x8b)],_0x40b617=await withSpinner(_0x23c5a3(0x186),()=>_0x45abcd[_0x23c5a3(0x18b)]['list'](_0x15c95e),{'verbose':_0x12981c['verbose']}),_0x5df558=_0x40b617['data'];let _0x335be0;for(const _0x2df0ca of _0x5df558){if(_0x2df0ca[_0x23c5a3(0x1d3)]?.['some'](_0x5e9f0a=>_0x5e9f0a['id']===_0x3a97d6)){_0x335be0=_0x2df0ca['id'];break;}}if(!_0x335be0)return console[_0x23c5a3(0xdd)](_0x23c5a3(0xba)+_0x3a97d6+'\x27\x20not\x20found\x20in\x20any\x20personalization\x20service'),0x1;const _0x243520=await withSpinner('Deleting\x20token\x20\x27'+_0x3a97d6+'\x27...',()=>_0x45abcd[_0x23c5a3(0x18b)][_0x23c5a3(0x168)](_0x15c95e,_0x335be0,_0x3a97d6),{'verbose':_0x12981c[_0x23c5a3(0x20b)]}),_0x4d351d=_0x243520[_0x23c5a3(0x8b)];return console[_0x23c5a3(0xdd)](_0x23c5a3(0xc3)+(_0x4d351d['name']||_0x3a97d6)+'\x27'),await handleSDKOutput([_0x4d351d],_0x12981c),0x0;}}export class PSPzListCommand extends BaseCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0x1ac);[a31_0x10c381(0x184)]=a31_0x10c381(0x189);async[a31_0x10c381(0xa0)](_0x509e7f){const _0x376243=a31_0x10c381,{options:_0x41704e,args:_0x5006d4,tdx:_0x3f7360}=_0x509e7f,_0x2075d6=_0x5006d4[0x0]||_0x41704e[_0x376243(0x113)];if(!_0x2075d6)return showParentSegmentNotSetError(_0x376243(0x1fc)+_0x376243(0x231)),0x1;const _0x54b4a9=await withSpinner(_0x376243(0x252)+_0x2075d6+'\x27...',()=>_0x3f7360[_0x376243(0x209)][_0x376243(0x13a)](_0x2075d6),{'verbose':_0x41704e[_0x376243(0x20b)]}),_0x3a75bc=_0x54b4a9[_0x376243(0x8b)],_0x2a638d=await withSpinner(_0x376243(0x181)+_0x2075d6+_0x376243(0x169),()=>_0x3f7360[_0x376243(0x18b)][_0x376243(0x1e9)](_0x3a75bc),{'verbose':_0x41704e['verbose']}),_0x3a49ea=_0x2a638d['data'];console[_0x376243(0xdd)](_0x376243(0x227)+_0x3a49ea[_0x376243(0x190)]+'\x20personalization'+(_0x3a49ea['length']!==0x1?'s':''));if(_0x41704e[_0x376243(0x6f)]===_0x376243(0x22f)||_0x41704e['format']===_0x376243(0xd1))await handleSDKOutput(_0x3a49ea,_0x41704e);else{if(_0x3a49ea[_0x376243(0x190)]===0x0)console[_0x376243(0x1db)](_0x376243(0x91));else for(const _0x2236db of _0x3a49ea){console[_0x376243(0x1db)](a31_0x343d08[_0x376243(0x10a)](_0x2236db['name'])+'\x20'+a31_0x343d08[_0x376243(0x1a7)](_0x376243(0x1a8)+_0x2236db['id']+')'));_0x2236db[_0x376243(0x184)]&&console[_0x376243(0x1db)]('\x20\x20'+a31_0x343d08[_0x376243(0x1a7)](_0x2236db[_0x376243(0x184)]));const _0x3a817b=_0x2236db[_0x376243(0x1d9)]?.[_0x376243(0x190)]||0x0;console[_0x376243(0x1db)]('\x20\x20'+a31_0x343d08[_0x376243(0x12a)]('sections:')+'\x20'+_0x3a817b);if(_0x2236db[_0x376243(0x1d9)]&&_0x2236db[_0x376243(0x1d9)][_0x376243(0x190)]>0x0)for(const _0x1f738b of _0x2236db['sections']){console['log'](_0x376243(0x1ab)+_0x1f738b[_0x376243(0x23b)]);}}}return 0x0;}}export class PSPzShowCommand extends BaseCommand{[a31_0x10c381(0x23b)]='ps:pz:show';[a31_0x10c381(0x184)]=a31_0x10c381(0x74);async['execute'](_0x27b26e){const _0x39e30a=a31_0x10c381,{options:_0x93446a,args:_0x12a437,tdx:_0x446d51}=_0x27b26e,_0x1f2d63=_0x12a437[0x0];if(!_0x1f2d63)return console[_0x39e30a(0xdd)](_0x39e30a(0x1c8)),console[_0x39e30a(0xdd)](_0x39e30a(0x1ca)),0x1;const _0x18e182=await withSpinner('Getting\x20personalization\x20\x27'+_0x1f2d63+'\x27...',()=>_0x446d51[_0x39e30a(0x18b)]['getPersonalization'](_0x1f2d63),{'verbose':_0x93446a['verbose']}),_0x244a90=_0x18e182[_0x39e30a(0x8b)];console['error'](_0x39e30a(0x1cc)+_0x244a90['name']+'\x27');if(_0x93446a[_0x39e30a(0x6f)]==='json'||_0x93446a[_0x39e30a(0x6f)]===_0x39e30a(0xd1))await handleSDKOutput([_0x244a90],_0x93446a);else{console['log'](a31_0x343d08[_0x39e30a(0x10a)](_0x244a90['name'])+'\x20'+a31_0x343d08[_0x39e30a(0x1a7)](_0x39e30a(0x1a8)+_0x244a90['id']+')'));_0x244a90[_0x39e30a(0x184)]&&console[_0x39e30a(0x1db)]('\x20\x20'+a31_0x343d08[_0x39e30a(0x1a7)](_0x244a90[_0x39e30a(0x184)]));_0x244a90[_0x39e30a(0x75)]&&console[_0x39e30a(0x1db)]('\x20\x20'+a31_0x343d08['cyan'](_0x39e30a(0x158))+'\x20'+_0x244a90[_0x39e30a(0x75)]);console[_0x39e30a(0x1db)]('\x20\x20'+a31_0x343d08[_0x39e30a(0x12a)](_0x39e30a(0x255))+'\x20'+_0x244a90[_0x39e30a(0x15b)]),console[_0x39e30a(0x1db)]('\x20\x20'+a31_0x343d08['cyan'](_0x39e30a(0x20d))+'\x20'+_0x244a90[_0x39e30a(0xaf)]);const _0x1ce276=_0x244a90['sections']?.[_0x39e30a(0x190)]||0x0;console[_0x39e30a(0x1db)]('\x20\x20'+a31_0x343d08[_0x39e30a(0x12a)]('sections:')+'\x20'+_0x1ce276);if(_0x244a90[_0x39e30a(0x1d9)]&&_0x244a90[_0x39e30a(0x1d9)][_0x39e30a(0x190)]>0x0)for(const _0x4160a5 of _0x244a90[_0x39e30a(0x1d9)]){console['log'](_0x39e30a(0x263)+a31_0x343d08[_0x39e30a(0x10a)](_0x4160a5[_0x39e30a(0x23b)])+'\x20'+a31_0x343d08[_0x39e30a(0x1a7)](_0x39e30a(0x1a8)+_0x4160a5['id']+')')),_0x4160a5[_0x39e30a(0x82)]&&(console[_0x39e30a(0x1db)](_0x39e30a(0x235)+a31_0x343d08[_0x39e30a(0x12a)](_0x39e30a(0x14a))+'\x20'+_0x4160a5[_0x39e30a(0x82)]['name']),_0x4160a5[_0x39e30a(0x82)][_0x39e30a(0x128)]?.['keyEventId']&&console[_0x39e30a(0x1db)](_0x39e30a(0x208)+a31_0x343d08[_0x39e30a(0x12a)](_0x39e30a(0x1af))+'\x20'+_0x4160a5[_0x39e30a(0x82)]['keyEventCriteria'][_0x39e30a(0x176)])),_0x4160a5[_0x39e30a(0x192)]&&console['log'](_0x39e30a(0x235)+a31_0x343d08[_0x39e30a(0x12a)](_0x39e30a(0x1e3))+'\x20'+JSON['stringify'](_0x4160a5['payload'])),_0x4160a5[_0x39e30a(0x9f)]&&console['log'](_0x39e30a(0x235)+a31_0x343d08[_0x39e30a(0x12a)](_0x39e30a(0x229))+_0x39e30a(0x233));}}return 0x0;}}export class PSPzDeleteCommand extends BaseCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0xc7);[a31_0x10c381(0x184)]=a31_0x10c381(0x11a);async[a31_0x10c381(0xa0)](_0x9c7cff){const _0x34b730=a31_0x10c381,{options:_0x506448,args:_0x2db245,tdx:_0x483722}=_0x9c7cff,_0x26a8ba=_0x2db245[0x0];if(!_0x26a8ba)return console['error'](_0x34b730(0x1c8)),console[_0x34b730(0xdd)]('Usage:\x20tdx\x20ps\x20pz\x20delete\x20<personalization_id>'),0x1;return await withSpinner(_0x34b730(0x123)+_0x26a8ba+_0x34b730(0x169),()=>_0x483722['personalization'][_0x34b730(0x164)](_0x26a8ba),{'verbose':_0x506448[_0x34b730(0x20b)]}),console['error'](_0x34b730(0x94)+_0x26a8ba+'\x27'),0x0;}}export class PSPzCreateCommand extends BaseCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0xbe);[a31_0x10c381(0x184)]=a31_0x10c381(0x253);async['execute'](_0x17caa2){const _0x5436e4=a31_0x10c381,{options:_0x5361e6,tdx:_0x2dae15}=_0x17caa2,_0x120035=_0x5361e6;let _0x397555;if(_0x120035[_0x5436e4(0x98)]){_0x397555=await loadJSON(_0x120035[_0x5436e4(0x98)],!![]);if(!_0x397555[_0x5436e4(0x154)]?.[_0x5436e4(0x1d8)])return console[_0x5436e4(0xdd)](_0x5436e4(0x100)),console[_0x5436e4(0xdd)](_0x5436e4(0x133)),console['error']('\x20\x20\x22relationships\x22:\x20{\x20\x22parentFolder\x22:\x20{\x20\x22data\x22:\x20{\x20\x22id\x22:\x20\x22<id>\x22,\x20\x22type\x22:\x20\x22folder-segment\x22\x20}\x20}\x20}'),0x1;}else{if(!_0x120035[_0x5436e4(0x23b)])return console[_0x5436e4(0xdd)](_0x5436e4(0x18d)),console[_0x5436e4(0xdd)](_0x5436e4(0xdb)),console[_0x5436e4(0xdd)](_0x5436e4(0xe5)),0x1;if(_0x120035[_0x5436e4(0x184)]===undefined)return console[_0x5436e4(0xdd)](_0x5436e4(0x251)),console[_0x5436e4(0xdd)](_0x5436e4(0xdb)),console[_0x5436e4(0xdd)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>'),0x1;if(_0x120035[_0x5436e4(0x92)]===undefined)return console[_0x5436e4(0xdd)](_0x5436e4(0x1aa)),console[_0x5436e4(0xdd)]('\x20\x20\x20\x20\x20\x20\x20Pass\x20null\x20to\x20place\x20in\x20the\x20root\x20folder.'),0x1;let _0x40c6cc=_0x120035['audienceId'];if(!_0x40c6cc&&_0x5361e6[_0x5436e4(0x113)]){const _0x58e517=await withSpinner(_0x5436e4(0x252)+_0x5361e6['parentSegment']+'\x27...',()=>_0x2dae15[_0x5436e4(0x209)][_0x5436e4(0x13a)](_0x5361e6[_0x5436e4(0x113)]),{'verbose':_0x5361e6[_0x5436e4(0x20b)]});_0x40c6cc=_0x58e517[_0x5436e4(0x8b)];}let _0x5f424c;_0x120035[_0x5436e4(0x1d9)]&&(_0x5f424c=await loadJSON(_0x120035[_0x5436e4(0x1d9)],![]));const _0x5b88ca=_0x120035[_0x5436e4(0x92)]===_0x5436e4(0x195)?null:{'id':_0x120035[_0x5436e4(0x92)],'type':_0x5436e4(0x156)};_0x397555={'attributes':{'name':_0x120035['name'],'description':_0x120035[_0x5436e4(0x184)]||null,..._0x40c6cc!==undefined&&{'audienceId':_0x40c6cc},..._0x5f424c!==undefined&&{'sections':_0x5f424c}},'relationships':{'parentFolder':{'data':_0x5b88ca}}};}const _0x35f924=await withSpinner(_0x5436e4(0x1b4)+(_0x397555[_0x5436e4(0x166)]?.[_0x5436e4(0x23b)]??'')+'\x27...',()=>_0x2dae15[_0x5436e4(0x18b)][_0x5436e4(0x118)](_0x397555),{'verbose':_0x5361e6['verbose']}),_0x446d43=_0x35f924[_0x5436e4(0x8b)];return console['error'](_0x5436e4(0x1c0)+_0x446d43[_0x5436e4(0x23b)]+'\x27\x20with\x20ID:\x20'+_0x446d43['id']),await handleSDKOutput([_0x446d43],_0x5361e6),0x0;}}export class PSPzPatchCommand extends BaseCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0x276);[a31_0x10c381(0x184)]=a31_0x10c381(0x122);async[a31_0x10c381(0xa0)](_0xa946ba){const _0x2be4e3=a31_0x10c381,{options:_0x6054af,args:_0x75a133}=_0xa946ba,_0x5c6f16=_0x6054af,_0x276e92=_0x75a133[0x0];if(!_0x276e92)return console[_0x2be4e3(0xdd)](_0x2be4e3(0x1c8)),console[_0x2be4e3(0xdd)](_0x2be4e3(0x254)),console[_0x2be4e3(0xdd)](_0x2be4e3(0x167)),0x1;let _0x37d924;if(_0x5c6f16[_0x2be4e3(0x98)])_0x37d924=await loadJSON(_0x5c6f16['file'],!![]);else{if(!_0x5c6f16[_0x2be4e3(0x23b)])return console[_0x2be4e3(0xdd)]('Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)'),console[_0x2be4e3(0xdd)](_0x2be4e3(0x254)),0x1;if(_0x5c6f16['description']===undefined)return console[_0x2be4e3(0xdd)]('Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)'),console['error'](_0x2be4e3(0x254)),0x1;let _0x3b3da0;_0x5c6f16[_0x2be4e3(0x1d9)]&&(_0x3b3da0=await loadJSON(_0x5c6f16[_0x2be4e3(0x1d9)],![])),_0x37d924={'attributes':{'name':_0x5c6f16[_0x2be4e3(0x23b)],'description':_0x5c6f16[_0x2be4e3(0x184)]||null,..._0x3b3da0!==undefined&&{'sections':_0x3b3da0}}};}const {tdx:_0x222022}=_0xa946ba,_0x5b9e2e=await withSpinner('Patching\x20personalization\x20\x27'+_0x276e92+'\x27...',()=>_0x222022[_0x2be4e3(0x18b)][_0x2be4e3(0x219)](_0x276e92,_0x37d924),{'verbose':_0x6054af[_0x2be4e3(0x20b)]}),_0x16bf5a=_0x5b9e2e[_0x2be4e3(0x8b)];return console[_0x2be4e3(0xdd)]('✔\x20Updated\x20personalization\x20\x27'+_0x16bf5a[_0x2be4e3(0x23b)]+_0x2be4e3(0xa7)+_0x16bf5a['id']+')'),await handleSDKOutput([_0x16bf5a],_0x6054af),0x0;}}export class PSPzInitCommand extends BaseParentSegmentCommand{[a31_0x10c381(0x23b)]='ps:pz:init';[a31_0x10c381(0x184)]=a31_0x10c381(0x137);async[a31_0x10c381(0xa0)](_0x564bc0){const _0x570bde=a31_0x10c381,{options:_0x58e73d,args:_0x161f60}=_0x564bc0,_0x164dcf=_0x161f60[0x0]||_0x58e73d[_0x570bde(0x113)];if(!_0x164dcf)return showParentSegmentNotSetError('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'+'\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 _0x3a8697=resolveYamlFile(_0x164dcf);if(!existsSync(_0x3a8697))return showFileNotFoundError(_0x3a8697,_0x164dcf),0x1;let _0x4f14f2;try{_0x4f14f2=readFileSync(_0x3a8697,_0x570bde(0x20f));}catch(_0x216638){const _0x4134a5=_0x216638 instanceof Error?_0x216638[_0x570bde(0x14e)]:String(_0x216638);return console[_0x570bde(0xdd)](_0x570bde(0x1cf)+_0x4134a5),0x1;}let _0x935bc7;try{_0x935bc7=parseDef(_0x4f14f2);}catch(_0x503531){const _0x18545c=_0x503531 instanceof Error?_0x503531[_0x570bde(0x14e)]:String(_0x503531);return console[_0x570bde(0xdd)](a31_0x343d08[_0x570bde(0x11b)](_0x570bde(0xb0)+_0x18545c)),0x1;}if(_0x935bc7[_0x570bde(0x15d)]&&_0x935bc7[_0x570bde(0x15d)]['length']>0x0)return console[_0x570bde(0xdd)](a31_0x343d08[_0x570bde(0x185)]('⚠️\x20\x20personalization_services\x20section\x20already\x20exists\x20in\x20'+_0x3a8697)),console[_0x570bde(0xdd)](a31_0x343d08[_0x570bde(0x1a7)]('\x20\x20\x20'+_0x935bc7[_0x570bde(0x15d)][_0x570bde(0x190)]+_0x570bde(0x9c))),0x1;!_0x935bc7[_0x570bde(0x193)]&&(_0x935bc7[_0x570bde(0x193)]={'events':[{'name':_0x570bde(0x1df),'source_table':_0x570bde(0x262)}],'attributes':[{'name':'last_page_viewed','type':_0x570bde(0x23f)}],'id_stitching':{'primary_key':_0x935bc7[_0x570bde(0x77)][_0x570bde(0x27e)]==='customers'?_0x570bde(0x273):_0x570bde(0x10d)}});_0x935bc7[_0x570bde(0x15d)]=[{'name':_0x570bde(0x1b9),'description':_0x570bde(0x150),'trigger_event':_0x570bde(0x1df),'sections':[{'name':'Default','criteria':_0x570bde(0x11f),'attributes':[_0x570bde(0x1e4)]}]}];const _0x38615=serializeDef(_0x935bc7);return writeFileSync(_0x3a8697,_0x38615,'utf-8'),console[_0x570bde(0xdd)](a31_0x343d08[_0x570bde(0x97)]('✔')+'\x20Added\x20personalization\x20template\x20to\x20'+a31_0x343d08[_0x570bde(0x12a)](_0x3a8697)),(!_0x935bc7['realtime']||_0x4f14f2[_0x570bde(0x204)]('realtime:')===-0x1)&&console[_0x570bde(0xdd)](a31_0x343d08[_0x570bde(0x97)]('✔')+_0x570bde(0x1d0)),console[_0x570bde(0xdd)]('\x0a'+a31_0x343d08[_0x570bde(0x1a7)](_0x570bde(0x24b))),console[_0x570bde(0xdd)](_0x570bde(0x1a0)+_0x3a8697+_0x570bde(0x236)),console[_0x570bde(0xdd)](_0x570bde(0x265)+a31_0x343d08[_0x570bde(0x1a7)](_0x570bde(0x15a)+_0x164dcf)+_0x570bde(0x1bd)),0x0;}}