@treasuredata/tdx 2026.7.5 → 2026.7.6

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 (250) 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-move-command.js +1 -1
  43. package/dist/commands/segment-pull-command.js +1 -1
  44. package/dist/commands/segment-push-command.js +1 -1
  45. package/dist/commands/segment-update-command.js +1 -1
  46. package/dist/commands/segment-use-command.js +1 -1
  47. package/dist/commands/segment-validate-command.js +1 -1
  48. package/dist/commands/segments.js +1 -1
  49. package/dist/commands/show.js +1 -1
  50. package/dist/commands/status-command.js +1 -1
  51. package/dist/commands/table-deleted.js +1 -1
  52. package/dist/commands/tables.js +1 -1
  53. package/dist/commands/unset-command.js +1 -1
  54. package/dist/commands/upgrade-command.js +1 -1
  55. package/dist/commands/use-command.js +1 -1
  56. package/dist/commands/user-command.js +1 -1
  57. package/dist/commands/work-command.js +1 -1
  58. package/dist/commands/workflow-command.js +1 -1
  59. package/dist/core/auth.js +1 -1
  60. package/dist/core/command-output.js +1 -1
  61. package/dist/core/config.js +1 -1
  62. package/dist/core/connection-cache.js +1 -1
  63. package/dist/core/constants.js +1 -1
  64. package/dist/core/credential-cache.js +1 -1
  65. package/dist/core/global-context.js +1 -1
  66. package/dist/core/keychain.js +1 -1
  67. package/dist/core/oauth-keychain.js +1 -1
  68. package/dist/core/oauth.js +1 -1
  69. package/dist/core/profile.js +1 -1
  70. package/dist/core/project-config.js +1 -1
  71. package/dist/core/session.js +1 -1
  72. package/dist/core/user-cache.js +1 -1
  73. package/dist/core/version.js +1 -1
  74. package/dist/index.js +1 -1
  75. package/dist/mcp/server.js +1 -1
  76. package/dist/mcp/tools/index.js +1 -1
  77. package/dist/mcp/tools/tdx-run.js +1 -1
  78. package/dist/mcp/tools/tdx-search.js +1 -1
  79. package/dist/mcp/tools/work-create-item.js +1 -1
  80. package/dist/mcp/utils.js +1 -1
  81. package/dist/proxy/claude-usage-tracker.js +1 -1
  82. package/dist/proxy/passthrough-server.js +1 -1
  83. package/dist/proxy/sse-usage-parser.js +1 -1
  84. package/dist/sdk/agent/agent-config.js +1 -1
  85. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  86. package/dist/sdk/agent/agent-yaml.js +1 -1
  87. package/dist/sdk/agent/test/evaluator.js +1 -1
  88. package/dist/sdk/agent/test/executor.js +1 -1
  89. package/dist/sdk/agent/test/index.js +1 -1
  90. package/dist/sdk/agent/test/output.js +1 -1
  91. package/dist/sdk/agent/test/parser.js +1 -1
  92. package/dist/sdk/agent/tool-target-registry.js +1 -1
  93. package/dist/sdk/api.js +1 -1
  94. package/dist/sdk/cas/cas-api-client.js +1 -1
  95. package/dist/sdk/cas/cas-audience-schema.js +1 -1
  96. package/dist/sdk/cas/cas-audience-validator.js +1 -1
  97. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  98. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  99. package/dist/sdk/cas/index.js +1 -1
  100. package/dist/sdk/cas/pull-workflow.js +1 -1
  101. package/dist/sdk/cas/push-workflow.js +1 -1
  102. package/dist/sdk/cas/validate-files.js +1 -1
  103. package/dist/sdk/client/cdp-api-client.d.ts +6 -6
  104. package/dist/sdk/client/cdp-api-client.d.ts.map +1 -1
  105. package/dist/sdk/client/cdp-api-client.js +1 -1
  106. package/dist/sdk/client/cdp-api-client.js.map +1 -1
  107. package/dist/sdk/client/delivery-api-client.js +1 -1
  108. package/dist/sdk/client/endpoints.js +1 -1
  109. package/dist/sdk/client/engage-api-client.js +1 -1
  110. package/dist/sdk/client/http-client.js +1 -1
  111. package/dist/sdk/client/llm-api-client.js +1 -1
  112. package/dist/sdk/client/oauth-refresh.js +1 -1
  113. package/dist/sdk/client/rate-limiter.js +1 -1
  114. package/dist/sdk/client/td-api-client.js +1 -1
  115. package/dist/sdk/client/trino-api-client.js +1 -1
  116. package/dist/sdk/client/workflow-client.js +1 -1
  117. package/dist/sdk/connection-validator.js +1 -1
  118. package/dist/sdk/connection.js +1 -1
  119. package/dist/sdk/delivery.js +1 -1
  120. package/dist/sdk/engage/campaign-pull.js +1 -1
  121. package/dist/sdk/engage/campaign-push.js +1 -1
  122. package/dist/sdk/engage/campaign-validator.js +1 -1
  123. package/dist/sdk/engage/campaign-yaml.js +1 -1
  124. package/dist/sdk/engage/template-pull.js +1 -1
  125. package/dist/sdk/engage/template-push.js +1 -1
  126. package/dist/sdk/engage/template-validator.js +1 -1
  127. package/dist/sdk/engage/template-yaml.js +1 -1
  128. package/dist/sdk/engage/types/campaign-def.js +1 -1
  129. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  130. package/dist/sdk/engage/types/template-schema.js +1 -1
  131. package/dist/sdk/engage.js +1 -1
  132. package/dist/sdk/errors.js +1 -1
  133. package/dist/sdk/index.js +1 -1
  134. package/dist/sdk/io/index.js +1 -1
  135. package/dist/sdk/io/node-filesystem.js +1 -1
  136. package/dist/sdk/job.js +1 -1
  137. package/dist/sdk/journey.js +1 -1
  138. package/dist/sdk/llm/chat-cache.js +1 -1
  139. package/dist/sdk/llm/index.js +1 -1
  140. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  141. package/dist/sdk/llm/model-factors.js +1 -1
  142. package/dist/sdk/llm/user-settings.js +1 -1
  143. package/dist/sdk/personalization.js +1 -1
  144. package/dist/sdk/policy.js +1 -1
  145. package/dist/sdk/query/deleted-table-validation.js +1 -1
  146. package/dist/sdk/query/index.js +1 -1
  147. package/dist/sdk/query/sql-parser.js +1 -1
  148. package/dist/sdk/realtime.js +1 -1
  149. package/dist/sdk/schedule.js +1 -1
  150. package/dist/sdk/segment/child-segment-yaml.d.ts +0 -8
  151. package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
  152. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  153. package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
  154. package/dist/sdk/segment/fields-display.js +1 -1
  155. package/dist/sdk/segment/file-discovery.js +1 -1
  156. package/dist/sdk/segment/journey-utils.js +1 -1
  157. package/dist/sdk/segment/journey-validator.js +1 -1
  158. package/dist/sdk/segment/journey-yaml.js +1 -1
  159. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  160. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  161. package/dist/sdk/segment/pull-workflow.js +1 -1
  162. package/dist/sdk/segment/push-recovery.js +1 -1
  163. package/dist/sdk/segment/push-workflow.d.ts.map +1 -1
  164. package/dist/sdk/segment/push-workflow.js +1 -1
  165. package/dist/sdk/segment/push-workflow.js.map +1 -1
  166. package/dist/sdk/segment/resolution-context.js +1 -1
  167. package/dist/sdk/segment/segment-path-parser.js +1 -1
  168. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  169. package/dist/sdk/segment/segment-validator.js +1 -1
  170. package/dist/sdk/segment/target-resolution.js +1 -1
  171. package/dist/sdk/segment/tdx-config.js +1 -1
  172. package/dist/sdk/segment/types/activation-schema.d.ts +66 -7
  173. package/dist/sdk/segment/types/activation-schema.d.ts.map +1 -1
  174. package/dist/sdk/segment/types/activation-schema.js +1 -1
  175. package/dist/sdk/segment/types/activation-schema.js.map +1 -1
  176. package/dist/sdk/segment/types/journey-def.js +1 -1
  177. package/dist/sdk/segment/types/journey-schema.js +1 -1
  178. package/dist/sdk/segment/types/segment-def.d.ts +1 -1
  179. package/dist/sdk/segment/types/segment-def.d.ts.map +1 -1
  180. package/dist/sdk/segment/types/segment-def.js +1 -1
  181. package/dist/sdk/segment/types/segment-def.js.map +1 -1
  182. package/dist/sdk/segment/types/segment-schema.d.ts +110 -1
  183. package/dist/sdk/segment/types/segment-schema.d.ts.map +1 -1
  184. package/dist/sdk/segment/types/segment-schema.js +1 -1
  185. package/dist/sdk/segment/types/segment-schema.js.map +1 -1
  186. package/dist/sdk/segment/validate-files.js +1 -1
  187. package/dist/sdk/segment/yaml-validator.js +1 -1
  188. package/dist/sdk/segment.js +1 -1
  189. package/dist/sdk/types/cdp.d.ts +7 -3
  190. package/dist/sdk/types/cdp.d.ts.map +1 -1
  191. package/dist/sdk/types/index.js +1 -1
  192. package/dist/sdk/types/progress.js +1 -1
  193. package/dist/sdk/types/workspace.js +1 -1
  194. package/dist/sdk/user.js +1 -1
  195. package/dist/sdk/util/format-detector.js +1 -1
  196. package/dist/sdk/util/formatters.js +1 -1
  197. package/dist/sdk/util/index.js +1 -1
  198. package/dist/sdk/util/paginate.js +1 -1
  199. package/dist/sdk/util/tree-formatter.js +1 -1
  200. package/dist/sdk/util/tree-search.js +1 -1
  201. package/dist/sdk/workflow/archive-validation.js +1 -1
  202. package/dist/sdk/workflow/clone-workflow.js +1 -1
  203. package/dist/sdk/workflow/index.js +1 -1
  204. package/dist/sdk/workflow/pull-workflow.js +1 -1
  205. package/dist/sdk/workflow/push-workflow.js +1 -1
  206. package/dist/sdk/workflow/task-graph.js +1 -1
  207. package/dist/sdk/workflow/tdx-config.js +1 -1
  208. package/dist/sdk/workflow/workflow-utils.js +1 -1
  209. package/dist/sdk/workspace/access-tracker.js +1 -1
  210. package/dist/sdk/workspace/frontmatter.js +1 -1
  211. package/dist/sdk/workspace/git.js +1 -1
  212. package/dist/sdk/workspace/index.js +1 -1
  213. package/dist/sdk/workspace/templates.js +1 -1
  214. package/dist/sdk/workspace/weekly.js +1 -1
  215. package/dist/sdk/workspace/wikilinks.js +1 -1
  216. package/dist/test-utils/command-runner.js +1 -1
  217. package/dist/test-utils/factories.js +1 -1
  218. package/dist/test-utils/fixtures.js +1 -1
  219. package/dist/test-utils/http-mock.js +1 -1
  220. package/dist/test-utils/index.js +1 -1
  221. package/dist/utils/async.js +1 -1
  222. package/dist/utils/claude-code-state.js +1 -1
  223. package/dist/utils/colors.js +1 -1
  224. package/dist/utils/diff.js +1 -1
  225. package/dist/utils/file-permissions.js +1 -1
  226. package/dist/utils/file-reader.js +1 -1
  227. package/dist/utils/github-releases.js +1 -1
  228. package/dist/utils/global-cache.js +1 -1
  229. package/dist/utils/json-loader.js +1 -1
  230. package/dist/utils/local-cache.js +1 -1
  231. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  232. package/dist/utils/logger/formatters/index.js +1 -1
  233. package/dist/utils/logger/handlers/console-handler.js +1 -1
  234. package/dist/utils/logger/handlers/file-handler.js +1 -1
  235. package/dist/utils/logger/handlers/index.js +1 -1
  236. package/dist/utils/logger/handlers/null-handler.js +1 -1
  237. package/dist/utils/logger/index.js +1 -1
  238. package/dist/utils/logger/logger.js +1 -1
  239. package/dist/utils/logger/types.js +1 -1
  240. package/dist/utils/option-validation.js +1 -1
  241. package/dist/utils/process.js +1 -1
  242. package/dist/utils/prompt.js +1 -1
  243. package/dist/utils/proxy-fetch.js +1 -1
  244. package/dist/utils/spinner.js +1 -1
  245. package/dist/utils/sse-parser.js +1 -1
  246. package/dist/utils/string-utils.js +1 -1
  247. package/dist/utils/table-ref-parser.js +1 -1
  248. package/dist/utils/tdx-logger.js +1 -1
  249. package/dist/utils/version-check.js +1 -1
  250. package/package.json +1 -1
