@treasuredata/tdx 2026.8.1 → 2026.8.3

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 (258) 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-always-on-campaign-pull-command.js +1 -1
  22. package/dist/commands/engage-always-on-campaign-push-command.js +1 -1
  23. package/dist/commands/engage-always-on-campaign-validate-command.js +1 -1
  24. package/dist/commands/engage-campaign-pull-command.js +1 -1
  25. package/dist/commands/engage-campaign-push-command.js +1 -1
  26. package/dist/commands/engage-campaign-validate-command.js +1 -1
  27. package/dist/commands/engage-command.js +1 -1
  28. package/dist/commands/engage-template-pull-command.js +1 -1
  29. package/dist/commands/engage-template-push-command.js +1 -1
  30. package/dist/commands/engage-template-validate-command.js +1 -1
  31. package/dist/commands/job-command.js +1 -1
  32. package/dist/commands/journey-command.js +1 -1
  33. package/dist/commands/journey-validate-command.js +1 -1
  34. package/dist/commands/llm-command.js +1 -1
  35. package/dist/commands/mcp-command.js +1 -1
  36. package/dist/commands/parent-segment-command.js +1 -1
  37. package/dist/commands/policy-command.js +1 -1
  38. package/dist/commands/profile-command.js +1 -1
  39. package/dist/commands/profiles-command.js +1 -1
  40. package/dist/commands/query-command.js +1 -1
  41. package/dist/commands/schedule-command.js +1 -1
  42. package/dist/commands/segment-command.js +1 -1
  43. package/dist/commands/segment-create-command.js +1 -1
  44. package/dist/commands/segment-fields-command.js +1 -1
  45. package/dist/commands/segment-move-command.js +1 -1
  46. package/dist/commands/segment-pull-command.js +1 -1
  47. package/dist/commands/segment-push-command.js +1 -1
  48. package/dist/commands/segment-update-command.js +1 -1
  49. package/dist/commands/segment-use-command.js +1 -1
  50. package/dist/commands/segment-validate-command.js +1 -1
  51. package/dist/commands/segments.js +1 -1
  52. package/dist/commands/show.js +1 -1
  53. package/dist/commands/status-command.js +1 -1
  54. package/dist/commands/table-deleted.js +1 -1
  55. package/dist/commands/tables.js +1 -1
  56. package/dist/commands/unset-command.js +1 -1
  57. package/dist/commands/upgrade-command.js +1 -1
  58. package/dist/commands/use-command.js +1 -1
  59. package/dist/commands/user-command.js +1 -1
  60. package/dist/commands/work-command.js +1 -1
  61. package/dist/commands/workflow-command.js +1 -1
  62. package/dist/core/auth.js +1 -1
  63. package/dist/core/command-output.js +1 -1
  64. package/dist/core/config.js +1 -1
  65. package/dist/core/connection-cache.js +1 -1
  66. package/dist/core/constants.js +1 -1
  67. package/dist/core/credential-cache.js +1 -1
  68. package/dist/core/global-context.js +1 -1
  69. package/dist/core/keychain.js +1 -1
  70. package/dist/core/oauth-keychain.js +1 -1
  71. package/dist/core/oauth.js +1 -1
  72. package/dist/core/profile.js +1 -1
  73. package/dist/core/project-config.js +1 -1
  74. package/dist/core/session.js +1 -1
  75. package/dist/core/site-mismatch.js +1 -1
  76. package/dist/core/user-cache.js +1 -1
  77. package/dist/core/version.js +1 -1
  78. package/dist/index.js +1 -1
  79. package/dist/mcp/server.js +1 -1
  80. package/dist/mcp/tools/index.js +1 -1
  81. package/dist/mcp/tools/tdx-run.js +1 -1
  82. package/dist/mcp/tools/tdx-search.js +1 -1
  83. package/dist/mcp/tools/work-create-item.js +1 -1
  84. package/dist/mcp/utils.js +1 -1
  85. package/dist/proxy/claude-usage-tracker.js +1 -1
  86. package/dist/proxy/passthrough-server.js +1 -1
  87. package/dist/proxy/sse-usage-parser.js +1 -1
  88. package/dist/sdk/agent/agent-config.js +1 -1
  89. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  90. package/dist/sdk/agent/agent-yaml.js +1 -1
  91. package/dist/sdk/agent/test/evaluator.js +1 -1
  92. package/dist/sdk/agent/test/executor.js +1 -1
  93. package/dist/sdk/agent/test/index.js +1 -1
  94. package/dist/sdk/agent/test/output.js +1 -1
  95. package/dist/sdk/agent/test/parser.js +1 -1
  96. package/dist/sdk/agent/tool-target-registry.js +1 -1
  97. package/dist/sdk/api.js +1 -1
  98. package/dist/sdk/auth-token.js +1 -1
  99. package/dist/sdk/cas/cas-api-client.d.ts +9 -3
  100. package/dist/sdk/cas/cas-api-client.d.ts.map +1 -1
  101. package/dist/sdk/cas/cas-api-client.js +1 -1
  102. package/dist/sdk/cas/cas-api-client.js.map +1 -1
  103. package/dist/sdk/cas/cas-audience-schema.d.ts +2 -0
  104. package/dist/sdk/cas/cas-audience-schema.d.ts.map +1 -1
  105. package/dist/sdk/cas/cas-audience-schema.js +1 -1
  106. package/dist/sdk/cas/cas-audience-schema.js.map +1 -1
  107. package/dist/sdk/cas/cas-audience-validator.js +1 -1
  108. package/dist/sdk/cas/cas-audience-yaml.d.ts.map +1 -1
  109. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  110. package/dist/sdk/cas/cas-audience-yaml.js.map +1 -1
  111. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  112. package/dist/sdk/cas/index.d.ts +10 -0
  113. package/dist/sdk/cas/index.d.ts.map +1 -1
  114. package/dist/sdk/cas/index.js +1 -1
  115. package/dist/sdk/cas/index.js.map +1 -1
  116. package/dist/sdk/cas/pull-workflow.js +1 -1
  117. package/dist/sdk/cas/push-workflow.d.ts.map +1 -1
  118. package/dist/sdk/cas/push-workflow.js +1 -1
  119. package/dist/sdk/cas/push-workflow.js.map +1 -1
  120. package/dist/sdk/cas/types.d.ts +2 -0
  121. package/dist/sdk/cas/types.d.ts.map +1 -1
  122. package/dist/sdk/cas/validate-files.js +1 -1
  123. package/dist/sdk/client/cdp-api-client.js +1 -1
  124. package/dist/sdk/client/delivery-api-client.js +1 -1
  125. package/dist/sdk/client/endpoints.js +1 -1
  126. package/dist/sdk/client/engage-api-client.js +1 -1
  127. package/dist/sdk/client/http-client.js +1 -1
  128. package/dist/sdk/client/llm-api-client.js +1 -1
  129. package/dist/sdk/client/oauth-refresh.js +1 -1
  130. package/dist/sdk/client/rate-limiter.js +1 -1
  131. package/dist/sdk/client/td-api-client.js +1 -1
  132. package/dist/sdk/client/trino-api-client.js +1 -1
  133. package/dist/sdk/client/workflow-client.js +1 -1
  134. package/dist/sdk/connection-validator.js +1 -1
  135. package/dist/sdk/connection.js +1 -1
  136. package/dist/sdk/delivery.js +1 -1
  137. package/dist/sdk/engage/always-on-campaign-pull.js +1 -1
  138. package/dist/sdk/engage/always-on-campaign-push.js +1 -1
  139. package/dist/sdk/engage/always-on-campaign-validator.js +1 -1
  140. package/dist/sdk/engage/always-on-campaign-yaml.js +1 -1
  141. package/dist/sdk/engage/campaign-pull.js +1 -1
  142. package/dist/sdk/engage/campaign-push.js +1 -1
  143. package/dist/sdk/engage/campaign-validator.js +1 -1
  144. package/dist/sdk/engage/campaign-yaml.js +1 -1
  145. package/dist/sdk/engage/template-pull.js +1 -1
  146. package/dist/sdk/engage/template-push.js +1 -1
  147. package/dist/sdk/engage/template-validator.js +1 -1
  148. package/dist/sdk/engage/template-yaml.js +1 -1
  149. package/dist/sdk/engage/types/always-on-campaign-schema.js +1 -1
  150. package/dist/sdk/engage/types/campaign-def.js +1 -1
  151. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  152. package/dist/sdk/engage/types/template-schema.js +1 -1
  153. package/dist/sdk/engage.js +1 -1
  154. package/dist/sdk/errors.js +1 -1
  155. package/dist/sdk/index.js +1 -1
  156. package/dist/sdk/io/index.js +1 -1
  157. package/dist/sdk/io/node-filesystem.js +1 -1
  158. package/dist/sdk/job.js +1 -1
  159. package/dist/sdk/journey.js +1 -1
  160. package/dist/sdk/llm/chat-cache.js +1 -1
  161. package/dist/sdk/llm/index.js +1 -1
  162. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  163. package/dist/sdk/llm/model-factors.js +1 -1
  164. package/dist/sdk/llm/user-settings.js +1 -1
  165. package/dist/sdk/personalization.js +1 -1
  166. package/dist/sdk/policy.js +1 -1
  167. package/dist/sdk/query/deleted-table-validation.js +1 -1
  168. package/dist/sdk/query/index.js +1 -1
  169. package/dist/sdk/query/sql-parser.js +1 -1
  170. package/dist/sdk/realtime.js +1 -1
  171. package/dist/sdk/schedule.js +1 -1
  172. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  173. package/dist/sdk/segment/fields-display.js +1 -1
  174. package/dist/sdk/segment/file-discovery.js +1 -1
  175. package/dist/sdk/segment/journey-utils.js +1 -1
  176. package/dist/sdk/segment/journey-validator.js +1 -1
  177. package/dist/sdk/segment/journey-yaml.js +1 -1
  178. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  179. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  180. package/dist/sdk/segment/pull-workflow.js +1 -1
  181. package/dist/sdk/segment/push-recovery.js +1 -1
  182. package/dist/sdk/segment/push-workflow.js +1 -1
  183. package/dist/sdk/segment/resolution-context.js +1 -1
  184. package/dist/sdk/segment/segment-path-parser.js +1 -1
  185. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  186. package/dist/sdk/segment/segment-validator.js +1 -1
  187. package/dist/sdk/segment/target-resolution.js +1 -1
  188. package/dist/sdk/segment/tdx-config.js +1 -1
  189. package/dist/sdk/segment/types/activation-schema.js +1 -1
  190. package/dist/sdk/segment/types/journey-def.js +1 -1
  191. package/dist/sdk/segment/types/journey-schema.js +1 -1
  192. package/dist/sdk/segment/types/segment-def.js +1 -1
  193. package/dist/sdk/segment/types/segment-schema.js +1 -1
  194. package/dist/sdk/segment/validate-files.js +1 -1
  195. package/dist/sdk/segment/yaml-validator.js +1 -1
  196. package/dist/sdk/segment.js +1 -1
  197. package/dist/sdk/types/cas.d.ts +4 -0
  198. package/dist/sdk/types/cas.d.ts.map +1 -1
  199. package/dist/sdk/types/index.js +1 -1
  200. package/dist/sdk/types/progress.js +1 -1
  201. package/dist/sdk/types/workspace.js +1 -1
  202. package/dist/sdk/user.js +1 -1
  203. package/dist/sdk/util/format-detector.js +1 -1
  204. package/dist/sdk/util/formatters.js +1 -1
  205. package/dist/sdk/util/index.js +1 -1
  206. package/dist/sdk/util/paginate.js +1 -1
  207. package/dist/sdk/util/tree-formatter.js +1 -1
  208. package/dist/sdk/util/tree-search.js +1 -1
  209. package/dist/sdk/workflow/archive-validation.js +1 -1
  210. package/dist/sdk/workflow/clone-workflow.js +1 -1
  211. package/dist/sdk/workflow/index.js +1 -1
  212. package/dist/sdk/workflow/pull-workflow.js +1 -1
  213. package/dist/sdk/workflow/push-workflow.js +1 -1
  214. package/dist/sdk/workflow/task-graph.js +1 -1
  215. package/dist/sdk/workflow/tdx-config.js +1 -1
  216. package/dist/sdk/workflow/workflow-utils.js +1 -1
  217. package/dist/sdk/workspace/access-tracker.js +1 -1
  218. package/dist/sdk/workspace/frontmatter.js +1 -1
  219. package/dist/sdk/workspace/git.js +1 -1
  220. package/dist/sdk/workspace/index.js +1 -1
  221. package/dist/sdk/workspace/templates.js +1 -1
  222. package/dist/sdk/workspace/weekly.js +1 -1
  223. package/dist/sdk/workspace/wikilinks.js +1 -1
  224. package/dist/test-utils/command-runner.js +1 -1
  225. package/dist/test-utils/factories.js +1 -1
  226. package/dist/test-utils/fixtures.js +1 -1
  227. package/dist/test-utils/http-mock.js +1 -1
  228. package/dist/test-utils/index.js +1 -1
  229. package/dist/utils/async.js +1 -1
  230. package/dist/utils/claude-code-state.js +1 -1
  231. package/dist/utils/colors.js +1 -1
  232. package/dist/utils/diff.js +1 -1
  233. package/dist/utils/file-permissions.js +1 -1
  234. package/dist/utils/file-reader.js +1 -1
  235. package/dist/utils/github-releases.js +1 -1
  236. package/dist/utils/global-cache.js +1 -1
  237. package/dist/utils/json-loader.js +1 -1
  238. package/dist/utils/local-cache.js +1 -1
  239. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  240. package/dist/utils/logger/formatters/index.js +1 -1
  241. package/dist/utils/logger/handlers/console-handler.js +1 -1
  242. package/dist/utils/logger/handlers/file-handler.js +1 -1
  243. package/dist/utils/logger/handlers/index.js +1 -1
  244. package/dist/utils/logger/handlers/null-handler.js +1 -1
  245. package/dist/utils/logger/index.js +1 -1
  246. package/dist/utils/logger/logger.js +1 -1
  247. package/dist/utils/logger/types.js +1 -1
  248. package/dist/utils/option-validation.js +1 -1
  249. package/dist/utils/process.js +1 -1
  250. package/dist/utils/prompt.js +1 -1
  251. package/dist/utils/proxy-fetch.js +1 -1
  252. package/dist/utils/spinner.js +1 -1
  253. package/dist/utils/sse-parser.js +1 -1
  254. package/dist/utils/string-utils.js +1 -1
  255. package/dist/utils/table-ref-parser.js +1 -1
  256. package/dist/utils/tdx-logger.js +1 -1
  257. package/dist/utils/version-check.js +1 -1
  258. package/package.json +1 -1