@@ -1 +1 @@
1
- const a31_0x8f883f=a31_0x4783;(function(_0x4a6599,_0x251960){const _0x44a115=a31_0x4783,_0x30e972=_0x4a6599();while(!![]){try{const _0x17faf7=-parseInt(_0x44a115(0x255))/0x1*(parseInt(_0x44a115(0x2b7))/0x2)+parseInt(_0x44a115(0x252))/0x3*(parseInt(_0x44a115(0x28e))/0x4)+-parseInt(_0x44a115(0x267))/0x5+-parseInt(_0x44a115(0x30b))/0x6+-parseInt(_0x44a115(0x251))/0x7+-parseInt(_0x44a115(0x383))/0x8*(-parseInt(_0x44a115(0x358))/0x9)+parseInt(_0x44a115(0x2ff))/0xa;if(_0x17faf7===_0x251960)break;else _0x30e972['push'](_0x30e972['shift']());}catch(_0xb1bb3e){_0x30e972['push'](_0x30e972['shift']());}}}(a31_0x32cf,0xb20f4));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a31_0x404746 from'path';function a31_0x32cf(){const _0x1a495a=['Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','keyEventCriteria','start','\x20rows\x20','apply','interval','👥\x20','Fetching\x20customers\x20schema...','payload','segment:parent:show','RT\x202.0:','Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]','Attempt:','coveragePercent','push','idStitching','getParentSQL','site','filter','⚡\x20Enabled','sampleData','Error:\x20Service\x20name\x20is\x20required','Create\x20a\x20personalization\x20service\x20for\x20a\x20parent\x20segment','⚠️\x20\x20personalization_services\x20section\x20already\x20exists\x20in\x20','addAttributesFile','No\x20RT\x20journeys\x20found','\x20+\x20[','\x20\x201.\x20Edit\x20','using\x20the\x20default\x20path:\x20','\x20\x20Columns:\x20','varchar','\x22\x20}','\x20tdx\x20wf\x20attempt\x20','Options:\x0a','No\x20personalizations\x20configured','timezone','✔\x20Deleted\x20personalization\x20service\x20\x27','712qcoSPd','foreignKey','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]','id:\x20','\x0a⚠️\x20\x20Migrating:\x20','population','Analyzing\x20changes...','✔\x20Query\x20completed:\x20Processed\x20','Show\x20parent\x20segment\x20details','Join\x20on:','utf-8','Error:\x20--folder-id\x20is\x20required.\x20Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID.','\x20--interval\x20','all','setJobId','Attribute:','Error:\x20--database\x20and\x20--table\x20are\x20required','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','Updated','pushParentYaml','✔\x20Resumed\x20activations\x20for\x20RT\x20journey\x20\x27','Error:\x20Token\x20\x27','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','\x20[Job\x20ID:\x20','launched','listPersonalizations','public:','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','totalEvents','Listing\x20personalizations\x20for\x20\x27','Creating\x20parent\x20segment\x20\x27','Attributes:','.yaml','✔\x20No\x20changes\x20-\x20\x27','\x27\x20for\x20service\x20\x27','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]\x0a','\x20\x20\x20\x20-\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','\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','\x20=\x20','Error:\x20Token\x20ID\x20is\x20required','518302VoxteM','Error:\x20File\x20not\x20found:\x20','ps:pz:service:show','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','pauseJourney','no\x20tokens\x20configured','\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)','\x0aTip:\x20Run\x20`tdx\x20ps\x20pz\x20service\x20init`\x20to\x20add\x20a\x20template\x20personalization\x20section\x20to\x20your\x20YAML','\x20Added\x20personalization\x20template\x20to\x20','sections:','Error:\x20Parent\x20segment\x20name\x20is\x20required','\x0a⚠\x20Save\x20this\x20token\x20value\x20-\x20it\x20will\x20not\x20be\x20shown\x20again:','displayAttributesStats','enriched','\x0a⚠️\x20\x20Both\x20','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','✔\x20Created\x20token\x20\x27','\x20parent\x20segment\x20\x27','Default','scheduleOption','\x27\x20is\x20up\x20to\x20date','Delete\x20a\x20realtime\x20personalization','localeCompare','Columns:','\x27\x20and\x20run\x20workflow?','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]\x0a','stop','\x27\x20not\x20found\x20in\x20any\x20personalization\x20service','✔\x20Found\x20','Executing\x20parent\x20segment\x20query...','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','win32','run','state','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--file\x20<path>','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','List\x20available\x20fields\x20for\x20segmentation','stitchingKeys','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','To\x20cancel:','jobId','Error\x20parsing\x20YAML:\x20','test','allowedIps','behavior_','deletePersonalization','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','getPersonalization','SQL\x20query:\x0a','realtime:','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','\x27\x20(id:\x20','✔\x20Found\x20personalization\x20\x27','personalization_services','displaySampleData','\x20to\x20configure\x20your\x20personalization\x20service','\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}','jsonl','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','\x20--attribute\x20\x22','yes','token:','formatSchemaJson','Found\x20YAML\x20file:\x20','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','\x0aChanges\x20to\x20apply\x20to\x20\x27','toFixed','scheduleType','dim','24747790lGaiYg','indexOf','text','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','✔\x20Updated\x20personalization\x20\x27','darwin','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','\x20service','name','sourceTableError','Errors:','905898cynXqz','keyEventId:','\x20personalization\x20service','Name:\x20','\x20--enriched','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','Usage:\x20tdx\x20ps\x20pz\x20delete\x20<personalization_id>','{\x0a\x20\x20\x22database\x22:\x20\x22','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','Error:\x20Service\x20ID\x20is\x20required','schemaError','enabled','customers','Options\x20(one\x20required):\x0a','ID\x20Stitching:','listJourneys','ps:pz:show','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','RT\x202.0\x20Validate:','sort','Validate:','Rows:','Available\x20behaviors:','\x20is\x20already\x20up\x20to\x20date','Usage:\x20tdx\x20ps\x20pz\x20show\x20<personalization_id>','created:','endsWith','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]','some','getCurrentConfigVersion','stageCount','workflowAttemptId','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>','join','\x27\x20is\x20already\x20up\x20to\x20date','/app/dw/parentSegments/','segment:parent:update','any','reduce','\x20\x202.\x20Run\x20','cyan','\x0a\x20\x20\x20\x20}','createdAt','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','Master\x20+\x20Attributes','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]','\x0aUsage:\x20tdx\x20ps\x20preview\x20','information_schema','\x20kill','Listing\x20parent\x20segments...','page_view','folderId','personalizationServices','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','Add\x20template\x20personalization\x20section\x20to\x20parent\x20segment\x20YAML','attributesFile','Events:','Show\x20personalization\x20service\x20details','✔\x20Updated\x20personalization\x20service\x20\x27','Resume\x20activations\x20in\x20an\x20RT\x20journey','Finding\x20service\x20for\x20token...','Error:\x20--behavior\x20requires\x20a\x20name\x0a','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','ps:pz:service:token:delete','ps:pz:delete','log','replace','✔\x20Deleted\x20personalization\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','\x20Configuration\x20is\x20valid','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','rowCount','description','\x0a\x20\x20\x20\x20]','\x20Added\x20RT\x202.0\x20template\x20section','4346253bmCbnn','status','Patching\x20personalization\x20\x27','SELECT\x20*\x20FROM\x20','green','Overwrite\x20\x27','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','Behavior:','in\x20','Creating\x20personalization\x20service\x20\x27','listParents','matchedCount','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','realtime','\x20to\x20push\x20the\x20configuration','unref','master','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context','\x20\x20Tables:\x201\x20customers\x20+\x20','\x20configured','sections','Error:','FINISHED','`\x20to\x20download\x20the\x20configuration\x20first','<database>.<table>','workflowSessionId','json','match','tokens','\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20','platform','realtime_enabled','ps:rt:list','Status:','\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','map','Delete\x20a\x20token\x20from\x20a\x20personalization\x20service','\x0a\x20\x20]\x0a}\x0a','Create\x20a\x20realtime\x20personalization\x20entity','displayColumns','\x20Context\x20set:\x20','16tkxFON','eventKind:\x20','ps:pz:service:update','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context','ps:pz:init','getOutputDatabaseName','displayBehaviorsStats','resolveParentId','ps:rt:jn:resume','includeSensitive','✔\x20Created\x20personalization\x20service\x20\x27','column','displayMasterInfo','YAML\x20file:\x20','session','format','output','/app/workflows/','ps:rt:jn:pause','Get\x20SQL\x20query\x20for\x20parent\x20segment','Master\x20Table','\x20RT-enabled\x20parent\x20segment','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','\x20personalization','Next\x20steps:','Apply\x20changes\x20to\x20\x27','open','relationships','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','✘\x20Failed\x20to\x20rename\x20directory:\x20','Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20all\x20tables\x20(requires\x20context)\x0a','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','column_name','Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]','Fetching\x20parent\x20segment\x20\x27','\x20(paused)','primaryKey','/{name}.yml\x0a','\x0aNo\x20sample\x20data\x20available','\x20\x20\x20\x20\x20\x20','Fetching\x20SQL\x20for\x20\x27','query','\x0aChanges\x20to\x20\x27','database','✔\x20Deleted\x20token\x20\x27','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','identifier','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','entryCriteria','✔\x20Paused\x20activations\x20for\x20RT\x20journey\x20\x27','string','%)\x20','/sessions/','/\x20directory.\x0a','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','\x20\x20No\x20sample\x20data\x20available','\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','parent_id','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context','use','stats','Delete\x20a\x20personalization\x20service','stringify','Master:','Error:\x20Token\x20name\x20is\x20required','-1d','✔\x20Created\x20parent\x20segment\x20\x27','elapsedTimeMillis','validateParentYaml','collectSchema','attribute','length','red','deleteToken','\x20No\x20changes\x20-\x20','/\x20directories\x20exist.','tdx\x20ps\x20preview\x20','segment:parent:desc','identifier:\x20','behaviors','getBehaviorNames','Update\x20a\x20realtime\x20personalization\x20entity','\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a','Show\x20parent\x20segment\x20schema\x20(column\x20types)','columns','\x20rows)','td_client_id','file','segment:parent:pull','Error:\x20--name\x20is\x20required','Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','entryCriteria:','eventKind','updatedAt','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','SELECT\x20*\x20FROM\x20(\x0a','true','Created','runParent','delete','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]\x0a','ps:rt:jn:list','patchPersonalization','web','Aborted.','Source:','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','\x20\x20\x20','Usage:\x20tdx\x20ps\x20rt\x20jn\x20pause_activations\x20<journeyId>\x0a','limit','\x27\x20with\x20ID:\x20','Listing\x20fields\x20for\x20\x27','Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID,\x20then\x20add:','createToken','keyEventId','segment:parent:view','dirname','\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22','.yml','Listing\x20parent\x20segments\x20matching\x20\x27','\x22,\x20\x22type\x22:\x20\x22','toLowerCase','\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22','ps:pz:list','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','Join:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context','Database:\x20','bold','\x27...','customerGroupFile','paused','Show\x20a\x20specific\x20realtime\x20personalization','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','segment:parent:fields','value','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','displayRealtimeInfo','\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','ps:pz:service:delete','displayPreviewHints','Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','Creating','\x5c$&','To\x20view\x20sample\x20data:','RT\x20Journey\x20ID:\x20','tdx\x20ps\x20push\x20','error','execute','No\x20personalization\x20services\x20configured','✔\x20Created\x20personalization\x20\x27','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','list','parentSegment','toLocaleString','Site:\x20','label','\x20field','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]','getParentFull','segment','\x20true','Error\x20reading\x20file:\x20','Deleting\x20personalization\x20service\x20\x27','Usage:\x20tdx\x20ps\x20rt\x20jn\x20resume_activations\x20<journeyId>\x0a','List\x20parent\x20segments\x20with\x20RT\x202.0\x20status','events','Listing\x20RT\x20journeys\x20for\x20\x27','customerGroup','sourceTableValid','addAttributes','message','ps:pz:service:token:create','attributes','Coverage:','\x20--behavior\x20\x22<name>\x22','\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22','customersWithEvents','displaySummary','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]','single','table','Create\x20parent\x20segment\x20\x27','/attempt/','listFields','Creating\x20personalization\x20\x27','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','data','Pattern:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','Customers:','public','.customers)','(id:\x20','Validating\x20configuration...','joinKey','No\x20RT-enabled\x20parent\x20segments\x20found','parent_segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','Pause\x20activations\x20in\x20an\x20RT\x20journey','\x20\x20\x20\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','\x20stage','List\x20realtime\x20personalizations\x20for\x20a\x20parent\x20segment','ps:rt:configuration_versions','isDirectory','\x0aNew\x20parent\x20segment\x20\x27','allValid','Resolving\x20parent\x20segment\x20\x27','payload:','displayValidateResults','errors','\x20RT\x20configuration\x20is\x20valid','segment:parent:list','personalization','Fetching\x20personalization\x20service\x20\x27','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','allowed\x20IPs:','keys','\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','Error:\x20Personalization\x20ID\x20is\x20required','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','createParent','Parent\x20segment:\x20','customerPercent','create','split','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','behavior','Schema\x20saved\x20to\x20','Output\x20file:\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','/\x20and\x20','✔\x20Updated\x20parent\x20segment\x20\x27','trim','Audience\x20ID:','yellow','schemaValid','includeSensitive:','4455941EliYHs','5556yZoMsj','Listing\x20RT-enabled\x20parent\x20segments\x20matching\x20\x27','\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path','5PirYOg','Output\x20Database:','repeat','Personalization\x20service\x20description','Behaviors','\x20\x20Note:\x20','Preview:','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','audienceId','verbose','Validate\x20RT\x202.0\x20configuration\x20from\x20parent\x20segment\x20YAML','Getting\x20RT\x20configuration\x20version\x20for\x20\x27','audienceId:\x20','\x0aError:','type','Fetching\x20behavior\x20list...','List\x20RT\x20journeys','segment:parent:validate','4788180fHvfbH','Creating\x20token\x20\x27'];a31_0x32cf=function(){return _0x1a495a;};return a31_0x32cf();}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_0x4783(_0x444964,_0xe4a25){_0x444964=_0x444964-0x190;const _0x32cf1c=a31_0x32cf();let _0x478362=_0x32cf1c[_0x444964];return _0x478362;}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_0x1f588f from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../sdk/segment/fields-display.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';const PARENT_SEGMENT_DIR='parent_segments',LEGACY_PARENT_SEGMENT_DIR=a31_0x8f883f(0x227);function openBrowser(_0x5e160d){const _0x4810ee=a31_0x8f883f,_0x43cf28=process[_0x4810ee(0x376)],_0x35549d=_0x43cf28===_0x4810ee(0x304)?_0x4810ee(0x39d):_0x43cf28===_0x4810ee(0x2d6)?_0x4810ee(0x26b):'xdg-open';spawn(_0x35549d,[_0x5e160d],{'detached':!![],'stdio':'ignore'})[_0x4810ee(0x367)]();}function migrateLegacyDirectory(){const _0x311d1c=a31_0x8f883f;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x53796d=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x53796d[_0x311d1c(0x22f)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console['error'](a31_0x1f588f['yellow'](_0x311d1c(0x2c5)+LEGACY_PARENT_SEGMENT_DIR+_0x311d1c(0x24a)+PARENT_SEGMENT_DIR+_0x311d1c(0x1a9))),console[_0x311d1c(0x1f3)](a31_0x1f588f['dim'](_0x311d1c(0x39f)+LEGACY_PARENT_SEGMENT_DIR+_0x311d1c(0x192))),![];console[_0x311d1c(0x1f3)](a31_0x1f588f[_0x311d1c(0x24e)](_0x311d1c(0x292)+LEGACY_PARENT_SEGMENT_DIR+'/\x20→\x20'+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x311d1c(0x1f3)](a31_0x1f588f[_0x311d1c(0x35c)]('✔\x20Renamed\x20directory\x20to\x20'+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x3b72cb){const _0x5bc7ca=_0x3b72cb instanceof Error?_0x3b72cb[_0x311d1c(0x20d)]:String(_0x3b72cb);return console[_0x311d1c(0x1f3)](a31_0x1f588f['red'](_0x311d1c(0x3a0)+_0x5bc7ca+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a31_0x8f883f(0x2d7)](_0x55d61f){const _0x5078fd=a31_0x8f883f;return migrateLegacyDirectory(),super[_0x5078fd(0x2d7)](_0x55d61f);}}function resolveYamlFile(_0x29dda2){const _0x4c5c4e=a31_0x8f883f;if(_0x29dda2[_0x4c5c4e(0x326)](_0x4c5c4e(0x1d5))||_0x29dda2['endsWith'](_0x4c5c4e(0x2ae)))return _0x29dda2;return a31_0x404746[_0x4c5c4e(0x32d)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x29dda2)+_0x4c5c4e(0x1d5));}function formatProgressMessage(_0x30a434){const _0x1736b4=a31_0x8f883f,_0x7f51ac=_0x30a434[_0x1736b4(0x373)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x7f51ac){const [,_0x239492,_0x117494,_0x55fbed='']=_0x7f51ac;return a31_0x1f588f[_0x1736b4(0x2fe)](_0x239492+':')+'\x20'+_0x117494+a31_0x1f588f[_0x1736b4(0x2fe)](_0x55fbed);}return a31_0x1f588f[_0x1736b4(0x2fe)](_0x30a434);}function showFileNotFoundError(_0x3a2158,_0x125292){const _0x3bc3ce=a31_0x8f883f;console[_0x3bc3ce(0x1f3)](a31_0x1f588f[_0x3bc3ce(0x1a6)](_0x3bc3ce(0x2b8)+_0x3a2158+'\x0a')),console['error'](a31_0x1f588f[_0x3bc3ce(0x334)](_0x3bc3ce(0x2a9)+_0x125292+_0x3bc3ce(0x36f)));}function displayRealtimeValidation(_0x3bb464){const _0x5cc4ed=a31_0x8f883f;if(!_0x3bb464[_0x5cc4ed(0x365)])return;const _0x52ead9=_0x3bb464[_0x5cc4ed(0x365)],_0x1e813e=_0x52ead9[_0x5cc4ed(0x316)]?a31_0x1f588f[_0x5cc4ed(0x35c)](_0x5cc4ed(0x27c)):a31_0x1f588f[_0x5cc4ed(0x24e)]('⚡\x20Not\x20enabled');console[_0x5cc4ed(0x1f3)]('\x0a'+a31_0x1f588f['dim'](_0x5cc4ed(0x273))+'\x20'+_0x1e813e);if(_0x52ead9[_0x5cc4ed(0x208)]&&_0x52ead9['events']['length']>0x0){console['error']('\x20\x20'+a31_0x1f588f[_0x5cc4ed(0x2fe)]('Events:')+'\x20'+_0x52ead9[_0x5cc4ed(0x208)][_0x5cc4ed(0x1a5)]+_0x5cc4ed(0x36b));for(const _0x15b708 of _0x52ead9[_0x5cc4ed(0x208)]){const _0x514802=_0x15b708[_0x5cc4ed(0x20b)]===![]?a31_0x1f588f[_0x5cc4ed(0x1a6)]('✘'):a31_0x1f588f[_0x5cc4ed(0x35c)]('✔');console[_0x5cc4ed(0x1f3)](_0x5cc4ed(0x22a)+_0x514802+'\x20'+_0x15b708[_0x5cc4ed(0x308)]),_0x15b708[_0x5cc4ed(0x309)]&&console['error'](_0x5cc4ed(0x3aa)+a31_0x1f588f[_0x5cc4ed(0x1a6)](_0x15b708['sourceTableError']));}}if(_0x52ead9[_0x5cc4ed(0x20f)]&&_0x52ead9[_0x5cc4ed(0x20f)][_0x5cc4ed(0x1a5)]>0x0){console[_0x5cc4ed(0x1f3)]('\x20\x20'+a31_0x1f588f[_0x5cc4ed(0x2fe)](_0x5cc4ed(0x2ad))+'\x20'+_0x52ead9[_0x5cc4ed(0x20f)][_0x5cc4ed(0x1a5)]+_0x5cc4ed(0x36b));for(const _0x18dacb of _0x52ead9['attributes']){const _0x559509=_0x18dacb['valid']?a31_0x1f588f[_0x5cc4ed(0x35c)]('✔'):a31_0x1f588f[_0x5cc4ed(0x1a6)]('✘');console['error'](_0x5cc4ed(0x22a)+_0x559509+'\x20'+_0x18dacb[_0x5cc4ed(0x308)]+'\x20'+a31_0x1f588f['dim']('('+_0x18dacb[_0x5cc4ed(0x263)]+')'));}}if(_0x52ead9[_0x5cc4ed(0x278)]){const _0x4ff148=_0x52ead9[_0x5cc4ed(0x278)][_0x5cc4ed(0x2dd)]?.[_0x5cc4ed(0x1a5)]?_0x5cc4ed(0x283)+_0x52ead9['idStitching'][_0x5cc4ed(0x2dd)][_0x5cc4ed(0x32d)](',\x20')+']':'';console['error']('\x20\x20'+a31_0x1f588f[_0x5cc4ed(0x2fe)](_0x5cc4ed(0x319))+'\x20'+_0x52ead9['idStitching'][_0x5cc4ed(0x3a7)]+_0x4ff148);}if(_0x52ead9[_0x5cc4ed(0x340)]&&_0x52ead9[_0x5cc4ed(0x340)][_0x5cc4ed(0x1a5)]>0x0){console[_0x5cc4ed(0x1f3)]('\x20\x20'+a31_0x1f588f['dim']('Personalization:')+'\x20'+_0x52ead9['personalizationServices']['length']+_0x5cc4ed(0x307)+(_0x52ead9['personalizationServices'][_0x5cc4ed(0x1a5)]!==0x1?'s':''));for(const _0x284692 of _0x52ead9[_0x5cc4ed(0x340)]){console[_0x5cc4ed(0x1f3)](_0x5cc4ed(0x2b2)+_0x284692[_0x5cc4ed(0x308)]);}}}function showParentSegmentNotSetError(_0x4b0a74){const _0x2365f6=a31_0x8f883f;console[_0x2365f6(0x1f3)](a31_0x1f588f[_0x2365f6(0x24e)](_0x2365f6(0x3a2))),console[_0x2365f6(0x1f3)](_0x4b0a74);}export class ParentSegmentListCommand extends BaseCommand{[a31_0x8f883f(0x308)]=a31_0x8f883f(0x237);['description']='List\x20parent\x20segments';async[a31_0x8f883f(0x1f4)](_0x53807c){const _0x3d236e=a31_0x8f883f,{options:_0x1c69bc,args:_0x363589,tdx:_0x18ed4b}=_0x53807c,_0x3d61ae=_0x363589[0x0];_0x1c69bc[_0x3d236e(0x25e)]&&(console['error']('Site:\x20'+_0x1c69bc[_0x3d236e(0x27a)]),_0x3d61ae&&console[_0x3d236e(0x1f3)](_0x3d236e(0x21e)+_0x3d61ae));const _0x232740=await withSpinner(_0x3d61ae?_0x3d236e(0x1d6)+_0x3d61ae+_0x3d236e(0x1e0):_0x3d236e(0x33d),()=>_0x18ed4b['segment'][_0x3d236e(0x362)](),{'verbose':_0x1c69bc['verbose']});let _0x3a296b=_0x232740[_0x3d236e(0x21d)];if(_0x3d61ae){const _0x40c074=_0x3d61ae[_0x3d236e(0x34f)](/[.+^${}()|[\]\\]/g,_0x3d236e(0x1ef))[_0x3d236e(0x34f)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x186538=new RegExp('^'+_0x40c074+'$','i');_0x3a296b=_0x3a296b[_0x3d236e(0x27b)](_0x3ae5ca=>_0x186538[_0x3d236e(0x2e2)](_0x3ae5ca[_0x3d236e(0x20f)]['name']));}_0x3a296b[_0x3d236e(0x31f)]((_0x475e12,_0x1ea8e4)=>_0x475e12['attributes']['name'][_0x3d236e(0x2cd)](_0x1ea8e4[_0x3d236e(0x20f)][_0x3d236e(0x308)])),console[_0x3d236e(0x1f3)](_0x3d236e(0x2d3)+_0x3a296b[_0x3d236e(0x1a5)]+'\x20parent\x20segment'+(_0x3a296b[_0x3d236e(0x1a5)]!==0x1?'s':''));const _0x5dba02=_0x5cab0d=>{const _0x4feb74=_0x3d236e;return getConsoleNextUrl(_0x1c69bc[_0x4feb74(0x27a)],'/app/dw/parentSegments/'+_0x5cab0d);};if(_0x1c69bc[_0x3d236e(0x392)]==='json'||_0x1c69bc[_0x3d236e(0x392)]===_0x3d236e(0x2f2)){const _0x4e919a=_0x3a296b['map'](_0x3686f7=>({..._0x3686f7,'url':_0x5dba02(_0x3686f7['id'])}));await handleSDKOutput(_0x4e919a,_0x1c69bc);}else{if(_0x3a296b[_0x3d236e(0x1a5)]===0x0)_0x3d61ae?console[_0x3d236e(0x34e)]('No\x20parent\x20segments\x20match\x20pattern:\x20'+_0x3d61ae):console[_0x3d236e(0x34e)]('No\x20parent\x20segments\x20found');else for(const _0x30f701 of _0x3a296b){const _0x314a0f=_0x30f701[_0x3d236e(0x20f)][_0x3d236e(0x293)]?a31_0x1f588f[_0x3d236e(0x2fe)]('\x20('+formatRows(_0x30f701[_0x3d236e(0x20f)]['population'])+')'):'',_0xf6a913=hyperlink(_0x30f701[_0x3d236e(0x20f)][_0x3d236e(0x308)],_0x5dba02(_0x30f701['id']));console[_0x3d236e(0x34e)](_0x3d236e(0x26f)+_0xf6a913+_0x314a0f);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a31_0x8f883f(0x308)]='segment:parent:create';[a31_0x8f883f(0x355)]=a31_0x8f883f(0x2fa);async[a31_0x8f883f(0x1f4)](_0x38f3f6){const _0x148510=a31_0x8f883f,{options:_0x4021c7,args:_0x162c57,tdx:_0x4deeeb}=_0x38f3f6;console[_0x148510(0x1f3)](_0x148510(0x31c)+_0x148510(0x305)+'\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a');const _0x59dc55=_0x4021c7;if(_0x162c57[_0x148510(0x1a5)]===0x0)return console['error'](a31_0x1f588f['red']('Error:\x20Parent\x20segment\x20name\x20is\x20required')),console['error'](_0x148510(0x337)),0x1;const _0x336092=_0x162c57[0x0];if(!_0x59dc55['database']||!_0x59dc55[_0x148510(0x217)])return console[_0x148510(0x1f3)](_0x148510(0x29e)),console[_0x148510(0x1f3)](_0x148510(0x337)),0x1;_0x59dc55[_0x148510(0x25e)]&&(console['error'](_0x148510(0x1fb)+_0x59dc55[_0x148510(0x27a)]),console[_0x148510(0x1f3)](_0x148510(0x30e)+_0x336092),console[_0x148510(0x1f3)](_0x148510(0x1de)+_0x59dc55[_0x148510(0x3ae)]),console[_0x148510(0x1f3)]('Table:\x20'+_0x59dc55['table']));const _0x3024db=await loadJSONFromOptions(_0x59dc55[_0x148510(0x20f)],_0x59dc55[_0x148510(0x344)]),_0x477d87=await loadJSONFromOptions(_0x59dc55[_0x148510(0x1ad)],_0x59dc55['behaviorsFile']),_0x27a032=await loadJSONFromOptions(_0x59dc55[_0x148510(0x20a)],_0x59dc55[_0x148510(0x1e1)]),_0x1d2abf={'name':_0x336092,'description':_0x59dc55[_0x148510(0x355)],'scheduleType':_0x59dc55['scheduleType'],'scheduleOption':_0x59dc55[_0x148510(0x2ca)],'timezone':_0x59dc55[_0x148510(0x28c)],'master':{'parentDatabaseName':_0x59dc55[_0x148510(0x3ae)],'parentTableName':_0x59dc55[_0x148510(0x217)]},'attributes':_0x3024db,'behaviors':_0x477d87,'customerGroup':_0x27a032},_0x9ff39a=await withSpinner(_0x148510(0x2ac)+_0x336092+_0x148510(0x1e0),()=>_0x4deeeb['segment'][_0x148510(0x240)](_0x1d2abf),{'verbose':_0x4021c7['verbose']}),_0x5c1766=_0x9ff39a[_0x148510(0x21d)];return console[_0x148510(0x1f3)](_0x148510(0x1a0)+_0x5c1766[_0x148510(0x308)]+'\x27\x20with\x20ID:\x20'+_0x5c1766['id']),await handleSDKOutput([_0x5c1766],_0x4021c7),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a31_0x8f883f(0x308)]=a31_0x8f883f(0x330);[a31_0x8f883f(0x355)]=a31_0x8f883f(0x1ea);async[a31_0x8f883f(0x1f4)](_0x5e5145){const _0x5ec4f6=a31_0x8f883f,{options:_0x35db90,args:_0x18b3ac,tdx:_0x243b2d}=_0x5e5145;console['error'](_0x5ec4f6(0x1ff)+'\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a'+_0x5ec4f6(0x29f));const _0x3d58da=_0x35db90;if(_0x18b3ac[_0x5ec4f6(0x1a5)]===0x0)return console[_0x5ec4f6(0x1f3)](a31_0x1f588f[_0x5ec4f6(0x1a6)](_0x5ec4f6(0x2c1))),console[_0x5ec4f6(0x1f3)](_0x5ec4f6(0x1b9)),0x1;const _0x1e89da=_0x18b3ac[0x0];_0x3d58da[_0x5ec4f6(0x25e)]&&(console[_0x5ec4f6(0x1f3)](_0x5ec4f6(0x1fb)+_0x3d58da['site']),console[_0x5ec4f6(0x1f3)](_0x5ec4f6(0x241)+_0x1e89da));const _0x58895c=await withSpinner('Fetching\x20current\x20configuration\x20for\x20\x27'+_0x1e89da+_0x5ec4f6(0x1e0),()=>_0x243b2d[_0x5ec4f6(0x202)][_0x5ec4f6(0x201)](_0x1e89da),{'verbose':_0x3d58da[_0x5ec4f6(0x25e)]}),_0x582c9d=_0x58895c[_0x5ec4f6(0x21d)],_0x2d8c4a=await loadJSONFromOptions(_0x3d58da[_0x5ec4f6(0x20c)],_0x3d58da[_0x5ec4f6(0x281)]),_0x11f292=await loadJSONFromOptions(_0x3d58da['addBehaviors'],_0x3d58da['addBehaviorsFile']),_0x5a5d17={'name':_0x582c9d[_0x5ec4f6(0x308)],'description':_0x3d58da[_0x5ec4f6(0x355)]!==undefined?_0x3d58da['description']:_0x582c9d['description'],'scheduleType':_0x3d58da[_0x5ec4f6(0x2fd)]!==undefined?_0x3d58da['scheduleType']:_0x582c9d[_0x5ec4f6(0x2fd)],'scheduleOption':_0x3d58da[_0x5ec4f6(0x2ca)]!==undefined?_0x3d58da[_0x5ec4f6(0x2ca)]:_0x582c9d[_0x5ec4f6(0x2ca)],'timezone':_0x3d58da['timezone']!==undefined?_0x3d58da['timezone']:_0x582c9d['timezone'],'master':_0x582c9d[_0x5ec4f6(0x368)],'attributes':_0x2d8c4a?[..._0x582c9d['attributes']||[],..._0x2d8c4a]:_0x582c9d[_0x5ec4f6(0x20f)],'behaviors':_0x11f292?[..._0x582c9d[_0x5ec4f6(0x1ad)]||[],..._0x11f292]:_0x582c9d['behaviors'],'customerGroup':_0x582c9d[_0x5ec4f6(0x20a)]},_0x4419c0=await withSpinner('Updating\x20parent\x20segment\x20\x27'+_0x1e89da+_0x5ec4f6(0x1e0),()=>_0x243b2d['segment']['updateParent'](_0x1e89da,_0x5a5d17),{'verbose':_0x3d58da[_0x5ec4f6(0x25e)]}),_0xf64a8d=_0x4419c0[_0x5ec4f6(0x21d)];return console[_0x5ec4f6(0x1f3)](_0x5ec4f6(0x24b)+_0xf64a8d[_0x5ec4f6(0x308)]+'\x27'),await handleSDKOutput([_0xf64a8d],_0x3d58da),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a31_0x8f883f(0x308)]=a31_0x8f883f(0x1b6);['description']=a31_0x8f883f(0x1c9);async[a31_0x8f883f(0x1f4)](_0x5dd2d1){const _0x155762=a31_0x8f883f,{options:_0x45ee50,args:_0x449ac4,tdx:_0xeb860e}=_0x5dd2d1,_0x27a082=_0x45ee50,_0x3cac15=_0x449ac4[0x0]||_0x45ee50[_0x155762(0x1f9)];if(!_0x3cac15)return showParentSegmentNotSetError(_0x155762(0x2de)+_0x155762(0x364)),0x1;if(_0x27a082[_0x155762(0x199)]&&_0x27a082['output'])return console[_0x155762(0x1f3)](a31_0x1f588f[_0x155762(0x1a6)](_0x155762(0x2c6))),console[_0x155762(0x1f3)](a31_0x1f588f[_0x155762(0x2fe)](_0x155762(0x2ea))),console[_0x155762(0x1f3)](a31_0x1f588f[_0x155762(0x2fe)](_0x155762(0x285)+PARENT_SEGMENT_DIR+_0x155762(0x3a8))),console[_0x155762(0x1f3)](a31_0x1f588f[_0x155762(0x334)](_0x155762(0x35e))),0x1;const _0x49e3a4=_0x27a082[_0x155762(0x393)]||a31_0x404746[_0x155762(0x32d)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x3cac15)+_0x155762(0x1d5));_0x27a082['verbose']&&(console[_0x155762(0x1f3)](_0x155762(0x1fb)+_0x27a082[_0x155762(0x27a)]),console[_0x155762(0x1f3)](_0x155762(0x241)+_0x3cac15),console[_0x155762(0x1f3)](_0x155762(0x248)+_0x49e3a4));const _0x13080f=await withSpinner(_0x155762(0x3a5)+_0x3cac15+_0x155762(0x1e0),()=>_0xeb860e[_0x155762(0x202)]['pullParentYaml'](_0x3cac15),{'verbose':_0x27a082['verbose']}),_0x371588=_0x13080f[_0x155762(0x21d)];if(existsSync(_0x49e3a4)){const _0x5916b7=readFileSync(_0x49e3a4,_0x155762(0x298)),_0x31f804=generateDiff(_0x5916b7,_0x371588);if(!hasChanges(_0x31f804))console[_0x155762(0x1f3)](a31_0x1f588f[_0x155762(0x35c)]('✔')+_0x155762(0x1a8)+a31_0x1f588f[_0x155762(0x334)](_0x49e3a4)+_0x155762(0x323));else{console[_0x155762(0x1f3)](_0x155762(0x3ad)+_0x49e3a4+'\x27:'),console['error']('─'[_0x155762(0x257)](0x3c)),console['error'](formatDiffWithColors(_0x31f804)),console[_0x155762(0x1f3)]('─'[_0x155762(0x257)](0x3c));if(!_0x27a082[_0x155762(0x2f6)]){if(!isInteractive())return console[_0x155762(0x1f3)](a31_0x1f588f[_0x155762(0x1a6)](_0x155762(0x262)),_0x155762(0x269)),console[_0x155762(0x1f3)](a31_0x1f588f[_0x155762(0x2fe)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x4ca8b9=await confirmKey(_0x155762(0x35d)+_0x49e3a4+'\x27?');if(!_0x4ca8b9)return console[_0x155762(0x1f3)](a31_0x1f588f[_0x155762(0x24e)](_0x155762(0x1c7))),0x1;}writeFileSync(_0x49e3a4,_0x371588,_0x155762(0x298)),console[_0x155762(0x1f3)](a31_0x1f588f[_0x155762(0x35c)]('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a31_0x1f588f['cyan'](_0x49e3a4));}}else{const _0x5d7e06=a31_0x404746[_0x155762(0x1d3)](_0x49e3a4);!existsSync(_0x5d7e06)&&mkdirSync(_0x5d7e06,{'recursive':!![]}),writeFileSync(_0x49e3a4,_0x371588,_0x155762(0x298)),console[_0x155762(0x1f3)](a31_0x1f588f[_0x155762(0x35c)]('✔')+_0x155762(0x306)+a31_0x1f588f['cyan'](_0x49e3a4));}return saveSessionContext({'parent_segment':_0x3cac15},_0x27a082[_0x155762(0x391)]),console[_0x155762(0x1f3)](a31_0x1f588f[_0x155762(0x35c)]('✔')+_0x155762(0x382)+a31_0x1f588f[_0x155762(0x2fe)](_0x155762(0x227))+_0x155762(0x2b5)+a31_0x1f588f[_0x155762(0x334)](_0x3cac15)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a31_0x8f883f(0x308)]='segment:parent:push';[a31_0x8f883f(0x355)]=a31_0x8f883f(0x31d);async[a31_0x8f883f(0x1f4)](_0x4b3fae){const _0x25bb46=a31_0x8f883f,{options:_0x3f59da,args:_0x5b67e8,tdx:_0x2f99d1}=_0x4b3fae,_0x421b58=_0x3f59da,_0x4ce212=_0x5b67e8[0x0]||_0x3f59da[_0x25bb46(0x1f9)];if(!_0x4ce212)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a'+_0x25bb46(0x21f)),0x1;const _0x613a3e=resolveYamlFile(_0x4ce212);if(!existsSync(_0x613a3e))return showFileNotFoundError(_0x613a3e,_0x4ce212),0x1;_0x421b58['verbose']&&(console[_0x25bb46(0x1f3)](_0x25bb46(0x1fb)+_0x421b58['site']),console[_0x25bb46(0x1f3)](_0x25bb46(0x390)+_0x613a3e));let _0xf72e05;try{_0xf72e05=readFileSync(_0x613a3e,_0x25bb46(0x298));}catch(_0x374040){const _0x3895f4=_0x374040 instanceof Error?_0x374040[_0x25bb46(0x20d)]:String(_0x374040);return console[_0x25bb46(0x1f3)](_0x25bb46(0x204)+_0x3895f4),0x1;}const _0x4ea109=await withSpinner(_0x25bb46(0x294),()=>_0x2f99d1[_0x25bb46(0x202)][_0x25bb46(0x2a1)](_0xf72e05),{'verbose':_0x421b58[_0x25bb46(0x25e)]}),_0x2bd039=_0x4ea109['data'],{isNew:_0x36f4f9,name:_0x3f03e3,hasChanges:_0x11c0fb,diffFormatted:_0x45bca9}=_0x2bd039;if(!_0x11c0fb)return console['error']('✔\x20No\x20changes\x20-\x20\x27'+_0x3f03e3+_0x25bb46(0x32e)),0x0;_0x36f4f9?console[_0x25bb46(0x1f3)](_0x25bb46(0x230)+_0x3f03e3+'\x27:'):console[_0x25bb46(0x1f3)](_0x25bb46(0x2fb)+_0x3f03e3+'\x27:');console[_0x25bb46(0x1f3)]('─'[_0x25bb46(0x257)](0x3c)),console[_0x25bb46(0x1f3)](_0x45bca9),console['error']('─'[_0x25bb46(0x257)](0x3c));const _0x13c99d=_0x36f4f9?_0x25bb46(0x218)+_0x3f03e3+'\x27?':_0x25bb46(0x39c)+_0x3f03e3+'\x27?';if(!_0x421b58['yes']){if(!isInteractive())return console[_0x25bb46(0x1f3)](a31_0x1f588f[_0x25bb46(0x1a6)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x25bb46(0x1f3)](a31_0x1f588f['dim'](_0x25bb46(0x2e6))),0x1;const _0x49e7a7=await confirmKey(_0x13c99d);if(!_0x49e7a7)return console[_0x25bb46(0x1f3)](a31_0x1f588f[_0x25bb46(0x24e)]('Aborted.')),0x1;}const _0xbb75f5=_0x36f4f9?_0x25bb46(0x1ee):'Updating',_0x483791=await withSpinner(_0xbb75f5+_0x25bb46(0x2c8)+_0x3f03e3+_0x25bb46(0x1e0),()=>_0x2bd039['apply'](),{'verbose':_0x421b58['verbose']}),_0x536939=_0x483791[_0x25bb46(0x21d)],_0x21c9f6=getConsoleNextUrl(_0x421b58[_0x25bb46(0x27a)],_0x25bb46(0x32f)+_0x536939['id']),_0x1d613d=_0x36f4f9?_0x25bb46(0x1c0):_0x25bb46(0x2a0);return console['error']('✔\x20'+_0x1d613d+'\x20parent\x20segment\x20\x27'+_0x536939[_0x25bb46(0x308)]+'\x27'),console[_0x25bb46(0x1f3)]('\x20\x20'+_0x21c9f6),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{['name']=a31_0x8f883f(0x266);[a31_0x8f883f(0x355)]=a31_0x8f883f(0x342);async[a31_0x8f883f(0x1f4)](_0x3fceb6){const _0x56212b=a31_0x8f883f,{options:_0x4aefe3,args:_0x3fcdc0,tdx:_0x572bcd}=_0x3fceb6,_0x29f4cc=_0x4aefe3,_0x902f7a=_0x3fcdc0[0x0]||_0x4aefe3[_0x56212b(0x1f9)];if(!_0x902f7a)return showParentSegmentNotSetError(_0x56212b(0x21c)+_0x56212b(0x1e7)+'Options:\x0a'+_0x56212b(0x302)+_0x56212b(0x313)+_0x56212b(0x193)),0x1;const _0x32e5bb=resolveYamlFile(_0x902f7a);if(!existsSync(_0x32e5bb))return showFileNotFoundError(_0x32e5bb,_0x902f7a),0x1;_0x29f4cc[_0x56212b(0x25e)]&&(console['error'](_0x56212b(0x1fb)+_0x29f4cc['site']),console[_0x56212b(0x1f3)](_0x56212b(0x390)+_0x32e5bb));let _0x63a2b;try{_0x63a2b=readFileSync(_0x32e5bb,_0x56212b(0x298));}catch(_0x4b38d6){const _0x3d8437=_0x4b38d6 instanceof Error?_0x4b38d6[_0x56212b(0x20d)]:String(_0x4b38d6);return console[_0x56212b(0x1f3)](_0x56212b(0x204)+_0x3d8437),0x1;}const _0x2e9b52=createCommandSpinner(a31_0x1f588f[_0x56212b(0x2fe)](_0x56212b(0x224)),{'verbose':_0x29f4cc['verbose']});_0x2e9b52[_0x56212b(0x26b)]();const _0x33a7ce={'onProgress':_0x43f95f=>{const _0x1e4fe3=_0x56212b;_0x2e9b52[_0x1e4fe3(0x301)]=formatProgressMessage(_0x43f95f);}};if(_0x29f4cc['master'])_0x33a7ce['master']=!![];if(_0x29f4cc[_0x56212b(0x2c4)])_0x33a7ce[_0x56212b(0x2c4)]=!![];_0x29f4cc['attribute']&&(_0x33a7ce['attribute']=_0x29f4cc['attribute']);_0x29f4cc[_0x56212b(0x246)]&&(_0x33a7ce['behavior']=_0x29f4cc[_0x56212b(0x246)]);if(_0x29f4cc['interval'])_0x33a7ce[_0x56212b(0x26e)]=_0x29f4cc['interval'];let _0xa0b727;try{_0xa0b727=await _0x572bcd[_0x56212b(0x202)]['validateParentYaml'](_0x63a2b,_0x33a7ce),_0x2e9b52[_0x56212b(0x2d1)]();}catch(_0x3d9f3d){_0x2e9b52['stop']();throw _0x3d9f3d;}const _0x293135=_0x29f4cc[_0x56212b(0x26e)]||_0x56212b(0x19f);return this[_0x56212b(0x234)](_0xa0b727,_0x33a7ce,_0x32e5bb,_0x293135),_0xa0b727['allValid']?0x0:0x1;}[a31_0x8f883f(0x234)](_0x352e2f,_0x2922c1,_0x117c43,_0x15cee1){const _0xc8410e=a31_0x8f883f;console['error']('\x0a'+a31_0x1f588f[_0xc8410e(0x1df)](_0xc8410e(0x320))+'\x20'+_0x352e2f['name']),console[_0xc8410e(0x1f3)]('═'[_0xc8410e(0x257)](0x3c)),this[_0xc8410e(0x38f)](_0x352e2f);if(typeof _0x2922c1[_0xc8410e(0x1a4)]===_0xc8410e(0x3b5)){this[_0xc8410e(0x2c3)](_0x352e2f),this[_0xc8410e(0x214)](_0x352e2f),this[_0xc8410e(0x1ec)](_0x117c43,_0x15cee1,'attribute',_0x2922c1[_0xc8410e(0x1a4)]);return;}if(_0x2922c1['attribute']===!![]){this[_0xc8410e(0x2c3)](_0x352e2f),this[_0xc8410e(0x214)](_0x352e2f),this['displayPreviewHints'](_0x117c43,_0x15cee1,_0xc8410e(0x20f));return;}if(typeof _0x2922c1[_0xc8410e(0x246)]==='string'){this[_0xc8410e(0x389)](_0x352e2f,_0x15cee1),this[_0xc8410e(0x214)](_0x352e2f),this['displayPreviewHints'](_0x117c43,_0x15cee1,_0xc8410e(0x246),_0x2922c1[_0xc8410e(0x246)]);return;}if(_0x2922c1[_0xc8410e(0x246)]===!![]){this['displayBehaviorsStats'](_0x352e2f,_0x15cee1),this[_0xc8410e(0x214)](_0x352e2f),this[_0xc8410e(0x1ec)](_0x117c43,_0x15cee1,'behaviors');return;}this[_0xc8410e(0x2c3)](_0x352e2f),this[_0xc8410e(0x389)](_0x352e2f,_0x15cee1),this[_0xc8410e(0x1e8)](_0x352e2f),this[_0xc8410e(0x214)](_0x352e2f),this['displayPreviewHints'](_0x117c43,_0x15cee1,_0xc8410e(0x29b));}[a31_0x8f883f(0x1e8)](_0xcd1749){displayRealtimeValidation(_0xcd1749);}[a31_0x8f883f(0x1ec)](_0x149724,_0x26c4ea,_0x2f95d1,_0xae37a){const _0x41bd64=a31_0x8f883f;console[_0x41bd64(0x1f3)]('\x0a'+a31_0x1f588f['dim'](_0x41bd64(0x1f0)));const _0x38c5a4=_0x26c4ea!==_0x41bd64(0x19f)?_0x41bd64(0x29a)+_0x26c4ea:'';if(_0x2f95d1===_0x41bd64(0x1a4)&&_0xae37a)console[_0x41bd64(0x1f3)]('\x20\x20'+a31_0x1f588f[_0x41bd64(0x2fe)](_0x41bd64(0x1aa)+_0x149724+_0x41bd64(0x2f5)+_0xae37a+'\x22'+_0x38c5a4));else{if(_0x2f95d1==='behavior'&&_0xae37a)console[_0x41bd64(0x1f3)]('\x20\x20'+a31_0x1f588f['dim'](_0x41bd64(0x1aa)+_0x149724+'\x20--behavior\x20\x22'+_0xae37a+'\x22'+_0x38c5a4));else(_0x2f95d1===_0x41bd64(0x20f)||_0x2f95d1===_0x41bd64(0x29b))&&console['error']('\x20\x20'+a31_0x1f588f[_0x41bd64(0x2fe)](_0x41bd64(0x1aa)+_0x149724+'\x20--attribute\x20\x22<name>\x22'+_0x38c5a4));}(_0x2f95d1===_0x41bd64(0x1ad)||_0x2f95d1===_0x41bd64(0x29b))&&console['error']('\x20\x20'+a31_0x1f588f[_0x41bd64(0x2fe)](_0x41bd64(0x1aa)+_0x149724+_0x41bd64(0x211)+_0x38c5a4)),_0x2f95d1===_0x41bd64(0x29b)&&console[_0x41bd64(0x1f3)]('\x20\x20'+a31_0x1f588f['dim']('tdx\x20ps\x20preview\x20'+_0x149724+_0x41bd64(0x30f)+_0x38c5a4));}['displayMasterInfo'](_0x501628){const _0x35efa8=a31_0x8f883f,{master:_0x5820d1}=_0x501628,_0xab3b8b=_0x5820d1[_0x35efa8(0x24f)]?a31_0x1f588f['green']('✔'):a31_0x1f588f[_0x35efa8(0x1a6)]('✘');console['error']('\x0a'+a31_0x1f588f[_0x35efa8(0x2fe)](_0x35efa8(0x397))),console[_0x35efa8(0x1f3)](_0xab3b8b+'\x20'+a31_0x1f588f['bold'](_0x5820d1[_0x35efa8(0x3ae)]+'.'+_0x5820d1['table'])),_0x5820d1[_0x35efa8(0x24f)]?_0x5820d1[_0x35efa8(0x354)]!==undefined&&console[_0x35efa8(0x1f3)]('\x20\x20'+a31_0x1f588f[_0x35efa8(0x2fe)](_0x35efa8(0x321))+'\x20'+a31_0x1f588f[_0x35efa8(0x334)](formatRows(_0x5820d1[_0x35efa8(0x354)]))):console['error']('\x20\x20'+a31_0x1f588f[_0x35efa8(0x1a6)](_0x35efa8(0x36d))+'\x20'+_0x5820d1[_0x35efa8(0x315)]);}[a31_0x8f883f(0x2c3)](_0x1b7660){const _0x36c74e=a31_0x8f883f;if(_0x1b7660[_0x36c74e(0x20f)]['length']===0x0)return;console['error']('\x0a'+a31_0x1f588f[_0x36c74e(0x2fe)]('Attributes'));for(const _0x17513a of _0x1b7660[_0x36c74e(0x20f)]){const _0x4e9cc6=_0x17513a['schemaValid']?a31_0x1f588f[_0x36c74e(0x35c)]('✔'):a31_0x1f588f[_0x36c74e(0x1a6)]('✘');let _0x3c12fa='';if(_0x17513a[_0x36c74e(0x24f)]&&_0x17513a['matchedCount']!==undefined&&_0x17513a[_0x36c74e(0x276)]!==undefined){const _0x66181b=_0x17513a[_0x36c74e(0x276)][_0x36c74e(0x2fc)](0x1),_0x231b5c=_0x17513a['coveragePercent']>=0x50?a31_0x1f588f[_0x36c74e(0x35c)]:_0x17513a[_0x36c74e(0x276)]>=0x32?a31_0x1f588f[_0x36c74e(0x24e)]:a31_0x1f588f['red'];_0x3c12fa='\x20'+a31_0x1f588f[_0x36c74e(0x2fe)](_0x36c74e(0x210))+'\x20'+_0x231b5c(_0x66181b+'%')+'\x20('+formatRows(_0x17513a[_0x36c74e(0x363)])+_0x36c74e(0x1b3);}console[_0x36c74e(0x1f3)](_0x4e9cc6+'\x20'+a31_0x1f588f[_0x36c74e(0x1df)](_0x17513a['name'])+_0x3c12fa),console[_0x36c74e(0x1f3)]('\x20\x20'+a31_0x1f588f[_0x36c74e(0x2fe)](_0x36c74e(0x1c8))+'\x20'+a31_0x1f588f[_0x36c74e(0x1df)](_0x17513a[_0x36c74e(0x3ae)]+'.'+_0x17513a[_0x36c74e(0x217)]));const _0x3bb403=_0x17513a[_0x36c74e(0x225)]===_0x17513a[_0x36c74e(0x28f)]?a31_0x1f588f['dim'](_0x36c74e(0x297))+'\x20'+_0x17513a[_0x36c74e(0x225)]:a31_0x1f588f[_0x36c74e(0x2fe)](_0x36c74e(0x1dc))+'\x20'+_0x17513a['joinKey']+_0x36c74e(0x2b5)+_0x17513a['foreignKey'];console['error']('\x20\x20'+_0x3bb403),console['error']('\x20\x20'+a31_0x1f588f[_0x36c74e(0x2fe)](_0x36c74e(0x2ce))),this[_0x36c74e(0x381)](_0x17513a[_0x36c74e(0x1b2)]),!_0x17513a[_0x36c74e(0x24f)]&&console[_0x36c74e(0x1f3)]('\x20\x20'+a31_0x1f588f[_0x36c74e(0x1a6)](_0x36c74e(0x36d))+'\x20'+_0x17513a[_0x36c74e(0x315)]);}}[a31_0x8f883f(0x389)](_0x4aeaa6,_0x559605){const _0x2b5d9d=a31_0x8f883f;if(_0x4aeaa6[_0x2b5d9d(0x1ad)]['length']===0x0)return;console['error']('\x0a'+a31_0x1f588f['dim'](_0x2b5d9d(0x259))+'\x20'+a31_0x1f588f[_0x2b5d9d(0x2fe)]('('+_0x559605+')'));for(const _0x1f88f8 of _0x4aeaa6['behaviors']){const _0x444eb0=_0x1f88f8[_0x2b5d9d(0x24f)]?a31_0x1f588f[_0x2b5d9d(0x35c)]('✔'):a31_0x1f588f[_0x2b5d9d(0x1a6)]('✘');let _0x1b592f='';if(_0x1f88f8[_0x2b5d9d(0x24f)]&&_0x1f88f8['customersWithEvents']!==undefined&&_0x1f88f8['totalEvents']!==undefined){const _0x344c08=_0x1f88f8[_0x2b5d9d(0x242)]?.[_0x2b5d9d(0x2fc)](0x1)||'?',_0x5af37d=(_0x1f88f8[_0x2b5d9d(0x242)]??0x0)>=0x32?a31_0x1f588f['green']:(_0x1f88f8[_0x2b5d9d(0x242)]??0x0)>=0x14?a31_0x1f588f[_0x2b5d9d(0x24e)]:a31_0x1f588f[_0x2b5d9d(0x1a6)];_0x1b592f='\x20'+a31_0x1f588f[_0x2b5d9d(0x2fe)](_0x2b5d9d(0x220))+'\x20'+_0x5af37d(formatRows(_0x1f88f8[_0x2b5d9d(0x213)]))+'\x20('+_0x344c08+_0x2b5d9d(0x190)+a31_0x1f588f[_0x2b5d9d(0x2fe)](_0x2b5d9d(0x345))+'\x20'+a31_0x1f588f['cyan'](formatRows(_0x1f88f8[_0x2b5d9d(0x2aa)]));}console[_0x2b5d9d(0x1f3)](_0x444eb0+'\x20'+a31_0x1f588f['bold'](_0x1f88f8[_0x2b5d9d(0x308)])+_0x1b592f),console[_0x2b5d9d(0x1f3)]('\x20\x20'+a31_0x1f588f[_0x2b5d9d(0x2fe)](_0x2b5d9d(0x1c8))+'\x20'+a31_0x1f588f[_0x2b5d9d(0x1df)](_0x1f88f8[_0x2b5d9d(0x3ae)]+'.'+_0x1f88f8[_0x2b5d9d(0x217)]));const _0x4d9992=_0x1f88f8['joinKey']===_0x1f88f8[_0x2b5d9d(0x28f)]?a31_0x1f588f['dim'](_0x2b5d9d(0x297))+'\x20'+_0x1f88f8[_0x2b5d9d(0x225)]:a31_0x1f588f[_0x2b5d9d(0x2fe)]('Join:')+'\x20'+_0x1f88f8[_0x2b5d9d(0x225)]+_0x2b5d9d(0x2b5)+_0x1f88f8[_0x2b5d9d(0x28f)];console[_0x2b5d9d(0x1f3)]('\x20\x20'+_0x4d9992),console[_0x2b5d9d(0x1f3)]('\x20\x20'+a31_0x1f588f['dim'](_0x2b5d9d(0x2ce))),this[_0x2b5d9d(0x381)](_0x1f88f8[_0x2b5d9d(0x1b2)]),!_0x1f88f8[_0x2b5d9d(0x24f)]&&console[_0x2b5d9d(0x1f3)]('\x20\x20'+a31_0x1f588f[_0x2b5d9d(0x1a6)](_0x2b5d9d(0x36d))+'\x20'+_0x1f88f8[_0x2b5d9d(0x315)]);}}[a31_0x8f883f(0x381)](_0x576b96){const _0x4c2ba2=a31_0x8f883f;for(const _0x4e22ec of _0x576b96){_0x4e22ec['label']===_0x4e22ec['column']||_0x4e22ec['column']==='*'?console[_0x4c2ba2(0x1f3)](_0x4c2ba2(0x2b2)+_0x4e22ec['label']):console[_0x4c2ba2(0x1f3)](_0x4c2ba2(0x2b2)+_0x4e22ec[_0x4c2ba2(0x1fc)]+'\x20'+a31_0x1f588f[_0x4c2ba2(0x2fe)]('('+_0x4e22ec[_0x4c2ba2(0x38e)]+')'));}}[a31_0x8f883f(0x214)](_0x31b52c){const _0x41c843=a31_0x8f883f;console['error']('─'[_0x41c843(0x257)](0x3c));if(_0x31b52c[_0x41c843(0x235)]['length']>0x0){console['error']('\x0a'+a31_0x1f588f[_0x41c843(0x1a6)]('Errors:'));for(const _0x182b1b of _0x31b52c[_0x41c843(0x235)]){console[_0x41c843(0x1f3)]('\x20\x20'+a31_0x1f588f[_0x41c843(0x1a6)]('•')+'\x20'+_0x182b1b);}}_0x31b52c['allValid']&&console[_0x41c843(0x1f3)]('\x0a'+a31_0x1f588f['green']('✔')+_0x41c843(0x352));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a31_0x8f883f(0x308)]='segment:parent:preview';['description']=a31_0x8f883f(0x3b2);async[a31_0x8f883f(0x1f4)](_0x4e8901){const _0x14ecee=a31_0x8f883f,{options:_0x3bcb57,args:_0x5cc477,tdx:_0x23624b}=_0x4e8901,_0xb07d91=_0x3bcb57,_0x3319d0=_0x5cc477[0x0]||_0x3bcb57['parentSegment'];if(!_0x3319d0)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'+_0x14ecee(0x228)+_0x14ecee(0x318)+_0x14ecee(0x1f7)+_0x14ecee(0x2d5)+'\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a'+_0x14ecee(0x2f4)+'\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)'),0x1;if(!_0xb07d91[_0x14ecee(0x368)]&&!_0xb07d91[_0x14ecee(0x1a4)]&&!_0xb07d91[_0x14ecee(0x246)]&&!_0xb07d91[_0x14ecee(0x2c4)])return console[_0x14ecee(0x1f3)](a31_0x1f588f[_0x14ecee(0x1a6)](_0x14ecee(0x2a4))),console['error']('Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a'),console[_0x14ecee(0x1f3)]('Options:'),console['error'](_0x14ecee(0x1bd)),console[_0x14ecee(0x1f3)](_0x14ecee(0x34b)),console[_0x14ecee(0x1f3)]('\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior'),console['error'](_0x14ecee(0x1fe)),0x1;const _0x131c5b=resolveYamlFile(_0x3319d0);if(!existsSync(_0x131c5b))return showFileNotFoundError(_0x131c5b,_0x3319d0),0x1;_0xb07d91[_0x14ecee(0x25e)]&&(console['error'](_0x14ecee(0x1fb)+_0xb07d91[_0x14ecee(0x27a)]),console[_0x14ecee(0x1f3)](_0x14ecee(0x390)+_0x131c5b));let _0xc808de;try{_0xc808de=readFileSync(_0x131c5b,_0x14ecee(0x298));}catch(_0x52303d){const _0x5a2b9a=_0x52303d instanceof Error?_0x52303d[_0x14ecee(0x20d)]:String(_0x52303d);return console['error']('Error\x20reading\x20file:\x20'+_0x5a2b9a),0x1;}let _0x3d0ed2;try{_0x3d0ed2=parseDef(_0xc808de);}catch(_0xe52e42){const _0x3752d9=_0xe52e42 instanceof Error?_0xe52e42[_0x14ecee(0x20d)]:String(_0xe52e42);return console[_0x14ecee(0x1f3)](a31_0x1f588f[_0x14ecee(0x1a6)](_0x14ecee(0x2e1)+_0x3752d9)),0x1;}if(_0xb07d91[_0x14ecee(0x1a4)]===!![]||_0xb07d91[_0x14ecee(0x1a4)]===''){const _0x2b534b=_0x3d0ed2['attributes']?.[_0x14ecee(0x37d)](_0x2107a8=>_0x2107a8[_0x14ecee(0x308)])||[];if(_0x2b534b['length']===0x0)console[_0x14ecee(0x1f3)](a31_0x1f588f[_0x14ecee(0x1a6)](_0x14ecee(0x2db)));else{console['error'](a31_0x1f588f[_0x14ecee(0x1a6)]('Error:\x20--attribute\x20requires\x20a\x20name\x0a')),console[_0x14ecee(0x1f3)]('Available\x20attributes:');for(const _0x276740 of _0x2b534b){console[_0x14ecee(0x1f3)]('\x20\x20'+a31_0x1f588f[_0x14ecee(0x334)](_0x276740));}console[_0x14ecee(0x1f3)](_0x14ecee(0x33a)+_0x3319d0+_0x14ecee(0x2f5)+_0x2b534b[0x0]+'\x22');}return 0x1;}if(_0xb07d91[_0x14ecee(0x246)]===!![]||_0xb07d91['behavior']===''){const _0x503233=_0x3d0ed2['behaviors']?.[_0x14ecee(0x37d)](_0x3f684d=>_0x3f684d['name'])||[];if(_0x503233[_0x14ecee(0x1a5)]===0x0)console[_0x14ecee(0x1f3)](a31_0x1f588f[_0x14ecee(0x1a6)]('Error:\x20No\x20behaviors\x20defined\x20in\x20configuration'));else{console[_0x14ecee(0x1f3)](a31_0x1f588f['red'](_0x14ecee(0x34a))),console['error'](_0x14ecee(0x322));for(const _0xb9bc4e of _0x503233){console['error']('\x20\x20'+a31_0x1f588f['cyan'](_0xb9bc4e));}console[_0x14ecee(0x1f3)](_0x14ecee(0x33a)+_0x3319d0+'\x20--behavior\x20\x22'+_0x503233[0x0]+'\x22');}return 0x1;}const _0x399aea=createCommandSpinner(a31_0x1f588f[_0x14ecee(0x2fe)]('Fetching\x20sample\x20data...'),{'verbose':_0xb07d91[_0x14ecee(0x25e)]});_0x399aea[_0x14ecee(0x26b)]();const _0x47bb82={'onProgress':_0x2c2d13=>{_0x399aea['text']=formatProgressMessage(_0x2c2d13);}};if(_0xb07d91[_0x14ecee(0x368)])_0x47bb82['master']=!![];if(_0xb07d91['attribute']&&typeof _0xb07d91[_0x14ecee(0x1a4)]===_0x14ecee(0x3b5))_0x47bb82[_0x14ecee(0x1a4)]=_0xb07d91[_0x14ecee(0x1a4)];if(_0xb07d91[_0x14ecee(0x246)]&&typeof _0xb07d91['behavior']===_0x14ecee(0x3b5))_0x47bb82[_0x14ecee(0x246)]=_0xb07d91['behavior'];if(_0xb07d91[_0x14ecee(0x2c4)])_0x47bb82[_0x14ecee(0x2c4)]=!![];if(_0xb07d91[_0x14ecee(0x26e)])_0x47bb82[_0x14ecee(0x26e)]=_0xb07d91[_0x14ecee(0x26e)];let _0x188fe9;try{_0x188fe9=await _0x23624b[_0x14ecee(0x202)]['previewParentYaml'](_0xc808de,_0x47bb82),_0x399aea[_0x14ecee(0x2d1)]();}catch(_0x204462){_0x399aea[_0x14ecee(0x2d1)]();throw _0x204462;}return await this['displayPreviewResults'](_0x188fe9,{'master':_0xb07d91['master'],'attribute':typeof _0xb07d91['attribute']===_0x14ecee(0x3b5)?_0xb07d91['attribute']:undefined,'behavior':typeof _0xb07d91[_0x14ecee(0x246)]===_0x14ecee(0x3b5)?_0xb07d91[_0x14ecee(0x246)]:undefined,'enriched':_0xb07d91[_0x14ecee(0x2c4)]}),_0x188fe9[_0x14ecee(0x231)]?0x0:0x1;}async['displayPreviewResults'](_0x402674,_0x49c59){const _0x2ab4f1=a31_0x8f883f;console[_0x2ab4f1(0x1f3)]('\x0a'+a31_0x1f588f['bold'](_0x2ab4f1(0x25b))+'\x20'+_0x402674[_0x2ab4f1(0x308)]),console[_0x2ab4f1(0x1f3)]('═'[_0x2ab4f1(0x257)](0x3c));if(_0x49c59[_0x2ab4f1(0x368)]&&_0x402674[_0x2ab4f1(0x27d)]){const _0x2ac173=a31_0x1f588f[_0x2ab4f1(0x2fe)](_0x2ab4f1(0x19d))+'\x20'+a31_0x1f588f[_0x2ab4f1(0x1df)](_0x402674[_0x2ab4f1(0x368)][_0x2ab4f1(0x3ae)]+'.'+_0x402674[_0x2ab4f1(0x368)][_0x2ab4f1(0x217)]);await this['displaySampleData'](_0x2ac173,_0x402674[_0x2ab4f1(0x27d)]);}else{if(_0x49c59[_0x2ab4f1(0x1a4)]&&_0x402674[_0x2ab4f1(0x27d)]){const _0x44535d=a31_0x1f588f[_0x2ab4f1(0x2fe)](_0x2ab4f1(0x29d))+'\x20'+a31_0x1f588f[_0x2ab4f1(0x1df)](_0x49c59['attribute']);await this[_0x2ab4f1(0x2ef)](_0x44535d,_0x402674['sampleData']);}else{if(_0x49c59[_0x2ab4f1(0x246)]&&_0x402674['sampleData']){const _0x41af40=a31_0x1f588f['dim'](_0x2ab4f1(0x35f))+'\x20'+a31_0x1f588f[_0x2ab4f1(0x1df)](_0x49c59[_0x2ab4f1(0x246)]);await this[_0x2ab4f1(0x2ef)](_0x41af40,_0x402674['sampleData']);}else{if(_0x49c59[_0x2ab4f1(0x2c4)]&&_0x402674['sampleData']){const _0x48a346=a31_0x1f588f[_0x2ab4f1(0x2fe)]('Enriched:')+'\x20'+a31_0x1f588f[_0x2ab4f1(0x1df)](_0x2ab4f1(0x338));await this[_0x2ab4f1(0x2ef)](_0x48a346,_0x402674[_0x2ab4f1(0x27d)]);}else!_0x402674[_0x2ab4f1(0x27d)]&&console[_0x2ab4f1(0x1f3)](_0x2ab4f1(0x3a9));}}}if(_0x402674[_0x2ab4f1(0x235)][_0x2ab4f1(0x1a5)]>0x0){console[_0x2ab4f1(0x1f3)]('─'[_0x2ab4f1(0x257)](0x3c)),console[_0x2ab4f1(0x1f3)]('\x0a'+a31_0x1f588f[_0x2ab4f1(0x1a6)](_0x2ab4f1(0x30a)));for(const _0x517222 of _0x402674[_0x2ab4f1(0x235)]){console[_0x2ab4f1(0x1f3)]('\x20\x20'+a31_0x1f588f[_0x2ab4f1(0x1a6)]('•')+'\x20'+_0x517222);}}}async['displaySampleData'](_0x357e36,_0xfc5a1c){const _0x5bf79d=a31_0x8f883f;if(_0xfc5a1c[_0x5bf79d(0x1a5)]===0x0){console['error']('\x0a'+_0x357e36),console[_0x5bf79d(0x1f3)](_0x5bf79d(0x195));return;}console[_0x5bf79d(0x1f3)]('\x0a'+_0x357e36);const _0x612677=Object[_0x5bf79d(0x23c)](_0xfc5a1c[0x0])['map'](_0x1627dd=>({'name':_0x1627dd,'type':typeof _0xfc5a1c[0x0][_0x1627dd]==='number'?'double':_0x5bf79d(0x287)})),_0x3f96a2={'queryId':'preview','columns':_0x612677,'data':_0xfc5a1c,'stats':{'state':_0x5bf79d(0x36e),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0xfc5a1c[_0x5bf79d(0x1a5)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x42002c=formatAsTable(_0x3f96a2,_0xfc5a1c['length'],!![]);await writeOutput(_0x42002c,undefined,'table');}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a31_0x8f883f(0x308)]='segment:parent:run';['description']=a31_0x8f883f(0x353);async[a31_0x8f883f(0x1f4)](_0x4c2fdc){const _0x13db8a=a31_0x8f883f,{options:_0x22a9aa,args:_0x11329f,tdx:_0x29d020}=_0x4c2fdc,_0x1b61e9=_0x22a9aa,_0x2a0649=_0x11329f[0x0]||_0x22a9aa['parentSegment'];if(!_0x2a0649)return showParentSegmentNotSetError(_0x13db8a(0x245)+_0x13db8a(0x22b)),0x1;const _0x2e4aa2=resolveYamlFile(_0x2a0649);if(existsSync(_0x2e4aa2)){_0x1b61e9[_0x13db8a(0x25e)]&&console[_0x13db8a(0x1f3)](_0x13db8a(0x2f9)+_0x2e4aa2);let _0x546541;try{_0x546541=readFileSync(_0x2e4aa2,'utf-8');}catch(_0x1ddde3){const _0x45e261=_0x1ddde3 instanceof Error?_0x1ddde3['message']:String(_0x1ddde3);return console[_0x13db8a(0x1f3)]('Error\x20reading\x20file:\x20'+_0x45e261),0x1;}const _0x3c3856=await withSpinner(_0x13db8a(0x294),()=>_0x29d020['segment'][_0x13db8a(0x2a1)](_0x546541),{'verbose':_0x1b61e9['verbose']}),_0x10485b=_0x3c3856[_0x13db8a(0x21d)],{isNew:_0x27419b,name:_0x3e6724,hasChanges:_0x5807c2,diffFormatted:_0x683e48}=_0x10485b;if(_0x5807c2){_0x27419b?console[_0x13db8a(0x1f3)](_0x13db8a(0x230)+_0x3e6724+'\x27:'):console['error'](_0x13db8a(0x2fb)+_0x3e6724+'\x27:');console[_0x13db8a(0x1f3)]('─'[_0x13db8a(0x257)](0x3c)),console[_0x13db8a(0x1f3)](_0x683e48),console[_0x13db8a(0x1f3)]('─'[_0x13db8a(0x257)](0x3c));const _0x302ed6=_0x27419b?_0x13db8a(0x218)+_0x3e6724+_0x13db8a(0x2cf):'Apply\x20changes\x20to\x20\x27'+_0x3e6724+_0x13db8a(0x2cf);if(!_0x1b61e9[_0x13db8a(0x2f6)]){if(!isInteractive())return console['error'](a31_0x1f588f[_0x13db8a(0x1a6)](_0x13db8a(0x262)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x13db8a(0x1f3)](a31_0x1f588f['dim'](_0x13db8a(0x2e6))),0x1;const _0x34b138=await confirmKey(_0x302ed6);if(!_0x34b138)return console[_0x13db8a(0x1f3)](a31_0x1f588f[_0x13db8a(0x24e)](_0x13db8a(0x1c7))),0x1;}const _0x3c1c79=_0x27419b?_0x13db8a(0x1ee):'Updating';await withSpinner(_0x3c1c79+_0x13db8a(0x2c8)+_0x3e6724+_0x13db8a(0x1e0),()=>_0x10485b[_0x13db8a(0x26d)](),{'verbose':_0x1b61e9['verbose']});const _0x4cdaa9=_0x27419b?_0x13db8a(0x1c0):_0x13db8a(0x2a0);console[_0x13db8a(0x1f3)]('✔\x20'+_0x4cdaa9+_0x13db8a(0x2c8)+_0x3e6724+'\x27');}else console[_0x13db8a(0x1f3)](_0x13db8a(0x2af)+_0x3e6724+_0x13db8a(0x2cb));}const _0x45dccd=await withSpinner(_0x13db8a(0x1e4)+_0x2a0649+'\x27...',()=>_0x29d020[_0x13db8a(0x202)][_0x13db8a(0x1c1)](_0x2a0649),{'verbose':_0x1b61e9[_0x13db8a(0x25e)]}),_0x2c9717=_0x45dccd['data'],_0x41f5e7=getConsoleUrl(_0x1b61e9[_0x13db8a(0x27a)],_0x13db8a(0x394)+_0x2c9717['workflowId']+_0x13db8a(0x191)+_0x2c9717[_0x13db8a(0x371)]+_0x13db8a(0x219)+_0x2c9717[_0x13db8a(0x32b)]);return console[_0x13db8a(0x1f3)]('\x0a✔\x20Workflow\x20started'),console[_0x13db8a(0x1f3)]('\x20\x20'+a31_0x1f588f[_0x13db8a(0x2fe)](_0x13db8a(0x24d))+'\x20'+_0x2c9717[_0x13db8a(0x25d)]),console[_0x13db8a(0x1f3)]('\x20\x20'+a31_0x1f588f[_0x13db8a(0x2fe)](_0x13db8a(0x379))+'\x20'+_0x2c9717[_0x13db8a(0x359)]),console[_0x13db8a(0x1f3)]('\x20\x20'+a31_0x1f588f[_0x13db8a(0x2fe)]('Session:')+'\x20'+_0x2c9717[_0x13db8a(0x371)]),console[_0x13db8a(0x1f3)]('\x20\x20'+a31_0x1f588f[_0x13db8a(0x2fe)](_0x13db8a(0x275))+'\x20'+_0x2c9717[_0x13db8a(0x32b)]),console[_0x13db8a(0x1f3)]('\x20\x20'+_0x41f5e7),console[_0x13db8a(0x1f3)]('\x0a'+a31_0x1f588f[_0x13db8a(0x2fe)](_0x13db8a(0x2df))+_0x13db8a(0x289)+_0x2c9717['workflowAttemptId']+_0x13db8a(0x33c)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a31_0x8f883f(0x308)]=a31_0x8f883f(0x1e5);['description']=a31_0x8f883f(0x2dc);async[a31_0x8f883f(0x1f4)](_0x217efd){const _0x42dd87=a31_0x8f883f,{options:_0x85168d,args:_0x4721b8,tdx:_0xd3ebbb}=_0x217efd,_0x184b7d=_0x4721b8[0x0]||_0x85168d[_0x42dd87(0x1f9)];if(!_0x184b7d)return showParentSegmentNotSetError(_0x42dd87(0x25c)+_0x42dd87(0x1db)),0x1;_0x85168d[_0x42dd87(0x25e)]&&(console[_0x42dd87(0x1f3)](_0x42dd87(0x1fb)+_0x85168d[_0x42dd87(0x27a)]),console[_0x42dd87(0x1f3)](_0x42dd87(0x241)+_0x184b7d));const _0x4a97a3=await withSpinner(_0x42dd87(0x1ce)+_0x184b7d+_0x42dd87(0x1e0),()=>_0xd3ebbb['segment'][_0x42dd87(0x21a)](_0x184b7d),{'verbose':_0x85168d['verbose']}),_0x258b34=_0x4a97a3[_0x42dd87(0x21d)];console[_0x42dd87(0x1f3)](_0x42dd87(0x2d3)+_0x258b34[_0x42dd87(0x1a5)]+_0x42dd87(0x1fd)+(_0x258b34[_0x42dd87(0x1a5)]!==0x1?'s':''));if(_0x85168d[_0x42dd87(0x372)]||_0x85168d[_0x42dd87(0x2f2)])return await handleSDKOutput(_0x258b34,_0x85168d),0x0;return displayFieldsHumanReadable(_0x258b34,_0x184b7d),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a31_0x8f883f(0x308)]=a31_0x8f883f(0x1d2);['description']=a31_0x8f883f(0x296);async[a31_0x8f883f(0x1f4)](_0x3c81fb){const _0x5b0e82=a31_0x8f883f,{options:_0x211556,args:_0x1d9f4e,tdx:_0x4768f9}=_0x3c81fb,_0x3d3cee=_0x211556,_0x423799=_0x1d9f4e[0x0]||_0x211556['parentSegment'];if(!_0x423799)return showParentSegmentNotSetError(_0x5b0e82(0x399)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a'+_0x5b0e82(0x28a)+_0x5b0e82(0x2f3)),0x1;_0x211556[_0x5b0e82(0x25e)]&&(console[_0x5b0e82(0x1f3)](_0x5b0e82(0x1fb)+_0x211556['site']),console[_0x5b0e82(0x1f3)]('Parent\x20segment:\x20'+_0x423799));const _0x325157=await withSpinner(_0x5b0e82(0x3a5)+_0x423799+_0x5b0e82(0x1e0),()=>_0x4768f9[_0x5b0e82(0x202)][_0x5b0e82(0x201)](_0x423799),{'verbose':_0x211556[_0x5b0e82(0x25e)]}),_0x64d1a6=_0x325157['data'];if(_0x3d3cee[_0x5b0e82(0x1c6)]){const _0x4418ed=getConsoleNextUrl(_0x3d3cee[_0x5b0e82(0x27a)],_0x5b0e82(0x32f)+_0x64d1a6['id']);return console['error'](a31_0x1f588f[_0x5b0e82(0x35c)]('✔')+'\x20Opening\x20'+a31_0x1f588f[_0x5b0e82(0x334)](_0x4418ed)),openBrowser(_0x4418ed),0x0;}return await handleSingleObjectOutput(_0x64d1a6,_0x211556),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a31_0x8f883f(0x308)]=a31_0x8f883f(0x1ab);[a31_0x8f883f(0x355)]=a31_0x8f883f(0x1b1);async['execute'](_0xd96ad1){const _0x2c8d26=a31_0x8f883f,{options:_0x1f2e89,args:_0x2b5b54,tdx:_0x4fda67}=_0xd96ad1,_0x1c572f=_0x1f2e89,_0x1e5528=_0x2b5b54[0x0]||_0x1f2e89[_0x2c8d26(0x1f9)];if(!_0x1e5528)return showParentSegmentNotSetError(_0x2c8d26(0x3a1)+'\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'+'Options:\x0a'+_0x2c8d26(0x254)),0x1;_0x1f2e89[_0x2c8d26(0x25e)]&&(console[_0x2c8d26(0x1f3)](_0x2c8d26(0x1fb)+_0x1f2e89['site']),console[_0x2c8d26(0x1f3)](_0x2c8d26(0x241)+_0x1e5528));const _0x3fc902=await withSpinner(_0x2c8d26(0x232)+_0x1e5528+'\x27...',()=>_0x4fda67['segment'][_0x2c8d26(0x38a)](_0x1e5528),{'verbose':_0x1f2e89[_0x2c8d26(0x25e)]}),_0x533556=_0x3fc902[_0x2c8d26(0x21d)],_0x27a254=_0x4fda67['segment'][_0x2c8d26(0x388)](_0x533556);if(_0x1c572f[_0x2c8d26(0x393)]){const _0x22a804=await this[_0x2c8d26(0x1a3)](_0xd96ad1,_0x1e5528,_0x533556,_0x27a254),_0x42a915=this[_0x2c8d26(0x2f8)](_0x22a804);writeFileSync(_0x1c572f[_0x2c8d26(0x393)],_0x42a915);const _0x3f58ca=_0x22a804['customers']['columns']['length']+_0x22a804[_0x2c8d26(0x1ad)][_0x2c8d26(0x332)]((_0x55ee4e,_0x129abf)=>_0x55ee4e+_0x129abf[_0x2c8d26(0x1b2)][_0x2c8d26(0x1a5)],0x0),_0x55d4e3=_0x22a804[_0x2c8d26(0x1ad)][_0x2c8d26(0x27b)](_0xef5674=>_0xef5674[_0x2c8d26(0x1b2)][_0x2c8d26(0x1a5)]===0x0)[_0x2c8d26(0x1a5)];return console[_0x2c8d26(0x34e)](_0x2c8d26(0x247)+_0x1c572f[_0x2c8d26(0x393)]),console[_0x2c8d26(0x34e)]('\x20\x20Database:\x20'+_0x27a254),console[_0x2c8d26(0x34e)](_0x2c8d26(0x36a)+_0x22a804[_0x2c8d26(0x1ad)]['length']+'\x20behaviors'),console['log'](_0x2c8d26(0x286)+_0x3f58ca+'\x20total'),_0x55d4e3>0x0&&console[_0x2c8d26(0x34e)](_0x2c8d26(0x25a)+_0x55d4e3+'\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)'),0x0;}console[_0x2c8d26(0x1f3)]('\x0a'+a31_0x1f588f[_0x2c8d26(0x1df)](_0x2c8d26(0x256))+'\x20'+a31_0x1f588f[_0x2c8d26(0x334)](_0x27a254));const _0x323382=await withSpinner(_0x2c8d26(0x270),()=>_0x4fda67[_0x2c8d26(0x202)][_0x2c8d26(0x279)](_0x533556),{'verbose':_0x1f2e89['verbose']});console['error']('\x0a'+a31_0x1f588f[_0x2c8d26(0x1df)](_0x2c8d26(0x317))+'\x20'+a31_0x1f588f[_0x2c8d26(0x2fe)]('('+_0x27a254+_0x2c8d26(0x222)));const _0x1a4a35=await executeSchemaQuery(_0x323382[_0x2c8d26(0x21d)],_0x4fda67,_0x1f2e89);await handleQueryOutput(_0x1a4a35,_0x1f2e89);const _0x21b25b=await withSpinner(_0x2c8d26(0x264),()=>_0x4fda67['segment'][_0x2c8d26(0x1ae)](_0x533556),{'verbose':_0x1f2e89[_0x2c8d26(0x25e)]});for(const _0x4f4d9e of _0x21b25b[_0x2c8d26(0x21d)]){const _0x61a413=_0x2c8d26(0x2e4)+_0x4f4d9e['toLowerCase']()[_0x2c8d26(0x34f)](/\s+/g,'_'),_0x246c35='SELECT\x20*\x20FROM\x20'+_0x27a254+'.'+_0x61a413;console['error']('\x0a'+a31_0x1f588f['bold'](_0x4f4d9e)+'\x20'+a31_0x1f588f['dim']('('+_0x27a254+'.'+_0x61a413+')'));try{const _0x3cd0ba=await executeSchemaQuery(_0x246c35,_0x4fda67,_0x1f2e89);await handleQueryOutput(_0x3cd0ba,_0x1f2e89);}catch{console[_0x2c8d26(0x1f3)](a31_0x1f588f[_0x2c8d26(0x24e)](_0x2c8d26(0x2bd)));}}return 0x0;}async[a31_0x8f883f(0x1a3)](_0x1e3518,_0x477084,_0x25b5c4,_0x6ec3c6){const _0xd46104=a31_0x8f883f,{options:_0x236af6,tdx:_0x306b0c}=_0x1e3518,_0x126edd=await withSpinner(_0xd46104(0x270),()=>_0x306b0c[_0xd46104(0x202)][_0xd46104(0x279)](_0x25b5c4),{'verbose':_0x236af6[_0xd46104(0x25e)]}),_0x547f0d=await executeSchemaQuery(_0x126edd['data'],_0x306b0c,_0x236af6),_0x32814e=_0x547f0d[_0xd46104(0x21d)][_0xd46104(0x37d)](_0x213fa8=>({'name':_0x213fa8[_0xd46104(0x3a3)],'type':_0x213fa8['column_type']})),_0x54d5a8=await withSpinner(_0xd46104(0x264),()=>_0x306b0c['segment'][_0xd46104(0x1ae)](_0x25b5c4),{'verbose':_0x236af6[_0xd46104(0x25e)]}),_0x275629=[];for(const _0x1fa204 of _0x54d5a8['data']){const _0x168714=_0xd46104(0x2e4)+_0x1fa204[_0xd46104(0x1d8)]()['replace'](/\s+/g,'_'),_0x7831f9=_0xd46104(0x35b)+_0x6ec3c6+'.'+_0x168714;let _0x109bbd=[];try{const _0x271440=await executeSchemaQuery(_0x7831f9,_0x306b0c,_0x236af6);_0x109bbd=_0x271440[_0xd46104(0x21d)]['map'](_0x420f5b=>({'name':_0x420f5b[_0xd46104(0x3a3)],'type':_0x420f5b['column_type']}));}catch{}_0x275629[_0xd46104(0x277)]({'table':_0x168714,'columns':_0x109bbd});}return{'database':_0x6ec3c6,'parent_segment':_0x477084,'parent_id':_0x25b5c4,'customers':{'table':'customers','columns':_0x32814e},'behaviors':_0x275629};}['formatSchemaJson'](_0x2d1f0b){const _0x5215ae=a31_0x8f883f,_0x51c178=_0x59f5bd=>{const _0x6d68c5=a31_0x4783;if(_0x59f5bd[_0x6d68c5(0x1a5)]===0x0)return'[]';const _0x134355=_0x59f5bd[_0x6d68c5(0x37d)](_0x49afee=>_0x6d68c5(0x212)+_0x49afee[_0x6d68c5(0x308)]+_0x6d68c5(0x1d7)+_0x49afee['type']+_0x6d68c5(0x288));return'[\x0a'+_0x134355['join'](',\x0a')+_0x6d68c5(0x356);},_0x4d1401=_0x2d1f0b[_0x5215ae(0x1ad)][_0x5215ae(0x37d)](_0x4799bf=>{const _0x8c2e35=_0x5215ae;return _0x8c2e35(0x37a)+_0x4799bf['table']+_0x8c2e35(0x1e9)+_0x51c178(_0x4799bf[_0x8c2e35(0x1b2)])[_0x8c2e35(0x34f)](/^/gm,'\x20\x20')[_0x8c2e35(0x24c)]()+_0x8c2e35(0x335);})[_0x5215ae(0x32d)](',\x0a');return _0x5215ae(0x312)+_0x2d1f0b['database']+_0x5215ae(0x1d4)+_0x2d1f0b[_0x5215ae(0x227)]+'\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22'+_0x2d1f0b[_0x5215ae(0x197)]+_0x5215ae(0x1d9)+_0x2d1f0b[_0x5215ae(0x317)]['table']+_0x5215ae(0x375)+_0x51c178(_0x2d1f0b[_0x5215ae(0x317)][_0x5215ae(0x1b2)])[_0x5215ae(0x34f)](/^/gm,'\x20\x20')[_0x5215ae(0x24c)]()+_0x5215ae(0x1b0)+_0x4d1401+_0x5215ae(0x37f);}}export class ParentSegmentSQLCommand extends BaseCommand{[a31_0x8f883f(0x308)]='segment:parent:sql';[a31_0x8f883f(0x355)]=a31_0x8f883f(0x396);async[a31_0x8f883f(0x1f4)](_0x526d4d){const _0x58c55f=a31_0x8f883f,{options:_0xb59297,args:_0x28378b,tdx:_0x5614e9}=_0x526d4d,_0x598f40=_0x28378b[0x0]||_0xb59297['parentSegment'];if(!_0x598f40)return showParentSegmentNotSetError(_0x58c55f(0x2eb)+_0x58c55f(0x2ba)),0x1;_0xb59297[_0x58c55f(0x25e)]&&(console[_0x58c55f(0x1f3)](_0x58c55f(0x1fb)+_0xb59297[_0x58c55f(0x27a)]),console[_0x58c55f(0x1f3)](_0x58c55f(0x241)+_0x598f40));const _0x4c9e03=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x598f40+_0x58c55f(0x1e0),()=>_0x5614e9['segment'][_0x58c55f(0x38a)](_0x598f40),{'verbose':_0xb59297[_0x58c55f(0x25e)]}),_0x4e4860=_0x4c9e03[_0x58c55f(0x21d)],_0x1225bc=await withSpinner(_0x58c55f(0x3ab)+_0x598f40+_0x58c55f(0x1e0),()=>_0x5614e9[_0x58c55f(0x202)]['getParentSQL'](_0x4e4860),{'verbose':_0xb59297[_0x58c55f(0x25e)]}),_0x553ce0=_0x1225bc[_0x58c55f(0x21d)];return _0xb59297[_0x58c55f(0x392)]===_0x58c55f(0x372)||_0xb59297[_0x58c55f(0x392)]==='jsonl'?await handleSDKOutput([{'sql':_0x553ce0}],_0xb59297):console[_0x58c55f(0x34e)](_0x553ce0),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{['name']=a31_0x8f883f(0x272);[a31_0x8f883f(0x355)]=a31_0x8f883f(0x37c);async['execute'](_0x43e862){const _0x167082=a31_0x8f883f,{options:_0x266873,args:_0x3e7047,tdx:_0x4eeca8}=_0x43e862,_0x45c8e6=_0x3e7047[0x0]||_0x266873[_0x167082(0x1f9)];if(!_0x45c8e6)return showParentSegmentNotSetError(_0x167082(0x2da)+'\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;_0x266873[_0x167082(0x25e)]&&(console[_0x167082(0x1f3)]('Site:\x20'+_0x266873[_0x167082(0x27a)]),console[_0x167082(0x1f3)](_0x167082(0x241)+_0x45c8e6));const _0x1e740e=await withSpinner(_0x167082(0x232)+_0x45c8e6+_0x167082(0x1e0),()=>_0x4eeca8['segment']['resolveParentId'](_0x45c8e6),{'verbose':_0x266873[_0x167082(0x25e)]}),_0x4422cb=_0x1e740e[_0x167082(0x21d)],_0x190a68=await withSpinner(_0x167082(0x3ab)+_0x45c8e6+_0x167082(0x1e0),()=>_0x4eeca8[_0x167082(0x202)][_0x167082(0x279)](_0x4422cb),{'verbose':_0x266873[_0x167082(0x25e)]});let _0x409ace=_0x190a68['data'];const _0x5de130=resolveLimit(_0x266873[_0x167082(0x1cc)],DEFAULT_DISPLAY_LIMIT),_0x339085=/\bLIMIT\s+\d+/i[_0x167082(0x2e2)](_0x409ace);!_0x339085&&(_0x409ace=_0x409ace[_0x167082(0x24c)]()[_0x167082(0x34f)](/;+$/,''),_0x409ace=_0x167082(0x1be)+_0x409ace+_0x167082(0x3b0)+_0x5de130);_0x266873['verbose']&&console['error'](_0x167082(0x2e8)+_0x409ace);const _0x4a3f10=await withProgressSpinner(_0x167082(0x2d4),async _0x20927a=>{const _0x58d1e3=_0x167082,_0x3a5c0c=await _0x4eeca8[_0x58d1e3(0x3ac)][_0x58d1e3(0x1f4)](_0x409ace,{'catalog':'td','schema':_0x58d1e3(0x33b),'onJobId':_0x354f1b=>{const _0x52a8e1=_0x58d1e3;_0x20927a[_0x52a8e1(0x29c)](_0x354f1b);}});return _0x3a5c0c;},{'verbose':_0x266873[_0x167082(0x25e)]}),_0xc043c8=_0x4a3f10[_0x167082(0x21d)],_0x4cf41e=_0xc043c8[_0x167082(0x2e0)]?_0x167082(0x2a5)+_0xc043c8['jobId']+']':'';return console['error'](_0x167082(0x295)+_0xc043c8[_0x167082(0x19a)]['processedRows'][_0x167082(0x1fa)]()+_0x167082(0x26c)+(_0x167082(0x360)+formatElapsed(_0xc043c8[_0x167082(0x19a)][_0x167082(0x1a1)])+_0x4cf41e)),await handleQueryOutput(_0xc043c8,_0x266873),0x0;}}export class PSRtListCommand extends BaseCommand{[a31_0x8f883f(0x308)]=a31_0x8f883f(0x378);[a31_0x8f883f(0x355)]=a31_0x8f883f(0x207);async[a31_0x8f883f(0x1f4)](_0x36828a){const _0x20625e=a31_0x8f883f,{options:_0x5bbcca,args:_0x3e358f,tdx:_0x371392}=_0x36828a,_0x17d24a=_0x3e358f[0x0],_0x2e0278=await withSpinner(_0x17d24a?_0x20625e(0x253)+_0x17d24a+_0x20625e(0x1e0):'Listing\x20RT-enabled\x20parent\x20segments...',()=>_0x371392[_0x20625e(0x365)][_0x20625e(0x1f8)](),{'verbose':_0x5bbcca[_0x20625e(0x25e)]});let _0x1d31c1=_0x2e0278[_0x20625e(0x21d)][_0x20625e(0x27b)](_0x267871=>_0x267871[_0x20625e(0x377)]);if(_0x17d24a){const _0x104d3e=_0x17d24a['replace'](/[.+^${}()|[\]\\]/g,_0x20625e(0x1ef))['replace'](/\*/g,'.*')[_0x20625e(0x34f)](/\?/g,'.'),_0x23b30f=new RegExp('^'+_0x104d3e+'$','i');_0x1d31c1=_0x1d31c1[_0x20625e(0x27b)](_0x27f97a=>_0x23b30f[_0x20625e(0x2e2)](_0x27f97a[_0x20625e(0x308)]));}_0x1d31c1[_0x20625e(0x31f)]((_0x3800bb,_0x419d05)=>_0x3800bb[_0x20625e(0x308)][_0x20625e(0x2cd)](_0x419d05[_0x20625e(0x308)])),console[_0x20625e(0x1f3)](_0x20625e(0x2d3)+_0x1d31c1[_0x20625e(0x1a5)]+_0x20625e(0x398)+(_0x1d31c1[_0x20625e(0x1a5)]!==0x1?'s':''));const _0xce8e84=_0xe0aa7=>{const _0x331090=_0x20625e;return getConsoleNextUrl(_0x5bbcca[_0x331090(0x27a)],_0x331090(0x32f)+_0xe0aa7);};if(_0x5bbcca[_0x20625e(0x392)]===_0x20625e(0x372)||_0x5bbcca[_0x20625e(0x392)]===_0x20625e(0x2f2)){const _0x48eb95=_0x1d31c1[_0x20625e(0x37d)](_0x7ff294=>({..._0x7ff294,'url':_0xce8e84(_0x7ff294['id'])}));await handleSDKOutput(_0x48eb95,_0x5bbcca);}else{if(_0x1d31c1[_0x20625e(0x1a5)]===0x0)console['log'](_0x20625e(0x226));else for(const _0x1c3f4e of _0x1d31c1){const _0x2b6813=_0x1c3f4e[_0x20625e(0x293)]?a31_0x1f588f[_0x20625e(0x2fe)]('\x20('+formatRows(_0x1c3f4e[_0x20625e(0x293)])+')'):'',_0x544548=hyperlink(_0x1c3f4e['name'],_0xce8e84(_0x1c3f4e['id']));console['log']('⚡\x20'+_0x544548+_0x2b6813);}}return 0x0;}}export class PSRtValidateCommand extends BaseParentSegmentCommand{[a31_0x8f883f(0x308)]='ps:rt:validate';[a31_0x8f883f(0x355)]=a31_0x8f883f(0x25f);async[a31_0x8f883f(0x1f4)](_0x122d16){const _0x23fd09=a31_0x8f883f,{options:_0x20863d,args:_0x57467e,tdx:_0x257dfd}=_0x122d16,_0x42441b=_0x57467e[0x0]||_0x20863d[_0x23fd09(0x1f9)];if(!_0x42441b)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'+_0x23fd09(0x249)),0x1;const _0x30154a=resolveYamlFile(_0x42441b);if(!existsSync(_0x30154a))return showFileNotFoundError(_0x30154a,_0x42441b),0x1;let _0x5cd35e;try{_0x5cd35e=readFileSync(_0x30154a,_0x23fd09(0x298));}catch(_0x5887d3){const _0x1582ed=_0x5887d3 instanceof Error?_0x5887d3[_0x23fd09(0x20d)]:String(_0x5887d3);return console[_0x23fd09(0x1f3)](_0x23fd09(0x204)+_0x1582ed),0x1;}const _0xc76f09=createCommandSpinner(a31_0x1f588f['dim']('Validating\x20RT\x20configuration...'),{'verbose':_0x20863d[_0x23fd09(0x25e)]});_0xc76f09['start']();const _0x2361ec={'realtime':!![],'onProgress':_0x37893f=>{const _0x156d2f=_0x23fd09;_0xc76f09[_0x156d2f(0x301)]=formatProgressMessage(_0x37893f);}};let _0x1034f1;try{_0x1034f1=await _0x257dfd['segment'][_0x23fd09(0x1a2)](_0x5cd35e,_0x2361ec),_0xc76f09[_0x23fd09(0x2d1)]();}catch(_0x3e36b8){_0xc76f09['stop']();throw _0x3e36b8;}console['error']('\x0a'+a31_0x1f588f[_0x23fd09(0x1df)](_0x23fd09(0x31e))+'\x20'+_0x1034f1[_0x23fd09(0x308)]),console[_0x23fd09(0x1f3)]('═'['repeat'](0x3c)),displayRealtimeValidation(_0x1034f1),console['error']('─'[_0x23fd09(0x257)](0x3c));if(_0x1034f1['errors'][_0x23fd09(0x1a5)]>0x0){console[_0x23fd09(0x1f3)]('\x0a'+a31_0x1f588f[_0x23fd09(0x1a6)](_0x23fd09(0x30a)));for(const _0x50daa8 of _0x1034f1[_0x23fd09(0x235)]){console[_0x23fd09(0x1f3)]('\x20\x20'+a31_0x1f588f[_0x23fd09(0x1a6)]('•')+'\x20'+_0x50daa8);}}return _0x1034f1[_0x23fd09(0x231)]&&console[_0x23fd09(0x1f3)]('\x0a'+a31_0x1f588f[_0x23fd09(0x35c)]('✔')+_0x23fd09(0x236)),_0x1034f1[_0x23fd09(0x231)]?0x0:0x1;}}export class PSRtJnListCommand extends BaseCommand{[a31_0x8f883f(0x308)]=a31_0x8f883f(0x1c4);[a31_0x8f883f(0x355)]=a31_0x8f883f(0x265);async[a31_0x8f883f(0x1f4)](_0x3ff46f){const _0x4aef24=a31_0x8f883f,{options:_0x3a3ecf,args:_0x5e7996,tdx:_0x6c65cd}=_0x3ff46f,_0x48deaa=_0x5e7996[0x0]||_0x3a3ecf[_0x4aef24(0x1f9)];if(!_0x48deaa)return showParentSegmentNotSetError(_0x4aef24(0x23f)+'\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;_0x3a3ecf[_0x4aef24(0x25e)]&&(console[_0x4aef24(0x1f3)]('Site:\x20'+_0x3a3ecf[_0x4aef24(0x27a)]),console[_0x4aef24(0x1f3)](_0x4aef24(0x241)+_0x48deaa));const _0x41155f=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x48deaa+_0x4aef24(0x1e0),()=>_0x6c65cd['segment'][_0x4aef24(0x38a)](_0x48deaa),{'verbose':_0x3a3ecf[_0x4aef24(0x25e)]}),_0x55b30d=_0x41155f[_0x4aef24(0x21d)],_0x40faad=await withSpinner(_0x4aef24(0x209)+_0x48deaa+'\x27...',()=>_0x6c65cd[_0x4aef24(0x365)][_0x4aef24(0x31a)](_0x55b30d),{'verbose':_0x3a3ecf[_0x4aef24(0x25e)]}),_0x1cd4fc=_0x40faad[_0x4aef24(0x21d)];console['error'](_0x4aef24(0x2d3)+_0x1cd4fc[_0x4aef24(0x1a5)]+'\x20RT\x20journey'+(_0x1cd4fc[_0x4aef24(0x1a5)]!==0x1?'s':''));if(_0x3a3ecf[_0x4aef24(0x392)]===_0x4aef24(0x372)||_0x3a3ecf['format']===_0x4aef24(0x2f2))await handleSDKOutput(_0x1cd4fc,_0x3a3ecf);else{if(_0x1cd4fc[_0x4aef24(0x1a5)]===0x0)console[_0x4aef24(0x34e)](_0x4aef24(0x282));else for(const _0x74cf62 of _0x1cd4fc){const _0x23251c=_0x74cf62[_0x4aef24(0x2d8)]==='launched'?'🚀':'📝',_0x3b8b4e=_0x74cf62[_0x4aef24(0x1e2)]?a31_0x1f588f[_0x4aef24(0x24e)](_0x4aef24(0x3a6)):'',_0xc1ff56=a31_0x1f588f['dim']('\x20('+_0x74cf62[_0x4aef24(0x32a)]+_0x4aef24(0x22c)+(_0x74cf62[_0x4aef24(0x32a)]!==0x1?'s':'')+')');console[_0x4aef24(0x34e)](_0x23251c+'\x20'+_0x74cf62['name']+_0x3b8b4e+_0xc1ff56);}}return 0x0;}}export class PSRtJnPauseCommand extends BaseCommand{[a31_0x8f883f(0x308)]=a31_0x8f883f(0x395);[a31_0x8f883f(0x355)]=a31_0x8f883f(0x229);async[a31_0x8f883f(0x1f4)](_0x1c0158){const _0x2d6f6d=a31_0x8f883f,{options:_0x6bd80e,args:_0x3bdec3,tdx:_0x1e9348}=_0x1c0158,_0x209827=_0x3bdec3[0x0];if(!_0x209827)return console[_0x2d6f6d(0x1f3)](a31_0x1f588f[_0x2d6f6d(0x1a6)](_0x2d6f6d(0x1b8))),console[_0x2d6f6d(0x1f3)](_0x2d6f6d(0x1cb)),console[_0x2d6f6d(0x1f3)](a31_0x1f588f['dim']('Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs')),0x1;_0x6bd80e[_0x2d6f6d(0x25e)]&&(console[_0x2d6f6d(0x1f3)](_0x2d6f6d(0x1fb)+_0x6bd80e[_0x2d6f6d(0x27a)]),console[_0x2d6f6d(0x1f3)](_0x2d6f6d(0x1f1)+_0x209827));const _0x7bbb71=await withSpinner('Pausing\x20activations\x20for\x20RT\x20journey\x20\x27'+_0x209827+_0x2d6f6d(0x1e0),()=>_0x1e9348[_0x2d6f6d(0x365)][_0x2d6f6d(0x2bb)](_0x209827),{'verbose':_0x6bd80e[_0x2d6f6d(0x25e)]}),_0x2cc471=_0x7bbb71[_0x2d6f6d(0x21d)];console[_0x2d6f6d(0x1f3)](_0x2d6f6d(0x3b4)+_0x2cc471[_0x2d6f6d(0x308)]+'\x27');if(_0x6bd80e['format']===_0x2d6f6d(0x372)||_0x6bd80e[_0x2d6f6d(0x392)]===_0x2d6f6d(0x2f2))await handleSDKOutput([_0x2cc471],_0x6bd80e);else{const _0x1e26d9=_0x2cc471[_0x2d6f6d(0x2d8)]===_0x2d6f6d(0x2a6)?'🚀':'📝',_0x4f9d8b=_0x2cc471[_0x2d6f6d(0x1e2)]?a31_0x1f588f[_0x2d6f6d(0x24e)](_0x2d6f6d(0x3a6)):'';console[_0x2d6f6d(0x34e)](_0x1e26d9+'\x20'+_0x2cc471[_0x2d6f6d(0x308)]+_0x4f9d8b);}return 0x0;}}export class PSRtJnResumeCommand extends BaseCommand{[a31_0x8f883f(0x308)]=a31_0x8f883f(0x38b);[a31_0x8f883f(0x355)]=a31_0x8f883f(0x348);async[a31_0x8f883f(0x1f4)](_0x27c51b){const _0x3d45c3=a31_0x8f883f,{options:_0x161364,args:_0xc25f9b,tdx:_0xbe8da1}=_0x27c51b,_0x5bf79e=_0xc25f9b[0x0];if(!_0x5bf79e)return console['error'](a31_0x1f588f[_0x3d45c3(0x1a6)](_0x3d45c3(0x1b8))),console[_0x3d45c3(0x1f3)](_0x3d45c3(0x206)),console[_0x3d45c3(0x1f3)](a31_0x1f588f[_0x3d45c3(0x2fe)]('Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs')),0x1;_0x161364['verbose']&&(console[_0x3d45c3(0x1f3)](_0x3d45c3(0x1fb)+_0x161364[_0x3d45c3(0x27a)]),console['error']('RT\x20Journey\x20ID:\x20'+_0x5bf79e));const _0x1cf445=await withSpinner('Resuming\x20activations\x20for\x20RT\x20journey\x20\x27'+_0x5bf79e+_0x3d45c3(0x1e0),()=>_0xbe8da1[_0x3d45c3(0x365)]['resumeJourney'](_0x5bf79e),{'verbose':_0x161364[_0x3d45c3(0x25e)]}),_0x354987=_0x1cf445[_0x3d45c3(0x21d)];console['error'](_0x3d45c3(0x2a2)+_0x354987[_0x3d45c3(0x308)]+'\x27');if(_0x161364[_0x3d45c3(0x392)]===_0x3d45c3(0x372)||_0x161364[_0x3d45c3(0x392)]===_0x3d45c3(0x2f2))await handleSDKOutput([_0x354987],_0x161364);else{const _0x1e680f=_0x354987[_0x3d45c3(0x2d8)]==='launched'?'🚀':'📝',_0x3fdbd3=_0x354987['paused']?a31_0x1f588f[_0x3d45c3(0x24e)]('\x20(paused)'):'';console['log'](_0x1e680f+'\x20'+_0x354987[_0x3d45c3(0x308)]+_0x3fdbd3);}return 0x0;}}export class PSRtConfigVersionCommand extends BaseCommand{[a31_0x8f883f(0x308)]=a31_0x8f883f(0x22e);['description']='Get\x20current\x20RT\x20configuration\x20version\x20status';async['execute'](_0x5874b2){const _0x202def=a31_0x8f883f,{options:_0x22923d,args:_0x50d1b9,tdx:_0x3f6682}=_0x5874b2,_0x2a19ee=_0x50d1b9[0x0]||_0x22923d['parentSegment'];if(!_0x2a19ee)return showParentSegmentNotSetError(_0x202def(0x23a)+_0x202def(0x23d)),0x1;_0x22923d[_0x202def(0x25e)]&&(console[_0x202def(0x1f3)](_0x202def(0x1fb)+_0x22923d['site']),console[_0x202def(0x1f3)]('Parent\x20segment:\x20'+_0x2a19ee));const _0xd4eeba=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x2a19ee+_0x202def(0x1e0),()=>_0x3f6682[_0x202def(0x202)][_0x202def(0x38a)](_0x2a19ee),{'verbose':_0x22923d[_0x202def(0x25e)]}),_0x199527=_0xd4eeba[_0x202def(0x21d)],_0x44d4f4=await withSpinner(_0x202def(0x260)+_0x2a19ee+'\x27...',()=>_0x3f6682['realtime'][_0x202def(0x329)](_0x199527),{'verbose':_0x22923d[_0x202def(0x25e)]}),_0x298499=_0x44d4f4['data'];return console['error']('✔\x20Retrieved\x20RT\x20configuration\x20version'),_0x22923d['format']===_0x202def(0x372)||_0x22923d[_0x202def(0x392)]===_0x202def(0x2f2)?await handleSDKOutput([_0x298499],_0x22923d):(console[_0x202def(0x34e)](_0x202def(0x291)+_0x298499['id']),console['log'](_0x202def(0x261)+_0x298499[_0x202def(0x25d)]),console['log'](_0x202def(0x1ac)+_0x298499[_0x202def(0x3b1)]),console[_0x202def(0x34e)](_0x202def(0x384)+_0x298499[_0x202def(0x1bb)]),console['log']('status:\x20'+_0x298499['status'])),0x0;}}export class PSPzServiceListCommand extends BaseCommand{[a31_0x8f883f(0x308)]='ps:pz:service:list';[a31_0x8f883f(0x355)]='List\x20personalization\x20services\x20for\x20a\x20parent\x20segment';async[a31_0x8f883f(0x1f4)](_0x59e5f9){const _0xb5cb72=a31_0x8f883f,{options:_0x67bed7,args:_0x519bf6,tdx:_0x3686c9}=_0x59e5f9,_0xa2977a=_0x519bf6[0x0]||_0x67bed7[_0xb5cb72(0x1f9)];if(!_0xa2977a)return showParentSegmentNotSetError(_0xb5cb72(0x310)+'\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'),0x1;const _0x1991ea=await withSpinner(_0xb5cb72(0x232)+_0xa2977a+_0xb5cb72(0x1e0),()=>_0x3686c9[_0xb5cb72(0x202)][_0xb5cb72(0x38a)](_0xa2977a),{'verbose':_0x67bed7[_0xb5cb72(0x25e)]}),_0x45ad81=_0x1991ea['data'],_0x1b520d=await withSpinner('Listing\x20personalization\x20services\x20for\x20\x27'+_0xa2977a+_0xb5cb72(0x1e0),()=>_0x3686c9[_0xb5cb72(0x238)]['list'](_0x45ad81),{'verbose':_0x67bed7[_0xb5cb72(0x25e)]}),_0xccb445=_0x1b520d[_0xb5cb72(0x21d)];console[_0xb5cb72(0x1f3)](_0xb5cb72(0x2d3)+_0xccb445['length']+_0xb5cb72(0x30d)+(_0xccb445['length']!==0x1?'s':''));if(_0x67bed7[_0xb5cb72(0x392)]===_0xb5cb72(0x372)||_0x67bed7[_0xb5cb72(0x392)]==='jsonl')await handleSDKOutput(_0xccb445,_0x67bed7);else{if(_0xccb445[_0xb5cb72(0x1a5)]===0x0)console['log'](_0xb5cb72(0x1f5)),console[_0xb5cb72(0x1f3)](a31_0x1f588f[_0xb5cb72(0x334)](_0xb5cb72(0x2be)));else for(const _0x55b5d2 of _0xccb445){console[_0xb5cb72(0x34e)](a31_0x1f588f['bold'](_0x55b5d2[_0xb5cb72(0x308)])+'\x20'+a31_0x1f588f[_0xb5cb72(0x2fe)]('(id:\x20'+_0x55b5d2['id']+')'));_0x55b5d2['description']&&console[_0xb5cb72(0x34e)]('\x20\x20'+a31_0x1f588f[_0xb5cb72(0x2fe)](_0x55b5d2[_0xb5cb72(0x355)]));if(_0x55b5d2['tokens']&&_0x55b5d2[_0xb5cb72(0x374)][_0xb5cb72(0x1a5)]>0x0)for(const _0x430fdf of _0x55b5d2[_0xb5cb72(0x374)]){const _0x1b915d=_0x430fdf[_0xb5cb72(0x2e3)]?.[_0xb5cb72(0x1a5)]?_0x430fdf[_0xb5cb72(0x2e3)][_0xb5cb72(0x32d)](',\x20'):_0xb5cb72(0x331);console[_0xb5cb72(0x34e)]('\x20\x20'+a31_0x1f588f['cyan'](_0xb5cb72(0x2f7))+'\x20'+_0x430fdf[_0xb5cb72(0x308)]+'\x20'+a31_0x1f588f[_0xb5cb72(0x2fe)](_0xb5cb72(0x223)+_0x430fdf['id']+')')),console[_0xb5cb72(0x34e)](_0xb5cb72(0x22a)+a31_0x1f588f[_0xb5cb72(0x2fe)](_0xb5cb72(0x23b))+'\x20'+_0x1b915d);}else console[_0xb5cb72(0x34e)]('\x20\x20'+a31_0x1f588f[_0xb5cb72(0x2fe)](_0xb5cb72(0x2bc)));}}return 0x0;}}export class PSPzServiceCreateCommand extends BaseCommand{[a31_0x8f883f(0x308)]='ps:pz:service:create';[a31_0x8f883f(0x355)]=a31_0x8f883f(0x27f);async[a31_0x8f883f(0x1f4)](_0x324053){const _0x40cff9=a31_0x8f883f,{options:_0x8f3307,args:_0x2a5264,tdx:_0x18ffb3}=_0x324053,_0x523806=_0x8f3307,_0x5b3bbd=_0x2a5264[0x0],_0x3e3648=_0x2a5264[0x1]||_0x8f3307[_0x40cff9(0x1f9)];if(!_0x5b3bbd)return console['error'](_0x40cff9(0x27e)),console['error']('Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]'),console['error'](_0x40cff9(0x369)),0x1;if(!_0x3e3648)return showParentSegmentNotSetError(_0x40cff9(0x2b1)+_0x40cff9(0x369)),0x1;const _0x3a0131=await withSpinner(_0x40cff9(0x232)+_0x3e3648+_0x40cff9(0x1e0),()=>_0x18ffb3['segment'][_0x40cff9(0x38a)](_0x3e3648),{'verbose':_0x8f3307['verbose']}),_0x38fcc4=_0x3a0131[_0x40cff9(0x21d)],_0x2fd8a3={'name':_0x5b3bbd,'description':_0x523806[_0x40cff9(0x355)],'public':_0x523806[_0x40cff9(0x221)]},_0x13d896=await withSpinner(_0x40cff9(0x361)+_0x5b3bbd+_0x40cff9(0x1e0),()=>_0x18ffb3[_0x40cff9(0x238)][_0x40cff9(0x243)](_0x38fcc4,_0x2fd8a3),{'verbose':_0x8f3307[_0x40cff9(0x25e)]}),_0x141f86=_0x13d896[_0x40cff9(0x21d)];return console[_0x40cff9(0x1f3)](_0x40cff9(0x38d)+_0x141f86[_0x40cff9(0x308)]+_0x40cff9(0x1cd)+_0x141f86['id']),await handleSDKOutput([_0x141f86],_0x8f3307),0x0;}}export class PSPzServiceShowCommand extends BaseCommand{['name']=a31_0x8f883f(0x2b9);['description']=a31_0x8f883f(0x346);async['execute'](_0x2bc60c){const _0x678e96=a31_0x8f883f,{options:_0x51bf55,args:_0x2a8505,tdx:_0x1f5ac6}=_0x2bc60c,_0x71ede5=_0x2a8505[0x0],_0x3f44c8=_0x2a8505[0x1]||_0x51bf55[_0x678e96(0x1f9)];if(!_0x71ede5)return console[_0x678e96(0x1f3)]('Error:\x20Service\x20ID\x20is\x20required'),console[_0x678e96(0x1f3)](_0x678e96(0x290)),console[_0x678e96(0x1f3)](_0x678e96(0x341)),0x1;if(!_0x3f44c8)return showParentSegmentNotSetError(_0x678e96(0x2d0)+_0x678e96(0x341)),0x1;const _0x306669=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x3f44c8+_0x678e96(0x1e0),()=>_0x1f5ac6['segment'][_0x678e96(0x38a)](_0x3f44c8),{'verbose':_0x51bf55['verbose']}),_0x5c8c3d=_0x306669[_0x678e96(0x21d)],_0x5753b9=await withSpinner(_0x678e96(0x239)+_0x71ede5+'\x27...',()=>_0x1f5ac6[_0x678e96(0x238)]['get'](_0x5c8c3d,_0x71ede5),{'verbose':_0x51bf55[_0x678e96(0x25e)]}),_0x23950e=_0x5753b9[_0x678e96(0x21d)];if(_0x51bf55['json']||_0x51bf55[_0x678e96(0x2f2)])await handleSDKOutput([_0x23950e],_0x51bf55);else{console[_0x678e96(0x34e)](a31_0x1f588f['bold'](_0x23950e[_0x678e96(0x308)])+'\x20'+a31_0x1f588f[_0x678e96(0x2fe)](_0x678e96(0x223)+_0x23950e['id']+')'));_0x23950e[_0x678e96(0x355)]&&console[_0x678e96(0x34e)]('\x20\x20'+a31_0x1f588f[_0x678e96(0x2fe)](_0x23950e['description']));console['log']('\x20\x20'+a31_0x1f588f['cyan'](_0x678e96(0x2a8))+'\x20'+(_0x23950e[_0x678e96(0x221)]?_0x678e96(0x2f6):'no'));if(_0x23950e['tokens']&&_0x23950e['tokens'][_0x678e96(0x1a5)]>0x0)for(const _0x3680a of _0x23950e[_0x678e96(0x374)]){const _0x5b1dda=_0x3680a[_0x678e96(0x2e3)]?.['length']?_0x3680a[_0x678e96(0x2e3)][_0x678e96(0x32d)](',\x20'):'any';console[_0x678e96(0x34e)]('\x20\x20'+a31_0x1f588f[_0x678e96(0x334)](_0x678e96(0x2f7))+'\x20'+_0x3680a['name']+'\x20'+a31_0x1f588f['dim'](_0x678e96(0x223)+_0x3680a['id']+')')),console['log'](_0x678e96(0x22a)+a31_0x1f588f[_0x678e96(0x2fe)](_0x678e96(0x23b))+'\x20'+_0x5b1dda);}else console[_0x678e96(0x34e)]('\x20\x20'+a31_0x1f588f[_0x678e96(0x2fe)]('no\x20tokens\x20configured'));}return 0x0;}}export class PSPzServiceDeleteCommand extends BaseCommand{[a31_0x8f883f(0x308)]=a31_0x8f883f(0x1eb);[a31_0x8f883f(0x355)]=a31_0x8f883f(0x19b);async['execute'](_0x3b64b3){const _0x41057c=a31_0x8f883f,{options:_0x37c7eb,args:_0x3bb45c,tdx:_0x18e30c}=_0x3b64b3,_0xde9c4b=_0x3bb45c[0x0],_0x207bbc=_0x3bb45c[0x1]||_0x37c7eb[_0x41057c(0x1f9)];if(!_0xde9c4b)return console[_0x41057c(0x1f3)](_0x41057c(0x314)),console[_0x41057c(0x1f3)](_0x41057c(0x200)),console['error'](_0x41057c(0x1dd)),0x1;if(!_0x207bbc)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]\x0a'+_0x41057c(0x1dd)),0x1;const _0x334910=await withSpinner(_0x41057c(0x232)+_0x207bbc+_0x41057c(0x1e0),()=>_0x18e30c['segment'][_0x41057c(0x38a)](_0x207bbc),{'verbose':_0x37c7eb[_0x41057c(0x25e)]}),_0x4f3116=_0x334910[_0x41057c(0x21d)];return await withSpinner(_0x41057c(0x205)+_0xde9c4b+_0x41057c(0x1e0),()=>_0x18e30c[_0x41057c(0x238)][_0x41057c(0x1c2)](_0x4f3116,_0xde9c4b),{'verbose':_0x37c7eb[_0x41057c(0x25e)]}),console[_0x41057c(0x1f3)](_0x41057c(0x28d)+_0xde9c4b+'\x27'),0x0;}}export class PSPzServiceUpdateCommand extends BaseCommand{[a31_0x8f883f(0x308)]=a31_0x8f883f(0x385);[a31_0x8f883f(0x355)]='Update\x20a\x20personalization\x20service\x20name\x20and/or\x20description';async[a31_0x8f883f(0x1f4)](_0x421f38){const _0xe1b53a=a31_0x8f883f,{options:_0x279d08,args:_0x400568,tdx:_0x208de9}=_0x421f38,_0x39cbad=_0x279d08,_0x3e89d1=_0x400568[0x0],_0x58b978=_0x400568[0x1]||_0x279d08['parentSegment'];if(!_0x3e89d1)return console[_0xe1b53a(0x1f3)](_0xe1b53a(0x314)),console[_0xe1b53a(0x1f3)](_0xe1b53a(0x215)),console[_0xe1b53a(0x1f3)](_0xe1b53a(0x198)),0x1;if(!_0x39cbad[_0xe1b53a(0x308)])return console[_0xe1b53a(0x1f3)](_0xe1b53a(0x1b7)),console['error'](_0xe1b53a(0x215)),0x1;if(!_0x58b978)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context'),0x1;const _0x3c60eb=await withSpinner(_0xe1b53a(0x232)+_0x58b978+_0xe1b53a(0x1e0),()=>_0x208de9['segment'][_0xe1b53a(0x38a)](_0x58b978),{'verbose':_0x279d08[_0xe1b53a(0x25e)]}),_0x3d22ce=_0x3c60eb[_0xe1b53a(0x21d)],_0x46dd3e={'name':_0x39cbad['name']};_0x39cbad[_0xe1b53a(0x355)]!==undefined&&(_0x46dd3e[_0xe1b53a(0x355)]=_0x39cbad['description']);const _0x594892=await withSpinner('Updating\x20personalization\x20service\x20\x27'+_0x3e89d1+_0xe1b53a(0x1e0),()=>_0x208de9[_0xe1b53a(0x238)]['patch'](_0x3d22ce,_0x3e89d1,_0x46dd3e),{'verbose':_0x279d08[_0xe1b53a(0x25e)]}),_0x2862c0=_0x594892[_0xe1b53a(0x21d)];return console[_0xe1b53a(0x1f3)](_0xe1b53a(0x347)+_0x2862c0[_0xe1b53a(0x308)]+'\x27'),await handleSDKOutput([_0x2862c0],_0x279d08),0x0;}}export class PSPzServiceTokenCreateCommand extends BaseCommand{[a31_0x8f883f(0x308)]=a31_0x8f883f(0x20e);[a31_0x8f883f(0x355)]='Create\x20a\x20token\x20for\x20a\x20personalization\x20service';async[a31_0x8f883f(0x1f4)](_0x1e0174){const _0x17f303=a31_0x8f883f,{options:_0x123c8,args:_0x278e43,tdx:_0x235253}=_0x1e0174,_0x55f4ee=_0x123c8,_0x368ee4=_0x278e43[0x0],_0x3b0348=_0x278e43[0x1],_0x6c14bc=_0x278e43[0x2]||_0x123c8[_0x17f303(0x1f9)];if(!_0x368ee4)return console[_0x17f303(0x1f3)](_0x17f303(0x19e)),console['error'](_0x17f303(0x327)),console['error'](_0x17f303(0x37b)),0x1;if(!_0x3b0348)return console[_0x17f303(0x1f3)](_0x17f303(0x314)),console['error'](_0x17f303(0x327)),console[_0x17f303(0x1f3)](_0x17f303(0x37b)),0x1;if(!_0x6c14bc)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;const _0x392414=await withSpinner(_0x17f303(0x232)+_0x6c14bc+_0x17f303(0x1e0),()=>_0x235253[_0x17f303(0x202)][_0x17f303(0x38a)](_0x6c14bc),{'verbose':_0x123c8[_0x17f303(0x25e)]}),_0x4a62f5=_0x392414[_0x17f303(0x21d)],_0x5edda9={'name':_0x368ee4};_0x55f4ee[_0x17f303(0x2e3)]&&(_0x5edda9['allowedIps']=_0x55f4ee[_0x17f303(0x2e3)][_0x17f303(0x244)](',')[_0x17f303(0x37d)](_0x470909=>_0x470909['trim']()));_0x55f4ee[_0x17f303(0x355)]&&(_0x5edda9[_0x17f303(0x355)]=_0x55f4ee[_0x17f303(0x355)]);const _0x53e6c0=await withSpinner(_0x17f303(0x268)+_0x368ee4+_0x17f303(0x2b0)+_0x3b0348+_0x17f303(0x1e0),()=>_0x235253[_0x17f303(0x238)][_0x17f303(0x1d0)](_0x4a62f5,_0x3b0348,_0x5edda9),{'verbose':_0x123c8['verbose']}),_0x510a69=_0x53e6c0[_0x17f303(0x21d)];return console[_0x17f303(0x1f3)](_0x17f303(0x2c7)+_0x510a69['name']+_0x17f303(0x1cd)+_0x510a69['id']),_0x510a69[_0x17f303(0x1e6)]&&(console[_0x17f303(0x1f3)](a31_0x1f588f[_0x17f303(0x24e)](_0x17f303(0x2c2))),console['error'](a31_0x1f588f['cyan'](_0x510a69[_0x17f303(0x1e6)])),console[_0x17f303(0x1f3)]('')),await handleSDKOutput([_0x510a69],_0x123c8),0x0;}}export class PSPzServiceTokenDeleteCommand extends BaseCommand{['name']=a31_0x8f883f(0x34c);['description']=a31_0x8f883f(0x37e);async[a31_0x8f883f(0x1f4)](_0x580a89){const _0x11cb82=a31_0x8f883f,{options:_0x140129,args:_0x57aff6,tdx:_0x6ab162}=_0x580a89,_0x18a2f5=_0x57aff6[0x0],_0x1ad2cd=_0x57aff6[0x1]||_0x140129[_0x11cb82(0x1f9)];if(!_0x18a2f5)return console['error'](_0x11cb82(0x2b6)),console[_0x11cb82(0x1f3)](_0x11cb82(0x339)),console[_0x11cb82(0x1f3)](_0x11cb82(0x386)),0x1;if(!_0x1ad2cd)return showParentSegmentNotSetError(_0x11cb82(0x1c3)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context'),0x1;const _0x3c87be=await withSpinner(_0x11cb82(0x232)+_0x1ad2cd+'\x27...',()=>_0x6ab162[_0x11cb82(0x202)][_0x11cb82(0x38a)](_0x1ad2cd),{'verbose':_0x140129['verbose']}),_0x1f226a=_0x3c87be[_0x11cb82(0x21d)],_0x412c7a=await withSpinner(_0x11cb82(0x349),()=>_0x6ab162[_0x11cb82(0x238)][_0x11cb82(0x1f8)](_0x1f226a),{'verbose':_0x140129['verbose']}),_0x6a6f34=_0x412c7a[_0x11cb82(0x21d)];let _0x68f3d9;for(const _0x2c7622 of _0x6a6f34){if(_0x2c7622[_0x11cb82(0x374)]?.[_0x11cb82(0x328)](_0x3c4a63=>_0x3c4a63['id']===_0x18a2f5)){_0x68f3d9=_0x2c7622['id'];break;}}if(!_0x68f3d9)return console['error'](_0x11cb82(0x2a3)+_0x18a2f5+_0x11cb82(0x2d2)),0x1;const _0x3a5113=await withSpinner('Deleting\x20token\x20\x27'+_0x18a2f5+'\x27...',()=>_0x6ab162['personalization'][_0x11cb82(0x1a7)](_0x1f226a,_0x68f3d9,_0x18a2f5),{'verbose':_0x140129['verbose']}),_0x135de9=_0x3a5113['data'];return console[_0x11cb82(0x1f3)](_0x11cb82(0x3af)+(_0x135de9[_0x11cb82(0x308)]||_0x18a2f5)+'\x27'),await handleSDKOutput([_0x135de9],_0x140129),0x0;}}export class PSPzListCommand extends BaseCommand{[a31_0x8f883f(0x308)]=a31_0x8f883f(0x1da);[a31_0x8f883f(0x355)]=a31_0x8f883f(0x22d);async['execute'](_0x16004e){const _0x92c3dd=a31_0x8f883f,{options:_0x1d8042,args:_0x5b35f0,tdx:_0xb10268}=_0x16004e,_0x1c7f24=_0x5b35f0[0x0]||_0x1d8042[_0x92c3dd(0x1f9)];if(!_0x1c7f24)return showParentSegmentNotSetError(_0x92c3dd(0x2b3)+_0x92c3dd(0x2b4)),0x1;const _0x386727=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x1c7f24+_0x92c3dd(0x1e0),()=>_0xb10268['segment']['resolveParentId'](_0x1c7f24),{'verbose':_0x1d8042[_0x92c3dd(0x25e)]}),_0x1f4dff=_0x386727[_0x92c3dd(0x21d)],_0x3b188d=await withSpinner(_0x92c3dd(0x2ab)+_0x1c7f24+'\x27...',()=>_0xb10268['personalization'][_0x92c3dd(0x2a7)](_0x1f4dff),{'verbose':_0x1d8042[_0x92c3dd(0x25e)]}),_0x5ce626=_0x3b188d['data'];console[_0x92c3dd(0x1f3)](_0x92c3dd(0x2d3)+_0x5ce626['length']+_0x92c3dd(0x39a)+(_0x5ce626[_0x92c3dd(0x1a5)]!==0x1?'s':''));if(_0x1d8042['format']===_0x92c3dd(0x372)||_0x1d8042[_0x92c3dd(0x392)]===_0x92c3dd(0x2f2))await handleSDKOutput(_0x5ce626,_0x1d8042);else{if(_0x5ce626['length']===0x0)console[_0x92c3dd(0x34e)](_0x92c3dd(0x28b));else for(const _0x3d0257 of _0x5ce626){console[_0x92c3dd(0x34e)](a31_0x1f588f[_0x92c3dd(0x1df)](_0x3d0257['name'])+'\x20'+a31_0x1f588f[_0x92c3dd(0x2fe)](_0x92c3dd(0x223)+_0x3d0257['id']+')'));_0x3d0257[_0x92c3dd(0x355)]&&console[_0x92c3dd(0x34e)]('\x20\x20'+a31_0x1f588f['dim'](_0x3d0257[_0x92c3dd(0x355)]));const _0xee8008=_0x3d0257[_0x92c3dd(0x36c)]?.[_0x92c3dd(0x1a5)]||0x0;console[_0x92c3dd(0x34e)]('\x20\x20'+a31_0x1f588f[_0x92c3dd(0x334)](_0x92c3dd(0x2c0))+'\x20'+_0xee8008);if(_0x3d0257[_0x92c3dd(0x36c)]&&_0x3d0257[_0x92c3dd(0x36c)][_0x92c3dd(0x1a5)]>0x0)for(const _0x1db0e1 of _0x3d0257[_0x92c3dd(0x36c)]){console['log']('\x20\x20\x20\x20-\x20'+_0x1db0e1['name']);}}}return 0x0;}}export class PSPzShowCommand extends BaseCommand{['name']=a31_0x8f883f(0x31b);[a31_0x8f883f(0x355)]=a31_0x8f883f(0x1e3);async[a31_0x8f883f(0x1f4)](_0x226755){const _0xf7af76=a31_0x8f883f,{options:_0x440103,args:_0x2e656f,tdx:_0x3c2007}=_0x226755,_0x28a8ee=_0x2e656f[0x0];if(!_0x28a8ee)return console[_0xf7af76(0x1f3)](_0xf7af76(0x23e)),console['error'](_0xf7af76(0x324)),0x1;const _0x3d46c4=await withSpinner('Getting\x20personalization\x20\x27'+_0x28a8ee+'\x27...',()=>_0x3c2007['personalization'][_0xf7af76(0x2e7)](_0x28a8ee),{'verbose':_0x440103[_0xf7af76(0x25e)]}),_0x23fb1e=_0x3d46c4['data'];console['error'](_0xf7af76(0x2ed)+_0x23fb1e[_0xf7af76(0x308)]+'\x27');if(_0x440103['format']===_0xf7af76(0x372)||_0x440103[_0xf7af76(0x392)]===_0xf7af76(0x2f2))await handleSDKOutput([_0x23fb1e],_0x440103);else{console[_0xf7af76(0x34e)](a31_0x1f588f[_0xf7af76(0x1df)](_0x23fb1e[_0xf7af76(0x308)])+'\x20'+a31_0x1f588f[_0xf7af76(0x2fe)](_0xf7af76(0x223)+_0x23fb1e['id']+')'));_0x23fb1e['description']&&console['log']('\x20\x20'+a31_0x1f588f[_0xf7af76(0x2fe)](_0x23fb1e['description']));_0x23fb1e['audienceId']&&console['log']('\x20\x20'+a31_0x1f588f[_0xf7af76(0x334)]('audienceId:')+'\x20'+_0x23fb1e[_0xf7af76(0x25d)]);console[_0xf7af76(0x34e)]('\x20\x20'+a31_0x1f588f[_0xf7af76(0x334)](_0xf7af76(0x325))+'\x20'+_0x23fb1e[_0xf7af76(0x336)]),console[_0xf7af76(0x34e)]('\x20\x20'+a31_0x1f588f[_0xf7af76(0x334)]('updated:')+'\x20'+_0x23fb1e[_0xf7af76(0x1bc)]);const _0x298cd6=_0x23fb1e['sections']?.['length']||0x0;console[_0xf7af76(0x34e)]('\x20\x20'+a31_0x1f588f[_0xf7af76(0x334)]('sections:')+'\x20'+_0x298cd6);if(_0x23fb1e[_0xf7af76(0x36c)]&&_0x23fb1e[_0xf7af76(0x36c)][_0xf7af76(0x1a5)]>0x0)for(const _0x1e0a18 of _0x23fb1e['sections']){console[_0xf7af76(0x34e)](_0xf7af76(0x22a)+a31_0x1f588f['bold'](_0x1e0a18[_0xf7af76(0x308)])+'\x20'+a31_0x1f588f['dim'](_0xf7af76(0x223)+_0x1e0a18['id']+')')),_0x1e0a18['entryCriteria']&&(console[_0xf7af76(0x34e)](_0xf7af76(0x3aa)+a31_0x1f588f[_0xf7af76(0x334)](_0xf7af76(0x1ba))+'\x20'+_0x1e0a18[_0xf7af76(0x3b3)][_0xf7af76(0x308)]),_0x1e0a18[_0xf7af76(0x3b3)]['keyEventCriteria']?.[_0xf7af76(0x1d1)]&&console['log']('\x20\x20\x20\x20\x20\x20\x20\x20'+a31_0x1f588f[_0xf7af76(0x334)](_0xf7af76(0x30c))+'\x20'+_0x1e0a18[_0xf7af76(0x3b3)][_0xf7af76(0x26a)]['keyEventId'])),_0x1e0a18['payload']&&console[_0xf7af76(0x34e)](_0xf7af76(0x3aa)+a31_0x1f588f[_0xf7af76(0x334)](_0xf7af76(0x233))+'\x20'+JSON[_0xf7af76(0x19c)](_0x1e0a18[_0xf7af76(0x271)])),_0x1e0a18[_0xf7af76(0x38c)]&&console['log'](_0xf7af76(0x3aa)+a31_0x1f588f['cyan'](_0xf7af76(0x250))+_0xf7af76(0x203));}}return 0x0;}}export class PSPzDeleteCommand extends BaseCommand{[a31_0x8f883f(0x308)]=a31_0x8f883f(0x34d);['description']=a31_0x8f883f(0x2cc);async[a31_0x8f883f(0x1f4)](_0xea1da9){const _0x4e6851=a31_0x8f883f,{options:_0x145dc6,args:_0x5e86bb,tdx:_0x5a7f24}=_0xea1da9,_0x273ae7=_0x5e86bb[0x0];if(!_0x273ae7)return console[_0x4e6851(0x1f3)](_0x4e6851(0x23e)),console[_0x4e6851(0x1f3)](_0x4e6851(0x311)),0x1;return await withSpinner('Deleting\x20personalization\x20\x27'+_0x273ae7+_0x4e6851(0x1e0),()=>_0x5a7f24['personalization'][_0x4e6851(0x2e5)](_0x273ae7),{'verbose':_0x145dc6['verbose']}),console[_0x4e6851(0x1f3)](_0x4e6851(0x350)+_0x273ae7+'\x27'),0x0;}}export class PSPzCreateCommand extends BaseCommand{['name']='ps:pz:create';[a31_0x8f883f(0x355)]=a31_0x8f883f(0x380);async[a31_0x8f883f(0x1f4)](_0x5cbae6){const _0xf1b8d=a31_0x8f883f,{options:_0x4974ec,tdx:_0x3e3dfb}=_0x5cbae6,_0x1474d1=_0x4974ec;let _0x167f10;if(_0x1474d1[_0xf1b8d(0x1b5)]){_0x167f10=await loadJSON(_0x1474d1['file'],!![]);if(!_0x167f10[_0xf1b8d(0x39e)]?.['parentFolder'])return console[_0xf1b8d(0x1f3)]('Error:\x20\x22relationships.parentFolder\x22\x20is\x20required\x20in\x20the\x20JSON\x20file.'),console[_0xf1b8d(0x1f3)](_0xf1b8d(0x1cf)),console[_0xf1b8d(0x1f3)](_0xf1b8d(0x2f1)),0x1;}else{if(!_0x1474d1[_0xf1b8d(0x308)])return console[_0xf1b8d(0x1f3)](_0xf1b8d(0x1ed)),console[_0xf1b8d(0x1f3)](_0xf1b8d(0x274)),console['error'](_0xf1b8d(0x32c)),0x1;if(_0x1474d1['description']===undefined)return console[_0xf1b8d(0x1f3)](_0xf1b8d(0x194)),console[_0xf1b8d(0x1f3)](_0xf1b8d(0x274)),console[_0xf1b8d(0x1f3)](_0xf1b8d(0x32c)),0x1;if(_0x1474d1[_0xf1b8d(0x33f)]===undefined)return console[_0xf1b8d(0x1f3)](_0xf1b8d(0x299)),console['error']('\x20\x20\x20\x20\x20\x20\x20Pass\x20null\x20to\x20place\x20in\x20the\x20root\x20folder.'),0x1;let _0x446a00=_0x1474d1[_0xf1b8d(0x25d)];if(!_0x446a00&&_0x4974ec[_0xf1b8d(0x1f9)]){const _0x4159f6=await withSpinner(_0xf1b8d(0x232)+_0x4974ec[_0xf1b8d(0x1f9)]+_0xf1b8d(0x1e0),()=>_0x3e3dfb[_0xf1b8d(0x202)][_0xf1b8d(0x38a)](_0x4974ec[_0xf1b8d(0x1f9)]),{'verbose':_0x4974ec[_0xf1b8d(0x25e)]});_0x446a00=_0x4159f6[_0xf1b8d(0x21d)];}let _0x4a26a7;_0x1474d1[_0xf1b8d(0x36c)]&&(_0x4a26a7=await loadJSON(_0x1474d1['sections'],![]));const _0x4bb854=_0x1474d1[_0xf1b8d(0x33f)]==='null'?null:{'id':_0x1474d1[_0xf1b8d(0x33f)],'type':'folder-segment'};_0x167f10={'attributes':{'name':_0x1474d1[_0xf1b8d(0x308)],'description':_0x1474d1[_0xf1b8d(0x355)]||null,..._0x446a00!==undefined&&{'audienceId':_0x446a00},..._0x4a26a7!==undefined&&{'sections':_0x4a26a7}},'relationships':{'parentFolder':{'data':_0x4bb854}}};}const _0x2cce70=await withSpinner(_0xf1b8d(0x21b)+(_0x167f10[_0xf1b8d(0x20f)]?.[_0xf1b8d(0x308)]??'')+'\x27...',()=>_0x3e3dfb[_0xf1b8d(0x238)]['createPersonalization'](_0x167f10),{'verbose':_0x4974ec[_0xf1b8d(0x25e)]}),_0x5b444c=_0x2cce70[_0xf1b8d(0x21d)];return console[_0xf1b8d(0x1f3)](_0xf1b8d(0x1f6)+_0x5b444c['name']+_0xf1b8d(0x1cd)+_0x5b444c['id']),await handleSDKOutput([_0x5b444c],_0x4974ec),0x0;}}export class PSPzPatchCommand extends BaseCommand{[a31_0x8f883f(0x308)]='ps:pz:patch';['description']=a31_0x8f883f(0x1af);async['execute'](_0x5e585f){const _0x9185aa=a31_0x8f883f,{options:_0x3707f3,args:_0x741ee3}=_0x5e585f,_0x4358f4=_0x3707f3,_0x4efe11=_0x741ee3[0x0];if(!_0x4efe11)return console['error'](_0x9185aa(0x23e)),console['error']('Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]'),console['error'](_0x9185aa(0x2d9)),0x1;let _0x22acac;if(_0x4358f4['file'])_0x22acac=await loadJSON(_0x4358f4[_0x9185aa(0x1b5)],!![]);else{if(!_0x4358f4[_0x9185aa(0x308)])return console[_0x9185aa(0x1f3)](_0x9185aa(0x1ed)),console[_0x9185aa(0x1f3)](_0x9185aa(0x3a4)),0x1;if(_0x4358f4['description']===undefined)return console[_0x9185aa(0x1f3)](_0x9185aa(0x194)),console['error'](_0x9185aa(0x3a4)),0x1;let _0x55be0e;_0x4358f4['sections']&&(_0x55be0e=await loadJSON(_0x4358f4['sections'],![])),_0x22acac={'attributes':{'name':_0x4358f4[_0x9185aa(0x308)],'description':_0x4358f4[_0x9185aa(0x355)]||null,..._0x55be0e!==undefined&&{'sections':_0x55be0e}}};}const {tdx:_0x42314c}=_0x5e585f,_0x4b278a=await withSpinner(_0x9185aa(0x35a)+_0x4efe11+_0x9185aa(0x1e0),()=>_0x42314c[_0x9185aa(0x238)][_0x9185aa(0x1c5)](_0x4efe11,_0x22acac),{'verbose':_0x3707f3['verbose']}),_0x12d40d=_0x4b278a[_0x9185aa(0x21d)];return console[_0x9185aa(0x1f3)](_0x9185aa(0x303)+_0x12d40d[_0x9185aa(0x308)]+_0x9185aa(0x2ec)+_0x12d40d['id']+')'),await handleSDKOutput([_0x12d40d],_0x3707f3),0x0;}}export class PSPzInitCommand extends BaseParentSegmentCommand{[a31_0x8f883f(0x308)]=a31_0x8f883f(0x387);[a31_0x8f883f(0x355)]=a31_0x8f883f(0x343);async[a31_0x8f883f(0x1f4)](_0x41055a){const _0xdbf96f=a31_0x8f883f,{options:_0x584128,args:_0x3c14a2}=_0x41055a,_0xffcbe6=_0x3c14a2[0x0]||_0x584128[_0xdbf96f(0x1f9)];if(!_0xffcbe6)return showParentSegmentNotSetError(_0xdbf96f(0x351)+_0xdbf96f(0x196)),0x1;const _0x69f87a=resolveYamlFile(_0xffcbe6);if(!existsSync(_0x69f87a))return showFileNotFoundError(_0x69f87a,_0xffcbe6),0x1;let _0x2783d6;try{_0x2783d6=readFileSync(_0x69f87a,'utf-8');}catch(_0x51ac08){const _0x5ef910=_0x51ac08 instanceof Error?_0x51ac08[_0xdbf96f(0x20d)]:String(_0x51ac08);return console[_0xdbf96f(0x1f3)]('Error\x20reading\x20file:\x20'+_0x5ef910),0x1;}let _0x10943c;try{_0x10943c=parseDef(_0x2783d6);}catch(_0x51afcc){const _0x19cb6b=_0x51afcc instanceof Error?_0x51afcc['message']:String(_0x51afcc);return console[_0xdbf96f(0x1f3)](a31_0x1f588f[_0xdbf96f(0x1a6)]('Error\x20parsing\x20YAML:\x20'+_0x19cb6b)),0x1;}if(_0x10943c[_0xdbf96f(0x2ee)]&&_0x10943c[_0xdbf96f(0x2ee)]['length']>0x0)return console[_0xdbf96f(0x1f3)](a31_0x1f588f[_0xdbf96f(0x24e)](_0xdbf96f(0x280)+_0x69f87a)),console[_0xdbf96f(0x1f3)](a31_0x1f588f[_0xdbf96f(0x2fe)](_0xdbf96f(0x1ca)+_0x10943c[_0xdbf96f(0x2ee)][_0xdbf96f(0x1a5)]+'\x20service(s)\x20configured')),0x1;!_0x10943c[_0xdbf96f(0x365)]&&(_0x10943c[_0xdbf96f(0x365)]={'events':[{'name':_0xdbf96f(0x33e),'source_table':_0xdbf96f(0x370)}],'attributes':[{'name':'last_page_viewed','type':_0xdbf96f(0x216)}],'id_stitching':{'primary_key':_0x10943c[_0xdbf96f(0x368)][_0xdbf96f(0x217)]===_0xdbf96f(0x317)?_0xdbf96f(0x1b4):'user_id'}});_0x10943c['personalization_services']=[{'name':'My\x20Service','description':_0xdbf96f(0x258),'trigger_event':_0xdbf96f(0x33e),'sections':[{'name':_0xdbf96f(0x2c9),'criteria':_0xdbf96f(0x1bf),'attributes':['last_page_viewed']}]}];const _0x2f8424=serializeDef(_0x10943c);return writeFileSync(_0x69f87a,_0x2f8424,'utf-8'),console['error'](a31_0x1f588f[_0xdbf96f(0x35c)]('✔')+_0xdbf96f(0x2bf)+a31_0x1f588f['cyan'](_0x69f87a)),(!_0x10943c['realtime']||_0x2783d6[_0xdbf96f(0x300)](_0xdbf96f(0x2e9))===-0x1)&&console[_0xdbf96f(0x1f3)](a31_0x1f588f['green']('✔')+_0xdbf96f(0x357)),console['error']('\x0a'+a31_0x1f588f[_0xdbf96f(0x2fe)](_0xdbf96f(0x39b))),console[_0xdbf96f(0x1f3)](_0xdbf96f(0x284)+_0x69f87a+_0xdbf96f(0x2f0)),console[_0xdbf96f(0x1f3)](_0xdbf96f(0x333)+a31_0x1f588f[_0xdbf96f(0x2fe)](_0xdbf96f(0x1f2)+_0xffcbe6)+_0xdbf96f(0x366)),0x0;}}
1
+ const a31_0x40ba7c=a31_0x3927;(function(_0x4832f5,_0x5deeb0){const _0x289d5c=a31_0x3927,_0x49e752=_0x4832f5();while(!![]){try{const _0x56150a=parseInt(_0x289d5c(0x160))/0x1+parseInt(_0x289d5c(0x118))/0x2*(-parseInt(_0x289d5c(0x17c))/0x3)+-parseInt(_0x289d5c(0x28e))/0x4*(parseInt(_0x289d5c(0x250))/0x5)+parseInt(_0x289d5c(0x15e))/0x6*(parseInt(_0x289d5c(0x25c))/0x7)+parseInt(_0x289d5c(0xf1))/0x8+-parseInt(_0x289d5c(0x183))/0x9*(parseInt(_0x289d5c(0x9e))/0xa)+-parseInt(_0x289d5c(0x108))/0xb;if(_0x56150a===_0x5deeb0)break;else _0x49e752['push'](_0x49e752['shift']());}catch(_0x1e6c56){_0x49e752['push'](_0x49e752['shift']());}}}(a31_0x1b4e,0x3f7b6));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a31_0x358565 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_0x3927(_0x3c1760,_0x4e4b7d){_0x3c1760=_0x3c1760-0x93;const _0x1b4e3f=a31_0x1b4e();let _0x3927b9=_0x1b4e3f[_0x3c1760];return _0x3927b9;}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_0x11627e 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_0x40ba7c(0x18d),LEGACY_PARENT_SEGMENT_DIR=a31_0x40ba7c(0xce);function openBrowser(_0x86a947){const _0x579b17=a31_0x40ba7c,_0x1309d0=process[_0x579b17(0x1c1)],_0x335c21=_0x1309d0===_0x579b17(0x113)?_0x579b17(0x191):_0x1309d0===_0x579b17(0xc6)?_0x579b17(0x149):_0x579b17(0x20b);spawn(_0x335c21,[_0x86a947],{'detached':!![],'stdio':'ignore'})[_0x579b17(0x19d)]();}function migrateLegacyDirectory(){const _0x2cee41=a31_0x40ba7c;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x54c602=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x54c602[_0x2cee41(0x1d8)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x2cee41(0x29c)](a31_0x11627e[_0x2cee41(0x12d)](_0x2cee41(0x139)+LEGACY_PARENT_SEGMENT_DIR+_0x2cee41(0xeb)+PARENT_SEGMENT_DIR+'/\x20directories\x20exist.')),console[_0x2cee41(0x29c)](a31_0x11627e['dim']('\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20'+LEGACY_PARENT_SEGMENT_DIR+'/\x20directory.\x0a')),![];console[_0x2cee41(0x29c)](a31_0x11627e[_0x2cee41(0x12d)](_0x2cee41(0x11e)+LEGACY_PARENT_SEGMENT_DIR+_0x2cee41(0x252)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x2cee41(0x29c)](a31_0x11627e[_0x2cee41(0x14f)](_0x2cee41(0xa6)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x488af4){const _0x5afd5e=_0x488af4 instanceof Error?_0x488af4['message']:String(_0x488af4);return console['error'](a31_0x11627e['red'](_0x2cee41(0x1da)+_0x5afd5e+'\x0a')),![];}}function a31_0x1b4e(){const _0x1e8d8a=['Master:','Available\x20attributes:','👥\x20','ps:pz:service:create','.yml','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','Error:\x20File\x20not\x20found:\x20','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','Add\x20template\x20personalization\x20section\x20to\x20parent\x20segment\x20YAML','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','\x20\x20Database:\x20','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]\x0a','scheduleType','\x20(paused)','yes','{\x0a\x20\x20\x22database\x22:\x20\x22','execute','value','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]','repeat','localeCompare','\x20to\x20push\x20the\x20configuration','Show\x20personalization\x20service\x20details','✔\x20No\x20changes\x20-\x20\x27','Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]\x0a','Usage:\x20tdx\x20ps\x20pz\x20delete\x20<personalization_id>','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','displaySampleData','interval','Listing\x20parent\x20segments...','Create\x20a\x20personalization\x20service\x20for\x20a\x20parent\x20segment','no\x20tokens\x20configured','segment:parent:desc','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22','allowed\x20IPs:','Site:\x20','Get\x20SQL\x20query\x20for\x20parent\x20segment','Creating\x20personalization\x20service\x20\x27','\x0a\x20\x20\x20\x20}','Options:\x0a','⚡\x20Not\x20enabled','totalEvents','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]\x0a','/app/workflows/','id:\x20','✔\x20Retrieved\x20RT\x20configuration\x20version','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','✔\x20Found\x20','dim','390vnTyKC','utf-8','/\x20→\x20','Error:\x20Service\x20ID\x20is\x20required','/{name}.yml\x0a','database','(id:\x20','\x20is\x20already\x20up\x20to\x20date','data','identifier:\x20','✔\x20Deleted\x20token\x20\x27','createParent','2873283ouBhgY','✔\x20Resumed\x20activations\x20for\x20RT\x20journey\x20\x27','List\x20parent\x20segments','✔\x20Created\x20token\x20\x27','any','collectSchema','sourceTableError','message','✔\x20Created\x20personalization\x20service\x20\x27','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','\x20--attribute\x20\x22<name>\x22','endsWith','population','Listing\x20RT-enabled\x20parent\x20segments...','Error:\x20--folder-id\x20is\x20required.\x20Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID.','\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','No\x20RT-enabled\x20parent\x20segments\x20found','Getting\x20RT\x20configuration\x20version\x20for\x20\x27','displayPreviewResults','ps:rt:jn:pause','Validate:','relationships','Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','all','tdx\x20ps\x20preview\x20','get','ps:pz:patch','Enriched:','timezone','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','✔\x20Deleted\x20personalization\x20service\x20\x27','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]\x0a','Apply\x20changes\x20to\x20\x27','Error:\x20--name\x20is\x20required','Customers:','indexOf','cyan','workflowAttemptId','preview','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]','Updating\x20personalization\x20service\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>','Finding\x20service\x20for\x20token...','parentFolder','public','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]','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','sections:','jobId','Name:\x20','6352EUokTr','ps:pz:service:list','json','Error:\x20--database\x20and\x20--table\x20are\x20required','getParentSQL','Output\x20file:\x20','✔\x20Updated\x20personalization\x20service\x20\x27','map','enriched','customers','payload','audienceId:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--file\x20<path>','\x0a✔\x20Workflow\x20started','error','Created','ps:pz:init','\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','pushParentYaml','getBehaviorNames','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context','Delete\x20a\x20token\x20from\x20a\x20personalization\x20service','✔\x20Updated\x20personalization\x20\x27','listFields','Executing\x20parent\x20segment\x20query...','Join\x20on:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','Create\x20a\x20token\x20for\x20a\x20personalization\x20service','List\x20RT\x20journeys','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','keyEventId:','formatSchemaJson','payload:','allowedIps','Resume\x20activations\x20in\x20an\x20RT\x20journey','\x20+\x20[','validateParentYaml','Fetching\x20current\x20configuration\x20for\x20\x27','ps:rt:jn:list','Behaviors','Fetching\x20parent\x20segment\x20\x27','join','\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','entryCriteria:','YAML\x20file:\x20','.customers)','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','4330730EJsNpv','\x20true','\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)','\x27\x20not\x20found\x20in\x20any\x20personalization\x20service','\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)','\x20to\x20configure\x20your\x20personalization\x20service','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','Found\x20YAML\x20file:\x20','✔\x20Renamed\x20directory\x20to\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--interval\x20','Personalization:','keyEventId','deletePersonalization','session','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','launched','string','\x20--attribute\x20\x22','SELECT\x20*\x20FROM\x20(\x0a','schemaError','personalizationServices','Update\x20a\x20personalization\x20service\x20name\x20and/or\x20description','apply','Next\x20steps:','stitchingKeys','Validate\x20RT\x202.0\x20configuration\x20from\x20parent\x20segment\x20YAML','token:','Master\x20Table','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','Updated','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','\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','/attempt/','\x22,\x20\x22type\x22:\x20\x22','\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','Creating\x20token\x20\x27','\x27\x20(id:\x20','win32','stageCount','toFixed','single','Show\x20a\x20specific\x20realtime\x20personalization','listJourneys','keys','\x27\x20and\x20run\x20workflow?','parent_segment','✔\x20Deleted\x20personalization\x20\x27','Creating','scheduleOption','tokens','\x20stage','match','columns','behaviors','Listing\x20personalization\x20services\x20for\x20\x27','in\x20','toLowerCase','Attribute:','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]','segment:parent:show','\x20RT\x20journey','Updating\x20parent\x20segment\x20\x27','Error:\x20\x22relationships.parentFolder\x22\x20is\x20required\x20in\x20the\x20JSON\x20file.','filter','jsonl','schemaValid','\x20\x20\x20\x20\x20\x20\x20Pass\x20null\x20to\x20place\x20in\x20the\x20root\x20folder.','updated:','\x20\x20Tables:\x201\x20customers\x20+\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','eventKind:\x20','ps:pz:service:token:create','\x0aUsage:\x20tdx\x20ps\x20preview\x20','/\x20and\x20','Session:','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','displaySummary','\x20=\x20','\x20--behavior\x20\x22','3045104fUwaVh','Listing\x20parent\x20segments\x20matching\x20\x27','run','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]','foreignKey','pullParentYaml','Database:\x20','processedRows','Deleting\x20personalization\x20service\x20\x27','\x20tdx\x20wf\x20attempt\x20','realtime:','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','Create\x20parent\x20segment\x20\x27','length','\x27\x20with\x20ID:\x20','\x20service','sections','Getting\x20personalization\x20\x27','\x20\x20No\x20sample\x20data\x20available','Pause\x20activations\x20in\x20an\x20RT\x20journey','No\x20personalizations\x20configured','\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}','last_page_viewed','605011AtwMoJ','segment:parent:view','includeSensitive:','Fetching\x20SQL\x20for\x20\x27','stats','created:','enabled','elapsedTimeMillis','Source:','✔\x20Found\x20personalization\x20\x27','web','darwin','realtime_enabled','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','No\x20parent\x20segments\x20found','Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','664dYrBFb','customerGroup','audienceId','Creating\x20parent\x20segment\x20\x27','segment:parent:validate','replace','\x0a⚠️\x20\x20Migrating:\x20','\x0a\x20\x20]\x0a}\x0a','displayPreviewHints','⚠️\x20\x20personalization_services\x20section\x20already\x20exists\x20in\x20','Error:\x20Personalization\x20ID\x20is\x20required','Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs','✔\x20Created\x20personalization\x20\x27','Update\x20a\x20realtime\x20personalization\x20entity','\x0aChanges\x20to\x20apply\x20to\x20\x27','displayBehaviorsStats','getCurrentConfigVersion','Error:\x20--attribute\x20requires\x20a\x20name\x0a','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','\x27\x20is\x20up\x20to\x20date','✔\x20Paused\x20activations\x20for\x20RT\x20journey\x20\x27','yellow','Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]','patchPersonalization','\x20\x20\x20','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','Fetching\x20behavior\x20list...','personalization','list','Error\x20reading\x20file:\x20','\x20\x20\x20\x20-\x20','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','Parent\x20segment:\x20','\x0a⚠️\x20\x20Both\x20','-1d','patch','No\x20parent\x20segments\x20match\x20pattern:\x20','Coverage:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22','ps:pz:service:show','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','segment:parent:create','\x20Context\x20set:\x20','✔\x20Query\x20completed:\x20Processed\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID,\x20then\x20add:','start','resumeJourney','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','Resuming\x20activations\x20for\x20RT\x20journey\x20\x27','Fetching\x20customers\x20schema...','segment','green','stringify','Resolving\x20parent\x20segment\x20\x27','To\x20cancel:','Audience\x20ID:','FINISHED','Usage:\x20tdx\x20ps\x20rt\x20jn\x20resume_activations\x20<journeyId>\x0a','SQL\x20query:\x0a','Schema\x20saved\x20to\x20','\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','Deleting\x20personalization\x20\x27','status:\x20','addAttributes','Error:\x20Token\x20\x27','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','6DQcmCt','\x20parent\x20segment','200041sXaOti','varchar','description','displayRealtimeInfo','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','log','customerGroupFile','\x20behaviors','Get\x20current\x20RT\x20configuration\x20version\x20status','column_name','segment:parent:pull','My\x20Service','verbose','No\x20personalization\x20services\x20configured','Updating','\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22','trim','Options\x20(one\x20required):\x0a','limit','ps:rt:jn:resume','\x20\x20Columns:\x20','Overwrite\x20\x27','output','Listing\x20fields\x20for\x20\x27','sourceTableValid','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','\x20No\x20changes\x20-\x20','rowCount','1077BFNKFO','\x20parent\x20segment\x20\x27','Usage:\x20tdx\x20ps\x20rt\x20jn\x20pause_activations\x20<journeyId>\x0a','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','customersWithEvents','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','createToken','9UUfPmS','paused','Personalization\x20service\x20description','Show\x20parent\x20segment\x20details','behavior_','master','Error:\x20Parent\x20segment\x20name\x20is\x20required','entryCriteria','\x20Opening\x20','addBehaviors','parent_segments','table','Events:','\x0aNew\x20parent\x20segment\x20\x27','open','/app/dw/parentSegments/','Master\x20+\x20Attributes','Errors:','Validating\x20configuration...','\x20[Job\x20ID:\x20','ps:rt:validate','\x0a⚠\x20Save\x20this\x20token\x20value\x20-\x20it\x20will\x20not\x20be\x20shown\x20again:','errors','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]\x0a','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','displayAttributesStats','unref','behavior','\x0aTip:\x20Run\x20`tdx\x20ps\x20pz\x20service\x20init`\x20to\x20add\x20a\x20template\x20personalization\x20section\x20to\x20your\x20YAML','Table:\x20','\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22','state','displayMasterInfo','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Creating\x20personalization\x20\x27','column','\x20RT-enabled\x20parent\x20segment','Error:\x20Token\x20name\x20is\x20required','\x20field','\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path','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--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','segment:parent:update','sampleData','realtime','coveragePercent','ps:rt:configuration_versions','toLocaleString','attribute','push','attributes','Fetching\x20sample\x20data...','personalization_services','Delete\x20a\x20personalization\x20service','\x0aNo\x20sample\x20data\x20available','reduce','ps:pz:create','includeSensitive','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','/sessions/','Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a','List\x20personalization\x20services\x20for\x20a\x20parent\x20segment','platform','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','\x20configured','format','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','Error:\x20Token\x20ID\x20is\x20required','valid','Validating\x20RT\x20configuration...','getPersonalization','Attributes','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context','Error:','stop','site','Options:','Deleting\x20token\x20\x27','idStitching','segment:parent:preview','ID\x20Stitching:','Attempt:','parentSegment','\x20RT\x20configuration\x20is\x20valid','SELECT\x20*\x20FROM\x20','isDirectory','Status:','✘\x20Failed\x20to\x20rename\x20directory:\x20','\x0a\x20\x20\x20\x20]','\x20\x20\x20\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','public:','listPersonalizations','displayValidateResults','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','\x20Added\x20personalization\x20template\x20to\x20','segment:parent:list','ps:pz:delete','label','\x20--enriched','\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a','customerPercent','\x0aError:','status','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','allValid','List\x20available\x20fields\x20for\x20segmentation','bold','\x27...','listParents','Analyzing\x20changes...','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','ps:pz:service:delete','RT\x20Journey\x20ID:\x20','pauseJourney','text','name','getParentFull','type','displayColumns','\x20Added\x20RT\x202.0\x20template\x20section','information_schema','Listing\x20RT-enabled\x20parent\x20segments\x20matching\x20\x27','\x20\x20\x20\x20\x20\x20','\x20personalization\x20service','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','Aborted.','sort','\x20\x20Note:\x20','updateParent','resolveParentId','some','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]','red','use','ps:pz:service:update','xdg-open','\x20\x202.\x20Run\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context','Create\x20a\x20realtime\x20personalization\x20entity','setJobId','Error\x20parsing\x20YAML:\x20','\x5c$&','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]\x0a','Default','RT\x202.0:','events','column_type','joinKey','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context','Listing\x20RT\x20journeys\x20for\x20\x27','No\x20RT\x20journeys\x20found','RT\x202.0\x20Validate:','Listing\x20personalizations\x20for\x20\x27'];a31_0x1b4e=function(){return _0x1e8d8a;};return a31_0x1b4e();}class BaseParentSegmentCommand extends BaseCommand{async[a31_0x40ba7c(0xf3)](_0x3140d3){const _0x58a754=a31_0x40ba7c;return migrateLegacyDirectory(),super[_0x58a754(0xf3)](_0x3140d3);}}function resolveYamlFile(_0x10a6cc){const _0x4e8fbd=a31_0x40ba7c;if(_0x10a6cc[_0x4e8fbd(0x267)](_0x4e8fbd(0x221))||_0x10a6cc['endsWith']('.yaml'))return _0x10a6cc;return a31_0x358565[_0x4e8fbd(0x98)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x10a6cc)+'.yml');}function formatProgressMessage(_0x42934d){const _0x38f95e=a31_0x40ba7c,_0x41936e=_0x42934d[_0x38f95e(0xd4)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x41936e){const [,_0x1c2a69,_0x4a354d,_0x332c1='']=_0x41936e;return a31_0x11627e['dim'](_0x1c2a69+':')+'\x20'+_0x4a354d+a31_0x11627e[_0x38f95e(0x24f)](_0x332c1);}return a31_0x11627e[_0x38f95e(0x24f)](_0x42934d);}function showFileNotFoundError(_0x1f158d,_0x58121a){const _0x338b3a=a31_0x40ba7c;console[_0x338b3a(0x29c)](a31_0x11627e['red'](_0x338b3a(0x223)+_0x1f158d+'\x0a')),console[_0x338b3a(0x29c)](a31_0x11627e[_0x338b3a(0x280)](_0x338b3a(0x181)+_0x58121a+'`\x20to\x20download\x20the\x20configuration\x20first'));}function displayRealtimeValidation(_0x35bf1b){const _0x2e67f2=a31_0x40ba7c;if(!_0x35bf1b[_0x2e67f2(0x1af)])return;const _0x3b03ec=_0x35bf1b[_0x2e67f2(0x1af)],_0x3a0a88=_0x3b03ec[_0x2e67f2(0x10e)]?a31_0x11627e[_0x2e67f2(0x14f)]('⚡\x20Enabled'):a31_0x11627e['yellow'](_0x2e67f2(0x247));console[_0x2e67f2(0x29c)]('\x0a'+a31_0x11627e[_0x2e67f2(0x24f)](_0x2e67f2(0x214))+'\x20'+_0x3a0a88);if(_0x3b03ec[_0x2e67f2(0x215)]&&_0x3b03ec['events']['length']>0x0){console[_0x2e67f2(0x29c)]('\x20\x20'+a31_0x11627e[_0x2e67f2(0x24f)]('Events:')+'\x20'+_0x3b03ec['events'][_0x2e67f2(0xfe)]+'\x20configured');for(const _0xe5dfda of _0x3b03ec[_0x2e67f2(0x215)]){const _0xe38027=_0xe5dfda[_0x2e67f2(0x178)]===![]?a31_0x11627e['red']('✘'):a31_0x11627e[_0x2e67f2(0x14f)]('✔');console[_0x2e67f2(0x29c)]('\x20\x20\x20\x20'+_0xe38027+'\x20'+_0xe5dfda[_0x2e67f2(0x1f7)]),_0xe5dfda['sourceTableError']&&console[_0x2e67f2(0x29c)]('\x20\x20\x20\x20\x20\x20'+a31_0x11627e[_0x2e67f2(0x208)](_0xe5dfda[_0x2e67f2(0x262)]));}}if(_0x3b03ec[_0x2e67f2(0x1b5)]&&_0x3b03ec['attributes']['length']>0x0){console[_0x2e67f2(0x29c)]('\x20\x20'+a31_0x11627e['dim']('Attributes:')+'\x20'+_0x3b03ec[_0x2e67f2(0x1b5)][_0x2e67f2(0xfe)]+_0x2e67f2(0x1c3));for(const _0x3221e6 of _0x3b03ec[_0x2e67f2(0x1b5)]){const _0x4bf8d2=_0x3221e6[_0x2e67f2(0x1c7)]?a31_0x11627e[_0x2e67f2(0x14f)]('✔'):a31_0x11627e[_0x2e67f2(0x208)]('✘');console[_0x2e67f2(0x29c)](_0x2e67f2(0x1dc)+_0x4bf8d2+'\x20'+_0x3221e6['name']+'\x20'+a31_0x11627e['dim']('('+_0x3221e6[_0x2e67f2(0x1f9)]+')'));}}if(_0x3b03ec[_0x2e67f2(0x1d1)]){const _0x11c58d=_0x3b03ec[_0x2e67f2(0x1d1)][_0x2e67f2(0xb8)]?.[_0x2e67f2(0xfe)]?_0x2e67f2(0x2b1)+_0x3b03ec[_0x2e67f2(0x1d1)][_0x2e67f2(0xb8)][_0x2e67f2(0x98)](',\x20')+']':'';console['error']('\x20\x20'+a31_0x11627e['dim'](_0x2e67f2(0x1d3))+'\x20'+_0x3b03ec[_0x2e67f2(0x1d1)]['primaryKey']+_0x11c58d);}if(_0x3b03ec[_0x2e67f2(0xb4)]&&_0x3b03ec['personalizationServices']['length']>0x0){console[_0x2e67f2(0x29c)]('\x20\x20'+a31_0x11627e['dim'](_0x2e67f2(0xa9))+'\x20'+_0x3b03ec['personalizationServices'][_0x2e67f2(0xfe)]+_0x2e67f2(0x100)+(_0x3b03ec['personalizationServices'][_0x2e67f2(0xfe)]!==0x1?'s':''));for(const _0x35a455 of _0x3b03ec[_0x2e67f2(0xb4)]){console[_0x2e67f2(0x29c)](_0x2e67f2(0x136)+_0x35a455[_0x2e67f2(0x1f7)]);}}}function showParentSegmentNotSetError(_0x17a427){const _0x991430=a31_0x40ba7c;console[_0x991430(0x29c)](a31_0x11627e['yellow']('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x991430(0x29c)](_0x17a427);}export class ParentSegmentListCommand extends BaseCommand{[a31_0x40ba7c(0x1f7)]=a31_0x40ba7c(0x1e3);[a31_0x40ba7c(0x162)]=a31_0x40ba7c(0x25e);async[a31_0x40ba7c(0x22d)](_0x9e20b4){const _0x283749=a31_0x40ba7c,{options:_0xf352bd,args:_0x1d11cb,tdx:_0x16bae9}=_0x9e20b4,_0x54f4f3=_0x1d11cb[0x0];_0xf352bd[_0x283749(0x16c)]&&(console['error'](_0x283749(0x242)+_0xf352bd['site']),_0x54f4f3&&console[_0x283749(0x29c)]('Pattern:\x20'+_0x54f4f3));const _0x35e8b7=await withSpinner(_0x54f4f3?_0x283749(0xf2)+_0x54f4f3+_0x283749(0x1ef):_0x283749(0x23b),()=>_0x16bae9[_0x283749(0x14e)][_0x283749(0x1f0)](),{'verbose':_0xf352bd[_0x283749(0x16c)]});let _0x26eeb9=_0x35e8b7[_0x283749(0x258)];if(_0x54f4f3){const _0x19c2a3=_0x54f4f3[_0x283749(0x11d)](/[.+^${}()|[\]\\]/g,'\x5c$&')[_0x283749(0x11d)](/\*/g,'.*')[_0x283749(0x11d)](/\?/g,'.'),_0x3664e4=new RegExp('^'+_0x19c2a3+'$','i');_0x26eeb9=_0x26eeb9[_0x283749(0xe1)](_0x30b854=>_0x3664e4['test'](_0x30b854[_0x283749(0x1b5)][_0x283749(0x1f7)]));}_0x26eeb9['sort']((_0x57d4f5,_0x277a3d)=>_0x57d4f5['attributes']['name'][_0x283749(0x231)](_0x277a3d[_0x283749(0x1b5)][_0x283749(0x1f7)])),console[_0x283749(0x29c)](_0x283749(0x24e)+_0x26eeb9[_0x283749(0xfe)]+_0x283749(0x15f)+(_0x26eeb9[_0x283749(0xfe)]!==0x1?'s':''));const _0x3a9f23=_0x2fb0e9=>{const _0x213dbb=_0x283749;return getConsoleNextUrl(_0xf352bd[_0x213dbb(0x1ce)],_0x213dbb(0x192)+_0x2fb0e9);};if(_0xf352bd[_0x283749(0x1c4)]==='json'||_0xf352bd[_0x283749(0x1c4)]===_0x283749(0xe2)){const _0x14b633=_0x26eeb9[_0x283749(0x295)](_0x4b8891=>({..._0x4b8891,'url':_0x3a9f23(_0x4b8891['id'])}));await handleSDKOutput(_0x14b633,_0xf352bd);}else{if(_0x26eeb9[_0x283749(0xfe)]===0x0)_0x54f4f3?console['log'](_0x283749(0x13c)+_0x54f4f3):console[_0x283749(0x165)](_0x283749(0x116));else for(const _0x2c4f34 of _0x26eeb9){const _0x506be8=_0x2c4f34[_0x283749(0x1b5)][_0x283749(0x268)]?a31_0x11627e[_0x283749(0x24f)]('\x20('+formatRows(_0x2c4f34[_0x283749(0x1b5)][_0x283749(0x268)])+')'):'',_0x10e832=hyperlink(_0x2c4f34['attributes'][_0x283749(0x1f7)],_0x3a9f23(_0x2c4f34['id']));console[_0x283749(0x165)](_0x283749(0x21f)+_0x10e832+_0x506be8);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{['name']=a31_0x40ba7c(0x144);[a31_0x40ba7c(0x162)]=a31_0x40ba7c(0x2ab);async[a31_0x40ba7c(0x22d)](_0x3738b4){const _0x480349=a31_0x40ba7c,{options:_0x4a1483,args:_0x5353d5,tdx:_0x397e79}=_0x3738b4;console[_0x480349(0x29c)](_0x480349(0x265)+_0x480349(0x238)+'\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a');const _0x67ca3d=_0x4a1483;if(_0x5353d5['length']===0x0)return console[_0x480349(0x29c)](a31_0x11627e['red'](_0x480349(0x189))),console[_0x480349(0x29c)](_0x480349(0x13f)),0x1;const _0x1bb1be=_0x5353d5[0x0];if(!_0x67ca3d[_0x480349(0x255)]||!_0x67ca3d[_0x480349(0x18e)])return console[_0x480349(0x29c)](_0x480349(0x291)),console[_0x480349(0x29c)](_0x480349(0x13f)),0x1;_0x67ca3d[_0x480349(0x16c)]&&(console[_0x480349(0x29c)](_0x480349(0x242)+_0x67ca3d[_0x480349(0x1ce)]),console[_0x480349(0x29c)](_0x480349(0x28d)+_0x1bb1be),console['error'](_0x480349(0xf7)+_0x67ca3d[_0x480349(0x255)]),console['error'](_0x480349(0x1a0)+_0x67ca3d[_0x480349(0x18e)]));const _0x395eb7=await loadJSONFromOptions(_0x67ca3d[_0x480349(0x1b5)],_0x67ca3d['attributesFile']),_0x280828=await loadJSONFromOptions(_0x67ca3d['behaviors'],_0x67ca3d['behaviorsFile']),_0x3c83a6=await loadJSONFromOptions(_0x67ca3d[_0x480349(0x119)],_0x67ca3d[_0x480349(0x166)]),_0x580543={'name':_0x1bb1be,'description':_0x67ca3d[_0x480349(0x162)],'scheduleType':_0x67ca3d[_0x480349(0x229)],'scheduleOption':_0x67ca3d[_0x480349(0xd1)],'timezone':_0x67ca3d[_0x480349(0x278)],'master':{'parentDatabaseName':_0x67ca3d[_0x480349(0x255)],'parentTableName':_0x67ca3d[_0x480349(0x18e)]},'attributes':_0x395eb7,'behaviors':_0x280828,'customerGroup':_0x3c83a6},_0x356c70=await withSpinner(_0x480349(0x11b)+_0x1bb1be+_0x480349(0x1ef),()=>_0x397e79[_0x480349(0x14e)][_0x480349(0x25b)](_0x580543),{'verbose':_0x4a1483[_0x480349(0x16c)]}),_0x2b2a16=_0x356c70[_0x480349(0x258)];return console[_0x480349(0x29c)]('✔\x20Created\x20parent\x20segment\x20\x27'+_0x2b2a16[_0x480349(0x1f7)]+_0x480349(0xff)+_0x2b2a16['id']),await handleSDKOutput([_0x2b2a16],_0x4a1483),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a31_0x40ba7c(0x1f7)]=a31_0x40ba7c(0x1ad);[a31_0x40ba7c(0x162)]=a31_0x40ba7c(0x1c5);async[a31_0x40ba7c(0x22d)](_0x16e0f2){const _0x1f97c7=a31_0x40ba7c,{options:_0x368346,args:_0x1272bd,tdx:_0x300e63}=_0x16e0f2;console[_0x1f97c7(0x29c)](_0x1f97c7(0x137)+_0x1f97c7(0x238)+'\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a');const _0x5c302f=_0x368346;if(_0x1272bd['length']===0x0)return console[_0x1f97c7(0x29c)](a31_0x11627e[_0x1f97c7(0x208)]('Error:\x20Parent\x20segment\x20name\x20is\x20required')),console[_0x1f97c7(0x29c)]('Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]'),0x1;const _0x3977ce=_0x1272bd[0x0];_0x5c302f[_0x1f97c7(0x16c)]&&(console[_0x1f97c7(0x29c)](_0x1f97c7(0x242)+_0x5c302f[_0x1f97c7(0x1ce)]),console[_0x1f97c7(0x29c)](_0x1f97c7(0x138)+_0x3977ce));const _0x2ea0ac=await withSpinner(_0x1f97c7(0x94)+_0x3977ce+_0x1f97c7(0x1ef),()=>_0x300e63[_0x1f97c7(0x14e)][_0x1f97c7(0x1f8)](_0x3977ce),{'verbose':_0x5c302f[_0x1f97c7(0x16c)]}),_0x535667=_0x2ea0ac[_0x1f97c7(0x258)],_0x4fee6e=await loadJSONFromOptions(_0x5c302f[_0x1f97c7(0x15b)],_0x5c302f['addAttributesFile']),_0x365c91=await loadJSONFromOptions(_0x5c302f[_0x1f97c7(0x18c)],_0x5c302f['addBehaviorsFile']),_0x3860f6={'name':_0x535667[_0x1f97c7(0x1f7)],'description':_0x5c302f[_0x1f97c7(0x162)]!==undefined?_0x5c302f['description']:_0x535667[_0x1f97c7(0x162)],'scheduleType':_0x5c302f[_0x1f97c7(0x229)]!==undefined?_0x5c302f[_0x1f97c7(0x229)]:_0x535667[_0x1f97c7(0x229)],'scheduleOption':_0x5c302f[_0x1f97c7(0xd1)]!==undefined?_0x5c302f['scheduleOption']:_0x535667[_0x1f97c7(0xd1)],'timezone':_0x5c302f[_0x1f97c7(0x278)]!==undefined?_0x5c302f['timezone']:_0x535667[_0x1f97c7(0x278)],'master':_0x535667[_0x1f97c7(0x188)],'attributes':_0x4fee6e?[..._0x535667['attributes']||[],..._0x4fee6e]:_0x535667[_0x1f97c7(0x1b5)],'behaviors':_0x365c91?[..._0x535667[_0x1f97c7(0xd6)]||[],..._0x365c91]:_0x535667[_0x1f97c7(0xd6)],'customerGroup':_0x535667[_0x1f97c7(0x119)]},_0x57d353=await withSpinner(_0x1f97c7(0xdf)+_0x3977ce+_0x1f97c7(0x1ef),()=>_0x300e63[_0x1f97c7(0x14e)][_0x1f97c7(0x204)](_0x3977ce,_0x3860f6),{'verbose':_0x5c302f['verbose']}),_0x5c0e69=_0x57d353[_0x1f97c7(0x258)];return console[_0x1f97c7(0x29c)]('✔\x20Updated\x20parent\x20segment\x20\x27'+_0x5c0e69['name']+'\x27'),await handleSDKOutput([_0x5c0e69],_0x5c302f),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a31_0x40ba7c(0x1f7)]=a31_0x40ba7c(0x16a);['description']=a31_0x40ba7c(0x224);async[a31_0x40ba7c(0x22d)](_0x18611e){const _0x3e6f75=a31_0x40ba7c,{options:_0x21a385,args:_0x2d2902,tdx:_0x56a7c3}=_0x18611e,_0x4fab91=_0x21a385,_0x2787cd=_0x2d2902[0x0]||_0x21a385[_0x3e6f75(0x1d5)];if(!_0x2787cd)return showParentSegmentNotSetError(_0x3e6f75(0x140)+_0x3e6f75(0x164)),0x1;if(_0x4fab91[_0x3e6f75(0x209)]&&_0x4fab91[_0x3e6f75(0x176)])return console['error'](a31_0x11627e['red'](_0x3e6f75(0x1e1))),console[_0x3e6f75(0x29c)](a31_0x11627e[_0x3e6f75(0x24f)]('The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires')),console[_0x3e6f75(0x29c)](a31_0x11627e['dim']('using\x20the\x20default\x20path:\x20'+PARENT_SEGMENT_DIR+_0x3e6f75(0x254))),console[_0x3e6f75(0x29c)](a31_0x11627e[_0x3e6f75(0x280)]('Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u')),0x1;const _0x358d1a=_0x4fab91[_0x3e6f75(0x176)]||a31_0x358565[_0x3e6f75(0x98)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x2787cd)+_0x3e6f75(0x221));_0x4fab91[_0x3e6f75(0x16c)]&&(console[_0x3e6f75(0x29c)]('Site:\x20'+_0x4fab91[_0x3e6f75(0x1ce)]),console['error'](_0x3e6f75(0x138)+_0x2787cd),console[_0x3e6f75(0x29c)](_0x3e6f75(0x293)+_0x358d1a));const _0x2386cc=await withSpinner('Fetching\x20parent\x20segment\x20\x27'+_0x2787cd+_0x3e6f75(0x1ef),()=>_0x56a7c3[_0x3e6f75(0x14e)][_0x3e6f75(0xf6)](_0x2787cd),{'verbose':_0x4fab91['verbose']}),_0x14a9b3=_0x2386cc[_0x3e6f75(0x258)];if(existsSync(_0x358d1a)){const _0xfbfba2=readFileSync(_0x358d1a,_0x3e6f75(0x251)),_0x445b90=generateDiff(_0xfbfba2,_0x14a9b3);if(!hasChanges(_0x445b90))console[_0x3e6f75(0x29c)](a31_0x11627e[_0x3e6f75(0x14f)]('✔')+_0x3e6f75(0x17a)+a31_0x11627e[_0x3e6f75(0x280)](_0x358d1a)+_0x3e6f75(0x257));else{console[_0x3e6f75(0x29c)]('\x0aChanges\x20to\x20\x27'+_0x358d1a+'\x27:'),console[_0x3e6f75(0x29c)]('─'[_0x3e6f75(0x230)](0x3c)),console['error'](formatDiffWithColors(_0x445b90)),console[_0x3e6f75(0x29c)]('─'['repeat'](0x3c));if(!_0x4fab91[_0x3e6f75(0x22b)]){if(!isInteractive())return console[_0x3e6f75(0x29c)](a31_0x11627e[_0x3e6f75(0x208)](_0x3e6f75(0x1e9)),_0x3e6f75(0x1a4)),console['error'](a31_0x11627e[_0x3e6f75(0x24f)](_0x3e6f75(0x147))),0x1;const _0x472187=await confirmKey(_0x3e6f75(0x175)+_0x358d1a+'\x27?');if(!_0x472187)return console[_0x3e6f75(0x29c)](a31_0x11627e['yellow'](_0x3e6f75(0x201))),0x1;}writeFileSync(_0x358d1a,_0x14a9b3,_0x3e6f75(0x251)),console[_0x3e6f75(0x29c)](a31_0x11627e[_0x3e6f75(0x14f)]('✔')+_0x3e6f75(0xbc)+a31_0x11627e[_0x3e6f75(0x280)](_0x358d1a));}}else{const _0x5adf8d=a31_0x358565['dirname'](_0x358d1a);!existsSync(_0x5adf8d)&&mkdirSync(_0x5adf8d,{'recursive':!![]}),writeFileSync(_0x358d1a,_0x14a9b3,_0x3e6f75(0x251)),console[_0x3e6f75(0x29c)](a31_0x11627e[_0x3e6f75(0x14f)]('✔')+_0x3e6f75(0xbc)+a31_0x11627e['cyan'](_0x358d1a));}return saveSessionContext({'parent_segment':_0x2787cd},_0x4fab91[_0x3e6f75(0xac)]),console[_0x3e6f75(0x29c)](a31_0x11627e[_0x3e6f75(0x14f)]('✔')+_0x3e6f75(0x145)+a31_0x11627e[_0x3e6f75(0x24f)](_0x3e6f75(0xce))+_0x3e6f75(0xef)+a31_0x11627e['cyan'](_0x2787cd)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a31_0x40ba7c(0x1f7)]='segment:parent:push';[a31_0x40ba7c(0x162)]=a31_0x40ba7c(0x15d);async['execute'](_0x57e109){const _0x3fdae4=a31_0x40ba7c,{options:_0x34c388,args:_0x3a48ac,tdx:_0xe16ae6}=_0x57e109,_0x12bfa7=_0x34c388,_0x332c4c=_0x3a48ac[0x0]||_0x34c388[_0x3fdae4(0x1d5)];if(!_0x332c4c)return showParentSegmentNotSetError(_0x3fdae4(0x226)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment'),0x1;const _0x577e0e=resolveYamlFile(_0x332c4c);if(!existsSync(_0x577e0e))return showFileNotFoundError(_0x577e0e,_0x332c4c),0x1;_0x12bfa7[_0x3fdae4(0x16c)]&&(console[_0x3fdae4(0x29c)](_0x3fdae4(0x242)+_0x12bfa7[_0x3fdae4(0x1ce)]),console[_0x3fdae4(0x29c)](_0x3fdae4(0x9b)+_0x577e0e));let _0x449845;try{_0x449845=readFileSync(_0x577e0e,_0x3fdae4(0x251));}catch(_0x563eed){const _0x439ccf=_0x563eed instanceof Error?_0x563eed['message']:String(_0x563eed);return console['error'](_0x3fdae4(0x135)+_0x439ccf),0x1;}const _0x8cc451=await withSpinner(_0x3fdae4(0x1f1),()=>_0xe16ae6[_0x3fdae4(0x14e)][_0x3fdae4(0x2a0)](_0x449845),{'verbose':_0x12bfa7[_0x3fdae4(0x16c)]}),_0xcfa0b6=_0x8cc451[_0x3fdae4(0x258)],{isNew:_0x25a9cd,name:_0x49f536,hasChanges:_0x161295,diffFormatted:_0x54eb06}=_0xcfa0b6;if(!_0x161295)return console['error'](_0x3fdae4(0x234)+_0x49f536+'\x27\x20is\x20already\x20up\x20to\x20date'),0x0;_0x25a9cd?console['error'](_0x3fdae4(0x190)+_0x49f536+'\x27:'):console[_0x3fdae4(0x29c)](_0x3fdae4(0x126)+_0x49f536+'\x27:');console[_0x3fdae4(0x29c)]('─'[_0x3fdae4(0x230)](0x3c)),console['error'](_0x54eb06),console[_0x3fdae4(0x29c)]('─'[_0x3fdae4(0x230)](0x3c));const _0x47847f=_0x25a9cd?_0x3fdae4(0xfd)+_0x49f536+'\x27?':_0x3fdae4(0x27c)+_0x49f536+'\x27?';if(!_0x12bfa7[_0x3fdae4(0x22b)]){if(!isInteractive())return console['error'](a31_0x11627e[_0x3fdae4(0x208)](_0x3fdae4(0x1e9)),_0x3fdae4(0x1a4)),console[_0x3fdae4(0x29c)](a31_0x11627e[_0x3fdae4(0x24f)](_0x3fdae4(0x147))),0x1;const _0x1d4066=await confirmKey(_0x47847f);if(!_0x1d4066)return console[_0x3fdae4(0x29c)](a31_0x11627e['yellow'](_0x3fdae4(0x201))),0x1;}const _0x486254=_0x25a9cd?_0x3fdae4(0xd0):_0x3fdae4(0x16e),_0x306de4=await withSpinner(_0x486254+_0x3fdae4(0x17d)+_0x49f536+_0x3fdae4(0x1ef),()=>_0xcfa0b6[_0x3fdae4(0xb6)](),{'verbose':_0x12bfa7[_0x3fdae4(0x16c)]}),_0x35b90e=_0x306de4[_0x3fdae4(0x258)],_0x2c5ea4=getConsoleNextUrl(_0x12bfa7[_0x3fdae4(0x1ce)],_0x3fdae4(0x192)+_0x35b90e['id']),_0x33e431=_0x25a9cd?_0x3fdae4(0x29d):'Updated';return console[_0x3fdae4(0x29c)]('✔\x20'+_0x33e431+'\x20parent\x20segment\x20\x27'+_0x35b90e[_0x3fdae4(0x1f7)]+'\x27'),console[_0x3fdae4(0x29c)]('\x20\x20'+_0x2c5ea4),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a31_0x40ba7c(0x1f7)]=a31_0x40ba7c(0x11c);[a31_0x40ba7c(0x162)]=a31_0x40ba7c(0x222);async[a31_0x40ba7c(0x22d)](_0xe9a6dc){const _0x23be9a=a31_0x40ba7c,{options:_0x424ee6,args:_0x402cc5,tdx:_0x2d37b1}=_0xe9a6dc,_0x3ff23d=_0x424ee6,_0x5481cc=_0x402cc5[0x0]||_0x424ee6[_0x23be9a(0x1d5)];if(!_0x5481cc)return showParentSegmentNotSetError(_0x23be9a(0xa4)+_0x23be9a(0x1eb)+_0x23be9a(0x246)+_0x23be9a(0x23f)+_0x23be9a(0x279)+_0x23be9a(0x1c2)),0x1;const _0x56a6be=resolveYamlFile(_0x5481cc);if(!existsSync(_0x56a6be))return showFileNotFoundError(_0x56a6be,_0x5481cc),0x1;_0x3ff23d[_0x23be9a(0x16c)]&&(console[_0x23be9a(0x29c)]('Site:\x20'+_0x3ff23d[_0x23be9a(0x1ce)]),console[_0x23be9a(0x29c)]('YAML\x20file:\x20'+_0x56a6be));let _0xb41da1;try{_0xb41da1=readFileSync(_0x56a6be,_0x23be9a(0x251));}catch(_0x24c542){const _0x5cdcb8=_0x24c542 instanceof Error?_0x24c542[_0x23be9a(0x263)]:String(_0x24c542);return console[_0x23be9a(0x29c)](_0x23be9a(0x135)+_0x5cdcb8),0x1;}const _0x46e49d=createCommandSpinner(a31_0x11627e[_0x23be9a(0x24f)](_0x23be9a(0x195)),{'verbose':_0x3ff23d[_0x23be9a(0x16c)]});_0x46e49d[_0x23be9a(0x149)]();const _0x10aabe={'onProgress':_0x43ac62=>{const _0x349a0d=_0x23be9a;_0x46e49d[_0x349a0d(0x1f6)]=formatProgressMessage(_0x43ac62);}};if(_0x3ff23d['master'])_0x10aabe[_0x23be9a(0x188)]=!![];if(_0x3ff23d[_0x23be9a(0x296)])_0x10aabe[_0x23be9a(0x296)]=!![];_0x3ff23d[_0x23be9a(0x1b3)]&&(_0x10aabe[_0x23be9a(0x1b3)]=_0x3ff23d['attribute']);_0x3ff23d['behavior']&&(_0x10aabe[_0x23be9a(0x19e)]=_0x3ff23d['behavior']);if(_0x3ff23d[_0x23be9a(0x23a)])_0x10aabe['interval']=_0x3ff23d['interval'];let _0x12696b;try{_0x12696b=await _0x2d37b1['segment'][_0x23be9a(0x93)](_0xb41da1,_0x10aabe),_0x46e49d['stop']();}catch(_0x1c231b){_0x46e49d[_0x23be9a(0x1cd)]();throw _0x1c231b;}const _0x58d02d=_0x3ff23d[_0x23be9a(0x23a)]||_0x23be9a(0x13a);return this[_0x23be9a(0x1e0)](_0x12696b,_0x10aabe,_0x56a6be,_0x58d02d),_0x12696b[_0x23be9a(0x1ec)]?0x0:0x1;}['displayValidateResults'](_0x5d8518,_0x1e45db,_0x59a318,_0x58855e){const _0x10d050=a31_0x40ba7c;console['error']('\x0a'+a31_0x11627e[_0x10d050(0x1ee)](_0x10d050(0x270))+'\x20'+_0x5d8518[_0x10d050(0x1f7)]),console[_0x10d050(0x29c)]('═'['repeat'](0x3c)),this[_0x10d050(0x1a3)](_0x5d8518);if(typeof _0x1e45db[_0x10d050(0x1b3)]===_0x10d050(0xb0)){this[_0x10d050(0x19c)](_0x5d8518),this[_0x10d050(0xee)](_0x5d8518),this[_0x10d050(0x120)](_0x59a318,_0x58855e,_0x10d050(0x1b3),_0x1e45db[_0x10d050(0x1b3)]);return;}if(_0x1e45db[_0x10d050(0x1b3)]===!![]){this['displayAttributesStats'](_0x5d8518),this[_0x10d050(0xee)](_0x5d8518),this[_0x10d050(0x120)](_0x59a318,_0x58855e,'attributes');return;}if(typeof _0x1e45db[_0x10d050(0x19e)]===_0x10d050(0xb0)){this[_0x10d050(0x127)](_0x5d8518,_0x58855e),this[_0x10d050(0xee)](_0x5d8518),this[_0x10d050(0x120)](_0x59a318,_0x58855e,_0x10d050(0x19e),_0x1e45db[_0x10d050(0x19e)]);return;}if(_0x1e45db['behavior']===!![]){this[_0x10d050(0x127)](_0x5d8518,_0x58855e),this[_0x10d050(0xee)](_0x5d8518),this[_0x10d050(0x120)](_0x59a318,_0x58855e,_0x10d050(0xd6));return;}this[_0x10d050(0x19c)](_0x5d8518),this[_0x10d050(0x127)](_0x5d8518,_0x58855e),this[_0x10d050(0x163)](_0x5d8518),this[_0x10d050(0xee)](_0x5d8518),this[_0x10d050(0x120)](_0x59a318,_0x58855e,_0x10d050(0x273));}[a31_0x40ba7c(0x163)](_0x423c0e){displayRealtimeValidation(_0x423c0e);}[a31_0x40ba7c(0x120)](_0x1fa221,_0x4d1a8a,_0x250d73,_0x1f7621){const _0xbdac77=a31_0x40ba7c;console['error']('\x0a'+a31_0x11627e[_0xbdac77(0x24f)]('To\x20view\x20sample\x20data:'));const _0x44e5bc=_0x4d1a8a!=='-1d'?_0xbdac77(0xa8)+_0x4d1a8a:'';if(_0x250d73==='attribute'&&_0x1f7621)console[_0xbdac77(0x29c)]('\x20\x20'+a31_0x11627e[_0xbdac77(0x24f)](_0xbdac77(0x274)+_0x1fa221+_0xbdac77(0xb1)+_0x1f7621+'\x22'+_0x44e5bc));else{if(_0x250d73==='behavior'&&_0x1f7621)console[_0xbdac77(0x29c)]('\x20\x20'+a31_0x11627e['dim'](_0xbdac77(0x274)+_0x1fa221+'\x20--behavior\x20\x22'+_0x1f7621+'\x22'+_0x44e5bc));else(_0x250d73===_0xbdac77(0x1b5)||_0x250d73==='all')&&console[_0xbdac77(0x29c)]('\x20\x20'+a31_0x11627e[_0xbdac77(0x24f)](_0xbdac77(0x274)+_0x1fa221+_0xbdac77(0x266)+_0x44e5bc));}(_0x250d73===_0xbdac77(0xd6)||_0x250d73==='all')&&console[_0xbdac77(0x29c)]('\x20\x20'+a31_0x11627e[_0xbdac77(0x24f)](_0xbdac77(0x274)+_0x1fa221+'\x20--behavior\x20\x22<name>\x22'+_0x44e5bc)),_0x250d73===_0xbdac77(0x273)&&console[_0xbdac77(0x29c)]('\x20\x20'+a31_0x11627e[_0xbdac77(0x24f)]('tdx\x20ps\x20preview\x20'+_0x1fa221+_0xbdac77(0x1e6)+_0x44e5bc));}[a31_0x40ba7c(0x1a3)](_0x221aea){const _0x13d256=a31_0x40ba7c,{master:_0x601cdf}=_0x221aea,_0x2ca2bb=_0x601cdf[_0x13d256(0xe3)]?a31_0x11627e[_0x13d256(0x14f)]('✔'):a31_0x11627e['red']('✘');console[_0x13d256(0x29c)]('\x0a'+a31_0x11627e[_0x13d256(0x24f)](_0x13d256(0xbb))),console[_0x13d256(0x29c)](_0x2ca2bb+'\x20'+a31_0x11627e[_0x13d256(0x1ee)](_0x601cdf[_0x13d256(0x255)]+'.'+_0x601cdf[_0x13d256(0x18e)])),_0x601cdf[_0x13d256(0xe3)]?_0x601cdf[_0x13d256(0x17b)]!==undefined&&console['error']('\x20\x20'+a31_0x11627e[_0x13d256(0x24f)]('Rows:')+'\x20'+a31_0x11627e['cyan'](formatRows(_0x601cdf[_0x13d256(0x17b)]))):console[_0x13d256(0x29c)]('\x20\x20'+a31_0x11627e[_0x13d256(0x208)](_0x13d256(0x1cc))+'\x20'+_0x601cdf[_0x13d256(0xb3)]);}['displayAttributesStats'](_0x4b5696){const _0x4330cc=a31_0x40ba7c;if(_0x4b5696['attributes'][_0x4330cc(0xfe)]===0x0)return;console['error']('\x0a'+a31_0x11627e[_0x4330cc(0x24f)](_0x4330cc(0x1ca)));for(const _0x4d432a of _0x4b5696[_0x4330cc(0x1b5)]){const _0x57fc76=_0x4d432a['schemaValid']?a31_0x11627e['green']('✔'):a31_0x11627e[_0x4330cc(0x208)]('✘');let _0xa94d1e='';if(_0x4d432a['schemaValid']&&_0x4d432a['matchedCount']!==undefined&&_0x4d432a[_0x4330cc(0x1b0)]!==undefined){const _0x26e652=_0x4d432a[_0x4330cc(0x1b0)][_0x4330cc(0xc8)](0x1),_0x8ad7d=_0x4d432a[_0x4330cc(0x1b0)]>=0x50?a31_0x11627e[_0x4330cc(0x14f)]:_0x4d432a['coveragePercent']>=0x32?a31_0x11627e[_0x4330cc(0x12d)]:a31_0x11627e[_0x4330cc(0x208)];_0xa94d1e='\x20'+a31_0x11627e[_0x4330cc(0x24f)](_0x4330cc(0x13d))+'\x20'+_0x8ad7d(_0x26e652+'%')+'\x20('+formatRows(_0x4d432a['matchedCount'])+'\x20rows)';}console[_0x4330cc(0x29c)](_0x57fc76+'\x20'+a31_0x11627e['bold'](_0x4d432a[_0x4330cc(0x1f7)])+_0xa94d1e),console[_0x4330cc(0x29c)]('\x20\x20'+a31_0x11627e[_0x4330cc(0x24f)](_0x4330cc(0x110))+'\x20'+a31_0x11627e[_0x4330cc(0x1ee)](_0x4d432a[_0x4330cc(0x255)]+'.'+_0x4d432a['table']));const _0x167bf4=_0x4d432a[_0x4330cc(0x217)]===_0x4d432a[_0x4330cc(0xf5)]?a31_0x11627e[_0x4330cc(0x24f)]('Join\x20on:')+'\x20'+_0x4d432a[_0x4330cc(0x217)]:a31_0x11627e[_0x4330cc(0x24f)]('Join:')+'\x20'+_0x4d432a[_0x4330cc(0x217)]+_0x4330cc(0xef)+_0x4d432a[_0x4330cc(0xf5)];console[_0x4330cc(0x29c)]('\x20\x20'+_0x167bf4),console[_0x4330cc(0x29c)]('\x20\x20'+a31_0x11627e['dim']('Columns:')),this[_0x4330cc(0x1fa)](_0x4d432a[_0x4330cc(0xd5)]),!_0x4d432a[_0x4330cc(0xe3)]&&console['error']('\x20\x20'+a31_0x11627e['red'](_0x4330cc(0x1cc))+'\x20'+_0x4d432a['schemaError']);}}[a31_0x40ba7c(0x127)](_0x378f99,_0x18a965){const _0xcdde7a=a31_0x40ba7c;if(_0x378f99[_0xcdde7a(0xd6)][_0xcdde7a(0xfe)]===0x0)return;console[_0xcdde7a(0x29c)]('\x0a'+a31_0x11627e[_0xcdde7a(0x24f)](_0xcdde7a(0x96))+'\x20'+a31_0x11627e['dim']('('+_0x18a965+')'));for(const _0x11d577 of _0x378f99[_0xcdde7a(0xd6)]){const _0x204f2a=_0x11d577[_0xcdde7a(0xe3)]?a31_0x11627e[_0xcdde7a(0x14f)]('✔'):a31_0x11627e['red']('✘');let _0x59ea88='';if(_0x11d577['schemaValid']&&_0x11d577[_0xcdde7a(0x180)]!==undefined&&_0x11d577[_0xcdde7a(0x248)]!==undefined){const _0x591ad4=_0x11d577[_0xcdde7a(0x1e8)]?.[_0xcdde7a(0xc8)](0x1)||'?',_0x34db87=(_0x11d577[_0xcdde7a(0x1e8)]??0x0)>=0x32?a31_0x11627e[_0xcdde7a(0x14f)]:(_0x11d577[_0xcdde7a(0x1e8)]??0x0)>=0x14?a31_0x11627e[_0xcdde7a(0x12d)]:a31_0x11627e[_0xcdde7a(0x208)];_0x59ea88='\x20'+a31_0x11627e[_0xcdde7a(0x24f)](_0xcdde7a(0x27e))+'\x20'+_0x34db87(formatRows(_0x11d577['customersWithEvents']))+'\x20('+_0x591ad4+'%)\x20'+a31_0x11627e[_0xcdde7a(0x24f)](_0xcdde7a(0x18f))+'\x20'+a31_0x11627e[_0xcdde7a(0x280)](formatRows(_0x11d577['totalEvents']));}console['error'](_0x204f2a+'\x20'+a31_0x11627e[_0xcdde7a(0x1ee)](_0x11d577['name'])+_0x59ea88),console[_0xcdde7a(0x29c)]('\x20\x20'+a31_0x11627e['dim'](_0xcdde7a(0x110))+'\x20'+a31_0x11627e[_0xcdde7a(0x1ee)](_0x11d577[_0xcdde7a(0x255)]+'.'+_0x11d577[_0xcdde7a(0x18e)]));const _0xb87922=_0x11d577['joinKey']===_0x11d577[_0xcdde7a(0xf5)]?a31_0x11627e[_0xcdde7a(0x24f)](_0xcdde7a(0x2a7))+'\x20'+_0x11d577[_0xcdde7a(0x217)]:a31_0x11627e[_0xcdde7a(0x24f)]('Join:')+'\x20'+_0x11d577[_0xcdde7a(0x217)]+_0xcdde7a(0xef)+_0x11d577[_0xcdde7a(0xf5)];console[_0xcdde7a(0x29c)]('\x20\x20'+_0xb87922),console['error']('\x20\x20'+a31_0x11627e[_0xcdde7a(0x24f)]('Columns:')),this[_0xcdde7a(0x1fa)](_0x11d577['columns']),!_0x11d577[_0xcdde7a(0xe3)]&&console[_0xcdde7a(0x29c)]('\x20\x20'+a31_0x11627e['red']('Error:')+'\x20'+_0x11d577[_0xcdde7a(0xb3)]);}}[a31_0x40ba7c(0x1fa)](_0x7ae0af){const _0x145273=a31_0x40ba7c;for(const _0x4ecbbc of _0x7ae0af){_0x4ecbbc[_0x145273(0x1e5)]===_0x4ecbbc[_0x145273(0x1a6)]||_0x4ecbbc['column']==='*'?console['error'](_0x145273(0x136)+_0x4ecbbc[_0x145273(0x1e5)]):console[_0x145273(0x29c)](_0x145273(0x136)+_0x4ecbbc['label']+'\x20'+a31_0x11627e[_0x145273(0x24f)]('('+_0x4ecbbc[_0x145273(0x1a6)]+')'));}}[a31_0x40ba7c(0xee)](_0x1794ce){const _0x2be35d=a31_0x40ba7c;console['error']('─'[_0x2be35d(0x230)](0x3c));if(_0x1794ce[_0x2be35d(0x199)][_0x2be35d(0xfe)]>0x0){console['error']('\x0a'+a31_0x11627e[_0x2be35d(0x208)](_0x2be35d(0x194)));for(const _0x37efcd of _0x1794ce[_0x2be35d(0x199)]){console[_0x2be35d(0x29c)]('\x20\x20'+a31_0x11627e[_0x2be35d(0x208)]('•')+'\x20'+_0x37efcd);}}_0x1794ce[_0x2be35d(0x1ec)]&&console[_0x2be35d(0x29c)]('\x0a'+a31_0x11627e[_0x2be35d(0x14f)]('✔')+'\x20Configuration\x20is\x20valid');}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a31_0x40ba7c(0x1f7)]=a31_0x40ba7c(0x1d2);[a31_0x40ba7c(0x162)]=a31_0x40ba7c(0xad);async[a31_0x40ba7c(0x22d)](_0x1cd200){const _0x4fc5b3=a31_0x40ba7c,{options:_0x252138,args:_0x24f790,tdx:_0x48d90b}=_0x1cd200,_0x2385b5=_0x252138,_0x41f8b5=_0x24f790[0x0]||_0x252138['parentSegment'];if(!_0x41f8b5)return showParentSegmentNotSetError(_0x4fc5b3(0x19b)+_0x4fc5b3(0x1dd)+_0x4fc5b3(0x171)+'\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a'+_0x4fc5b3(0x1bd)+_0x4fc5b3(0x12a)+_0x4fc5b3(0x24d)+'\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)'),0x1;if(!_0x2385b5['master']&&!_0x2385b5[_0x4fc5b3(0x1b3)]&&!_0x2385b5[_0x4fc5b3(0x19e)]&&!_0x2385b5[_0x4fc5b3(0x296)])return console[_0x4fc5b3(0x29c)](a31_0x11627e['red'](_0x4fc5b3(0x200))),console['error'](_0x4fc5b3(0xae)),console['error'](_0x4fc5b3(0x1cf)),console[_0x4fc5b3(0x29c)](_0x4fc5b3(0x1ac)),console[_0x4fc5b3(0x29c)](_0x4fc5b3(0x115)),console[_0x4fc5b3(0x29c)](_0x4fc5b3(0x143)),console[_0x4fc5b3(0x29c)]('\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data'),0x1;const _0x4ae4fa=resolveYamlFile(_0x41f8b5);if(!existsSync(_0x4ae4fa))return showFileNotFoundError(_0x4ae4fa,_0x41f8b5),0x1;_0x2385b5[_0x4fc5b3(0x16c)]&&(console[_0x4fc5b3(0x29c)](_0x4fc5b3(0x242)+_0x2385b5[_0x4fc5b3(0x1ce)]),console[_0x4fc5b3(0x29c)](_0x4fc5b3(0x9b)+_0x4ae4fa));let _0x31212d;try{_0x31212d=readFileSync(_0x4ae4fa,_0x4fc5b3(0x251));}catch(_0x419f0c){const _0x4172db=_0x419f0c instanceof Error?_0x419f0c[_0x4fc5b3(0x263)]:String(_0x419f0c);return console[_0x4fc5b3(0x29c)](_0x4fc5b3(0x135)+_0x4172db),0x1;}let _0x5af031;try{_0x5af031=parseDef(_0x31212d);}catch(_0x4e9923){const _0x45a42f=_0x4e9923 instanceof Error?_0x4e9923['message']:String(_0x4e9923);return console[_0x4fc5b3(0x29c)](a31_0x11627e[_0x4fc5b3(0x208)](_0x4fc5b3(0x210)+_0x45a42f)),0x1;}if(_0x2385b5[_0x4fc5b3(0x1b3)]===!![]||_0x2385b5[_0x4fc5b3(0x1b3)]===''){const _0x22d50c=_0x5af031['attributes']?.[_0x4fc5b3(0x295)](_0x19363e=>_0x19363e['name'])||[];if(_0x22d50c[_0x4fc5b3(0xfe)]===0x0)console['error'](a31_0x11627e[_0x4fc5b3(0x208)](_0x4fc5b3(0xc3)));else{console[_0x4fc5b3(0x29c)](a31_0x11627e[_0x4fc5b3(0x208)](_0x4fc5b3(0x129))),console['error'](_0x4fc5b3(0x21e));for(const _0x3b632c of _0x22d50c){console[_0x4fc5b3(0x29c)]('\x20\x20'+a31_0x11627e['cyan'](_0x3b632c));}console['error'](_0x4fc5b3(0xea)+_0x41f8b5+'\x20--attribute\x20\x22'+_0x22d50c[0x0]+'\x22');}return 0x1;}if(_0x2385b5[_0x4fc5b3(0x19e)]===!![]||_0x2385b5[_0x4fc5b3(0x19e)]===''){const _0x5a9793=_0x5af031[_0x4fc5b3(0xd6)]?.[_0x4fc5b3(0x295)](_0x3d2476=>_0x3d2476[_0x4fc5b3(0x1f7)])||[];if(_0x5a9793['length']===0x0)console['error'](a31_0x11627e[_0x4fc5b3(0x208)](_0x4fc5b3(0xbe)));else{console[_0x4fc5b3(0x29c)](a31_0x11627e[_0x4fc5b3(0x208)]('Error:\x20--behavior\x20requires\x20a\x20name\x0a')),console['error']('Available\x20behaviors:');for(const _0x595112 of _0x5a9793){console[_0x4fc5b3(0x29c)]('\x20\x20'+a31_0x11627e[_0x4fc5b3(0x280)](_0x595112));}console[_0x4fc5b3(0x29c)](_0x4fc5b3(0xea)+_0x41f8b5+_0x4fc5b3(0xf0)+_0x5a9793[0x0]+'\x22');}return 0x1;}const _0x242042=createCommandSpinner(a31_0x11627e['dim'](_0x4fc5b3(0x1b6)),{'verbose':_0x2385b5['verbose']});_0x242042[_0x4fc5b3(0x149)]();const _0x4799ec={'onProgress':_0x36e71c=>{const _0x15e2ad=_0x4fc5b3;_0x242042[_0x15e2ad(0x1f6)]=formatProgressMessage(_0x36e71c);}};if(_0x2385b5[_0x4fc5b3(0x188)])_0x4799ec[_0x4fc5b3(0x188)]=!![];if(_0x2385b5['attribute']&&typeof _0x2385b5[_0x4fc5b3(0x1b3)]===_0x4fc5b3(0xb0))_0x4799ec[_0x4fc5b3(0x1b3)]=_0x2385b5[_0x4fc5b3(0x1b3)];if(_0x2385b5[_0x4fc5b3(0x19e)]&&typeof _0x2385b5['behavior']===_0x4fc5b3(0xb0))_0x4799ec[_0x4fc5b3(0x19e)]=_0x2385b5[_0x4fc5b3(0x19e)];if(_0x2385b5[_0x4fc5b3(0x296)])_0x4799ec['enriched']=!![];if(_0x2385b5['interval'])_0x4799ec[_0x4fc5b3(0x23a)]=_0x2385b5[_0x4fc5b3(0x23a)];let _0x2bab9e;try{_0x2bab9e=await _0x48d90b['segment']['previewParentYaml'](_0x31212d,_0x4799ec),_0x242042[_0x4fc5b3(0x1cd)]();}catch(_0x34c29d){_0x242042[_0x4fc5b3(0x1cd)]();throw _0x34c29d;}return await this[_0x4fc5b3(0x26e)](_0x2bab9e,{'master':_0x2385b5[_0x4fc5b3(0x188)],'attribute':typeof _0x2385b5[_0x4fc5b3(0x1b3)]==='string'?_0x2385b5[_0x4fc5b3(0x1b3)]:undefined,'behavior':typeof _0x2385b5[_0x4fc5b3(0x19e)]===_0x4fc5b3(0xb0)?_0x2385b5[_0x4fc5b3(0x19e)]:undefined,'enriched':_0x2385b5['enriched']}),_0x2bab9e['allValid']?0x0:0x1;}async[a31_0x40ba7c(0x26e)](_0x2f4339,_0x27d405){const _0x5e1792=a31_0x40ba7c;console[_0x5e1792(0x29c)]('\x0a'+a31_0x11627e['bold']('Preview:')+'\x20'+_0x2f4339[_0x5e1792(0x1f7)]),console[_0x5e1792(0x29c)]('═'[_0x5e1792(0x230)](0x3c));if(_0x27d405[_0x5e1792(0x188)]&&_0x2f4339['sampleData']){const _0x4f32f9=a31_0x11627e[_0x5e1792(0x24f)](_0x5e1792(0x21d))+'\x20'+a31_0x11627e['bold'](_0x2f4339[_0x5e1792(0x188)]['database']+'.'+_0x2f4339[_0x5e1792(0x188)][_0x5e1792(0x18e)]);await this[_0x5e1792(0x239)](_0x4f32f9,_0x2f4339[_0x5e1792(0x1ae)]);}else{if(_0x27d405[_0x5e1792(0x1b3)]&&_0x2f4339[_0x5e1792(0x1ae)]){const _0x3cba59=a31_0x11627e[_0x5e1792(0x24f)](_0x5e1792(0xda))+'\x20'+a31_0x11627e[_0x5e1792(0x1ee)](_0x27d405[_0x5e1792(0x1b3)]);await this[_0x5e1792(0x239)](_0x3cba59,_0x2f4339[_0x5e1792(0x1ae)]);}else{if(_0x27d405['behavior']&&_0x2f4339['sampleData']){const _0x4b2d41=a31_0x11627e[_0x5e1792(0x24f)]('Behavior:')+'\x20'+a31_0x11627e[_0x5e1792(0x1ee)](_0x27d405['behavior']);await this[_0x5e1792(0x239)](_0x4b2d41,_0x2f4339['sampleData']);}else{if(_0x27d405['enriched']&&_0x2f4339[_0x5e1792(0x1ae)]){const _0x195860=a31_0x11627e[_0x5e1792(0x24f)](_0x5e1792(0x277))+'\x20'+a31_0x11627e[_0x5e1792(0x1ee)](_0x5e1792(0x193));await this['displaySampleData'](_0x195860,_0x2f4339[_0x5e1792(0x1ae)]);}else!_0x2f4339[_0x5e1792(0x1ae)]&&console[_0x5e1792(0x29c)](_0x5e1792(0x1b9));}}}if(_0x2f4339[_0x5e1792(0x199)][_0x5e1792(0xfe)]>0x0){console['error']('─'[_0x5e1792(0x230)](0x3c)),console['error']('\x0a'+a31_0x11627e['red'](_0x5e1792(0x194)));for(const _0x1fd874 of _0x2f4339['errors']){console[_0x5e1792(0x29c)]('\x20\x20'+a31_0x11627e['red']('•')+'\x20'+_0x1fd874);}}}async['displaySampleData'](_0x135f8b,_0x43cfc6){const _0x556a44=a31_0x40ba7c;if(_0x43cfc6[_0x556a44(0xfe)]===0x0){console[_0x556a44(0x29c)]('\x0a'+_0x135f8b),console[_0x556a44(0x29c)](_0x556a44(0x103));return;}console['error']('\x0a'+_0x135f8b);const _0x360263=Object[_0x556a44(0xcc)](_0x43cfc6[0x0])[_0x556a44(0x295)](_0x24e4b4=>({'name':_0x24e4b4,'type':typeof _0x43cfc6[0x0][_0x24e4b4]==='number'?'double':_0x556a44(0x161)})),_0x119a22={'queryId':_0x556a44(0x282),'columns':_0x360263,'data':_0x43cfc6,'stats':{'state':_0x556a44(0x154),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x43cfc6[_0x556a44(0xfe)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x354dc2=formatAsTable(_0x119a22,_0x43cfc6[_0x556a44(0xfe)],!![]);await writeOutput(_0x354dc2,undefined,_0x556a44(0x18e));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a31_0x40ba7c(0x1f7)]='segment:parent:run';[a31_0x40ba7c(0x162)]=a31_0x40ba7c(0x14b);async[a31_0x40ba7c(0x22d)](_0x4c4767){const _0x3d4b1f=a31_0x40ba7c,{options:_0x59fb65,args:_0x55644e,tdx:_0x4e4f72}=_0x4c4767,_0x1fc291=_0x59fb65,_0x167394=_0x55644e[0x0]||_0x59fb65[_0x3d4b1f(0x1d5)];if(!_0x167394)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'+_0x3d4b1f(0x2a8)),0x1;const _0x1e2d49=resolveYamlFile(_0x167394);if(existsSync(_0x1e2d49)){_0x1fc291['verbose']&&console['error'](_0x3d4b1f(0xa5)+_0x1e2d49);let _0x16ce2b;try{_0x16ce2b=readFileSync(_0x1e2d49,_0x3d4b1f(0x251));}catch(_0x10254f){const _0x64c41=_0x10254f instanceof Error?_0x10254f['message']:String(_0x10254f);return console[_0x3d4b1f(0x29c)](_0x3d4b1f(0x135)+_0x64c41),0x1;}const _0x598043=await withSpinner('Analyzing\x20changes...',()=>_0x4e4f72[_0x3d4b1f(0x14e)]['pushParentYaml'](_0x16ce2b),{'verbose':_0x1fc291['verbose']}),_0x5199a9=_0x598043['data'],{isNew:_0x2e0b19,name:_0x13b81d,hasChanges:_0x5d8a6d,diffFormatted:_0x5436f5}=_0x5199a9;if(_0x5d8a6d){_0x2e0b19?console[_0x3d4b1f(0x29c)](_0x3d4b1f(0x190)+_0x13b81d+'\x27:'):console[_0x3d4b1f(0x29c)]('\x0aChanges\x20to\x20apply\x20to\x20\x27'+_0x13b81d+'\x27:');console['error']('─'[_0x3d4b1f(0x230)](0x3c)),console[_0x3d4b1f(0x29c)](_0x5436f5),console[_0x3d4b1f(0x29c)]('─'[_0x3d4b1f(0x230)](0x3c));const _0xdac6ef=_0x2e0b19?'Create\x20parent\x20segment\x20\x27'+_0x13b81d+_0x3d4b1f(0xcd):_0x3d4b1f(0x27c)+_0x13b81d+_0x3d4b1f(0xcd);if(!_0x1fc291[_0x3d4b1f(0x22b)]){if(!isInteractive())return console[_0x3d4b1f(0x29c)](a31_0x11627e[_0x3d4b1f(0x208)](_0x3d4b1f(0x1e9)),_0x3d4b1f(0x1a4)),console[_0x3d4b1f(0x29c)](a31_0x11627e[_0x3d4b1f(0x24f)](_0x3d4b1f(0x147))),0x1;const _0x398b93=await confirmKey(_0xdac6ef);if(!_0x398b93)return console[_0x3d4b1f(0x29c)](a31_0x11627e[_0x3d4b1f(0x12d)](_0x3d4b1f(0x201))),0x1;}const _0x2ce034=_0x2e0b19?_0x3d4b1f(0xd0):_0x3d4b1f(0x16e);await withSpinner(_0x2ce034+_0x3d4b1f(0x17d)+_0x13b81d+_0x3d4b1f(0x1ef),()=>_0x5199a9[_0x3d4b1f(0xb6)](),{'verbose':_0x1fc291['verbose']});const _0x5e4120=_0x2e0b19?'Created':_0x3d4b1f(0xbd);console[_0x3d4b1f(0x29c)]('✔\x20'+_0x5e4120+_0x3d4b1f(0x17d)+_0x13b81d+'\x27');}else console[_0x3d4b1f(0x29c)]('✔\x20No\x20changes\x20-\x20\x27'+_0x13b81d+_0x3d4b1f(0x12b));}const _0x11f062=await withSpinner('Running\x20parent\x20segment\x20workflow\x20for\x20\x27'+_0x167394+_0x3d4b1f(0x1ef),()=>_0x4e4f72[_0x3d4b1f(0x14e)]['runParent'](_0x167394),{'verbose':_0x1fc291[_0x3d4b1f(0x16c)]}),_0x375c90=_0x11f062[_0x3d4b1f(0x258)],_0x5019f7=getConsoleUrl(_0x1fc291['site'],_0x3d4b1f(0x24a)+_0x375c90['workflowId']+_0x3d4b1f(0x1be)+_0x375c90['workflowSessionId']+_0x3d4b1f(0xc0)+_0x375c90[_0x3d4b1f(0x281)]);return console['error'](_0x3d4b1f(0x29b)),console[_0x3d4b1f(0x29c)]('\x20\x20'+a31_0x11627e['dim'](_0x3d4b1f(0x153))+'\x20'+_0x375c90[_0x3d4b1f(0x11a)]),console['error']('\x20\x20'+a31_0x11627e[_0x3d4b1f(0x24f)](_0x3d4b1f(0x1d9))+'\x20'+_0x375c90[_0x3d4b1f(0x1ea)]),console[_0x3d4b1f(0x29c)]('\x20\x20'+a31_0x11627e[_0x3d4b1f(0x24f)](_0x3d4b1f(0xec))+'\x20'+_0x375c90['workflowSessionId']),console[_0x3d4b1f(0x29c)]('\x20\x20'+a31_0x11627e['dim'](_0x3d4b1f(0x1d4))+'\x20'+_0x375c90['workflowAttemptId']),console[_0x3d4b1f(0x29c)]('\x20\x20'+_0x5019f7),console[_0x3d4b1f(0x29c)]('\x0a'+a31_0x11627e[_0x3d4b1f(0x24f)](_0x3d4b1f(0x152))+_0x3d4b1f(0xfa)+_0x375c90['workflowAttemptId']+'\x20kill'),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a31_0x40ba7c(0x1f7)]='segment:parent:fields';[a31_0x40ba7c(0x162)]=a31_0x40ba7c(0x1ed);async['execute'](_0x32c54e){const _0x2de10d=a31_0x40ba7c,{options:_0xb92682,args:_0xd323e1,tdx:_0x41a958}=_0x32c54e,_0x5e3b29=_0xd323e1[0x0]||_0xb92682[_0x2de10d(0x1d5)];if(!_0x5e3b29)return showParentSegmentNotSetError(_0x2de10d(0x131)+_0x2de10d(0x179)),0x1;_0xb92682['verbose']&&(console[_0x2de10d(0x29c)](_0x2de10d(0x242)+_0xb92682[_0x2de10d(0x1ce)]),console[_0x2de10d(0x29c)](_0x2de10d(0x138)+_0x5e3b29));const _0x369ef6=await withSpinner(_0x2de10d(0x177)+_0x5e3b29+'\x27...',()=>_0x41a958[_0x2de10d(0x14e)][_0x2de10d(0x2a5)](_0x5e3b29),{'verbose':_0xb92682[_0x2de10d(0x16c)]}),_0x5db95b=_0x369ef6[_0x2de10d(0x258)];console[_0x2de10d(0x29c)](_0x2de10d(0x24e)+_0x5db95b[_0x2de10d(0xfe)]+_0x2de10d(0x1a9)+(_0x5db95b[_0x2de10d(0xfe)]!==0x1?'s':''));if(_0xb92682['json']||_0xb92682[_0x2de10d(0xe2)])return await handleSDKOutput(_0x5db95b,_0xb92682),0x0;return displayFieldsHumanReadable(_0x5db95b,_0x5e3b29),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a31_0x40ba7c(0x1f7)]=a31_0x40ba7c(0x109);[a31_0x40ba7c(0x162)]=a31_0x40ba7c(0x186);async[a31_0x40ba7c(0x22d)](_0x2af14d){const _0x57f059=a31_0x40ba7c,{options:_0x30bdb4,args:_0x1dc564,tdx:_0x581518}=_0x2af14d,_0x4231aa=_0x30bdb4,_0x7b2c61=_0x1dc564[0x0]||_0x30bdb4[_0x57f059(0x1d5)];if(!_0x7b2c61)return showParentSegmentNotSetError(_0x57f059(0xed)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a'+_0x57f059(0x246)+_0x57f059(0x1f2)),0x1;_0x30bdb4['verbose']&&(console[_0x57f059(0x29c)](_0x57f059(0x242)+_0x30bdb4[_0x57f059(0x1ce)]),console[_0x57f059(0x29c)](_0x57f059(0x138)+_0x7b2c61));const _0x3ef4aa=await withSpinner(_0x57f059(0x97)+_0x7b2c61+_0x57f059(0x1ef),()=>_0x581518[_0x57f059(0x14e)][_0x57f059(0x1f8)](_0x7b2c61),{'verbose':_0x30bdb4[_0x57f059(0x16c)]}),_0x15d44d=_0x3ef4aa[_0x57f059(0x258)];if(_0x4231aa[_0x57f059(0x112)]){const _0x232dde=getConsoleNextUrl(_0x4231aa[_0x57f059(0x1ce)],'/app/dw/parentSegments/'+_0x15d44d['id']);return console['error'](a31_0x11627e[_0x57f059(0x14f)]('✔')+_0x57f059(0x18b)+a31_0x11627e[_0x57f059(0x280)](_0x232dde)),openBrowser(_0x232dde),0x0;}return await handleSingleObjectOutput(_0x15d44d,_0x30bdb4),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{['name']=a31_0x40ba7c(0x23e);['description']='Show\x20parent\x20segment\x20schema\x20(column\x20types)';async[a31_0x40ba7c(0x22d)](_0x46cc7d){const _0x3358fd=a31_0x40ba7c,{options:_0x40c48c,args:_0x54789b,tdx:_0x102dc3}=_0x46cc7d,_0x552979=_0x40c48c,_0x13bf85=_0x54789b[0x0]||_0x40c48c[_0x3358fd(0x1d5)];if(!_0x13bf85)return showParentSegmentNotSetError('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\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20all\x20tables\x20for\x20parent\x20segment\x0a\x0a'+_0x3358fd(0x246)+_0x3358fd(0x1aa)),0x1;_0x40c48c[_0x3358fd(0x16c)]&&(console[_0x3358fd(0x29c)](_0x3358fd(0x242)+_0x40c48c[_0x3358fd(0x1ce)]),console[_0x3358fd(0x29c)](_0x3358fd(0x138)+_0x13bf85));const _0x100424=await withSpinner(_0x3358fd(0x151)+_0x13bf85+_0x3358fd(0x1ef),()=>_0x102dc3['segment']['resolveParentId'](_0x13bf85),{'verbose':_0x40c48c['verbose']}),_0x5881eb=_0x100424[_0x3358fd(0x258)],_0x2aab94=_0x102dc3['segment']['getOutputDatabaseName'](_0x5881eb);if(_0x552979[_0x3358fd(0x176)]){const _0x254d87=await this['collectSchema'](_0x46cc7d,_0x13bf85,_0x5881eb,_0x2aab94),_0x57e02a=this['formatSchemaJson'](_0x254d87);writeFileSync(_0x552979['output'],_0x57e02a);const _0x1c073c=_0x254d87[_0x3358fd(0x297)][_0x3358fd(0xd5)][_0x3358fd(0xfe)]+_0x254d87[_0x3358fd(0xd6)][_0x3358fd(0x1ba)]((_0x401dc8,_0x327d01)=>_0x401dc8+_0x327d01[_0x3358fd(0xd5)][_0x3358fd(0xfe)],0x0),_0xb47110=_0x254d87[_0x3358fd(0xd6)][_0x3358fd(0xe1)](_0x17fa55=>_0x17fa55[_0x3358fd(0xd5)][_0x3358fd(0xfe)]===0x0)['length'];return console['log'](_0x3358fd(0x157)+_0x552979['output']),console[_0x3358fd(0x165)](_0x3358fd(0x227)+_0x2aab94),console[_0x3358fd(0x165)](_0x3358fd(0xe6)+_0x254d87[_0x3358fd(0xd6)][_0x3358fd(0xfe)]+_0x3358fd(0x167)),console[_0x3358fd(0x165)](_0x3358fd(0x174)+_0x1c073c+'\x20total'),_0xb47110>0x0&&console[_0x3358fd(0x165)](_0x3358fd(0x203)+_0xb47110+_0x3358fd(0xa2)),0x0;}console[_0x3358fd(0x29c)]('\x0a'+a31_0x11627e[_0x3358fd(0x1ee)]('Output\x20Database:')+'\x20'+a31_0x11627e[_0x3358fd(0x280)](_0x2aab94));const _0x536505=await withSpinner('Fetching\x20customers\x20schema...',()=>_0x102dc3[_0x3358fd(0x14e)]['getParentSQL'](_0x5881eb),{'verbose':_0x40c48c[_0x3358fd(0x16c)]});console[_0x3358fd(0x29c)]('\x0a'+a31_0x11627e[_0x3358fd(0x1ee)](_0x3358fd(0x297))+'\x20'+a31_0x11627e[_0x3358fd(0x24f)]('('+_0x2aab94+_0x3358fd(0x9c)));const _0x2416ff=await executeSchemaQuery(_0x536505[_0x3358fd(0x258)],_0x102dc3,_0x40c48c);await handleQueryOutput(_0x2416ff,_0x40c48c);const _0x48904e=await withSpinner(_0x3358fd(0x132),()=>_0x102dc3[_0x3358fd(0x14e)][_0x3358fd(0x2a1)](_0x5881eb),{'verbose':_0x40c48c['verbose']});for(const _0x2e0f2a of _0x48904e[_0x3358fd(0x258)]){const _0x4fc5f6=_0x3358fd(0x187)+_0x2e0f2a[_0x3358fd(0xd9)]()[_0x3358fd(0x11d)](/\s+/g,'_'),_0x55c358=_0x3358fd(0x1d7)+_0x2aab94+'.'+_0x4fc5f6;console[_0x3358fd(0x29c)]('\x0a'+a31_0x11627e[_0x3358fd(0x1ee)](_0x2e0f2a)+'\x20'+a31_0x11627e[_0x3358fd(0x24f)]('('+_0x2aab94+'.'+_0x4fc5f6+')'));try{const _0x5594af=await executeSchemaQuery(_0x55c358,_0x102dc3,_0x40c48c);await handleQueryOutput(_0x5594af,_0x40c48c);}catch{console[_0x3358fd(0x29c)](a31_0x11627e[_0x3358fd(0x12d)](_0x3358fd(0xa0)));}}return 0x0;}async[a31_0x40ba7c(0x261)](_0x33940a,_0x1d95ac,_0x2b0d4f,_0x21f5ac){const _0xc5ec0e=a31_0x40ba7c,{options:_0x41908a,tdx:_0x51f81b}=_0x33940a,_0x4ed988=await withSpinner(_0xc5ec0e(0x14d),()=>_0x51f81b[_0xc5ec0e(0x14e)]['getParentSQL'](_0x2b0d4f),{'verbose':_0x41908a[_0xc5ec0e(0x16c)]}),_0x489184=await executeSchemaQuery(_0x4ed988[_0xc5ec0e(0x258)],_0x51f81b,_0x41908a),_0x16202b=_0x489184[_0xc5ec0e(0x258)][_0xc5ec0e(0x295)](_0x3e9a7d=>({'name':_0x3e9a7d[_0xc5ec0e(0x169)],'type':_0x3e9a7d[_0xc5ec0e(0x216)]})),_0x158bcb=await withSpinner(_0xc5ec0e(0x132),()=>_0x51f81b[_0xc5ec0e(0x14e)]['getBehaviorNames'](_0x2b0d4f),{'verbose':_0x41908a[_0xc5ec0e(0x16c)]}),_0x542564=[];for(const _0x17513a of _0x158bcb[_0xc5ec0e(0x258)]){const _0x4ddd0b=_0xc5ec0e(0x187)+_0x17513a[_0xc5ec0e(0xd9)]()[_0xc5ec0e(0x11d)](/\s+/g,'_'),_0xfed7dc=_0xc5ec0e(0x1d7)+_0x21f5ac+'.'+_0x4ddd0b;let _0x500445=[];try{const _0x5bbd87=await executeSchemaQuery(_0xfed7dc,_0x51f81b,_0x41908a);_0x500445=_0x5bbd87[_0xc5ec0e(0x258)][_0xc5ec0e(0x295)](_0x8d63a7=>({'name':_0x8d63a7[_0xc5ec0e(0x169)],'type':_0x8d63a7['column_type']}));}catch{}_0x542564[_0xc5ec0e(0x1b4)]({'table':_0x4ddd0b,'columns':_0x500445});}return{'database':_0x21f5ac,'parent_segment':_0x1d95ac,'parent_id':_0x2b0d4f,'customers':{'table':_0xc5ec0e(0x297),'columns':_0x16202b},'behaviors':_0x542564};}[a31_0x40ba7c(0x2ad)](_0x24dde4){const _0x16a159=a31_0x40ba7c,_0x2ea0d8=_0x43f4d1=>{const _0x40dfcd=a31_0x3927;if(_0x43f4d1['length']===0x0)return'[]';const _0x2c74c5=_0x43f4d1['map'](_0x538c75=>_0x40dfcd(0x1a1)+_0x538c75[_0x40dfcd(0x1f7)]+_0x40dfcd(0xc1)+_0x538c75[_0x40dfcd(0x1f9)]+'\x22\x20}');return'[\x0a'+_0x2c74c5[_0x40dfcd(0x98)](',\x0a')+_0x40dfcd(0x1db);},_0xe40735=_0x24dde4['behaviors'][_0x16a159(0x295)](_0x4721c2=>{const _0x9e9ada=_0x16a159;return _0x9e9ada(0x141)+_0x4721c2[_0x9e9ada(0x18e)]+'\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20'+_0x2ea0d8(_0x4721c2['columns'])[_0x9e9ada(0x11d)](/^/gm,'\x20\x20')[_0x9e9ada(0x170)]()+_0x9e9ada(0x245);})[_0x16a159(0x98)](',\x0a');return _0x16a159(0x22c)+_0x24dde4[_0x16a159(0x255)]+_0x16a159(0x240)+_0x24dde4['parent_segment']+_0x16a159(0x16f)+_0x24dde4['parent_id']+'\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22'+_0x24dde4['customers'][_0x16a159(0x18e)]+_0x16a159(0xc2)+_0x2ea0d8(_0x24dde4[_0x16a159(0x297)][_0x16a159(0xd5)])[_0x16a159(0x11d)](/^/gm,'\x20\x20')['trim']()+_0x16a159(0x1e7)+_0xe40735+_0x16a159(0x11f);}}export class ParentSegmentSQLCommand extends BaseCommand{[a31_0x40ba7c(0x1f7)]='segment:parent:sql';['description']=a31_0x40ba7c(0x243);async['execute'](_0x54f2b5){const _0x312ac6=a31_0x40ba7c,{options:_0x35d99c,args:_0x5b1606,tdx:_0x13231d}=_0x54f2b5,_0xa9ea18=_0x5b1606[0x0]||_0x35d99c['parentSegment'];if(!_0xa9ea18)return showParentSegmentNotSetError(_0x312ac6(0xdb)+_0x312ac6(0x13e)),0x1;_0x35d99c[_0x312ac6(0x16c)]&&(console[_0x312ac6(0x29c)](_0x312ac6(0x242)+_0x35d99c[_0x312ac6(0x1ce)]),console[_0x312ac6(0x29c)](_0x312ac6(0x138)+_0xa9ea18));const _0x2362f0=await withSpinner(_0x312ac6(0x151)+_0xa9ea18+_0x312ac6(0x1ef),()=>_0x13231d[_0x312ac6(0x14e)][_0x312ac6(0x205)](_0xa9ea18),{'verbose':_0x35d99c[_0x312ac6(0x16c)]}),_0x5df081=_0x2362f0[_0x312ac6(0x258)],_0x12f80c=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0xa9ea18+_0x312ac6(0x1ef),()=>_0x13231d[_0x312ac6(0x14e)]['getParentSQL'](_0x5df081),{'verbose':_0x35d99c[_0x312ac6(0x16c)]}),_0x2bf26d=_0x12f80c[_0x312ac6(0x258)];return _0x35d99c[_0x312ac6(0x1c4)]===_0x312ac6(0x290)||_0x35d99c[_0x312ac6(0x1c4)]===_0x312ac6(0xe2)?await handleSDKOutput([{'sql':_0x2bf26d}],_0x35d99c):console[_0x312ac6(0x165)](_0x2bf26d),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a31_0x40ba7c(0x1f7)]=a31_0x40ba7c(0xdd);[a31_0x40ba7c(0x162)]=a31_0x40ba7c(0x9d);async[a31_0x40ba7c(0x22d)](_0x32d1a0){const _0x5ed712=a31_0x40ba7c,{options:_0x16ae94,args:_0x1858d,tdx:_0x5e19e9}=_0x32d1a0,_0x44d5b8=_0x1858d[0x0]||_0x16ae94[_0x5ed712(0x1d5)];if(!_0x44d5b8)return showParentSegmentNotSetError(_0x5ed712(0xfc)+'\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;_0x16ae94[_0x5ed712(0x16c)]&&(console[_0x5ed712(0x29c)](_0x5ed712(0x242)+_0x16ae94[_0x5ed712(0x1ce)]),console[_0x5ed712(0x29c)]('Parent\x20segment:\x20'+_0x44d5b8));const _0x4baea8=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x44d5b8+'\x27...',()=>_0x5e19e9[_0x5ed712(0x14e)][_0x5ed712(0x205)](_0x44d5b8),{'verbose':_0x16ae94[_0x5ed712(0x16c)]}),_0x2cda19=_0x4baea8[_0x5ed712(0x258)],_0x340978=await withSpinner(_0x5ed712(0x10b)+_0x44d5b8+_0x5ed712(0x1ef),()=>_0x5e19e9[_0x5ed712(0x14e)][_0x5ed712(0x292)](_0x2cda19),{'verbose':_0x16ae94[_0x5ed712(0x16c)]});let _0x508c73=_0x340978[_0x5ed712(0x258)];const _0xdbcf86=resolveLimit(_0x16ae94[_0x5ed712(0x172)],DEFAULT_DISPLAY_LIMIT),_0x180394=/\bLIMIT\s+\d+/i['test'](_0x508c73);!_0x180394&&(_0x508c73=_0x508c73[_0x5ed712(0x170)]()[_0x5ed712(0x11d)](/;+$/,''),_0x508c73=_0x5ed712(0xb2)+_0x508c73+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0xdbcf86);_0x16ae94[_0x5ed712(0x16c)]&&console[_0x5ed712(0x29c)](_0x5ed712(0x156)+_0x508c73);const _0x3be414=await withProgressSpinner(_0x5ed712(0x2a6),async _0xcfe38b=>{const _0x5ebe8d=_0x5ed712,_0x2fd82b=await _0x5e19e9['query'][_0x5ebe8d(0x22d)](_0x508c73,{'catalog':'td','schema':_0x5ebe8d(0x1fc),'onJobId':_0x3a5636=>{const _0x2d45a2=_0x5ebe8d;_0xcfe38b[_0x2d45a2(0x20f)](_0x3a5636);}});return _0x2fd82b;},{'verbose':_0x16ae94[_0x5ed712(0x16c)]}),_0x83428c=_0x3be414[_0x5ed712(0x258)],_0x1519b3=_0x83428c[_0x5ed712(0x28c)]?_0x5ed712(0x196)+_0x83428c[_0x5ed712(0x28c)]+']':'';return console['error'](_0x5ed712(0x146)+_0x83428c[_0x5ed712(0x10c)][_0x5ed712(0xf8)][_0x5ed712(0x1b2)]()+'\x20rows\x20'+(_0x5ed712(0xd8)+formatElapsed(_0x83428c[_0x5ed712(0x10c)][_0x5ed712(0x10f)])+_0x1519b3)),await handleQueryOutput(_0x83428c,_0x16ae94),0x0;}}export class PSRtListCommand extends BaseCommand{[a31_0x40ba7c(0x1f7)]='ps:rt:list';['description']='List\x20parent\x20segments\x20with\x20RT\x202.0\x20status';async[a31_0x40ba7c(0x22d)](_0x48be00){const _0x20844a=a31_0x40ba7c,{options:_0x4db4f4,args:_0x25b580,tdx:_0x259fe0}=_0x48be00,_0x1db407=_0x25b580[0x0],_0x280b53=await withSpinner(_0x1db407?_0x20844a(0x1fd)+_0x1db407+_0x20844a(0x1ef):_0x20844a(0x269),()=>_0x259fe0[_0x20844a(0x1af)]['list'](),{'verbose':_0x4db4f4[_0x20844a(0x16c)]});let _0x12ac5b=_0x280b53['data']['filter'](_0x38331c=>_0x38331c[_0x20844a(0x114)]);if(_0x1db407){const _0x5e36a9=_0x1db407[_0x20844a(0x11d)](/[.+^${}()|[\]\\]/g,_0x20844a(0x211))[_0x20844a(0x11d)](/\*/g,'.*')[_0x20844a(0x11d)](/\?/g,'.'),_0x35be37=new RegExp('^'+_0x5e36a9+'$','i');_0x12ac5b=_0x12ac5b[_0x20844a(0xe1)](_0x18c904=>_0x35be37['test'](_0x18c904[_0x20844a(0x1f7)]));}_0x12ac5b[_0x20844a(0x202)]((_0x52deeb,_0x46de92)=>_0x52deeb[_0x20844a(0x1f7)][_0x20844a(0x231)](_0x46de92[_0x20844a(0x1f7)])),console[_0x20844a(0x29c)](_0x20844a(0x24e)+_0x12ac5b['length']+_0x20844a(0x1a7)+(_0x12ac5b[_0x20844a(0xfe)]!==0x1?'s':''));const _0x57e766=_0x39399c=>{const _0x525585=_0x20844a;return getConsoleNextUrl(_0x4db4f4[_0x525585(0x1ce)],_0x525585(0x192)+_0x39399c);};if(_0x4db4f4[_0x20844a(0x1c4)]===_0x20844a(0x290)||_0x4db4f4['format']===_0x20844a(0xe2)){const _0x95947b=_0x12ac5b[_0x20844a(0x295)](_0x36addf=>({..._0x36addf,'url':_0x57e766(_0x36addf['id'])}));await handleSDKOutput(_0x95947b,_0x4db4f4);}else{if(_0x12ac5b[_0x20844a(0xfe)]===0x0)console['log'](_0x20844a(0x26c));else for(const _0x4d5078 of _0x12ac5b){const _0x2c40ea=_0x4d5078[_0x20844a(0x268)]?a31_0x11627e[_0x20844a(0x24f)]('\x20('+formatRows(_0x4d5078[_0x20844a(0x268)])+')'):'',_0x210c03=hyperlink(_0x4d5078[_0x20844a(0x1f7)],_0x57e766(_0x4d5078['id']));console[_0x20844a(0x165)]('⚡\x20'+_0x210c03+_0x2c40ea);}}return 0x0;}}export class PSRtValidateCommand extends BaseParentSegmentCommand{[a31_0x40ba7c(0x1f7)]=a31_0x40ba7c(0x197);[a31_0x40ba7c(0x162)]=a31_0x40ba7c(0xb9);async['execute'](_0x20633e){const _0x502100=a31_0x40ba7c,{options:_0x3dd0c1,args:_0x2fb239,tdx:_0x3db569}=_0x20633e,_0x29ac8f=_0x2fb239[0x0]||_0x3dd0c1['parentSegment'];if(!_0x29ac8f)return showParentSegmentNotSetError(_0x502100(0x28a)+_0x502100(0x26b)),0x1;const _0x166ffa=resolveYamlFile(_0x29ac8f);if(!existsSync(_0x166ffa))return showFileNotFoundError(_0x166ffa,_0x29ac8f),0x1;let _0x5ac7b5;try{_0x5ac7b5=readFileSync(_0x166ffa,'utf-8');}catch(_0x41c1b2){const _0x5d9509=_0x41c1b2 instanceof Error?_0x41c1b2['message']:String(_0x41c1b2);return console[_0x502100(0x29c)](_0x502100(0x135)+_0x5d9509),0x1;}const _0x1aa265=createCommandSpinner(a31_0x11627e[_0x502100(0x24f)](_0x502100(0x1c8)),{'verbose':_0x3dd0c1[_0x502100(0x16c)]});_0x1aa265['start']();const _0x4cd89f={'realtime':!![],'onProgress':_0x9e5256=>{const _0x28f057=_0x502100;_0x1aa265[_0x28f057(0x1f6)]=formatProgressMessage(_0x9e5256);}};let _0x344b5f;try{_0x344b5f=await _0x3db569[_0x502100(0x14e)][_0x502100(0x93)](_0x5ac7b5,_0x4cd89f),_0x1aa265['stop']();}catch(_0x438087){_0x1aa265['stop']();throw _0x438087;}console[_0x502100(0x29c)]('\x0a'+a31_0x11627e['bold'](_0x502100(0x21b))+'\x20'+_0x344b5f[_0x502100(0x1f7)]),console[_0x502100(0x29c)]('═'['repeat'](0x3c)),displayRealtimeValidation(_0x344b5f),console['error']('─'['repeat'](0x3c));if(_0x344b5f['errors'][_0x502100(0xfe)]>0x0){console[_0x502100(0x29c)]('\x0a'+a31_0x11627e[_0x502100(0x208)]('Errors:'));for(const _0x570059 of _0x344b5f[_0x502100(0x199)]){console[_0x502100(0x29c)]('\x20\x20'+a31_0x11627e[_0x502100(0x208)]('•')+'\x20'+_0x570059);}}return _0x344b5f['allValid']&&console['error']('\x0a'+a31_0x11627e['green']('✔')+_0x502100(0x1d6)),_0x344b5f['allValid']?0x0:0x1;}}export class PSRtJnListCommand extends BaseCommand{['name']=a31_0x40ba7c(0x95);[a31_0x40ba7c(0x162)]=a31_0x40ba7c(0x2aa);async[a31_0x40ba7c(0x22d)](_0x455d63){const _0x45f136=a31_0x40ba7c,{options:_0x5c97a1,args:_0x400c1a,tdx:_0x544c6d}=_0x455d63,_0x1dddae=_0x400c1a[0x0]||_0x5c97a1[_0x45f136(0x1d5)];if(!_0x1dddae)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'+_0x45f136(0x158)),0x1;_0x5c97a1['verbose']&&(console[_0x45f136(0x29c)](_0x45f136(0x242)+_0x5c97a1[_0x45f136(0x1ce)]),console[_0x45f136(0x29c)](_0x45f136(0x138)+_0x1dddae));const _0x288704=await withSpinner(_0x45f136(0x151)+_0x1dddae+_0x45f136(0x1ef),()=>_0x544c6d[_0x45f136(0x14e)][_0x45f136(0x205)](_0x1dddae),{'verbose':_0x5c97a1['verbose']}),_0x397f6a=_0x288704['data'],_0xed7d06=await withSpinner(_0x45f136(0x219)+_0x1dddae+_0x45f136(0x1ef),()=>_0x544c6d['realtime'][_0x45f136(0xcb)](_0x397f6a),{'verbose':_0x5c97a1[_0x45f136(0x16c)]}),_0x255b31=_0xed7d06[_0x45f136(0x258)];console[_0x45f136(0x29c)]('✔\x20Found\x20'+_0x255b31[_0x45f136(0xfe)]+_0x45f136(0xde)+(_0x255b31[_0x45f136(0xfe)]!==0x1?'s':''));if(_0x5c97a1[_0x45f136(0x1c4)]==='json'||_0x5c97a1['format']==='jsonl')await handleSDKOutput(_0x255b31,_0x5c97a1);else{if(_0x255b31[_0x45f136(0xfe)]===0x0)console[_0x45f136(0x165)](_0x45f136(0x21a));else for(const _0x54fda8 of _0x255b31){const _0x47fce8=_0x54fda8[_0x45f136(0x1a2)]===_0x45f136(0xaf)?'🚀':'📝',_0x140d37=_0x54fda8[_0x45f136(0x184)]?a31_0x11627e[_0x45f136(0x12d)]('\x20(paused)'):'',_0x47d7ec=a31_0x11627e[_0x45f136(0x24f)]('\x20('+_0x54fda8[_0x45f136(0xc7)]+_0x45f136(0xd3)+(_0x54fda8[_0x45f136(0xc7)]!==0x1?'s':'')+')');console[_0x45f136(0x165)](_0x47fce8+'\x20'+_0x54fda8[_0x45f136(0x1f7)]+_0x140d37+_0x47d7ec);}}return 0x0;}}export class PSRtJnPauseCommand extends BaseCommand{['name']=a31_0x40ba7c(0x26f);[a31_0x40ba7c(0x162)]=a31_0x40ba7c(0x104);async[a31_0x40ba7c(0x22d)](_0x3b99be){const _0x135c90=a31_0x40ba7c,{options:_0x4f87bb,args:_0x363937,tdx:_0x24e0f7}=_0x3b99be,_0x565d7d=_0x363937[0x0];if(!_0x565d7d)return console[_0x135c90(0x29c)](a31_0x11627e['red']('Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a')),console[_0x135c90(0x29c)](_0x135c90(0x17e)),console[_0x135c90(0x29c)](a31_0x11627e[_0x135c90(0x24f)](_0x135c90(0x123))),0x1;_0x4f87bb['verbose']&&(console[_0x135c90(0x29c)](_0x135c90(0x242)+_0x4f87bb['site']),console[_0x135c90(0x29c)](_0x135c90(0x1f4)+_0x565d7d));const _0x3765bd=await withSpinner('Pausing\x20activations\x20for\x20RT\x20journey\x20\x27'+_0x565d7d+_0x135c90(0x1ef),()=>_0x24e0f7[_0x135c90(0x1af)][_0x135c90(0x1f5)](_0x565d7d),{'verbose':_0x4f87bb[_0x135c90(0x16c)]}),_0x7314e9=_0x3765bd['data'];console[_0x135c90(0x29c)](_0x135c90(0x12c)+_0x7314e9[_0x135c90(0x1f7)]+'\x27');if(_0x4f87bb[_0x135c90(0x1c4)]===_0x135c90(0x290)||_0x4f87bb['format']==='jsonl')await handleSDKOutput([_0x7314e9],_0x4f87bb);else{const _0x39ce0a=_0x7314e9['state']===_0x135c90(0xaf)?'🚀':'📝',_0x299dde=_0x7314e9['paused']?a31_0x11627e[_0x135c90(0x12d)](_0x135c90(0x22a)):'';console[_0x135c90(0x165)](_0x39ce0a+'\x20'+_0x7314e9[_0x135c90(0x1f7)]+_0x299dde);}return 0x0;}}export class PSRtJnResumeCommand extends BaseCommand{[a31_0x40ba7c(0x1f7)]=a31_0x40ba7c(0x173);['description']=a31_0x40ba7c(0x2b0);async[a31_0x40ba7c(0x22d)](_0x278555){const _0x19fb71=a31_0x40ba7c,{options:_0x595fe5,args:_0x38056e,tdx:_0x461303}=_0x278555,_0xb418d8=_0x38056e[0x0];if(!_0xb418d8)return console['error'](a31_0x11627e[_0x19fb71(0x208)](_0x19fb71(0x1bf))),console[_0x19fb71(0x29c)](_0x19fb71(0x155)),console[_0x19fb71(0x29c)](a31_0x11627e['dim'](_0x19fb71(0x123))),0x1;_0x595fe5[_0x19fb71(0x16c)]&&(console[_0x19fb71(0x29c)](_0x19fb71(0x242)+_0x595fe5[_0x19fb71(0x1ce)]),console['error'](_0x19fb71(0x1f4)+_0xb418d8));const _0x91afc4=await withSpinner(_0x19fb71(0x14c)+_0xb418d8+_0x19fb71(0x1ef),()=>_0x461303[_0x19fb71(0x1af)][_0x19fb71(0x14a)](_0xb418d8),{'verbose':_0x595fe5['verbose']}),_0xeed380=_0x91afc4[_0x19fb71(0x258)];console[_0x19fb71(0x29c)](_0x19fb71(0x25d)+_0xeed380[_0x19fb71(0x1f7)]+'\x27');if(_0x595fe5[_0x19fb71(0x1c4)]===_0x19fb71(0x290)||_0x595fe5[_0x19fb71(0x1c4)]==='jsonl')await handleSDKOutput([_0xeed380],_0x595fe5);else{const _0x1a98d2=_0xeed380[_0x19fb71(0x1a2)]===_0x19fb71(0xaf)?'🚀':'📝',_0x2cdb26=_0xeed380[_0x19fb71(0x184)]?a31_0x11627e[_0x19fb71(0x12d)](_0x19fb71(0x22a)):'';console['log'](_0x1a98d2+'\x20'+_0xeed380[_0x19fb71(0x1f7)]+_0x2cdb26);}return 0x0;}}export class PSRtConfigVersionCommand extends BaseCommand{[a31_0x40ba7c(0x1f7)]=a31_0x40ba7c(0x1b1);[a31_0x40ba7c(0x162)]=a31_0x40ba7c(0x168);async[a31_0x40ba7c(0x22d)](_0x472c22){const _0x4fb5f6=a31_0x40ba7c,{options:_0x5ce75f,args:_0x41b64c,tdx:_0x4554ed}=_0x472c22,_0x40af3d=_0x41b64c[0x0]||_0x5ce75f[_0x4fb5f6(0x1d5)];if(!_0x40af3d)return showParentSegmentNotSetError(_0x4fb5f6(0xa7)+_0x4fb5f6(0x29f)),0x1;_0x5ce75f[_0x4fb5f6(0x16c)]&&(console[_0x4fb5f6(0x29c)]('Site:\x20'+_0x5ce75f[_0x4fb5f6(0x1ce)]),console[_0x4fb5f6(0x29c)](_0x4fb5f6(0x138)+_0x40af3d));const _0x2e67ac=await withSpinner(_0x4fb5f6(0x151)+_0x40af3d+'\x27...',()=>_0x4554ed[_0x4fb5f6(0x14e)]['resolveParentId'](_0x40af3d),{'verbose':_0x5ce75f[_0x4fb5f6(0x16c)]}),_0xaa7fd2=_0x2e67ac[_0x4fb5f6(0x258)],_0x2b3920=await withSpinner(_0x4fb5f6(0x26d)+_0x40af3d+_0x4fb5f6(0x1ef),()=>_0x4554ed[_0x4fb5f6(0x1af)][_0x4fb5f6(0x128)](_0xaa7fd2),{'verbose':_0x5ce75f[_0x4fb5f6(0x16c)]}),_0x380d08=_0x2b3920[_0x4fb5f6(0x258)];return console[_0x4fb5f6(0x29c)](_0x4fb5f6(0x24c)),_0x5ce75f['format']==='json'||_0x5ce75f[_0x4fb5f6(0x1c4)]===_0x4fb5f6(0xe2)?await handleSDKOutput([_0x380d08],_0x5ce75f):(console[_0x4fb5f6(0x165)](_0x4fb5f6(0x24b)+_0x380d08['id']),console[_0x4fb5f6(0x165)](_0x4fb5f6(0x299)+_0x380d08[_0x4fb5f6(0x11a)]),console[_0x4fb5f6(0x165)](_0x4fb5f6(0x259)+_0x380d08['identifier']),console['log'](_0x4fb5f6(0xe8)+_0x380d08['eventKind']),console['log'](_0x4fb5f6(0x15a)+_0x380d08[_0x4fb5f6(0x1ea)])),0x0;}}export class PSPzServiceListCommand extends BaseCommand{[a31_0x40ba7c(0x1f7)]=a31_0x40ba7c(0x28f);[a31_0x40ba7c(0x162)]=a31_0x40ba7c(0x1c0);async['execute'](_0x225e7c){const _0x23217e=a31_0x40ba7c,{options:_0x481b3e,args:_0x45cdbf,tdx:_0x48d686}=_0x225e7c,_0x22217d=_0x45cdbf[0x0]||_0x481b3e[_0x23217e(0x1d5)];if(!_0x22217d)return showParentSegmentNotSetError(_0x23217e(0x17f)+_0x23217e(0xbf)),0x1;const _0x121e25=await withSpinner(_0x23217e(0x151)+_0x22217d+'\x27...',()=>_0x48d686[_0x23217e(0x14e)][_0x23217e(0x205)](_0x22217d),{'verbose':_0x481b3e[_0x23217e(0x16c)]}),_0xe441a3=_0x121e25[_0x23217e(0x258)],_0x27b829=await withSpinner(_0x23217e(0xd7)+_0x22217d+'\x27...',()=>_0x48d686[_0x23217e(0x133)][_0x23217e(0x134)](_0xe441a3),{'verbose':_0x481b3e[_0x23217e(0x16c)]}),_0xdc2b0c=_0x27b829['data'];console[_0x23217e(0x29c)](_0x23217e(0x24e)+_0xdc2b0c['length']+_0x23217e(0x1ff)+(_0xdc2b0c[_0x23217e(0xfe)]!==0x1?'s':''));if(_0x481b3e[_0x23217e(0x1c4)]===_0x23217e(0x290)||_0x481b3e[_0x23217e(0x1c4)]===_0x23217e(0xe2))await handleSDKOutput(_0xdc2b0c,_0x481b3e);else{if(_0xdc2b0c[_0x23217e(0xfe)]===0x0)console[_0x23217e(0x165)](_0x23217e(0x16d)),console[_0x23217e(0x29c)](a31_0x11627e[_0x23217e(0x280)](_0x23217e(0x19f)));else for(const _0x1b6c91 of _0xdc2b0c){console[_0x23217e(0x165)](a31_0x11627e[_0x23217e(0x1ee)](_0x1b6c91[_0x23217e(0x1f7)])+'\x20'+a31_0x11627e[_0x23217e(0x24f)](_0x23217e(0x256)+_0x1b6c91['id']+')'));_0x1b6c91[_0x23217e(0x162)]&&console[_0x23217e(0x165)]('\x20\x20'+a31_0x11627e['dim'](_0x1b6c91[_0x23217e(0x162)]));if(_0x1b6c91[_0x23217e(0xd2)]&&_0x1b6c91[_0x23217e(0xd2)]['length']>0x0)for(const _0x3f4fd7 of _0x1b6c91[_0x23217e(0xd2)]){const _0x17b613=_0x3f4fd7[_0x23217e(0x2af)]?.[_0x23217e(0xfe)]?_0x3f4fd7[_0x23217e(0x2af)]['join'](',\x20'):_0x23217e(0x260);console[_0x23217e(0x165)]('\x20\x20'+a31_0x11627e['cyan'](_0x23217e(0xba))+'\x20'+_0x3f4fd7['name']+'\x20'+a31_0x11627e[_0x23217e(0x24f)]('(id:\x20'+_0x3f4fd7['id']+')')),console[_0x23217e(0x165)]('\x20\x20\x20\x20'+a31_0x11627e[_0x23217e(0x24f)](_0x23217e(0x241))+'\x20'+_0x17b613);}else console[_0x23217e(0x165)]('\x20\x20'+a31_0x11627e[_0x23217e(0x24f)](_0x23217e(0x23d)));}}return 0x0;}}export class PSPzServiceCreateCommand extends BaseCommand{['name']=a31_0x40ba7c(0x220);['description']=a31_0x40ba7c(0x23c);async['execute'](_0x5d030e){const _0x1ae0aa=a31_0x40ba7c,{options:_0x316a48,args:_0x7d8e9c,tdx:_0x2ebdb7}=_0x5d030e,_0x3c18b9=_0x316a48,_0x28c239=_0x7d8e9c[0x0],_0x2fcb3f=_0x7d8e9c[0x1]||_0x316a48['parentSegment'];if(!_0x28c239)return console['error']('Error:\x20Service\x20name\x20is\x20required'),console['error'](_0x1ae0aa(0x283)),console[_0x1ae0aa(0x29c)](_0x1ae0aa(0x218)),0x1;if(!_0x2fcb3f)return showParentSegmentNotSetError(_0x1ae0aa(0x236)+_0x1ae0aa(0x218)),0x1;const _0x40e912=await withSpinner(_0x1ae0aa(0x151)+_0x2fcb3f+_0x1ae0aa(0x1ef),()=>_0x2ebdb7[_0x1ae0aa(0x14e)][_0x1ae0aa(0x205)](_0x2fcb3f),{'verbose':_0x316a48[_0x1ae0aa(0x16c)]}),_0x3cec89=_0x40e912[_0x1ae0aa(0x258)],_0x16b745={'name':_0x28c239,'description':_0x3c18b9[_0x1ae0aa(0x162)],'public':_0x3c18b9[_0x1ae0aa(0x288)]},_0x1e78ec=await withSpinner(_0x1ae0aa(0x244)+_0x28c239+_0x1ae0aa(0x1ef),()=>_0x2ebdb7[_0x1ae0aa(0x133)]['create'](_0x3cec89,_0x16b745),{'verbose':_0x316a48[_0x1ae0aa(0x16c)]}),_0x5dda3a=_0x1e78ec[_0x1ae0aa(0x258)];return console[_0x1ae0aa(0x29c)](_0x1ae0aa(0x264)+_0x5dda3a[_0x1ae0aa(0x1f7)]+_0x1ae0aa(0xff)+_0x5dda3a['id']),await handleSDKOutput([_0x5dda3a],_0x316a48),0x0;}}export class PSPzServiceShowCommand extends BaseCommand{[a31_0x40ba7c(0x1f7)]=a31_0x40ba7c(0x142);[a31_0x40ba7c(0x162)]=a31_0x40ba7c(0x233);async[a31_0x40ba7c(0x22d)](_0x4425c6){const _0x3ce6cd=a31_0x40ba7c,{options:_0x1c3201,args:_0x15d99c,tdx:_0x5d8a6c}=_0x4425c6,_0x5bf394=_0x15d99c[0x0],_0x282c5c=_0x15d99c[0x1]||_0x1c3201['parentSegment'];if(!_0x5bf394)return console[_0x3ce6cd(0x29c)](_0x3ce6cd(0x253)),console['error'](_0x3ce6cd(0xdc)),console[_0x3ce6cd(0x29c)](_0x3ce6cd(0x20d)),0x1;if(!_0x282c5c)return showParentSegmentNotSetError(_0x3ce6cd(0x249)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;const _0x29813a=await withSpinner(_0x3ce6cd(0x151)+_0x282c5c+_0x3ce6cd(0x1ef),()=>_0x5d8a6c[_0x3ce6cd(0x14e)][_0x3ce6cd(0x205)](_0x282c5c),{'verbose':_0x1c3201[_0x3ce6cd(0x16c)]}),_0x392622=_0x29813a[_0x3ce6cd(0x258)],_0xe3e339=await withSpinner('Fetching\x20personalization\x20service\x20\x27'+_0x5bf394+'\x27...',()=>_0x5d8a6c[_0x3ce6cd(0x133)][_0x3ce6cd(0x275)](_0x392622,_0x5bf394),{'verbose':_0x1c3201[_0x3ce6cd(0x16c)]}),_0x15f4a1=_0xe3e339['data'];if(_0x1c3201['json']||_0x1c3201[_0x3ce6cd(0xe2)])await handleSDKOutput([_0x15f4a1],_0x1c3201);else{console[_0x3ce6cd(0x165)](a31_0x11627e[_0x3ce6cd(0x1ee)](_0x15f4a1[_0x3ce6cd(0x1f7)])+'\x20'+a31_0x11627e[_0x3ce6cd(0x24f)](_0x3ce6cd(0x256)+_0x15f4a1['id']+')'));_0x15f4a1[_0x3ce6cd(0x162)]&&console['log']('\x20\x20'+a31_0x11627e[_0x3ce6cd(0x24f)](_0x15f4a1[_0x3ce6cd(0x162)]));console[_0x3ce6cd(0x165)]('\x20\x20'+a31_0x11627e[_0x3ce6cd(0x280)](_0x3ce6cd(0x1de))+'\x20'+(_0x15f4a1[_0x3ce6cd(0x288)]?_0x3ce6cd(0x22b):'no'));if(_0x15f4a1[_0x3ce6cd(0xd2)]&&_0x15f4a1['tokens'][_0x3ce6cd(0xfe)]>0x0)for(const _0x2a280e of _0x15f4a1[_0x3ce6cd(0xd2)]){const _0x18aa42=_0x2a280e[_0x3ce6cd(0x2af)]?.[_0x3ce6cd(0xfe)]?_0x2a280e['allowedIps'][_0x3ce6cd(0x98)](',\x20'):_0x3ce6cd(0x260);console[_0x3ce6cd(0x165)]('\x20\x20'+a31_0x11627e[_0x3ce6cd(0x280)](_0x3ce6cd(0xba))+'\x20'+_0x2a280e[_0x3ce6cd(0x1f7)]+'\x20'+a31_0x11627e['dim'](_0x3ce6cd(0x256)+_0x2a280e['id']+')')),console[_0x3ce6cd(0x165)](_0x3ce6cd(0x1dc)+a31_0x11627e[_0x3ce6cd(0x24f)](_0x3ce6cd(0x241))+'\x20'+_0x18aa42);}else console[_0x3ce6cd(0x165)]('\x20\x20'+a31_0x11627e[_0x3ce6cd(0x24f)]('no\x20tokens\x20configured'));}return 0x0;}}export class PSPzServiceDeleteCommand extends BaseCommand{[a31_0x40ba7c(0x1f7)]=a31_0x40ba7c(0x1f3);['description']=a31_0x40ba7c(0x1b8);async[a31_0x40ba7c(0x22d)](_0x5898e9){const _0x125a88=a31_0x40ba7c,{options:_0x4ebdda,args:_0x15e932,tdx:_0x531bc2}=_0x5898e9,_0x3d9c73=_0x15e932[0x0],_0x5e7714=_0x15e932[0x1]||_0x4ebdda[_0x125a88(0x1d5)];if(!_0x3d9c73)return console[_0x125a88(0x29c)](_0x125a88(0x253)),console[_0x125a88(0x29c)](_0x125a88(0x289)),console[_0x125a88(0x29c)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x5e7714)return showParentSegmentNotSetError(_0x125a88(0x27b)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;const _0x19ea2e=await withSpinner(_0x125a88(0x151)+_0x5e7714+_0x125a88(0x1ef),()=>_0x531bc2[_0x125a88(0x14e)][_0x125a88(0x205)](_0x5e7714),{'verbose':_0x4ebdda[_0x125a88(0x16c)]}),_0x4adc3a=_0x19ea2e[_0x125a88(0x258)];return await withSpinner(_0x125a88(0xf9)+_0x3d9c73+_0x125a88(0x1ef),()=>_0x531bc2[_0x125a88(0x133)]['delete'](_0x4adc3a,_0x3d9c73),{'verbose':_0x4ebdda[_0x125a88(0x16c)]}),console[_0x125a88(0x29c)](_0x125a88(0x27a)+_0x3d9c73+'\x27'),0x0;}}export class PSPzServiceUpdateCommand extends BaseCommand{[a31_0x40ba7c(0x1f7)]=a31_0x40ba7c(0x20a);['description']=a31_0x40ba7c(0xb5);async[a31_0x40ba7c(0x22d)](_0x333d7d){const _0x1d4f1c=a31_0x40ba7c,{options:_0x51060a,args:_0x3666b2,tdx:_0xb1a959}=_0x333d7d,_0x695cf5=_0x51060a,_0x4c2193=_0x3666b2[0x0],_0x12cce1=_0x3666b2[0x1]||_0x51060a[_0x1d4f1c(0x1d5)];if(!_0x4c2193)return console[_0x1d4f1c(0x29c)](_0x1d4f1c(0x253)),console[_0x1d4f1c(0x29c)](_0x1d4f1c(0xf4)),console[_0x1d4f1c(0x29c)](_0x1d4f1c(0x1cb)),0x1;if(!_0x695cf5[_0x1d4f1c(0x1f7)])return console[_0x1d4f1c(0x29c)](_0x1d4f1c(0x27d)),console['error'](_0x1d4f1c(0xf4)),0x1;if(!_0x12cce1)return showParentSegmentNotSetError(_0x1d4f1c(0x228)+_0x1d4f1c(0x1cb)),0x1;const _0x5a1750=await withSpinner(_0x1d4f1c(0x151)+_0x12cce1+_0x1d4f1c(0x1ef),()=>_0xb1a959[_0x1d4f1c(0x14e)][_0x1d4f1c(0x205)](_0x12cce1),{'verbose':_0x51060a['verbose']}),_0xd9d6=_0x5a1750[_0x1d4f1c(0x258)],_0x6cc63f={'name':_0x695cf5['name']};_0x695cf5[_0x1d4f1c(0x162)]!==undefined&&(_0x6cc63f[_0x1d4f1c(0x162)]=_0x695cf5[_0x1d4f1c(0x162)]);const _0x466fac=await withSpinner(_0x1d4f1c(0x284)+_0x4c2193+_0x1d4f1c(0x1ef),()=>_0xb1a959[_0x1d4f1c(0x133)][_0x1d4f1c(0x13b)](_0xd9d6,_0x4c2193,_0x6cc63f),{'verbose':_0x51060a[_0x1d4f1c(0x16c)]}),_0x16d4c2=_0x466fac[_0x1d4f1c(0x258)];return console[_0x1d4f1c(0x29c)](_0x1d4f1c(0x294)+_0x16d4c2[_0x1d4f1c(0x1f7)]+'\x27'),await handleSDKOutput([_0x16d4c2],_0x51060a),0x0;}}export class PSPzServiceTokenCreateCommand extends BaseCommand{[a31_0x40ba7c(0x1f7)]=a31_0x40ba7c(0xe9);['description']=a31_0x40ba7c(0x2a9);async[a31_0x40ba7c(0x22d)](_0x2adf90){const _0x491497=a31_0x40ba7c,{options:_0x17d971,args:_0x2a223a,tdx:_0x3d2278}=_0x2adf90,_0x3d79f3=_0x17d971,_0x28035e=_0x2a223a[0x0],_0x25f0a5=_0x2a223a[0x1],_0x4108c9=_0x2a223a[0x2]||_0x17d971[_0x491497(0x1d5)];if(!_0x28035e)return console[_0x491497(0x29c)](_0x491497(0x1a8)),console[_0x491497(0x29c)](_0x491497(0x22f)),console[_0x491497(0x29c)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x25f0a5)return console['error'](_0x491497(0x253)),console[_0x491497(0x29c)](_0x491497(0x22f)),console['error'](_0x491497(0x2a2)),0x1;if(!_0x4108c9)return showParentSegmentNotSetError(_0x491497(0x19a)+_0x491497(0x2a2)),0x1;const _0x2025f9=await withSpinner(_0x491497(0x151)+_0x4108c9+_0x491497(0x1ef),()=>_0x3d2278[_0x491497(0x14e)][_0x491497(0x205)](_0x4108c9),{'verbose':_0x17d971[_0x491497(0x16c)]}),_0x52d0d3=_0x2025f9['data'],_0x99a119={'name':_0x28035e};_0x3d79f3[_0x491497(0x2af)]&&(_0x99a119[_0x491497(0x2af)]=_0x3d79f3[_0x491497(0x2af)]['split'](',')['map'](_0x1300ed=>_0x1300ed['trim']()));_0x3d79f3[_0x491497(0x162)]&&(_0x99a119[_0x491497(0x162)]=_0x3d79f3[_0x491497(0x162)]);const _0x454474=await withSpinner(_0x491497(0xc4)+_0x28035e+'\x27\x20for\x20service\x20\x27'+_0x25f0a5+_0x491497(0x1ef),()=>_0x3d2278[_0x491497(0x133)][_0x491497(0x182)](_0x52d0d3,_0x25f0a5,_0x99a119),{'verbose':_0x17d971[_0x491497(0x16c)]}),_0x42a00c=_0x454474['data'];return console[_0x491497(0x29c)](_0x491497(0x25f)+_0x42a00c[_0x491497(0x1f7)]+_0x491497(0xff)+_0x42a00c['id']),_0x42a00c['value']&&(console['error'](a31_0x11627e[_0x491497(0x12d)](_0x491497(0x198))),console['error'](a31_0x11627e[_0x491497(0x280)](_0x42a00c[_0x491497(0x22e)])),console[_0x491497(0x29c)]('')),await handleSDKOutput([_0x42a00c],_0x17d971),0x0;}}export class PSPzServiceTokenDeleteCommand extends BaseCommand{[a31_0x40ba7c(0x1f7)]='ps:pz:service:token:delete';['description']=a31_0x40ba7c(0x2a3);async[a31_0x40ba7c(0x22d)](_0x1e30ea){const _0x29c60e=a31_0x40ba7c,{options:_0x56973f,args:_0x4d53d0,tdx:_0x3c9864}=_0x1e30ea,_0x1f2315=_0x4d53d0[0x0],_0x29e67b=_0x4d53d0[0x1]||_0x56973f[_0x29c60e(0x1d5)];if(!_0x1f2315)return console[_0x29c60e(0x29c)](_0x29c60e(0x1c6)),console['error'](_0x29c60e(0x207)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x29e67b)return showParentSegmentNotSetError(_0x29c60e(0x212)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context'),0x1;const _0x3c10b0=await withSpinner(_0x29c60e(0x151)+_0x29e67b+_0x29c60e(0x1ef),()=>_0x3c9864['segment'][_0x29c60e(0x205)](_0x29e67b),{'verbose':_0x56973f[_0x29c60e(0x16c)]}),_0x2263ac=_0x3c10b0[_0x29c60e(0x258)],_0x2340dd=await withSpinner(_0x29c60e(0x286),()=>_0x3c9864[_0x29c60e(0x133)][_0x29c60e(0x134)](_0x2263ac),{'verbose':_0x56973f[_0x29c60e(0x16c)]}),_0x5bb289=_0x2340dd[_0x29c60e(0x258)];let _0x19472a;for(const _0x5851e7 of _0x5bb289){if(_0x5851e7[_0x29c60e(0xd2)]?.[_0x29c60e(0x206)](_0x606d2a=>_0x606d2a['id']===_0x1f2315)){_0x19472a=_0x5851e7['id'];break;}}if(!_0x19472a)return console[_0x29c60e(0x29c)](_0x29c60e(0x15c)+_0x1f2315+_0x29c60e(0xa1)),0x1;const _0x132507=await withSpinner(_0x29c60e(0x1d0)+_0x1f2315+_0x29c60e(0x1ef),()=>_0x3c9864['personalization']['deleteToken'](_0x2263ac,_0x19472a,_0x1f2315),{'verbose':_0x56973f[_0x29c60e(0x16c)]}),_0x3057c3=_0x132507[_0x29c60e(0x258)];return console['error'](_0x29c60e(0x25a)+(_0x3057c3[_0x29c60e(0x1f7)]||_0x1f2315)+'\x27'),await handleSDKOutput([_0x3057c3],_0x56973f),0x0;}}export class PSPzListCommand extends BaseCommand{['name']='ps:pz:list';[a31_0x40ba7c(0x162)]='List\x20realtime\x20personalizations\x20for\x20a\x20parent\x20segment';async[a31_0x40ba7c(0x22d)](_0x161a11){const _0x490956=a31_0x40ba7c,{options:_0x36ad61,args:_0xea04c8,tdx:_0x14a6b3}=_0x161a11,_0x346d4f=_0xea04c8[0x0]||_0x36ad61['parentSegment'];if(!_0x346d4f)return showParentSegmentNotSetError(_0x490956(0xe7)+_0x490956(0x99)),0x1;const _0x231da0=await withSpinner(_0x490956(0x151)+_0x346d4f+'\x27...',()=>_0x14a6b3[_0x490956(0x14e)][_0x490956(0x205)](_0x346d4f),{'verbose':_0x36ad61[_0x490956(0x16c)]}),_0x51faa0=_0x231da0['data'],_0x2f2d82=await withSpinner(_0x490956(0x21c)+_0x346d4f+_0x490956(0x1ef),()=>_0x14a6b3[_0x490956(0x133)][_0x490956(0x1df)](_0x51faa0),{'verbose':_0x36ad61[_0x490956(0x16c)]}),_0x5398c7=_0x2f2d82['data'];console[_0x490956(0x29c)](_0x490956(0x24e)+_0x5398c7[_0x490956(0xfe)]+'\x20personalization'+(_0x5398c7[_0x490956(0xfe)]!==0x1?'s':''));if(_0x36ad61[_0x490956(0x1c4)]==='json'||_0x36ad61[_0x490956(0x1c4)]==='jsonl')await handleSDKOutput(_0x5398c7,_0x36ad61);else{if(_0x5398c7['length']===0x0)console['log'](_0x490956(0x105));else for(const _0x100891 of _0x5398c7){console[_0x490956(0x165)](a31_0x11627e['bold'](_0x100891[_0x490956(0x1f7)])+'\x20'+a31_0x11627e[_0x490956(0x24f)](_0x490956(0x256)+_0x100891['id']+')'));_0x100891[_0x490956(0x162)]&&console['log']('\x20\x20'+a31_0x11627e['dim'](_0x100891['description']));const _0x203ab8=_0x100891[_0x490956(0x101)]?.[_0x490956(0xfe)]||0x0;console[_0x490956(0x165)]('\x20\x20'+a31_0x11627e[_0x490956(0x280)]('sections:')+'\x20'+_0x203ab8);if(_0x100891[_0x490956(0x101)]&&_0x100891[_0x490956(0x101)][_0x490956(0xfe)]>0x0)for(const _0x460e2f of _0x100891['sections']){console[_0x490956(0x165)]('\x20\x20\x20\x20-\x20'+_0x460e2f[_0x490956(0x1f7)]);}}}return 0x0;}}export class PSPzShowCommand extends BaseCommand{[a31_0x40ba7c(0x1f7)]='ps:pz:show';[a31_0x40ba7c(0x162)]=a31_0x40ba7c(0xca);async[a31_0x40ba7c(0x22d)](_0x11faba){const _0x339f58=a31_0x40ba7c,{options:_0x1b0f1d,args:_0x4f782a,tdx:_0x9da9d2}=_0x11faba,_0x1a4372=_0x4f782a[0x0];if(!_0x1a4372)return console['error']('Error:\x20Personalization\x20ID\x20is\x20required'),console[_0x339f58(0x29c)]('Usage:\x20tdx\x20ps\x20pz\x20show\x20<personalization_id>'),0x1;const _0x134c83=await withSpinner(_0x339f58(0x102)+_0x1a4372+_0x339f58(0x1ef),()=>_0x9da9d2[_0x339f58(0x133)][_0x339f58(0x1c9)](_0x1a4372),{'verbose':_0x1b0f1d[_0x339f58(0x16c)]}),_0x2dbb13=_0x134c83[_0x339f58(0x258)];console[_0x339f58(0x29c)](_0x339f58(0x111)+_0x2dbb13['name']+'\x27');if(_0x1b0f1d['format']==='json'||_0x1b0f1d['format']===_0x339f58(0xe2))await handleSDKOutput([_0x2dbb13],_0x1b0f1d);else{console['log'](a31_0x11627e['bold'](_0x2dbb13[_0x339f58(0x1f7)])+'\x20'+a31_0x11627e[_0x339f58(0x24f)](_0x339f58(0x256)+_0x2dbb13['id']+')'));_0x2dbb13[_0x339f58(0x162)]&&console['log']('\x20\x20'+a31_0x11627e[_0x339f58(0x24f)](_0x2dbb13[_0x339f58(0x162)]));_0x2dbb13[_0x339f58(0x11a)]&&console[_0x339f58(0x165)]('\x20\x20'+a31_0x11627e[_0x339f58(0x280)]('audienceId:')+'\x20'+_0x2dbb13[_0x339f58(0x11a)]);console[_0x339f58(0x165)]('\x20\x20'+a31_0x11627e[_0x339f58(0x280)](_0x339f58(0x10d))+'\x20'+_0x2dbb13['createdAt']),console[_0x339f58(0x165)]('\x20\x20'+a31_0x11627e[_0x339f58(0x280)](_0x339f58(0xe5))+'\x20'+_0x2dbb13['updatedAt']);const _0x2ff8f7=_0x2dbb13[_0x339f58(0x101)]?.[_0x339f58(0xfe)]||0x0;console['log']('\x20\x20'+a31_0x11627e['cyan'](_0x339f58(0x28b))+'\x20'+_0x2ff8f7);if(_0x2dbb13[_0x339f58(0x101)]&&_0x2dbb13[_0x339f58(0x101)][_0x339f58(0xfe)]>0x0)for(const _0x3278b3 of _0x2dbb13['sections']){console[_0x339f58(0x165)](_0x339f58(0x1dc)+a31_0x11627e[_0x339f58(0x1ee)](_0x3278b3[_0x339f58(0x1f7)])+'\x20'+a31_0x11627e[_0x339f58(0x24f)](_0x339f58(0x256)+_0x3278b3['id']+')')),_0x3278b3[_0x339f58(0x18a)]&&(console['log']('\x20\x20\x20\x20\x20\x20'+a31_0x11627e[_0x339f58(0x280)](_0x339f58(0x9a))+'\x20'+_0x3278b3[_0x339f58(0x18a)][_0x339f58(0x1f7)]),_0x3278b3['entryCriteria']['keyEventCriteria']?.[_0x339f58(0xaa)]&&console[_0x339f58(0x165)]('\x20\x20\x20\x20\x20\x20\x20\x20'+a31_0x11627e[_0x339f58(0x280)](_0x339f58(0x2ac))+'\x20'+_0x3278b3[_0x339f58(0x18a)]['keyEventCriteria'][_0x339f58(0xaa)])),_0x3278b3[_0x339f58(0x298)]&&console[_0x339f58(0x165)](_0x339f58(0x1fe)+a31_0x11627e[_0x339f58(0x280)](_0x339f58(0x2ae))+'\x20'+JSON[_0x339f58(0x150)](_0x3278b3[_0x339f58(0x298)])),_0x3278b3[_0x339f58(0x1bc)]&&console['log'](_0x339f58(0x1fe)+a31_0x11627e['cyan'](_0x339f58(0x10a))+_0x339f58(0x9f));}}return 0x0;}}export class PSPzDeleteCommand extends BaseCommand{[a31_0x40ba7c(0x1f7)]=a31_0x40ba7c(0x1e4);[a31_0x40ba7c(0x162)]='Delete\x20a\x20realtime\x20personalization';async[a31_0x40ba7c(0x22d)](_0x1495a8){const _0x30fed5=a31_0x40ba7c,{options:_0x40d067,args:_0x241b91,tdx:_0x17257e}=_0x1495a8,_0xb8c7b3=_0x241b91[0x0];if(!_0xb8c7b3)return console[_0x30fed5(0x29c)](_0x30fed5(0x122)),console[_0x30fed5(0x29c)](_0x30fed5(0x237)),0x1;return await withSpinner(_0x30fed5(0x159)+_0xb8c7b3+_0x30fed5(0x1ef),()=>_0x17257e['personalization'][_0x30fed5(0xab)](_0xb8c7b3),{'verbose':_0x40d067[_0x30fed5(0x16c)]}),console[_0x30fed5(0x29c)](_0x30fed5(0xcf)+_0xb8c7b3+'\x27'),0x0;}}export class PSPzCreateCommand extends BaseCommand{['name']=a31_0x40ba7c(0x1bb);[a31_0x40ba7c(0x162)]=a31_0x40ba7c(0x20e);async[a31_0x40ba7c(0x22d)](_0x289a3a){const _0x509666=a31_0x40ba7c,{options:_0x5732da,tdx:_0x59b49a}=_0x289a3a,_0x596747=_0x5732da;let _0x57f40e;if(_0x596747['file']){_0x57f40e=await loadJSON(_0x596747['file'],!![]);if(!_0x57f40e[_0x509666(0x271)]?.[_0x509666(0x287)])return console[_0x509666(0x29c)](_0x509666(0xe0)),console[_0x509666(0x29c)](_0x509666(0x148)),console[_0x509666(0x29c)](_0x509666(0x106)),0x1;}else{if(!_0x596747[_0x509666(0x1f7)])return console[_0x509666(0x29c)](_0x509666(0x272)),console[_0x509666(0x29c)](_0x509666(0x235)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>'),0x1;if(_0x596747['description']===undefined)return console[_0x509666(0x29c)](_0x509666(0x117)),console['error'](_0x509666(0x235)),console[_0x509666(0x29c)](_0x509666(0x285)),0x1;if(_0x596747['folderId']===undefined)return console[_0x509666(0x29c)](_0x509666(0x26a)),console['error'](_0x509666(0xe4)),0x1;let _0x49d8a6=_0x596747[_0x509666(0x11a)];if(!_0x49d8a6&&_0x5732da[_0x509666(0x1d5)]){const _0x1cd3d1=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x5732da['parentSegment']+_0x509666(0x1ef),()=>_0x59b49a[_0x509666(0x14e)][_0x509666(0x205)](_0x5732da['parentSegment']),{'verbose':_0x5732da[_0x509666(0x16c)]});_0x49d8a6=_0x1cd3d1['data'];}let _0x24402a;_0x596747[_0x509666(0x101)]&&(_0x24402a=await loadJSON(_0x596747[_0x509666(0x101)],![]));const _0x447245=_0x596747['folderId']==='null'?null:{'id':_0x596747['folderId'],'type':'folder-segment'};_0x57f40e={'attributes':{'name':_0x596747[_0x509666(0x1f7)],'description':_0x596747[_0x509666(0x162)]||null,..._0x49d8a6!==undefined&&{'audienceId':_0x49d8a6},..._0x24402a!==undefined&&{'sections':_0x24402a}},'relationships':{'parentFolder':{'data':_0x447245}}};}const _0x544bc8=await withSpinner(_0x509666(0x1a5)+(_0x57f40e[_0x509666(0x1b5)]?.['name']??'')+_0x509666(0x1ef),()=>_0x59b49a[_0x509666(0x133)]['createPersonalization'](_0x57f40e),{'verbose':_0x5732da['verbose']}),_0x4de180=_0x544bc8[_0x509666(0x258)];return console['error'](_0x509666(0x124)+_0x4de180['name']+_0x509666(0xff)+_0x4de180['id']),await handleSDKOutput([_0x4de180],_0x5732da),0x0;}}export class PSPzPatchCommand extends BaseCommand{[a31_0x40ba7c(0x1f7)]=a31_0x40ba7c(0x276);['description']=a31_0x40ba7c(0x125);async[a31_0x40ba7c(0x22d)](_0x26a21f){const _0x2b949c=a31_0x40ba7c,{options:_0x4ee56e,args:_0x5cb379}=_0x26a21f,_0x5ad10f=_0x4ee56e,_0x24cb12=_0x5cb379[0x0];if(!_0x24cb12)return console['error'](_0x2b949c(0x122)),console['error'](_0x2b949c(0x12e)),console[_0x2b949c(0x29c)](_0x2b949c(0x29a)),0x1;let _0x279ca5;if(_0x5ad10f['file'])_0x279ca5=await loadJSON(_0x5ad10f['file'],!![]);else{if(!_0x5ad10f[_0x2b949c(0x1f7)])return console['error'](_0x2b949c(0x272)),console[_0x2b949c(0x29c)](_0x2b949c(0x12e)),0x1;if(_0x5ad10f[_0x2b949c(0x162)]===undefined)return console[_0x2b949c(0x29c)](_0x2b949c(0x117)),console[_0x2b949c(0x29c)](_0x2b949c(0x12e)),0x1;let _0xb862d1;_0x5ad10f[_0x2b949c(0x101)]&&(_0xb862d1=await loadJSON(_0x5ad10f[_0x2b949c(0x101)],![])),_0x279ca5={'attributes':{'name':_0x5ad10f['name'],'description':_0x5ad10f[_0x2b949c(0x162)]||null,..._0xb862d1!==undefined&&{'sections':_0xb862d1}}};}const {tdx:_0x23c75a}=_0x26a21f,_0x4b69fa=await withSpinner('Patching\x20personalization\x20\x27'+_0x24cb12+_0x2b949c(0x1ef),()=>_0x23c75a[_0x2b949c(0x133)][_0x2b949c(0x12f)](_0x24cb12,_0x279ca5),{'verbose':_0x4ee56e[_0x2b949c(0x16c)]}),_0x132b0b=_0x4b69fa[_0x2b949c(0x258)];return console['error'](_0x2b949c(0x2a4)+_0x132b0b['name']+_0x2b949c(0xc5)+_0x132b0b['id']+')'),await handleSDKOutput([_0x132b0b],_0x4ee56e),0x0;}}export class PSPzInitCommand extends BaseParentSegmentCommand{[a31_0x40ba7c(0x1f7)]=a31_0x40ba7c(0x29e);[a31_0x40ba7c(0x162)]=a31_0x40ba7c(0x225);async[a31_0x40ba7c(0x22d)](_0x382ef1){const _0x140cb7=a31_0x40ba7c,{options:_0x6e3e71,args:_0x126ef4}=_0x382ef1,_0x24fd99=_0x126ef4[0x0]||_0x6e3e71[_0x140cb7(0x1d5)];if(!_0x24fd99)return showParentSegmentNotSetError(_0x140cb7(0x1ab)+'\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 _0x8c91df=resolveYamlFile(_0x24fd99);if(!existsSync(_0x8c91df))return showFileNotFoundError(_0x8c91df,_0x24fd99),0x1;let _0x1935a9;try{_0x1935a9=readFileSync(_0x8c91df,'utf-8');}catch(_0x11889b){const _0x93935b=_0x11889b instanceof Error?_0x11889b[_0x140cb7(0x263)]:String(_0x11889b);return console['error'](_0x140cb7(0x135)+_0x93935b),0x1;}let _0xfdf10c;try{_0xfdf10c=parseDef(_0x1935a9);}catch(_0x45c920){const _0x1bd691=_0x45c920 instanceof Error?_0x45c920[_0x140cb7(0x263)]:String(_0x45c920);return console[_0x140cb7(0x29c)](a31_0x11627e[_0x140cb7(0x208)](_0x140cb7(0x210)+_0x1bd691)),0x1;}if(_0xfdf10c[_0x140cb7(0x1b7)]&&_0xfdf10c[_0x140cb7(0x1b7)][_0x140cb7(0xfe)]>0x0)return console[_0x140cb7(0x29c)](a31_0x11627e[_0x140cb7(0x12d)](_0x140cb7(0x121)+_0x8c91df)),console['error'](a31_0x11627e[_0x140cb7(0x24f)](_0x140cb7(0x130)+_0xfdf10c[_0x140cb7(0x1b7)]['length']+'\x20service(s)\x20configured')),0x1;!_0xfdf10c[_0x140cb7(0x1af)]&&(_0xfdf10c[_0x140cb7(0x1af)]={'events':[{'name':'page_view','source_table':'<database>.<table>'}],'attributes':[{'name':_0x140cb7(0x107),'type':_0x140cb7(0xc9)}],'id_stitching':{'primary_key':_0xfdf10c['master'][_0x140cb7(0x18e)]===_0x140cb7(0x297)?'td_client_id':'user_id'}});_0xfdf10c[_0x140cb7(0x1b7)]=[{'name':_0x140cb7(0x16b),'description':_0x140cb7(0x185),'trigger_event':'page_view','sections':[{'name':_0x140cb7(0x213),'criteria':'true','attributes':[_0x140cb7(0x107)]}]}];const _0x426896=serializeDef(_0xfdf10c);return writeFileSync(_0x8c91df,_0x426896,_0x140cb7(0x251)),console[_0x140cb7(0x29c)](a31_0x11627e['green']('✔')+_0x140cb7(0x1e2)+a31_0x11627e[_0x140cb7(0x280)](_0x8c91df)),(!_0xfdf10c[_0x140cb7(0x1af)]||_0x1935a9[_0x140cb7(0x27f)](_0x140cb7(0xfb))===-0x1)&&console[_0x140cb7(0x29c)](a31_0x11627e[_0x140cb7(0x14f)]('✔')+_0x140cb7(0x1fb)),console[_0x140cb7(0x29c)]('\x0a'+a31_0x11627e[_0x140cb7(0x24f)](_0x140cb7(0xb7))),console['error']('\x20\x201.\x20Edit\x20'+_0x8c91df+_0x140cb7(0xa3)),console[_0x140cb7(0x29c)](_0x140cb7(0x20c)+a31_0x11627e[_0x140cb7(0x24f)]('tdx\x20ps\x20push\x20'+_0x24fd99)+_0x140cb7(0x232)),0x0;}}