@@ -1 +1 @@
1
- const a34_0x43d0d4=a34_0x11ee;(function(_0x18a36f,_0x3cf4b8){const _0x4e170e=a34_0x11ee,_0x4a095d=_0x18a36f();while(!![]){try{const _0xa5cec0=parseInt(_0x4e170e(0x357))/0x1+parseInt(_0x4e170e(0x24a))/0x2+-parseInt(_0x4e170e(0x320))/0x3*(parseInt(_0x4e170e(0x247))/0x4)+-parseInt(_0x4e170e(0x26c))/0x5*(parseInt(_0x4e170e(0x22e))/0x6)+-parseInt(_0x4e170e(0x29b))/0x7*(-parseInt(_0x4e170e(0x1dc))/0x8)+parseInt(_0x4e170e(0x23b))/0x9*(parseInt(_0x4e170e(0x180))/0xa)+parseInt(_0x4e170e(0x23c))/0xb*(parseInt(_0x4e170e(0x215))/0xc);if(_0xa5cec0===_0x3cf4b8)break;else _0x4a095d['push'](_0x4a095d['shift']());}catch(_0x5a33a5){_0x4a095d['push'](_0x4a095d['shift']());}}}(a34_0x3059,0xc9147));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a34_0x2baf04 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,createCommandSpinner,formatElapsed}from'../utils/spinner.js';import{loadJSONFromOptions,loadJSON}from'../utils/json-loader.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{getConsoleUrl,getConsoleNextUrl}from'../sdk/client/endpoints.js';import{formatRows,formatAsTable,hyperlink}from'../sdk/util/formatters.js';import{parseDef,serializeDef}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import a34_0x270838 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=a34_0x43d0d4(0x187),LEGACY_PARENT_SEGMENT_DIR=a34_0x43d0d4(0x25d);function openBrowser(_0x2012d8){const _0x4b7cf0=a34_0x43d0d4,_0x3b3210=process[_0x4b7cf0(0x242)],_0x4b6171=_0x3b3210===_0x4b7cf0(0x284)?_0x4b7cf0(0x33d):_0x3b3210===_0x4b7cf0(0x2ba)?_0x4b7cf0(0x262):_0x4b7cf0(0x153);spawn(_0x4b6171,[_0x2012d8],{'detached':!![],'stdio':_0x4b7cf0(0x173)})[_0x4b7cf0(0x31c)]();}function migrateLegacyDirectory(){const _0x3e4e16=a34_0x43d0d4;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x4413b8=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x4413b8[_0x3e4e16(0x2d0)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x3e4e16(0x1a0)](a34_0x270838[_0x3e4e16(0x194)]('\x0a⚠️\x20\x20Both\x20'+LEGACY_PARENT_SEGMENT_DIR+_0x3e4e16(0x35e)+PARENT_SEGMENT_DIR+'/\x20directories\x20exist.')),console[_0x3e4e16(0x1a0)](a34_0x270838['dim'](_0x3e4e16(0x1f0)+LEGACY_PARENT_SEGMENT_DIR+'/\x20directory.\x0a')),![];console[_0x3e4e16(0x1a0)](a34_0x270838[_0x3e4e16(0x194)](_0x3e4e16(0x1d5)+LEGACY_PARENT_SEGMENT_DIR+_0x3e4e16(0x342)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x3e4e16(0x1a0)](a34_0x270838['green'](_0x3e4e16(0x2a1)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x50bee2){const _0x3fd1e8=_0x50bee2 instanceof Error?_0x50bee2['message']:String(_0x50bee2);return console[_0x3e4e16(0x1a0)](a34_0x270838[_0x3e4e16(0x1e0)]('✘\x20Failed\x20to\x20rename\x20directory:\x20'+_0x3fd1e8+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a34_0x43d0d4(0x249)](_0x4358e7){const _0x4c26ad=a34_0x43d0d4;return migrateLegacyDirectory(),super[_0x4c26ad(0x249)](_0x4358e7);}}function resolveYamlFile(_0xe8cf2a){const _0x3895b8=a34_0x43d0d4;if(_0xe8cf2a[_0x3895b8(0x246)](_0x3895b8(0x29d))||_0xe8cf2a[_0x3895b8(0x246)](_0x3895b8(0x31e)))return _0xe8cf2a;return a34_0x2baf04[_0x3895b8(0x2d4)](PARENT_SEGMENT_DIR,sanitizeFileName(_0xe8cf2a)+_0x3895b8(0x29d));}function formatProgressMessage(_0x265701){const _0x49386c=a34_0x43d0d4,_0x46dca2=_0x265701[_0x49386c(0x1b6)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x46dca2){const [,_0x1c24ff,_0x443ad1,_0x3c202e='']=_0x46dca2;return a34_0x270838[_0x49386c(0x207)](_0x1c24ff+':')+'\x20'+_0x443ad1+a34_0x270838[_0x49386c(0x207)](_0x3c202e);}return a34_0x270838[_0x49386c(0x207)](_0x265701);}function showFileNotFoundError(_0x54717d,_0xd17283){const _0x2f5d98=a34_0x43d0d4;console[_0x2f5d98(0x1a0)](a34_0x270838[_0x2f5d98(0x1e0)](_0x2f5d98(0x165)+_0x54717d+'\x0a')),console[_0x2f5d98(0x1a0)](a34_0x270838[_0x2f5d98(0x32c)](_0x2f5d98(0x2d3)+_0xd17283+_0x2f5d98(0x287)));}function a34_0x11ee(_0x22b789,_0x24c044){_0x22b789=_0x22b789-0x14b;const _0x305984=a34_0x3059();let _0x11ee63=_0x305984[_0x22b789];return _0x11ee63;}function displayRealtimeValidation(_0x25c6fc){const _0x9c4050=a34_0x43d0d4;if(!_0x25c6fc['realtime'])return;const _0x267ebe=_0x25c6fc[_0x9c4050(0x291)],_0x382f44=_0x267ebe[_0x9c4050(0x2da)]?a34_0x270838[_0x9c4050(0x19d)](_0x9c4050(0x19c)):a34_0x270838[_0x9c4050(0x194)](_0x9c4050(0x350));console[_0x9c4050(0x1a0)]('\x0a'+a34_0x270838[_0x9c4050(0x207)](_0x9c4050(0x361))+'\x20'+_0x382f44);if(_0x267ebe[_0x9c4050(0x208)]&&_0x267ebe[_0x9c4050(0x208)][_0x9c4050(0x2c7)]>0x0){console['error']('\x20\x20'+a34_0x270838[_0x9c4050(0x207)](_0x9c4050(0x2b6))+'\x20'+_0x267ebe[_0x9c4050(0x208)]['length']+_0x9c4050(0x176));for(const _0x307e49 of _0x267ebe['events']){const _0x214f2d=_0x307e49[_0x9c4050(0x205)]===![]?a34_0x270838[_0x9c4050(0x1e0)]('✘'):a34_0x270838[_0x9c4050(0x19d)]('✔');console[_0x9c4050(0x1a0)](_0x9c4050(0x2e9)+_0x214f2d+'\x20'+_0x307e49['name']),_0x307e49[_0x9c4050(0x273)]&&console[_0x9c4050(0x1a0)](_0x9c4050(0x18e)+a34_0x270838[_0x9c4050(0x1e0)](_0x307e49[_0x9c4050(0x273)]));}}if(_0x267ebe[_0x9c4050(0x168)]&&_0x267ebe[_0x9c4050(0x168)][_0x9c4050(0x2c7)]>0x0){console[_0x9c4050(0x1a0)]('\x20\x20'+a34_0x270838['dim'](_0x9c4050(0x2a7))+'\x20'+_0x267ebe['attributes'][_0x9c4050(0x2c7)]+_0x9c4050(0x176));for(const _0xe975f of _0x267ebe[_0x9c4050(0x168)]){const _0x2aacf9=_0xe975f['valid']?a34_0x270838[_0x9c4050(0x19d)]('✔'):a34_0x270838[_0x9c4050(0x1e0)]('✘');console[_0x9c4050(0x1a0)](_0x9c4050(0x2e9)+_0x2aacf9+'\x20'+_0xe975f['name']+'\x20'+a34_0x270838[_0x9c4050(0x207)]('('+_0xe975f[_0x9c4050(0x1d6)]+')'));}}if(_0x267ebe['idStitching']){const _0x4fd093=_0x267ebe['idStitching'][_0x9c4050(0x1b3)]?.['length']?_0x9c4050(0x261)+_0x267ebe['idStitching'][_0x9c4050(0x1b3)][_0x9c4050(0x2d4)](',\x20')+']':'';console[_0x9c4050(0x1a0)]('\x20\x20'+a34_0x270838[_0x9c4050(0x207)](_0x9c4050(0x295))+'\x20'+_0x267ebe['idStitching'][_0x9c4050(0x2c4)]+_0x4fd093);}if(_0x267ebe['personalizationServices']&&_0x267ebe[_0x9c4050(0x2e3)]['length']>0x0){console[_0x9c4050(0x1a0)]('\x20\x20'+a34_0x270838[_0x9c4050(0x207)]('Personalization:')+'\x20'+_0x267ebe[_0x9c4050(0x2e3)]['length']+_0x9c4050(0x2b9)+(_0x267ebe[_0x9c4050(0x2e3)]['length']!==0x1?'s':''));for(const _0xaee540 of _0x267ebe[_0x9c4050(0x2e3)]){console[_0x9c4050(0x1a0)](_0x9c4050(0x2c5)+_0xaee540[_0x9c4050(0x2f9)]);}}}function showParentSegmentNotSetError(_0x105929){const _0x29166d=a34_0x43d0d4;console[_0x29166d(0x1a0)](a34_0x270838[_0x29166d(0x194)](_0x29166d(0x26f))),console['error'](_0x105929);}export class ParentSegmentListCommand extends BaseCommand{['name']=a34_0x43d0d4(0x2f4);[a34_0x43d0d4(0x241)]=a34_0x43d0d4(0x2b2);async['execute'](_0x322ecf){const _0x24df1c=a34_0x43d0d4,{options:_0x930165,args:_0x53fe5f,tdx:_0x27a727}=_0x322ecf,_0x7a9fd=_0x53fe5f[0x0];_0x930165[_0x24df1c(0x235)]&&(console['error'](_0x24df1c(0x328)+_0x930165[_0x24df1c(0x213)]),_0x7a9fd&&console[_0x24df1c(0x1a0)](_0x24df1c(0x30c)+_0x7a9fd));const _0x177151=await withSpinner(_0x7a9fd?'Listing\x20parent\x20segments\x20matching\x20\x27'+_0x7a9fd+_0x24df1c(0x1f6):_0x24df1c(0x1e8),()=>_0x27a727[_0x24df1c(0x347)][_0x24df1c(0x169)](),{'verbose':_0x930165['verbose']});let _0x4b4519=_0x177151['data'];if(_0x7a9fd){const _0x4f96de=_0x7a9fd[_0x24df1c(0x238)](/[.+^${}()|[\]\\]/g,'\x5c$&')[_0x24df1c(0x238)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x572740=new RegExp('^'+_0x4f96de+'$','i');_0x4b4519=_0x4b4519[_0x24df1c(0x14b)](_0xce4c8c=>_0x572740[_0x24df1c(0x2af)](_0xce4c8c['attributes'][_0x24df1c(0x2f9)]));}_0x4b4519['sort']((_0x56218d,_0x5c51c2)=>_0x56218d[_0x24df1c(0x168)][_0x24df1c(0x2f9)][_0x24df1c(0x348)](_0x5c51c2['attributes'][_0x24df1c(0x2f9)])),console[_0x24df1c(0x1a0)]('✔\x20Found\x20'+_0x4b4519[_0x24df1c(0x2c7)]+_0x24df1c(0x2cd)+(_0x4b4519['length']!==0x1?'s':''));const _0x197e8e=_0x4d51be=>{const _0x266d5f=_0x24df1c;return getConsoleNextUrl(_0x930165[_0x266d5f(0x213)],_0x266d5f(0x23a)+_0x4d51be);};if(_0x930165['format']===_0x24df1c(0x294)||_0x930165[_0x24df1c(0x1d2)]==='jsonl'){const _0x56aaec=_0x4b4519['map'](_0x59805c=>({..._0x59805c,'url':_0x197e8e(_0x59805c['id'])}));await handleSDKOutput(_0x56aaec,_0x930165);}else{if(_0x4b4519[_0x24df1c(0x2c7)]===0x0)_0x7a9fd?console[_0x24df1c(0x167)](_0x24df1c(0x2b0)+_0x7a9fd):console[_0x24df1c(0x167)]('No\x20parent\x20segments\x20found');else for(const _0x36256e of _0x4b4519){const _0x1b3745=_0x36256e[_0x24df1c(0x168)]['population']?a34_0x270838['dim']('\x20('+formatRows(_0x36256e[_0x24df1c(0x168)][_0x24df1c(0x15e)])+')'):'',_0x10fe45=hyperlink(_0x36256e[_0x24df1c(0x168)]['name'],_0x197e8e(_0x36256e['id']));console[_0x24df1c(0x167)]('👥\x20'+_0x10fe45+_0x1b3745);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a34_0x43d0d4(0x2f9)]='segment:parent:create';[a34_0x43d0d4(0x241)]='Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]';async['execute'](_0x407490){const _0x2bcaf8=a34_0x43d0d4,{options:_0x5cc76d,args:_0xb45bd7,tdx:_0x5746d0}=_0x407490;console[_0x2bcaf8(0x1a0)]('\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a'+_0x2bcaf8(0x2e6)+_0x2bcaf8(0x236));const _0x2653df=_0x5cc76d;if(_0xb45bd7[_0x2bcaf8(0x2c7)]===0x0)return console[_0x2bcaf8(0x1a0)](a34_0x270838[_0x2bcaf8(0x1e0)]('Error:\x20Parent\x20segment\x20name\x20is\x20required')),console[_0x2bcaf8(0x1a0)](_0x2bcaf8(0x2c1)),0x1;const _0x79defa=_0xb45bd7[0x0];if(!_0x2653df[_0x2bcaf8(0x2bc)]||!_0x2653df['table'])return console[_0x2bcaf8(0x1a0)](_0x2bcaf8(0x183)),console[_0x2bcaf8(0x1a0)](_0x2bcaf8(0x2c1)),0x1;_0x2653df[_0x2bcaf8(0x235)]&&(console['error']('Site:\x20'+_0x2653df[_0x2bcaf8(0x213)]),console[_0x2bcaf8(0x1a0)]('Name:\x20'+_0x79defa),console['error']('Database:\x20'+_0x2653df['database']),console[_0x2bcaf8(0x1a0)](_0x2bcaf8(0x27c)+_0x2653df[_0x2bcaf8(0x230)]));const _0x3d1742=await loadJSONFromOptions(_0x2653df['attributes'],_0x2653df['attributesFile']),_0x3df1ac=await loadJSONFromOptions(_0x2653df[_0x2bcaf8(0x2d6)],_0x2653df['behaviorsFile']),_0x531ae5=await loadJSONFromOptions(_0x2653df[_0x2bcaf8(0x2a6)],_0x2653df[_0x2bcaf8(0x1ce)]),_0x167285={'name':_0x79defa,'description':_0x2653df[_0x2bcaf8(0x241)],'scheduleType':_0x2653df[_0x2bcaf8(0x29c)],'scheduleOption':_0x2653df[_0x2bcaf8(0x206)],'timezone':_0x2653df['timezone'],'master':{'parentDatabaseName':_0x2653df[_0x2bcaf8(0x2bc)],'parentTableName':_0x2653df[_0x2bcaf8(0x230)]},'attributes':_0x3d1742,'behaviors':_0x3df1ac,'customerGroup':_0x531ae5},_0x6fa3ab=await withSpinner(_0x2bcaf8(0x344)+_0x79defa+_0x2bcaf8(0x1f6),()=>_0x5746d0[_0x2bcaf8(0x347)][_0x2bcaf8(0x1aa)](_0x167285),{'verbose':_0x5cc76d[_0x2bcaf8(0x235)]}),_0x2e637d=_0x6fa3ab[_0x2bcaf8(0x369)];return console[_0x2bcaf8(0x1a0)](_0x2bcaf8(0x28e)+_0x2e637d[_0x2bcaf8(0x2f9)]+_0x2bcaf8(0x220)+_0x2e637d['id']),await handleSDKOutput([_0x2e637d],_0x5cc76d),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a34_0x43d0d4(0x2f9)]='segment:parent:update';['description']='Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]';async[a34_0x43d0d4(0x331)](_0x407819){const _0xdf99b7=a34_0x43d0d4,{options:_0x50ad21,args:_0xe78320,tdx:_0x3c6160}=_0x407819;console['error']('\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a'+_0xdf99b7(0x2e6)+_0xdf99b7(0x236));const _0x2e5433=_0x50ad21;if(_0xe78320[_0xdf99b7(0x2c7)]===0x0)return console['error'](a34_0x270838[_0xdf99b7(0x1e0)](_0xdf99b7(0x178))),console[_0xdf99b7(0x1a0)](_0xdf99b7(0x164)),0x1;const _0x371679=_0xe78320[0x0];_0x2e5433[_0xdf99b7(0x235)]&&(console[_0xdf99b7(0x1a0)](_0xdf99b7(0x328)+_0x2e5433['site']),console['error'](_0xdf99b7(0x191)+_0x371679));const _0x459e64=await withSpinner(_0xdf99b7(0x310)+_0x371679+_0xdf99b7(0x1f6),()=>_0x3c6160[_0xdf99b7(0x347)][_0xdf99b7(0x2f0)](_0x371679),{'verbose':_0x2e5433[_0xdf99b7(0x235)]}),_0x2ab8b0=_0x459e64[_0xdf99b7(0x369)],_0x44b7e7=await loadJSONFromOptions(_0x2e5433[_0xdf99b7(0x2ed)],_0x2e5433[_0xdf99b7(0x333)]),_0x419b7d=await loadJSONFromOptions(_0x2e5433[_0xdf99b7(0x18c)],_0x2e5433[_0xdf99b7(0x16e)]),_0x3f81e6={'name':_0x2ab8b0[_0xdf99b7(0x2f9)],'description':_0x2e5433[_0xdf99b7(0x241)]!==undefined?_0x2e5433[_0xdf99b7(0x241)]:_0x2ab8b0[_0xdf99b7(0x241)],'scheduleType':_0x2e5433[_0xdf99b7(0x29c)]!==undefined?_0x2e5433['scheduleType']:_0x2ab8b0[_0xdf99b7(0x29c)],'scheduleOption':_0x2e5433[_0xdf99b7(0x206)]!==undefined?_0x2e5433['scheduleOption']:_0x2ab8b0['scheduleOption'],'timezone':_0x2e5433['timezone']!==undefined?_0x2e5433[_0xdf99b7(0x179)]:_0x2ab8b0[_0xdf99b7(0x179)],'master':_0x2ab8b0['master'],'attributes':_0x44b7e7?[..._0x2ab8b0[_0xdf99b7(0x168)]||[],..._0x44b7e7]:_0x2ab8b0[_0xdf99b7(0x168)],'behaviors':_0x419b7d?[..._0x2ab8b0['behaviors']||[],..._0x419b7d]:_0x2ab8b0[_0xdf99b7(0x2d6)],'customerGroup':_0x2ab8b0[_0xdf99b7(0x2a6)]},_0xff3987=await withSpinner('Updating\x20parent\x20segment\x20\x27'+_0x371679+_0xdf99b7(0x1f6),()=>_0x3c6160['segment']['updateParent'](_0x371679,_0x3f81e6),{'verbose':_0x2e5433[_0xdf99b7(0x235)]}),_0x54d58b=_0xff3987['data'];return console['error'](_0xdf99b7(0x24c)+_0x54d58b[_0xdf99b7(0x2f9)]+'\x27'),await handleSDKOutput([_0x54d58b],_0x2e5433),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a34_0x43d0d4(0x2f9)]=a34_0x43d0d4(0x32b);[a34_0x43d0d4(0x241)]=a34_0x43d0d4(0x234);async['execute'](_0xff8f32){const _0x5e47b0=a34_0x43d0d4,{options:_0x49b53a,args:_0x503b86,tdx:_0x6bebea}=_0xff8f32,_0x5a8e6a=_0x49b53a,_0x171c44=_0x503b86[0x0]||_0x49b53a[_0x5e47b0(0x201)];if(!_0x171c44)return showParentSegmentNotSetError(_0x5e47b0(0x19e)+_0x5e47b0(0x2ad)),0x1;if(_0x5a8e6a[_0x5e47b0(0x28b)]&&_0x5a8e6a[_0x5e47b0(0x1ac)])return console[_0x5e47b0(0x1a0)](a34_0x270838[_0x5e47b0(0x1e0)](_0x5e47b0(0x16f))),console['error'](a34_0x270838['dim'](_0x5e47b0(0x186))),console[_0x5e47b0(0x1a0)](a34_0x270838[_0x5e47b0(0x207)](_0x5e47b0(0x21a)+PARENT_SEGMENT_DIR+'/{name}.yml\x0a')),console['error'](a34_0x270838[_0x5e47b0(0x32c)]('Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u')),0x1;const _0x4f1f6e=_0x5a8e6a[_0x5e47b0(0x1ac)]||a34_0x2baf04[_0x5e47b0(0x2d4)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x171c44)+_0x5e47b0(0x29d));_0x5a8e6a[_0x5e47b0(0x235)]&&(console[_0x5e47b0(0x1a0)](_0x5e47b0(0x328)+_0x5a8e6a[_0x5e47b0(0x213)]),console[_0x5e47b0(0x1a0)](_0x5e47b0(0x191)+_0x171c44),console[_0x5e47b0(0x1a0)](_0x5e47b0(0x16c)+_0x4f1f6e));const _0x217e01=await withSpinner(_0x5e47b0(0x36a)+_0x171c44+_0x5e47b0(0x1f6),()=>_0x6bebea[_0x5e47b0(0x347)][_0x5e47b0(0x2cb)](_0x171c44),{'verbose':_0x5a8e6a[_0x5e47b0(0x235)]}),_0x2c23b3=_0x217e01[_0x5e47b0(0x369)];if(existsSync(_0x4f1f6e)){const _0x2e87d0=readFileSync(_0x4f1f6e,'utf-8'),_0x36d831=generateDiff(_0x2e87d0,_0x2c23b3);if(!hasChanges(_0x36d831))console[_0x5e47b0(0x1a0)](a34_0x270838[_0x5e47b0(0x19d)]('✔')+_0x5e47b0(0x2ea)+a34_0x270838['cyan'](_0x4f1f6e)+_0x5e47b0(0x1c4));else{console[_0x5e47b0(0x1a0)](_0x5e47b0(0x170)+_0x4f1f6e+'\x27:'),console[_0x5e47b0(0x1a0)]('─'[_0x5e47b0(0x1e1)](0x3c)),console[_0x5e47b0(0x1a0)](formatDiffWithColors(_0x36d831)),console[_0x5e47b0(0x1a0)]('─'[_0x5e47b0(0x1e1)](0x3c));if(!_0x5a8e6a[_0x5e47b0(0x1b5)]){if(!isInteractive())return console[_0x5e47b0(0x1a0)](a34_0x270838[_0x5e47b0(0x1e0)](_0x5e47b0(0x286)),_0x5e47b0(0x2d8)),console[_0x5e47b0(0x1a0)](a34_0x270838['dim'](_0x5e47b0(0x1b1))),0x1;const _0x28f12f=await confirmKey(_0x5e47b0(0x35c)+_0x4f1f6e+'\x27?');if(!_0x28f12f)return console['error'](a34_0x270838[_0x5e47b0(0x194)](_0x5e47b0(0x2cf))),0x1;}writeFileSync(_0x4f1f6e,_0x2c23b3,_0x5e47b0(0x315)),console[_0x5e47b0(0x1a0)](a34_0x270838['green']('✔')+_0x5e47b0(0x2f2)+a34_0x270838[_0x5e47b0(0x32c)](_0x4f1f6e));}}else{const _0x23a841=a34_0x2baf04[_0x5e47b0(0x259)](_0x4f1f6e);!existsSync(_0x23a841)&&mkdirSync(_0x23a841,{'recursive':!![]}),writeFileSync(_0x4f1f6e,_0x2c23b3,'utf-8'),console['error'](a34_0x270838[_0x5e47b0(0x19d)]('✔')+_0x5e47b0(0x2f2)+a34_0x270838[_0x5e47b0(0x32c)](_0x4f1f6e));}return saveSessionContext({'parent_segment':_0x171c44},_0x5a8e6a[_0x5e47b0(0x343)]),console[_0x5e47b0(0x1a0)](a34_0x270838[_0x5e47b0(0x19d)]('✔')+_0x5e47b0(0x1a3)+a34_0x270838[_0x5e47b0(0x207)](_0x5e47b0(0x25d))+'\x20=\x20'+a34_0x270838['cyan'](_0x171c44)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a34_0x43d0d4(0x2f9)]='segment:parent:push';['description']=a34_0x43d0d4(0x324);async[a34_0x43d0d4(0x331)](_0x4f8c90){const _0x43ad2f=a34_0x43d0d4,{options:_0x3f9574,args:_0x342ea0,tdx:_0x3b76f2}=_0x4f8c90,_0x5db0b9=_0x3f9574,_0x5593dc=_0x342ea0[0x0]||_0x3f9574[_0x43ad2f(0x201)];if(!_0x5593dc)return showParentSegmentNotSetError(_0x43ad2f(0x1af)+_0x43ad2f(0x25e)),0x1;const _0x24afad=resolveYamlFile(_0x5593dc);if(!existsSync(_0x24afad))return showFileNotFoundError(_0x24afad,_0x5593dc),0x1;_0x5db0b9[_0x43ad2f(0x235)]&&(console['error']('Site:\x20'+_0x5db0b9[_0x43ad2f(0x213)]),console[_0x43ad2f(0x1a0)](_0x43ad2f(0x166)+_0x24afad));let _0xbd64de;try{_0xbd64de=readFileSync(_0x24afad,_0x43ad2f(0x315));}catch(_0x5474fd){const _0x16a1d2=_0x5474fd instanceof Error?_0x5474fd[_0x43ad2f(0x1ea)]:String(_0x5474fd);return console[_0x43ad2f(0x1a0)](_0x43ad2f(0x14e)+_0x16a1d2),0x1;}const _0x1adf86=await withSpinner(_0x43ad2f(0x27e),()=>_0x3b76f2[_0x43ad2f(0x347)][_0x43ad2f(0x269)](_0xbd64de),{'verbose':_0x5db0b9[_0x43ad2f(0x235)]}),_0x29efd2=_0x1adf86[_0x43ad2f(0x369)],{isNew:_0x10a0d6,name:_0x242b0f,hasChanges:_0x456b91,diffFormatted:_0x4746fb}=_0x29efd2;if(!_0x456b91)return console['error'](_0x43ad2f(0x229)+_0x242b0f+'\x27\x20is\x20already\x20up\x20to\x20date'),0x0;_0x10a0d6?console['error'](_0x43ad2f(0x2d7)+_0x242b0f+'\x27:'):console[_0x43ad2f(0x1a0)](_0x43ad2f(0x2a2)+_0x242b0f+'\x27:');console[_0x43ad2f(0x1a0)]('─'['repeat'](0x3c)),console[_0x43ad2f(0x1a0)](_0x4746fb),console['error']('─'[_0x43ad2f(0x1e1)](0x3c));const _0x2f5889=_0x10a0d6?'Create\x20parent\x20segment\x20\x27'+_0x242b0f+'\x27?':_0x43ad2f(0x335)+_0x242b0f+'\x27?';if(!_0x5db0b9[_0x43ad2f(0x1b5)]){if(!isInteractive())return console[_0x43ad2f(0x1a0)](a34_0x270838[_0x43ad2f(0x1e0)](_0x43ad2f(0x286)),_0x43ad2f(0x2d8)),console[_0x43ad2f(0x1a0)](a34_0x270838[_0x43ad2f(0x207)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x6a897e=await confirmKey(_0x2f5889);if(!_0x6a897e)return console[_0x43ad2f(0x1a0)](a34_0x270838['yellow'](_0x43ad2f(0x2cf))),0x1;}const _0x73d51a=_0x10a0d6?_0x43ad2f(0x1b7):_0x43ad2f(0x312),_0x43831f=await withSpinner(_0x73d51a+_0x43ad2f(0x1ae)+_0x242b0f+_0x43ad2f(0x1f6),()=>_0x29efd2[_0x43ad2f(0x27f)](),{'verbose':_0x5db0b9[_0x43ad2f(0x235)]}),_0xadb4e0=_0x43831f['data'],_0x54d9c9=getConsoleNextUrl(_0x5db0b9[_0x43ad2f(0x213)],_0x43ad2f(0x23a)+_0xadb4e0['id']),_0x5e6fc2=_0x10a0d6?'Created':_0x43ad2f(0x222);return console[_0x43ad2f(0x1a0)]('✔\x20'+_0x5e6fc2+_0x43ad2f(0x1ae)+_0xadb4e0[_0x43ad2f(0x2f9)]+'\x27'),console['error']('\x20\x20'+_0x54d9c9),0x0;}}function a34_0x3059(){const _0x11d513=['message','{\x0a\x20\x20\x22database\x22:\x20\x22','sampleData','Error:\x20Service\x20ID\x20is\x20required','schemaValid','/sessions/','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','✔\x20Deleted\x20personalization\x20\x27','Attribute:','getBehaviorNames','List\x20personalization\x20services\x20for\x20a\x20parent\x20segment','includeSensitive','\x27...','\x20\x20Columns:\x20','Add\x20template\x20personalization\x20section\x20to\x20parent\x20segment\x20YAML','Personalization\x20service\x20description','displaySampleData','\x20to\x20configure\x20your\x20personalization\x20service','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\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context','get','\x27\x20for\x20service\x20\x27','varchar','parentSegment','Usage:\x20tdx\x20ps\x20pz\x20show\x20<personalization_id>','FINISHED','Patching\x20personalization\x20\x27','sourceTableValid','scheduleOption','dim','events','Update\x20a\x20personalization\x20service\x20name\x20and/or\x20description','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','any','Updating\x20personalization\x20service\x20\x27','ps:pz:service:token:create','\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}','Listing\x20RT-enabled\x20parent\x20segments\x20matching\x20\x27','setJobId','totalEvents','site','resumeJourney','12AXHsRN','\x27\x20not\x20found\x20in\x20any\x20personalization\x20service','Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID,\x20then\x20add:','payload:','Enriched:','using\x20the\x20default\x20path:\x20','stop','.customers)','\x20total','ps:pz:create','\x20tdx\x20wf\x20attempt\x20','\x27\x20with\x20ID:\x20','Error:\x20--name\x20is\x20required','Updated','\x0a✔\x20Workflow\x20started','stats','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','\x0a\x20\x20\x20\x20]','Delete\x20a\x20personalization\x20service','updated:','✔\x20No\x20changes\x20-\x20\x27','Finding\x20service\x20for\x20token...','jsonl','joinKey','Default','12HspuxI','Status:','table','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','entryCriteria:','workflowAttemptId','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','verbose','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','Options:','replace','Master\x20+\x20Attributes','/app/dw/parentSegments/','9EbfGBv','10739003AsTCYF','Columns:','Create\x20a\x20personalization\x20service\x20for\x20a\x20parent\x20segment','\x20\x201.\x20Edit\x20','coveragePercent','description','platform','\x20Added\x20personalization\x20template\x20to\x20','label','null','endsWith','264492BvfLHF','displayAttributesStats','run','339932IBoKnG','keyEventCriteria','✔\x20Updated\x20parent\x20segment\x20\x27','Fetching\x20SQL\x20for\x20\x27','single','text','\x20stage','audienceId','✔\x20Created\x20personalization\x20\x27','\x20\x20\x20','\x20--enriched','double','Next\x20steps:','ps:rt:jn:resume','Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','dirname','validateParentYaml','tdx\x20ps\x20push\x20','sections:','parent_segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','Attempt:','formatSchemaJson','\x20+\x20[','start','id:\x20','toLowerCase','stageCount','stringify','SELECT\x20*\x20FROM\x20','\x20\x20Tables:\x201\x20customers\x20+\x20','pushParentYaml','Source:','ps:rt:configuration_versions','2289205CAZozR','workflowId','segment:parent:show','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','true','\x20[Job\x20ID:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','sourceTableError','✔\x20Paused\x20activations\x20for\x20RT\x20journey\x20\x27','displaySummary','Show\x20personalization\x20service\x20details','Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','ps:pz:service:token:delete','ps:pz:service:delete','entryCriteria','user_id','Table:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20init\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Add\x20PZ\x20template\x20for\x20specific\x20parent\x20segment','Analyzing\x20changes...','apply','information_schema','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','Create\x20parent\x20segment\x20\x27','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','darwin','list','\x0aError:','`\x20to\x20download\x20the\x20configuration\x20first','page_view','realtime:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context','use','token:','customerPercent','✔\x20Created\x20parent\x20segment\x20\x27','workflowSessionId','Error:','realtime','Delete\x20a\x20token\x20from\x20a\x20personalization\x20service','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','json','ID\x20Stitching:','\x20=\x20','resolveParentId','List\x20available\x20fields\x20for\x20segmentation','ps:rt:list','collectSchema','410578NaCnYV','scheduleType','.yml','status','eventKind','payload','✔\x20Renamed\x20directory\x20to\x20','\x0aChanges\x20to\x20apply\x20to\x20\x27','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]\x0a','Getting\x20personalization\x20\x27','Options\x20(one\x20required):\x0a','customerGroup','Attributes:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','parentFolder','\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','indexOf','Join\x20on:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','create','test','No\x20parent\x20segments\x20match\x20pattern:\x20','delete','List\x20parent\x20segments','\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22','✔\x20Retrieved\x20RT\x20configuration\x20version','<database>.<table>','Events:','Schema\x20saved\x20to\x20','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','\x20service','win32','deletePersonalization','database','Rows:','Listing\x20fields\x20for\x20\x27','matchedCount','\x0aNo\x20sample\x20data\x20available','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','SQL\x20query:\x0a','processedRows','primaryKey','\x20\x20\x20\x20-\x20','no\x20tokens\x20configured','length','ps:pz:show','personalization','\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22','pullParentYaml','split','\x20parent\x20segment','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','Aborted.','isDirectory','\x20--interval\x20','deleteToken','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','join','Error:\x20--attribute\x20requires\x20a\x20name\x0a','behaviors','\x0aNew\x20parent\x20segment\x20\x27','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Fetching\x20personalization\x20service\x20\x27','enabled','\x27\x20and\x20run\x20workflow?','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]\x0a','RT\x20Journey\x20ID:\x20','rowCount','Get\x20SQL\x20query\x20for\x20parent\x20segment','Get\x20current\x20RT\x20configuration\x20version\x20status','all','public:','personalizationServices','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','runParent','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','file','\x5c$&','\x20\x20\x20\x20','\x20No\x20changes\x20-\x20','Creating\x20token\x20\x27','\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a','addAttributes','foreignKey','Errors:','getParentFull','bold','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','displayBehaviorsStats','segment:parent:list','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','in\x20','Preview:','segment:parent:preview','name','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','✔\x20Updated\x20personalization\x20service\x20\x27','attribute','pauseJourney','ps:pz:delete','Error:\x20Service\x20name\x20is\x20required','elapsedTimeMillis','Executing\x20parent\x20segment\x20query...','⚠️\x20\x20personalization_services\x20section\x20already\x20exists\x20in\x20','toLocaleString','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]','customersWithEvents','Resume\x20activations\x20in\x20an\x20RT\x20journey','paused','\x20RT-enabled\x20parent\x20segment','public','createdAt','created:','Pattern:\x20','\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context','Deleting\x20personalization\x20\x27','Fetching\x20current\x20configuration\x20for\x20\x27','ps:rt:jn:list','Updating','ps:pz:service:list','(id:\x20','utf-8','behavior','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>','\x20field','\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','ps:rt:validate','\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)','unref','\x20Opening\x20','.yaml','No\x20RT\x20journeys\x20found','51WNWWiI','patch','✔\x20Deleted\x20token\x20\x27','\x22,\x20\x22type\x22:\x20\x22','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','columns','listPersonalizations','Creating\x20personalization\x20\x27','Site:\x20','✔\x20Query\x20completed:\x20Processed\x20','keyEventId:','segment:parent:pull','cyan','Show\x20a\x20specific\x20realtime\x20personalization','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','displayPreviewHints','allowedIps','execute','reduce','addAttributesFile','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context','Apply\x20changes\x20to\x20\x27','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','preview','ps:pz:init','Error:\x20Token\x20name\x20is\x20required','string','realtime_enabled','\x20rows)','open','folderId','List\x20realtime\x20personalizations\x20for\x20a\x20parent\x20segment','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]\x0a','column_type','/\x20→\x20','session','Creating\x20parent\x20segment\x20\x27','Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs','displayRealtimeInfo','segment','localeCompare','Behavior:','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','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','Error:\x20--folder-id\x20is\x20required.\x20Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID.','Session:','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','Audience\x20ID:','⚡\x20Not\x20enabled','Attributes','ps:rt:jn:pause','displayValidateResults','\x20--attribute\x20\x22<name>\x22','status:\x20','Fetching\x20behavior\x20list...','837012AtNVrm','value','-1d','toFixed','Join:','Overwrite\x20\x27','createPersonalization','/\x20and\x20','Usage:\x20tdx\x20ps\x20pz\x20delete\x20<personalization_id>','patchPersonalization','RT\x202.0:','column_name','✔\x20Deleted\x20personalization\x20service\x20\x27','Delete\x20a\x20realtime\x20personalization','jobId','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]','My\x20Service','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context','data','Fetching\x20parent\x20segment\x20\x27','filter','\x20RT\x20configuration\x20is\x20valid','query','Error\x20reading\x20file:\x20','customers','\x20--attribute\x20\x22','Master:','allValid','xdg-open','✔\x20Resumed\x20activations\x20for\x20RT\x20journey\x20\x27','segment:parent:fields','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','displayMasterInfo','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','getParentSQL','Error\x20parsing\x20YAML:\x20','tdx\x20ps\x20preview\x20','population','parent_id','map','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','✔\x20Found\x20','sections','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','Error:\x20File\x20not\x20found:\x20','YAML\x20file:\x20','log','attributes','listParents','\x20--behavior\x20\x22','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','Output\x20file:\x20','column','addBehaviorsFile','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','\x0aChanges\x20to\x20\x27','eventKind:\x20','/app/workflows/','ignore','Master\x20Table','Resolving\x20parent\x20segment\x20\x27','\x20configured','\x0a\x20\x20]\x0a}\x0a','Error:\x20Parent\x20segment\x20name\x20is\x20required','timezone','\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20','\x0aUsage:\x20tdx\x20ps\x20preview\x20','To\x20cancel:','createToken','\x0a⚠\x20Save\x20this\x20token\x20value\x20-\x20it\x20will\x20not\x20be\x20shown\x20again:','enriched','2936050vNXoXC','Error:\x20Token\x20ID\x20is\x20required','\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)','Error:\x20--database\x20and\x20--table\x20are\x20required','Listing\x20RT\x20journeys\x20for\x20\x27','Output\x20Database:','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','parent_segments','personalization_services','\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','segment:parent:view','Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a','addBehaviors','getPersonalization','\x20\x20\x20\x20\x20\x20','last_page_viewed','segment:parent:sql','Parent\x20segment:\x20','Deleting\x20token\x20\x27','✔\x20Updated\x20personalization\x20\x27','yellow','schemaError','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','tokens','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','\x20to\x20push\x20the\x20configuration','Error:\x20Personalization\x20ID\x20is\x20required','\x20Configuration\x20is\x20valid','⚡\x20Enabled','green','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','Usage:\x20tdx\x20ps\x20rt\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20RT\x20config\x20(requires\x20context)\x0a','error','ps:pz:patch','Getting\x20RT\x20configuration\x20version\x20for\x20\x27','\x20Context\x20set:\x20','Options:\x0a','state','identifier','trim','\x20personalization\x20service','audienceId:','createParent','relationships','output','Usage:\x20tdx\x20ps\x20rt\x20jn\x20pause_activations\x20<journeyId>\x0a','\x20parent\x20segment\x20\x27','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','getCurrentConfigVersion','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','master','stitchingKeys','Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]','yes','match','Creating','\x20--behavior\x20\x22<name>\x22','\x20\x20\x20\x20\x20\x20\x20Pass\x20null\x20to\x20place\x20in\x20the\x20root\x20folder.','\x20service(s)\x20configured','Coverage:','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','sort','\x27\x20(id:\x20','\x22\x20}','interval','displayPreviewResults','Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]','Show\x20parent\x20segment\x20details','\x20is\x20already\x20up\x20to\x20date','Validate:','Available\x20behaviors:','launched','\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20','\x0a\x20\x20\x20\x20}','audienceId:\x20','keyEventId','\x20(paused)','updatedAt','customerGroupFile','behavior_','number','Validating\x20RT\x20configuration...','format','\x20kill','ps:pz:service:create','\x0a⚠️\x20\x20Migrating:\x20','type','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','errors','Fetching\x20customers\x20schema...','getOutputDatabaseName','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]','80qpcwbS','List\x20parent\x20segments\x20with\x20RT\x202.0\x20status','\x20rows\x20','Error:\x20--behavior\x20requires\x20a\x20name\x0a','red','repeat','previewParentYaml','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','displayColumns','Listing\x20parent\x20segments...','web'];a34_0x3059=function(){return _0x11d513;};return a34_0x3059();}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{['name']='segment:parent:validate';['description']=a34_0x43d0d4(0x16b);async['execute'](_0x14ab29){const _0x1934aa=a34_0x43d0d4,{options:_0x251c8c,args:_0x406aad,tdx:_0x13baf5}=_0x14ab29,_0x17047b=_0x251c8c,_0x4bb235=_0x406aad[0x0]||_0x251c8c[_0x1934aa(0x201)];if(!_0x4bb235)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a'+_0x1934aa(0x1e3)+_0x1934aa(0x1a4)+_0x1934aa(0x158)+_0x1934aa(0x293)+'\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)'),0x1;const _0x1485f0=resolveYamlFile(_0x4bb235);if(!existsSync(_0x1485f0))return showFileNotFoundError(_0x1485f0,_0x4bb235),0x1;_0x17047b[_0x1934aa(0x235)]&&(console[_0x1934aa(0x1a0)](_0x1934aa(0x328)+_0x17047b[_0x1934aa(0x213)]),console[_0x1934aa(0x1a0)](_0x1934aa(0x166)+_0x1485f0));let _0x26cd3e;try{_0x26cd3e=readFileSync(_0x1485f0,_0x1934aa(0x315));}catch(_0x1b3ffe){const _0x27ebfc=_0x1b3ffe instanceof Error?_0x1b3ffe[_0x1934aa(0x1ea)]:String(_0x1b3ffe);return console[_0x1934aa(0x1a0)]('Error\x20reading\x20file:\x20'+_0x27ebfc),0x1;}const _0x4df1a1=createCommandSpinner(a34_0x270838[_0x1934aa(0x207)]('Validating\x20configuration...'),{'verbose':_0x17047b[_0x1934aa(0x235)]});_0x4df1a1[_0x1934aa(0x262)]();const _0x29e51e={'onProgress':_0x29e8b3=>{const _0x576c9f=_0x1934aa;_0x4df1a1[_0x576c9f(0x24f)]=formatProgressMessage(_0x29e8b3);}};if(_0x17047b['master'])_0x29e51e[_0x1934aa(0x1b2)]=!![];if(_0x17047b['enriched'])_0x29e51e['enriched']=!![];_0x17047b[_0x1934aa(0x2fc)]&&(_0x29e51e[_0x1934aa(0x2fc)]=_0x17047b[_0x1934aa(0x2fc)]);_0x17047b[_0x1934aa(0x316)]&&(_0x29e51e[_0x1934aa(0x316)]=_0x17047b[_0x1934aa(0x316)]);if(_0x17047b[_0x1934aa(0x1c0)])_0x29e51e[_0x1934aa(0x1c0)]=_0x17047b[_0x1934aa(0x1c0)];let _0x344e9c;try{_0x344e9c=await _0x13baf5[_0x1934aa(0x347)][_0x1934aa(0x25a)](_0x26cd3e,_0x29e51e),_0x4df1a1[_0x1934aa(0x21b)]();}catch(_0x9c15e0){_0x4df1a1[_0x1934aa(0x21b)]();throw _0x9c15e0;}const _0x1613ae=_0x17047b[_0x1934aa(0x1c0)]||_0x1934aa(0x359);return this[_0x1934aa(0x353)](_0x344e9c,_0x29e51e,_0x1485f0,_0x1613ae),_0x344e9c[_0x1934aa(0x152)]?0x0:0x1;}[a34_0x43d0d4(0x353)](_0x52a5bf,_0x169614,_0x517b62,_0x22596e){const _0x3e649f=a34_0x43d0d4;console[_0x3e649f(0x1a0)]('\x0a'+a34_0x270838[_0x3e649f(0x2f1)](_0x3e649f(0x1c5))+'\x20'+_0x52a5bf[_0x3e649f(0x2f9)]),console[_0x3e649f(0x1a0)]('═'[_0x3e649f(0x1e1)](0x3c)),this[_0x3e649f(0x157)](_0x52a5bf);if(typeof _0x169614[_0x3e649f(0x2fc)]==='string'){this['displayAttributesStats'](_0x52a5bf),this[_0x3e649f(0x275)](_0x52a5bf),this[_0x3e649f(0x32f)](_0x517b62,_0x22596e,_0x3e649f(0x2fc),_0x169614[_0x3e649f(0x2fc)]);return;}if(_0x169614[_0x3e649f(0x2fc)]===!![]){this[_0x3e649f(0x248)](_0x52a5bf),this['displaySummary'](_0x52a5bf),this['displayPreviewHints'](_0x517b62,_0x22596e,_0x3e649f(0x168));return;}if(typeof _0x169614['behavior']===_0x3e649f(0x33a)){this['displayBehaviorsStats'](_0x52a5bf,_0x22596e),this[_0x3e649f(0x275)](_0x52a5bf),this[_0x3e649f(0x32f)](_0x517b62,_0x22596e,'behavior',_0x169614['behavior']);return;}if(_0x169614[_0x3e649f(0x316)]===!![]){this[_0x3e649f(0x2f3)](_0x52a5bf,_0x22596e),this[_0x3e649f(0x275)](_0x52a5bf),this['displayPreviewHints'](_0x517b62,_0x22596e,'behaviors');return;}this[_0x3e649f(0x248)](_0x52a5bf),this[_0x3e649f(0x2f3)](_0x52a5bf,_0x22596e),this[_0x3e649f(0x346)](_0x52a5bf),this[_0x3e649f(0x275)](_0x52a5bf),this[_0x3e649f(0x32f)](_0x517b62,_0x22596e,'all');}['displayRealtimeInfo'](_0x7bceb){displayRealtimeValidation(_0x7bceb);}['displayPreviewHints'](_0x10c2c3,_0x33a72b,_0x6ed508,_0x4550e6){const _0x45d78d=a34_0x43d0d4;console['error']('\x0a'+a34_0x270838[_0x45d78d(0x207)]('To\x20view\x20sample\x20data:'));const _0x36fc81=_0x33a72b!==_0x45d78d(0x359)?_0x45d78d(0x2d1)+_0x33a72b:'';if(_0x6ed508===_0x45d78d(0x2fc)&&_0x4550e6)console['error']('\x20\x20'+a34_0x270838[_0x45d78d(0x207)](_0x45d78d(0x15d)+_0x10c2c3+_0x45d78d(0x150)+_0x4550e6+'\x22'+_0x36fc81));else{if(_0x6ed508===_0x45d78d(0x316)&&_0x4550e6)console[_0x45d78d(0x1a0)]('\x20\x20'+a34_0x270838[_0x45d78d(0x207)]('tdx\x20ps\x20preview\x20'+_0x10c2c3+_0x45d78d(0x16a)+_0x4550e6+'\x22'+_0x36fc81));else(_0x6ed508==='attributes'||_0x6ed508===_0x45d78d(0x2e1))&&console[_0x45d78d(0x1a0)]('\x20\x20'+a34_0x270838[_0x45d78d(0x207)](_0x45d78d(0x15d)+_0x10c2c3+_0x45d78d(0x354)+_0x36fc81));}(_0x6ed508==='behaviors'||_0x6ed508==='all')&&console[_0x45d78d(0x1a0)]('\x20\x20'+a34_0x270838[_0x45d78d(0x207)](_0x45d78d(0x15d)+_0x10c2c3+_0x45d78d(0x1b8)+_0x36fc81)),_0x6ed508===_0x45d78d(0x2e1)&&console[_0x45d78d(0x1a0)]('\x20\x20'+a34_0x270838[_0x45d78d(0x207)](_0x45d78d(0x15d)+_0x10c2c3+_0x45d78d(0x254)+_0x36fc81));}['displayMasterInfo'](_0x3a8867){const _0xacea22=a34_0x43d0d4,{master:_0xa6848}=_0x3a8867,_0x41a7b5=_0xa6848[_0xacea22(0x1ee)]?a34_0x270838[_0xacea22(0x19d)]('✔'):a34_0x270838[_0xacea22(0x1e0)]('✘');console[_0xacea22(0x1a0)]('\x0a'+a34_0x270838[_0xacea22(0x207)](_0xacea22(0x174))),console['error'](_0x41a7b5+'\x20'+a34_0x270838[_0xacea22(0x2f1)](_0xa6848[_0xacea22(0x2bc)]+'.'+_0xa6848[_0xacea22(0x230)])),_0xa6848['schemaValid']?_0xa6848[_0xacea22(0x2de)]!==undefined&&console[_0xacea22(0x1a0)]('\x20\x20'+a34_0x270838[_0xacea22(0x207)](_0xacea22(0x2bd))+'\x20'+a34_0x270838[_0xacea22(0x32c)](formatRows(_0xa6848[_0xacea22(0x2de)]))):console[_0xacea22(0x1a0)]('\x20\x20'+a34_0x270838[_0xacea22(0x1e0)](_0xacea22(0x290))+'\x20'+_0xa6848[_0xacea22(0x195)]);}[a34_0x43d0d4(0x248)](_0x132107){const _0x4697a0=a34_0x43d0d4;if(_0x132107[_0x4697a0(0x168)][_0x4697a0(0x2c7)]===0x0)return;console['error']('\x0a'+a34_0x270838[_0x4697a0(0x207)](_0x4697a0(0x351)));for(const _0x286cff of _0x132107[_0x4697a0(0x168)]){const _0x2993fd=_0x286cff[_0x4697a0(0x1ee)]?a34_0x270838[_0x4697a0(0x19d)]('✔'):a34_0x270838[_0x4697a0(0x1e0)]('✘');let _0x4bbc37='';if(_0x286cff[_0x4697a0(0x1ee)]&&_0x286cff[_0x4697a0(0x2bf)]!==undefined&&_0x286cff[_0x4697a0(0x240)]!==undefined){const _0x29f15e=_0x286cff[_0x4697a0(0x240)][_0x4697a0(0x35a)](0x1),_0x4f1a4f=_0x286cff[_0x4697a0(0x240)]>=0x50?a34_0x270838[_0x4697a0(0x19d)]:_0x286cff['coveragePercent']>=0x32?a34_0x270838[_0x4697a0(0x194)]:a34_0x270838[_0x4697a0(0x1e0)];_0x4bbc37='\x20'+a34_0x270838['dim'](_0x4697a0(0x1bb))+'\x20'+_0x4f1a4f(_0x29f15e+'%')+'\x20('+formatRows(_0x286cff[_0x4697a0(0x2bf)])+_0x4697a0(0x33c);}console[_0x4697a0(0x1a0)](_0x2993fd+'\x20'+a34_0x270838[_0x4697a0(0x2f1)](_0x286cff[_0x4697a0(0x2f9)])+_0x4bbc37),console[_0x4697a0(0x1a0)]('\x20\x20'+a34_0x270838[_0x4697a0(0x207)](_0x4697a0(0x26a))+'\x20'+a34_0x270838['bold'](_0x286cff[_0x4697a0(0x2bc)]+'.'+_0x286cff['table']));const _0x6c6cf7=_0x286cff[_0x4697a0(0x22c)]===_0x286cff[_0x4697a0(0x2ee)]?a34_0x270838[_0x4697a0(0x207)]('Join\x20on:')+'\x20'+_0x286cff[_0x4697a0(0x22c)]:a34_0x270838[_0x4697a0(0x207)]('Join:')+'\x20'+_0x286cff[_0x4697a0(0x22c)]+_0x4697a0(0x296)+_0x286cff[_0x4697a0(0x2ee)];console[_0x4697a0(0x1a0)]('\x20\x20'+_0x6c6cf7),console['error']('\x20\x20'+a34_0x270838['dim'](_0x4697a0(0x23d))),this[_0x4697a0(0x1e7)](_0x286cff[_0x4697a0(0x325)]),!_0x286cff['schemaValid']&&console[_0x4697a0(0x1a0)]('\x20\x20'+a34_0x270838[_0x4697a0(0x1e0)](_0x4697a0(0x290))+'\x20'+_0x286cff['schemaError']);}}[a34_0x43d0d4(0x2f3)](_0x42f0b3,_0x45ec73){const _0x5d663e=a34_0x43d0d4;if(_0x42f0b3[_0x5d663e(0x2d6)][_0x5d663e(0x2c7)]===0x0)return;console['error']('\x0a'+a34_0x270838[_0x5d663e(0x207)]('Behaviors')+'\x20'+a34_0x270838[_0x5d663e(0x207)]('('+_0x45ec73+')'));for(const _0x533e3f of _0x42f0b3[_0x5d663e(0x2d6)]){const _0x49cf21=_0x533e3f[_0x5d663e(0x1ee)]?a34_0x270838[_0x5d663e(0x19d)]('✔'):a34_0x270838[_0x5d663e(0x1e0)]('✘');let _0x28b8ec='';if(_0x533e3f[_0x5d663e(0x1ee)]&&_0x533e3f[_0x5d663e(0x305)]!==undefined&&_0x533e3f['totalEvents']!==undefined){const _0x33172f=_0x533e3f[_0x5d663e(0x28d)]?.[_0x5d663e(0x35a)](0x1)||'?',_0x4989b8=(_0x533e3f[_0x5d663e(0x28d)]??0x0)>=0x32?a34_0x270838['green']:(_0x533e3f[_0x5d663e(0x28d)]??0x0)>=0x14?a34_0x270838[_0x5d663e(0x194)]:a34_0x270838[_0x5d663e(0x1e0)];_0x28b8ec='\x20'+a34_0x270838[_0x5d663e(0x207)]('Customers:')+'\x20'+_0x4989b8(formatRows(_0x533e3f[_0x5d663e(0x305)]))+'\x20('+_0x33172f+'%)\x20'+a34_0x270838[_0x5d663e(0x207)](_0x5d663e(0x2b6))+'\x20'+a34_0x270838[_0x5d663e(0x32c)](formatRows(_0x533e3f[_0x5d663e(0x212)]));}console[_0x5d663e(0x1a0)](_0x49cf21+'\x20'+a34_0x270838[_0x5d663e(0x2f1)](_0x533e3f[_0x5d663e(0x2f9)])+_0x28b8ec),console['error']('\x20\x20'+a34_0x270838[_0x5d663e(0x207)]('Source:')+'\x20'+a34_0x270838['bold'](_0x533e3f['database']+'.'+_0x533e3f['table']));const _0x5f0fc1=_0x533e3f[_0x5d663e(0x22c)]===_0x533e3f['foreignKey']?a34_0x270838[_0x5d663e(0x207)](_0x5d663e(0x2ac))+'\x20'+_0x533e3f[_0x5d663e(0x22c)]:a34_0x270838[_0x5d663e(0x207)](_0x5d663e(0x35b))+'\x20'+_0x533e3f[_0x5d663e(0x22c)]+'\x20=\x20'+_0x533e3f[_0x5d663e(0x2ee)];console['error']('\x20\x20'+_0x5f0fc1),console[_0x5d663e(0x1a0)]('\x20\x20'+a34_0x270838['dim'](_0x5d663e(0x23d))),this[_0x5d663e(0x1e7)](_0x533e3f[_0x5d663e(0x325)]),!_0x533e3f[_0x5d663e(0x1ee)]&&console[_0x5d663e(0x1a0)]('\x20\x20'+a34_0x270838[_0x5d663e(0x1e0)](_0x5d663e(0x290))+'\x20'+_0x533e3f[_0x5d663e(0x195)]);}}[a34_0x43d0d4(0x1e7)](_0x25cc5c){const _0x25755b=a34_0x43d0d4;for(const _0x48ffb8 of _0x25cc5c){_0x48ffb8[_0x25755b(0x244)]===_0x48ffb8[_0x25755b(0x16d)]||_0x48ffb8['column']==='*'?console[_0x25755b(0x1a0)]('\x20\x20\x20\x20-\x20'+_0x48ffb8['label']):console['error'](_0x25755b(0x2c5)+_0x48ffb8[_0x25755b(0x244)]+'\x20'+a34_0x270838['dim']('('+_0x48ffb8[_0x25755b(0x16d)]+')'));}}[a34_0x43d0d4(0x275)](_0x32052f){const _0x3dad5f=a34_0x43d0d4;console[_0x3dad5f(0x1a0)]('─'[_0x3dad5f(0x1e1)](0x3c));if(_0x32052f[_0x3dad5f(0x1d8)]['length']>0x0){console[_0x3dad5f(0x1a0)]('\x0a'+a34_0x270838['red']('Errors:'));for(const _0x4ea371 of _0x32052f[_0x3dad5f(0x1d8)]){console[_0x3dad5f(0x1a0)]('\x20\x20'+a34_0x270838[_0x3dad5f(0x1e0)]('•')+'\x20'+_0x4ea371);}}_0x32052f['allValid']&&console['error']('\x0a'+a34_0x270838[_0x3dad5f(0x19d)]('✔')+_0x3dad5f(0x19b));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a34_0x43d0d4(0x2f9)]=a34_0x43d0d4(0x2f8);[a34_0x43d0d4(0x241)]=a34_0x43d0d4(0x1e6);async['execute'](_0x57a233){const _0x1a448b=a34_0x43d0d4,{options:_0x3a9af8,args:_0x30077d,tdx:_0x43ee06}=_0x57a233,_0x449004=_0x3a9af8,_0x4f5878=_0x30077d[0x0]||_0x3a9af8[_0x1a448b(0x201)];if(!_0x4f5878)return showParentSegmentNotSetError(_0x1a448b(0x198)+_0x1a448b(0x2fa)+_0x1a448b(0x2a5)+_0x1a448b(0x1bc)+_0x1a448b(0x34e)+'\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a'+'\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a'+'\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)'),0x1;if(!_0x449004[_0x1a448b(0x1b2)]&&!_0x449004[_0x1a448b(0x2fc)]&&!_0x449004['behavior']&&!_0x449004[_0x1a448b(0x17f)])return console['error'](a34_0x270838['red'](_0x1a448b(0x225))),console[_0x1a448b(0x1a0)](_0x1a448b(0x231)),console[_0x1a448b(0x1a0)](_0x1a448b(0x237)),console[_0x1a448b(0x1a0)]('\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data'),console[_0x1a448b(0x1a0)](_0x1a448b(0x161)),console[_0x1a448b(0x1a0)](_0x1a448b(0x20b)),console['error'](_0x1a448b(0x336)),0x1;const _0x515324=resolveYamlFile(_0x4f5878);if(!existsSync(_0x515324))return showFileNotFoundError(_0x515324,_0x4f5878),0x1;_0x449004['verbose']&&(console[_0x1a448b(0x1a0)](_0x1a448b(0x328)+_0x449004[_0x1a448b(0x213)]),console[_0x1a448b(0x1a0)](_0x1a448b(0x166)+_0x515324));let _0x4c0bba;try{_0x4c0bba=readFileSync(_0x515324,_0x1a448b(0x315));}catch(_0x5b7abd){const _0x524a43=_0x5b7abd instanceof Error?_0x5b7abd[_0x1a448b(0x1ea)]:String(_0x5b7abd);return console[_0x1a448b(0x1a0)](_0x1a448b(0x14e)+_0x524a43),0x1;}let _0xedd341;try{_0xedd341=parseDef(_0x4c0bba);}catch(_0x58dc58){const _0x3275fe=_0x58dc58 instanceof Error?_0x58dc58[_0x1a448b(0x1ea)]:String(_0x58dc58);return console[_0x1a448b(0x1a0)](a34_0x270838[_0x1a448b(0x1e0)](_0x1a448b(0x15c)+_0x3275fe)),0x1;}if(_0x449004[_0x1a448b(0x2fc)]===!![]||_0x449004['attribute']===''){const _0x421ddc=_0xedd341['attributes']?.[_0x1a448b(0x160)](_0x1323d6=>_0x1323d6['name'])||[];if(_0x421ddc[_0x1a448b(0x2c7)]===0x0)console['error'](a34_0x270838[_0x1a448b(0x1e0)](_0x1a448b(0x2ce)));else{console[_0x1a448b(0x1a0)](a34_0x270838[_0x1a448b(0x1e0)](_0x1a448b(0x2d5))),console[_0x1a448b(0x1a0)]('Available\x20attributes:');for(const _0x1dd793 of _0x421ddc){console[_0x1a448b(0x1a0)]('\x20\x20'+a34_0x270838[_0x1a448b(0x32c)](_0x1dd793));}console['error'](_0x1a448b(0x17b)+_0x4f5878+_0x1a448b(0x150)+_0x421ddc[0x0]+'\x22');}return 0x1;}if(_0x449004[_0x1a448b(0x316)]===!![]||_0x449004['behavior']===''){const _0x252699=_0xedd341[_0x1a448b(0x2d6)]?.['map'](_0x1c1078=>_0x1c1078[_0x1a448b(0x2f9)])||[];if(_0x252699[_0x1a448b(0x2c7)]===0x0)console['error'](a34_0x270838[_0x1a448b(0x1e0)](_0x1a448b(0x1d7)));else{console[_0x1a448b(0x1a0)](a34_0x270838['red'](_0x1a448b(0x1df))),console['error'](_0x1a448b(0x1c6));for(const _0x3c1d87 of _0x252699){console['error']('\x20\x20'+a34_0x270838[_0x1a448b(0x32c)](_0x3c1d87));}console['error'](_0x1a448b(0x17b)+_0x4f5878+_0x1a448b(0x16a)+_0x252699[0x0]+'\x22');}return 0x1;}const _0x4657e6=createCommandSpinner(a34_0x270838[_0x1a448b(0x207)]('Fetching\x20sample\x20data...'),{'verbose':_0x449004['verbose']});_0x4657e6[_0x1a448b(0x262)]();const _0x2a3c04={'onProgress':_0x1a0302=>{const _0x1dc96d=_0x1a448b;_0x4657e6[_0x1dc96d(0x24f)]=formatProgressMessage(_0x1a0302);}};if(_0x449004[_0x1a448b(0x1b2)])_0x2a3c04['master']=!![];if(_0x449004['attribute']&&typeof _0x449004[_0x1a448b(0x2fc)]===_0x1a448b(0x33a))_0x2a3c04[_0x1a448b(0x2fc)]=_0x449004[_0x1a448b(0x2fc)];if(_0x449004[_0x1a448b(0x316)]&&typeof _0x449004[_0x1a448b(0x316)]==='string')_0x2a3c04[_0x1a448b(0x316)]=_0x449004[_0x1a448b(0x316)];if(_0x449004['enriched'])_0x2a3c04[_0x1a448b(0x17f)]=!![];if(_0x449004[_0x1a448b(0x1c0)])_0x2a3c04[_0x1a448b(0x1c0)]=_0x449004['interval'];let _0x550abc;try{_0x550abc=await _0x43ee06['segment'][_0x1a448b(0x1e2)](_0x4c0bba,_0x2a3c04),_0x4657e6['stop']();}catch(_0x3da8b4){_0x4657e6[_0x1a448b(0x21b)]();throw _0x3da8b4;}return await this['displayPreviewResults'](_0x550abc,{'master':_0x449004[_0x1a448b(0x1b2)],'attribute':typeof _0x449004[_0x1a448b(0x2fc)]===_0x1a448b(0x33a)?_0x449004[_0x1a448b(0x2fc)]:undefined,'behavior':typeof _0x449004[_0x1a448b(0x316)]===_0x1a448b(0x33a)?_0x449004[_0x1a448b(0x316)]:undefined,'enriched':_0x449004[_0x1a448b(0x17f)]}),_0x550abc[_0x1a448b(0x152)]?0x0:0x1;}async[a34_0x43d0d4(0x1c1)](_0x226aad,_0x170311){const _0x3d9168=a34_0x43d0d4;console[_0x3d9168(0x1a0)]('\x0a'+a34_0x270838[_0x3d9168(0x2f1)](_0x3d9168(0x2f7))+'\x20'+_0x226aad[_0x3d9168(0x2f9)]),console[_0x3d9168(0x1a0)]('═'['repeat'](0x3c));if(_0x170311['master']&&_0x226aad['sampleData']){const _0x925a21=a34_0x270838['dim'](_0x3d9168(0x151))+'\x20'+a34_0x270838[_0x3d9168(0x2f1)](_0x226aad[_0x3d9168(0x1b2)][_0x3d9168(0x2bc)]+'.'+_0x226aad['master'][_0x3d9168(0x230)]);await this[_0x3d9168(0x1fa)](_0x925a21,_0x226aad[_0x3d9168(0x1ec)]);}else{if(_0x170311[_0x3d9168(0x2fc)]&&_0x226aad['sampleData']){const _0x2cccf2=a34_0x270838[_0x3d9168(0x207)](_0x3d9168(0x1f2))+'\x20'+a34_0x270838[_0x3d9168(0x2f1)](_0x170311[_0x3d9168(0x2fc)]);await this[_0x3d9168(0x1fa)](_0x2cccf2,_0x226aad[_0x3d9168(0x1ec)]);}else{if(_0x170311['behavior']&&_0x226aad[_0x3d9168(0x1ec)]){const _0x55dfda=a34_0x270838['dim'](_0x3d9168(0x349))+'\x20'+a34_0x270838[_0x3d9168(0x2f1)](_0x170311[_0x3d9168(0x316)]);await this[_0x3d9168(0x1fa)](_0x55dfda,_0x226aad[_0x3d9168(0x1ec)]);}else{if(_0x170311['enriched']&&_0x226aad['sampleData']){const _0x1bf660=a34_0x270838['dim'](_0x3d9168(0x219))+'\x20'+a34_0x270838[_0x3d9168(0x2f1)](_0x3d9168(0x239));await this[_0x3d9168(0x1fa)](_0x1bf660,_0x226aad['sampleData']);}else!_0x226aad[_0x3d9168(0x1ec)]&&console[_0x3d9168(0x1a0)](_0x3d9168(0x2c0));}}}if(_0x226aad[_0x3d9168(0x1d8)][_0x3d9168(0x2c7)]>0x0){console[_0x3d9168(0x1a0)]('─'[_0x3d9168(0x1e1)](0x3c)),console[_0x3d9168(0x1a0)]('\x0a'+a34_0x270838[_0x3d9168(0x1e0)]('Errors:'));for(const _0x2137de of _0x226aad[_0x3d9168(0x1d8)]){console[_0x3d9168(0x1a0)]('\x20\x20'+a34_0x270838['red']('•')+'\x20'+_0x2137de);}}}async[a34_0x43d0d4(0x1fa)](_0x1e7eb1,_0x528bf5){const _0x53b533=a34_0x43d0d4;if(_0x528bf5[_0x53b533(0x2c7)]===0x0){console['error']('\x0a'+_0x1e7eb1),console[_0x53b533(0x1a0)]('\x20\x20No\x20sample\x20data\x20available');return;}console[_0x53b533(0x1a0)]('\x0a'+_0x1e7eb1);const _0x337bf4=Object['keys'](_0x528bf5[0x0])[_0x53b533(0x160)](_0x5d739e=>({'name':_0x5d739e,'type':typeof _0x528bf5[0x0][_0x5d739e]===_0x53b533(0x1d0)?_0x53b533(0x255):_0x53b533(0x200)})),_0x3d812b={'queryId':_0x53b533(0x337),'columns':_0x337bf4,'data':_0x528bf5,'stats':{'state':_0x53b533(0x203),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x528bf5[_0x53b533(0x2c7)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x2020da=formatAsTable(_0x3d812b,_0x528bf5[_0x53b533(0x2c7)],!![]);await writeOutput(_0x2020da,undefined,_0x53b533(0x230));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a34_0x43d0d4(0x2f9)]='segment:parent:run';[a34_0x43d0d4(0x241)]=a34_0x43d0d4(0x2b8);async[a34_0x43d0d4(0x331)](_0x21b1f5){const _0x51e1bb=a34_0x43d0d4,{options:_0x29e8cd,args:_0x45e968,tdx:_0x500e50}=_0x21b1f5,_0x44942f=_0x29e8cd,_0x163b79=_0x45e968[0x0]||_0x29e8cd['parentSegment'];if(!_0x163b79)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment'),0x1;const _0x574436=resolveYamlFile(_0x163b79);if(existsSync(_0x574436)){_0x44942f[_0x51e1bb(0x235)]&&console[_0x51e1bb(0x1a0)]('Found\x20YAML\x20file:\x20'+_0x574436);let _0x448695;try{_0x448695=readFileSync(_0x574436,_0x51e1bb(0x315));}catch(_0x271188){const _0x5b223e=_0x271188 instanceof Error?_0x271188[_0x51e1bb(0x1ea)]:String(_0x271188);return console[_0x51e1bb(0x1a0)](_0x51e1bb(0x14e)+_0x5b223e),0x1;}const _0x4c6fce=await withSpinner(_0x51e1bb(0x27e),()=>_0x500e50[_0x51e1bb(0x347)][_0x51e1bb(0x269)](_0x448695),{'verbose':_0x44942f[_0x51e1bb(0x235)]}),_0x59a497=_0x4c6fce[_0x51e1bb(0x369)],{isNew:_0x57c488,name:_0x135ea3,hasChanges:_0x4b9797,diffFormatted:_0x134aea}=_0x59a497;if(_0x4b9797){_0x57c488?console[_0x51e1bb(0x1a0)](_0x51e1bb(0x2d7)+_0x135ea3+'\x27:'):console[_0x51e1bb(0x1a0)]('\x0aChanges\x20to\x20apply\x20to\x20\x27'+_0x135ea3+'\x27:');console[_0x51e1bb(0x1a0)]('─'[_0x51e1bb(0x1e1)](0x3c)),console['error'](_0x134aea),console[_0x51e1bb(0x1a0)]('─'[_0x51e1bb(0x1e1)](0x3c));const _0x428b7f=_0x57c488?_0x51e1bb(0x282)+_0x135ea3+_0x51e1bb(0x2db):_0x51e1bb(0x335)+_0x135ea3+_0x51e1bb(0x2db);if(!_0x44942f[_0x51e1bb(0x1b5)]){if(!isInteractive())return console[_0x51e1bb(0x1a0)](a34_0x270838[_0x51e1bb(0x1e0)](_0x51e1bb(0x286)),_0x51e1bb(0x2d8)),console['error'](a34_0x270838[_0x51e1bb(0x207)](_0x51e1bb(0x1b1))),0x1;const _0x5f1edc=await confirmKey(_0x428b7f);if(!_0x5f1edc)return console['error'](a34_0x270838[_0x51e1bb(0x194)](_0x51e1bb(0x2cf))),0x1;}const _0x140857=_0x57c488?_0x51e1bb(0x1b7):'Updating';await withSpinner(_0x140857+_0x51e1bb(0x1ae)+_0x135ea3+'\x27...',()=>_0x59a497[_0x51e1bb(0x27f)](),{'verbose':_0x44942f[_0x51e1bb(0x235)]});const _0x28627a=_0x57c488?'Created':_0x51e1bb(0x222);console[_0x51e1bb(0x1a0)]('✔\x20'+_0x28627a+'\x20parent\x20segment\x20\x27'+_0x135ea3+'\x27');}else console[_0x51e1bb(0x1a0)]('✔\x20No\x20changes\x20-\x20\x27'+_0x135ea3+'\x27\x20is\x20up\x20to\x20date');}const _0x8730df=await withSpinner(_0x51e1bb(0x281)+_0x163b79+_0x51e1bb(0x1f6),()=>_0x500e50[_0x51e1bb(0x347)][_0x51e1bb(0x2e5)](_0x163b79),{'verbose':_0x44942f[_0x51e1bb(0x235)]}),_0x45dfb8=_0x8730df[_0x51e1bb(0x369)],_0x596d8f=getConsoleUrl(_0x44942f[_0x51e1bb(0x213)],_0x51e1bb(0x172)+_0x45dfb8[_0x51e1bb(0x26d)]+_0x51e1bb(0x1ef)+_0x45dfb8[_0x51e1bb(0x28f)]+'/attempt/'+_0x45dfb8['workflowAttemptId']);return console['error'](_0x51e1bb(0x223)),console[_0x51e1bb(0x1a0)]('\x20\x20'+a34_0x270838[_0x51e1bb(0x207)](_0x51e1bb(0x34f))+'\x20'+_0x45dfb8[_0x51e1bb(0x251)]),console[_0x51e1bb(0x1a0)]('\x20\x20'+a34_0x270838[_0x51e1bb(0x207)](_0x51e1bb(0x22f))+'\x20'+_0x45dfb8[_0x51e1bb(0x29e)]),console[_0x51e1bb(0x1a0)]('\x20\x20'+a34_0x270838[_0x51e1bb(0x207)](_0x51e1bb(0x34d))+'\x20'+_0x45dfb8[_0x51e1bb(0x28f)]),console[_0x51e1bb(0x1a0)]('\x20\x20'+a34_0x270838[_0x51e1bb(0x207)](_0x51e1bb(0x25f))+'\x20'+_0x45dfb8['workflowAttemptId']),console[_0x51e1bb(0x1a0)]('\x20\x20'+_0x596d8f),console['error']('\x0a'+a34_0x270838[_0x51e1bb(0x207)](_0x51e1bb(0x17c))+_0x51e1bb(0x21f)+_0x45dfb8[_0x51e1bb(0x233)]+_0x51e1bb(0x1d3)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a34_0x43d0d4(0x2f9)]=a34_0x43d0d4(0x155);['description']=a34_0x43d0d4(0x298);async[a34_0x43d0d4(0x331)](_0x1184cb){const _0x2a09eb=a34_0x43d0d4,{options:_0x3dedd7,args:_0x5ed8be,tdx:_0x1214ce}=_0x1184cb,_0xddd543=_0x5ed8be[0x0]||_0x3dedd7[_0x2a09eb(0x201)];if(!_0xddd543)return showParentSegmentNotSetError(_0x2a09eb(0x196)+_0x2a09eb(0x2a8)),0x1;_0x3dedd7['verbose']&&(console[_0x2a09eb(0x1a0)](_0x2a09eb(0x328)+_0x3dedd7[_0x2a09eb(0x213)]),console[_0x2a09eb(0x1a0)](_0x2a09eb(0x191)+_0xddd543));const _0x1ef02e=await withSpinner(_0x2a09eb(0x2be)+_0xddd543+_0x2a09eb(0x1f6),()=>_0x1214ce[_0x2a09eb(0x347)]['listFields'](_0xddd543),{'verbose':_0x3dedd7[_0x2a09eb(0x235)]}),_0x3815a3=_0x1ef02e[_0x2a09eb(0x369)];console[_0x2a09eb(0x1a0)]('✔\x20Found\x20'+_0x3815a3[_0x2a09eb(0x2c7)]+_0x2a09eb(0x318)+(_0x3815a3[_0x2a09eb(0x2c7)]!==0x1?'s':''));if(_0x3dedd7['json']||_0x3dedd7[_0x2a09eb(0x22b)])return await handleSDKOutput(_0x3815a3,_0x3dedd7),0x0;return displayFieldsHumanReadable(_0x3815a3,_0xddd543),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a34_0x43d0d4(0x2f9)]=a34_0x43d0d4(0x18a);[a34_0x43d0d4(0x241)]=a34_0x43d0d4(0x1c3);async[a34_0x43d0d4(0x331)](_0x5b3637){const _0x20470a=a34_0x43d0d4,{options:_0x148300,args:_0x404f50,tdx:_0x2800de}=_0x5b3637,_0x5828fc=_0x148300,_0x3d4fe1=_0x404f50[0x0]||_0x148300[_0x20470a(0x201)];if(!_0x3d4fe1)return showParentSegmentNotSetError(_0x20470a(0x15a)+_0x20470a(0x272)+_0x20470a(0x1a4)+_0x20470a(0x2f5)),0x1;_0x148300[_0x20470a(0x235)]&&(console['error'](_0x20470a(0x328)+_0x148300['site']),console[_0x20470a(0x1a0)](_0x20470a(0x191)+_0x3d4fe1));const _0x4fedd2=await withSpinner(_0x20470a(0x36a)+_0x3d4fe1+_0x20470a(0x1f6),()=>_0x2800de[_0x20470a(0x347)][_0x20470a(0x2f0)](_0x3d4fe1),{'verbose':_0x148300['verbose']}),_0x5c04ae=_0x4fedd2[_0x20470a(0x369)];if(_0x5828fc[_0x20470a(0x1e9)]){const _0xa6625c=getConsoleNextUrl(_0x5828fc[_0x20470a(0x213)],_0x20470a(0x23a)+_0x5c04ae['id']);return console['error'](a34_0x270838[_0x20470a(0x19d)]('✔')+_0x20470a(0x31d)+a34_0x270838['cyan'](_0xa6625c)),openBrowser(_0xa6625c),0x0;}return await handleSingleObjectOutput(_0x5c04ae,_0x148300),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a34_0x43d0d4(0x2f9)]='segment:parent:desc';['description']='Show\x20parent\x20segment\x20schema\x20(column\x20types)';async[a34_0x43d0d4(0x331)](_0x1058ff){const _0x18e690=a34_0x43d0d4,{options:_0x5a4775,args:_0x269243,tdx:_0x439e90}=_0x1058ff,_0x492565=_0x5a4775,_0x39e6bd=_0x269243[0x0]||_0x5a4775['parentSegment'];if(!_0x39e6bd)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'+_0x18e690(0x189)+_0x18e690(0x1a4)+'\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path'),0x1;_0x5a4775[_0x18e690(0x235)]&&(console[_0x18e690(0x1a0)](_0x18e690(0x328)+_0x5a4775[_0x18e690(0x213)]),console['error'](_0x18e690(0x191)+_0x39e6bd));const _0x55f9ff=await withSpinner(_0x18e690(0x175)+_0x39e6bd+_0x18e690(0x1f6),()=>_0x439e90[_0x18e690(0x347)][_0x18e690(0x297)](_0x39e6bd),{'verbose':_0x5a4775[_0x18e690(0x235)]}),_0x42ba6a=_0x55f9ff[_0x18e690(0x369)],_0x24870d=_0x439e90[_0x18e690(0x347)][_0x18e690(0x1da)](_0x42ba6a);if(_0x492565['output']){const _0xbbf54e=await this[_0x18e690(0x29a)](_0x1058ff,_0x39e6bd,_0x42ba6a,_0x24870d),_0x389aed=this[_0x18e690(0x260)](_0xbbf54e);writeFileSync(_0x492565[_0x18e690(0x1ac)],_0x389aed);const _0x421954=_0xbbf54e[_0x18e690(0x14f)][_0x18e690(0x325)]['length']+_0xbbf54e[_0x18e690(0x2d6)][_0x18e690(0x332)]((_0x16d8d4,_0x46a785)=>_0x16d8d4+_0x46a785['columns'][_0x18e690(0x2c7)],0x0),_0x504b14=_0xbbf54e[_0x18e690(0x2d6)][_0x18e690(0x14b)](_0x434d91=>_0x434d91[_0x18e690(0x325)]['length']===0x0)[_0x18e690(0x2c7)];return console[_0x18e690(0x167)](_0x18e690(0x2b7)+_0x492565[_0x18e690(0x1ac)]),console[_0x18e690(0x167)]('\x20\x20Database:\x20'+_0x24870d),console[_0x18e690(0x167)](_0x18e690(0x268)+_0xbbf54e[_0x18e690(0x2d6)][_0x18e690(0x2c7)]+'\x20behaviors'),console[_0x18e690(0x167)](_0x18e690(0x1f7)+_0x421954+_0x18e690(0x21d)),_0x504b14>0x0&&console[_0x18e690(0x167)]('\x20\x20Note:\x20'+_0x504b14+_0x18e690(0x31b)),0x0;}console[_0x18e690(0x1a0)]('\x0a'+a34_0x270838[_0x18e690(0x2f1)](_0x18e690(0x185))+'\x20'+a34_0x270838[_0x18e690(0x32c)](_0x24870d));const _0xb808fe=await withSpinner(_0x18e690(0x1d9),()=>_0x439e90['segment'][_0x18e690(0x15b)](_0x42ba6a),{'verbose':_0x5a4775['verbose']});console[_0x18e690(0x1a0)]('\x0a'+a34_0x270838['bold']('customers')+'\x20'+a34_0x270838[_0x18e690(0x207)]('('+_0x24870d+_0x18e690(0x21c)));const _0x597580=await executeSchemaQuery(_0xb808fe['data'],_0x439e90,_0x5a4775);await handleQueryOutput(_0x597580,_0x5a4775);const _0x3c1ee8=await withSpinner('Fetching\x20behavior\x20list...',()=>_0x439e90[_0x18e690(0x347)][_0x18e690(0x1f3)](_0x42ba6a),{'verbose':_0x5a4775[_0x18e690(0x235)]});for(const _0x2c10b4 of _0x3c1ee8[_0x18e690(0x369)]){const _0x23970b=_0x18e690(0x1cf)+_0x2c10b4[_0x18e690(0x264)]()['replace'](/\s+/g,'_'),_0x2fdf46=_0x18e690(0x267)+_0x24870d+'.'+_0x23970b;console[_0x18e690(0x1a0)]('\x0a'+a34_0x270838[_0x18e690(0x2f1)](_0x2c10b4)+'\x20'+a34_0x270838['dim']('('+_0x24870d+'.'+_0x23970b+')'));try{const _0x12a43f=await executeSchemaQuery(_0x2fdf46,_0x439e90,_0x5a4775);await handleQueryOutput(_0x12a43f,_0x5a4775);}catch{console[_0x18e690(0x1a0)](a34_0x270838[_0x18e690(0x194)](_0x18e690(0x182)));}}return 0x0;}async['collectSchema'](_0x3ea3b5,_0xc8ac6d,_0x17315e,_0x145e02){const _0x57fe15=a34_0x43d0d4,{options:_0x39f5e8,tdx:_0x121021}=_0x3ea3b5,_0x4be6e0=await withSpinner('Fetching\x20customers\x20schema...',()=>_0x121021[_0x57fe15(0x347)]['getParentSQL'](_0x17315e),{'verbose':_0x39f5e8[_0x57fe15(0x235)]}),_0x2f2e78=await executeSchemaQuery(_0x4be6e0[_0x57fe15(0x369)],_0x121021,_0x39f5e8),_0x520c2d=_0x2f2e78[_0x57fe15(0x369)][_0x57fe15(0x160)](_0x4f128d=>({'name':_0x4f128d[_0x57fe15(0x362)],'type':_0x4f128d[_0x57fe15(0x341)]})),_0x1c2028=await withSpinner(_0x57fe15(0x356),()=>_0x121021[_0x57fe15(0x347)][_0x57fe15(0x1f3)](_0x17315e),{'verbose':_0x39f5e8[_0x57fe15(0x235)]}),_0x4d0a0a=[];for(const _0x2a019d of _0x1c2028[_0x57fe15(0x369)]){const _0x1fdfac=_0x57fe15(0x1cf)+_0x2a019d[_0x57fe15(0x264)]()[_0x57fe15(0x238)](/\s+/g,'_'),_0x476d26='SELECT\x20*\x20FROM\x20'+_0x145e02+'.'+_0x1fdfac;let _0x15d1d1=[];try{const _0xf2c2de=await executeSchemaQuery(_0x476d26,_0x121021,_0x39f5e8);_0x15d1d1=_0xf2c2de[_0x57fe15(0x369)][_0x57fe15(0x160)](_0x56c94d=>({'name':_0x56c94d[_0x57fe15(0x362)],'type':_0x56c94d[_0x57fe15(0x341)]}));}catch{}_0x4d0a0a['push']({'table':_0x1fdfac,'columns':_0x15d1d1});}return{'database':_0x145e02,'parent_segment':_0xc8ac6d,'parent_id':_0x17315e,'customers':{'table':_0x57fe15(0x14f),'columns':_0x520c2d},'behaviors':_0x4d0a0a};}[a34_0x43d0d4(0x260)](_0x1f3362){const _0x122693=a34_0x43d0d4,_0x3b9f6d=_0x50d34a=>{const _0x4385bc=a34_0x11ee;if(_0x50d34a[_0x4385bc(0x2c7)]===0x0)return'[]';const _0x33887d=_0x50d34a[_0x4385bc(0x160)](_0x2b6911=>_0x4385bc(0x30d)+_0x2b6911[_0x4385bc(0x2f9)]+_0x4385bc(0x323)+_0x2b6911[_0x4385bc(0x1d6)]+_0x4385bc(0x1bf));return'[\x0a'+_0x33887d[_0x4385bc(0x2d4)](',\x0a')+_0x4385bc(0x226);},_0x408957=_0x1f3362[_0x122693(0x2d6)][_0x122693(0x160)](_0x580411=>{const _0x1a0072=_0x122693;return'\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22'+_0x580411['table']+_0x1a0072(0x1c8)+_0x3b9f6d(_0x580411['columns'])['replace'](/^/gm,'\x20\x20')[_0x1a0072(0x1a7)]()+_0x1a0072(0x1c9);})[_0x122693(0x2d4)](',\x0a');return _0x122693(0x1eb)+_0x1f3362[_0x122693(0x2bc)]+_0x122693(0x1e5)+_0x1f3362['parent_segment']+_0x122693(0x2ca)+_0x1f3362[_0x122693(0x15f)]+_0x122693(0x2b3)+_0x1f3362[_0x122693(0x14f)]['table']+_0x122693(0x17a)+_0x3b9f6d(_0x1f3362[_0x122693(0x14f)]['columns'])['replace'](/^/gm,'\x20\x20')['trim']()+_0x122693(0x2ec)+_0x408957+_0x122693(0x177);}}export class ParentSegmentSQLCommand extends BaseCommand{[a34_0x43d0d4(0x2f9)]=a34_0x43d0d4(0x190);[a34_0x43d0d4(0x241)]=a34_0x43d0d4(0x2df);async[a34_0x43d0d4(0x331)](_0x39d583){const _0x386612=a34_0x43d0d4,{options:_0xd30fd0,args:_0x4ceafe,tdx:_0x586482}=_0x39d583,_0x30ad23=_0x4ceafe[0x0]||_0xd30fd0[_0x386612(0x201)];if(!_0x30ad23)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment'),0x1;_0xd30fd0[_0x386612(0x235)]&&(console['error'](_0x386612(0x328)+_0xd30fd0['site']),console[_0x386612(0x1a0)](_0x386612(0x191)+_0x30ad23));const _0x7ade70=await withSpinner(_0x386612(0x175)+_0x30ad23+_0x386612(0x1f6),()=>_0x586482[_0x386612(0x347)][_0x386612(0x297)](_0x30ad23),{'verbose':_0xd30fd0[_0x386612(0x235)]}),_0x2ff0d8=_0x7ade70[_0x386612(0x369)],_0x76aaf4=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x30ad23+_0x386612(0x1f6),()=>_0x586482['segment'][_0x386612(0x15b)](_0x2ff0d8),{'verbose':_0xd30fd0['verbose']}),_0x3ca8a1=_0x76aaf4['data'];return _0xd30fd0[_0x386612(0x1d2)]===_0x386612(0x294)||_0xd30fd0[_0x386612(0x1d2)]===_0x386612(0x22b)?await handleSDKOutput([{'sql':_0x3ca8a1}],_0xd30fd0):console[_0x386612(0x167)](_0x3ca8a1),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{['name']=a34_0x43d0d4(0x26e);['description']=a34_0x43d0d4(0x34b);async[a34_0x43d0d4(0x331)](_0x1e8fa8){const _0x3657d1=a34_0x43d0d4,{options:_0x2f583d,args:_0x4e25c2,tdx:_0x378b59}=_0x1e8fa8,_0x482362=_0x4e25c2[0x0]||_0x2f583d['parentSegment'];if(!_0x482362)return showParentSegmentNotSetError(_0x3657d1(0x1e4)+'\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;_0x2f583d[_0x3657d1(0x235)]&&(console[_0x3657d1(0x1a0)](_0x3657d1(0x328)+_0x2f583d[_0x3657d1(0x213)]),console[_0x3657d1(0x1a0)](_0x3657d1(0x191)+_0x482362));const _0x196dd0=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x482362+_0x3657d1(0x1f6),()=>_0x378b59[_0x3657d1(0x347)][_0x3657d1(0x297)](_0x482362),{'verbose':_0x2f583d[_0x3657d1(0x235)]}),_0x5e1925=_0x196dd0[_0x3657d1(0x369)],_0x142bd7=await withSpinner(_0x3657d1(0x24d)+_0x482362+_0x3657d1(0x1f6),()=>_0x378b59[_0x3657d1(0x347)][_0x3657d1(0x15b)](_0x5e1925),{'verbose':_0x2f583d[_0x3657d1(0x235)]});let _0xd57ef0=_0x142bd7['data'];const _0xc00047=resolveLimit(_0x2f583d['limit'],DEFAULT_DISPLAY_LIMIT),_0x5925e4=/\bLIMIT\s+\d+/i[_0x3657d1(0x2af)](_0xd57ef0);!_0x5925e4&&(_0xd57ef0=_0xd57ef0['trim']()['replace'](/;+$/,''),_0xd57ef0='SELECT\x20*\x20FROM\x20(\x0a'+_0xd57ef0+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0xc00047);_0x2f583d[_0x3657d1(0x235)]&&console[_0x3657d1(0x1a0)](_0x3657d1(0x2c2)+_0xd57ef0);const _0x2911c4=await withProgressSpinner(_0x3657d1(0x301),async _0x412a49=>{const _0x29dcc6=_0x3657d1,_0x248633=await _0x378b59[_0x29dcc6(0x14d)][_0x29dcc6(0x331)](_0xd57ef0,{'catalog':'td','schema':_0x29dcc6(0x280),'onJobId':_0x5a6494=>{const _0x5f0684=_0x29dcc6;_0x412a49[_0x5f0684(0x211)](_0x5a6494);}});return _0x248633;},{'verbose':_0x2f583d['verbose']}),_0x523769=_0x2911c4[_0x3657d1(0x369)],_0x59a844=_0x523769[_0x3657d1(0x365)]?_0x3657d1(0x271)+_0x523769[_0x3657d1(0x365)]+']':'';return console[_0x3657d1(0x1a0)](_0x3657d1(0x329)+_0x523769['stats'][_0x3657d1(0x2c3)][_0x3657d1(0x303)]()+_0x3657d1(0x1de)+(_0x3657d1(0x2f6)+formatElapsed(_0x523769[_0x3657d1(0x224)][_0x3657d1(0x300)])+_0x59a844)),await handleQueryOutput(_0x523769,_0x2f583d),0x0;}}export class PSRtListCommand extends BaseCommand{['name']=a34_0x43d0d4(0x299);[a34_0x43d0d4(0x241)]=a34_0x43d0d4(0x1dd);async['execute'](_0x22194d){const _0x5db1c0=a34_0x43d0d4,{options:_0x55c771,args:_0x350aa4,tdx:_0x41db8f}=_0x22194d,_0x25e4cd=_0x350aa4[0x0],_0x2e01e0=await withSpinner(_0x25e4cd?_0x5db1c0(0x210)+_0x25e4cd+_0x5db1c0(0x1f6):'Listing\x20RT-enabled\x20parent\x20segments...',()=>_0x41db8f['realtime'][_0x5db1c0(0x285)](),{'verbose':_0x55c771[_0x5db1c0(0x235)]});let _0x36eb14=_0x2e01e0['data'][_0x5db1c0(0x14b)](_0x2b09d9=>_0x2b09d9[_0x5db1c0(0x33b)]);if(_0x25e4cd){const _0x214bfd=_0x25e4cd['replace'](/[.+^${}()|[\]\\]/g,_0x5db1c0(0x2e8))[_0x5db1c0(0x238)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x4a4d66=new RegExp('^'+_0x214bfd+'$','i');_0x36eb14=_0x36eb14[_0x5db1c0(0x14b)](_0xe160be=>_0x4a4d66[_0x5db1c0(0x2af)](_0xe160be[_0x5db1c0(0x2f9)]));}_0x36eb14[_0x5db1c0(0x1bd)]((_0x4105bb,_0x314823)=>_0x4105bb[_0x5db1c0(0x2f9)]['localeCompare'](_0x314823[_0x5db1c0(0x2f9)])),console['error'](_0x5db1c0(0x162)+_0x36eb14[_0x5db1c0(0x2c7)]+_0x5db1c0(0x308)+(_0x36eb14['length']!==0x1?'s':''));const _0x2ea136=_0x449d84=>{const _0x14c858=_0x5db1c0;return getConsoleNextUrl(_0x55c771[_0x14c858(0x213)],'/app/dw/parentSegments/'+_0x449d84);};if(_0x55c771[_0x5db1c0(0x1d2)]===_0x5db1c0(0x294)||_0x55c771['format']===_0x5db1c0(0x22b)){const _0x8a27df=_0x36eb14['map'](_0x107aa5=>({..._0x107aa5,'url':_0x2ea136(_0x107aa5['id'])}));await handleSDKOutput(_0x8a27df,_0x55c771);}else{if(_0x36eb14[_0x5db1c0(0x2c7)]===0x0)console[_0x5db1c0(0x167)]('No\x20RT-enabled\x20parent\x20segments\x20found');else for(const _0x157da7 of _0x36eb14){const _0x518673=_0x157da7[_0x5db1c0(0x15e)]?a34_0x270838[_0x5db1c0(0x207)]('\x20('+formatRows(_0x157da7[_0x5db1c0(0x15e)])+')'):'',_0x29c2f2=hyperlink(_0x157da7[_0x5db1c0(0x2f9)],_0x2ea136(_0x157da7['id']));console[_0x5db1c0(0x167)]('⚡\x20'+_0x29c2f2+_0x518673);}}return 0x0;}}export class PSRtValidateCommand extends BaseParentSegmentCommand{[a34_0x43d0d4(0x2f9)]=a34_0x43d0d4(0x31a);['description']='Validate\x20RT\x202.0\x20configuration\x20from\x20parent\x20segment\x20YAML';async[a34_0x43d0d4(0x331)](_0x25a142){const _0x249845=a34_0x43d0d4,{options:_0x497c19,args:_0x1d4cb8,tdx:_0xeac59}=_0x25a142,_0x160de0=_0x1d4cb8[0x0]||_0x497c19[_0x249845(0x201)];if(!_0x160de0)return showParentSegmentNotSetError(_0x249845(0x19f)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20rt\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20RT\x20config\x20for\x20specific\x20parent\x20segment'),0x1;const _0x1aac35=resolveYamlFile(_0x160de0);if(!existsSync(_0x1aac35))return showFileNotFoundError(_0x1aac35,_0x160de0),0x1;let _0x16a60d;try{_0x16a60d=readFileSync(_0x1aac35,_0x249845(0x315));}catch(_0x41051b){const _0x4523e2=_0x41051b instanceof Error?_0x41051b[_0x249845(0x1ea)]:String(_0x41051b);return console['error']('Error\x20reading\x20file:\x20'+_0x4523e2),0x1;}const _0x564b51=createCommandSpinner(a34_0x270838[_0x249845(0x207)](_0x249845(0x1d1)),{'verbose':_0x497c19[_0x249845(0x235)]});_0x564b51[_0x249845(0x262)]();const _0x452a02={'realtime':!![],'onProgress':_0x2f0801=>{const _0x5dd78a=_0x249845;_0x564b51[_0x5dd78a(0x24f)]=formatProgressMessage(_0x2f0801);}};let _0x2b9393;try{_0x2b9393=await _0xeac59[_0x249845(0x347)]['validateParentYaml'](_0x16a60d,_0x452a02),_0x564b51[_0x249845(0x21b)]();}catch(_0x5650dd){_0x564b51[_0x249845(0x21b)]();throw _0x5650dd;}console['error']('\x0a'+a34_0x270838[_0x249845(0x2f1)]('RT\x202.0\x20Validate:')+'\x20'+_0x2b9393[_0x249845(0x2f9)]),console['error']('═'[_0x249845(0x1e1)](0x3c)),displayRealtimeValidation(_0x2b9393),console[_0x249845(0x1a0)]('─'[_0x249845(0x1e1)](0x3c));if(_0x2b9393[_0x249845(0x1d8)][_0x249845(0x2c7)]>0x0){console[_0x249845(0x1a0)]('\x0a'+a34_0x270838['red'](_0x249845(0x2ef)));for(const _0x4e84c3 of _0x2b9393[_0x249845(0x1d8)]){console[_0x249845(0x1a0)]('\x20\x20'+a34_0x270838['red']('•')+'\x20'+_0x4e84c3);}}return _0x2b9393[_0x249845(0x152)]&&console[_0x249845(0x1a0)]('\x0a'+a34_0x270838[_0x249845(0x19d)]('✔')+_0x249845(0x14c)),_0x2b9393[_0x249845(0x152)]?0x0:0x1;}}export class PSRtJnListCommand extends BaseCommand{[a34_0x43d0d4(0x2f9)]=a34_0x43d0d4(0x311);[a34_0x43d0d4(0x241)]='List\x20RT\x20journeys';async[a34_0x43d0d4(0x331)](_0x14dfee){const _0x33c0a3=a34_0x43d0d4,{options:_0x1f007a,args:_0x417330,tdx:_0x2bfeb1}=_0x14dfee,_0x5c2c2f=_0x417330[0x0]||_0x1f007a[_0x33c0a3(0x201)];if(!_0x5c2c2f)return showParentSegmentNotSetError(_0x33c0a3(0x34a)+'\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;_0x1f007a[_0x33c0a3(0x235)]&&(console['error']('Site:\x20'+_0x1f007a['site']),console[_0x33c0a3(0x1a0)](_0x33c0a3(0x191)+_0x5c2c2f));const _0x42b883=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x5c2c2f+_0x33c0a3(0x1f6),()=>_0x2bfeb1[_0x33c0a3(0x347)][_0x33c0a3(0x297)](_0x5c2c2f),{'verbose':_0x1f007a[_0x33c0a3(0x235)]}),_0x87d0ed=_0x42b883[_0x33c0a3(0x369)],_0x42797f=await withSpinner(_0x33c0a3(0x184)+_0x5c2c2f+_0x33c0a3(0x1f6),()=>_0x2bfeb1['realtime']['listJourneys'](_0x87d0ed),{'verbose':_0x1f007a[_0x33c0a3(0x235)]}),_0x6e46de=_0x42797f[_0x33c0a3(0x369)];console[_0x33c0a3(0x1a0)](_0x33c0a3(0x162)+_0x6e46de[_0x33c0a3(0x2c7)]+'\x20RT\x20journey'+(_0x6e46de[_0x33c0a3(0x2c7)]!==0x1?'s':''));if(_0x1f007a['format']==='json'||_0x1f007a[_0x33c0a3(0x1d2)]==='jsonl')await handleSDKOutput(_0x6e46de,_0x1f007a);else{if(_0x6e46de[_0x33c0a3(0x2c7)]===0x0)console[_0x33c0a3(0x167)](_0x33c0a3(0x31f));else for(const _0x5cbdb1 of _0x6e46de){const _0x67da04=_0x5cbdb1[_0x33c0a3(0x1a5)]===_0x33c0a3(0x1c7)?'🚀':'📝',_0x17da6e=_0x5cbdb1['paused']?a34_0x270838[_0x33c0a3(0x194)](_0x33c0a3(0x1cc)):'',_0x23af9e=a34_0x270838['dim']('\x20('+_0x5cbdb1[_0x33c0a3(0x265)]+_0x33c0a3(0x250)+(_0x5cbdb1[_0x33c0a3(0x265)]!==0x1?'s':'')+')');console[_0x33c0a3(0x167)](_0x67da04+'\x20'+_0x5cbdb1['name']+_0x17da6e+_0x23af9e);}}return 0x0;}}export class PSRtJnPauseCommand extends BaseCommand{[a34_0x43d0d4(0x2f9)]=a34_0x43d0d4(0x352);['description']='Pause\x20activations\x20in\x20an\x20RT\x20journey';async['execute'](_0xfb159f){const _0x500784=a34_0x43d0d4,{options:_0x2d043e,args:_0x6e74ea,tdx:_0x447b8a}=_0xfb159f,_0x21bd1e=_0x6e74ea[0x0];if(!_0x21bd1e)return console[_0x500784(0x1a0)](a34_0x270838[_0x500784(0x1e0)](_0x500784(0x18b))),console[_0x500784(0x1a0)](_0x500784(0x1ad)),console[_0x500784(0x1a0)](a34_0x270838[_0x500784(0x207)](_0x500784(0x345))),0x1;_0x2d043e[_0x500784(0x235)]&&(console[_0x500784(0x1a0)](_0x500784(0x328)+_0x2d043e[_0x500784(0x213)]),console[_0x500784(0x1a0)](_0x500784(0x2dd)+_0x21bd1e));const _0x198816=await withSpinner('Pausing\x20activations\x20for\x20RT\x20journey\x20\x27'+_0x21bd1e+'\x27...',()=>_0x447b8a['realtime'][_0x500784(0x2fd)](_0x21bd1e),{'verbose':_0x2d043e[_0x500784(0x235)]}),_0x575dc0=_0x198816['data'];console[_0x500784(0x1a0)](_0x500784(0x274)+_0x575dc0['name']+'\x27');if(_0x2d043e['format']===_0x500784(0x294)||_0x2d043e['format']===_0x500784(0x22b))await handleSDKOutput([_0x575dc0],_0x2d043e);else{const _0x530df2=_0x575dc0['state']===_0x500784(0x1c7)?'🚀':'📝',_0x2a89cb=_0x575dc0[_0x500784(0x307)]?a34_0x270838[_0x500784(0x194)](_0x500784(0x1cc)):'';console[_0x500784(0x167)](_0x530df2+'\x20'+_0x575dc0[_0x500784(0x2f9)]+_0x2a89cb);}return 0x0;}}export class PSRtJnResumeCommand extends BaseCommand{[a34_0x43d0d4(0x2f9)]=a34_0x43d0d4(0x257);['description']=a34_0x43d0d4(0x306);async[a34_0x43d0d4(0x331)](_0x589ace){const _0x1da213=a34_0x43d0d4,{options:_0x9bda2a,args:_0x14aea7,tdx:_0x3988f2}=_0x589ace,_0x6a4391=_0x14aea7[0x0];if(!_0x6a4391)return console[_0x1da213(0x1a0)](a34_0x270838[_0x1da213(0x1e0)]('Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a')),console[_0x1da213(0x1a0)]('Usage:\x20tdx\x20ps\x20rt\x20jn\x20resume_activations\x20<journeyId>\x0a'),console[_0x1da213(0x1a0)](a34_0x270838[_0x1da213(0x207)]('Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs')),0x1;_0x9bda2a[_0x1da213(0x235)]&&(console[_0x1da213(0x1a0)](_0x1da213(0x328)+_0x9bda2a[_0x1da213(0x213)]),console[_0x1da213(0x1a0)](_0x1da213(0x2dd)+_0x6a4391));const _0x3d93d1=await withSpinner('Resuming\x20activations\x20for\x20RT\x20journey\x20\x27'+_0x6a4391+'\x27...',()=>_0x3988f2[_0x1da213(0x291)][_0x1da213(0x214)](_0x6a4391),{'verbose':_0x9bda2a[_0x1da213(0x235)]}),_0x3dc8d4=_0x3d93d1[_0x1da213(0x369)];console[_0x1da213(0x1a0)](_0x1da213(0x154)+_0x3dc8d4[_0x1da213(0x2f9)]+'\x27');if(_0x9bda2a['format']==='json'||_0x9bda2a[_0x1da213(0x1d2)]===_0x1da213(0x22b))await handleSDKOutput([_0x3dc8d4],_0x9bda2a);else{const _0x30045f=_0x3dc8d4[_0x1da213(0x1a5)]===_0x1da213(0x1c7)?'🚀':'📝',_0x22e1d1=_0x3dc8d4['paused']?a34_0x270838[_0x1da213(0x194)](_0x1da213(0x1cc)):'';console[_0x1da213(0x167)](_0x30045f+'\x20'+_0x3dc8d4[_0x1da213(0x2f9)]+_0x22e1d1);}return 0x0;}}export class PSRtConfigVersionCommand extends BaseCommand{[a34_0x43d0d4(0x2f9)]=a34_0x43d0d4(0x26b);['description']=a34_0x43d0d4(0x2e0);async[a34_0x43d0d4(0x331)](_0x2d34c9){const _0x385b10=a34_0x43d0d4,{options:_0x2c8faf,args:_0x27d035,tdx:_0x558cc0}=_0x2d34c9,_0x1ad78b=_0x27d035[0x0]||_0x2c8faf[_0x385b10(0x201)];if(!_0x1ad78b)return showParentSegmentNotSetError(_0x385b10(0x156)+_0x385b10(0x2aa)),0x1;_0x2c8faf[_0x385b10(0x235)]&&(console[_0x385b10(0x1a0)](_0x385b10(0x328)+_0x2c8faf[_0x385b10(0x213)]),console[_0x385b10(0x1a0)](_0x385b10(0x191)+_0x1ad78b));const _0x49df5d=await withSpinner(_0x385b10(0x175)+_0x1ad78b+_0x385b10(0x1f6),()=>_0x558cc0['segment'][_0x385b10(0x297)](_0x1ad78b),{'verbose':_0x2c8faf[_0x385b10(0x235)]}),_0x32a57b=_0x49df5d['data'],_0x7b7692=await withSpinner(_0x385b10(0x1a2)+_0x1ad78b+_0x385b10(0x1f6),()=>_0x558cc0['realtime'][_0x385b10(0x1b0)](_0x32a57b),{'verbose':_0x2c8faf['verbose']}),_0x4779bd=_0x7b7692[_0x385b10(0x369)];return console[_0x385b10(0x1a0)](_0x385b10(0x2b4)),_0x2c8faf[_0x385b10(0x1d2)]===_0x385b10(0x294)||_0x2c8faf[_0x385b10(0x1d2)]===_0x385b10(0x22b)?await handleSDKOutput([_0x4779bd],_0x2c8faf):(console['log'](_0x385b10(0x263)+_0x4779bd['id']),console[_0x385b10(0x167)](_0x385b10(0x1ca)+_0x4779bd[_0x385b10(0x251)]),console[_0x385b10(0x167)]('identifier:\x20'+_0x4779bd[_0x385b10(0x1a6)]),console[_0x385b10(0x167)](_0x385b10(0x171)+_0x4779bd[_0x385b10(0x29f)]),console['log'](_0x385b10(0x355)+_0x4779bd['status'])),0x0;}}export class PSPzServiceListCommand extends BaseCommand{[a34_0x43d0d4(0x2f9)]=a34_0x43d0d4(0x313);[a34_0x43d0d4(0x241)]=a34_0x43d0d4(0x1f4);async[a34_0x43d0d4(0x331)](_0x1c446e){const _0x661f8c=a34_0x43d0d4,{options:_0x948174,args:_0x4b6359,tdx:_0x4cb1d2}=_0x1c446e,_0x41d3a4=_0x4b6359[0x0]||_0x948174[_0x661f8c(0x201)];if(!_0x41d3a4)return showParentSegmentNotSetError(_0x661f8c(0x2e4)+_0x661f8c(0x319)),0x1;const _0x1f0af6=await withSpinner(_0x661f8c(0x175)+_0x41d3a4+_0x661f8c(0x1f6),()=>_0x4cb1d2['segment'][_0x661f8c(0x297)](_0x41d3a4),{'verbose':_0x948174['verbose']}),_0x2f4d7f=_0x1f0af6[_0x661f8c(0x369)],_0x379762=await withSpinner('Listing\x20personalization\x20services\x20for\x20\x27'+_0x41d3a4+'\x27...',()=>_0x4cb1d2[_0x661f8c(0x2c9)][_0x661f8c(0x285)](_0x2f4d7f),{'verbose':_0x948174[_0x661f8c(0x235)]}),_0x5dd87c=_0x379762[_0x661f8c(0x369)];console[_0x661f8c(0x1a0)]('✔\x20Found\x20'+_0x5dd87c[_0x661f8c(0x2c7)]+_0x661f8c(0x1a8)+(_0x5dd87c['length']!==0x1?'s':''));if(_0x948174[_0x661f8c(0x1d2)]===_0x661f8c(0x294)||_0x948174['format']===_0x661f8c(0x22b))await handleSDKOutput(_0x5dd87c,_0x948174);else{if(_0x5dd87c[_0x661f8c(0x2c7)]===0x0)console[_0x661f8c(0x167)]('No\x20personalization\x20services\x20configured'),console['error'](a34_0x270838[_0x661f8c(0x32c)]('\x0aTip:\x20Run\x20`tdx\x20ps\x20pz\x20service\x20init`\x20to\x20add\x20a\x20template\x20personalization\x20section\x20to\x20your\x20YAML'));else for(const _0x24bb7d of _0x5dd87c){console[_0x661f8c(0x167)](a34_0x270838[_0x661f8c(0x2f1)](_0x24bb7d[_0x661f8c(0x2f9)])+'\x20'+a34_0x270838['dim'](_0x661f8c(0x314)+_0x24bb7d['id']+')'));_0x24bb7d['description']&&console[_0x661f8c(0x167)]('\x20\x20'+a34_0x270838[_0x661f8c(0x207)](_0x24bb7d[_0x661f8c(0x241)]));if(_0x24bb7d['tokens']&&_0x24bb7d[_0x661f8c(0x197)][_0x661f8c(0x2c7)]>0x0)for(const _0x2763a9 of _0x24bb7d['tokens']){const _0x4a7ba9=_0x2763a9[_0x661f8c(0x330)]?.[_0x661f8c(0x2c7)]?_0x2763a9[_0x661f8c(0x330)][_0x661f8c(0x2d4)](',\x20'):_0x661f8c(0x20c);console[_0x661f8c(0x167)]('\x20\x20'+a34_0x270838[_0x661f8c(0x32c)](_0x661f8c(0x28c))+'\x20'+_0x2763a9[_0x661f8c(0x2f9)]+'\x20'+a34_0x270838[_0x661f8c(0x207)](_0x661f8c(0x314)+_0x2763a9['id']+')')),console[_0x661f8c(0x167)](_0x661f8c(0x2e9)+a34_0x270838['dim']('allowed\x20IPs:')+'\x20'+_0x4a7ba9);}else console[_0x661f8c(0x167)]('\x20\x20'+a34_0x270838['dim']('no\x20tokens\x20configured'));}}return 0x0;}}export class PSPzServiceCreateCommand extends BaseCommand{[a34_0x43d0d4(0x2f9)]=a34_0x43d0d4(0x1d4);['description']=a34_0x43d0d4(0x23e);async['execute'](_0xaa4ec4){const _0x51ca00=a34_0x43d0d4,{options:_0x496f11,args:_0x10d8e5,tdx:_0x291a91}=_0xaa4ec4,_0x3262cf=_0x496f11,_0x2e3c27=_0x10d8e5[0x0],_0x41b31c=_0x10d8e5[0x1]||_0x496f11['parentSegment'];if(!_0x2e3c27)return console[_0x51ca00(0x1a0)](_0x51ca00(0x2ff)),console['error'](_0x51ca00(0x366)),console['error'](_0x51ca00(0x28a)),0x1;if(!_0x41b31c)return showParentSegmentNotSetError(_0x51ca00(0x2a3)+_0x51ca00(0x28a)),0x1;const _0x56ed43=await withSpinner(_0x51ca00(0x175)+_0x41b31c+_0x51ca00(0x1f6),()=>_0x291a91[_0x51ca00(0x347)][_0x51ca00(0x297)](_0x41b31c),{'verbose':_0x496f11[_0x51ca00(0x235)]}),_0x5402fc=_0x56ed43[_0x51ca00(0x369)],_0x4fdd57={'name':_0x2e3c27,'description':_0x3262cf[_0x51ca00(0x241)],'public':_0x3262cf['public']},_0x513be5=await withSpinner('Creating\x20personalization\x20service\x20\x27'+_0x2e3c27+_0x51ca00(0x1f6),()=>_0x291a91[_0x51ca00(0x2c9)][_0x51ca00(0x2ae)](_0x5402fc,_0x4fdd57),{'verbose':_0x496f11['verbose']}),_0x5d9dc9=_0x513be5[_0x51ca00(0x369)];return console[_0x51ca00(0x1a0)]('✔\x20Created\x20personalization\x20service\x20\x27'+_0x5d9dc9[_0x51ca00(0x2f9)]+_0x51ca00(0x220)+_0x5d9dc9['id']),await handleSDKOutput([_0x5d9dc9],_0x496f11),0x0;}}export class PSPzServiceShowCommand extends BaseCommand{[a34_0x43d0d4(0x2f9)]='ps:pz:service:show';[a34_0x43d0d4(0x241)]=a34_0x43d0d4(0x276);async[a34_0x43d0d4(0x331)](_0x185af4){const _0x3acb26=a34_0x43d0d4,{options:_0x31dc4d,args:_0x31d8ab,tdx:_0x2908c5}=_0x185af4,_0x350a9e=_0x31d8ab[0x0],_0x3a5fdf=_0x31d8ab[0x1]||_0x31dc4d[_0x3acb26(0x201)];if(!_0x350a9e)return console[_0x3acb26(0x1a0)](_0x3acb26(0x1ed)),console[_0x3acb26(0x1a0)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]'),console[_0x3acb26(0x1a0)](_0x3acb26(0x368)),0x1;if(!_0x3a5fdf)return showParentSegmentNotSetError(_0x3acb26(0x340)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;const _0x3be0a2=await withSpinner(_0x3acb26(0x175)+_0x3a5fdf+_0x3acb26(0x1f6),()=>_0x2908c5['segment'][_0x3acb26(0x297)](_0x3a5fdf),{'verbose':_0x31dc4d['verbose']}),_0x56b1b1=_0x3be0a2['data'],_0x22a348=await withSpinner(_0x3acb26(0x2d9)+_0x350a9e+'\x27...',()=>_0x2908c5[_0x3acb26(0x2c9)][_0x3acb26(0x1fe)](_0x56b1b1,_0x350a9e),{'verbose':_0x31dc4d['verbose']}),_0x3e2e2f=_0x22a348[_0x3acb26(0x369)];if(_0x31dc4d[_0x3acb26(0x294)]||_0x31dc4d[_0x3acb26(0x22b)])await handleSDKOutput([_0x3e2e2f],_0x31dc4d);else{console[_0x3acb26(0x167)](a34_0x270838[_0x3acb26(0x2f1)](_0x3e2e2f[_0x3acb26(0x2f9)])+'\x20'+a34_0x270838[_0x3acb26(0x207)](_0x3acb26(0x314)+_0x3e2e2f['id']+')'));_0x3e2e2f[_0x3acb26(0x241)]&&console[_0x3acb26(0x167)]('\x20\x20'+a34_0x270838[_0x3acb26(0x207)](_0x3e2e2f[_0x3acb26(0x241)]));console[_0x3acb26(0x167)]('\x20\x20'+a34_0x270838[_0x3acb26(0x32c)](_0x3acb26(0x2e2))+'\x20'+(_0x3e2e2f[_0x3acb26(0x309)]?'yes':'no'));if(_0x3e2e2f[_0x3acb26(0x197)]&&_0x3e2e2f[_0x3acb26(0x197)]['length']>0x0)for(const _0x1541fc of _0x3e2e2f['tokens']){const _0x4539b1=_0x1541fc['allowedIps']?.['length']?_0x1541fc[_0x3acb26(0x330)][_0x3acb26(0x2d4)](',\x20'):_0x3acb26(0x20c);console['log']('\x20\x20'+a34_0x270838[_0x3acb26(0x32c)](_0x3acb26(0x28c))+'\x20'+_0x1541fc[_0x3acb26(0x2f9)]+'\x20'+a34_0x270838[_0x3acb26(0x207)](_0x3acb26(0x314)+_0x1541fc['id']+')')),console[_0x3acb26(0x167)](_0x3acb26(0x2e9)+a34_0x270838['dim']('allowed\x20IPs:')+'\x20'+_0x4539b1);}else console[_0x3acb26(0x167)]('\x20\x20'+a34_0x270838[_0x3acb26(0x207)](_0x3acb26(0x2c6)));}return 0x0;}}export class PSPzServiceDeleteCommand extends BaseCommand{[a34_0x43d0d4(0x2f9)]=a34_0x43d0d4(0x279);[a34_0x43d0d4(0x241)]=a34_0x43d0d4(0x227);async[a34_0x43d0d4(0x331)](_0x40f4a2){const _0x226928=a34_0x43d0d4,{options:_0xe7fb06,args:_0x195d9f,tdx:_0xef977}=_0x40f4a2,_0x39dbd5=_0x195d9f[0x0],_0x575c6f=_0x195d9f[0x1]||_0xe7fb06[_0x226928(0x201)];if(!_0x39dbd5)return console['error'](_0x226928(0x1ed)),console[_0x226928(0x1a0)](_0x226928(0x304)),console[_0x226928(0x1a0)](_0x226928(0x334)),0x1;if(!_0x575c6f)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]\x0a'+_0x226928(0x334)),0x1;const _0x3d860b=await withSpinner(_0x226928(0x175)+_0x575c6f+_0x226928(0x1f6),()=>_0xef977[_0x226928(0x347)][_0x226928(0x297)](_0x575c6f),{'verbose':_0xe7fb06[_0x226928(0x235)]}),_0x4f6146=_0x3d860b[_0x226928(0x369)];return await withSpinner('Deleting\x20personalization\x20service\x20\x27'+_0x39dbd5+_0x226928(0x1f6),()=>_0xef977['personalization'][_0x226928(0x2b1)](_0x4f6146,_0x39dbd5),{'verbose':_0xe7fb06[_0x226928(0x235)]}),console[_0x226928(0x1a0)](_0x226928(0x363)+_0x39dbd5+'\x27'),0x0;}}export class PSPzServiceUpdateCommand extends BaseCommand{[a34_0x43d0d4(0x2f9)]='ps:pz:service:update';[a34_0x43d0d4(0x241)]=a34_0x43d0d4(0x209);async[a34_0x43d0d4(0x331)](_0x54b848){const _0x131473=a34_0x43d0d4,{options:_0x15056d,args:_0x3dc637,tdx:_0xcdb553}=_0x54b848,_0x4c0627=_0x15056d,_0x138d7e=_0x3dc637[0x0],_0x555973=_0x3dc637[0x1]||_0x15056d[_0x131473(0x201)];if(!_0x138d7e)return console[_0x131473(0x1a0)](_0x131473(0x1ed)),console[_0x131473(0x1a0)](_0x131473(0x1db)),console[_0x131473(0x1a0)](_0x131473(0x159)),0x1;if(!_0x4c0627[_0x131473(0x2f9)])return console[_0x131473(0x1a0)](_0x131473(0x221)),console[_0x131473(0x1a0)](_0x131473(0x1db)),0x1;if(!_0x555973)return showParentSegmentNotSetError(_0x131473(0x1fc)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context'),0x1;const _0x5f3ad4=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x555973+_0x131473(0x1f6),()=>_0xcdb553[_0x131473(0x347)][_0x131473(0x297)](_0x555973),{'verbose':_0x15056d[_0x131473(0x235)]}),_0x1ef4fd=_0x5f3ad4['data'],_0x4783fc={'name':_0x4c0627[_0x131473(0x2f9)]};_0x4c0627[_0x131473(0x241)]!==undefined&&(_0x4783fc[_0x131473(0x241)]=_0x4c0627[_0x131473(0x241)]);const _0xf54892=await withSpinner(_0x131473(0x20d)+_0x138d7e+_0x131473(0x1f6),()=>_0xcdb553[_0x131473(0x2c9)][_0x131473(0x321)](_0x1ef4fd,_0x138d7e,_0x4783fc),{'verbose':_0x15056d[_0x131473(0x235)]}),_0x41f358=_0xf54892[_0x131473(0x369)];return console[_0x131473(0x1a0)](_0x131473(0x2fb)+_0x41f358['name']+'\x27'),await handleSDKOutput([_0x41f358],_0x15056d),0x0;}}export class PSPzServiceTokenCreateCommand extends BaseCommand{[a34_0x43d0d4(0x2f9)]=a34_0x43d0d4(0x20e);[a34_0x43d0d4(0x241)]='Create\x20a\x20token\x20for\x20a\x20personalization\x20service';async[a34_0x43d0d4(0x331)](_0x50f2c8){const _0x1eb210=a34_0x43d0d4,{options:_0x39c48e,args:_0x3c9e06,tdx:_0x2b25e2}=_0x50f2c8,_0x1034da=_0x39c48e,_0x334c68=_0x3c9e06[0x0],_0x577b1a=_0x3c9e06[0x1],_0x27c998=_0x3c9e06[0x2]||_0x39c48e[_0x1eb210(0x201)];if(!_0x334c68)return console['error'](_0x1eb210(0x339)),console[_0x1eb210(0x1a0)](_0x1eb210(0x20a)),console[_0x1eb210(0x1a0)](_0x1eb210(0x30e)),0x1;if(!_0x577b1a)return console['error'](_0x1eb210(0x1ed)),console['error'](_0x1eb210(0x20a)),console[_0x1eb210(0x1a0)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x27c998)return showParentSegmentNotSetError(_0x1eb210(0x2dc)+_0x1eb210(0x30e)),0x1;const _0x13082b=await withSpinner(_0x1eb210(0x175)+_0x27c998+_0x1eb210(0x1f6),()=>_0x2b25e2[_0x1eb210(0x347)][_0x1eb210(0x297)](_0x27c998),{'verbose':_0x39c48e[_0x1eb210(0x235)]}),_0x3a0d73=_0x13082b[_0x1eb210(0x369)],_0x160713={'name':_0x334c68};_0x1034da[_0x1eb210(0x330)]&&(_0x160713[_0x1eb210(0x330)]=_0x1034da['allowedIps'][_0x1eb210(0x2cc)](',')[_0x1eb210(0x160)](_0x3a92d3=>_0x3a92d3['trim']()));_0x1034da[_0x1eb210(0x241)]&&(_0x160713[_0x1eb210(0x241)]=_0x1034da['description']);const _0x1e76c4=await withSpinner(_0x1eb210(0x2eb)+_0x334c68+_0x1eb210(0x1ff)+_0x577b1a+'\x27...',()=>_0x2b25e2[_0x1eb210(0x2c9)][_0x1eb210(0x17d)](_0x3a0d73,_0x577b1a,_0x160713),{'verbose':_0x39c48e['verbose']}),_0x21db65=_0x1e76c4['data'];return console['error']('✔\x20Created\x20token\x20\x27'+_0x21db65[_0x1eb210(0x2f9)]+_0x1eb210(0x220)+_0x21db65['id']),_0x21db65['value']&&(console[_0x1eb210(0x1a0)](a34_0x270838[_0x1eb210(0x194)](_0x1eb210(0x17e))),console[_0x1eb210(0x1a0)](a34_0x270838['cyan'](_0x21db65[_0x1eb210(0x358)])),console[_0x1eb210(0x1a0)]('')),await handleSDKOutput([_0x21db65],_0x39c48e),0x0;}}export class PSPzServiceTokenDeleteCommand extends BaseCommand{['name']=a34_0x43d0d4(0x278);[a34_0x43d0d4(0x241)]=a34_0x43d0d4(0x292);async[a34_0x43d0d4(0x331)](_0xc323f5){const _0x592c96=a34_0x43d0d4,{options:_0x462620,args:_0x41ab37,tdx:_0xa91b94}=_0xc323f5,_0x2bad60=_0x41ab37[0x0],_0x35950c=_0x41ab37[0x1]||_0x462620[_0x592c96(0x201)];if(!_0x2bad60)return console['error'](_0x592c96(0x181)),console['error']('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]'),console[_0x592c96(0x1a0)](_0x592c96(0x1fd)),0x1;if(!_0x35950c)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]\x0a'+_0x592c96(0x1fd)),0x1;const _0x2e9b0b=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x35950c+_0x592c96(0x1f6),()=>_0xa91b94[_0x592c96(0x347)]['resolveParentId'](_0x35950c),{'verbose':_0x462620[_0x592c96(0x235)]}),_0x1444a5=_0x2e9b0b[_0x592c96(0x369)],_0x44b3cf=await withSpinner(_0x592c96(0x22a),()=>_0xa91b94[_0x592c96(0x2c9)][_0x592c96(0x285)](_0x1444a5),{'verbose':_0x462620[_0x592c96(0x235)]}),_0x2542b9=_0x44b3cf[_0x592c96(0x369)];let _0x39b20d;for(const _0x127f2d of _0x2542b9){if(_0x127f2d['tokens']?.['some'](_0x1fcadf=>_0x1fcadf['id']===_0x2bad60)){_0x39b20d=_0x127f2d['id'];break;}}if(!_0x39b20d)return console['error']('Error:\x20Token\x20\x27'+_0x2bad60+_0x592c96(0x216)),0x1;const _0x5df2ba=await withSpinner(_0x592c96(0x192)+_0x2bad60+_0x592c96(0x1f6),()=>_0xa91b94['personalization'][_0x592c96(0x2d2)](_0x1444a5,_0x39b20d,_0x2bad60),{'verbose':_0x462620['verbose']}),_0x3f09d6=_0x5df2ba['data'];return console['error'](_0x592c96(0x322)+(_0x3f09d6[_0x592c96(0x2f9)]||_0x2bad60)+'\x27'),await handleSDKOutput([_0x3f09d6],_0x462620),0x0;}}export class PSPzListCommand extends BaseCommand{[a34_0x43d0d4(0x2f9)]='ps:pz:list';[a34_0x43d0d4(0x241)]=a34_0x43d0d4(0x33f);async[a34_0x43d0d4(0x331)](_0x25d7d3){const _0x54d014=a34_0x43d0d4,{options:_0x31966a,args:_0xf9aa8d,tdx:_0x55a822}=_0x25d7d3,_0x398148=_0xf9aa8d[0x0]||_0x31966a[_0x54d014(0x201)];if(!_0x398148)return showParentSegmentNotSetError(_0x54d014(0x283)+'\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'),0x1;const _0x25d722=await withSpinner(_0x54d014(0x175)+_0x398148+_0x54d014(0x1f6),()=>_0x55a822['segment'][_0x54d014(0x297)](_0x398148),{'verbose':_0x31966a[_0x54d014(0x235)]}),_0x2b912d=_0x25d722['data'],_0x5c6606=await withSpinner('Listing\x20personalizations\x20for\x20\x27'+_0x398148+_0x54d014(0x1f6),()=>_0x55a822[_0x54d014(0x2c9)][_0x54d014(0x326)](_0x2b912d),{'verbose':_0x31966a[_0x54d014(0x235)]}),_0x43078f=_0x5c6606[_0x54d014(0x369)];console['error'](_0x54d014(0x162)+_0x43078f[_0x54d014(0x2c7)]+'\x20personalization'+(_0x43078f['length']!==0x1?'s':''));if(_0x31966a['format']==='json'||_0x31966a[_0x54d014(0x1d2)]===_0x54d014(0x22b))await handleSDKOutput(_0x43078f,_0x31966a);else{if(_0x43078f[_0x54d014(0x2c7)]===0x0)console[_0x54d014(0x167)]('No\x20personalizations\x20configured');else for(const _0x52a5cb of _0x43078f){console[_0x54d014(0x167)](a34_0x270838[_0x54d014(0x2f1)](_0x52a5cb['name'])+'\x20'+a34_0x270838['dim'](_0x54d014(0x314)+_0x52a5cb['id']+')'));_0x52a5cb[_0x54d014(0x241)]&&console[_0x54d014(0x167)]('\x20\x20'+a34_0x270838[_0x54d014(0x207)](_0x52a5cb[_0x54d014(0x241)]));const _0x279040=_0x52a5cb[_0x54d014(0x163)]?.[_0x54d014(0x2c7)]||0x0;console['log']('\x20\x20'+a34_0x270838[_0x54d014(0x32c)]('sections:')+'\x20'+_0x279040);if(_0x52a5cb[_0x54d014(0x163)]&&_0x52a5cb[_0x54d014(0x163)][_0x54d014(0x2c7)]>0x0)for(const _0x24ca72 of _0x52a5cb[_0x54d014(0x163)]){console['log'](_0x54d014(0x2c5)+_0x24ca72[_0x54d014(0x2f9)]);}}}return 0x0;}}export class PSPzShowCommand extends BaseCommand{[a34_0x43d0d4(0x2f9)]=a34_0x43d0d4(0x2c8);['description']=a34_0x43d0d4(0x32d);async[a34_0x43d0d4(0x331)](_0x403b03){const _0x574a9b=a34_0x43d0d4,{options:_0x107c5e,args:_0x5d47ac,tdx:_0xe1d83}=_0x403b03,_0x25f669=_0x5d47ac[0x0];if(!_0x25f669)return console[_0x574a9b(0x1a0)](_0x574a9b(0x19a)),console[_0x574a9b(0x1a0)](_0x574a9b(0x202)),0x1;const _0x4a0d89=await withSpinner(_0x574a9b(0x2a4)+_0x25f669+_0x574a9b(0x1f6),()=>_0xe1d83[_0x574a9b(0x2c9)][_0x574a9b(0x18d)](_0x25f669),{'verbose':_0x107c5e['verbose']}),_0x3e53e0=_0x4a0d89['data'];console[_0x574a9b(0x1a0)]('✔\x20Found\x20personalization\x20\x27'+_0x3e53e0[_0x574a9b(0x2f9)]+'\x27');if(_0x107c5e[_0x574a9b(0x1d2)]===_0x574a9b(0x294)||_0x107c5e[_0x574a9b(0x1d2)]===_0x574a9b(0x22b))await handleSDKOutput([_0x3e53e0],_0x107c5e);else{console[_0x574a9b(0x167)](a34_0x270838[_0x574a9b(0x2f1)](_0x3e53e0[_0x574a9b(0x2f9)])+'\x20'+a34_0x270838[_0x574a9b(0x207)](_0x574a9b(0x314)+_0x3e53e0['id']+')'));_0x3e53e0['description']&&console[_0x574a9b(0x167)]('\x20\x20'+a34_0x270838[_0x574a9b(0x207)](_0x3e53e0['description']));_0x3e53e0[_0x574a9b(0x251)]&&console[_0x574a9b(0x167)]('\x20\x20'+a34_0x270838[_0x574a9b(0x32c)](_0x574a9b(0x1a9))+'\x20'+_0x3e53e0[_0x574a9b(0x251)]);console[_0x574a9b(0x167)]('\x20\x20'+a34_0x270838[_0x574a9b(0x32c)](_0x574a9b(0x30b))+'\x20'+_0x3e53e0[_0x574a9b(0x30a)]),console['log']('\x20\x20'+a34_0x270838[_0x574a9b(0x32c)](_0x574a9b(0x228))+'\x20'+_0x3e53e0[_0x574a9b(0x1cd)]);const _0x26315a=_0x3e53e0[_0x574a9b(0x163)]?.[_0x574a9b(0x2c7)]||0x0;console['log']('\x20\x20'+a34_0x270838[_0x574a9b(0x32c)](_0x574a9b(0x25c))+'\x20'+_0x26315a);if(_0x3e53e0['sections']&&_0x3e53e0['sections']['length']>0x0)for(const _0x15fcd9 of _0x3e53e0['sections']){console[_0x574a9b(0x167)]('\x20\x20\x20\x20'+a34_0x270838[_0x574a9b(0x2f1)](_0x15fcd9[_0x574a9b(0x2f9)])+'\x20'+a34_0x270838[_0x574a9b(0x207)](_0x574a9b(0x314)+_0x15fcd9['id']+')')),_0x15fcd9[_0x574a9b(0x27a)]&&(console[_0x574a9b(0x167)](_0x574a9b(0x18e)+a34_0x270838[_0x574a9b(0x32c)](_0x574a9b(0x232))+'\x20'+_0x15fcd9['entryCriteria']['name']),_0x15fcd9[_0x574a9b(0x27a)][_0x574a9b(0x24b)]?.[_0x574a9b(0x1cb)]&&console[_0x574a9b(0x167)]('\x20\x20\x20\x20\x20\x20\x20\x20'+a34_0x270838[_0x574a9b(0x32c)](_0x574a9b(0x32a))+'\x20'+_0x15fcd9[_0x574a9b(0x27a)][_0x574a9b(0x24b)][_0x574a9b(0x1cb)])),_0x15fcd9[_0x574a9b(0x2a0)]&&console[_0x574a9b(0x167)]('\x20\x20\x20\x20\x20\x20'+a34_0x270838['cyan'](_0x574a9b(0x218))+'\x20'+JSON[_0x574a9b(0x266)](_0x15fcd9['payload'])),_0x15fcd9[_0x574a9b(0x1f5)]&&console['log'](_0x574a9b(0x18e)+a34_0x270838[_0x574a9b(0x32c)]('includeSensitive:')+'\x20true');}}return 0x0;}}export class PSPzDeleteCommand extends BaseCommand{[a34_0x43d0d4(0x2f9)]=a34_0x43d0d4(0x2fe);[a34_0x43d0d4(0x241)]=a34_0x43d0d4(0x364);async['execute'](_0x12245f){const _0x19f781=a34_0x43d0d4,{options:_0x50f471,args:_0x24a1c3,tdx:_0x28c606}=_0x12245f,_0x346b5f=_0x24a1c3[0x0];if(!_0x346b5f)return console[_0x19f781(0x1a0)](_0x19f781(0x19a)),console[_0x19f781(0x1a0)](_0x19f781(0x35f)),0x1;return await withSpinner(_0x19f781(0x30f)+_0x346b5f+_0x19f781(0x1f6),()=>_0x28c606[_0x19f781(0x2c9)][_0x19f781(0x2bb)](_0x346b5f),{'verbose':_0x50f471[_0x19f781(0x235)]}),console[_0x19f781(0x1a0)](_0x19f781(0x1f1)+_0x346b5f+'\x27'),0x0;}}export class PSPzCreateCommand extends BaseCommand{['name']=a34_0x43d0d4(0x21e);['description']='Create\x20a\x20realtime\x20personalization\x20entity';async['execute'](_0x1b5e3e){const _0x527f1b=a34_0x43d0d4,{options:_0x5da8f5,tdx:_0x34903a}=_0x1b5e3e,_0x59a056=_0x5da8f5;let _0x1b1db6;if(_0x59a056[_0x527f1b(0x2e7)]){_0x1b1db6=await loadJSON(_0x59a056[_0x527f1b(0x2e7)],!![]);if(!_0x1b1db6[_0x527f1b(0x1ab)]?.[_0x527f1b(0x2a9)])return console[_0x527f1b(0x1a0)]('Error:\x20\x22relationships.parentFolder\x22\x20is\x20required\x20in\x20the\x20JSON\x20file.'),console[_0x527f1b(0x1a0)](_0x527f1b(0x217)),console[_0x527f1b(0x1a0)](_0x527f1b(0x20f)),0x1;}else{if(!_0x59a056[_0x527f1b(0x2f9)])return console[_0x527f1b(0x1a0)](_0x527f1b(0x277)),console['error']('Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]'),console[_0x527f1b(0x1a0)](_0x527f1b(0x317)),0x1;if(_0x59a056[_0x527f1b(0x241)]===undefined)return console[_0x527f1b(0x1a0)](_0x527f1b(0x258)),console[_0x527f1b(0x1a0)](_0x527f1b(0x1b4)),console[_0x527f1b(0x1a0)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>'),0x1;if(_0x59a056[_0x527f1b(0x33e)]===undefined)return console[_0x527f1b(0x1a0)](_0x527f1b(0x34c)),console[_0x527f1b(0x1a0)](_0x527f1b(0x1b9)),0x1;let _0xbcb7f7=_0x59a056[_0x527f1b(0x251)];if(!_0xbcb7f7&&_0x5da8f5[_0x527f1b(0x201)]){const _0x4e21af=await withSpinner(_0x527f1b(0x175)+_0x5da8f5[_0x527f1b(0x201)]+_0x527f1b(0x1f6),()=>_0x34903a[_0x527f1b(0x347)][_0x527f1b(0x297)](_0x5da8f5[_0x527f1b(0x201)]),{'verbose':_0x5da8f5[_0x527f1b(0x235)]});_0xbcb7f7=_0x4e21af[_0x527f1b(0x369)];}let _0x2a3f11;_0x59a056[_0x527f1b(0x163)]&&(_0x2a3f11=await loadJSON(_0x59a056[_0x527f1b(0x163)],![]));const _0x3655df=_0x59a056[_0x527f1b(0x33e)]===_0x527f1b(0x245)?null:{'id':_0x59a056['folderId'],'type':'folder-segment'};_0x1b1db6={'attributes':{'name':_0x59a056['name'],'description':_0x59a056[_0x527f1b(0x241)]||null,..._0xbcb7f7!==undefined&&{'audienceId':_0xbcb7f7},..._0x2a3f11!==undefined&&{'sections':_0x2a3f11}},'relationships':{'parentFolder':{'data':_0x3655df}}};}const _0x5a79a2=await withSpinner(_0x527f1b(0x327)+(_0x1b1db6['attributes']?.[_0x527f1b(0x2f9)]??'')+'\x27...',()=>_0x34903a[_0x527f1b(0x2c9)][_0x527f1b(0x35d)](_0x1b1db6),{'verbose':_0x5da8f5['verbose']}),_0x2e0810=_0x5a79a2[_0x527f1b(0x369)];return console['error'](_0x527f1b(0x252)+_0x2e0810[_0x527f1b(0x2f9)]+_0x527f1b(0x220)+_0x2e0810['id']),await handleSDKOutput([_0x2e0810],_0x5da8f5),0x0;}}export class PSPzPatchCommand extends BaseCommand{[a34_0x43d0d4(0x2f9)]=a34_0x43d0d4(0x1a1);[a34_0x43d0d4(0x241)]='Update\x20a\x20realtime\x20personalization\x20entity';async[a34_0x43d0d4(0x331)](_0x2b4b69){const _0x120e6f=a34_0x43d0d4,{options:_0x2d96ff,args:_0x208d51}=_0x2b4b69,_0x2ee6c7=_0x2d96ff,_0x44f0a9=_0x208d51[0x0];if(!_0x44f0a9)return console[_0x120e6f(0x1a0)](_0x120e6f(0x19a)),console[_0x120e6f(0x1a0)]('Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]'),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--file\x20<path>'),0x1;let _0xeda06d;if(_0x2ee6c7[_0x120e6f(0x2e7)])_0xeda06d=await loadJSON(_0x2ee6c7['file'],!![]);else{if(!_0x2ee6c7['name'])return console[_0x120e6f(0x1a0)](_0x120e6f(0x277)),console[_0x120e6f(0x1a0)](_0x120e6f(0x1c2)),0x1;if(_0x2ee6c7[_0x120e6f(0x241)]===undefined)return console[_0x120e6f(0x1a0)](_0x120e6f(0x258)),console[_0x120e6f(0x1a0)](_0x120e6f(0x1c2)),0x1;let _0x4e426b;_0x2ee6c7[_0x120e6f(0x163)]&&(_0x4e426b=await loadJSON(_0x2ee6c7['sections'],![])),_0xeda06d={'attributes':{'name':_0x2ee6c7['name'],'description':_0x2ee6c7[_0x120e6f(0x241)]||null,..._0x4e426b!==undefined&&{'sections':_0x4e426b}}};}const {tdx:_0x557a16}=_0x2b4b69,_0x31e95f=await withSpinner(_0x120e6f(0x204)+_0x44f0a9+_0x120e6f(0x1f6),()=>_0x557a16[_0x120e6f(0x2c9)][_0x120e6f(0x360)](_0x44f0a9,_0xeda06d),{'verbose':_0x2d96ff[_0x120e6f(0x235)]}),_0x500b44=_0x31e95f['data'];return console['error'](_0x120e6f(0x193)+_0x500b44[_0x120e6f(0x2f9)]+_0x120e6f(0x1be)+_0x500b44['id']+')'),await handleSDKOutput([_0x500b44],_0x2d96ff),0x0;}}export class PSPzInitCommand extends BaseParentSegmentCommand{[a34_0x43d0d4(0x2f9)]=a34_0x43d0d4(0x338);[a34_0x43d0d4(0x241)]=a34_0x43d0d4(0x1f8);async[a34_0x43d0d4(0x331)](_0x512f69){const _0x4bc9eb=a34_0x43d0d4,{options:_0x2ec3de,args:_0x9137b7}=_0x512f69,_0x34d11d=_0x9137b7[0x0]||_0x2ec3de[_0x4bc9eb(0x201)];if(!_0x34d11d)return showParentSegmentNotSetError(_0x4bc9eb(0x32e)+_0x4bc9eb(0x27d)),0x1;const _0xa9afa3=resolveYamlFile(_0x34d11d);if(!existsSync(_0xa9afa3))return showFileNotFoundError(_0xa9afa3,_0x34d11d),0x1;let _0x2247f9;try{_0x2247f9=readFileSync(_0xa9afa3,'utf-8');}catch(_0xc8009f){const _0x62bb57=_0xc8009f instanceof Error?_0xc8009f[_0x4bc9eb(0x1ea)]:String(_0xc8009f);return console[_0x4bc9eb(0x1a0)](_0x4bc9eb(0x14e)+_0x62bb57),0x1;}let _0x4c455a;try{_0x4c455a=parseDef(_0x2247f9);}catch(_0x536875){const _0x4d1494=_0x536875 instanceof Error?_0x536875[_0x4bc9eb(0x1ea)]:String(_0x536875);return console[_0x4bc9eb(0x1a0)](a34_0x270838[_0x4bc9eb(0x1e0)](_0x4bc9eb(0x15c)+_0x4d1494)),0x1;}if(_0x4c455a[_0x4bc9eb(0x188)]&&_0x4c455a[_0x4bc9eb(0x188)][_0x4bc9eb(0x2c7)]>0x0)return console[_0x4bc9eb(0x1a0)](a34_0x270838[_0x4bc9eb(0x194)](_0x4bc9eb(0x302)+_0xa9afa3)),console[_0x4bc9eb(0x1a0)](a34_0x270838[_0x4bc9eb(0x207)](_0x4bc9eb(0x253)+_0x4c455a[_0x4bc9eb(0x188)][_0x4bc9eb(0x2c7)]+_0x4bc9eb(0x1ba))),0x1;!_0x4c455a[_0x4bc9eb(0x291)]&&(_0x4c455a[_0x4bc9eb(0x291)]={'events':[{'name':_0x4bc9eb(0x288),'source_table':_0x4bc9eb(0x2b5)}],'attributes':[{'name':_0x4bc9eb(0x18f),'type':_0x4bc9eb(0x24e)}],'id_stitching':{'primary_key':_0x4c455a[_0x4bc9eb(0x1b2)][_0x4bc9eb(0x230)]==='customers'?'td_client_id':_0x4bc9eb(0x27b)}});_0x4c455a[_0x4bc9eb(0x188)]=[{'name':_0x4bc9eb(0x367),'description':_0x4bc9eb(0x1f9),'trigger_event':_0x4bc9eb(0x288),'sections':[{'name':_0x4bc9eb(0x22d),'criteria':_0x4bc9eb(0x270),'attributes':[_0x4bc9eb(0x18f)]}]}];const _0x55ba8b=serializeDef(_0x4c455a);return writeFileSync(_0xa9afa3,_0x55ba8b,_0x4bc9eb(0x315)),console[_0x4bc9eb(0x1a0)](a34_0x270838[_0x4bc9eb(0x19d)]('✔')+_0x4bc9eb(0x243)+a34_0x270838[_0x4bc9eb(0x32c)](_0xa9afa3)),(!_0x4c455a[_0x4bc9eb(0x291)]||_0x2247f9[_0x4bc9eb(0x2ab)](_0x4bc9eb(0x289))===-0x1)&&console['error'](a34_0x270838[_0x4bc9eb(0x19d)]('✔')+'\x20Added\x20RT\x202.0\x20template\x20section'),console['error']('\x0a'+a34_0x270838[_0x4bc9eb(0x207)](_0x4bc9eb(0x256))),console['error'](_0x4bc9eb(0x23f)+_0xa9afa3+_0x4bc9eb(0x1fb)),console[_0x4bc9eb(0x1a0)]('\x20\x202.\x20Run\x20'+a34_0x270838[_0x4bc9eb(0x207)](_0x4bc9eb(0x25b)+_0x34d11d)+_0x4bc9eb(0x199)),0x0;}}
1
+ const a34_0x2fb84d=a34_0xd65f;(function(_0x3685fe,_0x190e1c){const _0x5a73ab=a34_0xd65f,_0x4c5db3=_0x3685fe();while(!![]){try{const _0x4219cd=-parseInt(_0x5a73ab(0x21b))/0x1+parseInt(_0x5a73ab(0x36d))/0x2*(parseInt(_0x5a73ab(0x23c))/0x3)+parseInt(_0x5a73ab(0x28c))/0x4*(-parseInt(_0x5a73ab(0x21a))/0x5)+parseInt(_0x5a73ab(0x29b))/0x6*(-parseInt(_0x5a73ab(0x189))/0x7)+-parseInt(_0x5a73ab(0x31b))/0x8+-parseInt(_0x5a73ab(0x20c))/0x9+parseInt(_0x5a73ab(0x366))/0xa;if(_0x4219cd===_0x190e1c)break;else _0x4c5db3['push'](_0x4c5db3['shift']());}catch(_0x86a946){_0x4c5db3['push'](_0x4c5db3['shift']());}}}(a34_0x2634,0x5a545));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a34_0x53d68d from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,createCommandSpinner,formatElapsed}from'../utils/spinner.js';import{loadJSONFromOptions,loadJSON}from'../utils/json-loader.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{getConsoleUrl,getConsoleNextUrl}from'../sdk/client/endpoints.js';import{formatRows,formatAsTable,hyperlink}from'../sdk/util/formatters.js';import{parseDef,serializeDef}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import a34_0x2463e0 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=a34_0x2fb84d(0x31e),LEGACY_PARENT_SEGMENT_DIR='parent_segment';function openBrowser(_0x25ea78){const _0x4d5cfa=a34_0x2fb84d,_0xc6ef5c=process[_0x4d5cfa(0x1d0)],_0xb21820=_0xc6ef5c===_0x4d5cfa(0x21f)?_0x4d5cfa(0x346):_0xc6ef5c==='win32'?_0x4d5cfa(0x2dc):_0x4d5cfa(0x336);spawn(_0xb21820,[_0x25ea78],{'detached':!![],'stdio':_0x4d5cfa(0x23b)})[_0x4d5cfa(0x37b)]();}function migrateLegacyDirectory(){const _0x1b6fe3=a34_0x2fb84d;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x13f8ff=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x13f8ff[_0x1b6fe3(0x2f5)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x1b6fe3(0x22f)](a34_0x2463e0[_0x1b6fe3(0x2c8)]('\x0a⚠️\x20\x20Both\x20'+LEGACY_PARENT_SEGMENT_DIR+_0x1b6fe3(0x1e5)+PARENT_SEGMENT_DIR+_0x1b6fe3(0x1be))),console[_0x1b6fe3(0x22f)](a34_0x2463e0[_0x1b6fe3(0x241)]('\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20'+LEGACY_PARENT_SEGMENT_DIR+_0x1b6fe3(0x26e))),![];console[_0x1b6fe3(0x22f)](a34_0x2463e0[_0x1b6fe3(0x2c8)](_0x1b6fe3(0x2ca)+LEGACY_PARENT_SEGMENT_DIR+_0x1b6fe3(0x28f)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console['error'](a34_0x2463e0[_0x1b6fe3(0x2f0)]('✔\x20Renamed\x20directory\x20to\x20'+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x140dd7){const _0x3f2394=_0x140dd7 instanceof Error?_0x140dd7['message']:String(_0x140dd7);return console[_0x1b6fe3(0x22f)](a34_0x2463e0[_0x1b6fe3(0x1b1)](_0x1b6fe3(0x334)+_0x3f2394+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a34_0x2fb84d(0x24e)](_0x104092){const _0x4c3847=a34_0x2fb84d;return migrateLegacyDirectory(),super[_0x4c3847(0x24e)](_0x104092);}}function resolveYamlFile(_0x4fdd03){const _0x219abb=a34_0x2fb84d;if(_0x4fdd03[_0x219abb(0x300)](_0x219abb(0x324))||_0x4fdd03[_0x219abb(0x300)](_0x219abb(0x1b4)))return _0x4fdd03;return a34_0x53d68d[_0x219abb(0x31f)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x4fdd03)+_0x219abb(0x324));}function formatProgressMessage(_0x2ddbd6){const _0x2bebbb=a34_0x2fb84d,_0x2fd436=_0x2ddbd6[_0x2bebbb(0x236)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x2fd436){const [,_0x3a3d84,_0x133daa,_0x145bd7='']=_0x2fd436;return a34_0x2463e0['dim'](_0x3a3d84+':')+'\x20'+_0x133daa+a34_0x2463e0[_0x2bebbb(0x241)](_0x145bd7);}return a34_0x2463e0['dim'](_0x2ddbd6);}function showFileNotFoundError(_0x105f4e,_0x49d729){const _0x584519=a34_0x2fb84d;console[_0x584519(0x22f)](a34_0x2463e0[_0x584519(0x1b1)](_0x584519(0x250)+_0x105f4e+'\x0a')),console[_0x584519(0x22f)](a34_0x2463e0[_0x584519(0x2ea)](_0x584519(0x25b)+_0x49d729+'`\x20to\x20download\x20the\x20configuration\x20first'));}function displayRealtimeValidation(_0x524333){const _0xcea265=a34_0x2fb84d;if(!_0x524333[_0xcea265(0x1e4)])return;const _0x4d755e=_0x524333[_0xcea265(0x1e4)],_0x4c1a1d=_0x4d755e[_0xcea265(0x2e1)]?a34_0x2463e0[_0xcea265(0x2f0)](_0xcea265(0x333)):a34_0x2463e0[_0xcea265(0x2c8)](_0xcea265(0x39c));console[_0xcea265(0x22f)]('\x0a'+a34_0x2463e0[_0xcea265(0x241)]('RT\x202.0:')+'\x20'+_0x4c1a1d);if(_0x4d755e[_0xcea265(0x265)]&&_0x4d755e[_0xcea265(0x265)][_0xcea265(0x2e8)]>0x0){console[_0xcea265(0x22f)]('\x20\x20'+a34_0x2463e0[_0xcea265(0x241)]('Events:')+'\x20'+_0x4d755e[_0xcea265(0x265)][_0xcea265(0x2e8)]+_0xcea265(0x392));for(const _0x48df2e of _0x4d755e[_0xcea265(0x265)]){const _0x312aed=_0x48df2e[_0xcea265(0x1ea)]===![]?a34_0x2463e0[_0xcea265(0x1b1)]('✘'):a34_0x2463e0[_0xcea265(0x2f0)]('✔');console[_0xcea265(0x22f)](_0xcea265(0x20f)+_0x312aed+'\x20'+_0x48df2e[_0xcea265(0x323)]),_0x48df2e['sourceTableError']&&console['error'](_0xcea265(0x2c6)+a34_0x2463e0[_0xcea265(0x1b1)](_0x48df2e[_0xcea265(0x2a7)]));}}if(_0x4d755e[_0xcea265(0x205)]&&_0x4d755e['attributes'][_0xcea265(0x2e8)]>0x0){console[_0xcea265(0x22f)]('\x20\x20'+a34_0x2463e0['dim']('Attributes:')+'\x20'+_0x4d755e[_0xcea265(0x205)][_0xcea265(0x2e8)]+_0xcea265(0x392));for(const _0x546700 of _0x4d755e[_0xcea265(0x205)]){const _0x4ad9a7=_0x546700[_0xcea265(0x387)]?a34_0x2463e0[_0xcea265(0x2f0)]('✔'):a34_0x2463e0[_0xcea265(0x1b1)]('✘');console[_0xcea265(0x22f)]('\x20\x20\x20\x20'+_0x4ad9a7+'\x20'+_0x546700[_0xcea265(0x323)]+'\x20'+a34_0x2463e0['dim']('('+_0x546700[_0xcea265(0x3a3)]+')'));}}if(_0x4d755e[_0xcea265(0x37a)]){const _0x29f854=_0x4d755e[_0xcea265(0x37a)][_0xcea265(0x32c)]?.[_0xcea265(0x2e8)]?_0xcea265(0x2bb)+_0x4d755e['idStitching'][_0xcea265(0x32c)]['join'](',\x20')+']':'';console[_0xcea265(0x22f)]('\x20\x20'+a34_0x2463e0[_0xcea265(0x241)](_0xcea265(0x221))+'\x20'+_0x4d755e['idStitching'][_0xcea265(0x29c)]+_0x29f854);}if(_0x4d755e[_0xcea265(0x317)]&&_0x4d755e[_0xcea265(0x317)][_0xcea265(0x2e8)]>0x0){console[_0xcea265(0x22f)]('\x20\x20'+a34_0x2463e0[_0xcea265(0x241)]('Personalization:')+'\x20'+_0x4d755e['personalizationServices'][_0xcea265(0x2e8)]+_0xcea265(0x1d5)+(_0x4d755e[_0xcea265(0x317)][_0xcea265(0x2e8)]!==0x1?'s':''));for(const _0x4610df of _0x4d755e['personalizationServices']){console[_0xcea265(0x22f)](_0xcea265(0x2ee)+_0x4610df[_0xcea265(0x323)]);}}}function showParentSegmentNotSetError(_0x264bb2){const _0x3a000f=a34_0x2fb84d;console[_0x3a000f(0x22f)](a34_0x2463e0['yellow']('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x3a000f(0x22f)](_0x264bb2);}export class ParentSegmentListCommand extends BaseCommand{[a34_0x2fb84d(0x323)]=a34_0x2fb84d(0x1ae);[a34_0x2fb84d(0x34e)]='List\x20parent\x20segments';async[a34_0x2fb84d(0x209)](_0x584f84){const _0x4c09c6=a34_0x2fb84d,{options:_0x4b7fcb,args:_0x25b7b1,tdx:_0x191b08}=_0x584f84,_0x3981d6=_0x25b7b1[0x0];_0x4b7fcb[_0x4c09c6(0x36f)]&&(console[_0x4c09c6(0x22f)](_0x4c09c6(0x301)+_0x4b7fcb[_0x4c09c6(0x1a1)]),_0x3981d6&&console[_0x4c09c6(0x22f)](_0x4c09c6(0x271)+_0x3981d6));const _0x40d96f=await withSpinner(_0x3981d6?_0x4c09c6(0x266)+_0x3981d6+_0x4c09c6(0x246):_0x4c09c6(0x2c3),()=>_0x191b08[_0x4c09c6(0x372)]['listParents'](),{'verbose':_0x4b7fcb[_0x4c09c6(0x36f)]});let _0x5f34bc=_0x40d96f[_0x4c09c6(0x24f)];if(_0x3981d6){const _0x4d2781=_0x3981d6[_0x4c09c6(0x2aa)](/[.+^${}()|[\]\\]/g,_0x4c09c6(0x2f3))[_0x4c09c6(0x2aa)](/\*/g,'.*')[_0x4c09c6(0x2aa)](/\?/g,'.'),_0x345555=new RegExp('^'+_0x4d2781+'$','i');_0x5f34bc=_0x5f34bc[_0x4c09c6(0x2f4)](_0xb56b52=>_0x345555[_0x4c09c6(0x385)](_0xb56b52[_0x4c09c6(0x205)][_0x4c09c6(0x323)]));}_0x5f34bc['sort']((_0x42ee44,_0x155f76)=>_0x42ee44[_0x4c09c6(0x205)]['name'][_0x4c09c6(0x2bc)](_0x155f76[_0x4c09c6(0x205)][_0x4c09c6(0x323)])),console[_0x4c09c6(0x22f)](_0x4c09c6(0x2d2)+_0x5f34bc[_0x4c09c6(0x2e8)]+'\x20parent\x20segment'+(_0x5f34bc['length']!==0x1?'s':''));const _0x22468f=_0x53fdb6=>{const _0x3e5d50=_0x4c09c6;return getConsoleNextUrl(_0x4b7fcb['site'],_0x3e5d50(0x394)+_0x53fdb6);};if(_0x4b7fcb[_0x4c09c6(0x249)]===_0x4c09c6(0x288)||_0x4b7fcb[_0x4c09c6(0x249)]==='jsonl'){const _0x398a62=_0x5f34bc['map'](_0x4edfc3=>({..._0x4edfc3,'url':_0x22468f(_0x4edfc3['id'])}));await handleSDKOutput(_0x398a62,_0x4b7fcb);}else{if(_0x5f34bc[_0x4c09c6(0x2e8)]===0x0)_0x3981d6?console[_0x4c09c6(0x2a3)](_0x4c09c6(0x291)+_0x3981d6):console[_0x4c09c6(0x2a3)](_0x4c09c6(0x2d7));else for(const _0xdef1a5 of _0x5f34bc){const _0x55ff77=_0xdef1a5['attributes'][_0x4c09c6(0x304)]?a34_0x2463e0[_0x4c09c6(0x241)]('\x20('+formatRows(_0xdef1a5['attributes']['population'])+')'):'',_0x33c2b7=hyperlink(_0xdef1a5[_0x4c09c6(0x205)][_0x4c09c6(0x323)],_0x22468f(_0xdef1a5['id']));console['log'](_0x4c09c6(0x39e)+_0x33c2b7+_0x55ff77);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{['name']=a34_0x2fb84d(0x2d1);['description']='Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]';async[a34_0x2fb84d(0x209)](_0x27fde2){const _0x52eb62=a34_0x2fb84d,{options:_0x521459,args:_0x3a4926,tdx:_0x2c1040}=_0x27fde2;console['error'](_0x52eb62(0x235)+_0x52eb62(0x393)+_0x52eb62(0x1eb));const _0x554bf0=_0x521459;if(_0x3a4926['length']===0x0)return console[_0x52eb62(0x22f)](a34_0x2463e0[_0x52eb62(0x1b1)](_0x52eb62(0x2b3))),console['error']('Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>'),0x1;const _0x5eede4=_0x3a4926[0x0];if(!_0x554bf0[_0x52eb62(0x2a4)]||!_0x554bf0[_0x52eb62(0x30f)])return console[_0x52eb62(0x22f)](_0x52eb62(0x1a3)),console[_0x52eb62(0x22f)]('Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>'),0x1;_0x554bf0['verbose']&&(console['error'](_0x52eb62(0x301)+_0x554bf0[_0x52eb62(0x1a1)]),console[_0x52eb62(0x22f)](_0x52eb62(0x254)+_0x5eede4),console[_0x52eb62(0x22f)](_0x52eb62(0x38c)+_0x554bf0['database']),console[_0x52eb62(0x22f)]('Table:\x20'+_0x554bf0[_0x52eb62(0x30f)]));const _0x120f1f=await loadJSONFromOptions(_0x554bf0[_0x52eb62(0x205)],_0x554bf0['attributesFile']),_0x3f9f63=await loadJSONFromOptions(_0x554bf0['behaviors'],_0x554bf0['behaviorsFile']),_0xd3ce22=await loadJSONFromOptions(_0x554bf0[_0x52eb62(0x1f9)],_0x554bf0[_0x52eb62(0x26d)]),_0x335b13={'name':_0x5eede4,'description':_0x554bf0[_0x52eb62(0x34e)],'scheduleType':_0x554bf0[_0x52eb62(0x252)],'scheduleOption':_0x554bf0[_0x52eb62(0x232)],'timezone':_0x554bf0[_0x52eb62(0x2c0)],'master':{'parentDatabaseName':_0x554bf0[_0x52eb62(0x2a4)],'parentTableName':_0x554bf0[_0x52eb62(0x30f)]},'attributes':_0x120f1f,'behaviors':_0x3f9f63,'customerGroup':_0xd3ce22},_0x449f4e=await withSpinner(_0x52eb62(0x327)+_0x5eede4+_0x52eb62(0x246),()=>_0x2c1040['segment'][_0x52eb62(0x260)](_0x335b13),{'verbose':_0x521459[_0x52eb62(0x36f)]}),_0x51158f=_0x449f4e[_0x52eb62(0x24f)];return console[_0x52eb62(0x22f)](_0x52eb62(0x244)+_0x51158f['name']+_0x52eb62(0x270)+_0x51158f['id']),await handleSDKOutput([_0x51158f],_0x521459),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{['name']=a34_0x2fb84d(0x397);[a34_0x2fb84d(0x34e)]=a34_0x2fb84d(0x238);async[a34_0x2fb84d(0x209)](_0x2f091e){const _0x53214b=a34_0x2fb84d,{options:_0x4cffbd,args:_0x459170,tdx:_0x3940b6}=_0x2f091e;console[_0x53214b(0x22f)]('\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a'+_0x53214b(0x393)+_0x53214b(0x1eb));const _0x1776db=_0x4cffbd;if(_0x459170[_0x53214b(0x2e8)]===0x0)return console['error'](a34_0x2463e0[_0x53214b(0x1b1)](_0x53214b(0x2b3))),console['error'](_0x53214b(0x1f1)),0x1;const _0x448421=_0x459170[0x0];_0x1776db[_0x53214b(0x36f)]&&(console['error'](_0x53214b(0x301)+_0x1776db[_0x53214b(0x1a1)]),console['error'](_0x53214b(0x287)+_0x448421));const _0x40d03f=await withSpinner(_0x53214b(0x32b)+_0x448421+_0x53214b(0x246),()=>_0x3940b6['segment'][_0x53214b(0x2f9)](_0x448421),{'verbose':_0x1776db[_0x53214b(0x36f)]}),_0x398153=_0x40d03f[_0x53214b(0x24f)],_0xa5c39f=await loadJSONFromOptions(_0x1776db[_0x53214b(0x293)],_0x1776db[_0x53214b(0x26f)]),_0x59b169=await loadJSONFromOptions(_0x1776db['addBehaviors'],_0x1776db['addBehaviorsFile']),_0xd54fcf={'name':_0x398153[_0x53214b(0x323)],'description':_0x1776db[_0x53214b(0x34e)]!==undefined?_0x1776db['description']:_0x398153[_0x53214b(0x34e)],'scheduleType':_0x1776db[_0x53214b(0x252)]!==undefined?_0x1776db[_0x53214b(0x252)]:_0x398153[_0x53214b(0x252)],'scheduleOption':_0x1776db[_0x53214b(0x232)]!==undefined?_0x1776db[_0x53214b(0x232)]:_0x398153['scheduleOption'],'timezone':_0x1776db[_0x53214b(0x2c0)]!==undefined?_0x1776db[_0x53214b(0x2c0)]:_0x398153[_0x53214b(0x2c0)],'master':_0x398153[_0x53214b(0x28e)],'attributes':_0xa5c39f?[..._0x398153[_0x53214b(0x205)]||[],..._0xa5c39f]:_0x398153[_0x53214b(0x205)],'behaviors':_0x59b169?[..._0x398153['behaviors']||[],..._0x59b169]:_0x398153['behaviors'],'customerGroup':_0x398153[_0x53214b(0x1f9)]},_0x1ff501=await withSpinner(_0x53214b(0x351)+_0x448421+_0x53214b(0x246),()=>_0x3940b6['segment']['updateParent'](_0x448421,_0xd54fcf),{'verbose':_0x1776db[_0x53214b(0x36f)]}),_0x5db822=_0x1ff501[_0x53214b(0x24f)];return console['error']('✔\x20Updated\x20parent\x20segment\x20\x27'+_0x5db822[_0x53214b(0x323)]+'\x27'),await handleSDKOutput([_0x5db822],_0x1776db),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a34_0x2fb84d(0x323)]=a34_0x2fb84d(0x303);[a34_0x2fb84d(0x34e)]=a34_0x2fb84d(0x1a8);async[a34_0x2fb84d(0x209)](_0x57c60a){const _0x2b3097=a34_0x2fb84d,{options:_0x17b5db,args:_0x16ddb5,tdx:_0x5ee6e4}=_0x57c60a,_0x57dc37=_0x17b5db,_0x20d896=_0x16ddb5[0x0]||_0x17b5db[_0x2b3097(0x2cb)];if(!_0x20d896)return showParentSegmentNotSetError(_0x2b3097(0x369)+_0x2b3097(0x2f6)),0x1;if(_0x57dc37[_0x2b3097(0x2c5)]&&_0x57dc37[_0x2b3097(0x1ee)])return console['error'](a34_0x2463e0['red'](_0x2b3097(0x1c7))),console[_0x2b3097(0x22f)](a34_0x2463e0[_0x2b3097(0x241)]('The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires')),console[_0x2b3097(0x22f)](a34_0x2463e0[_0x2b3097(0x241)](_0x2b3097(0x1bb)+PARENT_SEGMENT_DIR+_0x2b3097(0x1ca))),console[_0x2b3097(0x22f)](a34_0x2463e0[_0x2b3097(0x2ea)](_0x2b3097(0x2c4))),0x1;const _0x3998ac=_0x57dc37['output']||a34_0x53d68d[_0x2b3097(0x31f)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x20d896)+_0x2b3097(0x324));_0x57dc37[_0x2b3097(0x36f)]&&(console[_0x2b3097(0x22f)]('Site:\x20'+_0x57dc37[_0x2b3097(0x1a1)]),console[_0x2b3097(0x22f)](_0x2b3097(0x287)+_0x20d896),console[_0x2b3097(0x22f)]('Output\x20file:\x20'+_0x3998ac));const _0x1afea1=await withSpinner(_0x2b3097(0x33a)+_0x20d896+_0x2b3097(0x246),()=>_0x5ee6e4[_0x2b3097(0x372)][_0x2b3097(0x237)](_0x20d896),{'verbose':_0x57dc37['verbose']}),_0x1b8465=_0x1afea1['data'];if(existsSync(_0x3998ac)){const _0x5bd2fe=readFileSync(_0x3998ac,_0x2b3097(0x353)),_0x474aff=generateDiff(_0x5bd2fe,_0x1b8465);if(!hasChanges(_0x474aff))console[_0x2b3097(0x22f)](a34_0x2463e0['green']('✔')+_0x2b3097(0x285)+a34_0x2463e0['cyan'](_0x3998ac)+'\x20is\x20already\x20up\x20to\x20date');else{console[_0x2b3097(0x22f)](_0x2b3097(0x2df)+_0x3998ac+'\x27:'),console[_0x2b3097(0x22f)]('─'['repeat'](0x3c)),console[_0x2b3097(0x22f)](formatDiffWithColors(_0x474aff)),console[_0x2b3097(0x22f)]('─'[_0x2b3097(0x195)](0x3c));if(!_0x57dc37[_0x2b3097(0x38d)]){if(!isInteractive())return console['error'](a34_0x2463e0['red'](_0x2b3097(0x338)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x2b3097(0x22f)](a34_0x2463e0[_0x2b3097(0x241)](_0x2b3097(0x214))),0x1;const _0x344d89=await confirmKey(_0x2b3097(0x2cd)+_0x3998ac+'\x27?');if(!_0x344d89)return console[_0x2b3097(0x22f)](a34_0x2463e0[_0x2b3097(0x2c8)](_0x2b3097(0x2db))),0x1;}writeFileSync(_0x3998ac,_0x1b8465,_0x2b3097(0x353)),console['error'](a34_0x2463e0[_0x2b3097(0x2f0)]('✔')+_0x2b3097(0x1cc)+a34_0x2463e0['cyan'](_0x3998ac));}}else{const _0x379fd6=a34_0x53d68d['dirname'](_0x3998ac);!existsSync(_0x379fd6)&&mkdirSync(_0x379fd6,{'recursive':!![]}),writeFileSync(_0x3998ac,_0x1b8465,_0x2b3097(0x353)),console['error'](a34_0x2463e0['green']('✔')+_0x2b3097(0x1cc)+a34_0x2463e0[_0x2b3097(0x2ea)](_0x3998ac));}return saveSessionContext({'parent_segment':_0x20d896},_0x57dc37[_0x2b3097(0x203)]),console[_0x2b3097(0x22f)](a34_0x2463e0[_0x2b3097(0x2f0)]('✔')+_0x2b3097(0x1e7)+a34_0x2463e0[_0x2b3097(0x241)]('parent_segment')+_0x2b3097(0x357)+a34_0x2463e0[_0x2b3097(0x2ea)](_0x20d896)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a34_0x2fb84d(0x323)]='segment:parent:push';[a34_0x2fb84d(0x34e)]=a34_0x2fb84d(0x2de);async['execute'](_0x512948){const _0xac9d6=a34_0x2fb84d,{options:_0x33f229,args:_0x583b68,tdx:_0x3aa239}=_0x512948,_0x33801c=_0x33f229,_0x111484=_0x583b68[0x0]||_0x33f229[_0xac9d6(0x2cb)];if(!_0x111484)return showParentSegmentNotSetError(_0xac9d6(0x1d2)+_0xac9d6(0x289)),0x1;const _0x15e28d=resolveYamlFile(_0x111484);if(!existsSync(_0x15e28d))return showFileNotFoundError(_0x15e28d,_0x111484),0x1;_0x33801c[_0xac9d6(0x36f)]&&(console[_0xac9d6(0x22f)]('Site:\x20'+_0x33801c['site']),console[_0xac9d6(0x22f)](_0xac9d6(0x213)+_0x15e28d));let _0xbc2a4f;try{_0xbc2a4f=readFileSync(_0x15e28d,_0xac9d6(0x353));}catch(_0x5bcb26){const _0x3ef0f4=_0x5bcb26 instanceof Error?_0x5bcb26[_0xac9d6(0x299)]:String(_0x5bcb26);return console[_0xac9d6(0x22f)](_0xac9d6(0x2b5)+_0x3ef0f4),0x1;}const _0x3a6296=await withSpinner(_0xac9d6(0x1db),()=>_0x3aa239[_0xac9d6(0x372)][_0xac9d6(0x28a)](_0xbc2a4f),{'verbose':_0x33801c['verbose']}),_0x3bd604=_0x3a6296['data'],{isNew:_0x59ac56,name:_0x18be75,hasChanges:_0x2444ec,diffFormatted:_0x23ae69}=_0x3bd604;if(!_0x2444ec)return console[_0xac9d6(0x22f)](_0xac9d6(0x295)+_0x18be75+_0xac9d6(0x19f)),0x0;_0x59ac56?console['error'](_0xac9d6(0x1c9)+_0x18be75+'\x27:'):console[_0xac9d6(0x22f)]('\x0aChanges\x20to\x20apply\x20to\x20\x27'+_0x18be75+'\x27:');console['error']('─'['repeat'](0x3c)),console['error'](_0x23ae69),console[_0xac9d6(0x22f)]('─'[_0xac9d6(0x195)](0x3c));const _0x3a9f97=_0x59ac56?'Create\x20parent\x20segment\x20\x27'+_0x18be75+'\x27?':_0xac9d6(0x1fd)+_0x18be75+'\x27?';if(!_0x33801c['yes']){if(!isInteractive())return console[_0xac9d6(0x22f)](a34_0x2463e0[_0xac9d6(0x1b1)]('\x0aError:'),_0xac9d6(0x2be)),console['error'](a34_0x2463e0['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x2a19a5=await confirmKey(_0x3a9f97);if(!_0x2a19a5)return console[_0xac9d6(0x22f)](a34_0x2463e0[_0xac9d6(0x2c8)](_0xac9d6(0x2db))),0x1;}const _0x355efd=_0x59ac56?_0xac9d6(0x36e):_0xac9d6(0x2d9),_0x1a79b9=await withSpinner(_0x355efd+_0xac9d6(0x2eb)+_0x18be75+_0xac9d6(0x246),()=>_0x3bd604[_0xac9d6(0x1ce)](),{'verbose':_0x33801c['verbose']}),_0x574a82=_0x1a79b9['data'],_0x19946a=getConsoleNextUrl(_0x33801c[_0xac9d6(0x1a1)],_0xac9d6(0x394)+_0x574a82['id']),_0x5b45c4=_0x59ac56?'Created':'Updated';return console[_0xac9d6(0x22f)]('✔\x20'+_0x5b45c4+_0xac9d6(0x2eb)+_0x574a82[_0xac9d6(0x323)]+'\x27'),console[_0xac9d6(0x22f)]('\x20\x20'+_0x19946a),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a34_0x2fb84d(0x323)]=a34_0x2fb84d(0x2a5);[a34_0x2fb84d(0x34e)]=a34_0x2fb84d(0x24d);async[a34_0x2fb84d(0x209)](_0x7f0642){const _0x3e3a6a=a34_0x2fb84d,{options:_0x4ba5ec,args:_0x1bfd9a,tdx:_0x5a03fe}=_0x7f0642,_0x547d72=_0x4ba5ec,_0x115472=_0x1bfd9a[0x0]||_0x4ba5ec[_0x3e3a6a(0x2cb)];if(!_0x115472)return showParentSegmentNotSetError(_0x3e3a6a(0x364)+_0x3e3a6a(0x1e3)+_0x3e3a6a(0x27d)+_0x3e3a6a(0x2a8)+_0x3e3a6a(0x18b)+_0x3e3a6a(0x2bf)),0x1;const _0x39dd9d=resolveYamlFile(_0x115472);if(!existsSync(_0x39dd9d))return showFileNotFoundError(_0x39dd9d,_0x115472),0x1;_0x547d72[_0x3e3a6a(0x36f)]&&(console[_0x3e3a6a(0x22f)](_0x3e3a6a(0x301)+_0x547d72[_0x3e3a6a(0x1a1)]),console[_0x3e3a6a(0x22f)](_0x3e3a6a(0x213)+_0x39dd9d));let _0x30ebe7;try{_0x30ebe7=readFileSync(_0x39dd9d,'utf-8');}catch(_0x5e2e3f){const _0x464263=_0x5e2e3f instanceof Error?_0x5e2e3f['message']:String(_0x5e2e3f);return console['error']('Error\x20reading\x20file:\x20'+_0x464263),0x1;}const _0x36f33a=createCommandSpinner(a34_0x2463e0['dim'](_0x3e3a6a(0x396)),{'verbose':_0x547d72[_0x3e3a6a(0x36f)]});_0x36f33a['start']();const _0xa3eaaa={'onProgress':_0x5db835=>{const _0x258c06=_0x3e3a6a;_0x36f33a[_0x258c06(0x1ed)]=formatProgressMessage(_0x5db835);}};if(_0x547d72[_0x3e3a6a(0x28e)])_0xa3eaaa['master']=!![];if(_0x547d72[_0x3e3a6a(0x37f)])_0xa3eaaa[_0x3e3a6a(0x37f)]=!![];_0x547d72[_0x3e3a6a(0x25a)]&&(_0xa3eaaa[_0x3e3a6a(0x25a)]=_0x547d72[_0x3e3a6a(0x25a)]);_0x547d72['behavior']&&(_0xa3eaaa['behavior']=_0x547d72[_0x3e3a6a(0x330)]);if(_0x547d72[_0x3e3a6a(0x199)])_0xa3eaaa[_0x3e3a6a(0x199)]=_0x547d72[_0x3e3a6a(0x199)];let _0x4f51be;try{_0x4f51be=await _0x5a03fe[_0x3e3a6a(0x372)][_0x3e3a6a(0x1a2)](_0x30ebe7,_0xa3eaaa),_0x36f33a[_0x3e3a6a(0x257)]();}catch(_0x40ffa8){_0x36f33a[_0x3e3a6a(0x257)]();throw _0x40ffa8;}const _0xd9e1ee=_0x547d72[_0x3e3a6a(0x199)]||_0x3e3a6a(0x340);return this[_0x3e3a6a(0x220)](_0x4f51be,_0xa3eaaa,_0x39dd9d,_0xd9e1ee),_0x4f51be[_0x3e3a6a(0x240)]?0x0:0x1;}['displayValidateResults'](_0x47c55a,_0x235e46,_0x3c09be,_0x36a182){const _0x37c9c8=a34_0x2fb84d;console[_0x37c9c8(0x22f)]('\x0a'+a34_0x2463e0['bold'](_0x37c9c8(0x377))+'\x20'+_0x47c55a[_0x37c9c8(0x323)]),console[_0x37c9c8(0x22f)]('═'[_0x37c9c8(0x195)](0x3c)),this['displayMasterInfo'](_0x47c55a);if(typeof _0x235e46[_0x37c9c8(0x25a)]===_0x37c9c8(0x30b)){this['displayAttributesStats'](_0x47c55a),this['displaySummary'](_0x47c55a),this['displayPreviewHints'](_0x3c09be,_0x36a182,'attribute',_0x235e46['attribute']);return;}if(_0x235e46['attribute']===!![]){this['displayAttributesStats'](_0x47c55a),this[_0x37c9c8(0x1c5)](_0x47c55a),this[_0x37c9c8(0x370)](_0x3c09be,_0x36a182,_0x37c9c8(0x205));return;}if(typeof _0x235e46[_0x37c9c8(0x330)]===_0x37c9c8(0x30b)){this['displayBehaviorsStats'](_0x47c55a,_0x36a182),this[_0x37c9c8(0x1c5)](_0x47c55a),this[_0x37c9c8(0x370)](_0x3c09be,_0x36a182,'behavior',_0x235e46[_0x37c9c8(0x330)]);return;}if(_0x235e46[_0x37c9c8(0x330)]===!![]){this[_0x37c9c8(0x193)](_0x47c55a,_0x36a182),this['displaySummary'](_0x47c55a),this[_0x37c9c8(0x370)](_0x3c09be,_0x36a182,_0x37c9c8(0x188));return;}this[_0x37c9c8(0x322)](_0x47c55a),this['displayBehaviorsStats'](_0x47c55a,_0x36a182),this[_0x37c9c8(0x371)](_0x47c55a),this['displaySummary'](_0x47c55a),this[_0x37c9c8(0x370)](_0x3c09be,_0x36a182,'all');}['displayRealtimeInfo'](_0x596759){displayRealtimeValidation(_0x596759);}['displayPreviewHints'](_0x234a21,_0x26a37d,_0x4c8837,_0x2093f1){const _0xa11836=a34_0x2fb84d;console[_0xa11836(0x22f)]('\x0a'+a34_0x2463e0['dim'](_0xa11836(0x2f1)));const _0x502acc=_0x26a37d!==_0xa11836(0x340)?_0xa11836(0x390)+_0x26a37d:'';if(_0x4c8837==='attribute'&&_0x2093f1)console[_0xa11836(0x22f)]('\x20\x20'+a34_0x2463e0[_0xa11836(0x241)]('tdx\x20ps\x20preview\x20'+_0x234a21+_0xa11836(0x263)+_0x2093f1+'\x22'+_0x502acc));else{if(_0x4c8837==='behavior'&&_0x2093f1)console[_0xa11836(0x22f)]('\x20\x20'+a34_0x2463e0[_0xa11836(0x241)](_0xa11836(0x35d)+_0x234a21+'\x20--behavior\x20\x22'+_0x2093f1+'\x22'+_0x502acc));else(_0x4c8837==='attributes'||_0x4c8837==='all')&&console[_0xa11836(0x22f)]('\x20\x20'+a34_0x2463e0['dim'](_0xa11836(0x35d)+_0x234a21+_0xa11836(0x325)+_0x502acc));}(_0x4c8837===_0xa11836(0x188)||_0x4c8837===_0xa11836(0x368))&&console[_0xa11836(0x22f)]('\x20\x20'+a34_0x2463e0[_0xa11836(0x241)](_0xa11836(0x35d)+_0x234a21+_0xa11836(0x29e)+_0x502acc)),_0x4c8837==='all'&&console['error']('\x20\x20'+a34_0x2463e0['dim'](_0xa11836(0x35d)+_0x234a21+'\x20--enriched'+_0x502acc));}[a34_0x2fb84d(0x279)](_0x3f4d9b){const _0x13d6b5=a34_0x2fb84d,{master:_0x31531f}=_0x3f4d9b,_0x368ad0=_0x31531f[_0x13d6b5(0x33f)]?a34_0x2463e0[_0x13d6b5(0x2f0)]('✔'):a34_0x2463e0['red']('✘');console['error']('\x0a'+a34_0x2463e0[_0x13d6b5(0x241)]('Master\x20Table')),console['error'](_0x368ad0+'\x20'+a34_0x2463e0[_0x13d6b5(0x376)](_0x31531f[_0x13d6b5(0x2a4)]+'.'+_0x31531f[_0x13d6b5(0x30f)])),_0x31531f[_0x13d6b5(0x33f)]?_0x31531f[_0x13d6b5(0x228)]!==undefined&&console[_0x13d6b5(0x22f)]('\x20\x20'+a34_0x2463e0[_0x13d6b5(0x241)](_0x13d6b5(0x197))+'\x20'+a34_0x2463e0[_0x13d6b5(0x2ea)](formatRows(_0x31531f[_0x13d6b5(0x228)]))):console[_0x13d6b5(0x22f)]('\x20\x20'+a34_0x2463e0[_0x13d6b5(0x1b1)](_0x13d6b5(0x362))+'\x20'+_0x31531f[_0x13d6b5(0x23e)]);}[a34_0x2fb84d(0x322)](_0x1686bd){const _0x4ae148=a34_0x2fb84d;if(_0x1686bd[_0x4ae148(0x205)][_0x4ae148(0x2e8)]===0x0)return;console[_0x4ae148(0x22f)]('\x0a'+a34_0x2463e0[_0x4ae148(0x241)]('Attributes'));for(const _0x44db84 of _0x1686bd['attributes']){const _0x2b577f=_0x44db84[_0x4ae148(0x33f)]?a34_0x2463e0['green']('✔'):a34_0x2463e0[_0x4ae148(0x1b1)]('✘');let _0x4ea378='';if(_0x44db84[_0x4ae148(0x33f)]&&_0x44db84[_0x4ae148(0x26c)]!==undefined&&_0x44db84[_0x4ae148(0x384)]!==undefined){const _0x43e01b=_0x44db84[_0x4ae148(0x384)][_0x4ae148(0x22b)](0x1),_0x560b1e=_0x44db84['coveragePercent']>=0x50?a34_0x2463e0[_0x4ae148(0x2f0)]:_0x44db84['coveragePercent']>=0x32?a34_0x2463e0[_0x4ae148(0x2c8)]:a34_0x2463e0['red'];_0x4ea378='\x20'+a34_0x2463e0[_0x4ae148(0x241)](_0x4ae148(0x19c))+'\x20'+_0x560b1e(_0x43e01b+'%')+'\x20('+formatRows(_0x44db84['matchedCount'])+_0x4ae148(0x267);}console[_0x4ae148(0x22f)](_0x2b577f+'\x20'+a34_0x2463e0[_0x4ae148(0x376)](_0x44db84['name'])+_0x4ea378),console[_0x4ae148(0x22f)]('\x20\x20'+a34_0x2463e0['dim'](_0x4ae148(0x1d6))+'\x20'+a34_0x2463e0[_0x4ae148(0x376)](_0x44db84[_0x4ae148(0x2a4)]+'.'+_0x44db84['table']));const _0x288522=_0x44db84[_0x4ae148(0x2bd)]===_0x44db84['foreignKey']?a34_0x2463e0[_0x4ae148(0x241)](_0x4ae148(0x191))+'\x20'+_0x44db84[_0x4ae148(0x2bd)]:a34_0x2463e0[_0x4ae148(0x241)]('Join:')+'\x20'+_0x44db84[_0x4ae148(0x2bd)]+_0x4ae148(0x357)+_0x44db84['foreignKey'];console[_0x4ae148(0x22f)]('\x20\x20'+_0x288522),console[_0x4ae148(0x22f)]('\x20\x20'+a34_0x2463e0['dim'](_0x4ae148(0x18c))),this[_0x4ae148(0x32e)](_0x44db84['columns']),!_0x44db84[_0x4ae148(0x33f)]&&console['error']('\x20\x20'+a34_0x2463e0[_0x4ae148(0x1b1)](_0x4ae148(0x362))+'\x20'+_0x44db84[_0x4ae148(0x23e)]);}}[a34_0x2fb84d(0x193)](_0x27bcee,_0x44b0d5){const _0x4a11f4=a34_0x2fb84d;if(_0x27bcee['behaviors'][_0x4a11f4(0x2e8)]===0x0)return;console['error']('\x0a'+a34_0x2463e0[_0x4a11f4(0x241)](_0x4a11f4(0x229))+'\x20'+a34_0x2463e0[_0x4a11f4(0x241)]('('+_0x44b0d5+')'));for(const _0x504d42 of _0x27bcee['behaviors']){const _0x3850f7=_0x504d42[_0x4a11f4(0x33f)]?a34_0x2463e0['green']('✔'):a34_0x2463e0[_0x4a11f4(0x1b1)]('✘');let _0x5c7fe4='';if(_0x504d42[_0x4a11f4(0x33f)]&&_0x504d42[_0x4a11f4(0x223)]!==undefined&&_0x504d42[_0x4a11f4(0x225)]!==undefined){const _0x5ee6da=_0x504d42[_0x4a11f4(0x305)]?.[_0x4a11f4(0x22b)](0x1)||'?',_0x2ccac5=(_0x504d42[_0x4a11f4(0x305)]??0x0)>=0x32?a34_0x2463e0[_0x4a11f4(0x2f0)]:(_0x504d42['customerPercent']??0x0)>=0x14?a34_0x2463e0[_0x4a11f4(0x2c8)]:a34_0x2463e0[_0x4a11f4(0x1b1)];_0x5c7fe4='\x20'+a34_0x2463e0[_0x4a11f4(0x241)](_0x4a11f4(0x36a))+'\x20'+_0x2ccac5(formatRows(_0x504d42['customersWithEvents']))+'\x20('+_0x5ee6da+'%)\x20'+a34_0x2463e0['dim']('Events:')+'\x20'+a34_0x2463e0[_0x4a11f4(0x2ea)](formatRows(_0x504d42[_0x4a11f4(0x225)]));}console[_0x4a11f4(0x22f)](_0x3850f7+'\x20'+a34_0x2463e0[_0x4a11f4(0x376)](_0x504d42[_0x4a11f4(0x323)])+_0x5c7fe4),console[_0x4a11f4(0x22f)]('\x20\x20'+a34_0x2463e0[_0x4a11f4(0x241)](_0x4a11f4(0x1d6))+'\x20'+a34_0x2463e0['bold'](_0x504d42[_0x4a11f4(0x2a4)]+'.'+_0x504d42[_0x4a11f4(0x30f)]));const _0x1d2e1f=_0x504d42[_0x4a11f4(0x2bd)]===_0x504d42[_0x4a11f4(0x1d4)]?a34_0x2463e0[_0x4a11f4(0x241)](_0x4a11f4(0x191))+'\x20'+_0x504d42['joinKey']:a34_0x2463e0['dim'](_0x4a11f4(0x1aa))+'\x20'+_0x504d42[_0x4a11f4(0x2bd)]+_0x4a11f4(0x357)+_0x504d42[_0x4a11f4(0x1d4)];console[_0x4a11f4(0x22f)]('\x20\x20'+_0x1d2e1f),console['error']('\x20\x20'+a34_0x2463e0['dim'](_0x4a11f4(0x18c))),this[_0x4a11f4(0x32e)](_0x504d42['columns']),!_0x504d42['schemaValid']&&console['error']('\x20\x20'+a34_0x2463e0['red'](_0x4a11f4(0x362))+'\x20'+_0x504d42[_0x4a11f4(0x23e)]);}}[a34_0x2fb84d(0x32e)](_0x540bc8){const _0x26c81f=a34_0x2fb84d;for(const _0xe6fd72 of _0x540bc8){_0xe6fd72[_0x26c81f(0x388)]===_0xe6fd72[_0x26c81f(0x27b)]||_0xe6fd72[_0x26c81f(0x27b)]==='*'?console[_0x26c81f(0x22f)](_0x26c81f(0x2ee)+_0xe6fd72[_0x26c81f(0x388)]):console[_0x26c81f(0x22f)](_0x26c81f(0x2ee)+_0xe6fd72[_0x26c81f(0x388)]+'\x20'+a34_0x2463e0['dim']('('+_0xe6fd72[_0x26c81f(0x27b)]+')'));}}[a34_0x2fb84d(0x1c5)](_0x554b02){const _0x5c7f24=a34_0x2fb84d;console['error']('─'['repeat'](0x3c));if(_0x554b02[_0x5c7f24(0x3a6)][_0x5c7f24(0x2e8)]>0x0){console[_0x5c7f24(0x22f)]('\x0a'+a34_0x2463e0[_0x5c7f24(0x1b1)](_0x5c7f24(0x3a5)));for(const _0x3e6fbd of _0x554b02['errors']){console['error']('\x20\x20'+a34_0x2463e0[_0x5c7f24(0x1b1)]('•')+'\x20'+_0x3e6fbd);}}_0x554b02[_0x5c7f24(0x240)]&&console[_0x5c7f24(0x22f)]('\x0a'+a34_0x2463e0[_0x5c7f24(0x2f0)]('✔')+'\x20Configuration\x20is\x20valid');}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a34_0x2fb84d(0x323)]='segment:parent:preview';[a34_0x2fb84d(0x34e)]=a34_0x2fb84d(0x206);async['execute'](_0x1465a9){const _0x367955=a34_0x2fb84d,{options:_0x971ed2,args:_0x3a083d,tdx:_0x15e56c}=_0x1465a9,_0x4d959b=_0x971ed2,_0x3b64bf=_0x3a083d[0x0]||_0x971ed2[_0x367955(0x2cb)];if(!_0x3b64bf)return showParentSegmentNotSetError(_0x367955(0x318)+_0x367955(0x2a2)+_0x367955(0x354)+_0x367955(0x1b8)+_0x367955(0x226)+_0x367955(0x2e9)+'\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a'+'\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)'),0x1;if(!_0x4d959b[_0x367955(0x28e)]&&!_0x4d959b['attribute']&&!_0x4d959b[_0x367955(0x330)]&&!_0x4d959b[_0x367955(0x37f)])return console['error'](a34_0x2463e0[_0x367955(0x1b1)](_0x367955(0x2b2))),console['error'](_0x367955(0x38e)),console[_0x367955(0x22f)](_0x367955(0x190)),console[_0x367955(0x22f)]('\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data'),console['error'](_0x367955(0x2fd)),console[_0x367955(0x22f)](_0x367955(0x25f)),console[_0x367955(0x22f)]('\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data'),0x1;const _0x14cdc7=resolveYamlFile(_0x3b64bf);if(!existsSync(_0x14cdc7))return showFileNotFoundError(_0x14cdc7,_0x3b64bf),0x1;_0x4d959b[_0x367955(0x36f)]&&(console[_0x367955(0x22f)](_0x367955(0x301)+_0x4d959b[_0x367955(0x1a1)]),console[_0x367955(0x22f)]('YAML\x20file:\x20'+_0x14cdc7));let _0x24969e;try{_0x24969e=readFileSync(_0x14cdc7,_0x367955(0x353));}catch(_0x2dd0b9){const _0xc693f4=_0x2dd0b9 instanceof Error?_0x2dd0b9['message']:String(_0x2dd0b9);return console[_0x367955(0x22f)](_0x367955(0x2b5)+_0xc693f4),0x1;}let _0x24b0c0;try{_0x24b0c0=parseDef(_0x24969e);}catch(_0x2c34c3){const _0x9462a=_0x2c34c3 instanceof Error?_0x2c34c3[_0x367955(0x299)]:String(_0x2c34c3);return console[_0x367955(0x22f)](a34_0x2463e0[_0x367955(0x1b1)](_0x367955(0x1dd)+_0x9462a)),0x1;}if(_0x4d959b[_0x367955(0x25a)]===!![]||_0x4d959b[_0x367955(0x25a)]===''){const _0x390122=_0x24b0c0['attributes']?.[_0x367955(0x2b6)](_0x357d5c=>_0x357d5c[_0x367955(0x323)])||[];if(_0x390122[_0x367955(0x2e8)]===0x0)console[_0x367955(0x22f)](a34_0x2463e0[_0x367955(0x1b1)](_0x367955(0x1bf)));else{console[_0x367955(0x22f)](a34_0x2463e0['red'](_0x367955(0x2b1))),console[_0x367955(0x22f)]('Available\x20attributes:');for(const _0x55588c of _0x390122){console[_0x367955(0x22f)]('\x20\x20'+a34_0x2463e0[_0x367955(0x2ea)](_0x55588c));}console[_0x367955(0x22f)](_0x367955(0x20a)+_0x3b64bf+_0x367955(0x263)+_0x390122[0x0]+'\x22');}return 0x1;}if(_0x4d959b[_0x367955(0x330)]===!![]||_0x4d959b['behavior']===''){const _0x11206d=_0x24b0c0[_0x367955(0x188)]?.[_0x367955(0x2b6)](_0x2a2cde=>_0x2a2cde[_0x367955(0x323)])||[];if(_0x11206d[_0x367955(0x2e8)]===0x0)console[_0x367955(0x22f)](a34_0x2463e0['red'](_0x367955(0x3a4)));else{console[_0x367955(0x22f)](a34_0x2463e0[_0x367955(0x1b1)](_0x367955(0x23d))),console[_0x367955(0x22f)](_0x367955(0x1c0));for(const _0x1a4468 of _0x11206d){console[_0x367955(0x22f)]('\x20\x20'+a34_0x2463e0[_0x367955(0x2ea)](_0x1a4468));}console['error'](_0x367955(0x20a)+_0x3b64bf+'\x20--behavior\x20\x22'+_0x11206d[0x0]+'\x22');}return 0x1;}const _0x111198=createCommandSpinner(a34_0x2463e0[_0x367955(0x241)](_0x367955(0x25e)),{'verbose':_0x4d959b[_0x367955(0x36f)]});_0x111198['start']();const _0x5536d0={'onProgress':_0x2d6f5b=>{const _0x8324bc=_0x367955;_0x111198[_0x8324bc(0x1ed)]=formatProgressMessage(_0x2d6f5b);}};if(_0x4d959b[_0x367955(0x28e)])_0x5536d0[_0x367955(0x28e)]=!![];if(_0x4d959b[_0x367955(0x25a)]&&typeof _0x4d959b[_0x367955(0x25a)]===_0x367955(0x30b))_0x5536d0[_0x367955(0x25a)]=_0x4d959b[_0x367955(0x25a)];if(_0x4d959b[_0x367955(0x330)]&&typeof _0x4d959b[_0x367955(0x330)]==='string')_0x5536d0['behavior']=_0x4d959b['behavior'];if(_0x4d959b[_0x367955(0x37f)])_0x5536d0[_0x367955(0x37f)]=!![];if(_0x4d959b[_0x367955(0x199)])_0x5536d0[_0x367955(0x199)]=_0x4d959b[_0x367955(0x199)];let _0x5aaa03;try{_0x5aaa03=await _0x15e56c[_0x367955(0x372)][_0x367955(0x1d9)](_0x24969e,_0x5536d0),_0x111198[_0x367955(0x257)]();}catch(_0x5d026c){_0x111198[_0x367955(0x257)]();throw _0x5d026c;}return await this[_0x367955(0x294)](_0x5aaa03,{'master':_0x4d959b[_0x367955(0x28e)],'attribute':typeof _0x4d959b[_0x367955(0x25a)]===_0x367955(0x30b)?_0x4d959b[_0x367955(0x25a)]:undefined,'behavior':typeof _0x4d959b[_0x367955(0x330)]===_0x367955(0x30b)?_0x4d959b[_0x367955(0x330)]:undefined,'enriched':_0x4d959b[_0x367955(0x37f)]}),_0x5aaa03[_0x367955(0x240)]?0x0:0x1;}async['displayPreviewResults'](_0x2642d4,_0x29cf7f){const _0xebce68=a34_0x2fb84d;console[_0xebce68(0x22f)]('\x0a'+a34_0x2463e0[_0xebce68(0x376)]('Preview:')+'\x20'+_0x2642d4[_0xebce68(0x323)]),console[_0xebce68(0x22f)]('═'[_0xebce68(0x195)](0x3c));if(_0x29cf7f['master']&&_0x2642d4['sampleData']){const _0x17f45c=a34_0x2463e0['dim'](_0xebce68(0x36b))+'\x20'+a34_0x2463e0[_0xebce68(0x376)](_0x2642d4[_0xebce68(0x28e)]['database']+'.'+_0x2642d4[_0xebce68(0x28e)][_0xebce68(0x30f)]);await this[_0xebce68(0x2fe)](_0x17f45c,_0x2642d4[_0xebce68(0x286)]);}else{if(_0x29cf7f[_0xebce68(0x25a)]&&_0x2642d4['sampleData']){const _0x3485ab=a34_0x2463e0['dim']('Attribute:')+'\x20'+a34_0x2463e0[_0xebce68(0x376)](_0x29cf7f[_0xebce68(0x25a)]);await this[_0xebce68(0x2fe)](_0x3485ab,_0x2642d4[_0xebce68(0x286)]);}else{if(_0x29cf7f['behavior']&&_0x2642d4[_0xebce68(0x286)]){const _0xf88919=a34_0x2463e0[_0xebce68(0x241)](_0xebce68(0x2ba))+'\x20'+a34_0x2463e0[_0xebce68(0x376)](_0x29cf7f['behavior']);await this[_0xebce68(0x2fe)](_0xf88919,_0x2642d4[_0xebce68(0x286)]);}else{if(_0x29cf7f['enriched']&&_0x2642d4[_0xebce68(0x286)]){const _0x3bda21=a34_0x2463e0[_0xebce68(0x241)](_0xebce68(0x31c))+'\x20'+a34_0x2463e0[_0xebce68(0x376)]('Master\x20+\x20Attributes');await this['displaySampleData'](_0x3bda21,_0x2642d4['sampleData']);}else!_0x2642d4[_0xebce68(0x286)]&&console[_0xebce68(0x22f)](_0xebce68(0x33d));}}}if(_0x2642d4[_0xebce68(0x3a6)][_0xebce68(0x2e8)]>0x0){console['error']('─'[_0xebce68(0x195)](0x3c)),console[_0xebce68(0x22f)]('\x0a'+a34_0x2463e0[_0xebce68(0x1b1)]('Errors:'));for(const _0x539c36 of _0x2642d4[_0xebce68(0x3a6)]){console['error']('\x20\x20'+a34_0x2463e0['red']('•')+'\x20'+_0x539c36);}}}async[a34_0x2fb84d(0x2fe)](_0xd7bbb3,_0x1517a2){const _0x433605=a34_0x2fb84d;if(_0x1517a2[_0x433605(0x2e8)]===0x0){console[_0x433605(0x22f)]('\x0a'+_0xd7bbb3),console[_0x433605(0x22f)](_0x433605(0x1a0));return;}console[_0x433605(0x22f)]('\x0a'+_0xd7bbb3);const _0x5ed3c2=Object[_0x433605(0x1a7)](_0x1517a2[0x0])['map'](_0x301537=>({'name':_0x301537,'type':typeof _0x1517a2[0x0][_0x301537]==='number'?_0x433605(0x1c1):'varchar'})),_0xf938d9={'queryId':'preview','columns':_0x5ed3c2,'data':_0x1517a2,'stats':{'state':_0x433605(0x1f8),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x1517a2[_0x433605(0x2e8)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x4892d8=formatAsTable(_0xf938d9,_0x1517a2[_0x433605(0x2e8)],!![]);await writeOutput(_0x4892d8,undefined,_0x433605(0x30f));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{['name']='segment:parent:run';[a34_0x2fb84d(0x34e)]=a34_0x2fb84d(0x355);async[a34_0x2fb84d(0x209)](_0x1f4a69){const _0x154f29=a34_0x2fb84d,{options:_0x11f010,args:_0x256171,tdx:_0x51f37b}=_0x1f4a69,_0x3510e3=_0x11f010,_0x33d62c=_0x256171[0x0]||_0x11f010[_0x154f29(0x2cb)];if(!_0x33d62c)return showParentSegmentNotSetError(_0x154f29(0x326)+_0x154f29(0x1c6)),0x1;const _0x34e5e5=resolveYamlFile(_0x33d62c);if(existsSync(_0x34e5e5)){_0x3510e3['verbose']&&console[_0x154f29(0x22f)](_0x154f29(0x378)+_0x34e5e5);let _0x36423b;try{_0x36423b=readFileSync(_0x34e5e5,_0x154f29(0x353));}catch(_0x66932e){const _0x1eacbd=_0x66932e instanceof Error?_0x66932e['message']:String(_0x66932e);return console[_0x154f29(0x22f)](_0x154f29(0x2b5)+_0x1eacbd),0x1;}const _0xed77f6=await withSpinner('Analyzing\x20changes...',()=>_0x51f37b['segment'][_0x154f29(0x28a)](_0x36423b),{'verbose':_0x3510e3[_0x154f29(0x36f)]}),_0x5d0788=_0xed77f6[_0x154f29(0x24f)],{isNew:_0x225d52,name:_0x4067bb,hasChanges:_0x3daf34,diffFormatted:_0x495efe}=_0x5d0788;if(_0x3daf34){_0x225d52?console['error'](_0x154f29(0x1c9)+_0x4067bb+'\x27:'):console[_0x154f29(0x22f)](_0x154f29(0x233)+_0x4067bb+'\x27:');console[_0x154f29(0x22f)]('─'[_0x154f29(0x195)](0x3c)),console[_0x154f29(0x22f)](_0x495efe),console[_0x154f29(0x22f)]('─'[_0x154f29(0x195)](0x3c));const _0x41f2d=_0x225d52?_0x154f29(0x1d7)+_0x4067bb+'\x27\x20and\x20run\x20workflow?':_0x154f29(0x1fd)+_0x4067bb+_0x154f29(0x1df);if(!_0x3510e3[_0x154f29(0x38d)]){if(!isInteractive())return console[_0x154f29(0x22f)](a34_0x2463e0['red']('\x0aError:'),_0x154f29(0x2be)),console[_0x154f29(0x22f)](a34_0x2463e0[_0x154f29(0x241)](_0x154f29(0x214))),0x1;const _0x153527=await confirmKey(_0x41f2d);if(!_0x153527)return console[_0x154f29(0x22f)](a34_0x2463e0[_0x154f29(0x2c8)](_0x154f29(0x2db))),0x1;}const _0x39e700=_0x225d52?_0x154f29(0x36e):'Updating';await withSpinner(_0x39e700+_0x154f29(0x2eb)+_0x4067bb+'\x27...',()=>_0x5d0788[_0x154f29(0x1ce)](),{'verbose':_0x3510e3[_0x154f29(0x36f)]});const _0x1d5880=_0x225d52?_0x154f29(0x375):_0x154f29(0x192);console[_0x154f29(0x22f)]('✔\x20'+_0x1d5880+'\x20parent\x20segment\x20\x27'+_0x4067bb+'\x27');}else console['error'](_0x154f29(0x295)+_0x4067bb+_0x154f29(0x1ef));}const _0x298004=await withSpinner(_0x154f29(0x311)+_0x33d62c+_0x154f29(0x246),()=>_0x51f37b[_0x154f29(0x372)]['runParent'](_0x33d62c),{'verbose':_0x3510e3[_0x154f29(0x36f)]}),_0x6ebdad=_0x298004[_0x154f29(0x24f)],_0x4765d6=getConsoleUrl(_0x3510e3[_0x154f29(0x1a1)],_0x154f29(0x22c)+_0x6ebdad['workflowId']+_0x154f29(0x26b)+_0x6ebdad['workflowSessionId']+_0x154f29(0x2c7)+_0x6ebdad['workflowAttemptId']);return console[_0x154f29(0x22f)](_0x154f29(0x1b2)),console[_0x154f29(0x22f)]('\x20\x20'+a34_0x2463e0[_0x154f29(0x241)](_0x154f29(0x23f))+'\x20'+_0x6ebdad['audienceId']),console[_0x154f29(0x22f)]('\x20\x20'+a34_0x2463e0[_0x154f29(0x241)](_0x154f29(0x259))+'\x20'+_0x6ebdad['status']),console[_0x154f29(0x22f)]('\x20\x20'+a34_0x2463e0['dim'](_0x154f29(0x321))+'\x20'+_0x6ebdad[_0x154f29(0x1f7)]),console[_0x154f29(0x22f)]('\x20\x20'+a34_0x2463e0['dim']('Attempt:')+'\x20'+_0x6ebdad[_0x154f29(0x32d)]),console[_0x154f29(0x22f)]('\x20\x20'+_0x4765d6),console[_0x154f29(0x22f)]('\x0a'+a34_0x2463e0[_0x154f29(0x241)]('To\x20cancel:')+_0x154f29(0x2c1)+_0x6ebdad['workflowAttemptId']+'\x20kill'),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a34_0x2fb84d(0x323)]='segment:parent:fields';[a34_0x2fb84d(0x34e)]='List\x20available\x20fields\x20for\x20segmentation';async[a34_0x2fb84d(0x209)](_0xbc2a9c){const _0x2f5651=a34_0x2fb84d,{options:_0x2c6f5b,args:_0x3377cf,tdx:_0x469d9f}=_0xbc2a9c,_0x35b9bd=_0x3377cf[0x0]||_0x2c6f5b[_0x2f5651(0x2cb)];if(!_0x35b9bd)return showParentSegmentNotSetError(_0x2f5651(0x331)+_0x2f5651(0x360)),0x1;_0x2c6f5b['verbose']&&(console[_0x2f5651(0x22f)](_0x2f5651(0x301)+_0x2c6f5b['site']),console[_0x2f5651(0x22f)](_0x2f5651(0x287)+_0x35b9bd));const _0x52f5f2=await withSpinner(_0x2f5651(0x1ba)+_0x35b9bd+_0x2f5651(0x246),()=>_0x469d9f[_0x2f5651(0x372)]['listFields'](_0x35b9bd),{'verbose':_0x2c6f5b[_0x2f5651(0x36f)]}),_0x25fee6=_0x52f5f2[_0x2f5651(0x24f)];console[_0x2f5651(0x22f)](_0x2f5651(0x2d2)+_0x25fee6[_0x2f5651(0x2e8)]+_0x2f5651(0x2f7)+(_0x25fee6['length']!==0x1?'s':''));if(_0x2c6f5b[_0x2f5651(0x288)]||_0x2c6f5b['jsonl'])return await handleSDKOutput(_0x25fee6,_0x2c6f5b),0x0;return displayFieldsHumanReadable(_0x25fee6,_0x35b9bd),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a34_0x2fb84d(0x323)]=a34_0x2fb84d(0x38f);[a34_0x2fb84d(0x34e)]=a34_0x2fb84d(0x381);async[a34_0x2fb84d(0x209)](_0x2f200e){const _0x2e6edd=a34_0x2fb84d,{options:_0x2c942e,args:_0x5ba3eb,tdx:_0x306bbf}=_0x2f200e,_0x1af772=_0x2c942e,_0xbb4a63=_0x5ba3eb[0x0]||_0x2c942e['parentSegment'];if(!_0xbb4a63)return showParentSegmentNotSetError(_0x2e6edd(0x391)+_0x2e6edd(0x341)+'Options:\x0a'+'\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser'),0x1;_0x2c942e[_0x2e6edd(0x36f)]&&(console['error'](_0x2e6edd(0x301)+_0x2c942e[_0x2e6edd(0x1a1)]),console[_0x2e6edd(0x22f)](_0x2e6edd(0x287)+_0xbb4a63));const _0x4d7c5b=await withSpinner(_0x2e6edd(0x33a)+_0xbb4a63+_0x2e6edd(0x246),()=>_0x306bbf[_0x2e6edd(0x372)]['getParentFull'](_0xbb4a63),{'verbose':_0x2c942e['verbose']}),_0x1b99e0=_0x4d7c5b[_0x2e6edd(0x24f)];if(_0x1af772[_0x2e6edd(0x373)]){const _0x194bd9=getConsoleNextUrl(_0x1af772['site'],_0x2e6edd(0x394)+_0x1b99e0['id']);return console[_0x2e6edd(0x22f)](a34_0x2463e0[_0x2e6edd(0x2f0)]('✔')+_0x2e6edd(0x261)+a34_0x2463e0[_0x2e6edd(0x2ea)](_0x194bd9)),openBrowser(_0x194bd9),0x0;}return await handleSingleObjectOutput(_0x1b99e0,_0x2c942e),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a34_0x2fb84d(0x323)]=a34_0x2fb84d(0x30e);['description']=a34_0x2fb84d(0x22e);async[a34_0x2fb84d(0x209)](_0x386901){const _0x4cc754=a34_0x2fb84d,{options:_0x2d4f3c,args:_0x495b73,tdx:_0x11a1a4}=_0x386901,_0x3f6c6b=_0x2d4f3c,_0x4ff3f5=_0x495b73[0x0]||_0x2d4f3c[_0x4cc754(0x2cb)];if(!_0x4ff3f5)return showParentSegmentNotSetError(_0x4cc754(0x382)+_0x4cc754(0x34a)+_0x4cc754(0x27d)+_0x4cc754(0x33c)),0x1;_0x2d4f3c[_0x4cc754(0x36f)]&&(console[_0x4cc754(0x22f)](_0x4cc754(0x301)+_0x2d4f3c[_0x4cc754(0x1a1)]),console['error'](_0x4cc754(0x287)+_0x4ff3f5));const _0x563924=await withSpinner(_0x4cc754(0x1a5)+_0x4ff3f5+_0x4cc754(0x246),()=>_0x11a1a4['segment']['resolveParentId'](_0x4ff3f5),{'verbose':_0x2d4f3c[_0x4cc754(0x36f)]}),_0x271103=_0x563924[_0x4cc754(0x24f)],_0x3f7c17=_0x11a1a4[_0x4cc754(0x372)][_0x4cc754(0x234)](_0x271103);if(_0x3f6c6b[_0x4cc754(0x1ee)]){const _0x4e962d=await this[_0x4cc754(0x20b)](_0x386901,_0x4ff3f5,_0x271103,_0x3f7c17),_0x3dcb05=this[_0x4cc754(0x1f2)](_0x4e962d);writeFileSync(_0x3f6c6b[_0x4cc754(0x1ee)],_0x3dcb05);const _0xe6f23c=_0x4e962d['customers'][_0x4cc754(0x253)][_0x4cc754(0x2e8)]+_0x4e962d[_0x4cc754(0x188)]['reduce']((_0x3ae420,_0x4ea8cc)=>_0x3ae420+_0x4ea8cc[_0x4cc754(0x253)]['length'],0x0),_0xf79a33=_0x4e962d[_0x4cc754(0x188)][_0x4cc754(0x2f4)](_0x58a14e=>_0x58a14e['columns'][_0x4cc754(0x2e8)]===0x0)[_0x4cc754(0x2e8)];return console[_0x4cc754(0x2a3)]('Schema\x20saved\x20to\x20'+_0x3f6c6b[_0x4cc754(0x1ee)]),console[_0x4cc754(0x2a3)](_0x4cc754(0x398)+_0x3f7c17),console[_0x4cc754(0x2a3)](_0x4cc754(0x1f5)+_0x4e962d[_0x4cc754(0x188)][_0x4cc754(0x2e8)]+_0x4cc754(0x1f3)),console['log'](_0x4cc754(0x365)+_0xe6f23c+_0x4cc754(0x19b)),_0xf79a33>0x0&&console[_0x4cc754(0x2a3)](_0x4cc754(0x18f)+_0xf79a33+_0x4cc754(0x345)),0x0;}console[_0x4cc754(0x22f)]('\x0a'+a34_0x2463e0[_0x4cc754(0x376)](_0x4cc754(0x39f))+'\x20'+a34_0x2463e0[_0x4cc754(0x2ea)](_0x3f7c17));const _0x382889=await withSpinner('Fetching\x20customers\x20schema...',()=>_0x11a1a4[_0x4cc754(0x372)][_0x4cc754(0x2d4)](_0x271103),{'verbose':_0x2d4f3c[_0x4cc754(0x36f)]});console[_0x4cc754(0x22f)]('\x0a'+a34_0x2463e0[_0x4cc754(0x376)](_0x4cc754(0x307))+'\x20'+a34_0x2463e0[_0x4cc754(0x241)]('('+_0x3f7c17+_0x4cc754(0x2f8)));const _0x4af19e=await executeSchemaQuery(_0x382889[_0x4cc754(0x24f)],_0x11a1a4,_0x2d4f3c);await handleQueryOutput(_0x4af19e,_0x2d4f3c);const _0x110ba3=await withSpinner(_0x4cc754(0x337),()=>_0x11a1a4[_0x4cc754(0x372)][_0x4cc754(0x255)](_0x271103),{'verbose':_0x2d4f3c[_0x4cc754(0x36f)]});for(const _0xc876e8 of _0x110ba3[_0x4cc754(0x24f)]){const _0x1cb2f3=_0x4cc754(0x1f4)+_0xc876e8[_0x4cc754(0x2a6)]()[_0x4cc754(0x2aa)](/\s+/g,'_'),_0x35d412=_0x4cc754(0x268)+_0x3f7c17+'.'+_0x1cb2f3;console[_0x4cc754(0x22f)]('\x0a'+a34_0x2463e0[_0x4cc754(0x376)](_0xc876e8)+'\x20'+a34_0x2463e0[_0x4cc754(0x241)]('('+_0x3f7c17+'.'+_0x1cb2f3+')'));try{const _0x1255c5=await executeSchemaQuery(_0x35d412,_0x11a1a4,_0x2d4f3c);await handleQueryOutput(_0x1255c5,_0x2d4f3c);}catch{console[_0x4cc754(0x22f)](a34_0x2463e0[_0x4cc754(0x2c8)](_0x4cc754(0x1cb)));}}return 0x0;}async[a34_0x2fb84d(0x20b)](_0x596a70,_0x2642a1,_0x48f54d,_0xdf3eb9){const _0xb07c4f=a34_0x2fb84d,{options:_0x31aac4,tdx:_0x24b729}=_0x596a70,_0x24baaf=await withSpinner('Fetching\x20customers\x20schema...',()=>_0x24b729[_0xb07c4f(0x372)]['getParentSQL'](_0x48f54d),{'verbose':_0x31aac4[_0xb07c4f(0x36f)]}),_0x58ef64=await executeSchemaQuery(_0x24baaf[_0xb07c4f(0x24f)],_0x24b729,_0x31aac4),_0x503812=_0x58ef64['data'][_0xb07c4f(0x2b6)](_0x32873b=>({'name':_0x32873b[_0xb07c4f(0x280)],'type':_0x32873b[_0xb07c4f(0x29f)]})),_0x4d39b6=await withSpinner(_0xb07c4f(0x337),()=>_0x24b729[_0xb07c4f(0x372)][_0xb07c4f(0x255)](_0x48f54d),{'verbose':_0x31aac4['verbose']}),_0x26015a=[];for(const _0x1c3e96 of _0x4d39b6['data']){const _0x24217b=_0xb07c4f(0x1f4)+_0x1c3e96[_0xb07c4f(0x2a6)]()[_0xb07c4f(0x2aa)](/\s+/g,'_'),_0x55cc32=_0xb07c4f(0x268)+_0xdf3eb9+'.'+_0x24217b;let _0x11e804=[];try{const _0x38f898=await executeSchemaQuery(_0x55cc32,_0x24b729,_0x31aac4);_0x11e804=_0x38f898['data']['map'](_0x14368b=>({'name':_0x14368b[_0xb07c4f(0x280)],'type':_0x14368b[_0xb07c4f(0x29f)]}));}catch{}_0x26015a[_0xb07c4f(0x2c9)]({'table':_0x24217b,'columns':_0x11e804});}return{'database':_0xdf3eb9,'parent_segment':_0x2642a1,'parent_id':_0x48f54d,'customers':{'table':'customers','columns':_0x503812},'behaviors':_0x26015a};}['formatSchemaJson'](_0x3dc70c){const _0x687b91=a34_0x2fb84d,_0x4048c8=_0x4b14bf=>{const _0x1dda3e=a34_0xd65f;if(_0x4b14bf['length']===0x0)return'[]';const _0x54599e=_0x4b14bf['map'](_0x8bbfb=>_0x1dda3e(0x2e3)+_0x8bbfb[_0x1dda3e(0x323)]+_0x1dda3e(0x211)+_0x8bbfb[_0x1dda3e(0x3a3)]+_0x1dda3e(0x1ad));return'[\x0a'+_0x54599e[_0x1dda3e(0x31f)](',\x0a')+_0x1dda3e(0x20d);},_0x9f2442=_0x3dc70c[_0x687b91(0x188)][_0x687b91(0x2b6)](_0x120ed7=>{const _0x3f07e9=_0x687b91;return _0x3f07e9(0x379)+_0x120ed7[_0x3f07e9(0x30f)]+_0x3f07e9(0x2b9)+_0x4048c8(_0x120ed7[_0x3f07e9(0x253)])[_0x3f07e9(0x2aa)](/^/gm,'\x20\x20')[_0x3f07e9(0x31a)]()+_0x3f07e9(0x19a);})[_0x687b91(0x31f)](',\x0a');return _0x687b91(0x1c2)+_0x3dc70c['database']+_0x687b91(0x281)+_0x3dc70c[_0x687b91(0x1dc)]+_0x687b91(0x2e0)+_0x3dc70c['parent_id']+_0x687b91(0x218)+_0x3dc70c[_0x687b91(0x307)][_0x687b91(0x30f)]+_0x687b91(0x26a)+_0x4048c8(_0x3dc70c[_0x687b91(0x307)][_0x687b91(0x253)])[_0x687b91(0x2aa)](/^/gm,'\x20\x20')['trim']()+_0x687b91(0x208)+_0x9f2442+_0x687b91(0x1fc);}}export class ParentSegmentSQLCommand extends BaseCommand{[a34_0x2fb84d(0x323)]=a34_0x2fb84d(0x219);[a34_0x2fb84d(0x34e)]='Get\x20SQL\x20query\x20for\x20parent\x20segment';async[a34_0x2fb84d(0x209)](_0x1bfcfe){const _0x1faddd=a34_0x2fb84d,{options:_0xd7f4fe,args:_0x101421,tdx:_0x6e6f2f}=_0x1bfcfe,_0x12fe79=_0x101421[0x0]||_0xd7f4fe['parentSegment'];if(!_0x12fe79)return showParentSegmentNotSetError(_0x1faddd(0x380)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment'),0x1;_0xd7f4fe['verbose']&&(console[_0x1faddd(0x22f)](_0x1faddd(0x301)+_0xd7f4fe[_0x1faddd(0x1a1)]),console[_0x1faddd(0x22f)](_0x1faddd(0x287)+_0x12fe79));const _0x23c7b8=await withSpinner(_0x1faddd(0x1a5)+_0x12fe79+_0x1faddd(0x246),()=>_0x6e6f2f[_0x1faddd(0x372)][_0x1faddd(0x21c)](_0x12fe79),{'verbose':_0xd7f4fe['verbose']}),_0x204310=_0x23c7b8[_0x1faddd(0x24f)],_0x3b9c6b=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x12fe79+_0x1faddd(0x246),()=>_0x6e6f2f[_0x1faddd(0x372)][_0x1faddd(0x2d4)](_0x204310),{'verbose':_0xd7f4fe[_0x1faddd(0x36f)]}),_0x15ed68=_0x3b9c6b[_0x1faddd(0x24f)];return _0xd7f4fe['format']==='json'||_0xd7f4fe['format']===_0x1faddd(0x1a6)?await handleSDKOutput([{'sql':_0x15ed68}],_0xd7f4fe):console['log'](_0x15ed68),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a34_0x2fb84d(0x323)]=a34_0x2fb84d(0x2cf);[a34_0x2fb84d(0x34e)]=a34_0x2fb84d(0x1c3);async[a34_0x2fb84d(0x209)](_0x338f30){const _0x1a0823=a34_0x2fb84d,{options:_0x4e7c41,args:_0x3204d0,tdx:_0x5db762}=_0x338f30,_0x30a9d6=_0x3204d0[0x0]||_0x4e7c41[_0x1a0823(0x2cb)];if(!_0x30a9d6)return showParentSegmentNotSetError(_0x1a0823(0x339)+_0x1a0823(0x25c)),0x1;_0x4e7c41[_0x1a0823(0x36f)]&&(console[_0x1a0823(0x22f)](_0x1a0823(0x301)+_0x4e7c41[_0x1a0823(0x1a1)]),console['error'](_0x1a0823(0x287)+_0x30a9d6));const _0x4cea4f=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x30a9d6+'\x27...',()=>_0x5db762[_0x1a0823(0x372)][_0x1a0823(0x21c)](_0x30a9d6),{'verbose':_0x4e7c41['verbose']}),_0xe96d0=_0x4cea4f[_0x1a0823(0x24f)],_0x3d9b39=await withSpinner(_0x1a0823(0x30a)+_0x30a9d6+_0x1a0823(0x246),()=>_0x5db762[_0x1a0823(0x372)][_0x1a0823(0x2d4)](_0xe96d0),{'verbose':_0x4e7c41[_0x1a0823(0x36f)]});let _0x3fe431=_0x3d9b39[_0x1a0823(0x24f)];const _0x35b03a=resolveLimit(_0x4e7c41['limit'],DEFAULT_DISPLAY_LIMIT),_0x2b95a4=/\bLIMIT\s+\d+/i[_0x1a0823(0x385)](_0x3fe431);!_0x2b95a4&&(_0x3fe431=_0x3fe431[_0x1a0823(0x31a)]()[_0x1a0823(0x2aa)](/;+$/,''),_0x3fe431='SELECT\x20*\x20FROM\x20(\x0a'+_0x3fe431+_0x1a0823(0x37e)+_0x35b03a);_0x4e7c41[_0x1a0823(0x36f)]&&console['error'](_0x1a0823(0x19e)+_0x3fe431);const _0x1808ad=await withProgressSpinner('Executing\x20parent\x20segment\x20query...',async _0x256ce8=>{const _0x35c722=_0x1a0823,_0x1a31ef=await _0x5db762[_0x35c722(0x2c2)][_0x35c722(0x209)](_0x3fe431,{'catalog':'td','schema':'information_schema','onJobId':_0xf66e85=>{_0x256ce8['setJobId'](_0xf66e85);}});return _0x1a31ef;},{'verbose':_0x4e7c41[_0x1a0823(0x36f)]}),_0x4a4691=_0x1808ad[_0x1a0823(0x24f)],_0x52bbed=_0x4a4691[_0x1a0823(0x2d8)]?'\x20[Job\x20ID:\x20'+_0x4a4691[_0x1a0823(0x2d8)]+']':'';return console['error']('✔\x20Query\x20completed:\x20Processed\x20'+_0x4a4691['stats'][_0x1a0823(0x283)][_0x1a0823(0x28d)]()+_0x1a0823(0x204)+('in\x20'+formatElapsed(_0x4a4691['stats']['elapsedTimeMillis'])+_0x52bbed)),await handleQueryOutput(_0x4a4691,_0x4e7c41),0x0;}}function a34_0x2634(){const _0x50cd4a=['stringify','sourceTableValid','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','allowedIps','text','output','\x27\x20is\x20up\x20to\x20date','ps:pz:service:list','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','formatSchemaJson','\x20behaviors','behavior_','\x20\x20Tables:\x201\x20customers\x20+\x20','(id:\x20','workflowSessionId','FINISHED','customerGroup','No\x20personalizations\x20configured','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context','\x0a\x20\x20]\x0a}\x0a','Apply\x20changes\x20to\x20\x27','list','Create\x20a\x20realtime\x20personalization\x20entity','ps:pz:patch','\x20personalization\x20service','patch','session','\x20rows\x20','attributes','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','\x20RT\x20journey','\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a','execute','\x0aUsage:\x20tdx\x20ps\x20preview\x20','collectSchema','3485331SgRtoG','\x0a\x20\x20\x20\x20]','listPersonalizations','\x20\x20\x20\x20','Getting\x20personalization\x20\x27','\x22,\x20\x22type\x22:\x20\x22','List\x20RT\x20journeys','YAML\x20file:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]','value','\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22','segment:parent:sql','153290WRIToj','611760yZHuTq','resolveParentId','Create\x20a\x20personalization\x20service\x20for\x20a\x20parent\x20segment','some','darwin','displayValidateResults','ID\x20Stitching:','identifier:\x20','customersWithEvents','✔\x20Created\x20personalization\x20\x27','totalEvents','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','\x20true','rowCount','Behaviors','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]','toFixed','/app/workflows/','eventKind','Show\x20parent\x20segment\x20schema\x20(column\x20types)','error','RT\x202.0\x20Validate:','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','scheduleOption','\x0aChanges\x20to\x20apply\x20to\x20\x27','getOutputDatabaseName','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','match','pullParentYaml','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]\x0a','Update\x20a\x20personalization\x20service\x20name\x20and/or\x20description','ignore','3YjrWHV','Error:\x20--behavior\x20requires\x20a\x20name\x0a','schemaError','Audience\x20ID:','allValid','dim','user_id','\x0a⚠\x20Save\x20this\x20token\x20value\x20-\x20it\x20will\x20not\x20be\x20shown\x20again:','✔\x20Created\x20parent\x20segment\x20\x27','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]\x0a','\x27...','\x20\x202.\x20Run\x20','ps:pz:service:show','format','Resume\x20activations\x20in\x20an\x20RT\x20journey','entryCriteria:','eventKind:\x20','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','run','data','Error:\x20File\x20not\x20found:\x20','Deleting\x20personalization\x20\x27','scheduleType','columns','Name:\x20','getBehaviorNames','td_client_id','stop','Create\x20a\x20token\x20for\x20a\x20personalization\x20service','Status:','attribute','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','id:\x20','Fetching\x20sample\x20data...','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','createParent','\x20Opening\x20','Show\x20a\x20specific\x20realtime\x20personalization','\x20--attribute\x20\x22','status','events','Listing\x20parent\x20segments\x20matching\x20\x27','\x20rows)','SELECT\x20*\x20FROM\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context','\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20','/sessions/','matchedCount','customerGroupFile','/\x20directory.\x0a','addAttributesFile','\x27\x20with\x20ID:\x20','Pattern:\x20','Getting\x20RT\x20configuration\x20version\x20for\x20\x27','patchPersonalization','\x20\x20\x20\x20\x20\x20\x20Pass\x20null\x20to\x20place\x20in\x20the\x20root\x20folder.','Listing\x20RT-enabled\x20parent\x20segments...','Delete\x20a\x20realtime\x20personalization','resumeJourney','split','displayMasterInfo','Get\x20current\x20RT\x20configuration\x20version\x20status','column','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]\x0a','Options:\x0a','\x20RT\x20configuration\x20is\x20valid','✔\x20Created\x20token\x20\x27','column_name','\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22','listJourneys','processedRows','✔\x20Created\x20personalization\x20service\x20\x27','\x20No\x20changes\x20-\x20','sampleData','Parent\x20segment:\x20','json','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','pushParentYaml','Creating\x20personalization\x20\x27','28iuhHTc','toLocaleString','master','/\x20→\x20','Deleting\x20personalization\x20service\x20\x27','No\x20parent\x20segments\x20match\x20pattern:\x20','\x20to\x20configure\x20your\x20personalization\x20service','addAttributes','displayPreviewResults','✔\x20No\x20changes\x20-\x20\x27','\x27\x20(id:\x20','Error:\x20Personalization\x20ID\x20is\x20required','ps:rt:configuration_versions','message','No\x20RT-enabled\x20parent\x20segments\x20found','78psWetW','primaryKey','last_page_viewed','\x20--behavior\x20\x22<name>\x22','column_type','Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','log','database','segment:parent:validate','toLowerCase','sourceTableError','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','⚠️\x20\x20personalization_services\x20section\x20already\x20exists\x20in\x20','replace','Error:\x20Token\x20ID\x20is\x20required','\x20personalization','My\x20Service','List\x20parent\x20segments\x20with\x20RT\x202.0\x20status','personalization','tdx\x20ps\x20push\x20','Error:\x20--attribute\x20requires\x20a\x20name\x0a','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','Error:\x20Parent\x20segment\x20name\x20is\x20required','keyEventId','Error\x20reading\x20file:\x20','map','sections','Error:\x20--folder-id\x20is\x20required.\x20Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID.','\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20','Behavior:','\x20+\x20[','localeCompare','joinKey','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','timezone','\x20tdx\x20wf\x20attempt\x20','query','Listing\x20parent\x20segments...','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','use','\x20\x20\x20\x20\x20\x20','/attempt/','yellow','push','\x0a⚠️\x20\x20Migrating:\x20','parentSegment','\x20stage','Overwrite\x20\x27','\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','segment:parent:show','Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID,\x20then\x20add:','segment:parent:create','✔\x20Found\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--file\x20<path>','getParentSQL','includeSensitive:','Pause\x20activations\x20in\x20an\x20RT\x20journey','No\x20parent\x20segments\x20found','jobId','Updating','Error:\x20Service\x20ID\x20is\x20required','Aborted.','start','ps:pz:delete','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','\x0aChanges\x20to\x20\x27','\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22','enabled','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','\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22','\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','no\x20tokens\x20configured','ps:pz:service:token:create','\x20\x20\x20\x20\x20\x20\x20\x20','length','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','cyan','\x20parent\x20segment\x20\x27','Listing\x20personalization\x20services\x20for\x20\x27','personalization_services','\x20\x20\x20\x20-\x20','\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','green','To\x20view\x20sample\x20data:','Add\x20template\x20personalization\x20section\x20to\x20parent\x20segment\x20YAML','\x5c$&','filter','isDirectory','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','\x20field','.customers)','getParentFull','✔\x20Updated\x20personalization\x20service\x20\x27','Listing\x20RT-enabled\x20parent\x20segments\x20matching\x20\x27','Delete\x20a\x20token\x20from\x20a\x20personalization\x20service','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','displaySampleData','ps:rt:list','endsWith','Site:\x20','indexOf','segment:parent:pull','population','customerPercent','delete','customers','sort','create','Fetching\x20SQL\x20for\x20\x27','string','\x20(paused)','created:','segment:parent:desc','table','get','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','launched','Personalization\x20service\x20description','keyEventCriteria','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]','\x20\x201.\x20Edit\x20','personalizationServices','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','Usage:\x20tdx\x20ps\x20rt\x20jn\x20pause_activations\x20<journeyId>\x0a','trim','3050528wkivHe','Enriched:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context','parent_segments','join','Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]','Session:','displayAttributesStats','name','.yml','\x20--attribute\x20\x22<name>\x22','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','Creating\x20parent\x20segment\x20\x27','Updating\x20personalization\x20service\x20\x27','Validating\x20RT\x20configuration...','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context','Fetching\x20current\x20configuration\x20for\x20\x27','stitchingKeys','workflowAttemptId','displayColumns','ps:rt:jn:list','behavior','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','deleteToken','⚡\x20Enabled','✘\x20Failed\x20to\x20rename\x20directory:\x20','ps:pz:create','xdg-open','Fetching\x20behavior\x20list...','\x0aError:','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','Fetching\x20parent\x20segment\x20\x27','token:','\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path','\x0aNo\x20sample\x20data\x20available','identifier','schemaValid','-1d','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','Update\x20a\x20realtime\x20personalization\x20entity','Creating\x20token\x20\x27','stageCount','\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)','open','page_view','Error:\x20Service\x20name\x20is\x20required','parentFolder','\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','✔\x20Updated\x20personalization\x20\x27','single','Usage:\x20tdx\x20ps\x20pz\x20show\x20<personalization_id>','description','Next\x20steps:','getPersonalization','Updating\x20parent\x20segment\x20\x27','createToken','utf-8','Options\x20(one\x20required):\x0a','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','realtime_enabled','\x20=\x20','No\x20RT\x20journeys\x20found','public','Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','ps:pz:service:update','Usage:\x20tdx\x20ps\x20rt\x20jn\x20resume_activations\x20<journeyId>\x0a','tdx\x20ps\x20preview\x20','\x20service(s)\x20configured','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','Default','Error:','Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','\x20\x20Columns:\x20','21102900FZDuyw','Finding\x20service\x20for\x20token...','all','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','Customers:','Master:','\x27\x20not\x20found\x20in\x20any\x20personalization\x20service','264302fUTSlw','Creating','verbose','displayPreviewHints','displayRealtimeInfo','segment','web','paused','Created','bold','Validate:','Found\x20YAML\x20file:\x20','\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22','idStitching','unref','updatedAt','ps:pz:show','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','enriched','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','Show\x20parent\x20segment\x20details','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','RT\x20Journey\x20ID:\x20','coveragePercent','test','ps:pz:list','valid','label','payload','ps:rt:validate','keyEventId:','Database:\x20','yes','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','segment:parent:view','\x20--interval\x20','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','\x20configured','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','/app/dw/parentSegments/','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','Validating\x20configuration...','segment:parent:update','\x20\x20Database:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>','\x0aTip:\x20Run\x20`tdx\x20ps\x20pz\x20service\x20init`\x20to\x20add\x20a\x20template\x20personalization\x20section\x20to\x20your\x20YAML','Creating\x20personalization\x20service\x20\x27','⚡\x20Not\x20enabled','<database>.<table>','👥\x20','Output\x20Database:','Patching\x20personalization\x20\x27','ps:pz:service:token:delete','✔\x20Deleted\x20personalization\x20service\x20\x27','type','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','Errors:','errors','Error:\x20Token\x20\x27','behaviors','149429tlwMgb','audienceId:','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','Columns:','ps:pz:service:delete','createPersonalization','\x20\x20Note:\x20','Options:','Join\x20on:','Updated','displayBehaviorsStats','realtime:','repeat','tokens','Rows:','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','interval','\x0a\x20\x20\x20\x20}','\x20total','Coverage:','No\x20personalization\x20services\x20configured','SQL\x20query:\x0a','\x27\x20is\x20already\x20up\x20to\x20date','\x20\x20No\x20sample\x20data\x20available','site','validateParentYaml','Error:\x20--database\x20and\x20--table\x20are\x20required','\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','Resolving\x20parent\x20segment\x20\x27','jsonl','keys','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','state','Join:','folderId','includeSensitive','\x22\x20}','segment:parent:list','Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a','Error:\x20Token\x20name\x20is\x20required','red','\x0a✔\x20Workflow\x20started','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','.yaml','\x27\x20for\x20service\x20\x27','\x20Added\x20RT\x202.0\x20template\x20section','allowed\x20IPs:','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','Validate\x20RT\x202.0\x20configuration\x20from\x20parent\x20segment\x20YAML','Listing\x20fields\x20for\x20\x27','using\x20the\x20default\x20path:\x20','audienceId','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context','/\x20directories\x20exist.','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','Available\x20behaviors:','double','{\x0a\x20\x20\x22database\x22:\x20\x22','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','sections:','displaySummary','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','Usage:\x20tdx\x20ps\x20pz\x20delete\x20<personalization_id>','\x0aNew\x20parent\x20segment\x20\x27','/{name}.yml\x0a','\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','Delete\x20a\x20personalization\x20service','apply','entryCriteria','platform','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]\x0a','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','null','foreignKey','\x20service','Source:','Create\x20parent\x20segment\x20\x27','ps:rt:jn:resume','previewParentYaml','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context','Analyzing\x20changes...','parent_segment','Error\x20parsing\x20YAML:\x20','Pausing\x20activations\x20for\x20RT\x20journey\x20\x27','\x27\x20and\x20run\x20workflow?','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]','getCurrentConfigVersion','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','realtime','/\x20and\x20','List\x20realtime\x20personalizations\x20for\x20a\x20parent\x20segment','\x20Context\x20set:\x20','file'];a34_0x2634=function(){return _0x50cd4a;};return a34_0x2634();}export class PSRtListCommand extends BaseCommand{['name']=a34_0x2fb84d(0x2ff);['description']=a34_0x2fb84d(0x2ae);async[a34_0x2fb84d(0x209)](_0xc61418){const _0x1fbc90=a34_0x2fb84d,{options:_0x557f10,args:_0x31316d,tdx:_0x59ba8f}=_0xc61418,_0x55bb8=_0x31316d[0x0],_0x17d1f1=await withSpinner(_0x55bb8?_0x1fbc90(0x2fb)+_0x55bb8+_0x1fbc90(0x246):_0x1fbc90(0x275),()=>_0x59ba8f[_0x1fbc90(0x1e4)]['list'](),{'verbose':_0x557f10[_0x1fbc90(0x36f)]});let _0x1953c3=_0x17d1f1[_0x1fbc90(0x24f)]['filter'](_0x166f1e=>_0x166f1e[_0x1fbc90(0x356)]);if(_0x55bb8){const _0x5b5a1c=_0x55bb8['replace'](/[.+^${}()|[\]\\]/g,_0x1fbc90(0x2f3))[_0x1fbc90(0x2aa)](/\*/g,'.*')[_0x1fbc90(0x2aa)](/\?/g,'.'),_0x20f2a5=new RegExp('^'+_0x5b5a1c+'$','i');_0x1953c3=_0x1953c3[_0x1fbc90(0x2f4)](_0x2a1155=>_0x20f2a5[_0x1fbc90(0x385)](_0x2a1155['name']));}_0x1953c3[_0x1fbc90(0x308)]((_0x3fd5d5,_0x5e24da)=>_0x3fd5d5['name'][_0x1fbc90(0x2bc)](_0x5e24da[_0x1fbc90(0x323)])),console['error'](_0x1fbc90(0x2d2)+_0x1953c3['length']+'\x20RT-enabled\x20parent\x20segment'+(_0x1953c3[_0x1fbc90(0x2e8)]!==0x1?'s':''));const _0x314069=_0x3d38c2=>{const _0x398b28=_0x1fbc90;return getConsoleNextUrl(_0x557f10[_0x398b28(0x1a1)],_0x398b28(0x394)+_0x3d38c2);};if(_0x557f10[_0x1fbc90(0x249)]===_0x1fbc90(0x288)||_0x557f10[_0x1fbc90(0x249)]===_0x1fbc90(0x1a6)){const _0x285a7=_0x1953c3[_0x1fbc90(0x2b6)](_0x55f6e7=>({..._0x55f6e7,'url':_0x314069(_0x55f6e7['id'])}));await handleSDKOutput(_0x285a7,_0x557f10);}else{if(_0x1953c3[_0x1fbc90(0x2e8)]===0x0)console['log'](_0x1fbc90(0x29a));else for(const _0x4b996d of _0x1953c3){const _0x4347e4=_0x4b996d[_0x1fbc90(0x304)]?a34_0x2463e0[_0x1fbc90(0x241)]('\x20('+formatRows(_0x4b996d['population'])+')'):'',_0x500d1=hyperlink(_0x4b996d['name'],_0x314069(_0x4b996d['id']));console['log']('⚡\x20'+_0x500d1+_0x4347e4);}}return 0x0;}}export class PSRtValidateCommand extends BaseParentSegmentCommand{[a34_0x2fb84d(0x323)]=a34_0x2fb84d(0x38a);[a34_0x2fb84d(0x34e)]=a34_0x2fb84d(0x1b9);async[a34_0x2fb84d(0x209)](_0x4db9c5){const _0x10e2c7=a34_0x2fb84d,{options:_0x3b6b5f,args:_0x4d444b,tdx:_0x3dbad6}=_0x4db9c5,_0x3f8aad=_0x4d444b[0x0]||_0x3b6b5f[_0x10e2c7(0x2cb)];if(!_0x3f8aad)return showParentSegmentNotSetError(_0x10e2c7(0x198)+_0x10e2c7(0x1a4)),0x1;const _0xec5f44=resolveYamlFile(_0x3f8aad);if(!existsSync(_0xec5f44))return showFileNotFoundError(_0xec5f44,_0x3f8aad),0x1;let _0x3fdb67;try{_0x3fdb67=readFileSync(_0xec5f44,_0x10e2c7(0x353));}catch(_0x1e24e5){const _0x7947ad=_0x1e24e5 instanceof Error?_0x1e24e5['message']:String(_0x1e24e5);return console[_0x10e2c7(0x22f)](_0x10e2c7(0x2b5)+_0x7947ad),0x1;}const _0x419bc9=createCommandSpinner(a34_0x2463e0['dim'](_0x10e2c7(0x329)),{'verbose':_0x3b6b5f[_0x10e2c7(0x36f)]});_0x419bc9['start']();const _0x38d9b4={'realtime':!![],'onProgress':_0x11a22c=>{const _0x52e303=_0x10e2c7;_0x419bc9[_0x52e303(0x1ed)]=formatProgressMessage(_0x11a22c);}};let _0x4ebbf3;try{_0x4ebbf3=await _0x3dbad6[_0x10e2c7(0x372)][_0x10e2c7(0x1a2)](_0x3fdb67,_0x38d9b4),_0x419bc9[_0x10e2c7(0x257)]();}catch(_0x4f04c2){_0x419bc9['stop']();throw _0x4f04c2;}console[_0x10e2c7(0x22f)]('\x0a'+a34_0x2463e0[_0x10e2c7(0x376)](_0x10e2c7(0x230))+'\x20'+_0x4ebbf3[_0x10e2c7(0x323)]),console[_0x10e2c7(0x22f)]('═'[_0x10e2c7(0x195)](0x3c)),displayRealtimeValidation(_0x4ebbf3),console['error']('─'[_0x10e2c7(0x195)](0x3c));if(_0x4ebbf3[_0x10e2c7(0x3a6)]['length']>0x0){console['error']('\x0a'+a34_0x2463e0[_0x10e2c7(0x1b1)]('Errors:'));for(const _0xee892a of _0x4ebbf3[_0x10e2c7(0x3a6)]){console[_0x10e2c7(0x22f)]('\x20\x20'+a34_0x2463e0[_0x10e2c7(0x1b1)]('•')+'\x20'+_0xee892a);}}return _0x4ebbf3[_0x10e2c7(0x240)]&&console['error']('\x0a'+a34_0x2463e0[_0x10e2c7(0x2f0)]('✔')+_0x10e2c7(0x27e)),_0x4ebbf3[_0x10e2c7(0x240)]?0x0:0x1;}}export class PSRtJnListCommand extends BaseCommand{[a34_0x2fb84d(0x323)]=a34_0x2fb84d(0x32f);[a34_0x2fb84d(0x34e)]=a34_0x2fb84d(0x212);async[a34_0x2fb84d(0x209)](_0x5bd755){const _0x883d00=a34_0x2fb84d,{options:_0x1f84d2,args:_0x32781e,tdx:_0x43da6a}=_0x5bd755,_0x53c709=_0x32781e[0x0]||_0x1f84d2[_0x883d00(0x2cb)];if(!_0x53c709)return showParentSegmentNotSetError(_0x883d00(0x2e2)+'\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;_0x1f84d2[_0x883d00(0x36f)]&&(console[_0x883d00(0x22f)](_0x883d00(0x301)+_0x1f84d2[_0x883d00(0x1a1)]),console[_0x883d00(0x22f)](_0x883d00(0x287)+_0x53c709));const _0x1fc23e=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x53c709+'\x27...',()=>_0x43da6a['segment'][_0x883d00(0x21c)](_0x53c709),{'verbose':_0x1f84d2[_0x883d00(0x36f)]}),_0x39366e=_0x1fc23e['data'],_0x3ead41=await withSpinner('Listing\x20RT\x20journeys\x20for\x20\x27'+_0x53c709+_0x883d00(0x246),()=>_0x43da6a[_0x883d00(0x1e4)][_0x883d00(0x282)](_0x39366e),{'verbose':_0x1f84d2[_0x883d00(0x36f)]}),_0x4e12c5=_0x3ead41['data'];console[_0x883d00(0x22f)](_0x883d00(0x2d2)+_0x4e12c5['length']+_0x883d00(0x207)+(_0x4e12c5[_0x883d00(0x2e8)]!==0x1?'s':''));if(_0x1f84d2[_0x883d00(0x249)]==='json'||_0x1f84d2['format']===_0x883d00(0x1a6))await handleSDKOutput(_0x4e12c5,_0x1f84d2);else{if(_0x4e12c5['length']===0x0)console[_0x883d00(0x2a3)](_0x883d00(0x358));else for(const _0x15b846 of _0x4e12c5){const _0x360bf5=_0x15b846[_0x883d00(0x1a9)]===_0x883d00(0x312)?'🚀':'📝',_0x57a406=_0x15b846['paused']?a34_0x2463e0['yellow'](_0x883d00(0x30c)):'',_0x539108=a34_0x2463e0[_0x883d00(0x241)]('\x20('+_0x15b846[_0x883d00(0x344)]+_0x883d00(0x2cc)+(_0x15b846['stageCount']!==0x1?'s':'')+')');console['log'](_0x360bf5+'\x20'+_0x15b846[_0x883d00(0x323)]+_0x57a406+_0x539108);}}return 0x0;}}export class PSRtJnPauseCommand extends BaseCommand{[a34_0x2fb84d(0x323)]='ps:rt:jn:pause';['description']=a34_0x2fb84d(0x2d6);async[a34_0x2fb84d(0x209)](_0x1368a3){const _0x13dd0c=a34_0x2fb84d,{options:_0x2d3a62,args:_0x320bef,tdx:_0x153891}=_0x1368a3,_0x1c0c39=_0x320bef[0x0];if(!_0x1c0c39)return console[_0x13dd0c(0x22f)](a34_0x2463e0[_0x13dd0c(0x1b1)]('Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a')),console[_0x13dd0c(0x22f)](_0x13dd0c(0x319)),console[_0x13dd0c(0x22f)](a34_0x2463e0[_0x13dd0c(0x241)](_0x13dd0c(0x2a0))),0x1;_0x2d3a62['verbose']&&(console[_0x13dd0c(0x22f)]('Site:\x20'+_0x2d3a62['site']),console[_0x13dd0c(0x22f)](_0x13dd0c(0x383)+_0x1c0c39));const _0x2b9368=await withSpinner(_0x13dd0c(0x1de)+_0x1c0c39+_0x13dd0c(0x246),()=>_0x153891[_0x13dd0c(0x1e4)]['pauseJourney'](_0x1c0c39),{'verbose':_0x2d3a62[_0x13dd0c(0x36f)]}),_0x2c9109=_0x2b9368[_0x13dd0c(0x24f)];console['error']('✔\x20Paused\x20activations\x20for\x20RT\x20journey\x20\x27'+_0x2c9109[_0x13dd0c(0x323)]+'\x27');if(_0x2d3a62[_0x13dd0c(0x249)]===_0x13dd0c(0x288)||_0x2d3a62[_0x13dd0c(0x249)]===_0x13dd0c(0x1a6))await handleSDKOutput([_0x2c9109],_0x2d3a62);else{const _0x3eff50=_0x2c9109[_0x13dd0c(0x1a9)]===_0x13dd0c(0x312)?'🚀':'📝',_0x3403d7=_0x2c9109[_0x13dd0c(0x374)]?a34_0x2463e0['yellow'](_0x13dd0c(0x30c)):'';console[_0x13dd0c(0x2a3)](_0x3eff50+'\x20'+_0x2c9109[_0x13dd0c(0x323)]+_0x3403d7);}return 0x0;}}export class PSRtJnResumeCommand extends BaseCommand{[a34_0x2fb84d(0x323)]=a34_0x2fb84d(0x1d8);[a34_0x2fb84d(0x34e)]=a34_0x2fb84d(0x24a);async['execute'](_0x162695){const _0x11f9fe=a34_0x2fb84d,{options:_0x166ab1,args:_0x3aca8e,tdx:_0x50cb2e}=_0x162695,_0x24eeaa=_0x3aca8e[0x0];if(!_0x24eeaa)return console[_0x11f9fe(0x22f)](a34_0x2463e0[_0x11f9fe(0x1b1)](_0x11f9fe(0x1af))),console['error'](_0x11f9fe(0x35c)),console['error'](a34_0x2463e0[_0x11f9fe(0x241)]('Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs')),0x1;_0x166ab1[_0x11f9fe(0x36f)]&&(console[_0x11f9fe(0x22f)](_0x11f9fe(0x301)+_0x166ab1[_0x11f9fe(0x1a1)]),console[_0x11f9fe(0x22f)]('RT\x20Journey\x20ID:\x20'+_0x24eeaa));const _0x58dd82=await withSpinner('Resuming\x20activations\x20for\x20RT\x20journey\x20\x27'+_0x24eeaa+_0x11f9fe(0x246),()=>_0x50cb2e[_0x11f9fe(0x1e4)][_0x11f9fe(0x277)](_0x24eeaa),{'verbose':_0x166ab1[_0x11f9fe(0x36f)]}),_0x2c705c=_0x58dd82['data'];console[_0x11f9fe(0x22f)]('✔\x20Resumed\x20activations\x20for\x20RT\x20journey\x20\x27'+_0x2c705c[_0x11f9fe(0x323)]+'\x27');if(_0x166ab1[_0x11f9fe(0x249)]==='json'||_0x166ab1[_0x11f9fe(0x249)]==='jsonl')await handleSDKOutput([_0x2c705c],_0x166ab1);else{const _0x1ba2eb=_0x2c705c['state']===_0x11f9fe(0x312)?'🚀':'📝',_0x360ba3=_0x2c705c[_0x11f9fe(0x374)]?a34_0x2463e0['yellow'](_0x11f9fe(0x30c)):'';console[_0x11f9fe(0x2a3)](_0x1ba2eb+'\x20'+_0x2c705c[_0x11f9fe(0x323)]+_0x360ba3);}return 0x0;}}export class PSRtConfigVersionCommand extends BaseCommand{[a34_0x2fb84d(0x323)]=a34_0x2fb84d(0x298);[a34_0x2fb84d(0x34e)]=a34_0x2fb84d(0x27a);async[a34_0x2fb84d(0x209)](_0x10937c){const _0x1136b3=a34_0x2fb84d,{options:_0x4f38d6,args:_0x2ff88a,tdx:_0x47a990}=_0x10937c,_0x5a237f=_0x2ff88a[0x0]||_0x4f38d6['parentSegment'];if(!_0x5a237f)return showParentSegmentNotSetError(_0x1136b3(0x395)+_0x1136b3(0x2e4)),0x1;_0x4f38d6['verbose']&&(console[_0x1136b3(0x22f)](_0x1136b3(0x301)+_0x4f38d6[_0x1136b3(0x1a1)]),console['error'](_0x1136b3(0x287)+_0x5a237f));const _0x5aeacf=await withSpinner(_0x1136b3(0x1a5)+_0x5a237f+_0x1136b3(0x246),()=>_0x47a990[_0x1136b3(0x372)][_0x1136b3(0x21c)](_0x5a237f),{'verbose':_0x4f38d6[_0x1136b3(0x36f)]}),_0x2178c9=_0x5aeacf[_0x1136b3(0x24f)],_0x42623a=await withSpinner(_0x1136b3(0x272)+_0x5a237f+_0x1136b3(0x246),()=>_0x47a990[_0x1136b3(0x1e4)][_0x1136b3(0x1e2)](_0x2178c9),{'verbose':_0x4f38d6[_0x1136b3(0x36f)]}),_0x2b6d28=_0x42623a[_0x1136b3(0x24f)];return console[_0x1136b3(0x22f)]('✔\x20Retrieved\x20RT\x20configuration\x20version'),_0x4f38d6[_0x1136b3(0x249)]==='json'||_0x4f38d6[_0x1136b3(0x249)]===_0x1136b3(0x1a6)?await handleSDKOutput([_0x2b6d28],_0x4f38d6):(console[_0x1136b3(0x2a3)](_0x1136b3(0x25d)+_0x2b6d28['id']),console[_0x1136b3(0x2a3)]('audienceId:\x20'+_0x2b6d28['audienceId']),console['log'](_0x1136b3(0x222)+_0x2b6d28[_0x1136b3(0x33e)]),console[_0x1136b3(0x2a3)](_0x1136b3(0x24c)+_0x2b6d28[_0x1136b3(0x22d)]),console['log']('status:\x20'+_0x2b6d28[_0x1136b3(0x264)])),0x0;}}export class PSPzServiceListCommand extends BaseCommand{[a34_0x2fb84d(0x323)]=a34_0x2fb84d(0x1f0);[a34_0x2fb84d(0x34e)]='List\x20personalization\x20services\x20for\x20a\x20parent\x20segment';async[a34_0x2fb84d(0x209)](_0x25f51e){const _0x17e1f6=a34_0x2fb84d,{options:_0x1c8130,args:_0x309f6d,tdx:_0x353f2c}=_0x25f51e,_0x180dc5=_0x309f6d[0x0]||_0x1c8130[_0x17e1f6(0x2cb)];if(!_0x180dc5)return showParentSegmentNotSetError(_0x17e1f6(0x1b3)+_0x17e1f6(0x2ef)),0x1;const _0x2b55cd=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x180dc5+_0x17e1f6(0x246),()=>_0x353f2c[_0x17e1f6(0x372)][_0x17e1f6(0x21c)](_0x180dc5),{'verbose':_0x1c8130[_0x17e1f6(0x36f)]}),_0x142159=_0x2b55cd['data'],_0x5dc8f5=await withSpinner(_0x17e1f6(0x2ec)+_0x180dc5+_0x17e1f6(0x246),()=>_0x353f2c[_0x17e1f6(0x2af)]['list'](_0x142159),{'verbose':_0x1c8130[_0x17e1f6(0x36f)]}),_0x35cbda=_0x5dc8f5[_0x17e1f6(0x24f)];console[_0x17e1f6(0x22f)](_0x17e1f6(0x2d2)+_0x35cbda['length']+_0x17e1f6(0x201)+(_0x35cbda['length']!==0x1?'s':''));if(_0x1c8130[_0x17e1f6(0x249)]===_0x17e1f6(0x288)||_0x1c8130[_0x17e1f6(0x249)]===_0x17e1f6(0x1a6))await handleSDKOutput(_0x35cbda,_0x1c8130);else{if(_0x35cbda[_0x17e1f6(0x2e8)]===0x0)console['log'](_0x17e1f6(0x19d)),console[_0x17e1f6(0x22f)](a34_0x2463e0['cyan'](_0x17e1f6(0x39a)));else for(const _0x515943 of _0x35cbda){console[_0x17e1f6(0x2a3)](a34_0x2463e0[_0x17e1f6(0x376)](_0x515943[_0x17e1f6(0x323)])+'\x20'+a34_0x2463e0[_0x17e1f6(0x241)](_0x17e1f6(0x1f6)+_0x515943['id']+')'));_0x515943[_0x17e1f6(0x34e)]&&console[_0x17e1f6(0x2a3)]('\x20\x20'+a34_0x2463e0[_0x17e1f6(0x241)](_0x515943[_0x17e1f6(0x34e)]));if(_0x515943[_0x17e1f6(0x196)]&&_0x515943[_0x17e1f6(0x196)][_0x17e1f6(0x2e8)]>0x0)for(const _0x5a2254 of _0x515943[_0x17e1f6(0x196)]){const _0x234bd9=_0x5a2254['allowedIps']?.['length']?_0x5a2254[_0x17e1f6(0x1ec)][_0x17e1f6(0x31f)](',\x20'):'any';console[_0x17e1f6(0x2a3)]('\x20\x20'+a34_0x2463e0[_0x17e1f6(0x2ea)](_0x17e1f6(0x33b))+'\x20'+_0x5a2254['name']+'\x20'+a34_0x2463e0['dim']('(id:\x20'+_0x5a2254['id']+')')),console[_0x17e1f6(0x2a3)](_0x17e1f6(0x20f)+a34_0x2463e0[_0x17e1f6(0x241)](_0x17e1f6(0x1b7))+'\x20'+_0x234bd9);}else console[_0x17e1f6(0x2a3)]('\x20\x20'+a34_0x2463e0[_0x17e1f6(0x241)](_0x17e1f6(0x2e5)));}}return 0x0;}}export class PSPzServiceCreateCommand extends BaseCommand{[a34_0x2fb84d(0x323)]='ps:pz:service:create';['description']=a34_0x2fb84d(0x21d);async[a34_0x2fb84d(0x209)](_0x4d9e42){const _0xf8081c=a34_0x2fb84d,{options:_0x2ff015,args:_0x50cb46,tdx:_0x2f0474}=_0x4d9e42,_0x1f3ea7=_0x2ff015,_0x2bf4c5=_0x50cb46[0x0],_0x10c1ef=_0x50cb46[0x1]||_0x2ff015[_0xf8081c(0x2cb)];if(!_0x2bf4c5)return console['error'](_0xf8081c(0x348)),console[_0xf8081c(0x22f)](_0xf8081c(0x1e1)),console[_0xf8081c(0x22f)](_0xf8081c(0x269)),0x1;if(!_0x10c1ef)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]\x0a'+_0xf8081c(0x269)),0x1;const _0xc60673=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x10c1ef+'\x27...',()=>_0x2f0474['segment']['resolveParentId'](_0x10c1ef),{'verbose':_0x2ff015['verbose']}),_0x39146d=_0xc60673[_0xf8081c(0x24f)],_0x4db373={'name':_0x2bf4c5,'description':_0x1f3ea7['description'],'public':_0x1f3ea7[_0xf8081c(0x359)]},_0x2feed1=await withSpinner(_0xf8081c(0x39b)+_0x2bf4c5+_0xf8081c(0x246),()=>_0x2f0474[_0xf8081c(0x2af)][_0xf8081c(0x309)](_0x39146d,_0x4db373),{'verbose':_0x2ff015['verbose']}),_0x8068ef=_0x2feed1[_0xf8081c(0x24f)];return console['error'](_0xf8081c(0x284)+_0x8068ef[_0xf8081c(0x323)]+_0xf8081c(0x270)+_0x8068ef['id']),await handleSDKOutput([_0x8068ef],_0x2ff015),0x0;}}export class PSPzServiceShowCommand extends BaseCommand{['name']=a34_0x2fb84d(0x248);[a34_0x2fb84d(0x34e)]='Show\x20personalization\x20service\x20details';async['execute'](_0x399b6e){const _0x1ae660=a34_0x2fb84d,{options:_0x22d51e,args:_0x1a75de,tdx:_0x35b1e6}=_0x399b6e,_0xfd2d3=_0x1a75de[0x0],_0x3a4d50=_0x1a75de[0x1]||_0x22d51e[_0x1ae660(0x2cb)];if(!_0xfd2d3)return console[_0x1ae660(0x22f)](_0x1ae660(0x2da)),console[_0x1ae660(0x22f)](_0x1ae660(0x216)),console[_0x1ae660(0x22f)](_0x1ae660(0x1da)),0x1;if(!_0x3a4d50)return showParentSegmentNotSetError(_0x1ae660(0x245)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;const _0x238c0b=await withSpinner(_0x1ae660(0x1a5)+_0x3a4d50+_0x1ae660(0x246),()=>_0x35b1e6[_0x1ae660(0x372)][_0x1ae660(0x21c)](_0x3a4d50),{'verbose':_0x22d51e[_0x1ae660(0x36f)]}),_0x1a6df3=_0x238c0b['data'],_0x4ded93=await withSpinner('Fetching\x20personalization\x20service\x20\x27'+_0xfd2d3+_0x1ae660(0x246),()=>_0x35b1e6[_0x1ae660(0x2af)][_0x1ae660(0x310)](_0x1a6df3,_0xfd2d3),{'verbose':_0x22d51e[_0x1ae660(0x36f)]}),_0x4f2040=_0x4ded93['data'];if(_0x22d51e[_0x1ae660(0x288)]||_0x22d51e['jsonl'])await handleSDKOutput([_0x4f2040],_0x22d51e);else{console[_0x1ae660(0x2a3)](a34_0x2463e0[_0x1ae660(0x376)](_0x4f2040[_0x1ae660(0x323)])+'\x20'+a34_0x2463e0[_0x1ae660(0x241)]('(id:\x20'+_0x4f2040['id']+')'));_0x4f2040[_0x1ae660(0x34e)]&&console['log']('\x20\x20'+a34_0x2463e0['dim'](_0x4f2040['description']));console[_0x1ae660(0x2a3)]('\x20\x20'+a34_0x2463e0[_0x1ae660(0x2ea)]('public:')+'\x20'+(_0x4f2040['public']?_0x1ae660(0x38d):'no'));if(_0x4f2040[_0x1ae660(0x196)]&&_0x4f2040['tokens'][_0x1ae660(0x2e8)]>0x0)for(const _0x39ef5f of _0x4f2040['tokens']){const _0x11870d=_0x39ef5f[_0x1ae660(0x1ec)]?.['length']?_0x39ef5f[_0x1ae660(0x1ec)][_0x1ae660(0x31f)](',\x20'):'any';console[_0x1ae660(0x2a3)]('\x20\x20'+a34_0x2463e0[_0x1ae660(0x2ea)](_0x1ae660(0x33b))+'\x20'+_0x39ef5f[_0x1ae660(0x323)]+'\x20'+a34_0x2463e0[_0x1ae660(0x241)](_0x1ae660(0x1f6)+_0x39ef5f['id']+')')),console[_0x1ae660(0x2a3)](_0x1ae660(0x20f)+a34_0x2463e0[_0x1ae660(0x241)](_0x1ae660(0x1b7))+'\x20'+_0x11870d);}else console[_0x1ae660(0x2a3)]('\x20\x20'+a34_0x2463e0[_0x1ae660(0x241)](_0x1ae660(0x2e5)));}return 0x0;}}function a34_0xd65f(_0x35c41c,_0x59b417){_0x35c41c=_0x35c41c-0x187;const _0x263419=a34_0x2634();let _0xd65f65=_0x263419[_0x35c41c];return _0xd65f65;}export class PSPzServiceDeleteCommand extends BaseCommand{[a34_0x2fb84d(0x323)]=a34_0x2fb84d(0x18d);['description']=a34_0x2fb84d(0x1cd);async[a34_0x2fb84d(0x209)](_0x4fb416){const _0x1882a0=a34_0x2fb84d,{options:_0x300afc,args:_0x3c9d89,tdx:_0x4aed3e}=_0x4fb416,_0x526784=_0x3c9d89[0x0],_0x24f9b3=_0x3c9d89[0x1]||_0x300afc['parentSegment'];if(!_0x526784)return console[_0x1882a0(0x22f)](_0x1882a0(0x2da)),console[_0x1882a0(0x22f)](_0x1882a0(0x315)),console[_0x1882a0(0x22f)](_0x1882a0(0x1fb)),0x1;if(!_0x24f9b3)return showParentSegmentNotSetError(_0x1882a0(0x1d1)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;const _0x1d4d24=await withSpinner(_0x1882a0(0x1a5)+_0x24f9b3+_0x1882a0(0x246),()=>_0x4aed3e[_0x1882a0(0x372)][_0x1882a0(0x21c)](_0x24f9b3),{'verbose':_0x300afc['verbose']}),_0x21a5be=_0x1d4d24[_0x1882a0(0x24f)];return await withSpinner(_0x1882a0(0x290)+_0x526784+_0x1882a0(0x246),()=>_0x4aed3e['personalization'][_0x1882a0(0x306)](_0x21a5be,_0x526784),{'verbose':_0x300afc[_0x1882a0(0x36f)]}),console[_0x1882a0(0x22f)](_0x1882a0(0x3a2)+_0x526784+'\x27'),0x0;}}export class PSPzServiceUpdateCommand extends BaseCommand{[a34_0x2fb84d(0x323)]=a34_0x2fb84d(0x35b);[a34_0x2fb84d(0x34e)]=a34_0x2fb84d(0x23a);async['execute'](_0x3ce44c){const _0x3e9e99=a34_0x2fb84d,{options:_0x10dd13,args:_0x996b5f,tdx:_0x2aada8}=_0x3ce44c,_0x59bf27=_0x10dd13,_0x21951a=_0x996b5f[0x0],_0x2f89ea=_0x996b5f[0x1]||_0x10dd13[_0x3e9e99(0x2cb)];if(!_0x21951a)return console[_0x3e9e99(0x22f)](_0x3e9e99(0x2da)),console[_0x3e9e99(0x22f)](_0x3e9e99(0x215)),console[_0x3e9e99(0x22f)](_0x3e9e99(0x32a)),0x1;if(!_0x59bf27['name'])return console[_0x3e9e99(0x22f)]('Error:\x20--name\x20is\x20required'),console[_0x3e9e99(0x22f)](_0x3e9e99(0x215)),0x1;if(!_0x2f89ea)return showParentSegmentNotSetError(_0x3e9e99(0x27c)+_0x3e9e99(0x32a)),0x1;const _0x43debd=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x2f89ea+_0x3e9e99(0x246),()=>_0x2aada8[_0x3e9e99(0x372)][_0x3e9e99(0x21c)](_0x2f89ea),{'verbose':_0x10dd13[_0x3e9e99(0x36f)]}),_0x2994fe=_0x43debd[_0x3e9e99(0x24f)],_0x4129f5={'name':_0x59bf27[_0x3e9e99(0x323)]};_0x59bf27[_0x3e9e99(0x34e)]!==undefined&&(_0x4129f5[_0x3e9e99(0x34e)]=_0x59bf27['description']);const _0xcf2ae6=await withSpinner(_0x3e9e99(0x328)+_0x21951a+'\x27...',()=>_0x2aada8[_0x3e9e99(0x2af)][_0x3e9e99(0x202)](_0x2994fe,_0x21951a,_0x4129f5),{'verbose':_0x10dd13['verbose']}),_0x157734=_0xcf2ae6['data'];return console[_0x3e9e99(0x22f)](_0x3e9e99(0x2fa)+_0x157734[_0x3e9e99(0x323)]+'\x27'),await handleSDKOutput([_0x157734],_0x10dd13),0x0;}}export class PSPzServiceTokenCreateCommand extends BaseCommand{['name']=a34_0x2fb84d(0x2e6);[a34_0x2fb84d(0x34e)]=a34_0x2fb84d(0x258);async[a34_0x2fb84d(0x209)](_0x397652){const _0x402fd9=a34_0x2fb84d,{options:_0x48cdb1,args:_0x11d295,tdx:_0x173913}=_0x397652,_0x541b72=_0x48cdb1,_0x29eae9=_0x11d295[0x0],_0x5892bf=_0x11d295[0x1],_0x5956f6=_0x11d295[0x2]||_0x48cdb1[_0x402fd9(0x2cb)];if(!_0x29eae9)return console['error'](_0x402fd9(0x1b0)),console[_0x402fd9(0x22f)](_0x402fd9(0x22a)),console['error'](_0x402fd9(0x1bd)),0x1;if(!_0x5892bf)return console['error']('Error:\x20Service\x20ID\x20is\x20required'),console['error'](_0x402fd9(0x22a)),console[_0x402fd9(0x22f)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x5956f6)return showParentSegmentNotSetError(_0x402fd9(0x2a1)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;const _0x309bf7=await withSpinner(_0x402fd9(0x1a5)+_0x5956f6+_0x402fd9(0x246),()=>_0x173913[_0x402fd9(0x372)][_0x402fd9(0x21c)](_0x5956f6),{'verbose':_0x48cdb1[_0x402fd9(0x36f)]}),_0x63b328=_0x309bf7['data'],_0x50cfc7={'name':_0x29eae9};_0x541b72[_0x402fd9(0x1ec)]&&(_0x50cfc7[_0x402fd9(0x1ec)]=_0x541b72[_0x402fd9(0x1ec)][_0x402fd9(0x278)](',')[_0x402fd9(0x2b6)](_0x1b97a6=>_0x1b97a6['trim']()));_0x541b72[_0x402fd9(0x34e)]&&(_0x50cfc7['description']=_0x541b72['description']);const _0x2ddb2d=await withSpinner(_0x402fd9(0x343)+_0x29eae9+_0x402fd9(0x1b5)+_0x5892bf+_0x402fd9(0x246),()=>_0x173913[_0x402fd9(0x2af)][_0x402fd9(0x352)](_0x63b328,_0x5892bf,_0x50cfc7),{'verbose':_0x48cdb1[_0x402fd9(0x36f)]}),_0x1eff6b=_0x2ddb2d[_0x402fd9(0x24f)];return console['error'](_0x402fd9(0x27f)+_0x1eff6b[_0x402fd9(0x323)]+_0x402fd9(0x270)+_0x1eff6b['id']),_0x1eff6b[_0x402fd9(0x217)]&&(console[_0x402fd9(0x22f)](a34_0x2463e0['yellow'](_0x402fd9(0x243))),console['error'](a34_0x2463e0[_0x402fd9(0x2ea)](_0x1eff6b[_0x402fd9(0x217)])),console['error']('')),await handleSDKOutput([_0x1eff6b],_0x48cdb1),0x0;}}export class PSPzServiceTokenDeleteCommand extends BaseCommand{['name']=a34_0x2fb84d(0x3a1);[a34_0x2fb84d(0x34e)]=a34_0x2fb84d(0x2fc);async[a34_0x2fb84d(0x209)](_0x18466c){const _0x128440=a34_0x2fb84d,{options:_0x27f16e,args:_0x4fcdc0,tdx:_0x478a4d}=_0x18466c,_0x36c3de=_0x4fcdc0[0x0],_0x5e1a68=_0x4fcdc0[0x1]||_0x27f16e[_0x128440(0x2cb)];if(!_0x36c3de)return console[_0x128440(0x22f)](_0x128440(0x2ab)),console[_0x128440(0x22f)](_0x128440(0x35f)),console[_0x128440(0x22f)](_0x128440(0x31d)),0x1;if(!_0x5e1a68)return showParentSegmentNotSetError(_0x128440(0x239)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context'),0x1;const _0x5009b4=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x5e1a68+_0x128440(0x246),()=>_0x478a4d[_0x128440(0x372)][_0x128440(0x21c)](_0x5e1a68),{'verbose':_0x27f16e[_0x128440(0x36f)]}),_0x1f4a62=_0x5009b4[_0x128440(0x24f)],_0x1e0992=await withSpinner(_0x128440(0x367),()=>_0x478a4d[_0x128440(0x2af)][_0x128440(0x1fe)](_0x1f4a62),{'verbose':_0x27f16e[_0x128440(0x36f)]}),_0x458adb=_0x1e0992[_0x128440(0x24f)];let _0x29691c;for(const _0x4eae4b of _0x458adb){if(_0x4eae4b[_0x128440(0x196)]?.[_0x128440(0x21e)](_0x204db5=>_0x204db5['id']===_0x36c3de)){_0x29691c=_0x4eae4b['id'];break;}}if(!_0x29691c)return console[_0x128440(0x22f)](_0x128440(0x187)+_0x36c3de+_0x128440(0x36c)),0x1;const _0x58e78c=await withSpinner('Deleting\x20token\x20\x27'+_0x36c3de+'\x27...',()=>_0x478a4d['personalization'][_0x128440(0x332)](_0x1f4a62,_0x29691c,_0x36c3de),{'verbose':_0x27f16e[_0x128440(0x36f)]}),_0x35be17=_0x58e78c['data'];return console[_0x128440(0x22f)]('✔\x20Deleted\x20token\x20\x27'+(_0x35be17[_0x128440(0x323)]||_0x36c3de)+'\x27'),await handleSDKOutput([_0x35be17],_0x27f16e),0x0;}}export class PSPzListCommand extends BaseCommand{['name']=a34_0x2fb84d(0x386);[a34_0x2fb84d(0x34e)]=a34_0x2fb84d(0x1e6);async[a34_0x2fb84d(0x209)](_0x1fdd9e){const _0x45cb43=a34_0x2fb84d,{options:_0x4f194d,args:_0x15e4ba,tdx:_0x5823c0}=_0x1fdd9e,_0x303be3=_0x15e4ba[0x0]||_0x4f194d[_0x45cb43(0x2cb)];if(!_0x303be3)return showParentSegmentNotSetError('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'+_0x45cb43(0x2ce)),0x1;const _0x48a35f=await withSpinner(_0x45cb43(0x1a5)+_0x303be3+_0x45cb43(0x246),()=>_0x5823c0[_0x45cb43(0x372)][_0x45cb43(0x21c)](_0x303be3),{'verbose':_0x4f194d[_0x45cb43(0x36f)]}),_0x31903b=_0x48a35f[_0x45cb43(0x24f)],_0x2f45a5=await withSpinner('Listing\x20personalizations\x20for\x20\x27'+_0x303be3+_0x45cb43(0x246),()=>_0x5823c0['personalization'][_0x45cb43(0x20e)](_0x31903b),{'verbose':_0x4f194d[_0x45cb43(0x36f)]}),_0x9e3776=_0x2f45a5[_0x45cb43(0x24f)];console[_0x45cb43(0x22f)]('✔\x20Found\x20'+_0x9e3776['length']+_0x45cb43(0x2ac)+(_0x9e3776['length']!==0x1?'s':''));if(_0x4f194d[_0x45cb43(0x249)]===_0x45cb43(0x288)||_0x4f194d['format']==='jsonl')await handleSDKOutput(_0x9e3776,_0x4f194d);else{if(_0x9e3776[_0x45cb43(0x2e8)]===0x0)console[_0x45cb43(0x2a3)](_0x45cb43(0x1fa));else for(const _0x131e4e of _0x9e3776){console[_0x45cb43(0x2a3)](a34_0x2463e0[_0x45cb43(0x376)](_0x131e4e['name'])+'\x20'+a34_0x2463e0['dim'](_0x45cb43(0x1f6)+_0x131e4e['id']+')'));_0x131e4e[_0x45cb43(0x34e)]&&console['log']('\x20\x20'+a34_0x2463e0[_0x45cb43(0x241)](_0x131e4e[_0x45cb43(0x34e)]));const _0x27dd10=_0x131e4e['sections']?.[_0x45cb43(0x2e8)]||0x0;console[_0x45cb43(0x2a3)]('\x20\x20'+a34_0x2463e0[_0x45cb43(0x2ea)]('sections:')+'\x20'+_0x27dd10);if(_0x131e4e[_0x45cb43(0x2b7)]&&_0x131e4e['sections']['length']>0x0)for(const _0x155680 of _0x131e4e[_0x45cb43(0x2b7)]){console[_0x45cb43(0x2a3)](_0x45cb43(0x2ee)+_0x155680[_0x45cb43(0x323)]);}}}return 0x0;}}export class PSPzShowCommand extends BaseCommand{['name']=a34_0x2fb84d(0x37d);[a34_0x2fb84d(0x34e)]=a34_0x2fb84d(0x262);async[a34_0x2fb84d(0x209)](_0x431fda){const _0x11646f=a34_0x2fb84d,{options:_0x203055,args:_0x41e70a,tdx:_0x46b3d4}=_0x431fda,_0x184b4f=_0x41e70a[0x0];if(!_0x184b4f)return console['error'](_0x11646f(0x297)),console[_0x11646f(0x22f)](_0x11646f(0x34d)),0x1;const _0x4cebb1=await withSpinner(_0x11646f(0x210)+_0x184b4f+_0x11646f(0x246),()=>_0x46b3d4[_0x11646f(0x2af)][_0x11646f(0x350)](_0x184b4f),{'verbose':_0x203055['verbose']}),_0x3e76f9=_0x4cebb1[_0x11646f(0x24f)];console[_0x11646f(0x22f)]('✔\x20Found\x20personalization\x20\x27'+_0x3e76f9['name']+'\x27');if(_0x203055[_0x11646f(0x249)]===_0x11646f(0x288)||_0x203055[_0x11646f(0x249)]===_0x11646f(0x1a6))await handleSDKOutput([_0x3e76f9],_0x203055);else{console[_0x11646f(0x2a3)](a34_0x2463e0['bold'](_0x3e76f9['name'])+'\x20'+a34_0x2463e0[_0x11646f(0x241)](_0x11646f(0x1f6)+_0x3e76f9['id']+')'));_0x3e76f9[_0x11646f(0x34e)]&&console[_0x11646f(0x2a3)]('\x20\x20'+a34_0x2463e0[_0x11646f(0x241)](_0x3e76f9[_0x11646f(0x34e)]));_0x3e76f9[_0x11646f(0x1bc)]&&console[_0x11646f(0x2a3)]('\x20\x20'+a34_0x2463e0['cyan'](_0x11646f(0x18a))+'\x20'+_0x3e76f9[_0x11646f(0x1bc)]);console[_0x11646f(0x2a3)]('\x20\x20'+a34_0x2463e0[_0x11646f(0x2ea)](_0x11646f(0x30d))+'\x20'+_0x3e76f9['createdAt']),console['log']('\x20\x20'+a34_0x2463e0[_0x11646f(0x2ea)]('updated:')+'\x20'+_0x3e76f9[_0x11646f(0x37c)]);const _0x5a8c7b=_0x3e76f9['sections']?.[_0x11646f(0x2e8)]||0x0;console[_0x11646f(0x2a3)]('\x20\x20'+a34_0x2463e0[_0x11646f(0x2ea)](_0x11646f(0x1c4))+'\x20'+_0x5a8c7b);if(_0x3e76f9['sections']&&_0x3e76f9[_0x11646f(0x2b7)][_0x11646f(0x2e8)]>0x0)for(const _0x2a31c7 of _0x3e76f9['sections']){console[_0x11646f(0x2a3)]('\x20\x20\x20\x20'+a34_0x2463e0[_0x11646f(0x376)](_0x2a31c7[_0x11646f(0x323)])+'\x20'+a34_0x2463e0['dim'](_0x11646f(0x1f6)+_0x2a31c7['id']+')')),_0x2a31c7[_0x11646f(0x1cf)]&&(console[_0x11646f(0x2a3)]('\x20\x20\x20\x20\x20\x20'+a34_0x2463e0['cyan'](_0x11646f(0x24b))+'\x20'+_0x2a31c7[_0x11646f(0x1cf)]['name']),_0x2a31c7['entryCriteria'][_0x11646f(0x314)]?.[_0x11646f(0x2b4)]&&console[_0x11646f(0x2a3)](_0x11646f(0x2e7)+a34_0x2463e0[_0x11646f(0x2ea)](_0x11646f(0x38b))+'\x20'+_0x2a31c7[_0x11646f(0x1cf)][_0x11646f(0x314)][_0x11646f(0x2b4)])),_0x2a31c7[_0x11646f(0x389)]&&console[_0x11646f(0x2a3)](_0x11646f(0x2c6)+a34_0x2463e0['cyan']('payload:')+'\x20'+JSON[_0x11646f(0x1e9)](_0x2a31c7[_0x11646f(0x389)])),_0x2a31c7[_0x11646f(0x1ac)]&&console[_0x11646f(0x2a3)](_0x11646f(0x2c6)+a34_0x2463e0[_0x11646f(0x2ea)](_0x11646f(0x2d5))+_0x11646f(0x227));}}return 0x0;}}export class PSPzDeleteCommand extends BaseCommand{[a34_0x2fb84d(0x323)]=a34_0x2fb84d(0x2dd);[a34_0x2fb84d(0x34e)]=a34_0x2fb84d(0x276);async[a34_0x2fb84d(0x209)](_0x6e6b58){const _0xb25bb8=a34_0x2fb84d,{options:_0x1fcf0e,args:_0x46dbb1,tdx:_0x47dba1}=_0x6e6b58,_0x7733fb=_0x46dbb1[0x0];if(!_0x7733fb)return console[_0xb25bb8(0x22f)]('Error:\x20Personalization\x20ID\x20is\x20required'),console[_0xb25bb8(0x22f)](_0xb25bb8(0x1c8)),0x1;return await withSpinner(_0xb25bb8(0x251)+_0x7733fb+'\x27...',()=>_0x47dba1[_0xb25bb8(0x2af)]['deletePersonalization'](_0x7733fb),{'verbose':_0x1fcf0e[_0xb25bb8(0x36f)]}),console[_0xb25bb8(0x22f)]('✔\x20Deleted\x20personalization\x20\x27'+_0x7733fb+'\x27'),0x0;}}export class PSPzCreateCommand extends BaseCommand{[a34_0x2fb84d(0x323)]=a34_0x2fb84d(0x335);[a34_0x2fb84d(0x34e)]=a34_0x2fb84d(0x1ff);async[a34_0x2fb84d(0x209)](_0x4458fe){const _0x8b43d5=a34_0x2fb84d,{options:_0x31b125,tdx:_0x37027f}=_0x4458fe,_0x2bcade=_0x31b125;let _0x17b9df;if(_0x2bcade['file']){_0x17b9df=await loadJSON(_0x2bcade[_0x8b43d5(0x1e8)],!![]);if(!_0x17b9df['relationships']?.[_0x8b43d5(0x349)])return console[_0x8b43d5(0x22f)]('Error:\x20\x22relationships.parentFolder\x22\x20is\x20required\x20in\x20the\x20JSON\x20file.'),console[_0x8b43d5(0x22f)](_0x8b43d5(0x2d0)),console[_0x8b43d5(0x22f)]('\x20\x20\x22relationships\x22:\x20{\x20\x22parentFolder\x22:\x20{\x20\x22data\x22:\x20{\x20\x22id\x22:\x20\x22<id>\x22,\x20\x22type\x22:\x20\x22folder-segment\x22\x20}\x20}\x20}'),0x1;}else{if(!_0x2bcade[_0x8b43d5(0x323)])return console[_0x8b43d5(0x22f)]('Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)'),console['error'](_0x8b43d5(0x1e0)),console[_0x8b43d5(0x22f)](_0x8b43d5(0x399)),0x1;if(_0x2bcade[_0x8b43d5(0x34e)]===undefined)return console[_0x8b43d5(0x22f)](_0x8b43d5(0x363)),console[_0x8b43d5(0x22f)]('Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]'),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>'),0x1;if(_0x2bcade[_0x8b43d5(0x1ab)]===undefined)return console[_0x8b43d5(0x22f)](_0x8b43d5(0x2b8)),console[_0x8b43d5(0x22f)](_0x8b43d5(0x274)),0x1;let _0x1c077f=_0x2bcade[_0x8b43d5(0x1bc)];if(!_0x1c077f&&_0x31b125[_0x8b43d5(0x2cb)]){const _0x1abfcb=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x31b125[_0x8b43d5(0x2cb)]+'\x27...',()=>_0x37027f[_0x8b43d5(0x372)]['resolveParentId'](_0x31b125[_0x8b43d5(0x2cb)]),{'verbose':_0x31b125[_0x8b43d5(0x36f)]});_0x1c077f=_0x1abfcb[_0x8b43d5(0x24f)];}let _0x49a571;_0x2bcade[_0x8b43d5(0x2b7)]&&(_0x49a571=await loadJSON(_0x2bcade['sections'],![]));const _0x3b5af4=_0x2bcade['folderId']===_0x8b43d5(0x1d3)?null:{'id':_0x2bcade[_0x8b43d5(0x1ab)],'type':'folder-segment'};_0x17b9df={'attributes':{'name':_0x2bcade['name'],'description':_0x2bcade[_0x8b43d5(0x34e)]||null,..._0x1c077f!==undefined&&{'audienceId':_0x1c077f},..._0x49a571!==undefined&&{'sections':_0x49a571}},'relationships':{'parentFolder':{'data':_0x3b5af4}}};}const _0xbc2e96=await withSpinner(_0x8b43d5(0x28b)+(_0x17b9df[_0x8b43d5(0x205)]?.[_0x8b43d5(0x323)]??'')+_0x8b43d5(0x246),()=>_0x37027f[_0x8b43d5(0x2af)][_0x8b43d5(0x18e)](_0x17b9df),{'verbose':_0x31b125[_0x8b43d5(0x36f)]}),_0x5ea617=_0xbc2e96['data'];return console[_0x8b43d5(0x22f)](_0x8b43d5(0x224)+_0x5ea617['name']+_0x8b43d5(0x270)+_0x5ea617['id']),await handleSDKOutput([_0x5ea617],_0x31b125),0x0;}}export class PSPzPatchCommand extends BaseCommand{[a34_0x2fb84d(0x323)]=a34_0x2fb84d(0x200);['description']=a34_0x2fb84d(0x342);async[a34_0x2fb84d(0x209)](_0x312e80){const _0x128661=a34_0x2fb84d,{options:_0x1657f1,args:_0x598bfc}=_0x312e80,_0x3f5132=_0x1657f1,_0x3f545c=_0x598bfc[0x0];if(!_0x3f545c)return console[_0x128661(0x22f)](_0x128661(0x297)),console[_0x128661(0x22f)](_0x128661(0x320)),console[_0x128661(0x22f)](_0x128661(0x2d3)),0x1;let _0x4c5fd9;if(_0x3f5132['file'])_0x4c5fd9=await loadJSON(_0x3f5132[_0x128661(0x1e8)],!![]);else{if(!_0x3f5132[_0x128661(0x323)])return console[_0x128661(0x22f)](_0x128661(0x35a)),console[_0x128661(0x22f)](_0x128661(0x320)),0x1;if(_0x3f5132[_0x128661(0x34e)]===undefined)return console[_0x128661(0x22f)]('Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)'),console[_0x128661(0x22f)](_0x128661(0x320)),0x1;let _0x3c50db;_0x3f5132[_0x128661(0x2b7)]&&(_0x3c50db=await loadJSON(_0x3f5132[_0x128661(0x2b7)],![])),_0x4c5fd9={'attributes':{'name':_0x3f5132[_0x128661(0x323)],'description':_0x3f5132[_0x128661(0x34e)]||null,..._0x3c50db!==undefined&&{'sections':_0x3c50db}}};}const {tdx:_0x444da3}=_0x312e80,_0x2d4691=await withSpinner(_0x128661(0x3a0)+_0x3f545c+_0x128661(0x246),()=>_0x444da3['personalization'][_0x128661(0x273)](_0x3f545c,_0x4c5fd9),{'verbose':_0x1657f1['verbose']}),_0x15be23=_0x2d4691[_0x128661(0x24f)];return console[_0x128661(0x22f)](_0x128661(0x34b)+_0x15be23[_0x128661(0x323)]+_0x128661(0x296)+_0x15be23['id']+')'),await handleSDKOutput([_0x15be23],_0x1657f1),0x0;}}export class PSPzInitCommand extends BaseParentSegmentCommand{[a34_0x2fb84d(0x323)]='ps:pz:init';['description']=a34_0x2fb84d(0x2f2);async[a34_0x2fb84d(0x209)](_0x5394d2){const _0x5e3d49=a34_0x2fb84d,{options:_0x389d87,args:_0x371790}=_0x5394d2,_0xf48271=_0x371790[0x0]||_0x389d87['parentSegment'];if(!_0xf48271)return showParentSegmentNotSetError(_0x5e3d49(0x231)+'\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 _0x252b56=resolveYamlFile(_0xf48271);if(!existsSync(_0x252b56))return showFileNotFoundError(_0x252b56,_0xf48271),0x1;let _0x2f21dd;try{_0x2f21dd=readFileSync(_0x252b56,_0x5e3d49(0x353));}catch(_0x457e86){const _0x1d3fa6=_0x457e86 instanceof Error?_0x457e86[_0x5e3d49(0x299)]:String(_0x457e86);return console[_0x5e3d49(0x22f)]('Error\x20reading\x20file:\x20'+_0x1d3fa6),0x1;}let _0xaf914;try{_0xaf914=parseDef(_0x2f21dd);}catch(_0x558e0c){const _0xa7d662=_0x558e0c instanceof Error?_0x558e0c[_0x5e3d49(0x299)]:String(_0x558e0c);return console['error'](a34_0x2463e0[_0x5e3d49(0x1b1)](_0x5e3d49(0x1dd)+_0xa7d662)),0x1;}if(_0xaf914['personalization_services']&&_0xaf914['personalization_services'][_0x5e3d49(0x2e8)]>0x0)return console['error'](a34_0x2463e0['yellow'](_0x5e3d49(0x2a9)+_0x252b56)),console[_0x5e3d49(0x22f)](a34_0x2463e0[_0x5e3d49(0x241)]('\x20\x20\x20'+_0xaf914['personalization_services'][_0x5e3d49(0x2e8)]+_0x5e3d49(0x35e))),0x1;!_0xaf914[_0x5e3d49(0x1e4)]&&(_0xaf914[_0x5e3d49(0x1e4)]={'events':[{'name':_0x5e3d49(0x347),'source_table':_0x5e3d49(0x39d)}],'attributes':[{'name':_0x5e3d49(0x29d),'type':_0x5e3d49(0x34c)}],'id_stitching':{'primary_key':_0xaf914['master'][_0x5e3d49(0x30f)]===_0x5e3d49(0x307)?_0x5e3d49(0x256):_0x5e3d49(0x242)}});_0xaf914[_0x5e3d49(0x2ed)]=[{'name':_0x5e3d49(0x2ad),'description':_0x5e3d49(0x313),'trigger_event':_0x5e3d49(0x347),'sections':[{'name':_0x5e3d49(0x361),'criteria':'true','attributes':[_0x5e3d49(0x29d)]}]}];const _0x311ddb=serializeDef(_0xaf914);return writeFileSync(_0x252b56,_0x311ddb,_0x5e3d49(0x353)),console['error'](a34_0x2463e0[_0x5e3d49(0x2f0)]('✔')+'\x20Added\x20personalization\x20template\x20to\x20'+a34_0x2463e0[_0x5e3d49(0x2ea)](_0x252b56)),(!_0xaf914['realtime']||_0x2f21dd[_0x5e3d49(0x302)](_0x5e3d49(0x194))===-0x1)&&console[_0x5e3d49(0x22f)](a34_0x2463e0['green']('✔')+_0x5e3d49(0x1b6)),console[_0x5e3d49(0x22f)]('\x0a'+a34_0x2463e0['dim'](_0x5e3d49(0x34f))),console[_0x5e3d49(0x22f)](_0x5e3d49(0x316)+_0x252b56+_0x5e3d49(0x292)),console[_0x5e3d49(0x22f)](_0x5e3d49(0x247)+a34_0x2463e0[_0x5e3d49(0x241)](_0x5e3d49(0x2b0)+_0xf48271)+'\x20to\x20push\x20the\x20configuration'),0x0;}}