@treasuredata/tdx 2026.6.4 → 2026.6.5

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 (241) 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.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/agent-command.js +1 -1
  9. package/dist/commands/agent-test-command.js +1 -1
  10. package/dist/commands/api-command.js +1 -1
  11. package/dist/commands/auth-command.js +1 -1
  12. package/dist/commands/cas-command.js +1 -1
  13. package/dist/commands/cas-segment-command.js +1 -1
  14. package/dist/commands/chat-command.js +1 -1
  15. package/dist/commands/claude-command.js +1 -1
  16. package/dist/commands/claude-statusline-command.js +1 -1
  17. package/dist/commands/claude-usage-command.js +1 -1
  18. package/dist/commands/command.js +1 -1
  19. package/dist/commands/connection-command.js +1 -1
  20. package/dist/commands/databases.js +1 -1
  21. package/dist/commands/delivery-command.js +1 -1
  22. package/dist/commands/describe.js +1 -1
  23. package/dist/commands/engage-campaign-pull-command.js +1 -1
  24. package/dist/commands/engage-campaign-push-command.js +1 -1
  25. package/dist/commands/engage-campaign-validate-command.js +1 -1
  26. package/dist/commands/engage-command.js +1 -1
  27. package/dist/commands/engage-template-pull-command.js +1 -1
  28. package/dist/commands/engage-template-push-command.js +1 -1
  29. package/dist/commands/engage-template-validate-command.js +1 -1
  30. package/dist/commands/job-command.js +1 -1
  31. package/dist/commands/journey-command.js +1 -1
  32. package/dist/commands/journey-validate-command.js +1 -1
  33. package/dist/commands/llm-command.js +1 -1
  34. package/dist/commands/mcp-command.js +1 -1
  35. package/dist/commands/parent-segment-command.js +1 -1
  36. package/dist/commands/policy-command.js +1 -1
  37. package/dist/commands/profile-command.js +1 -1
  38. package/dist/commands/profiles-command.js +1 -1
  39. package/dist/commands/query-command.js +1 -1
  40. package/dist/commands/schedule-command.js +1 -1
  41. package/dist/commands/segment-command.js +1 -1
  42. package/dist/commands/segment-create-command.js +1 -1
  43. package/dist/commands/segment-fields-command.js +1 -1
  44. package/dist/commands/segment-move-command.d.ts +19 -0
  45. package/dist/commands/segment-move-command.d.ts.map +1 -0
  46. package/dist/commands/segment-move-command.js +1 -0
  47. package/dist/commands/segment-move-command.js.map +1 -0
  48. package/dist/commands/segment-pull-command.js +1 -1
  49. package/dist/commands/segment-push-command.js +1 -1
  50. package/dist/commands/segment-update-command.js +1 -1
  51. package/dist/commands/segment-use-command.js +1 -1
  52. package/dist/commands/segment-validate-command.js +1 -1
  53. package/dist/commands/segments.js +1 -1
  54. package/dist/commands/show.js +1 -1
  55. package/dist/commands/status-command.js +1 -1
  56. package/dist/commands/table-deleted.js +1 -1
  57. package/dist/commands/tables.js +1 -1
  58. package/dist/commands/unset-command.js +1 -1
  59. package/dist/commands/upgrade-command.js +1 -1
  60. package/dist/commands/use-command.js +1 -1
  61. package/dist/commands/user-command.js +1 -1
  62. package/dist/commands/work-command.js +1 -1
  63. package/dist/commands/workflow-command.js +1 -1
  64. package/dist/core/auth.js +1 -1
  65. package/dist/core/command-output.js +1 -1
  66. package/dist/core/config.js +1 -1
  67. package/dist/core/connection-cache.js +1 -1
  68. package/dist/core/constants.js +1 -1
  69. package/dist/core/credential-cache.js +1 -1
  70. package/dist/core/global-context.js +1 -1
  71. package/dist/core/keychain.js +1 -1
  72. package/dist/core/oauth-keychain.js +1 -1
  73. package/dist/core/oauth.js +1 -1
  74. package/dist/core/profile.js +1 -1
  75. package/dist/core/project-config.js +1 -1
  76. package/dist/core/session.js +1 -1
  77. package/dist/core/user-cache.js +1 -1
  78. package/dist/core/version.js +1 -1
  79. package/dist/index.js +1 -1
  80. package/dist/mcp/server.js +1 -1
  81. package/dist/mcp/tools/index.js +1 -1
  82. package/dist/mcp/tools/tdx-run.js +1 -1
  83. package/dist/mcp/tools/tdx-search.js +1 -1
  84. package/dist/mcp/tools/work-create-item.js +1 -1
  85. package/dist/mcp/utils.js +1 -1
  86. package/dist/proxy/claude-usage-tracker.js +1 -1
  87. package/dist/proxy/passthrough-server.js +1 -1
  88. package/dist/proxy/sse-usage-parser.js +1 -1
  89. package/dist/sdk/agent/agent-config.js +1 -1
  90. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  91. package/dist/sdk/agent/agent-yaml.js +1 -1
  92. package/dist/sdk/agent/test/evaluator.js +1 -1
  93. package/dist/sdk/agent/test/executor.js +1 -1
  94. package/dist/sdk/agent/test/index.js +1 -1
  95. package/dist/sdk/agent/test/output.js +1 -1
  96. package/dist/sdk/agent/test/parser.js +1 -1
  97. package/dist/sdk/agent/tool-target-registry.js +1 -1
  98. package/dist/sdk/api.js +1 -1
  99. package/dist/sdk/cas/cas-api-client.js +1 -1
  100. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  101. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  102. package/dist/sdk/cas/index.js +1 -1
  103. package/dist/sdk/cas/pull-workflow.js +1 -1
  104. package/dist/sdk/cas/push-workflow.js +1 -1
  105. package/dist/sdk/client/cdp-api-client.d.ts +18 -0
  106. package/dist/sdk/client/cdp-api-client.d.ts.map +1 -1
  107. package/dist/sdk/client/cdp-api-client.js +1 -1
  108. package/dist/sdk/client/cdp-api-client.js.map +1 -1
  109. package/dist/sdk/client/delivery-api-client.js +1 -1
  110. package/dist/sdk/client/endpoints.js +1 -1
  111. package/dist/sdk/client/engage-api-client.js +1 -1
  112. package/dist/sdk/client/http-client.js +1 -1
  113. package/dist/sdk/client/llm-api-client.js +1 -1
  114. package/dist/sdk/client/oauth-refresh.js +1 -1
  115. package/dist/sdk/client/rate-limiter.js +1 -1
  116. package/dist/sdk/client/td-api-client.js +1 -1
  117. package/dist/sdk/client/trino-api-client.js +1 -1
  118. package/dist/sdk/client/workflow-client.js +1 -1
  119. package/dist/sdk/connection-validator.js +1 -1
  120. package/dist/sdk/connection.js +1 -1
  121. package/dist/sdk/delivery.js +1 -1
  122. package/dist/sdk/engage/campaign-pull.js +1 -1
  123. package/dist/sdk/engage/campaign-push.js +1 -1
  124. package/dist/sdk/engage/campaign-validator.js +1 -1
  125. package/dist/sdk/engage/campaign-yaml.js +1 -1
  126. package/dist/sdk/engage/template-pull.js +1 -1
  127. package/dist/sdk/engage/template-push.js +1 -1
  128. package/dist/sdk/engage/template-validator.js +1 -1
  129. package/dist/sdk/engage/template-yaml.js +1 -1
  130. package/dist/sdk/engage/types/campaign-def.js +1 -1
  131. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  132. package/dist/sdk/engage/types/template-schema.js +1 -1
  133. package/dist/sdk/engage.js +1 -1
  134. package/dist/sdk/errors.js +1 -1
  135. package/dist/sdk/index.js +1 -1
  136. package/dist/sdk/io/index.js +1 -1
  137. package/dist/sdk/io/node-filesystem.js +1 -1
  138. package/dist/sdk/job.js +1 -1
  139. package/dist/sdk/journey.js +1 -1
  140. package/dist/sdk/llm/chat-cache.js +1 -1
  141. package/dist/sdk/llm/index.js +1 -1
  142. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  143. package/dist/sdk/llm/model-factors.js +1 -1
  144. package/dist/sdk/llm/user-settings.js +1 -1
  145. package/dist/sdk/personalization.js +1 -1
  146. package/dist/sdk/policy.js +1 -1
  147. package/dist/sdk/query/deleted-table-validation.js +1 -1
  148. package/dist/sdk/query/index.js +1 -1
  149. package/dist/sdk/query/sql-parser.js +1 -1
  150. package/dist/sdk/realtime.js +1 -1
  151. package/dist/sdk/schedule.js +1 -1
  152. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  153. package/dist/sdk/segment/fields-display.js +1 -1
  154. package/dist/sdk/segment/file-discovery.js +1 -1
  155. package/dist/sdk/segment/journey-utils.js +1 -1
  156. package/dist/sdk/segment/journey-validator.js +1 -1
  157. package/dist/sdk/segment/journey-yaml.js +1 -1
  158. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  159. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  160. package/dist/sdk/segment/pull-workflow.js +1 -1
  161. package/dist/sdk/segment/push-recovery.js +1 -1
  162. package/dist/sdk/segment/push-workflow.js +1 -1
  163. package/dist/sdk/segment/resolution-context.js +1 -1
  164. package/dist/sdk/segment/segment-path-parser.js +1 -1
  165. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  166. package/dist/sdk/segment/segment-validator.js +1 -1
  167. package/dist/sdk/segment/target-resolution.js +1 -1
  168. package/dist/sdk/segment/tdx-config.js +1 -1
  169. package/dist/sdk/segment/types/activation-schema.js +1 -1
  170. package/dist/sdk/segment/types/journey-def.js +1 -1
  171. package/dist/sdk/segment/types/journey-schema.js +1 -1
  172. package/dist/sdk/segment/types/segment-def.js +1 -1
  173. package/dist/sdk/segment/types/segment-schema.js +1 -1
  174. package/dist/sdk/segment/validate-files.js +1 -1
  175. package/dist/sdk/segment/yaml-validator.js +1 -1
  176. package/dist/sdk/segment.d.ts +28 -1
  177. package/dist/sdk/segment.d.ts.map +1 -1
  178. package/dist/sdk/segment.js +1 -1
  179. package/dist/sdk/segment.js.map +1 -1
  180. package/dist/sdk/types/cdp.d.ts +15 -0
  181. package/dist/sdk/types/cdp.d.ts.map +1 -1
  182. package/dist/sdk/types/index.d.ts +1 -1
  183. package/dist/sdk/types/index.d.ts.map +1 -1
  184. package/dist/sdk/types/index.js +1 -1
  185. package/dist/sdk/types/index.js.map +1 -1
  186. package/dist/sdk/types/progress.js +1 -1
  187. package/dist/sdk/types/workspace.js +1 -1
  188. package/dist/sdk/user.js +1 -1
  189. package/dist/sdk/util/format-detector.js +1 -1
  190. package/dist/sdk/util/formatters.js +1 -1
  191. package/dist/sdk/util/index.js +1 -1
  192. package/dist/sdk/util/paginate.js +1 -1
  193. package/dist/sdk/util/tree-formatter.js +1 -1
  194. package/dist/sdk/workflow/archive-validation.js +1 -1
  195. package/dist/sdk/workflow/clone-workflow.js +1 -1
  196. package/dist/sdk/workflow/index.js +1 -1
  197. package/dist/sdk/workflow/pull-workflow.js +1 -1
  198. package/dist/sdk/workflow/push-workflow.js +1 -1
  199. package/dist/sdk/workflow/task-graph.js +1 -1
  200. package/dist/sdk/workflow/tdx-config.js +1 -1
  201. package/dist/sdk/workflow/workflow-utils.js +1 -1
  202. package/dist/sdk/workspace/access-tracker.js +1 -1
  203. package/dist/sdk/workspace/frontmatter.js +1 -1
  204. package/dist/sdk/workspace/git.js +1 -1
  205. package/dist/sdk/workspace/index.js +1 -1
  206. package/dist/sdk/workspace/templates.js +1 -1
  207. package/dist/sdk/workspace/weekly.js +1 -1
  208. package/dist/sdk/workspace/wikilinks.js +1 -1
  209. package/dist/test-utils/command-runner.js +1 -1
  210. package/dist/test-utils/factories.js +1 -1
  211. package/dist/test-utils/fixtures.js +1 -1
  212. package/dist/test-utils/http-mock.js +1 -1
  213. package/dist/test-utils/index.js +1 -1
  214. package/dist/utils/async.js +1 -1
  215. package/dist/utils/colors.js +1 -1
  216. package/dist/utils/diff.js +1 -1
  217. package/dist/utils/file-permissions.js +1 -1
  218. package/dist/utils/file-reader.js +1 -1
  219. package/dist/utils/github-releases.js +1 -1
  220. package/dist/utils/global-cache.js +1 -1
  221. package/dist/utils/json-loader.js +1 -1
  222. package/dist/utils/local-cache.js +1 -1
  223. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  224. package/dist/utils/logger/formatters/index.js +1 -1
  225. package/dist/utils/logger/handlers/console-handler.js +1 -1
  226. package/dist/utils/logger/handlers/file-handler.js +1 -1
  227. package/dist/utils/logger/handlers/index.js +1 -1
  228. package/dist/utils/logger/handlers/null-handler.js +1 -1
  229. package/dist/utils/logger/index.js +1 -1
  230. package/dist/utils/logger/logger.js +1 -1
  231. package/dist/utils/logger/types.js +1 -1
  232. package/dist/utils/option-validation.js +1 -1
  233. package/dist/utils/process.js +1 -1
  234. package/dist/utils/prompt.js +1 -1
  235. package/dist/utils/spinner.js +1 -1
  236. package/dist/utils/sse-parser.js +1 -1
  237. package/dist/utils/string-utils.js +1 -1
  238. package/dist/utils/table-ref-parser.js +1 -1
  239. package/dist/utils/tdx-logger.js +1 -1
  240. package/dist/utils/version-check.js +1 -1
  241. package/package.json +1 -1
@@ -1 +1 @@
1
- const a31_0x1cf65c=a31_0x31f0;(function(_0x4fa8ec,_0x4ccc01){const _0x2237d2=a31_0x31f0,_0x20a204=_0x4fa8ec();while(!![]){try{const _0x3881d3=parseInt(_0x2237d2(0x12f))/0x1*(parseInt(_0x2237d2(0x16b))/0x2)+parseInt(_0x2237d2(0x2a0))/0x3+parseInt(_0x2237d2(0x2da))/0x4*(-parseInt(_0x2237d2(0x2b1))/0x5)+parseInt(_0x2237d2(0x274))/0x6+parseInt(_0x2237d2(0x118))/0x7*(-parseInt(_0x2237d2(0x185))/0x8)+-parseInt(_0x2237d2(0x1c3))/0x9+parseInt(_0x2237d2(0x1a7))/0xa;if(_0x3881d3===_0x4ccc01)break;else _0x20a204['push'](_0x20a204['shift']());}catch(_0x579caa){_0x20a204['push'](_0x20a204['shift']());}}}(a31_0x321a,0xbe52f));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a31_0x51cf72 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,createCommandSpinner,formatElapsed}from'../utils/spinner.js';import{loadJSONFromOptions,loadJSON}from'../utils/json-loader.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{getConsoleUrl,getConsoleNextUrl}from'../sdk/client/endpoints.js';import{formatRows,formatAsTable,hyperlink}from'../sdk/util/formatters.js';import{parseDef,serializeDef}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import a31_0x2d8ea2 from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../sdk/segment/fields-display.js';import{saveSessionContext}from'../core/session.js';function a31_0x321a(){const _0x5e5925=['Error:\x20Parent\x20segment\x20name\x20is\x20required','Validate:','type','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','getParentSQL','verbose','scheduleOption','sourceTableValid','Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID,\x20then\x20add:','Source:','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','Create\x20parent\x20segment\x20\x27','\x22,\x20\x22type\x22:\x20\x22','Aborted.','enriched','\x0aNew\x20parent\x20segment\x20\x27','cyan','FINISHED','platform','Error:\x20Personalization\x20ID\x20is\x20required','👥\x20','\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','getBehaviorNames','ps:pz:service:list','bold','{\x0a\x20\x20\x22database\x22:\x20\x22','ps:rt:list','stageCount','Validating\x20RT\x20configuration...','keyEventId','SQL\x20query:\x0a','displayMasterInfo','\x0aChanges\x20to\x20\x27','Pause\x20activations\x20in\x20an\x20RT\x20journey','displaySampleData','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','\x20--behavior\x20\x22<name>\x22','yellow','Error:\x20--name\x20is\x20required','\x0aError:','285892dksRlH','RT\x20Journey\x20ID:\x20','create','processedRows','RT\x202.0\x20Validate:','keyEventId:','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','✔\x20Paused\x20activations\x20for\x20RT\x20journey\x20\x27','Updating\x20parent\x20segment\x20\x27','listParents','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Output\x20file:\x20','public','displayPreviewResults','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','createdAt','✔\x20Created\x20token\x20\x27','Executing\x20parent\x20segment\x20query...','Creating\x20parent\x20segment\x20\x27','attribute','Error:\x20File\x20not\x20found:\x20','behaviors','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]\x0a','Attribute:','Error\x20reading\x20file:\x20','displayValidateResults','72hjrXYE','Error:\x20--database\x20and\x20--table\x20are\x20required','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]\x0a','validateParentYaml','No\x20personalization\x20services\x20configured','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','\x20No\x20changes\x20-\x20','\x20\x20Tables:\x201\x20customers\x20+\x20','\x20--behavior\x20\x22','workflowAttemptId','pushParentYaml','RT\x202.0:','\x20\x20\x20\x20','toLocaleString','Status:','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','displayPreviewHints','\x20configured','token:','\x20parent\x20segment','pullParentYaml','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]','match','displayColumns','Listing\x20RT\x20journeys\x20for\x20\x27','realtime:','\x0a\x20\x20]\x0a}\x0a','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','Updating','Site:\x20','Error:\x20--folder-id\x20is\x20required.\x20Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID.','\x27\x20is\x20up\x20to\x20date','column','11526200luuijd','length','segment:parent:desc','file','/\x20directories\x20exist.','Behavior:','\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)','displayRealtimeInfo','customerGroup','filter','Session:','\x20RT\x20journey','dim','segment:parent:view','No\x20RT-enabled\x20parent\x20segments\x20found','customersWithEvents','valid','payload','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','join','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','\x20rows)','\x20Context\x20set:\x20','toFixed','patch','timezone','audienceId:\x20','10861245PIELKD','\x20parent\x20segment\x20\x27','patchPersonalization','paused','\x5c$&','stop','double','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','Usage:\x20tdx\x20ps\x20rt\x20jn\x20resume_activations\x20<journeyId>\x0a','sort','✔\x20Query\x20completed:\x20Processed\x20','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','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','Schema\x20saved\x20to\x20','replace','localeCompare','getParentFull','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','description','deleteToken','\x20tdx\x20wf\x20attempt\x20','Error:\x20--behavior\x20requires\x20a\x20name\x0a','\x20Configuration\x20is\x20valid','\x20personalization\x20service','ps:rt:validate','\x0a⚠️\x20\x20Migrating:\x20','idStitching','displaySummary','Available\x20behaviors:','Columns:','label','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','Parent\x20segment:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Error:','No\x20personalizations\x20configured','\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22','Listing\x20RT-enabled\x20parent\x20segments\x20matching\x20\x27','\x20\x20No\x20sample\x20data\x20available','ps:pz:service:token:delete','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','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','use','red','Usage:\x20tdx\x20ps\x20pz\x20show\x20<personalization_id>','sourceTableError','SELECT\x20*\x20FROM\x20(\x0a','\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','stitchingKeys','Error:\x20Service\x20ID\x20is\x20required','\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','\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a','displayBehaviorsStats','My\x20Service','name','Creating\x20personalization\x20\x27','Validating\x20configuration...','parent_id','Fetching\x20customers\x20schema...','status','Validate\x20RT\x202.0\x20configuration\x20from\x20parent\x20segment\x20YAML','Next\x20steps:','Deleting\x20token\x20\x27','\x20personalization','List\x20personalization\x20services\x20for\x20a\x20parent\x20segment','\x20--attribute\x20\x22','Created','setJobId','any','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','entryCriteria:','✔\x20No\x20changes\x20-\x20\x27','\x20rows\x20','\x20\x20\x20\x20\x20\x20\x20\x20','data','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>','\x0a\x20\x20\x20\x20]','\x20--interval\x20','Listing\x20personalizations\x20for\x20\x27','Options:\x0a','behaviorsFile','all','ignore','Analyzing\x20changes...','personalization_services','keys','✔\x20Updated\x20personalization\x20\x27','✔\x20Deleted\x20personalization\x20service\x20\x27','start','List\x20available\x20fields\x20for\x20segmentation','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','ps:pz:patch','addAttributes','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','Customers:','ps:pz:service:token:create','launched','.yaml','Options:','master','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','To\x20cancel:','customerGroupFile','\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22','population','identifier','site','value','tokens','coveragePercent','get','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','Add\x20template\x20personalization\x20section\x20to\x20parent\x20segment\x20YAML','SELECT\x20*\x20FROM\x20','jsonl','⚠️\x20\x20personalization_services\x20section\x20already\x20exists\x20in\x20','\x20=\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs','\x27\x20(id:\x20','\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22','⚡\x20Not\x20enabled','List\x20RT\x20journeys','entryCriteria','execute','\x20true','Creating\x20personalization\x20service\x20\x27','✔\x20Created\x20parent\x20segment\x20\x27','Listing\x20RT-enabled\x20parent\x20segments...','\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20PZ\x20services\x20for\x20specific\x20parent\x20segment','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','\x0a⚠\x20Save\x20this\x20token\x20value\x20-\x20it\x20will\x20not\x20be\x20shown\x20again:','columns','Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','pauseJourney','Master:','message','audienceId:','\x20[Job\x20ID:\x20','ps:rt:jn:resume','column_type','Rows:','Found\x20YAML\x20file:\x20','Options\x20(one\x20required):\x0a','\x20\x202.\x20Run\x20','\x20+\x20[','parent_segments','\x27\x20and\x20run\x20workflow?','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','query','log','Errors:','allowedIps','\x20\x20\x20\x20\x20\x20\x20Pass\x20null\x20to\x20place\x20in\x20the\x20root\x20folder.','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20rt\x20jn\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20RT\x20journeys\x20for\x20specific\x20parent\x20segment','\x20--attribute\x20\x22<name>\x22','Fetching\x20current\x20configuration\x20for\x20\x27','\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context','yes','Events:','Fetching\x20behavior\x20list...','\x20(paused)','dirname','/\x20→\x20','\x20behaviors','\x20service(s)\x20configured','no\x20tokens\x20configured','personalization','\x20\x20\x20','\x27\x20with\x20ID:\x20','498252dYYPch','created:','/sessions/','user_id','\x0aNo\x20sample\x20data\x20available','schemaError','Fetching\x20SQL\x20for\x20\x27','Listing\x20personalization\x20services\x20for\x20\x27','workflowSessionId','Output\x20Database:','map','repeat','ps:rt:jn:list','Master\x20+\x20Attributes','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]','eventKind:\x20','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','limit','segment:parent:push','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]','\x20RT-enabled\x20parent\x20segment','\x27...','\x20\x20Database:\x20','Error:\x20Token\x20name\x20is\x20required','✔\x20Deleted\x20personalization\x20\x27','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','Behaviors','ps:pz:service:create','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','some','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','text','endsWith','/app/workflows/','Preview:','realtime','string','open','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','✔\x20Found\x20','displayAttributesStats','\x0aChanges\x20to\x20apply\x20to\x20\x27','(id:\x20','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]\x0a','3932328tGzuSa','payload:','table','Error:\x20Token\x20ID\x20is\x20required','YAML\x20file:\x20','behavior_','No\x20parent\x20segments\x20found','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','✔\x20Renamed\x20directory\x20to\x20','\x20kill','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','\x27\x20not\x20found\x20in\x20any\x20personalization\x20service','rowCount','personalizationServices','segment:parent:preview','List\x20realtime\x20personalizations\x20for\x20a\x20parent\x20segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','245515yhTWId','customers','segment:parent:update','formatSchemaJson','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','\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}','\x0a\x20\x20\x20\x20}','delete','\x0aTip:\x20Run\x20`tdx\x20ps\x20pz\x20service\x20init`\x20to\x20add\x20a\x20template\x20personalization\x20section\x20to\x20your\x20YAML','\x20service','✔\x20Updated\x20personalization\x20service\x20\x27','preview','List\x20parent\x20segments\x20with\x20RT\x202.0\x20status','realtime_enabled','updated:','-1d','foreignKey','Getting\x20personalization\x20\x27','Delete\x20a\x20token\x20from\x20a\x20personalization\x20service','listFields','format','page_view','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','runParent','sampleData','tdx\x20ps\x20preview\x20','state','%)\x20','\x27\x20is\x20already\x20up\x20to\x20date','Patching\x20personalization\x20\x27','\x20total','\x0a✔\x20Workflow\x20started','stringify','toLowerCase','Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a','json','folderId','Fetching\x20parent\x20segment\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context','resolveParentId','totalEvents','20faYkFu','information_schema','deletePersonalization','parent_segment','apply','scheduleType','matchedCount','\x20\x20Columns:\x20','ps:rt:configuration_versions','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','utf-8','stats','schemaValid','createParent','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','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','addBehaviors','behavior','last_page_viewed','joinKey','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context','null','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','ps:pz:init','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','Usage:\x20tdx\x20ps\x20pz\x20delete\x20<personalization_id>','relationships','ps:pz:service:delete','folder-segment','Show\x20parent\x20segment\x20details','.customers)','\x20\x20\x20\x20\x20\x20','Usage:\x20tdx\x20ps\x20rt\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20RT\x20config\x20(requires\x20context)\x0a','green','allowed\x20IPs:','Error:\x20--attribute\x20requires\x20a\x20name\x0a','ps:pz:service:update','Fetching\x20personalization\x20service\x20\x27','customerPercent','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','✔\x20Retrieved\x20RT\x20configuration\x20version','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]','test','sections:','Updated','Finding\x20service\x20for\x20token...','interval','Show\x20a\x20specific\x20realtime\x20personalization','darwin','error','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--file\x20<path>','Get\x20current\x20RT\x20configuration\x20version\x20status','\x20to\x20configure\x20your\x20personalization\x20service','list','Creating','includeSensitive','segment','previewParentYaml','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','attributes','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]\x0a','Database:\x20','✔\x20Updated\x20parent\x20segment\x20\x27','⚡\x20Enabled','Create\x20a\x20personalization\x20service\x20for\x20a\x20parent\x20segment','xdg-open','Resume\x20activations\x20in\x20an\x20RT\x20journey','Personalization:','Name:\x20','/app/dw/parentSegments/','column_name','trim','jobId','.yml','355831TjEcAs','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','createToken','✔\x20Deleted\x20token\x20\x27','public:','Update\x20a\x20personalization\x20service\x20name\x20and/or\x20description','listPersonalizations','database','List\x20parent\x20segments','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','ps:pz:create','output','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','\x20\x20\x20\x20-\x20','Resolving\x20parent\x20segment\x20\x27','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','parentSegment','in\x20','\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','tdx\x20ps\x20push\x20','Join\x20on:','\x20\x20Note:\x20','\x22\x20}','1mFzMUJ','parentFolder','Default','errors','segment:parent:run','updateParent','allValid','keyEventCriteria','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','enabled','sections','\x0a⚠️\x20\x20Both\x20','Overwrite\x20\x27','\x0aUsage:\x20tdx\x20ps\x20preview\x20','run','audienceId','Updating\x20personalization\x20service\x20\x27','events','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','/attempt/'];a31_0x321a=function(){return _0x5e5925;};return a31_0x321a();}import{sanitizeFileName}from'../utils/string-utils.js';const PARENT_SEGMENT_DIR=a31_0x1cf65c(0x259),LEGACY_PARENT_SEGMENT_DIR=a31_0x1cf65c(0x2dd);function openBrowser(_0x4e0fbf){const _0x4de9b4=a31_0x1cf65c,_0x2baa0f=process[_0x4de9b4(0x155)],_0x40c342=_0x2baa0f===_0x4de9b4(0xfe)?_0x4de9b4(0x299):_0x2baa0f==='win32'?_0x4de9b4(0x21d):_0x4de9b4(0x10f);spawn(_0x40c342,[_0x4e0fbf],{'detached':!![],'stdio':_0x4de9b4(0x217)})['unref']();}function migrateLegacyDirectory(){const _0x48cd87=a31_0x1cf65c;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x18e2e4=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x18e2e4['isDirectory']())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x48cd87(0xff)](a31_0x2d8ea2[_0x48cd87(0x168)](_0x48cd87(0x13a)+LEGACY_PARENT_SEGMENT_DIR+'/\x20and\x20'+PARENT_SEGMENT_DIR+_0x48cd87(0x1ab))),console[_0x48cd87(0xff)](a31_0x2d8ea2[_0x48cd87(0x1b3)](_0x48cd87(0x2a7)+LEGACY_PARENT_SEGMENT_DIR+'/\x20directory.\x0a')),![];console[_0x48cd87(0xff)](a31_0x2d8ea2[_0x48cd87(0x168)](_0x48cd87(0x1dd)+LEGACY_PARENT_SEGMENT_DIR+_0x48cd87(0x26d)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x48cd87(0xff)](a31_0x2d8ea2[_0x48cd87(0xee)](_0x48cd87(0x2a8)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x138d0b){const _0x40f274=_0x138d0b instanceof Error?_0x138d0b['message']:String(_0x138d0b);return console[_0x48cd87(0xff)](a31_0x2d8ea2['red']('✘\x20Failed\x20to\x20rename\x20directory:\x20'+_0x40f274+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async['run'](_0xb2e275){const _0x5d502d=a31_0x1cf65c;return migrateLegacyDirectory(),super[_0x5d502d(0x13d)](_0xb2e275);}}function resolveYamlFile(_0x503543){const _0x384aa9=a31_0x1cf65c;if(_0x503543[_0x384aa9(0x294)](_0x384aa9(0x117))||_0x503543[_0x384aa9(0x294)](_0x384aa9(0x226)))return _0x503543;return a31_0x51cf72[_0x384aa9(0x1ba)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x503543)+_0x384aa9(0x117));}function formatProgressMessage(_0x291630){const _0x422073=a31_0x1cf65c,_0x2471a9=_0x291630[_0x422073(0x19c)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x2471a9){const [,_0x999c88,_0x33e88a,_0x13f917='']=_0x2471a9;return a31_0x2d8ea2['dim'](_0x999c88+':')+'\x20'+_0x33e88a+a31_0x2d8ea2[_0x422073(0x1b3)](_0x13f917);}return a31_0x2d8ea2[_0x422073(0x1b3)](_0x291630);}function showFileNotFoundError(_0x41c5ea,_0x1f0d41){const _0x26f9ce=a31_0x1cf65c;console[_0x26f9ce(0xff)](a31_0x2d8ea2[_0x26f9ce(0x1f0)](_0x26f9ce(0x17f)+_0x41c5ea+'\x0a')),console[_0x26f9ce(0xff)](a31_0x2d8ea2[_0x26f9ce(0x153)](_0x26f9ce(0x1a1)+_0x1f0d41+'`\x20to\x20download\x20the\x20configuration\x20first'));}function displayRealtimeValidation(_0x5be94e){const _0x57c864=a31_0x1cf65c;if(!_0x5be94e[_0x57c864(0x297)])return;const _0x5eaaee=_0x5be94e['realtime'],_0x2afd0c=_0x5eaaee[_0x57c864(0x138)]?a31_0x2d8ea2['green'](_0x57c864(0x10d)):a31_0x2d8ea2[_0x57c864(0x168)](_0x57c864(0x23f));console['error']('\x0a'+a31_0x2d8ea2['dim'](_0x57c864(0x190))+'\x20'+_0x2afd0c);if(_0x5eaaee[_0x57c864(0x140)]&&_0x5eaaee[_0x57c864(0x140)][_0x57c864(0x1a8)]>0x0){console['error']('\x20\x20'+a31_0x2d8ea2[_0x57c864(0x1b3)]('Events:')+'\x20'+_0x5eaaee[_0x57c864(0x140)]['length']+_0x57c864(0x196));for(const _0x1261b6 of _0x5eaaee[_0x57c864(0x140)]){const _0x1bfe45=_0x1261b6[_0x57c864(0x14a)]===![]?a31_0x2d8ea2[_0x57c864(0x1f0)]('✘'):a31_0x2d8ea2[_0x57c864(0xee)]('✔');console[_0x57c864(0xff)](_0x57c864(0x191)+_0x1bfe45+'\x20'+_0x1261b6['name']),_0x1261b6['sourceTableError']&&console[_0x57c864(0xff)](_0x57c864(0xec)+a31_0x2d8ea2[_0x57c864(0x1f0)](_0x1261b6[_0x57c864(0x1f2)]));}}if(_0x5eaaee[_0x57c864(0x109)]&&_0x5eaaee[_0x57c864(0x109)][_0x57c864(0x1a8)]>0x0){console[_0x57c864(0xff)]('\x20\x20'+a31_0x2d8ea2[_0x57c864(0x1b3)]('Attributes:')+'\x20'+_0x5eaaee[_0x57c864(0x109)][_0x57c864(0x1a8)]+'\x20configured');for(const _0x38b022 of _0x5eaaee[_0x57c864(0x109)]){const _0x2f7373=_0x38b022[_0x57c864(0x1b7)]?a31_0x2d8ea2[_0x57c864(0xee)]('✔'):a31_0x2d8ea2[_0x57c864(0x1f0)]('✘');console[_0x57c864(0xff)]('\x20\x20\x20\x20'+_0x2f7373+'\x20'+_0x38b022['name']+'\x20'+a31_0x2d8ea2[_0x57c864(0x1b3)]('('+_0x38b022[_0x57c864(0x145)]+')'));}}if(_0x5eaaee[_0x57c864(0x1de)]){const _0x5b4760=_0x5eaaee['idStitching'][_0x57c864(0x1f5)]?.[_0x57c864(0x1a8)]?_0x57c864(0x258)+_0x5eaaee['idStitching']['stitchingKeys']['join'](',\x20')+']':'';console[_0x57c864(0xff)]('\x20\x20'+a31_0x2d8ea2[_0x57c864(0x1b3)]('ID\x20Stitching:')+'\x20'+_0x5eaaee[_0x57c864(0x1de)]['primaryKey']+_0x5b4760);}if(_0x5eaaee[_0x57c864(0x2ad)]&&_0x5eaaee['personalizationServices'][_0x57c864(0x1a8)]>0x0){console[_0x57c864(0xff)]('\x20\x20'+a31_0x2d8ea2[_0x57c864(0x1b3)](_0x57c864(0x111))+'\x20'+_0x5eaaee[_0x57c864(0x2ad)][_0x57c864(0x1a8)]+_0x57c864(0x2ba)+(_0x5eaaee[_0x57c864(0x2ad)]['length']!==0x1?'s':''));for(const _0x1028f3 of _0x5eaaee[_0x57c864(0x2ad)]){console[_0x57c864(0xff)](_0x57c864(0x125)+_0x1028f3[_0x57c864(0x1fb)]);}}}function showParentSegmentNotSetError(_0x533df6){const _0x22120f=a31_0x1cf65c;console[_0x22120f(0xff)](a31_0x2d8ea2[_0x22120f(0x168)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x22120f(0xff)](_0x533df6);}export class ParentSegmentListCommand extends BaseCommand{[a31_0x1cf65c(0x1fb)]='segment:parent:list';['description']=a31_0x1cf65c(0x120);async[a31_0x1cf65c(0x242)](_0x4eeb43){const _0x51f26a=a31_0x1cf65c,{options:_0x2dbe40,args:_0x543b2f,tdx:_0x5e1599}=_0x4eeb43,_0x3d8c9a=_0x543b2f[0x0];_0x2dbe40[_0x51f26a(0x148)]&&(console['error'](_0x51f26a(0x1a3)+_0x2dbe40[_0x51f26a(0x22f)]),_0x3d8c9a&&console[_0x51f26a(0xff)]('Pattern:\x20'+_0x3d8c9a));const _0x43cb2f=await withSpinner(_0x3d8c9a?'Listing\x20parent\x20segments\x20matching\x20\x27'+_0x3d8c9a+'\x27...':'Listing\x20parent\x20segments...',()=>_0x5e1599[_0x51f26a(0x106)][_0x51f26a(0x174)](),{'verbose':_0x2dbe40[_0x51f26a(0x148)]});let _0x42f021=_0x43cb2f[_0x51f26a(0x20f)];if(_0x3d8c9a){const _0x14dcf9=_0x3d8c9a[_0x51f26a(0x1d1)](/[.+^${}()|[\]\\]/g,_0x51f26a(0x1c7))[_0x51f26a(0x1d1)](/\*/g,'.*')[_0x51f26a(0x1d1)](/\?/g,'.'),_0x587fcf=new RegExp('^'+_0x14dcf9+'$','i');_0x42f021=_0x42f021[_0x51f26a(0x1b0)](_0x12401a=>_0x587fcf[_0x51f26a(0xf8)](_0x12401a[_0x51f26a(0x109)][_0x51f26a(0x1fb)]));}_0x42f021[_0x51f26a(0x1cc)]((_0x269d9f,_0xd748c1)=>_0x269d9f['attributes'][_0x51f26a(0x1fb)][_0x51f26a(0x1d2)](_0xd748c1[_0x51f26a(0x109)][_0x51f26a(0x1fb)])),console[_0x51f26a(0xff)](_0x51f26a(0x29b)+_0x42f021['length']+_0x51f26a(0x198)+(_0x42f021['length']!==0x1?'s':''));const _0x260c6f=_0x3f0c0b=>{const _0x275d38=_0x51f26a;return getConsoleNextUrl(_0x2dbe40[_0x275d38(0x22f)],_0x275d38(0x113)+_0x3f0c0b);};if(_0x2dbe40[_0x51f26a(0x2c5)]===_0x51f26a(0x2d4)||_0x2dbe40[_0x51f26a(0x2c5)]==='jsonl'){const _0x455a95=_0x42f021['map'](_0x219bf7=>({..._0x219bf7,'url':_0x260c6f(_0x219bf7['id'])}));await handleSDKOutput(_0x455a95,_0x2dbe40);}else{if(_0x42f021['length']===0x0)_0x3d8c9a?console[_0x51f26a(0x25e)]('No\x20parent\x20segments\x20match\x20pattern:\x20'+_0x3d8c9a):console['log'](_0x51f26a(0x2a6));else for(const _0x495fa1 of _0x42f021){const _0x559221=_0x495fa1[_0x51f26a(0x109)][_0x51f26a(0x22d)]?a31_0x2d8ea2[_0x51f26a(0x1b3)]('\x20('+formatRows(_0x495fa1[_0x51f26a(0x109)][_0x51f26a(0x22d)])+')'):'',_0x51c11a=hyperlink(_0x495fa1['attributes'][_0x51f26a(0x1fb)],_0x260c6f(_0x495fa1['id']));console[_0x51f26a(0x25e)](_0x51f26a(0x157)+_0x51c11a+_0x559221);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a31_0x1cf65c(0x1fb)]='segment:parent:create';[a31_0x1cf65c(0x1d6)]=a31_0x1cf65c(0x1d5);async[a31_0x1cf65c(0x242)](_0x2e4aff){const _0x494dea=a31_0x1cf65c,{options:_0x5a81f2,args:_0x5c40f1,tdx:_0x486f63}=_0x2e4aff;console[_0x494dea(0xff)](_0x494dea(0x18a)+_0x494dea(0x171)+'\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a');const _0x2e955a=_0x5a81f2;if(_0x5c40f1[_0x494dea(0x1a8)]===0x0)return console[_0x494dea(0xff)](a31_0x2d8ea2['red'](_0x494dea(0x143))),console['error'](_0x494dea(0x121)),0x1;const _0x3f0059=_0x5c40f1[0x0];if(!_0x2e955a['database']||!_0x2e955a['table'])return console['error'](_0x494dea(0x186)),console[_0x494dea(0xff)](_0x494dea(0x121)),0x1;_0x2e955a['verbose']&&(console[_0x494dea(0xff)]('Site:\x20'+_0x2e955a['site']),console['error'](_0x494dea(0x112)+_0x3f0059),console[_0x494dea(0xff)](_0x494dea(0x10b)+_0x2e955a['database']),console[_0x494dea(0xff)]('Table:\x20'+_0x2e955a[_0x494dea(0x2a2)]));const _0x18a26f=await loadJSONFromOptions(_0x2e955a[_0x494dea(0x109)],_0x2e955a['attributesFile']),_0x76ec83=await loadJSONFromOptions(_0x2e955a[_0x494dea(0x180)],_0x2e955a[_0x494dea(0x215)]),_0xd0dd60=await loadJSONFromOptions(_0x2e955a[_0x494dea(0x1af)],_0x2e955a[_0x494dea(0x22b)]),_0x523e12={'name':_0x3f0059,'description':_0x2e955a['description'],'scheduleType':_0x2e955a[_0x494dea(0x2df)],'scheduleOption':_0x2e955a[_0x494dea(0x149)],'timezone':_0x2e955a[_0x494dea(0x1c1)],'master':{'parentDatabaseName':_0x2e955a['database'],'parentTableName':_0x2e955a[_0x494dea(0x2a2)]},'attributes':_0x18a26f,'behaviors':_0x76ec83,'customerGroup':_0xd0dd60},_0x712b73=await withSpinner(_0x494dea(0x17d)+_0x3f0059+'\x27...',()=>_0x486f63['segment'][_0x494dea(0xda)](_0x523e12),{'verbose':_0x5a81f2['verbose']}),_0x33e219=_0x712b73[_0x494dea(0x20f)];return console[_0x494dea(0xff)](_0x494dea(0x245)+_0x33e219[_0x494dea(0x1fb)]+'\x27\x20with\x20ID:\x20'+_0x33e219['id']),await handleSDKOutput([_0x33e219],_0x5a81f2),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a31_0x1cf65c(0x1fb)]=a31_0x1cf65c(0x2b3);['description']=a31_0x1cf65c(0x1ce);async[a31_0x1cf65c(0x242)](_0x483675){const _0x543f1d=a31_0x1cf65c,{options:_0x442f9d,args:_0x2fd50f,tdx:_0x5b8519}=_0x483675;console['error'](_0x543f1d(0xf4)+_0x543f1d(0x171)+'\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a');const _0x2989f3=_0x442f9d;if(_0x2fd50f[_0x543f1d(0x1a8)]===0x0)return console[_0x543f1d(0xff)](a31_0x2d8ea2[_0x543f1d(0x1f0)](_0x543f1d(0x143))),console[_0x543f1d(0xff)]('Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]'),0x1;const _0x174ecc=_0x2fd50f[0x0];_0x2989f3[_0x543f1d(0x148)]&&(console[_0x543f1d(0xff)](_0x543f1d(0x1a3)+_0x2989f3['site']),console[_0x543f1d(0xff)](_0x543f1d(0x1e5)+_0x174ecc));const _0x397476=await withSpinner(_0x543f1d(0x265)+_0x174ecc+_0x543f1d(0x289),()=>_0x5b8519['segment'][_0x543f1d(0x1d3)](_0x174ecc),{'verbose':_0x2989f3[_0x543f1d(0x148)]}),_0xcf0b55=_0x397476[_0x543f1d(0x20f)],_0x25c161=await loadJSONFromOptions(_0x2989f3[_0x543f1d(0x221)],_0x2989f3['addAttributesFile']),_0x38184a=await loadJSONFromOptions(_0x2989f3[_0x543f1d(0xdd)],_0x2989f3['addBehaviorsFile']),_0x4f0f11={'name':_0xcf0b55[_0x543f1d(0x1fb)],'description':_0x2989f3[_0x543f1d(0x1d6)]!==undefined?_0x2989f3[_0x543f1d(0x1d6)]:_0xcf0b55['description'],'scheduleType':_0x2989f3['scheduleType']!==undefined?_0x2989f3[_0x543f1d(0x2df)]:_0xcf0b55['scheduleType'],'scheduleOption':_0x2989f3[_0x543f1d(0x149)]!==undefined?_0x2989f3[_0x543f1d(0x149)]:_0xcf0b55[_0x543f1d(0x149)],'timezone':_0x2989f3[_0x543f1d(0x1c1)]!==undefined?_0x2989f3['timezone']:_0xcf0b55[_0x543f1d(0x1c1)],'master':_0xcf0b55[_0x543f1d(0x228)],'attributes':_0x25c161?[..._0xcf0b55['attributes']||[],..._0x25c161]:_0xcf0b55[_0x543f1d(0x109)],'behaviors':_0x38184a?[..._0xcf0b55[_0x543f1d(0x180)]||[],..._0x38184a]:_0xcf0b55[_0x543f1d(0x180)],'customerGroup':_0xcf0b55['customerGroup']},_0x4f2d76=await withSpinner(_0x543f1d(0x173)+_0x174ecc+'\x27...',()=>_0x5b8519[_0x543f1d(0x106)][_0x543f1d(0x134)](_0x174ecc,_0x4f0f11),{'verbose':_0x2989f3['verbose']}),_0x17dc70=_0x4f2d76[_0x543f1d(0x20f)];return console[_0x543f1d(0xff)](_0x543f1d(0x10c)+_0x17dc70[_0x543f1d(0x1fb)]+'\x27'),await handleSDKOutput([_0x17dc70],_0x2989f3),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{['name']='segment:parent:pull';[a31_0x1cf65c(0x1d6)]=a31_0x1cf65c(0xe5);async[a31_0x1cf65c(0x242)](_0xc7ffa2){const _0x34ac3f=a31_0x1cf65c,{options:_0x14ac14,args:_0x55ff0e,tdx:_0x240598}=_0xc7ffa2,_0xce9349=_0x14ac14,_0x16463d=_0x55ff0e[0x0]||_0x14ac14[_0x34ac3f(0x128)];if(!_0x16463d)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment'),0x1;if(_0xce9349[_0x34ac3f(0x1ef)]&&_0xce9349[_0x34ac3f(0x123)])return console[_0x34ac3f(0xff)](a31_0x2d8ea2[_0x34ac3f(0x1f0)](_0x34ac3f(0x262))),console[_0x34ac3f(0xff)](a31_0x2d8ea2[_0x34ac3f(0x1b3)](_0x34ac3f(0xdb))),console['error'](a31_0x2d8ea2[_0x34ac3f(0x1b3)]('using\x20the\x20default\x20path:\x20'+PARENT_SEGMENT_DIR+'/{name}.yml\x0a')),console[_0x34ac3f(0xff)](a31_0x2d8ea2[_0x34ac3f(0x153)](_0x34ac3f(0x21f))),0x1;const _0x2278e3=_0xce9349['output']||a31_0x51cf72[_0x34ac3f(0x1ba)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x16463d)+'.yml');_0xce9349[_0x34ac3f(0x148)]&&(console[_0x34ac3f(0xff)](_0x34ac3f(0x1a3)+_0xce9349['site']),console[_0x34ac3f(0xff)](_0x34ac3f(0x1e5)+_0x16463d),console[_0x34ac3f(0xff)](_0x34ac3f(0x176)+_0x2278e3));const _0x455346=await withSpinner(_0x34ac3f(0x2d6)+_0x16463d+'\x27...',()=>_0x240598[_0x34ac3f(0x106)][_0x34ac3f(0x199)](_0x16463d),{'verbose':_0xce9349['verbose']}),_0x43cf23=_0x455346[_0x34ac3f(0x20f)];if(existsSync(_0x2278e3)){const _0x4f9795=readFileSync(_0x2278e3,'utf-8'),_0x41b785=generateDiff(_0x4f9795,_0x43cf23);if(!hasChanges(_0x41b785))console[_0x34ac3f(0xff)](a31_0x2d8ea2[_0x34ac3f(0xee)]('✔')+_0x34ac3f(0x18b)+a31_0x2d8ea2[_0x34ac3f(0x153)](_0x2278e3)+'\x20is\x20already\x20up\x20to\x20date');else{console[_0x34ac3f(0xff)](_0x34ac3f(0x163)+_0x2278e3+'\x27:'),console[_0x34ac3f(0xff)]('─'[_0x34ac3f(0x27f)](0x3c)),console[_0x34ac3f(0xff)](formatDiffWithColors(_0x41b785)),console[_0x34ac3f(0xff)]('─'[_0x34ac3f(0x27f)](0x3c));if(!_0xce9349[_0x34ac3f(0x268)]){if(!isInteractive())return console[_0x34ac3f(0xff)](a31_0x2d8ea2[_0x34ac3f(0x1f0)](_0x34ac3f(0x16a)),_0x34ac3f(0x108)),console[_0x34ac3f(0xff)](a31_0x2d8ea2[_0x34ac3f(0x1b3)](_0x34ac3f(0x1e6))),0x1;const _0x37cc35=await confirmKey(_0x34ac3f(0x13b)+_0x2278e3+'\x27?');if(!_0x37cc35)return console['error'](a31_0x2d8ea2['yellow']('Aborted.')),0x1;}writeFileSync(_0x2278e3,_0x43cf23,_0x34ac3f(0xd7)),console[_0x34ac3f(0xff)](a31_0x2d8ea2[_0x34ac3f(0xee)]('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a31_0x2d8ea2[_0x34ac3f(0x153)](_0x2278e3));}}else{const _0x1b2c3e=a31_0x51cf72[_0x34ac3f(0x26c)](_0x2278e3);!existsSync(_0x1b2c3e)&&mkdirSync(_0x1b2c3e,{'recursive':!![]}),writeFileSync(_0x2278e3,_0x43cf23,_0x34ac3f(0xd7)),console[_0x34ac3f(0xff)](a31_0x2d8ea2[_0x34ac3f(0xee)]('✔')+_0x34ac3f(0x1ee)+a31_0x2d8ea2['cyan'](_0x2278e3));}return saveSessionContext({'parent_segment':_0x16463d},_0xce9349['session']),console[_0x34ac3f(0xff)](a31_0x2d8ea2[_0x34ac3f(0xee)]('✔')+_0x34ac3f(0x1be)+a31_0x2d8ea2[_0x34ac3f(0x1b3)](_0x34ac3f(0x2dd))+'\x20=\x20'+a31_0x2d8ea2[_0x34ac3f(0x153)](_0x16463d)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a31_0x1cf65c(0x1fb)]=a31_0x1cf65c(0x286);[a31_0x1cf65c(0x1d6)]=a31_0x1cf65c(0x1ca);async[a31_0x1cf65c(0x242)](_0x5932e6){const _0x52c6a2=a31_0x1cf65c,{options:_0x30fc86,args:_0x4763ab,tdx:_0x1d789c}=_0x5932e6,_0x4c4fea=_0x30fc86,_0x6d1cee=_0x4763ab[0x0]||_0x30fc86['parentSegment'];if(!_0x6d1cee)return showParentSegmentNotSetError(_0x52c6a2(0x141)+_0x52c6a2(0x1bb)),0x1;const _0x5b7233=resolveYamlFile(_0x6d1cee);if(!existsSync(_0x5b7233))return showFileNotFoundError(_0x5b7233,_0x6d1cee),0x1;_0x4c4fea[_0x52c6a2(0x148)]&&(console['error'](_0x52c6a2(0x1a3)+_0x4c4fea['site']),console[_0x52c6a2(0xff)](_0x52c6a2(0x2a4)+_0x5b7233));let _0x3884d3;try{_0x3884d3=readFileSync(_0x5b7233,_0x52c6a2(0xd7));}catch(_0x3dee15){const _0x143a07=_0x3dee15 instanceof Error?_0x3dee15['message']:String(_0x3dee15);return console[_0x52c6a2(0xff)]('Error\x20reading\x20file:\x20'+_0x143a07),0x1;}const _0x42fb7e=await withSpinner('Analyzing\x20changes...',()=>_0x1d789c[_0x52c6a2(0x106)]['pushParentYaml'](_0x3884d3),{'verbose':_0x4c4fea[_0x52c6a2(0x148)]}),_0x445812=_0x42fb7e[_0x52c6a2(0x20f)],{isNew:_0x2e5f13,name:_0x2231e2,hasChanges:_0x161e31,diffFormatted:_0xd603c5}=_0x445812;if(!_0x161e31)return console[_0x52c6a2(0xff)](_0x52c6a2(0x20c)+_0x2231e2+_0x52c6a2(0x2cd)),0x0;_0x2e5f13?console[_0x52c6a2(0xff)](_0x52c6a2(0x152)+_0x2231e2+'\x27:'):console[_0x52c6a2(0xff)](_0x52c6a2(0x29d)+_0x2231e2+'\x27:');console[_0x52c6a2(0xff)]('─'[_0x52c6a2(0x27f)](0x3c)),console[_0x52c6a2(0xff)](_0xd603c5),console[_0x52c6a2(0xff)]('─'[_0x52c6a2(0x27f)](0x3c));const _0x346d77=_0x2e5f13?_0x52c6a2(0x14e)+_0x2231e2+'\x27?':'Apply\x20changes\x20to\x20\x27'+_0x2231e2+'\x27?';if(!_0x4c4fea[_0x52c6a2(0x268)]){if(!isInteractive())return console['error'](a31_0x2d8ea2[_0x52c6a2(0x1f0)](_0x52c6a2(0x16a)),_0x52c6a2(0x108)),console[_0x52c6a2(0xff)](a31_0x2d8ea2[_0x52c6a2(0x1b3)](_0x52c6a2(0x1e6))),0x1;const _0x153961=await confirmKey(_0x346d77);if(!_0x153961)return console[_0x52c6a2(0xff)](a31_0x2d8ea2['yellow']('Aborted.')),0x1;}const _0x5ec5fa=_0x2e5f13?_0x52c6a2(0x104):_0x52c6a2(0x1a2),_0x5bcb0b=await withSpinner(_0x5ec5fa+'\x20parent\x20segment\x20\x27'+_0x2231e2+'\x27...',()=>_0x445812[_0x52c6a2(0x2de)](),{'verbose':_0x4c4fea['verbose']}),_0x39511f=_0x5bcb0b[_0x52c6a2(0x20f)],_0x285744=getConsoleNextUrl(_0x4c4fea[_0x52c6a2(0x22f)],_0x52c6a2(0x113)+_0x39511f['id']),_0x56caf5=_0x2e5f13?_0x52c6a2(0x207):_0x52c6a2(0xfa);return console['error']('✔\x20'+_0x56caf5+_0x52c6a2(0x1c4)+_0x39511f[_0x52c6a2(0x1fb)]+'\x27'),console[_0x52c6a2(0xff)]('\x20\x20'+_0x285744),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{['name']='segment:parent:validate';[a31_0x1cf65c(0x1d6)]='Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics';async[a31_0x1cf65c(0x242)](_0x140883){const _0x5d6f85=a31_0x1cf65c,{options:_0x114df9,args:_0x2b9e9,tdx:_0x2d1219}=_0x140883,_0x35c593=_0x114df9,_0x3a4095=_0x2b9e9[0x0]||_0x114df9[_0x5d6f85(0x128)];if(!_0x3a4095)return showParentSegmentNotSetError(_0x5d6f85(0x166)+_0x5d6f85(0x1b9)+_0x5d6f85(0x214)+_0x5d6f85(0x137)+_0x5d6f85(0x234)+_0x5d6f85(0x1e4)),0x1;const _0x1865e4=resolveYamlFile(_0x3a4095);if(!existsSync(_0x1865e4))return showFileNotFoundError(_0x1865e4,_0x3a4095),0x1;_0x35c593[_0x5d6f85(0x148)]&&(console[_0x5d6f85(0xff)](_0x5d6f85(0x1a3)+_0x35c593[_0x5d6f85(0x22f)]),console[_0x5d6f85(0xff)](_0x5d6f85(0x2a4)+_0x1865e4));let _0x20b6ec;try{_0x20b6ec=readFileSync(_0x1865e4,_0x5d6f85(0xd7));}catch(_0x6421df){const _0x43e717=_0x6421df instanceof Error?_0x6421df['message']:String(_0x6421df);return console['error'](_0x5d6f85(0x183)+_0x43e717),0x1;}const _0xff7cf1=createCommandSpinner(a31_0x2d8ea2[_0x5d6f85(0x1b3)](_0x5d6f85(0x1fd)),{'verbose':_0x35c593[_0x5d6f85(0x148)]});_0xff7cf1[_0x5d6f85(0x21d)]();const _0x182ed4={'onProgress':_0x21ad6=>{_0xff7cf1['text']=formatProgressMessage(_0x21ad6);}};if(_0x35c593['master'])_0x182ed4['master']=!![];if(_0x35c593['enriched'])_0x182ed4['enriched']=!![];_0x35c593[_0x5d6f85(0x17e)]&&(_0x182ed4[_0x5d6f85(0x17e)]=_0x35c593[_0x5d6f85(0x17e)]);_0x35c593['behavior']&&(_0x182ed4[_0x5d6f85(0xde)]=_0x35c593[_0x5d6f85(0xde)]);if(_0x35c593['interval'])_0x182ed4[_0x5d6f85(0xfc)]=_0x35c593[_0x5d6f85(0xfc)];let _0x5482e1;try{_0x5482e1=await _0x2d1219[_0x5d6f85(0x106)][_0x5d6f85(0x188)](_0x20b6ec,_0x182ed4),_0xff7cf1[_0x5d6f85(0x1c8)]();}catch(_0x1ac1d4){_0xff7cf1[_0x5d6f85(0x1c8)]();throw _0x1ac1d4;}const _0x353e7f=_0x35c593[_0x5d6f85(0xfc)]||_0x5d6f85(0x2c0);return this[_0x5d6f85(0x184)](_0x5482e1,_0x182ed4,_0x1865e4,_0x353e7f),_0x5482e1['allValid']?0x0:0x1;}[a31_0x1cf65c(0x184)](_0x108b4d,_0xb03f15,_0x2e4962,_0x13564c){const _0x9be4d6=a31_0x1cf65c;console[_0x9be4d6(0xff)]('\x0a'+a31_0x2d8ea2['bold'](_0x9be4d6(0x144))+'\x20'+_0x108b4d[_0x9be4d6(0x1fb)]),console[_0x9be4d6(0xff)]('═'[_0x9be4d6(0x27f)](0x3c)),this['displayMasterInfo'](_0x108b4d);if(typeof _0xb03f15[_0x9be4d6(0x17e)]==='string'){this['displayAttributesStats'](_0x108b4d),this[_0x9be4d6(0x1df)](_0x108b4d),this[_0x9be4d6(0x195)](_0x2e4962,_0x13564c,'attribute',_0xb03f15[_0x9be4d6(0x17e)]);return;}if(_0xb03f15[_0x9be4d6(0x17e)]===!![]){this[_0x9be4d6(0x29c)](_0x108b4d),this[_0x9be4d6(0x1df)](_0x108b4d),this[_0x9be4d6(0x195)](_0x2e4962,_0x13564c,_0x9be4d6(0x109));return;}if(typeof _0xb03f15['behavior']===_0x9be4d6(0x298)){this[_0x9be4d6(0x1f9)](_0x108b4d,_0x13564c),this[_0x9be4d6(0x1df)](_0x108b4d),this['displayPreviewHints'](_0x2e4962,_0x13564c,_0x9be4d6(0xde),_0xb03f15[_0x9be4d6(0xde)]);return;}if(_0xb03f15[_0x9be4d6(0xde)]===!![]){this['displayBehaviorsStats'](_0x108b4d,_0x13564c),this[_0x9be4d6(0x1df)](_0x108b4d),this[_0x9be4d6(0x195)](_0x2e4962,_0x13564c,_0x9be4d6(0x180));return;}this[_0x9be4d6(0x29c)](_0x108b4d),this[_0x9be4d6(0x1f9)](_0x108b4d,_0x13564c),this[_0x9be4d6(0x1ae)](_0x108b4d),this['displaySummary'](_0x108b4d),this[_0x9be4d6(0x195)](_0x2e4962,_0x13564c,_0x9be4d6(0x216));}[a31_0x1cf65c(0x1ae)](_0x493de0){displayRealtimeValidation(_0x493de0);}['displayPreviewHints'](_0x3d973f,_0x574682,_0x228849,_0x53e8ef){const _0x59fdeb=a31_0x1cf65c;console[_0x59fdeb(0xff)]('\x0a'+a31_0x2d8ea2['dim']('To\x20view\x20sample\x20data:'));const _0x34fd2e=_0x574682!==_0x59fdeb(0x2c0)?_0x59fdeb(0x212)+_0x574682:'';if(_0x228849===_0x59fdeb(0x17e)&&_0x53e8ef)console[_0x59fdeb(0xff)]('\x20\x20'+a31_0x2d8ea2[_0x59fdeb(0x1b3)](_0x59fdeb(0x2ca)+_0x3d973f+_0x59fdeb(0x206)+_0x53e8ef+'\x22'+_0x34fd2e));else{if(_0x228849===_0x59fdeb(0xde)&&_0x53e8ef)console[_0x59fdeb(0xff)]('\x20\x20'+a31_0x2d8ea2['dim']('tdx\x20ps\x20preview\x20'+_0x3d973f+_0x59fdeb(0x18d)+_0x53e8ef+'\x22'+_0x34fd2e));else(_0x228849==='attributes'||_0x228849===_0x59fdeb(0x216))&&console[_0x59fdeb(0xff)]('\x20\x20'+a31_0x2d8ea2[_0x59fdeb(0x1b3)](_0x59fdeb(0x2ca)+_0x3d973f+_0x59fdeb(0x264)+_0x34fd2e));}(_0x228849===_0x59fdeb(0x180)||_0x228849===_0x59fdeb(0x216))&&console[_0x59fdeb(0xff)]('\x20\x20'+a31_0x2d8ea2[_0x59fdeb(0x1b3)](_0x59fdeb(0x2ca)+_0x3d973f+_0x59fdeb(0x167)+_0x34fd2e)),_0x228849===_0x59fdeb(0x216)&&console[_0x59fdeb(0xff)]('\x20\x20'+a31_0x2d8ea2[_0x59fdeb(0x1b3)](_0x59fdeb(0x2ca)+_0x3d973f+'\x20--enriched'+_0x34fd2e));}[a31_0x1cf65c(0x162)](_0x5dc00c){const _0x233772=a31_0x1cf65c,{master:_0x4f01a6}=_0x5dc00c,_0x515fa9=_0x4f01a6[_0x233772(0xd9)]?a31_0x2d8ea2[_0x233772(0xee)]('✔'):a31_0x2d8ea2[_0x233772(0x1f0)]('✘');console[_0x233772(0xff)]('\x0a'+a31_0x2d8ea2[_0x233772(0x1b3)]('Master\x20Table')),console[_0x233772(0xff)](_0x515fa9+'\x20'+a31_0x2d8ea2[_0x233772(0x15b)](_0x4f01a6[_0x233772(0x11f)]+'.'+_0x4f01a6[_0x233772(0x2a2)])),_0x4f01a6[_0x233772(0xd9)]?_0x4f01a6['rowCount']!==undefined&&console[_0x233772(0xff)]('\x20\x20'+a31_0x2d8ea2[_0x233772(0x1b3)](_0x233772(0x254))+'\x20'+a31_0x2d8ea2[_0x233772(0x153)](formatRows(_0x4f01a6[_0x233772(0x2ac)]))):console[_0x233772(0xff)]('\x20\x20'+a31_0x2d8ea2[_0x233772(0x1f0)](_0x233772(0x1e7))+'\x20'+_0x4f01a6[_0x233772(0x279)]);}['displayAttributesStats'](_0x48abd1){const _0x2a1a0a=a31_0x1cf65c;if(_0x48abd1[_0x2a1a0a(0x109)][_0x2a1a0a(0x1a8)]===0x0)return;console['error']('\x0a'+a31_0x2d8ea2[_0x2a1a0a(0x1b3)]('Attributes'));for(const _0x31f9e2 of _0x48abd1[_0x2a1a0a(0x109)]){const _0x2e805c=_0x31f9e2['schemaValid']?a31_0x2d8ea2[_0x2a1a0a(0xee)]('✔'):a31_0x2d8ea2[_0x2a1a0a(0x1f0)]('✘');let _0x7746d6='';if(_0x31f9e2[_0x2a1a0a(0xd9)]&&_0x31f9e2[_0x2a1a0a(0x2e0)]!==undefined&&_0x31f9e2[_0x2a1a0a(0x232)]!==undefined){const _0x52a74f=_0x31f9e2[_0x2a1a0a(0x232)]['toFixed'](0x1),_0x453eb7=_0x31f9e2['coveragePercent']>=0x50?a31_0x2d8ea2['green']:_0x31f9e2[_0x2a1a0a(0x232)]>=0x32?a31_0x2d8ea2[_0x2a1a0a(0x168)]:a31_0x2d8ea2['red'];_0x7746d6='\x20'+a31_0x2d8ea2['dim']('Coverage:')+'\x20'+_0x453eb7(_0x52a74f+'%')+'\x20('+formatRows(_0x31f9e2[_0x2a1a0a(0x2e0)])+_0x2a1a0a(0x1bd);}console[_0x2a1a0a(0xff)](_0x2e805c+'\x20'+a31_0x2d8ea2[_0x2a1a0a(0x15b)](_0x31f9e2[_0x2a1a0a(0x1fb)])+_0x7746d6),console[_0x2a1a0a(0xff)]('\x20\x20'+a31_0x2d8ea2[_0x2a1a0a(0x1b3)](_0x2a1a0a(0x14c))+'\x20'+a31_0x2d8ea2[_0x2a1a0a(0x15b)](_0x31f9e2[_0x2a1a0a(0x11f)]+'.'+_0x31f9e2[_0x2a1a0a(0x2a2)]));const _0x4d0dd9=_0x31f9e2[_0x2a1a0a(0xe0)]===_0x31f9e2['foreignKey']?a31_0x2d8ea2[_0x2a1a0a(0x1b3)](_0x2a1a0a(0x12c))+'\x20'+_0x31f9e2['joinKey']:a31_0x2d8ea2[_0x2a1a0a(0x1b3)]('Join:')+'\x20'+_0x31f9e2['joinKey']+'\x20=\x20'+_0x31f9e2['foreignKey'];console[_0x2a1a0a(0xff)]('\x20\x20'+_0x4d0dd9),console[_0x2a1a0a(0xff)]('\x20\x20'+a31_0x2d8ea2[_0x2a1a0a(0x1b3)](_0x2a1a0a(0x1e1))),this[_0x2a1a0a(0x19d)](_0x31f9e2['columns']),!_0x31f9e2[_0x2a1a0a(0xd9)]&&console[_0x2a1a0a(0xff)]('\x20\x20'+a31_0x2d8ea2[_0x2a1a0a(0x1f0)](_0x2a1a0a(0x1e7))+'\x20'+_0x31f9e2[_0x2a1a0a(0x279)]);}}[a31_0x1cf65c(0x1f9)](_0x179d30,_0x242a3d){const _0x1883b9=a31_0x1cf65c;if(_0x179d30[_0x1883b9(0x180)]['length']===0x0)return;console['error']('\x0a'+a31_0x2d8ea2[_0x1883b9(0x1b3)](_0x1883b9(0x28e))+'\x20'+a31_0x2d8ea2[_0x1883b9(0x1b3)]('('+_0x242a3d+')'));for(const _0x124efa of _0x179d30[_0x1883b9(0x180)]){const _0x12302f=_0x124efa[_0x1883b9(0xd9)]?a31_0x2d8ea2[_0x1883b9(0xee)]('✔'):a31_0x2d8ea2['red']('✘');let _0xa35416='';if(_0x124efa['schemaValid']&&_0x124efa[_0x1883b9(0x1b6)]!==undefined&&_0x124efa[_0x1883b9(0x2d9)]!==undefined){const _0x26b4ef=_0x124efa[_0x1883b9(0xf3)]?.[_0x1883b9(0x1bf)](0x1)||'?',_0x3089e4=(_0x124efa['customerPercent']??0x0)>=0x32?a31_0x2d8ea2[_0x1883b9(0xee)]:(_0x124efa[_0x1883b9(0xf3)]??0x0)>=0x14?a31_0x2d8ea2[_0x1883b9(0x168)]:a31_0x2d8ea2['red'];_0xa35416='\x20'+a31_0x2d8ea2[_0x1883b9(0x1b3)](_0x1883b9(0x223))+'\x20'+_0x3089e4(formatRows(_0x124efa[_0x1883b9(0x1b6)]))+'\x20('+_0x26b4ef+_0x1883b9(0x2cc)+a31_0x2d8ea2[_0x1883b9(0x1b3)](_0x1883b9(0x269))+'\x20'+a31_0x2d8ea2[_0x1883b9(0x153)](formatRows(_0x124efa[_0x1883b9(0x2d9)]));}console[_0x1883b9(0xff)](_0x12302f+'\x20'+a31_0x2d8ea2[_0x1883b9(0x15b)](_0x124efa['name'])+_0xa35416),console['error']('\x20\x20'+a31_0x2d8ea2[_0x1883b9(0x1b3)](_0x1883b9(0x14c))+'\x20'+a31_0x2d8ea2[_0x1883b9(0x15b)](_0x124efa['database']+'.'+_0x124efa['table']));const _0x2efced=_0x124efa['joinKey']===_0x124efa[_0x1883b9(0x2c1)]?a31_0x2d8ea2['dim'](_0x1883b9(0x12c))+'\x20'+_0x124efa[_0x1883b9(0xe0)]:a31_0x2d8ea2['dim']('Join:')+'\x20'+_0x124efa[_0x1883b9(0xe0)]+_0x1883b9(0x239)+_0x124efa[_0x1883b9(0x2c1)];console[_0x1883b9(0xff)]('\x20\x20'+_0x2efced),console[_0x1883b9(0xff)]('\x20\x20'+a31_0x2d8ea2[_0x1883b9(0x1b3)](_0x1883b9(0x1e1))),this['displayColumns'](_0x124efa[_0x1883b9(0x24b)]),!_0x124efa['schemaValid']&&console[_0x1883b9(0xff)]('\x20\x20'+a31_0x2d8ea2[_0x1883b9(0x1f0)](_0x1883b9(0x1e7))+'\x20'+_0x124efa[_0x1883b9(0x279)]);}}[a31_0x1cf65c(0x19d)](_0x4add18){const _0x2d06fd=a31_0x1cf65c;for(const _0x4c9345 of _0x4add18){_0x4c9345[_0x2d06fd(0x1e2)]===_0x4c9345['column']||_0x4c9345[_0x2d06fd(0x1a6)]==='*'?console[_0x2d06fd(0xff)](_0x2d06fd(0x125)+_0x4c9345[_0x2d06fd(0x1e2)]):console[_0x2d06fd(0xff)](_0x2d06fd(0x125)+_0x4c9345[_0x2d06fd(0x1e2)]+'\x20'+a31_0x2d8ea2[_0x2d06fd(0x1b3)]('('+_0x4c9345[_0x2d06fd(0x1a6)]+')'));}}[a31_0x1cf65c(0x1df)](_0x2d5db9){const _0x664e68=a31_0x1cf65c;console[_0x664e68(0xff)]('─'[_0x664e68(0x27f)](0x3c));if(_0x2d5db9['errors'][_0x664e68(0x1a8)]>0x0){console['error']('\x0a'+a31_0x2d8ea2[_0x664e68(0x1f0)](_0x664e68(0x25f)));for(const _0x137478 of _0x2d5db9[_0x664e68(0x132)]){console[_0x664e68(0xff)]('\x20\x20'+a31_0x2d8ea2[_0x664e68(0x1f0)]('•')+'\x20'+_0x137478);}}_0x2d5db9[_0x664e68(0x135)]&&console['error']('\x0a'+a31_0x2d8ea2['green']('✔')+_0x664e68(0x1da));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a31_0x1cf65c(0x1fb)]=a31_0x1cf65c(0x2ae);['description']=a31_0x1cf65c(0x284);async[a31_0x1cf65c(0x242)](_0x346ac1){const _0x56044b=a31_0x1cf65c,{options:_0x9c84f9,args:_0x32009f,tdx:_0x25d61c}=_0x346ac1,_0x5ac7a6=_0x9c84f9,_0x5d73b5=_0x32009f[0x0]||_0x9c84f9[_0x56044b(0x128)];if(!_0x5d73b5)return showParentSegmentNotSetError(_0x56044b(0x124)+_0x56044b(0x20a)+_0x56044b(0x256)+_0x56044b(0x2c7)+_0x56044b(0x179)+_0x56044b(0x2b5)+_0x56044b(0x249)+_0x56044b(0x1e4)),0x1;if(!_0x5ac7a6[_0x56044b(0x228)]&&!_0x5ac7a6[_0x56044b(0x17e)]&&!_0x5ac7a6['behavior']&&!_0x5ac7a6['enriched'])return console[_0x56044b(0xff)](a31_0x2d8ea2[_0x56044b(0x1f0)](_0x56044b(0x194))),console[_0x56044b(0xff)](_0x56044b(0x1bc)),console['error'](_0x56044b(0x227)),console[_0x56044b(0xff)]('\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data'),console[_0x56044b(0xff)]('\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute'),console[_0x56044b(0xff)](_0x56044b(0x14d)),console[_0x56044b(0xff)](_0x56044b(0x290)),0x1;const _0x3146b9=resolveYamlFile(_0x5d73b5);if(!existsSync(_0x3146b9))return showFileNotFoundError(_0x3146b9,_0x5d73b5),0x1;_0x5ac7a6['verbose']&&(console['error'](_0x56044b(0x1a3)+_0x5ac7a6['site']),console[_0x56044b(0xff)](_0x56044b(0x2a4)+_0x3146b9));let _0x2f2217;try{_0x2f2217=readFileSync(_0x3146b9,_0x56044b(0xd7));}catch(_0x1dcea0){const _0x11fb1f=_0x1dcea0 instanceof Error?_0x1dcea0[_0x56044b(0x24f)]:String(_0x1dcea0);return console[_0x56044b(0xff)](_0x56044b(0x183)+_0x11fb1f),0x1;}let _0x1e3ba2;try{_0x1e3ba2=parseDef(_0x2f2217);}catch(_0x4c4a00){const _0x3544c2=_0x4c4a00 instanceof Error?_0x4c4a00[_0x56044b(0x24f)]:String(_0x4c4a00);return console[_0x56044b(0xff)](a31_0x2d8ea2[_0x56044b(0x1f0)]('Error\x20parsing\x20YAML:\x20'+_0x3544c2)),0x1;}if(_0x5ac7a6[_0x56044b(0x17e)]===!![]||_0x5ac7a6[_0x56044b(0x17e)]===''){const _0x4c7f77=_0x1e3ba2[_0x56044b(0x109)]?.[_0x56044b(0x27e)](_0x5e68b8=>_0x5e68b8[_0x56044b(0x1fb)])||[];if(_0x4c7f77[_0x56044b(0x1a8)]===0x0)console['error'](a31_0x2d8ea2[_0x56044b(0x1f0)](_0x56044b(0x2aa)));else{console['error'](a31_0x2d8ea2['red'](_0x56044b(0xf0))),console[_0x56044b(0xff)]('Available\x20attributes:');for(const _0xb62f7b of _0x4c7f77){console[_0x56044b(0xff)]('\x20\x20'+a31_0x2d8ea2['cyan'](_0xb62f7b));}console[_0x56044b(0xff)](_0x56044b(0x13c)+_0x5d73b5+_0x56044b(0x206)+_0x4c7f77[0x0]+'\x22');}return 0x1;}if(_0x5ac7a6['behavior']===!![]||_0x5ac7a6['behavior']===''){const _0x3d5cf4=_0x1e3ba2['behaviors']?.[_0x56044b(0x27e)](_0x539cdd=>_0x539cdd['name'])||[];if(_0x3d5cf4['length']===0x0)console[_0x56044b(0xff)](a31_0x2d8ea2[_0x56044b(0x1f0)](_0x56044b(0x23b)));else{console[_0x56044b(0xff)](a31_0x2d8ea2[_0x56044b(0x1f0)](_0x56044b(0x1d9))),console[_0x56044b(0xff)](_0x56044b(0x1e0));for(const _0x4f75c9 of _0x3d5cf4){console[_0x56044b(0xff)]('\x20\x20'+a31_0x2d8ea2[_0x56044b(0x153)](_0x4f75c9));}console['error']('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0x5d73b5+_0x56044b(0x18d)+_0x3d5cf4[0x0]+'\x22');}return 0x1;}const _0x5340f1=createCommandSpinner(a31_0x2d8ea2[_0x56044b(0x1b3)]('Fetching\x20sample\x20data...'),{'verbose':_0x5ac7a6[_0x56044b(0x148)]});_0x5340f1['start']();const _0x39b4b2={'onProgress':_0x55d47b=>{const _0x5e0076=_0x56044b;_0x5340f1[_0x5e0076(0x293)]=formatProgressMessage(_0x55d47b);}};if(_0x5ac7a6[_0x56044b(0x228)])_0x39b4b2[_0x56044b(0x228)]=!![];if(_0x5ac7a6[_0x56044b(0x17e)]&&typeof _0x5ac7a6[_0x56044b(0x17e)]==='string')_0x39b4b2['attribute']=_0x5ac7a6['attribute'];if(_0x5ac7a6['behavior']&&typeof _0x5ac7a6['behavior']===_0x56044b(0x298))_0x39b4b2[_0x56044b(0xde)]=_0x5ac7a6[_0x56044b(0xde)];if(_0x5ac7a6[_0x56044b(0x151)])_0x39b4b2[_0x56044b(0x151)]=!![];if(_0x5ac7a6[_0x56044b(0xfc)])_0x39b4b2[_0x56044b(0xfc)]=_0x5ac7a6[_0x56044b(0xfc)];let _0x3dcced;try{_0x3dcced=await _0x25d61c[_0x56044b(0x106)][_0x56044b(0x107)](_0x2f2217,_0x39b4b2),_0x5340f1[_0x56044b(0x1c8)]();}catch(_0x5064d8){_0x5340f1[_0x56044b(0x1c8)]();throw _0x5064d8;}return await this[_0x56044b(0x178)](_0x3dcced,{'master':_0x5ac7a6['master'],'attribute':typeof _0x5ac7a6[_0x56044b(0x17e)]==='string'?_0x5ac7a6[_0x56044b(0x17e)]:undefined,'behavior':typeof _0x5ac7a6['behavior']===_0x56044b(0x298)?_0x5ac7a6[_0x56044b(0xde)]:undefined,'enriched':_0x5ac7a6[_0x56044b(0x151)]}),_0x3dcced[_0x56044b(0x135)]?0x0:0x1;}async['displayPreviewResults'](_0x568c5e,_0x457d50){const _0x2587d5=a31_0x1cf65c;console['error']('\x0a'+a31_0x2d8ea2[_0x2587d5(0x15b)](_0x2587d5(0x296))+'\x20'+_0x568c5e[_0x2587d5(0x1fb)]),console[_0x2587d5(0xff)]('═'[_0x2587d5(0x27f)](0x3c));if(_0x457d50[_0x2587d5(0x228)]&&_0x568c5e[_0x2587d5(0x2c9)]){const _0x2e64b9=a31_0x2d8ea2[_0x2587d5(0x1b3)](_0x2587d5(0x24e))+'\x20'+a31_0x2d8ea2[_0x2587d5(0x15b)](_0x568c5e[_0x2587d5(0x228)][_0x2587d5(0x11f)]+'.'+_0x568c5e[_0x2587d5(0x228)][_0x2587d5(0x2a2)]);await this[_0x2587d5(0x165)](_0x2e64b9,_0x568c5e[_0x2587d5(0x2c9)]);}else{if(_0x457d50[_0x2587d5(0x17e)]&&_0x568c5e['sampleData']){const _0x307fa1=a31_0x2d8ea2[_0x2587d5(0x1b3)](_0x2587d5(0x182))+'\x20'+a31_0x2d8ea2['bold'](_0x457d50['attribute']);await this[_0x2587d5(0x165)](_0x307fa1,_0x568c5e['sampleData']);}else{if(_0x457d50['behavior']&&_0x568c5e[_0x2587d5(0x2c9)]){const _0x18538b=a31_0x2d8ea2[_0x2587d5(0x1b3)](_0x2587d5(0x1ac))+'\x20'+a31_0x2d8ea2[_0x2587d5(0x15b)](_0x457d50[_0x2587d5(0xde)]);await this['displaySampleData'](_0x18538b,_0x568c5e[_0x2587d5(0x2c9)]);}else{if(_0x457d50[_0x2587d5(0x151)]&&_0x568c5e[_0x2587d5(0x2c9)]){const _0x2a9545=a31_0x2d8ea2[_0x2587d5(0x1b3)]('Enriched:')+'\x20'+a31_0x2d8ea2[_0x2587d5(0x15b)](_0x2587d5(0x281));await this['displaySampleData'](_0x2a9545,_0x568c5e[_0x2587d5(0x2c9)]);}else!_0x568c5e[_0x2587d5(0x2c9)]&&console[_0x2587d5(0xff)](_0x2587d5(0x278));}}}if(_0x568c5e[_0x2587d5(0x132)][_0x2587d5(0x1a8)]>0x0){console[_0x2587d5(0xff)]('─'[_0x2587d5(0x27f)](0x3c)),console[_0x2587d5(0xff)]('\x0a'+a31_0x2d8ea2['red'](_0x2587d5(0x25f)));for(const _0x4842e5 of _0x568c5e[_0x2587d5(0x132)]){console[_0x2587d5(0xff)]('\x20\x20'+a31_0x2d8ea2['red']('•')+'\x20'+_0x4842e5);}}}async['displaySampleData'](_0x41fd3c,_0x3d9be6){const _0x4bdb47=a31_0x1cf65c;if(_0x3d9be6[_0x4bdb47(0x1a8)]===0x0){console[_0x4bdb47(0xff)]('\x0a'+_0x41fd3c),console[_0x4bdb47(0xff)](_0x4bdb47(0x1eb));return;}console[_0x4bdb47(0xff)]('\x0a'+_0x41fd3c);const _0x218d21=Object[_0x4bdb47(0x21a)](_0x3d9be6[0x0])['map'](_0x2742f0=>({'name':_0x2742f0,'type':typeof _0x3d9be6[0x0][_0x2742f0]==='number'?_0x4bdb47(0x1c9):'varchar'})),_0x1ae41b={'queryId':_0x4bdb47(0x2bc),'columns':_0x218d21,'data':_0x3d9be6,'stats':{'state':_0x4bdb47(0x154),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x3d9be6['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x4a31d8=formatAsTable(_0x1ae41b,_0x3d9be6['length'],!![]);await writeOutput(_0x4a31d8,undefined,_0x4bdb47(0x2a2));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a31_0x1cf65c(0x1fb)]=a31_0x1cf65c(0x133);[a31_0x1cf65c(0x1d6)]='Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)';async['execute'](_0x3a2aa3){const _0x2cc3f5=a31_0x1cf65c,{options:_0x5385af,args:_0x337e3e,tdx:_0x185cef}=_0x3a2aa3,_0x4b10f4=_0x5385af,_0x20f447=_0x337e3e[0x0]||_0x5385af[_0x2cc3f5(0x128)];if(!_0x20f447)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'+_0x2cc3f5(0x119)),0x1;const _0x1b42f5=resolveYamlFile(_0x20f447);if(existsSync(_0x1b42f5)){_0x4b10f4[_0x2cc3f5(0x148)]&&console[_0x2cc3f5(0xff)](_0x2cc3f5(0x255)+_0x1b42f5);let _0x551639;try{_0x551639=readFileSync(_0x1b42f5,'utf-8');}catch(_0x3e1958){const _0x5eb8e3=_0x3e1958 instanceof Error?_0x3e1958[_0x2cc3f5(0x24f)]:String(_0x3e1958);return console[_0x2cc3f5(0xff)]('Error\x20reading\x20file:\x20'+_0x5eb8e3),0x1;}const _0x43e9f0=await withSpinner(_0x2cc3f5(0x218),()=>_0x185cef[_0x2cc3f5(0x106)][_0x2cc3f5(0x18f)](_0x551639),{'verbose':_0x4b10f4[_0x2cc3f5(0x148)]}),_0x5abaed=_0x43e9f0['data'],{isNew:_0x58e34e,name:_0x365287,hasChanges:_0x4a605e,diffFormatted:_0x3497f8}=_0x5abaed;if(_0x4a605e){_0x58e34e?console[_0x2cc3f5(0xff)](_0x2cc3f5(0x152)+_0x365287+'\x27:'):console[_0x2cc3f5(0xff)]('\x0aChanges\x20to\x20apply\x20to\x20\x27'+_0x365287+'\x27:');console[_0x2cc3f5(0xff)]('─'[_0x2cc3f5(0x27f)](0x3c)),console['error'](_0x3497f8),console[_0x2cc3f5(0xff)]('─'[_0x2cc3f5(0x27f)](0x3c));const _0x23e3ed=_0x58e34e?'Create\x20parent\x20segment\x20\x27'+_0x365287+'\x27\x20and\x20run\x20workflow?':'Apply\x20changes\x20to\x20\x27'+_0x365287+_0x2cc3f5(0x25a);if(!_0x4b10f4['yes']){if(!isInteractive())return console[_0x2cc3f5(0xff)](a31_0x2d8ea2[_0x2cc3f5(0x1f0)](_0x2cc3f5(0x16a)),_0x2cc3f5(0x108)),console[_0x2cc3f5(0xff)](a31_0x2d8ea2[_0x2cc3f5(0x1b3)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x3d141c=await confirmKey(_0x23e3ed);if(!_0x3d141c)return console[_0x2cc3f5(0xff)](a31_0x2d8ea2[_0x2cc3f5(0x168)](_0x2cc3f5(0x150))),0x1;}const _0x2488e3=_0x58e34e?'Creating':_0x2cc3f5(0x1a2);await withSpinner(_0x2488e3+_0x2cc3f5(0x1c4)+_0x365287+_0x2cc3f5(0x289),()=>_0x5abaed[_0x2cc3f5(0x2de)](),{'verbose':_0x4b10f4[_0x2cc3f5(0x148)]});const _0x51e59c=_0x58e34e?_0x2cc3f5(0x207):'Updated';console['error']('✔\x20'+_0x51e59c+_0x2cc3f5(0x1c4)+_0x365287+'\x27');}else console['error'](_0x2cc3f5(0x20c)+_0x365287+_0x2cc3f5(0x1a5));}const _0x367f64=await withSpinner(_0x2cc3f5(0x28d)+_0x20f447+_0x2cc3f5(0x289),()=>_0x185cef[_0x2cc3f5(0x106)][_0x2cc3f5(0x2c8)](_0x20f447),{'verbose':_0x4b10f4[_0x2cc3f5(0x148)]}),_0x13676d=_0x367f64[_0x2cc3f5(0x20f)],_0x2980f5=getConsoleUrl(_0x4b10f4[_0x2cc3f5(0x22f)],_0x2cc3f5(0x295)+_0x13676d['workflowId']+_0x2cc3f5(0x276)+_0x13676d[_0x2cc3f5(0x27c)]+_0x2cc3f5(0x142)+_0x13676d['workflowAttemptId']);return console[_0x2cc3f5(0xff)](_0x2cc3f5(0x2d0)),console[_0x2cc3f5(0xff)]('\x20\x20'+a31_0x2d8ea2[_0x2cc3f5(0x1b3)]('Audience\x20ID:')+'\x20'+_0x13676d['audienceId']),console[_0x2cc3f5(0xff)]('\x20\x20'+a31_0x2d8ea2[_0x2cc3f5(0x1b3)](_0x2cc3f5(0x193))+'\x20'+_0x13676d[_0x2cc3f5(0x200)]),console['error']('\x20\x20'+a31_0x2d8ea2[_0x2cc3f5(0x1b3)](_0x2cc3f5(0x1b1))+'\x20'+_0x13676d[_0x2cc3f5(0x27c)]),console[_0x2cc3f5(0xff)]('\x20\x20'+a31_0x2d8ea2['dim']('Attempt:')+'\x20'+_0x13676d[_0x2cc3f5(0x18e)]),console[_0x2cc3f5(0xff)]('\x20\x20'+_0x2980f5),console[_0x2cc3f5(0xff)]('\x0a'+a31_0x2d8ea2['dim'](_0x2cc3f5(0x22a))+_0x2cc3f5(0x1d8)+_0x13676d[_0x2cc3f5(0x18e)]+_0x2cc3f5(0x2a9)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a31_0x1cf65c(0x1fb)]='segment:parent:fields';['description']=a31_0x1cf65c(0x21e);async['execute'](_0x14b096){const _0x1911ec=a31_0x1cf65c,{options:_0x4dd5a7,args:_0x323a33,tdx:_0x186526}=_0x14b096,_0x2035c4=_0x323a33[0x0]||_0x4dd5a7[_0x1911ec(0x128)];if(!_0x2035c4)return showParentSegmentNotSetError(_0x1911ec(0x25b)+_0x1911ec(0x222)),0x1;_0x4dd5a7[_0x1911ec(0x148)]&&(console[_0x1911ec(0xff)](_0x1911ec(0x1a3)+_0x4dd5a7['site']),console[_0x1911ec(0xff)](_0x1911ec(0x1e5)+_0x2035c4));const _0x11e217=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x2035c4+_0x1911ec(0x289),()=>_0x186526[_0x1911ec(0x106)][_0x1911ec(0x2c4)](_0x2035c4),{'verbose':_0x4dd5a7[_0x1911ec(0x148)]}),_0x217e1e=_0x11e217['data'];console[_0x1911ec(0xff)](_0x1911ec(0x29b)+_0x217e1e[_0x1911ec(0x1a8)]+'\x20field'+(_0x217e1e[_0x1911ec(0x1a8)]!==0x1?'s':''));if(_0x4dd5a7[_0x1911ec(0x2d4)]||_0x4dd5a7[_0x1911ec(0x237)])return await handleSDKOutput(_0x217e1e,_0x4dd5a7),0x0;return displayFieldsHumanReadable(_0x217e1e,_0x2035c4),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a31_0x1cf65c(0x1fb)]=a31_0x1cf65c(0x1b4);['description']=a31_0x1cf65c(0xea);async['execute'](_0x30995f){const _0x218281=a31_0x1cf65c,{options:_0x11fff0,args:_0x94d3dd,tdx:_0x9857ce}=_0x30995f,_0x121561=_0x11fff0,_0x7af18=_0x94d3dd[0x0]||_0x11fff0[_0x218281(0x128)];if(!_0x7af18)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a'+_0x218281(0x229)+_0x218281(0x214)+_0x218281(0x292)),0x1;_0x11fff0[_0x218281(0x148)]&&(console[_0x218281(0xff)]('Site:\x20'+_0x11fff0['site']),console[_0x218281(0xff)](_0x218281(0x1e5)+_0x7af18));const _0x6b7f96=await withSpinner(_0x218281(0x2d6)+_0x7af18+_0x218281(0x289),()=>_0x9857ce[_0x218281(0x106)]['getParentFull'](_0x7af18),{'verbose':_0x11fff0[_0x218281(0x148)]}),_0x797b94=_0x6b7f96[_0x218281(0x20f)];if(_0x121561['web']){const _0x4fc909=getConsoleNextUrl(_0x121561['site'],_0x218281(0x113)+_0x797b94['id']);return console[_0x218281(0xff)](a31_0x2d8ea2[_0x218281(0xee)]('✔')+'\x20Opening\x20'+a31_0x2d8ea2['cyan'](_0x4fc909)),openBrowser(_0x4fc909),0x0;}return await handleSingleObjectOutput(_0x797b94,_0x11fff0),0x0;}}function a31_0x31f0(_0x27df21,_0x432b95){_0x27df21=_0x27df21-0xd6;const _0x321a97=a31_0x321a();let _0x31f0cf=_0x321a97[_0x27df21];return _0x31f0cf;}export class ParentSegmentDescCommand extends BaseCommand{['name']=a31_0x1cf65c(0x1a9);[a31_0x1cf65c(0x1d6)]='Show\x20parent\x20segment\x20schema\x20(column\x20types)';async[a31_0x1cf65c(0x242)](_0x157817){const _0x1289db=a31_0x1cf65c,{options:_0x35b63f,args:_0x2707a1,tdx:_0x644420}=_0x157817,_0x4926d7=_0x35b63f,_0x51312a=_0x2707a1[0x0]||_0x35b63f[_0x1289db(0x128)];if(!_0x51312a)return showParentSegmentNotSetError(_0x1289db(0x1cf)+_0x1289db(0x158)+_0x1289db(0x214)+_0x1289db(0x247)),0x1;_0x35b63f[_0x1289db(0x148)]&&(console[_0x1289db(0xff)](_0x1289db(0x1a3)+_0x35b63f[_0x1289db(0x22f)]),console['error']('Parent\x20segment:\x20'+_0x51312a));const _0x5be2d1=await withSpinner(_0x1289db(0x126)+_0x51312a+_0x1289db(0x289),()=>_0x644420[_0x1289db(0x106)][_0x1289db(0x2d8)](_0x51312a),{'verbose':_0x35b63f[_0x1289db(0x148)]}),_0x7942c7=_0x5be2d1['data'],_0x204ffa=_0x644420[_0x1289db(0x106)]['getOutputDatabaseName'](_0x7942c7);if(_0x4926d7[_0x1289db(0x123)]){const _0x3cbda7=await this['collectSchema'](_0x157817,_0x51312a,_0x7942c7,_0x204ffa),_0x1d7ecb=this[_0x1289db(0x2b4)](_0x3cbda7);writeFileSync(_0x4926d7[_0x1289db(0x123)],_0x1d7ecb);const _0x144840=_0x3cbda7[_0x1289db(0x2b2)][_0x1289db(0x24b)][_0x1289db(0x1a8)]+_0x3cbda7[_0x1289db(0x180)]['reduce']((_0x400dbc,_0x1bdb7a)=>_0x400dbc+_0x1bdb7a[_0x1289db(0x24b)][_0x1289db(0x1a8)],0x0),_0x2635f0=_0x3cbda7['behaviors']['filter'](_0x5cd108=>_0x5cd108[_0x1289db(0x24b)][_0x1289db(0x1a8)]===0x0)[_0x1289db(0x1a8)];return console[_0x1289db(0x25e)](_0x1289db(0x1d0)+_0x4926d7['output']),console['log'](_0x1289db(0x28a)+_0x204ffa),console[_0x1289db(0x25e)](_0x1289db(0x18c)+_0x3cbda7[_0x1289db(0x180)][_0x1289db(0x1a8)]+_0x1289db(0x26e)),console['log'](_0x1289db(0x2e1)+_0x144840+_0x1289db(0x2cf)),_0x2635f0>0x0&&console[_0x1289db(0x25e)](_0x1289db(0x12d)+_0x2635f0+'\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)'),0x0;}console[_0x1289db(0xff)]('\x0a'+a31_0x2d8ea2[_0x1289db(0x15b)](_0x1289db(0x27d))+'\x20'+a31_0x2d8ea2['cyan'](_0x204ffa));const _0x1976cd=await withSpinner(_0x1289db(0x1ff),()=>_0x644420['segment'][_0x1289db(0x147)](_0x7942c7),{'verbose':_0x35b63f['verbose']});console[_0x1289db(0xff)]('\x0a'+a31_0x2d8ea2[_0x1289db(0x15b)](_0x1289db(0x2b2))+'\x20'+a31_0x2d8ea2[_0x1289db(0x1b3)]('('+_0x204ffa+_0x1289db(0xeb)));const _0x107dc5=await executeSchemaQuery(_0x1976cd[_0x1289db(0x20f)],_0x644420,_0x35b63f);await handleQueryOutput(_0x107dc5,_0x35b63f);const _0x3148fa=await withSpinner('Fetching\x20behavior\x20list...',()=>_0x644420[_0x1289db(0x106)][_0x1289db(0x159)](_0x7942c7),{'verbose':_0x35b63f[_0x1289db(0x148)]});for(const _0x4944e8 of _0x3148fa[_0x1289db(0x20f)]){const _0x188325=_0x1289db(0x2a5)+_0x4944e8[_0x1289db(0x2d2)]()[_0x1289db(0x1d1)](/\s+/g,'_'),_0xfe7b4=_0x1289db(0x236)+_0x204ffa+'.'+_0x188325;console[_0x1289db(0xff)]('\x0a'+a31_0x2d8ea2[_0x1289db(0x15b)](_0x4944e8)+'\x20'+a31_0x2d8ea2[_0x1289db(0x1b3)]('('+_0x204ffa+'.'+_0x188325+')'));try{const _0x4d15a8=await executeSchemaQuery(_0xfe7b4,_0x644420,_0x35b63f);await handleQueryOutput(_0x4d15a8,_0x35b63f);}catch{console[_0x1289db(0xff)](a31_0x2d8ea2[_0x1289db(0x168)](_0x1289db(0x1ad)));}}return 0x0;}async['collectSchema'](_0x1cfefd,_0x5bfdf0,_0x116e77,_0x587d89){const _0xdc4044=a31_0x1cf65c,{options:_0x5c396f,tdx:_0x169a04}=_0x1cfefd,_0x56d47d=await withSpinner('Fetching\x20customers\x20schema...',()=>_0x169a04[_0xdc4044(0x106)]['getParentSQL'](_0x116e77),{'verbose':_0x5c396f[_0xdc4044(0x148)]}),_0x2aca3b=await executeSchemaQuery(_0x56d47d[_0xdc4044(0x20f)],_0x169a04,_0x5c396f),_0xf7ad4a=_0x2aca3b[_0xdc4044(0x20f)]['map'](_0x14d71d=>({'name':_0x14d71d[_0xdc4044(0x114)],'type':_0x14d71d[_0xdc4044(0x253)]})),_0xa414aa=await withSpinner(_0xdc4044(0x26a),()=>_0x169a04[_0xdc4044(0x106)][_0xdc4044(0x159)](_0x116e77),{'verbose':_0x5c396f[_0xdc4044(0x148)]}),_0x3ec40c=[];for(const _0x3c753e of _0xa414aa[_0xdc4044(0x20f)]){const _0x1b46ca=_0xdc4044(0x2a5)+_0x3c753e['toLowerCase']()[_0xdc4044(0x1d1)](/\s+/g,'_'),_0x190951=_0xdc4044(0x236)+_0x587d89+'.'+_0x1b46ca;let _0x265d7b=[];try{const _0xb95934=await executeSchemaQuery(_0x190951,_0x169a04,_0x5c396f);_0x265d7b=_0xb95934[_0xdc4044(0x20f)][_0xdc4044(0x27e)](_0x58ce2b=>({'name':_0x58ce2b['column_name'],'type':_0x58ce2b['column_type']}));}catch{}_0x3ec40c['push']({'table':_0x1b46ca,'columns':_0x265d7b});}return{'database':_0x587d89,'parent_segment':_0x5bfdf0,'parent_id':_0x116e77,'customers':{'table':_0xdc4044(0x2b2),'columns':_0xf7ad4a},'behaviors':_0x3ec40c};}['formatSchemaJson'](_0xf61d3f){const _0x29a1c2=a31_0x1cf65c,_0x1c11ea=_0x48b993=>{const _0x17c0cf=a31_0x31f0;if(_0x48b993[_0x17c0cf(0x1a8)]===0x0)return'[]';const _0x1e6a6a=_0x48b993['map'](_0x323ef4=>_0x17c0cf(0x266)+_0x323ef4[_0x17c0cf(0x1fb)]+_0x17c0cf(0x14f)+_0x323ef4['type']+_0x17c0cf(0x12e));return'[\x0a'+_0x1e6a6a[_0x17c0cf(0x1ba)](',\x0a')+_0x17c0cf(0x211);},_0x8c1715=_0xf61d3f[_0x29a1c2(0x180)][_0x29a1c2(0x27e)](_0x11d4e2=>{const _0x229853=_0x29a1c2;return'\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22'+_0x11d4e2['table']+'\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20'+_0x1c11ea(_0x11d4e2[_0x229853(0x24b)])[_0x229853(0x1d1)](/^/gm,'\x20\x20')[_0x229853(0x115)]()+_0x229853(0x2b7);})['join'](',\x0a');return _0x29a1c2(0x15c)+_0xf61d3f[_0x29a1c2(0x11f)]+_0x29a1c2(0x23e)+_0xf61d3f[_0x29a1c2(0x2dd)]+_0x29a1c2(0x1e9)+_0xf61d3f[_0x29a1c2(0x1fe)]+_0x29a1c2(0x22c)+_0xf61d3f['customers'][_0x29a1c2(0x2a2)]+'\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20'+_0x1c11ea(_0xf61d3f[_0x29a1c2(0x2b2)][_0x29a1c2(0x24b)])[_0x29a1c2(0x1d1)](/^/gm,'\x20\x20')[_0x29a1c2(0x115)]()+_0x29a1c2(0x1f8)+_0x8c1715+_0x29a1c2(0x1a0);}}export class ParentSegmentSQLCommand extends BaseCommand{[a31_0x1cf65c(0x1fb)]='segment:parent:sql';['description']='Get\x20SQL\x20query\x20for\x20parent\x20segment';async[a31_0x1cf65c(0x242)](_0x9989b2){const _0xe11551=a31_0x1cf65c,{options:_0x2da14a,args:_0xd08f43,tdx:_0xe56265}=_0x9989b2,_0x2839d6=_0xd08f43[0x0]||_0x2da14a['parentSegment'];if(!_0x2839d6)return showParentSegmentNotSetError(_0xe11551(0xe3)+_0xe11551(0x19a)),0x1;_0x2da14a[_0xe11551(0x148)]&&(console[_0xe11551(0xff)]('Site:\x20'+_0x2da14a[_0xe11551(0x22f)]),console[_0xe11551(0xff)](_0xe11551(0x1e5)+_0x2839d6));const _0x5a0059=await withSpinner(_0xe11551(0x126)+_0x2839d6+_0xe11551(0x289),()=>_0xe56265[_0xe11551(0x106)][_0xe11551(0x2d8)](_0x2839d6),{'verbose':_0x2da14a[_0xe11551(0x148)]}),_0x4c43db=_0x5a0059['data'],_0x444719=await withSpinner(_0xe11551(0x27a)+_0x2839d6+'\x27...',()=>_0xe56265[_0xe11551(0x106)][_0xe11551(0x147)](_0x4c43db),{'verbose':_0x2da14a[_0xe11551(0x148)]}),_0x2b462d=_0x444719[_0xe11551(0x20f)];return _0x2da14a[_0xe11551(0x2c5)]===_0xe11551(0x2d4)||_0x2da14a[_0xe11551(0x2c5)]===_0xe11551(0x237)?await handleSDKOutput([{'sql':_0x2b462d}],_0x2da14a):console[_0xe11551(0x25e)](_0x2b462d),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a31_0x1cf65c(0x1fb)]='segment:parent:show';['description']=a31_0x1cf65c(0x127);async[a31_0x1cf65c(0x242)](_0x20826e){const _0x585cb2=a31_0x1cf65c,{options:_0x4f4da7,args:_0x191f06,tdx:_0x28b796}=_0x20826e,_0x1cd02e=_0x191f06[0x0]||_0x4f4da7['parentSegment'];if(!_0x1cd02e)return showParentSegmentNotSetError(_0x585cb2(0x146)+_0x585cb2(0x2b0)),0x1;_0x4f4da7[_0x585cb2(0x148)]&&(console['error'](_0x585cb2(0x1a3)+_0x4f4da7[_0x585cb2(0x22f)]),console[_0x585cb2(0xff)](_0x585cb2(0x1e5)+_0x1cd02e));const _0x44c57f=await withSpinner(_0x585cb2(0x126)+_0x1cd02e+'\x27...',()=>_0x28b796[_0x585cb2(0x106)][_0x585cb2(0x2d8)](_0x1cd02e),{'verbose':_0x4f4da7[_0x585cb2(0x148)]}),_0x917451=_0x44c57f[_0x585cb2(0x20f)],_0x470732=await withSpinner(_0x585cb2(0x27a)+_0x1cd02e+_0x585cb2(0x289),()=>_0x28b796[_0x585cb2(0x106)]['getParentSQL'](_0x917451),{'verbose':_0x4f4da7[_0x585cb2(0x148)]});let _0x43d9e0=_0x470732[_0x585cb2(0x20f)];const _0x396273=resolveLimit(_0x4f4da7[_0x585cb2(0x285)],DEFAULT_DISPLAY_LIMIT),_0x1d62c9=/\bLIMIT\s+\d+/i[_0x585cb2(0xf8)](_0x43d9e0);!_0x1d62c9&&(_0x43d9e0=_0x43d9e0['trim']()[_0x585cb2(0x1d1)](/;+$/,''),_0x43d9e0=_0x585cb2(0x1f3)+_0x43d9e0+_0x585cb2(0x175)+_0x396273);_0x4f4da7[_0x585cb2(0x148)]&&console[_0x585cb2(0xff)](_0x585cb2(0x161)+_0x43d9e0);const _0x47f8ad=await withProgressSpinner(_0x585cb2(0x17c),async _0x1f66cf=>{const _0x4ed19f=_0x585cb2,_0x38793c=await _0x28b796[_0x4ed19f(0x25d)]['execute'](_0x43d9e0,{'catalog':'td','schema':_0x4ed19f(0x2db),'onJobId':_0x24f72b=>{const _0x3ef29b=_0x4ed19f;_0x1f66cf[_0x3ef29b(0x208)](_0x24f72b);}});return _0x38793c;},{'verbose':_0x4f4da7['verbose']}),_0x27b345=_0x47f8ad[_0x585cb2(0x20f)],_0x1b924c=_0x27b345[_0x585cb2(0x116)]?_0x585cb2(0x251)+_0x27b345['jobId']+']':'';return console['error'](_0x585cb2(0x1cd)+_0x27b345['stats'][_0x585cb2(0x16e)][_0x585cb2(0x192)]()+_0x585cb2(0x20d)+(_0x585cb2(0x129)+formatElapsed(_0x27b345[_0x585cb2(0xd8)]['elapsedTimeMillis'])+_0x1b924c)),await handleQueryOutput(_0x27b345,_0x4f4da7),0x0;}}export class PSRtListCommand extends BaseCommand{[a31_0x1cf65c(0x1fb)]=a31_0x1cf65c(0x15d);[a31_0x1cf65c(0x1d6)]=a31_0x1cf65c(0x2bd);async['execute'](_0x58046b){const _0xe3b67f=a31_0x1cf65c,{options:_0xa6c7ba,args:_0x5a4216,tdx:_0x2e5a66}=_0x58046b,_0x268cd6=_0x5a4216[0x0],_0x23e1f4=await withSpinner(_0x268cd6?_0xe3b67f(0x1ea)+_0x268cd6+_0xe3b67f(0x289):_0xe3b67f(0x246),()=>_0x2e5a66[_0xe3b67f(0x297)][_0xe3b67f(0x103)](),{'verbose':_0xa6c7ba[_0xe3b67f(0x148)]});let _0x57d666=_0x23e1f4['data'][_0xe3b67f(0x1b0)](_0x1a14ed=>_0x1a14ed[_0xe3b67f(0x2be)]);if(_0x268cd6){const _0x228a3b=_0x268cd6[_0xe3b67f(0x1d1)](/[.+^${}()|[\]\\]/g,_0xe3b67f(0x1c7))[_0xe3b67f(0x1d1)](/\*/g,'.*')[_0xe3b67f(0x1d1)](/\?/g,'.'),_0x4674b8=new RegExp('^'+_0x228a3b+'$','i');_0x57d666=_0x57d666[_0xe3b67f(0x1b0)](_0x343f46=>_0x4674b8[_0xe3b67f(0xf8)](_0x343f46[_0xe3b67f(0x1fb)]));}_0x57d666[_0xe3b67f(0x1cc)]((_0x1651e4,_0x3f1247)=>_0x1651e4['name'][_0xe3b67f(0x1d2)](_0x3f1247['name'])),console[_0xe3b67f(0xff)](_0xe3b67f(0x29b)+_0x57d666[_0xe3b67f(0x1a8)]+_0xe3b67f(0x288)+(_0x57d666['length']!==0x1?'s':''));const _0x164b9b=_0x1b9d6b=>{const _0x2c1c10=_0xe3b67f;return getConsoleNextUrl(_0xa6c7ba['site'],_0x2c1c10(0x113)+_0x1b9d6b);};if(_0xa6c7ba[_0xe3b67f(0x2c5)]===_0xe3b67f(0x2d4)||_0xa6c7ba[_0xe3b67f(0x2c5)]==='jsonl'){const _0x2df0fc=_0x57d666['map'](_0x361886=>({..._0x361886,'url':_0x164b9b(_0x361886['id'])}));await handleSDKOutput(_0x2df0fc,_0xa6c7ba);}else{if(_0x57d666[_0xe3b67f(0x1a8)]===0x0)console[_0xe3b67f(0x25e)](_0xe3b67f(0x1b5));else for(const _0x2cc231 of _0x57d666){const _0x319793=_0x2cc231[_0xe3b67f(0x22d)]?a31_0x2d8ea2[_0xe3b67f(0x1b3)]('\x20('+formatRows(_0x2cc231[_0xe3b67f(0x22d)])+')'):'',_0xe7c734=hyperlink(_0x2cc231['name'],_0x164b9b(_0x2cc231['id']));console['log']('⚡\x20'+_0xe7c734+_0x319793);}}return 0x0;}}export class PSRtValidateCommand extends BaseParentSegmentCommand{['name']=a31_0x1cf65c(0x1dc);[a31_0x1cf65c(0x1d6)]=a31_0x1cf65c(0x201);async['execute'](_0x342f7f){const _0x43ac5c=a31_0x1cf65c,{options:_0x4b274b,args:_0x3e5c09,tdx:_0x4872b9}=_0x342f7f,_0x4b21ea=_0x3e5c09[0x0]||_0x4b274b[_0x43ac5c(0x128)];if(!_0x4b21ea)return showParentSegmentNotSetError(_0x43ac5c(0xed)+_0x43ac5c(0x1f4)),0x1;const _0x3ef2e3=resolveYamlFile(_0x4b21ea);if(!existsSync(_0x3ef2e3))return showFileNotFoundError(_0x3ef2e3,_0x4b21ea),0x1;let _0x3902f5;try{_0x3902f5=readFileSync(_0x3ef2e3,_0x43ac5c(0xd7));}catch(_0xe8a07c){const _0xb2d31f=_0xe8a07c instanceof Error?_0xe8a07c[_0x43ac5c(0x24f)]:String(_0xe8a07c);return console[_0x43ac5c(0xff)]('Error\x20reading\x20file:\x20'+_0xb2d31f),0x1;}const _0x4027e8=createCommandSpinner(a31_0x2d8ea2[_0x43ac5c(0x1b3)](_0x43ac5c(0x15f)),{'verbose':_0x4b274b[_0x43ac5c(0x148)]});_0x4027e8[_0x43ac5c(0x21d)]();const _0x292b87={'realtime':!![],'onProgress':_0x2aa05d=>{_0x4027e8['text']=formatProgressMessage(_0x2aa05d);}};let _0x1a5d32;try{_0x1a5d32=await _0x4872b9[_0x43ac5c(0x106)][_0x43ac5c(0x188)](_0x3902f5,_0x292b87),_0x4027e8[_0x43ac5c(0x1c8)]();}catch(_0x22e8c7){_0x4027e8[_0x43ac5c(0x1c8)]();throw _0x22e8c7;}console['error']('\x0a'+a31_0x2d8ea2[_0x43ac5c(0x15b)](_0x43ac5c(0x16f))+'\x20'+_0x1a5d32[_0x43ac5c(0x1fb)]),console['error']('═'[_0x43ac5c(0x27f)](0x3c)),displayRealtimeValidation(_0x1a5d32),console[_0x43ac5c(0xff)]('─'['repeat'](0x3c));if(_0x1a5d32['errors'][_0x43ac5c(0x1a8)]>0x0){console[_0x43ac5c(0xff)]('\x0a'+a31_0x2d8ea2[_0x43ac5c(0x1f0)]('Errors:'));for(const _0x43a5e8 of _0x1a5d32[_0x43ac5c(0x132)]){console[_0x43ac5c(0xff)]('\x20\x20'+a31_0x2d8ea2['red']('•')+'\x20'+_0x43a5e8);}}return _0x1a5d32[_0x43ac5c(0x135)]&&console[_0x43ac5c(0xff)]('\x0a'+a31_0x2d8ea2[_0x43ac5c(0xee)]('✔')+'\x20RT\x20configuration\x20is\x20valid'),_0x1a5d32['allValid']?0x0:0x1;}}export class PSRtJnListCommand extends BaseCommand{[a31_0x1cf65c(0x1fb)]=a31_0x1cf65c(0x280);[a31_0x1cf65c(0x1d6)]=a31_0x1cf65c(0x240);async['execute'](_0x2cf6eb){const _0x104843=a31_0x1cf65c,{options:_0x5a82b0,args:_0x5f21fe,tdx:_0x17639c}=_0x2cf6eb,_0x3f3264=_0x5f21fe[0x0]||_0x5a82b0[_0x104843(0x128)];if(!_0x3f3264)return showParentSegmentNotSetError(_0x104843(0x1ed)+_0x104843(0x263)),0x1;_0x5a82b0[_0x104843(0x148)]&&(console['error'](_0x104843(0x1a3)+_0x5a82b0[_0x104843(0x22f)]),console['error'](_0x104843(0x1e5)+_0x3f3264));const _0x4cf6ad=await withSpinner(_0x104843(0x126)+_0x3f3264+_0x104843(0x289),()=>_0x17639c[_0x104843(0x106)][_0x104843(0x2d8)](_0x3f3264),{'verbose':_0x5a82b0[_0x104843(0x148)]}),_0x1fff64=_0x4cf6ad[_0x104843(0x20f)],_0x314918=await withSpinner(_0x104843(0x19e)+_0x3f3264+_0x104843(0x289),()=>_0x17639c['realtime']['listJourneys'](_0x1fff64),{'verbose':_0x5a82b0[_0x104843(0x148)]}),_0x3239c1=_0x314918[_0x104843(0x20f)];console['error']('✔\x20Found\x20'+_0x3239c1[_0x104843(0x1a8)]+_0x104843(0x1b2)+(_0x3239c1[_0x104843(0x1a8)]!==0x1?'s':''));if(_0x5a82b0['format']===_0x104843(0x2d4)||_0x5a82b0[_0x104843(0x2c5)]===_0x104843(0x237))await handleSDKOutput(_0x3239c1,_0x5a82b0);else{if(_0x3239c1[_0x104843(0x1a8)]===0x0)console[_0x104843(0x25e)]('No\x20RT\x20journeys\x20found');else for(const _0xfd7b47 of _0x3239c1){const _0x10a686=_0xfd7b47[_0x104843(0x2cb)]===_0x104843(0x225)?'🚀':'📝',_0x36d9ab=_0xfd7b47[_0x104843(0x1c6)]?a31_0x2d8ea2[_0x104843(0x168)]('\x20(paused)'):'',_0x7e0617=a31_0x2d8ea2[_0x104843(0x1b3)]('\x20('+_0xfd7b47['stageCount']+'\x20stage'+(_0xfd7b47[_0x104843(0x15e)]!==0x1?'s':'')+')');console['log'](_0x10a686+'\x20'+_0xfd7b47['name']+_0x36d9ab+_0x7e0617);}}return 0x0;}}export class PSRtJnPauseCommand extends BaseCommand{['name']='ps:rt:jn:pause';[a31_0x1cf65c(0x1d6)]=a31_0x1cf65c(0x164);async[a31_0x1cf65c(0x242)](_0x20dc31){const _0x5b054b=a31_0x1cf65c,{options:_0x1607fc,args:_0x240dff,tdx:_0x2d1572}=_0x20dc31,_0x3ade0e=_0x240dff[0x0];if(!_0x3ade0e)return console[_0x5b054b(0xff)](a31_0x2d8ea2[_0x5b054b(0x1f0)](_0x5b054b(0x2d3))),console[_0x5b054b(0xff)]('Usage:\x20tdx\x20ps\x20rt\x20jn\x20pause_activations\x20<journeyId>\x0a'),console['error'](a31_0x2d8ea2[_0x5b054b(0x1b3)](_0x5b054b(0x23c))),0x1;_0x1607fc[_0x5b054b(0x148)]&&(console[_0x5b054b(0xff)](_0x5b054b(0x1a3)+_0x1607fc[_0x5b054b(0x22f)]),console[_0x5b054b(0xff)](_0x5b054b(0x16c)+_0x3ade0e));const _0x48154c=await withSpinner('Pausing\x20activations\x20for\x20RT\x20journey\x20\x27'+_0x3ade0e+_0x5b054b(0x289),()=>_0x2d1572[_0x5b054b(0x297)][_0x5b054b(0x24d)](_0x3ade0e),{'verbose':_0x1607fc[_0x5b054b(0x148)]}),_0x5f4075=_0x48154c['data'];console[_0x5b054b(0xff)](_0x5b054b(0x172)+_0x5f4075['name']+'\x27');if(_0x1607fc[_0x5b054b(0x2c5)]===_0x5b054b(0x2d4)||_0x1607fc[_0x5b054b(0x2c5)]==='jsonl')await handleSDKOutput([_0x5f4075],_0x1607fc);else{const _0x599a77=_0x5f4075[_0x5b054b(0x2cb)]===_0x5b054b(0x225)?'🚀':'📝',_0x37610c=_0x5f4075[_0x5b054b(0x1c6)]?a31_0x2d8ea2[_0x5b054b(0x168)](_0x5b054b(0x26b)):'';console[_0x5b054b(0x25e)](_0x599a77+'\x20'+_0x5f4075[_0x5b054b(0x1fb)]+_0x37610c);}return 0x0;}}export class PSRtJnResumeCommand extends BaseCommand{[a31_0x1cf65c(0x1fb)]=a31_0x1cf65c(0x252);[a31_0x1cf65c(0x1d6)]=a31_0x1cf65c(0x110);async[a31_0x1cf65c(0x242)](_0x1dde23){const _0x681e93=a31_0x1cf65c,{options:_0x4a913c,args:_0x5d45af,tdx:_0x10ed03}=_0x1dde23,_0x59917d=_0x5d45af[0x0];if(!_0x59917d)return console['error'](a31_0x2d8ea2['red'](_0x681e93(0x2d3))),console[_0x681e93(0xff)](_0x681e93(0x1cb)),console[_0x681e93(0xff)](a31_0x2d8ea2[_0x681e93(0x1b3)](_0x681e93(0x23c))),0x1;_0x4a913c[_0x681e93(0x148)]&&(console['error'](_0x681e93(0x1a3)+_0x4a913c[_0x681e93(0x22f)]),console['error']('RT\x20Journey\x20ID:\x20'+_0x59917d));const _0x4789b7=await withSpinner('Resuming\x20activations\x20for\x20RT\x20journey\x20\x27'+_0x59917d+_0x681e93(0x289),()=>_0x10ed03[_0x681e93(0x297)]['resumeJourney'](_0x59917d),{'verbose':_0x4a913c[_0x681e93(0x148)]}),_0x5831ad=_0x4789b7[_0x681e93(0x20f)];console[_0x681e93(0xff)]('✔\x20Resumed\x20activations\x20for\x20RT\x20journey\x20\x27'+_0x5831ad[_0x681e93(0x1fb)]+'\x27');if(_0x4a913c[_0x681e93(0x2c5)]==='json'||_0x4a913c[_0x681e93(0x2c5)]===_0x681e93(0x237))await handleSDKOutput([_0x5831ad],_0x4a913c);else{const _0x49747d=_0x5831ad['state']===_0x681e93(0x225)?'🚀':'📝',_0x3fd8e5=_0x5831ad[_0x681e93(0x1c6)]?a31_0x2d8ea2[_0x681e93(0x168)]('\x20(paused)'):'';console['log'](_0x49747d+'\x20'+_0x5831ad[_0x681e93(0x1fb)]+_0x3fd8e5);}return 0x0;}}export class PSRtConfigVersionCommand extends BaseCommand{[a31_0x1cf65c(0x1fb)]=a31_0x1cf65c(0x2e2);['description']=a31_0x1cf65c(0x101);async[a31_0x1cf65c(0x242)](_0x52a646){const _0x446345=a31_0x1cf65c,{options:_0x3aec3d,args:_0x5e0435,tdx:_0x54d78a}=_0x52a646,_0xd6aeb1=_0x5e0435[0x0]||_0x3aec3d[_0x446345(0x128)];if(!_0xd6aeb1)return showParentSegmentNotSetError(_0x446345(0x29a)+_0x446345(0x12a)),0x1;_0x3aec3d[_0x446345(0x148)]&&(console[_0x446345(0xff)](_0x446345(0x1a3)+_0x3aec3d[_0x446345(0x22f)]),console[_0x446345(0xff)](_0x446345(0x1e5)+_0xd6aeb1));const _0x3ebf2d=await withSpinner(_0x446345(0x126)+_0xd6aeb1+_0x446345(0x289),()=>_0x54d78a['segment']['resolveParentId'](_0xd6aeb1),{'verbose':_0x3aec3d[_0x446345(0x148)]}),_0x3d0d41=_0x3ebf2d['data'],_0x37e92a=await withSpinner('Getting\x20RT\x20configuration\x20version\x20for\x20\x27'+_0xd6aeb1+'\x27...',()=>_0x54d78a[_0x446345(0x297)]['getCurrentConfigVersion'](_0x3d0d41),{'verbose':_0x3aec3d[_0x446345(0x148)]}),_0x134e6a=_0x37e92a[_0x446345(0x20f)];return console[_0x446345(0xff)](_0x446345(0xf5)),_0x3aec3d['format']===_0x446345(0x2d4)||_0x3aec3d[_0x446345(0x2c5)]===_0x446345(0x237)?await handleSDKOutput([_0x134e6a],_0x3aec3d):(console['log']('id:\x20'+_0x134e6a['id']),console[_0x446345(0x25e)](_0x446345(0x1c2)+_0x134e6a[_0x446345(0x13e)]),console[_0x446345(0x25e)]('identifier:\x20'+_0x134e6a[_0x446345(0x22e)]),console['log'](_0x446345(0x283)+_0x134e6a['eventKind']),console[_0x446345(0x25e)]('status:\x20'+_0x134e6a[_0x446345(0x200)])),0x0;}}export class PSPzServiceListCommand extends BaseCommand{[a31_0x1cf65c(0x1fb)]=a31_0x1cf65c(0x15a);['description']=a31_0x1cf65c(0x205);async['execute'](_0x5e7f4c){const _0x55640d=a31_0x1cf65c,{options:_0x4b4a9c,args:_0x2a7d05,tdx:_0x33ce9c}=_0x5e7f4c,_0x302706=_0x2a7d05[0x0]||_0x4b4a9c['parentSegment'];if(!_0x302706)return showParentSegmentNotSetError(_0x55640d(0xd6)+_0x55640d(0x248)),0x1;const _0x506b03=await withSpinner(_0x55640d(0x126)+_0x302706+_0x55640d(0x289),()=>_0x33ce9c['segment']['resolveParentId'](_0x302706),{'verbose':_0x4b4a9c[_0x55640d(0x148)]}),_0x521965=_0x506b03[_0x55640d(0x20f)],_0x3d9c17=await withSpinner(_0x55640d(0x27b)+_0x302706+_0x55640d(0x289),()=>_0x33ce9c[_0x55640d(0x271)][_0x55640d(0x103)](_0x521965),{'verbose':_0x4b4a9c[_0x55640d(0x148)]}),_0x36b4e1=_0x3d9c17['data'];console['error'](_0x55640d(0x29b)+_0x36b4e1[_0x55640d(0x1a8)]+_0x55640d(0x1db)+(_0x36b4e1[_0x55640d(0x1a8)]!==0x1?'s':''));if(_0x4b4a9c[_0x55640d(0x2c5)]===_0x55640d(0x2d4)||_0x4b4a9c['format']===_0x55640d(0x237))await handleSDKOutput(_0x36b4e1,_0x4b4a9c);else{if(_0x36b4e1[_0x55640d(0x1a8)]===0x0)console[_0x55640d(0x25e)](_0x55640d(0x189)),console[_0x55640d(0xff)](a31_0x2d8ea2[_0x55640d(0x153)](_0x55640d(0x2b9)));else for(const _0x7432bb of _0x36b4e1){console[_0x55640d(0x25e)](a31_0x2d8ea2['bold'](_0x7432bb[_0x55640d(0x1fb)])+'\x20'+a31_0x2d8ea2[_0x55640d(0x1b3)]('(id:\x20'+_0x7432bb['id']+')'));_0x7432bb[_0x55640d(0x1d6)]&&console[_0x55640d(0x25e)]('\x20\x20'+a31_0x2d8ea2[_0x55640d(0x1b3)](_0x7432bb[_0x55640d(0x1d6)]));if(_0x7432bb['tokens']&&_0x7432bb['tokens'][_0x55640d(0x1a8)]>0x0)for(const _0x2238b7 of _0x7432bb['tokens']){const _0x47e64d=_0x2238b7[_0x55640d(0x260)]?.['length']?_0x2238b7['allowedIps']['join'](',\x20'):_0x55640d(0x209);console[_0x55640d(0x25e)]('\x20\x20'+a31_0x2d8ea2[_0x55640d(0x153)](_0x55640d(0x197))+'\x20'+_0x2238b7[_0x55640d(0x1fb)]+'\x20'+a31_0x2d8ea2[_0x55640d(0x1b3)](_0x55640d(0x29e)+_0x2238b7['id']+')')),console[_0x55640d(0x25e)]('\x20\x20\x20\x20'+a31_0x2d8ea2[_0x55640d(0x1b3)](_0x55640d(0xef))+'\x20'+_0x47e64d);}else console['log']('\x20\x20'+a31_0x2d8ea2[_0x55640d(0x1b3)]('no\x20tokens\x20configured'));}}return 0x0;}}export class PSPzServiceCreateCommand extends BaseCommand{[a31_0x1cf65c(0x1fb)]=a31_0x1cf65c(0x28f);['description']=a31_0x1cf65c(0x10e);async[a31_0x1cf65c(0x242)](_0x2bdaec){const _0x2f8a09=a31_0x1cf65c,{options:_0x5d47ab,args:_0x4e31b4,tdx:_0x4db1af}=_0x2bdaec,_0x5f57e8=_0x5d47ab,_0x750af0=_0x4e31b4[0x0],_0x15c0b6=_0x4e31b4[0x1]||_0x5d47ab[_0x2f8a09(0x128)];if(!_0x750af0)return console[_0x2f8a09(0xff)]('Error:\x20Service\x20name\x20is\x20required'),console[_0x2f8a09(0xff)](_0x2f8a09(0x282)),console[_0x2f8a09(0xff)](_0x2f8a09(0x23a)),0x1;if(!_0x15c0b6)return showParentSegmentNotSetError(_0x2f8a09(0x29f)+_0x2f8a09(0x23a)),0x1;const _0x3267ac=await withSpinner(_0x2f8a09(0x126)+_0x15c0b6+_0x2f8a09(0x289),()=>_0x4db1af[_0x2f8a09(0x106)][_0x2f8a09(0x2d8)](_0x15c0b6),{'verbose':_0x5d47ab[_0x2f8a09(0x148)]}),_0x60233a=_0x3267ac['data'],_0x9576e6={'name':_0x750af0,'description':_0x5f57e8['description'],'public':_0x5f57e8[_0x2f8a09(0x177)]},_0x4c6a6f=await withSpinner(_0x2f8a09(0x244)+_0x750af0+_0x2f8a09(0x289),()=>_0x4db1af[_0x2f8a09(0x271)][_0x2f8a09(0x16d)](_0x60233a,_0x9576e6),{'verbose':_0x5d47ab[_0x2f8a09(0x148)]}),_0x44f86e=_0x4c6a6f[_0x2f8a09(0x20f)];return console[_0x2f8a09(0xff)]('✔\x20Created\x20personalization\x20service\x20\x27'+_0x44f86e[_0x2f8a09(0x1fb)]+_0x2f8a09(0x273)+_0x44f86e['id']),await handleSDKOutput([_0x44f86e],_0x5d47ab),0x0;}}export class PSPzServiceShowCommand extends BaseCommand{['name']='ps:pz:service:show';[a31_0x1cf65c(0x1d6)]='Show\x20personalization\x20service\x20details';async[a31_0x1cf65c(0x242)](_0x38c9c3){const _0x5e8f71=a31_0x1cf65c,{options:_0x48e22c,args:_0x432e11,tdx:_0x5268c8}=_0x38c9c3,_0x1be177=_0x432e11[0x0],_0x36303b=_0x432e11[0x1]||_0x48e22c[_0x5e8f71(0x128)];if(!_0x1be177)return console[_0x5e8f71(0xff)](_0x5e8f71(0x1f6)),console[_0x5e8f71(0xff)](_0x5e8f71(0x19b)),console[_0x5e8f71(0xff)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x36303b)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;const _0x34ae40=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x36303b+_0x5e8f71(0x289),()=>_0x5268c8['segment'][_0x5e8f71(0x2d8)](_0x36303b),{'verbose':_0x48e22c[_0x5e8f71(0x148)]}),_0x210270=_0x34ae40[_0x5e8f71(0x20f)],_0x4fea5b=await withSpinner(_0x5e8f71(0xf2)+_0x1be177+'\x27...',()=>_0x5268c8[_0x5e8f71(0x271)][_0x5e8f71(0x233)](_0x210270,_0x1be177),{'verbose':_0x48e22c[_0x5e8f71(0x148)]}),_0x4bf1c7=_0x4fea5b[_0x5e8f71(0x20f)];if(_0x48e22c[_0x5e8f71(0x2d4)]||_0x48e22c['jsonl'])await handleSDKOutput([_0x4bf1c7],_0x48e22c);else{console[_0x5e8f71(0x25e)](a31_0x2d8ea2['bold'](_0x4bf1c7[_0x5e8f71(0x1fb)])+'\x20'+a31_0x2d8ea2[_0x5e8f71(0x1b3)](_0x5e8f71(0x29e)+_0x4bf1c7['id']+')'));_0x4bf1c7['description']&&console['log']('\x20\x20'+a31_0x2d8ea2[_0x5e8f71(0x1b3)](_0x4bf1c7['description']));console[_0x5e8f71(0x25e)]('\x20\x20'+a31_0x2d8ea2[_0x5e8f71(0x153)](_0x5e8f71(0x11c))+'\x20'+(_0x4bf1c7[_0x5e8f71(0x177)]?_0x5e8f71(0x268):'no'));if(_0x4bf1c7[_0x5e8f71(0x231)]&&_0x4bf1c7['tokens'][_0x5e8f71(0x1a8)]>0x0)for(const _0x3312cc of _0x4bf1c7[_0x5e8f71(0x231)]){const _0x554e2c=_0x3312cc[_0x5e8f71(0x260)]?.[_0x5e8f71(0x1a8)]?_0x3312cc[_0x5e8f71(0x260)][_0x5e8f71(0x1ba)](',\x20'):_0x5e8f71(0x209);console['log']('\x20\x20'+a31_0x2d8ea2['cyan'](_0x5e8f71(0x197))+'\x20'+_0x3312cc[_0x5e8f71(0x1fb)]+'\x20'+a31_0x2d8ea2[_0x5e8f71(0x1b3)](_0x5e8f71(0x29e)+_0x3312cc['id']+')')),console[_0x5e8f71(0x25e)](_0x5e8f71(0x191)+a31_0x2d8ea2['dim'](_0x5e8f71(0xef))+'\x20'+_0x554e2c);}else console[_0x5e8f71(0x25e)]('\x20\x20'+a31_0x2d8ea2[_0x5e8f71(0x1b3)](_0x5e8f71(0x270)));}return 0x0;}}export class PSPzServiceDeleteCommand extends BaseCommand{[a31_0x1cf65c(0x1fb)]=a31_0x1cf65c(0xe8);[a31_0x1cf65c(0x1d6)]='Delete\x20a\x20personalization\x20service';async[a31_0x1cf65c(0x242)](_0x4ac5f8){const _0x4a0566=a31_0x1cf65c,{options:_0x5a4702,args:_0x248c3d,tdx:_0x42f933}=_0x4ac5f8,_0x3ccc92=_0x248c3d[0x0],_0x428812=_0x248c3d[0x1]||_0x5a4702['parentSegment'];if(!_0x3ccc92)return console[_0x4a0566(0xff)](_0x4a0566(0x1f6)),console[_0x4a0566(0xff)](_0x4a0566(0xf6)),console['error'](_0x4a0566(0x1d4)),0x1;if(!_0x428812)return showParentSegmentNotSetError(_0x4a0566(0x187)+_0x4a0566(0x1d4)),0x1;const _0xb2e17c=await withSpinner(_0x4a0566(0x126)+_0x428812+_0x4a0566(0x289),()=>_0x42f933['segment'][_0x4a0566(0x2d8)](_0x428812),{'verbose':_0x5a4702['verbose']}),_0x189228=_0xb2e17c[_0x4a0566(0x20f)];return await withSpinner('Deleting\x20personalization\x20service\x20\x27'+_0x3ccc92+_0x4a0566(0x289),()=>_0x42f933[_0x4a0566(0x271)][_0x4a0566(0x2b8)](_0x189228,_0x3ccc92),{'verbose':_0x5a4702[_0x4a0566(0x148)]}),console['error'](_0x4a0566(0x21c)+_0x3ccc92+'\x27'),0x0;}}export class PSPzServiceUpdateCommand extends BaseCommand{[a31_0x1cf65c(0x1fb)]=a31_0x1cf65c(0xf1);['description']=a31_0x1cf65c(0x11d);async[a31_0x1cf65c(0x242)](_0x455fc8){const _0x47f073=a31_0x1cf65c,{options:_0x55f10c,args:_0x37224d,tdx:_0x4f3d43}=_0x455fc8,_0x572e2a=_0x55f10c,_0x55e302=_0x37224d[0x0],_0x1f54da=_0x37224d[0x1]||_0x55f10c[_0x47f073(0x128)];if(!_0x55e302)return console['error'](_0x47f073(0x1f6)),console[_0x47f073(0xff)](_0x47f073(0xf7)),console['error'](_0x47f073(0x267)),0x1;if(!_0x572e2a[_0x47f073(0x1fb)])return console[_0x47f073(0xff)](_0x47f073(0x169)),console[_0x47f073(0xff)](_0x47f073(0xf7)),0x1;if(!_0x1f54da)return showParentSegmentNotSetError(_0x47f073(0x10a)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context'),0x1;const _0x9ff28e=await withSpinner(_0x47f073(0x126)+_0x1f54da+_0x47f073(0x289),()=>_0x4f3d43[_0x47f073(0x106)][_0x47f073(0x2d8)](_0x1f54da),{'verbose':_0x55f10c[_0x47f073(0x148)]}),_0x3c14b5=_0x9ff28e[_0x47f073(0x20f)],_0x2de75b={'name':_0x572e2a[_0x47f073(0x1fb)]};_0x572e2a[_0x47f073(0x1d6)]!==undefined&&(_0x2de75b[_0x47f073(0x1d6)]=_0x572e2a[_0x47f073(0x1d6)]);const _0xa9d30f=await withSpinner(_0x47f073(0x13f)+_0x55e302+_0x47f073(0x289),()=>_0x4f3d43[_0x47f073(0x271)][_0x47f073(0x1c0)](_0x3c14b5,_0x55e302,_0x2de75b),{'verbose':_0x55f10c[_0x47f073(0x148)]}),_0x34f951=_0xa9d30f[_0x47f073(0x20f)];return console[_0x47f073(0xff)](_0x47f073(0x2bb)+_0x34f951[_0x47f073(0x1fb)]+'\x27'),await handleSDKOutput([_0x34f951],_0x55f10c),0x0;}}export class PSPzServiceTokenCreateCommand extends BaseCommand{['name']=a31_0x1cf65c(0x224);[a31_0x1cf65c(0x1d6)]='Create\x20a\x20token\x20for\x20a\x20personalization\x20service';async[a31_0x1cf65c(0x242)](_0x580d45){const _0x2afeb3=a31_0x1cf65c,{options:_0x351caf,args:_0x5043bb,tdx:_0x4543d7}=_0x580d45,_0x522129=_0x351caf,_0x24c44b=_0x5043bb[0x0],_0xdd85ff=_0x5043bb[0x1],_0x25b549=_0x5043bb[0x2]||_0x351caf[_0x2afeb3(0x128)];if(!_0x24c44b)return console[_0x2afeb3(0xff)](_0x2afeb3(0x28b)),console[_0x2afeb3(0xff)](_0x2afeb3(0x287)),console[_0x2afeb3(0xff)](_0x2afeb3(0x2d7)),0x1;if(!_0xdd85ff)return console[_0x2afeb3(0xff)](_0x2afeb3(0x1f6)),console[_0x2afeb3(0xff)](_0x2afeb3(0x287)),console[_0x2afeb3(0xff)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x25b549)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;const _0x24ba3e=await withSpinner(_0x2afeb3(0x126)+_0x25b549+_0x2afeb3(0x289),()=>_0x4543d7['segment'][_0x2afeb3(0x2d8)](_0x25b549),{'verbose':_0x351caf['verbose']}),_0x14cbb3=_0x24ba3e['data'],_0xc38937={'name':_0x24c44b};_0x522129[_0x2afeb3(0x260)]&&(_0xc38937['allowedIps']=_0x522129[_0x2afeb3(0x260)]['split'](',')['map'](_0x41a5ff=>_0x41a5ff[_0x2afeb3(0x115)]()));_0x522129[_0x2afeb3(0x1d6)]&&(_0xc38937[_0x2afeb3(0x1d6)]=_0x522129[_0x2afeb3(0x1d6)]);const _0x87477c=await withSpinner('Creating\x20token\x20\x27'+_0x24c44b+'\x27\x20for\x20service\x20\x27'+_0xdd85ff+_0x2afeb3(0x289),()=>_0x4543d7['personalization'][_0x2afeb3(0x11a)](_0x14cbb3,_0xdd85ff,_0xc38937),{'verbose':_0x351caf[_0x2afeb3(0x148)]}),_0x28d954=_0x87477c[_0x2afeb3(0x20f)];return console[_0x2afeb3(0xff)](_0x2afeb3(0x17b)+_0x28d954['name']+'\x27\x20with\x20ID:\x20'+_0x28d954['id']),_0x28d954[_0x2afeb3(0x230)]&&(console[_0x2afeb3(0xff)](a31_0x2d8ea2['yellow'](_0x2afeb3(0x24a))),console[_0x2afeb3(0xff)](a31_0x2d8ea2[_0x2afeb3(0x153)](_0x28d954[_0x2afeb3(0x230)])),console[_0x2afeb3(0xff)]('')),await handleSDKOutput([_0x28d954],_0x351caf),0x0;}}export class PSPzServiceTokenDeleteCommand extends BaseCommand{[a31_0x1cf65c(0x1fb)]=a31_0x1cf65c(0x1ec);[a31_0x1cf65c(0x1d6)]=a31_0x1cf65c(0x2c3);async[a31_0x1cf65c(0x242)](_0x2637fd){const _0x3380ca=a31_0x1cf65c,{options:_0x8a1fce,args:_0x2b50ed,tdx:_0x1b5436}=_0x2637fd,_0xb720cc=_0x2b50ed[0x0],_0xdcd7ea=_0x2b50ed[0x1]||_0x8a1fce[_0x3380ca(0x128)];if(!_0xb720cc)return console[_0x3380ca(0xff)](_0x3380ca(0x2a3)),console[_0x3380ca(0xff)](_0x3380ca(0x1e3)),console[_0x3380ca(0xff)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0xdcd7ea)return showParentSegmentNotSetError(_0x3380ca(0x181)+_0x3380ca(0xe1)),0x1;const _0x410663=await withSpinner(_0x3380ca(0x126)+_0xdcd7ea+'\x27...',()=>_0x1b5436[_0x3380ca(0x106)][_0x3380ca(0x2d8)](_0xdcd7ea),{'verbose':_0x8a1fce[_0x3380ca(0x148)]}),_0x2737bb=_0x410663[_0x3380ca(0x20f)],_0x5e516b=await withSpinner(_0x3380ca(0xfb),()=>_0x1b5436[_0x3380ca(0x271)][_0x3380ca(0x103)](_0x2737bb),{'verbose':_0x8a1fce['verbose']}),_0x471aa9=_0x5e516b[_0x3380ca(0x20f)];let _0xc95506;for(const _0xacf39 of _0x471aa9){if(_0xacf39['tokens']?.[_0x3380ca(0x291)](_0x3bd737=>_0x3bd737['id']===_0xb720cc)){_0xc95506=_0xacf39['id'];break;}}if(!_0xc95506)return console[_0x3380ca(0xff)]('Error:\x20Token\x20\x27'+_0xb720cc+_0x3380ca(0x2ab)),0x1;const _0x3238b6=await withSpinner(_0x3380ca(0x203)+_0xb720cc+_0x3380ca(0x289),()=>_0x1b5436['personalization'][_0x3380ca(0x1d7)](_0x2737bb,_0xc95506,_0xb720cc),{'verbose':_0x8a1fce[_0x3380ca(0x148)]}),_0x2ed0d5=_0x3238b6[_0x3380ca(0x20f)];return console[_0x3380ca(0xff)](_0x3380ca(0x11b)+(_0x2ed0d5['name']||_0xb720cc)+'\x27'),await handleSDKOutput([_0x2ed0d5],_0x8a1fce),0x0;}}export class PSPzListCommand extends BaseCommand{[a31_0x1cf65c(0x1fb)]='ps:pz:list';[a31_0x1cf65c(0x1d6)]=a31_0x1cf65c(0x2af);async[a31_0x1cf65c(0x242)](_0x3cc6a8){const _0xecdb37=a31_0x1cf65c,{options:_0x28c1f4,args:_0x5064c1,tdx:_0xc73bc7}=_0x3cc6a8,_0x5c96ba=_0x5064c1[0x0]||_0x28c1f4['parentSegment'];if(!_0x5c96ba)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'+'\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 _0x409246=await withSpinner(_0xecdb37(0x126)+_0x5c96ba+_0xecdb37(0x289),()=>_0xc73bc7['segment'][_0xecdb37(0x2d8)](_0x5c96ba),{'verbose':_0x28c1f4['verbose']}),_0x4725ef=_0x409246[_0xecdb37(0x20f)],_0xd9b9c0=await withSpinner(_0xecdb37(0x213)+_0x5c96ba+_0xecdb37(0x289),()=>_0xc73bc7[_0xecdb37(0x271)][_0xecdb37(0x11e)](_0x4725ef),{'verbose':_0x28c1f4[_0xecdb37(0x148)]}),_0x473a04=_0xd9b9c0[_0xecdb37(0x20f)];console[_0xecdb37(0xff)](_0xecdb37(0x29b)+_0x473a04[_0xecdb37(0x1a8)]+_0xecdb37(0x204)+(_0x473a04[_0xecdb37(0x1a8)]!==0x1?'s':''));if(_0x28c1f4['format']==='json'||_0x28c1f4[_0xecdb37(0x2c5)]==='jsonl')await handleSDKOutput(_0x473a04,_0x28c1f4);else{if(_0x473a04[_0xecdb37(0x1a8)]===0x0)console[_0xecdb37(0x25e)](_0xecdb37(0x1e8));else for(const _0x551035 of _0x473a04){console[_0xecdb37(0x25e)](a31_0x2d8ea2[_0xecdb37(0x15b)](_0x551035[_0xecdb37(0x1fb)])+'\x20'+a31_0x2d8ea2['dim'](_0xecdb37(0x29e)+_0x551035['id']+')'));_0x551035[_0xecdb37(0x1d6)]&&console[_0xecdb37(0x25e)]('\x20\x20'+a31_0x2d8ea2[_0xecdb37(0x1b3)](_0x551035[_0xecdb37(0x1d6)]));const _0x1a873d=_0x551035['sections']?.[_0xecdb37(0x1a8)]||0x0;console[_0xecdb37(0x25e)]('\x20\x20'+a31_0x2d8ea2[_0xecdb37(0x153)](_0xecdb37(0xf9))+'\x20'+_0x1a873d);if(_0x551035[_0xecdb37(0x139)]&&_0x551035[_0xecdb37(0x139)][_0xecdb37(0x1a8)]>0x0)for(const _0x40df36 of _0x551035[_0xecdb37(0x139)]){console[_0xecdb37(0x25e)](_0xecdb37(0x125)+_0x40df36['name']);}}}return 0x0;}}export class PSPzShowCommand extends BaseCommand{[a31_0x1cf65c(0x1fb)]='ps:pz:show';[a31_0x1cf65c(0x1d6)]=a31_0x1cf65c(0xfd);async[a31_0x1cf65c(0x242)](_0x5988a3){const _0x1f254b=a31_0x1cf65c,{options:_0x529dff,args:_0x10cfab,tdx:_0x29f9a3}=_0x5988a3,_0x11bd68=_0x10cfab[0x0];if(!_0x11bd68)return console[_0x1f254b(0xff)](_0x1f254b(0x156)),console[_0x1f254b(0xff)](_0x1f254b(0x1f1)),0x1;const _0x5bce67=await withSpinner(_0x1f254b(0x2c2)+_0x11bd68+_0x1f254b(0x289),()=>_0x29f9a3['personalization']['getPersonalization'](_0x11bd68),{'verbose':_0x529dff[_0x1f254b(0x148)]}),_0x1b21d7=_0x5bce67[_0x1f254b(0x20f)];console['error']('✔\x20Found\x20personalization\x20\x27'+_0x1b21d7[_0x1f254b(0x1fb)]+'\x27');if(_0x529dff[_0x1f254b(0x2c5)]===_0x1f254b(0x2d4)||_0x529dff['format']===_0x1f254b(0x237))await handleSDKOutput([_0x1b21d7],_0x529dff);else{console[_0x1f254b(0x25e)](a31_0x2d8ea2['bold'](_0x1b21d7[_0x1f254b(0x1fb)])+'\x20'+a31_0x2d8ea2['dim']('(id:\x20'+_0x1b21d7['id']+')'));_0x1b21d7[_0x1f254b(0x1d6)]&&console[_0x1f254b(0x25e)]('\x20\x20'+a31_0x2d8ea2[_0x1f254b(0x1b3)](_0x1b21d7[_0x1f254b(0x1d6)]));_0x1b21d7[_0x1f254b(0x13e)]&&console[_0x1f254b(0x25e)]('\x20\x20'+a31_0x2d8ea2['cyan'](_0x1f254b(0x250))+'\x20'+_0x1b21d7[_0x1f254b(0x13e)]);console[_0x1f254b(0x25e)]('\x20\x20'+a31_0x2d8ea2[_0x1f254b(0x153)](_0x1f254b(0x275))+'\x20'+_0x1b21d7[_0x1f254b(0x17a)]),console[_0x1f254b(0x25e)]('\x20\x20'+a31_0x2d8ea2[_0x1f254b(0x153)](_0x1f254b(0x2bf))+'\x20'+_0x1b21d7['updatedAt']);const _0x3411ab=_0x1b21d7['sections']?.[_0x1f254b(0x1a8)]||0x0;console[_0x1f254b(0x25e)]('\x20\x20'+a31_0x2d8ea2[_0x1f254b(0x153)](_0x1f254b(0xf9))+'\x20'+_0x3411ab);if(_0x1b21d7[_0x1f254b(0x139)]&&_0x1b21d7[_0x1f254b(0x139)][_0x1f254b(0x1a8)]>0x0)for(const _0x2aab9c of _0x1b21d7['sections']){console[_0x1f254b(0x25e)](_0x1f254b(0x191)+a31_0x2d8ea2[_0x1f254b(0x15b)](_0x2aab9c[_0x1f254b(0x1fb)])+'\x20'+a31_0x2d8ea2['dim'](_0x1f254b(0x29e)+_0x2aab9c['id']+')')),_0x2aab9c[_0x1f254b(0x241)]&&(console['log'](_0x1f254b(0xec)+a31_0x2d8ea2['cyan'](_0x1f254b(0x20b))+'\x20'+_0x2aab9c[_0x1f254b(0x241)]['name']),_0x2aab9c[_0x1f254b(0x241)][_0x1f254b(0x136)]?.[_0x1f254b(0x160)]&&console[_0x1f254b(0x25e)](_0x1f254b(0x20e)+a31_0x2d8ea2['cyan'](_0x1f254b(0x170))+'\x20'+_0x2aab9c[_0x1f254b(0x241)][_0x1f254b(0x136)][_0x1f254b(0x160)])),_0x2aab9c[_0x1f254b(0x1b8)]&&console[_0x1f254b(0x25e)](_0x1f254b(0xec)+a31_0x2d8ea2['cyan'](_0x1f254b(0x2a1))+'\x20'+JSON[_0x1f254b(0x2d1)](_0x2aab9c[_0x1f254b(0x1b8)])),_0x2aab9c[_0x1f254b(0x105)]&&console[_0x1f254b(0x25e)]('\x20\x20\x20\x20\x20\x20'+a31_0x2d8ea2[_0x1f254b(0x153)]('includeSensitive:')+_0x1f254b(0x243));}}return 0x0;}}export class PSPzDeleteCommand extends BaseCommand{[a31_0x1cf65c(0x1fb)]='ps:pz:delete';[a31_0x1cf65c(0x1d6)]='Delete\x20a\x20realtime\x20personalization';async[a31_0x1cf65c(0x242)](_0x2e9753){const _0x5a5681=a31_0x1cf65c,{options:_0xf9df27,args:_0x3907b0,tdx:_0x85bb98}=_0x2e9753,_0x313bc1=_0x3907b0[0x0];if(!_0x313bc1)return console[_0x5a5681(0xff)](_0x5a5681(0x156)),console[_0x5a5681(0xff)](_0x5a5681(0xe6)),0x1;return await withSpinner('Deleting\x20personalization\x20\x27'+_0x313bc1+_0x5a5681(0x289),()=>_0x85bb98['personalization'][_0x5a5681(0x2dc)](_0x313bc1),{'verbose':_0xf9df27[_0x5a5681(0x148)]}),console[_0x5a5681(0xff)](_0x5a5681(0x28c)+_0x313bc1+'\x27'),0x0;}}export class PSPzCreateCommand extends BaseCommand{[a31_0x1cf65c(0x1fb)]=a31_0x1cf65c(0x122);['description']='Create\x20a\x20realtime\x20personalization\x20entity';async[a31_0x1cf65c(0x242)](_0x964176){const _0x153eda=a31_0x1cf65c,{options:_0x590938,tdx:_0x161a6a}=_0x964176,_0x2f684c=_0x590938;let _0x560036;if(_0x2f684c[_0x153eda(0x1aa)]){_0x560036=await loadJSON(_0x2f684c[_0x153eda(0x1aa)],!![]);if(!_0x560036[_0x153eda(0xe7)]?.[_0x153eda(0x130)])return console['error']('Error:\x20\x22relationships.parentFolder\x22\x20is\x20required\x20in\x20the\x20JSON\x20file.'),console[_0x153eda(0xff)](_0x153eda(0x14b)),console[_0x153eda(0xff)](_0x153eda(0x2b6)),0x1;}else{if(!_0x2f684c[_0x153eda(0x1fb)])return console[_0x153eda(0xff)]('Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)'),console[_0x153eda(0xff)]('Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]'),console[_0x153eda(0xff)](_0x153eda(0x210)),0x1;if(_0x2f684c[_0x153eda(0x1d6)]===undefined)return console[_0x153eda(0xff)](_0x153eda(0x25c)),console['error']('Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]'),console['error'](_0x153eda(0x210)),0x1;if(_0x2f684c[_0x153eda(0x2d5)]===undefined)return console[_0x153eda(0xff)](_0x153eda(0x1a4)),console[_0x153eda(0xff)](_0x153eda(0x261)),0x1;let _0x44eae7=_0x2f684c[_0x153eda(0x13e)];if(!_0x44eae7&&_0x590938[_0x153eda(0x128)]){const _0x582fbb=await withSpinner(_0x153eda(0x126)+_0x590938[_0x153eda(0x128)]+_0x153eda(0x289),()=>_0x161a6a[_0x153eda(0x106)][_0x153eda(0x2d8)](_0x590938[_0x153eda(0x128)]),{'verbose':_0x590938[_0x153eda(0x148)]});_0x44eae7=_0x582fbb[_0x153eda(0x20f)];}let _0x19d754;_0x2f684c[_0x153eda(0x139)]&&(_0x19d754=await loadJSON(_0x2f684c[_0x153eda(0x139)],![]));const _0x593f96=_0x2f684c[_0x153eda(0x2d5)]===_0x153eda(0xe2)?null:{'id':_0x2f684c[_0x153eda(0x2d5)],'type':_0x153eda(0xe9)};_0x560036={'attributes':{'name':_0x2f684c['name'],'description':_0x2f684c['description']||null,..._0x44eae7!==undefined&&{'audienceId':_0x44eae7},..._0x19d754!==undefined&&{'sections':_0x19d754}},'relationships':{'parentFolder':{'data':_0x593f96}}};}const _0x2d5d83=await withSpinner(_0x153eda(0x1fc)+(_0x560036['attributes']?.[_0x153eda(0x1fb)]??'')+_0x153eda(0x289),()=>_0x161a6a[_0x153eda(0x271)]['createPersonalization'](_0x560036),{'verbose':_0x590938[_0x153eda(0x148)]}),_0x580b83=_0x2d5d83[_0x153eda(0x20f)];return console[_0x153eda(0xff)]('✔\x20Created\x20personalization\x20\x27'+_0x580b83[_0x153eda(0x1fb)]+_0x153eda(0x273)+_0x580b83['id']),await handleSDKOutput([_0x580b83],_0x590938),0x0;}}export class PSPzPatchCommand extends BaseCommand{['name']=a31_0x1cf65c(0x220);[a31_0x1cf65c(0x1d6)]='Update\x20a\x20realtime\x20personalization\x20entity';async[a31_0x1cf65c(0x242)](_0x3f2017){const _0x6003b4=a31_0x1cf65c,{options:_0xbd881a,args:_0x53397b}=_0x3f2017,_0x4ca157=_0xbd881a,_0xe6ef3e=_0x53397b[0x0];if(!_0xe6ef3e)return console['error'](_0x6003b4(0x156)),console[_0x6003b4(0xff)]('Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]'),console[_0x6003b4(0xff)](_0x6003b4(0x100)),0x1;let _0x43888b;if(_0x4ca157[_0x6003b4(0x1aa)])_0x43888b=await loadJSON(_0x4ca157['file'],!![]);else{if(!_0x4ca157['name'])return console[_0x6003b4(0xff)](_0x6003b4(0x24c)),console[_0x6003b4(0xff)]('Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]'),0x1;if(_0x4ca157['description']===undefined)return console[_0x6003b4(0xff)](_0x6003b4(0x25c)),console['error']('Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]'),0x1;let _0x381a19;_0x4ca157[_0x6003b4(0x139)]&&(_0x381a19=await loadJSON(_0x4ca157[_0x6003b4(0x139)],![])),_0x43888b={'attributes':{'name':_0x4ca157['name'],'description':_0x4ca157[_0x6003b4(0x1d6)]||null,..._0x381a19!==undefined&&{'sections':_0x381a19}}};}const {tdx:_0x5bf54e}=_0x3f2017,_0x485601=await withSpinner(_0x6003b4(0x2ce)+_0xe6ef3e+_0x6003b4(0x289),()=>_0x5bf54e[_0x6003b4(0x271)][_0x6003b4(0x1c5)](_0xe6ef3e,_0x43888b),{'verbose':_0xbd881a['verbose']}),_0x453f11=_0x485601[_0x6003b4(0x20f)];return console[_0x6003b4(0xff)](_0x6003b4(0x21b)+_0x453f11[_0x6003b4(0x1fb)]+_0x6003b4(0x23d)+_0x453f11['id']+')'),await handleSDKOutput([_0x453f11],_0xbd881a),0x0;}}export class PSPzInitCommand extends BaseParentSegmentCommand{['name']=a31_0x1cf65c(0xe4);['description']=a31_0x1cf65c(0x235);async['execute'](_0x47f25b){const _0x2082a1=a31_0x1cf65c,{options:_0x4eae0b,args:_0x4aa955}=_0x47f25b,_0x3a17f1=_0x4aa955[0x0]||_0x4eae0b[_0x2082a1(0x128)];if(!_0x3a17f1)return showParentSegmentNotSetError(_0x2082a1(0xdc)+_0x2082a1(0x1f7)),0x1;const _0x592c7e=resolveYamlFile(_0x3a17f1);if(!existsSync(_0x592c7e))return showFileNotFoundError(_0x592c7e,_0x3a17f1),0x1;let _0x63dc6d;try{_0x63dc6d=readFileSync(_0x592c7e,'utf-8');}catch(_0x118e75){const _0x3b68f4=_0x118e75 instanceof Error?_0x118e75[_0x2082a1(0x24f)]:String(_0x118e75);return console[_0x2082a1(0xff)]('Error\x20reading\x20file:\x20'+_0x3b68f4),0x1;}let _0x452466;try{_0x452466=parseDef(_0x63dc6d);}catch(_0x112be3){const _0x8440e8=_0x112be3 instanceof Error?_0x112be3['message']:String(_0x112be3);return console[_0x2082a1(0xff)](a31_0x2d8ea2['red']('Error\x20parsing\x20YAML:\x20'+_0x8440e8)),0x1;}if(_0x452466['personalization_services']&&_0x452466[_0x2082a1(0x219)][_0x2082a1(0x1a8)]>0x0)return console[_0x2082a1(0xff)](a31_0x2d8ea2[_0x2082a1(0x168)](_0x2082a1(0x238)+_0x592c7e)),console[_0x2082a1(0xff)](a31_0x2d8ea2[_0x2082a1(0x1b3)](_0x2082a1(0x272)+_0x452466[_0x2082a1(0x219)]['length']+_0x2082a1(0x26f))),0x1;!_0x452466[_0x2082a1(0x297)]&&(_0x452466['realtime']={'events':[{'name':_0x2082a1(0x2c6),'source_table':'<database>.<table>'}],'attributes':[{'name':_0x2082a1(0xdf),'type':'single'}],'id_stitching':{'primary_key':_0x452466['master']['table']===_0x2082a1(0x2b2)?'td_client_id':_0x2082a1(0x277)}});_0x452466[_0x2082a1(0x219)]=[{'name':_0x2082a1(0x1fa),'description':'Personalization\x20service\x20description','trigger_event':_0x2082a1(0x2c6),'sections':[{'name':_0x2082a1(0x131),'criteria':'true','attributes':[_0x2082a1(0xdf)]}]}];const _0x3e7b8a=serializeDef(_0x452466);return writeFileSync(_0x592c7e,_0x3e7b8a,_0x2082a1(0xd7)),console[_0x2082a1(0xff)](a31_0x2d8ea2['green']('✔')+'\x20Added\x20personalization\x20template\x20to\x20'+a31_0x2d8ea2[_0x2082a1(0x153)](_0x592c7e)),(!_0x452466[_0x2082a1(0x297)]||_0x63dc6d['indexOf'](_0x2082a1(0x19f))===-0x1)&&console[_0x2082a1(0xff)](a31_0x2d8ea2['green']('✔')+'\x20Added\x20RT\x202.0\x20template\x20section'),console['error']('\x0a'+a31_0x2d8ea2[_0x2082a1(0x1b3)](_0x2082a1(0x202))),console[_0x2082a1(0xff)]('\x20\x201.\x20Edit\x20'+_0x592c7e+_0x2082a1(0x102)),console['error'](_0x2082a1(0x257)+a31_0x2d8ea2[_0x2082a1(0x1b3)](_0x2082a1(0x12b)+_0x3a17f1)+'\x20to\x20push\x20the\x20configuration'),0x0;}}
1
+ const a31_0x278ad1=a31_0x4d90;(function(_0xc935c8,_0x5b324d){const _0x1b37bc=a31_0x4d90,_0x40e6bf=_0xc935c8();while(!![]){try{const _0x29cdc2=-parseInt(_0x1b37bc(0x2d6))/0x1*(parseInt(_0x1b37bc(0x262))/0x2)+parseInt(_0x1b37bc(0x131))/0x3*(parseInt(_0x1b37bc(0x27e))/0x4)+-parseInt(_0x1b37bc(0x2f5))/0x5+parseInt(_0x1b37bc(0x220))/0x6*(parseInt(_0x1b37bc(0x25c))/0x7)+-parseInt(_0x1b37bc(0x24d))/0x8*(parseInt(_0x1b37bc(0x233))/0x9)+-parseInt(_0x1b37bc(0x1a3))/0xa+parseInt(_0x1b37bc(0x1fa))/0xb;if(_0x29cdc2===_0x5b324d)break;else _0x40e6bf['push'](_0x40e6bf['shift']());}catch(_0x33a7ef){_0x40e6bf['push'](_0x40e6bf['shift']());}}}(a31_0x447c,0x46578));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a31_0xbc3217 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,createCommandSpinner,formatElapsed}from'../utils/spinner.js';import{loadJSONFromOptions,loadJSON}from'../utils/json-loader.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{getConsoleUrl,getConsoleNextUrl}from'../sdk/client/endpoints.js';import{formatRows,formatAsTable,hyperlink}from'../sdk/util/formatters.js';import{parseDef,serializeDef}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import a31_0x2f8622 from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../sdk/segment/fields-display.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';const PARENT_SEGMENT_DIR=a31_0x278ad1(0x1a7),LEGACY_PARENT_SEGMENT_DIR=a31_0x278ad1(0x104);function openBrowser(_0x3fd497){const _0x5ce55b=a31_0x278ad1,_0x1480f9=process[_0x5ce55b(0x19c)],_0x3ad63b=_0x1480f9===_0x5ce55b(0x1d1)?_0x5ce55b(0x20d):_0x1480f9===_0x5ce55b(0x106)?'start':_0x5ce55b(0x2b1);spawn(_0x3ad63b,[_0x3fd497],{'detached':!![],'stdio':'ignore'})[_0x5ce55b(0x1f2)]();}function migrateLegacyDirectory(){const _0x40a26f=a31_0x278ad1;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x2321ff=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x2321ff[_0x40a26f(0x1cb)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console['error'](a31_0x2f8622['yellow'](_0x40a26f(0x20b)+LEGACY_PARENT_SEGMENT_DIR+_0x40a26f(0x270)+PARENT_SEGMENT_DIR+_0x40a26f(0x195))),console[_0x40a26f(0x14b)](a31_0x2f8622[_0x40a26f(0x2e9)](_0x40a26f(0x17a)+LEGACY_PARENT_SEGMENT_DIR+_0x40a26f(0x176))),![];console['error'](a31_0x2f8622[_0x40a26f(0x1c7)](_0x40a26f(0x100)+LEGACY_PARENT_SEGMENT_DIR+_0x40a26f(0x2e7)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console['error'](a31_0x2f8622[_0x40a26f(0x1ed)](_0x40a26f(0x305)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x438a8b){const _0x10b276=_0x438a8b instanceof Error?_0x438a8b[_0x40a26f(0x23f)]:String(_0x438a8b);return console[_0x40a26f(0x14b)](a31_0x2f8622['red'](_0x40a26f(0x160)+_0x10b276+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a31_0x278ad1(0x1ce)](_0x50ce4a){const _0x4ddca7=a31_0x278ad1;return migrateLegacyDirectory(),super[_0x4ddca7(0x1ce)](_0x50ce4a);}}function resolveYamlFile(_0x452af3){const _0xe9de60=a31_0x278ad1;if(_0x452af3[_0xe9de60(0x14d)](_0xe9de60(0x2f6))||_0x452af3[_0xe9de60(0x14d)](_0xe9de60(0x1d0)))return _0x452af3;return a31_0xbc3217[_0xe9de60(0x2df)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x452af3)+_0xe9de60(0x2f6));}function formatProgressMessage(_0x5c77df){const _0x27680c=a31_0x278ad1,_0xd3b64c=_0x5c77df[_0x27680c(0x1eb)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0xd3b64c){const [,_0x2b37b4,_0x452ebf,_0x4d0fc5='']=_0xd3b64c;return a31_0x2f8622[_0x27680c(0x2e9)](_0x2b37b4+':')+'\x20'+_0x452ebf+a31_0x2f8622[_0x27680c(0x2e9)](_0x4d0fc5);}return a31_0x2f8622[_0x27680c(0x2e9)](_0x5c77df);}function showFileNotFoundError(_0x1794f8,_0x5c836c){const _0x5299dd=a31_0x278ad1;console[_0x5299dd(0x14b)](a31_0x2f8622[_0x5299dd(0x179)](_0x5299dd(0x235)+_0x1794f8+'\x0a')),console[_0x5299dd(0x14b)](a31_0x2f8622[_0x5299dd(0x248)](_0x5299dd(0x303)+_0x5c836c+_0x5299dd(0x15b)));}function displayRealtimeValidation(_0x1a87e9){const _0x4c393a=a31_0x278ad1;if(!_0x1a87e9[_0x4c393a(0x1d7)])return;const _0x2bc513=_0x1a87e9[_0x4c393a(0x1d7)],_0x1d5e38=_0x2bc513[_0x4c393a(0x237)]?a31_0x2f8622[_0x4c393a(0x1ed)]('⚡\x20Enabled'):a31_0x2f8622[_0x4c393a(0x1c7)](_0x4c393a(0x193));console[_0x4c393a(0x14b)]('\x0a'+a31_0x2f8622[_0x4c393a(0x2e9)](_0x4c393a(0x15e))+'\x20'+_0x1d5e38);if(_0x2bc513[_0x4c393a(0x1e3)]&&_0x2bc513[_0x4c393a(0x1e3)]['length']>0x0){console[_0x4c393a(0x14b)]('\x20\x20'+a31_0x2f8622['dim'](_0x4c393a(0x279))+'\x20'+_0x2bc513[_0x4c393a(0x1e3)][_0x4c393a(0x19d)]+_0x4c393a(0x2b9));for(const _0x3b9ad4 of _0x2bc513[_0x4c393a(0x1e3)]){const _0x1948a9=_0x3b9ad4[_0x4c393a(0x2b3)]===![]?a31_0x2f8622[_0x4c393a(0x179)]('✘'):a31_0x2f8622[_0x4c393a(0x1ed)]('✔');console[_0x4c393a(0x14b)]('\x20\x20\x20\x20'+_0x1948a9+'\x20'+_0x3b9ad4[_0x4c393a(0x18b)]),_0x3b9ad4[_0x4c393a(0x13c)]&&console[_0x4c393a(0x14b)]('\x20\x20\x20\x20\x20\x20'+a31_0x2f8622[_0x4c393a(0x179)](_0x3b9ad4[_0x4c393a(0x13c)]));}}if(_0x2bc513[_0x4c393a(0x16e)]&&_0x2bc513[_0x4c393a(0x16e)][_0x4c393a(0x19d)]>0x0){console[_0x4c393a(0x14b)]('\x20\x20'+a31_0x2f8622[_0x4c393a(0x2e9)](_0x4c393a(0x2f1))+'\x20'+_0x2bc513[_0x4c393a(0x16e)][_0x4c393a(0x19d)]+_0x4c393a(0x2b9));for(const _0x51bf0e of _0x2bc513[_0x4c393a(0x16e)]){const _0x46a7eb=_0x51bf0e['valid']?a31_0x2f8622[_0x4c393a(0x1ed)]('✔'):a31_0x2f8622[_0x4c393a(0x179)]('✘');console[_0x4c393a(0x14b)]('\x20\x20\x20\x20'+_0x46a7eb+'\x20'+_0x51bf0e['name']+'\x20'+a31_0x2f8622[_0x4c393a(0x2e9)]('('+_0x51bf0e[_0x4c393a(0x2a1)]+')'));}}if(_0x2bc513['idStitching']){const _0x30006e=_0x2bc513[_0x4c393a(0x1a0)][_0x4c393a(0x2ba)]?.[_0x4c393a(0x19d)]?_0x4c393a(0x21a)+_0x2bc513['idStitching'][_0x4c393a(0x2ba)]['join'](',\x20')+']':'';console[_0x4c393a(0x14b)]('\x20\x20'+a31_0x2f8622['dim'](_0x4c393a(0x145))+'\x20'+_0x2bc513[_0x4c393a(0x1a0)][_0x4c393a(0x2ef)]+_0x30006e);}if(_0x2bc513[_0x4c393a(0x16b)]&&_0x2bc513[_0x4c393a(0x16b)][_0x4c393a(0x19d)]>0x0){console[_0x4c393a(0x14b)]('\x20\x20'+a31_0x2f8622[_0x4c393a(0x2e9)](_0x4c393a(0x24b))+'\x20'+_0x2bc513[_0x4c393a(0x16b)][_0x4c393a(0x19d)]+_0x4c393a(0x2dc)+(_0x2bc513['personalizationServices']['length']!==0x1?'s':''));for(const _0x41e2d2 of _0x2bc513['personalizationServices']){console['error']('\x20\x20\x20\x20-\x20'+_0x41e2d2[_0x4c393a(0x18b)]);}}}function showParentSegmentNotSetError(_0x335876){const _0x12a402=a31_0x278ad1;console['error'](a31_0x2f8622[_0x12a402(0x1c7)](_0x12a402(0x136))),console[_0x12a402(0x14b)](_0x335876);}export class ParentSegmentListCommand extends BaseCommand{[a31_0x278ad1(0x18b)]=a31_0x278ad1(0x120);[a31_0x278ad1(0x225)]='List\x20parent\x20segments';async[a31_0x278ad1(0x1e4)](_0x3a38cc){const _0x1ca40e=a31_0x278ad1,{options:_0x5ee082,args:_0x74252a,tdx:_0x1e57cd}=_0x3a38cc,_0x5d7eeb=_0x74252a[0x0];_0x5ee082[_0x1ca40e(0x189)]&&(console[_0x1ca40e(0x14b)]('Site:\x20'+_0x5ee082[_0x1ca40e(0x28b)]),_0x5d7eeb&&console[_0x1ca40e(0x14b)]('Pattern:\x20'+_0x5d7eeb));const _0x5d921a=await withSpinner(_0x5d7eeb?_0x1ca40e(0x277)+_0x5d7eeb+_0x1ca40e(0x2fa):'Listing\x20parent\x20segments...',()=>_0x1e57cd[_0x1ca40e(0x114)][_0x1ca40e(0x1db)](),{'verbose':_0x5ee082[_0x1ca40e(0x189)]});let _0x5c9af2=_0x5d921a['data'];if(_0x5d7eeb){const _0x308a08=_0x5d7eeb[_0x1ca40e(0x1f6)](/[.+^${}()|[\]\\]/g,_0x1ca40e(0x24c))['replace'](/\*/g,'.*')[_0x1ca40e(0x1f6)](/\?/g,'.'),_0x4809cf=new RegExp('^'+_0x308a08+'$','i');_0x5c9af2=_0x5c9af2[_0x1ca40e(0x1b0)](_0x16adaa=>_0x4809cf[_0x1ca40e(0x2e6)](_0x16adaa[_0x1ca40e(0x16e)]['name']));}_0x5c9af2['sort']((_0x25d86f,_0x3f4c40)=>_0x25d86f[_0x1ca40e(0x16e)][_0x1ca40e(0x18b)][_0x1ca40e(0x1b7)](_0x3f4c40[_0x1ca40e(0x16e)]['name'])),console[_0x1ca40e(0x14b)](_0x1ca40e(0x16a)+_0x5c9af2[_0x1ca40e(0x19d)]+_0x1ca40e(0x239)+(_0x5c9af2[_0x1ca40e(0x19d)]!==0x1?'s':''));const _0x104ce2=_0x1d08ae=>{const _0x18cdae=_0x1ca40e;return getConsoleNextUrl(_0x5ee082[_0x18cdae(0x28b)],_0x18cdae(0x1fb)+_0x1d08ae);};if(_0x5ee082[_0x1ca40e(0x1fd)]===_0x1ca40e(0x129)||_0x5ee082[_0x1ca40e(0x1fd)]===_0x1ca40e(0x215)){const _0x375dd9=_0x5c9af2['map'](_0x2d7584=>({..._0x2d7584,'url':_0x104ce2(_0x2d7584['id'])}));await handleSDKOutput(_0x375dd9,_0x5ee082);}else{if(_0x5c9af2['length']===0x0)_0x5d7eeb?console[_0x1ca40e(0x19a)](_0x1ca40e(0x1f3)+_0x5d7eeb):console[_0x1ca40e(0x19a)](_0x1ca40e(0x185));else for(const _0x43352c of _0x5c9af2){const _0x23f771=_0x43352c[_0x1ca40e(0x16e)]['population']?a31_0x2f8622[_0x1ca40e(0x2e9)]('\x20('+formatRows(_0x43352c['attributes'][_0x1ca40e(0x125)])+')'):'',_0x40f86a=hyperlink(_0x43352c['attributes'][_0x1ca40e(0x18b)],_0x104ce2(_0x43352c['id']));console[_0x1ca40e(0x19a)]('👥\x20'+_0x40f86a+_0x23f771);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{['name']=a31_0x278ad1(0x297);[a31_0x278ad1(0x225)]=a31_0x278ad1(0x213);async['execute'](_0x1f4ddd){const _0x210ea3=a31_0x278ad1,{options:_0x355b7f,args:_0x16946a,tdx:_0x2074ce}=_0x1f4ddd;console[_0x210ea3(0x14b)](_0x210ea3(0x1b2)+_0x210ea3(0x245)+_0x210ea3(0x1cd));const _0x539afb=_0x355b7f;if(_0x16946a[_0x210ea3(0x19d)]===0x0)return console[_0x210ea3(0x14b)](a31_0x2f8622['red']('Error:\x20Parent\x20segment\x20name\x20is\x20required')),console[_0x210ea3(0x14b)](_0x210ea3(0x300)),0x1;const _0x19d11a=_0x16946a[0x0];if(!_0x539afb['database']||!_0x539afb[_0x210ea3(0x107)])return console[_0x210ea3(0x14b)]('Error:\x20--database\x20and\x20--table\x20are\x20required'),console[_0x210ea3(0x14b)](_0x210ea3(0x300)),0x1;_0x539afb[_0x210ea3(0x189)]&&(console[_0x210ea3(0x14b)]('Site:\x20'+_0x539afb[_0x210ea3(0x28b)]),console[_0x210ea3(0x14b)](_0x210ea3(0x180)+_0x19d11a),console[_0x210ea3(0x14b)](_0x210ea3(0x199)+_0x539afb[_0x210ea3(0x232)]),console[_0x210ea3(0x14b)](_0x210ea3(0x172)+_0x539afb[_0x210ea3(0x107)]));const _0x1f2b9a=await loadJSONFromOptions(_0x539afb['attributes'],_0x539afb['attributesFile']),_0x173ff8=await loadJSONFromOptions(_0x539afb[_0x210ea3(0x1c4)],_0x539afb[_0x210ea3(0x20f)]),_0x5727ed=await loadJSONFromOptions(_0x539afb['customerGroup'],_0x539afb[_0x210ea3(0x1e8)]),_0x4a1c61={'name':_0x19d11a,'description':_0x539afb[_0x210ea3(0x225)],'scheduleType':_0x539afb['scheduleType'],'scheduleOption':_0x539afb[_0x210ea3(0x284)],'timezone':_0x539afb[_0x210ea3(0x1a1)],'master':{'parentDatabaseName':_0x539afb[_0x210ea3(0x232)],'parentTableName':_0x539afb[_0x210ea3(0x107)]},'attributes':_0x1f2b9a,'behaviors':_0x173ff8,'customerGroup':_0x5727ed},_0x5f471c=await withSpinner(_0x210ea3(0x1c5)+_0x19d11a+_0x210ea3(0x2fa),()=>_0x2074ce[_0x210ea3(0x114)][_0x210ea3(0x22f)](_0x4a1c61),{'verbose':_0x355b7f[_0x210ea3(0x189)]}),_0x4ee5c8=_0x5f471c[_0x210ea3(0x1d4)];return console['error'](_0x210ea3(0x196)+_0x4ee5c8['name']+_0x210ea3(0x22b)+_0x4ee5c8['id']),await handleSDKOutput([_0x4ee5c8],_0x355b7f),0x0;}}function a31_0x447c(){const _0x27e27b=['audienceId:\x20','Listing\x20RT-enabled\x20parent\x20segments\x20matching\x20\x27','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\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','Show\x20parent\x20segment\x20details','Fetching\x20parent\x20segment\x20\x27','repeat','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]','\x0a⚠️\x20\x20Both\x20','\x20(paused)','open','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','behaviorsFile','toLowerCase','joinKey','segment:parent:preview','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','master','jsonl','addBehaviors','keyEventId','{\x0a\x20\x20\x22database\x22:\x20\x22','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','\x20+\x20[','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','Fetching\x20current\x20configuration\x20for\x20\x27','eventKind','RT\x202.0\x20Validate:','text','3416628nIVKYi','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','resolveParentId','Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID,\x20then\x20add:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','description','\x27\x20not\x20found\x20in\x20any\x20personalization\x20service','\x20to\x20configure\x20your\x20personalization\x20service','Usage:\x20tdx\x20ps\x20rt\x20jn\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20RT\x20journeys\x20(requires\x20context)\x0a','no\x20tokens\x20configured','Update\x20a\x20personalization\x20service\x20name\x20and/or\x20description','\x27\x20with\x20ID:\x20','displayColumns','public','Error:\x20Personalization\x20ID\x20is\x20required','createParent','workflowSessionId','limit','database','90MdmiYG','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','Error:\x20File\x20not\x20found:\x20','pushParentYaml','enabled','output','\x20parent\x20segment','Listing\x20RT-enabled\x20parent\x20segments...','last_page_viewed','\x20--attribute\x20\x22','\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22','segment:parent:desc','message','\x20--behavior\x20\x22','token:','addAttributes','\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)','Error:\x20Parent\x20segment\x20name\x20is\x20required','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','ps:pz:show','cyan','To\x20view\x20sample\x20data:','split','Personalization:','\x5c$&','130376QRcFWB','Pausing\x20activations\x20for\x20RT\x20journey\x20\x27','utf-8','audienceId:','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','✔\x20Created\x20personalization\x20service\x20\x27','\x20service(s)\x20configured','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','Show\x20a\x20specific\x20realtime\x20personalization','attribute','map','RT\x20Journey\x20ID:\x20','realtime_enabled','workflowAttemptId','\x0aTip:\x20Run\x20`tdx\x20ps\x20pz\x20service\x20init`\x20to\x20add\x20a\x20template\x20personalization\x20section\x20to\x20your\x20YAML','7SOyYGC','Creating\x20personalization\x20service\x20\x27','getCurrentConfigVersion','segment:parent:push','ps:pz:create','enriched','33322dnyVrO','toLocaleString','\x27\x20(id:\x20','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','folderId','customerPercent','public:','validateParentYaml','\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','Usage:\x20tdx\x20ps\x20rt\x20jn\x20pause_activations\x20<journeyId>\x0a','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','yes','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','/\x20and\x20','\x20parent\x20segment\x20\x27','null','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','varchar','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]','\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','Listing\x20parent\x20segments\x20matching\x20\x27','query','Events:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','\x0aUsage:\x20tdx\x20ps\x20preview\x20','\x20Configuration\x20is\x20valid','No\x20personalization\x20services\x20configured','306388VmQJBi','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]','ps:rt:configuration_versions','ps:rt:list','workflowId','allValid','scheduleOption','Found\x20YAML\x20file:\x20','Analyzing\x20changes...','Updated','Validating\x20RT\x20configuration...','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','relationships','site','\x20field','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','single','keyEventCriteria','Validate:','list','\x20to\x20push\x20the\x20configuration','segment:parent:fields','getParentFull','Personalization\x20service\x20description','✔\x20Retrieved\x20RT\x20configuration\x20version','segment:parent:create','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','\x20personalization','\x20[Job\x20ID:\x20','coveragePercent','updateParent','Columns:','\x20\x20No\x20sample\x20data\x20available','displayRealtimeInfo','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','type','addAttributesFile','\x20No\x20changes\x20-\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20PZ\x20services\x20for\x20specific\x20parent\x20segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context','includeSensitive:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>','-1d','\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22','Overwrite\x20\x27','\x20RT-enabled\x20parent\x20segment','matchedCount','scheduleType','Getting\x20RT\x20configuration\x20version\x20for\x20\x27','ps:rt:jn:pause','xdg-open','\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22','sourceTableValid','ps:pz:service:delete','\x20is\x20already\x20up\x20to\x20date','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--file\x20<path>','getParentSQL','double','\x20configured','stitchingKeys','status','SQL\x20query:\x0a','List\x20RT\x20journeys','\x22,\x20\x22type\x22:\x20\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context','Error\x20parsing\x20YAML:\x20','entryCriteria:','\x22\x20}','\x0a\x20\x20\x20\x20]','Audience\x20ID:','%)\x20','entryCriteria','\x20tdx\x20wf\x20attempt\x20','column','Fetching\x20customers\x20schema...','\x20rows)','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','string','all','delete','user_id','List\x20parent\x20segments\x20with\x20RT\x202.0\x20status','\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22','Master\x20Table','setJobId','✔\x20Updated\x20personalization\x20service\x20\x27','Resume\x20activations\x20in\x20an\x20RT\x20journey','12rAEICt','some','segment:parent:pull','Creating\x20personalization\x20\x27','Error:\x20--name\x20is\x20required','(id:\x20','\x20service','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','join','td_client_id','Fetching\x20sample\x20data...','tdx\x20ps\x20preview\x20','ps:rt:jn:resume','foreignKey','Available\x20attributes:','test','/\x20→\x20','identifier','dim','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context','Updating\x20personalization\x20service\x20\x27','Create\x20parent\x20segment\x20\x27','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]\x0a','primaryKey','audienceId','Attributes:','\x20RT\x20configuration\x20is\x20valid','✔\x20Created\x20personalization\x20\x27','\x20\x202.\x20Run\x20','2208025CeYHeI','.yml','page_view','displayBehaviorsStats','updatedAt','\x27...','customerGroup','ps:pz:service:token:delete','\x20personalization\x20service','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','To\x20cancel:','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','/app/workflows/','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','Source:','✔\x20Renamed\x20directory\x20to\x20','Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','displayPreviewHints','Listing\x20fields\x20for\x20\x27','allowed\x20IPs:','payload','eventKind:\x20','getBehaviorNames','Resuming\x20activations\x20for\x20RT\x20journey\x20\x27','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','Error\x20reading\x20file:\x20','Master\x20+\x20Attributes','Usage:\x20tdx\x20ps\x20rt\x20jn\x20resume_activations\x20<journeyId>\x0a','any','label','\x27\x20is\x20up\x20to\x20date','\x20stage','Listing\x20personalization\x20services\x20for\x20\x27','Attempt:','\x0a⚠️\x20\x20Migrating:\x20','\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)','\x20\x20\x20\x20\x20\x20\x20\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','parent_segment','\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','win32','table','Fetching\x20SQL\x20for\x20\x27','segment:parent:sql','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','segment:parent:update','Fetching\x20personalization\x20service\x20\x27','ps:pz:service:token:create','\x0aError:','Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]','Creating','resumeJourney','Resolving\x20parent\x20segment\x20\x27','/sessions/','segment','Show\x20personalization\x20service\x20details','Customers:','\x20Added\x20RT\x202.0\x20template\x20section','patchPersonalization','schemaValid','Error:','\x0aNew\x20parent\x20segment\x20\x27','✔\x20No\x20changes\x20-\x20\x27','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','apply','Master:','segment:parent:list','\x20\x20Tables:\x201\x20customers\x20+\x20','realtime:','Updating\x20parent\x20segment\x20\x27','runParent','population','\x27\x20is\x20already\x20up\x20to\x20date','customersWithEvents','✔\x20Updated\x20parent\x20segment\x20\x27','json','stop','getOutputDatabaseName','errors','Error:\x20Service\x20ID\x20is\x20required','Listing\x20personalizations\x20for\x20\x27','\x0aChanges\x20to\x20apply\x20to\x20\x27','Update\x20a\x20realtime\x20personalization\x20entity','15VynHrP','value','Error:\x20Token\x20ID\x20is\x20required','keyEventId:','Apply\x20changes\x20to\x20\x27','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','Creating\x20token\x20\x27','Join:','Executing\x20parent\x20segment\x20query...','sort','Preview:','sourceTableError','listPersonalizations','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','/{name}.yml\x0a','\x20Added\x20personalization\x20template\x20to\x20','folder-segment','No\x20RT\x20journeys\x20found','Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]','Available\x20behaviors:','ID\x20Stitching:','displayValidateResults','Attributes','\x0aChanges\x20to\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','state','error','displaySampleData','endsWith','stats','Rows:','List\x20personalization\x20services\x20for\x20a\x20parent\x20segment','ps:pz:service:create','columns','displayPreviewResults','SELECT\x20*\x20FROM\x20','Usage:\x20tdx\x20ps\x20rt\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20RT\x20config\x20(requires\x20context)\x0a','✔\x20Found\x20personalization\x20\x27','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]\x0a','SELECT\x20*\x20FROM\x20(\x0a','behavior_','created:','`\x20to\x20download\x20the\x20configuration\x20first','launched','keys','RT\x202.0:','Attribute:','✘\x20Failed\x20to\x20rename\x20directory:\x20','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','schemaError','ps:pz:delete','Aborted.','Deleting\x20personalization\x20\x27','parent_id','allowedIps','Error:\x20--folder-id\x20is\x20required.\x20Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID.','Deleting\x20personalization\x20service\x20\x27','✔\x20Found\x20','personalizationServices','start','Validating\x20configuration...','attributes','file','Parent\x20segment:\x20','column_name','Table:\x20','toFixed','parentSegment','\x0a\x20\x20]\x0a}\x0a','/\x20directory.\x0a','Session:','ps:pz:list','red','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','sections','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','interval','\x20\x20\x20','\x20--attribute\x20\x22<name>\x22','Name:\x20','create','processedRows','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]','\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20','No\x20parent\x20segments\x20found','personalization','\x20--behavior\x20\x22<name>\x22','\x20total','verbose','Deleting\x20token\x20\x27','name','sections:','Site:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20rt\x20jn\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20RT\x20journeys\x20for\x20specific\x20parent\x20segment','personalization_services','listJourneys','tdx\x20ps\x20push\x20','\x20\x20Columns:\x20','⚡\x20Not\x20enabled','Get\x20SQL\x20query\x20for\x20parent\x20segment','/\x20directories\x20exist.','✔\x20Created\x20parent\x20segment\x20\x27','\x20=\x20','\x0a⚠\x20Save\x20this\x20token\x20value\x20-\x20it\x20will\x20not\x20be\x20shown\x20again:','Database:\x20','log','deletePersonalization','platform','length','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','addBehaviorsFile','idStitching','timezone','updated:','3495710eZchgH','sampleData','\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}','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context','parent_segments','Enriched:','Next\x20steps:','Output\x20Database:','totalEvents','Listing\x20RT\x20journeys\x20for\x20\x27','bold','push','\x20Context\x20set:\x20','filter','ps:pz:service:list','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','List\x20realtime\x20personalizations\x20for\x20a\x20parent\x20segment','formatSchemaJson','\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','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','localeCompare','trim','Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs','Join\x20on:','segment:parent:view','Create\x20a\x20personalization\x20service\x20for\x20a\x20parent\x20segment','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','Delete\x20a\x20realtime\x20personalization','paused','\x20--interval\x20','Options:','tokens','jobId','behaviors','Creating\x20parent\x20segment\x20\x27','createdAt','yellow','YAML\x20file:\x20','Errors:','Created','isDirectory','Fetching\x20behavior\x20list...','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','run','\x20\x20Database:\x20','.yaml','darwin','\x20\x20\x20\x20-\x20','\x20\x20\x20\x20\x20\x20','data','Pause\x20activations\x20in\x20an\x20RT\x20journey','payload:','realtime','\x20\x20\x20\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]','listParents','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','Error:\x20Service\x20name\x20is\x20required','collectSchema','segment:parent:show','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','events','execute','Usage:\x20tdx\x20ps\x20pz\x20show\x20<personalization_id>','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]\x0a','Output\x20file:\x20','customerGroupFile','displaySummary','Create\x20a\x20realtime\x20personalization\x20entity','match','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','green','✔\x20Created\x20token\x20\x27','List\x20available\x20fields\x20for\x20segmentation','Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a','using\x20the\x20default\x20path:\x20','unref','No\x20parent\x20segments\x20match\x20pattern:\x20','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','indexOf','replace','Delete\x20a\x20personalization\x20service','Status:','Get\x20current\x20RT\x20configuration\x20version\x20status','5387525hdncMs','/app/dw/parentSegments/','\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22','format','Patching\x20personalization\x20\x27','customers','displayAttributesStats','stageCount','behavior'];a31_0x447c=function(){return _0x27e27b;};return a31_0x447c();}export class ParentSegmentUpdateCommand extends BaseCommand{[a31_0x278ad1(0x18b)]=a31_0x278ad1(0x10b);[a31_0x278ad1(0x225)]=a31_0x278ad1(0x13e);async[a31_0x278ad1(0x1e4)](_0x2d8e1d){const _0x273675=a31_0x278ad1,{options:_0x1af7b7,args:_0x1c55c5,tdx:_0x16e5be}=_0x2d8e1d;console[_0x273675(0x14b)](_0x273675(0x1dc)+_0x273675(0x245)+_0x273675(0x1cd));const _0x4a497a=_0x1af7b7;if(_0x1c55c5[_0x273675(0x19d)]===0x0)return console[_0x273675(0x14b)](a31_0x2f8622[_0x273675(0x179)](_0x273675(0x244))),console[_0x273675(0x14b)](_0x273675(0x301)),0x1;const _0x57127b=_0x1c55c5[0x0];_0x4a497a[_0x273675(0x189)]&&(console[_0x273675(0x14b)](_0x273675(0x18d)+_0x4a497a[_0x273675(0x28b)]),console[_0x273675(0x14b)](_0x273675(0x170)+_0x57127b));const _0x7fe413=await withSpinner(_0x273675(0x21c)+_0x57127b+'\x27...',()=>_0x16e5be[_0x273675(0x114)][_0x273675(0x294)](_0x57127b),{'verbose':_0x4a497a[_0x273675(0x189)]}),_0x2a4dfb=_0x7fe413['data'],_0x45e3b1=await loadJSONFromOptions(_0x4a497a[_0x273675(0x242)],_0x4a497a[_0x273675(0x2a2)]),_0x130fd8=await loadJSONFromOptions(_0x4a497a[_0x273675(0x216)],_0x4a497a[_0x273675(0x19f)]),_0x337958={'name':_0x2a4dfb[_0x273675(0x18b)],'description':_0x4a497a[_0x273675(0x225)]!==undefined?_0x4a497a[_0x273675(0x225)]:_0x2a4dfb[_0x273675(0x225)],'scheduleType':_0x4a497a[_0x273675(0x2ae)]!==undefined?_0x4a497a[_0x273675(0x2ae)]:_0x2a4dfb['scheduleType'],'scheduleOption':_0x4a497a[_0x273675(0x284)]!==undefined?_0x4a497a[_0x273675(0x284)]:_0x2a4dfb[_0x273675(0x284)],'timezone':_0x4a497a['timezone']!==undefined?_0x4a497a[_0x273675(0x1a1)]:_0x2a4dfb[_0x273675(0x1a1)],'master':_0x2a4dfb['master'],'attributes':_0x45e3b1?[..._0x2a4dfb['attributes']||[],..._0x45e3b1]:_0x2a4dfb[_0x273675(0x16e)],'behaviors':_0x130fd8?[..._0x2a4dfb[_0x273675(0x1c4)]||[],..._0x130fd8]:_0x2a4dfb['behaviors'],'customerGroup':_0x2a4dfb[_0x273675(0x2fb)]},_0x5b4673=await withSpinner(_0x273675(0x123)+_0x57127b+_0x273675(0x2fa),()=>_0x16e5be[_0x273675(0x114)][_0x273675(0x29c)](_0x57127b,_0x337958),{'verbose':_0x4a497a['verbose']}),_0x17597a=_0x5b4673['data'];return console[_0x273675(0x14b)](_0x273675(0x128)+_0x17597a[_0x273675(0x18b)]+'\x27'),await handleSDKOutput([_0x17597a],_0x4a497a),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a31_0x278ad1(0x18b)]=a31_0x278ad1(0x2d8);[a31_0x278ad1(0x225)]='Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file';async['execute'](_0x302055){const _0x517d16=a31_0x278ad1,{options:_0x410301,args:_0x28428b,tdx:_0x2b5a6e}=_0x302055,_0x54a0f0=_0x410301,_0x691577=_0x28428b[0x0]||_0x410301[_0x517d16(0x174)];if(!_0x691577)return showParentSegmentNotSetError(_0x517d16(0x26f)+_0x517d16(0x27a)),0x1;if(_0x54a0f0['use']&&_0x54a0f0[_0x517d16(0x238)])return console['error'](a31_0x2f8622[_0x517d16(0x179)](_0x517d16(0x1bd))),console[_0x517d16(0x14b)](a31_0x2f8622[_0x517d16(0x2e9)](_0x517d16(0x219))),console[_0x517d16(0x14b)](a31_0x2f8622[_0x517d16(0x2e9)](_0x517d16(0x1f1)+PARENT_SEGMENT_DIR+_0x517d16(0x13f))),console['error'](a31_0x2f8622[_0x517d16(0x248)](_0x517d16(0x2ea))),0x1;const _0x55531f=_0x54a0f0[_0x517d16(0x238)]||a31_0xbc3217[_0x517d16(0x2df)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x691577)+'.yml');_0x54a0f0[_0x517d16(0x189)]&&(console[_0x517d16(0x14b)](_0x517d16(0x18d)+_0x54a0f0[_0x517d16(0x28b)]),console[_0x517d16(0x14b)](_0x517d16(0x170)+_0x691577),console['error'](_0x517d16(0x1e7)+_0x55531f));const _0x508fe1=await withSpinner(_0x517d16(0x208)+_0x691577+'\x27...',()=>_0x2b5a6e[_0x517d16(0x114)]['pullParentYaml'](_0x691577),{'verbose':_0x54a0f0[_0x517d16(0x189)]}),_0x23a666=_0x508fe1['data'];if(existsSync(_0x55531f)){const _0x93b08e=readFileSync(_0x55531f,_0x517d16(0x24f)),_0x3d0b42=generateDiff(_0x93b08e,_0x23a666);if(!hasChanges(_0x3d0b42))console[_0x517d16(0x14b)](a31_0x2f8622[_0x517d16(0x1ed)]('✔')+_0x517d16(0x2a3)+a31_0x2f8622[_0x517d16(0x248)](_0x55531f)+_0x517d16(0x2b5));else{console[_0x517d16(0x14b)](_0x517d16(0x148)+_0x55531f+'\x27:'),console[_0x517d16(0x14b)]('─'[_0x517d16(0x209)](0x3c)),console['error'](formatDiffWithColors(_0x3d0b42)),console[_0x517d16(0x14b)]('─'[_0x517d16(0x209)](0x3c));if(!_0x54a0f0[_0x517d16(0x26e)]){if(!isInteractive())return console[_0x517d16(0x14b)](a31_0x2f8622[_0x517d16(0x179)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x517d16(0x14b)](a31_0x2f8622[_0x517d16(0x2e9)](_0x517d16(0x28d))),0x1;const _0x748231=await confirmKey(_0x517d16(0x2ab)+_0x55531f+'\x27?');if(!_0x748231)return console[_0x517d16(0x14b)](a31_0x2f8622[_0x517d16(0x1c7)](_0x517d16(0x164))),0x1;}writeFileSync(_0x55531f,_0x23a666,_0x517d16(0x24f)),console[_0x517d16(0x14b)](a31_0x2f8622[_0x517d16(0x1ed)]('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a31_0x2f8622[_0x517d16(0x248)](_0x55531f));}}else{const _0x67a687=a31_0xbc3217['dirname'](_0x55531f);!existsSync(_0x67a687)&&mkdirSync(_0x67a687,{'recursive':!![]}),writeFileSync(_0x55531f,_0x23a666,_0x517d16(0x24f)),console[_0x517d16(0x14b)](a31_0x2f8622[_0x517d16(0x1ed)]('✔')+_0x517d16(0x1dd)+a31_0x2f8622['cyan'](_0x55531f));}return saveSessionContext({'parent_segment':_0x691577},_0x54a0f0['session']),console[_0x517d16(0x14b)](a31_0x2f8622['green']('✔')+_0x517d16(0x1af)+a31_0x2f8622[_0x517d16(0x2e9)]('parent_segment')+_0x517d16(0x197)+a31_0x2f8622[_0x517d16(0x248)](_0x691577)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a31_0x278ad1(0x18b)]=a31_0x278ad1(0x25f);['description']=a31_0x278ad1(0x1e1);async[a31_0x278ad1(0x1e4)](_0x3eafec){const _0x29ebe1=a31_0x278ad1,{options:_0x539956,args:_0x30b946,tdx:_0x37fd5b}=_0x3eafec,_0x40b829=_0x539956,_0x535656=_0x30b946[0x0]||_0x539956[_0x29ebe1(0x174)];if(!_0x535656)return showParentSegmentNotSetError(_0x29ebe1(0x2de)+_0x29ebe1(0x149)),0x1;const _0x23862=resolveYamlFile(_0x535656);if(!existsSync(_0x23862))return showFileNotFoundError(_0x23862,_0x535656),0x1;_0x40b829[_0x29ebe1(0x189)]&&(console[_0x29ebe1(0x14b)](_0x29ebe1(0x18d)+_0x40b829[_0x29ebe1(0x28b)]),console[_0x29ebe1(0x14b)]('YAML\x20file:\x20'+_0x23862));let _0x9acdcb;try{_0x9acdcb=readFileSync(_0x23862,_0x29ebe1(0x24f));}catch(_0x340784){const _0x3dd895=_0x340784 instanceof Error?_0x340784[_0x29ebe1(0x23f)]:String(_0x340784);return console[_0x29ebe1(0x14b)](_0x29ebe1(0x30f)+_0x3dd895),0x1;}const _0x191eb4=await withSpinner('Analyzing\x20changes...',()=>_0x37fd5b[_0x29ebe1(0x114)][_0x29ebe1(0x236)](_0x9acdcb),{'verbose':_0x40b829['verbose']}),_0x1c0dcb=_0x191eb4['data'],{isNew:_0x4ebb93,name:_0x49770d,hasChanges:_0x3e9a28,diffFormatted:_0x22cee5}=_0x1c0dcb;if(!_0x3e9a28)return console[_0x29ebe1(0x14b)](_0x29ebe1(0x11c)+_0x49770d+_0x29ebe1(0x126)),0x0;_0x4ebb93?console['error'](_0x29ebe1(0x11b)+_0x49770d+'\x27:'):console[_0x29ebe1(0x14b)](_0x29ebe1(0x12f)+_0x49770d+'\x27:');console['error']('─'['repeat'](0x3c)),console[_0x29ebe1(0x14b)](_0x22cee5),console[_0x29ebe1(0x14b)]('─'['repeat'](0x3c));const _0x3e0e82=_0x4ebb93?_0x29ebe1(0x2ed)+_0x49770d+'\x27?':_0x29ebe1(0x135)+_0x49770d+'\x27?';if(!_0x40b829[_0x29ebe1(0x26e)]){if(!isInteractive())return console[_0x29ebe1(0x14b)](a31_0x2f8622['red'](_0x29ebe1(0x10e)),_0x29ebe1(0x251)),console[_0x29ebe1(0x14b)](a31_0x2f8622[_0x29ebe1(0x2e9)](_0x29ebe1(0x28d))),0x1;const _0x1befca=await confirmKey(_0x3e0e82);if(!_0x1befca)return console[_0x29ebe1(0x14b)](a31_0x2f8622[_0x29ebe1(0x1c7)](_0x29ebe1(0x164))),0x1;}const _0x474620=_0x4ebb93?_0x29ebe1(0x110):'Updating',_0x5cbb57=await withSpinner(_0x474620+'\x20parent\x20segment\x20\x27'+_0x49770d+_0x29ebe1(0x2fa),()=>_0x1c0dcb[_0x29ebe1(0x11e)](),{'verbose':_0x40b829[_0x29ebe1(0x189)]}),_0xc8eb00=_0x5cbb57[_0x29ebe1(0x1d4)],_0x3efb9c=getConsoleNextUrl(_0x40b829[_0x29ebe1(0x28b)],'/app/dw/parentSegments/'+_0xc8eb00['id']),_0x5cf47a=_0x4ebb93?_0x29ebe1(0x1ca):_0x29ebe1(0x287);return console[_0x29ebe1(0x14b)]('✔\x20'+_0x5cf47a+_0x29ebe1(0x271)+_0xc8eb00['name']+'\x27'),console['error']('\x20\x20'+_0x3efb9c),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{['name']='segment:parent:validate';['description']=a31_0x278ad1(0x11d);async[a31_0x278ad1(0x1e4)](_0x56b7cf){const _0x5d025b=a31_0x278ad1,{options:_0x472491,args:_0x5041c3,tdx:_0x3cb1ef}=_0x56b7cf,_0x4b05ed=_0x472491,_0x37ff87=_0x5041c3[0x0]||_0x472491['parentSegment'];if(!_0x37ff87)return showParentSegmentNotSetError(_0x5d025b(0x17c)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a'+'Options:\x0a'+_0x5d025b(0x1e2)+_0x5d025b(0x1b6)+_0x5d025b(0x234)),0x1;const _0x358dee=resolveYamlFile(_0x37ff87);if(!existsSync(_0x358dee))return showFileNotFoundError(_0x358dee,_0x37ff87),0x1;_0x4b05ed[_0x5d025b(0x189)]&&(console[_0x5d025b(0x14b)](_0x5d025b(0x18d)+_0x4b05ed[_0x5d025b(0x28b)]),console[_0x5d025b(0x14b)]('YAML\x20file:\x20'+_0x358dee));let _0x35b4a9;try{_0x35b4a9=readFileSync(_0x358dee,_0x5d025b(0x24f));}catch(_0x2c3175){const _0x1add28=_0x2c3175 instanceof Error?_0x2c3175[_0x5d025b(0x23f)]:String(_0x2c3175);return console[_0x5d025b(0x14b)](_0x5d025b(0x30f)+_0x1add28),0x1;}const _0x245efb=createCommandSpinner(a31_0x2f8622[_0x5d025b(0x2e9)](_0x5d025b(0x16d)),{'verbose':_0x4b05ed[_0x5d025b(0x189)]});_0x245efb[_0x5d025b(0x16c)]();const _0x2591a0={'onProgress':_0x46b95c=>{const _0x479615=_0x5d025b;_0x245efb[_0x479615(0x21f)]=formatProgressMessage(_0x46b95c);}};if(_0x4b05ed[_0x5d025b(0x214)])_0x2591a0[_0x5d025b(0x214)]=!![];if(_0x4b05ed['enriched'])_0x2591a0[_0x5d025b(0x261)]=!![];_0x4b05ed[_0x5d025b(0x256)]&&(_0x2591a0[_0x5d025b(0x256)]=_0x4b05ed[_0x5d025b(0x256)]);_0x4b05ed['behavior']&&(_0x2591a0[_0x5d025b(0x202)]=_0x4b05ed[_0x5d025b(0x202)]);if(_0x4b05ed[_0x5d025b(0x17d)])_0x2591a0['interval']=_0x4b05ed[_0x5d025b(0x17d)];let _0x36a75c;try{_0x36a75c=await _0x3cb1ef['segment'][_0x5d025b(0x269)](_0x35b4a9,_0x2591a0),_0x245efb[_0x5d025b(0x12a)]();}catch(_0x4398f8){_0x245efb[_0x5d025b(0x12a)]();throw _0x4398f8;}const _0x1f00f7=_0x4b05ed[_0x5d025b(0x17d)]||_0x5d025b(0x2a9);return this[_0x5d025b(0x146)](_0x36a75c,_0x2591a0,_0x358dee,_0x1f00f7),_0x36a75c[_0x5d025b(0x283)]?0x0:0x1;}[a31_0x278ad1(0x146)](_0x1b2f25,_0x58a835,_0x393f1f,_0x3984e8){const _0x300a19=a31_0x278ad1;console[_0x300a19(0x14b)]('\x0a'+a31_0x2f8622[_0x300a19(0x1ad)](_0x300a19(0x290))+'\x20'+_0x1b2f25[_0x300a19(0x18b)]),console[_0x300a19(0x14b)]('═'['repeat'](0x3c)),this['displayMasterInfo'](_0x1b2f25);if(typeof _0x58a835[_0x300a19(0x256)]===_0x300a19(0x2cc)){this[_0x300a19(0x200)](_0x1b2f25),this[_0x300a19(0x1e9)](_0x1b2f25),this[_0x300a19(0x307)](_0x393f1f,_0x3984e8,'attribute',_0x58a835[_0x300a19(0x256)]);return;}if(_0x58a835[_0x300a19(0x256)]===!![]){this[_0x300a19(0x200)](_0x1b2f25),this[_0x300a19(0x1e9)](_0x1b2f25),this[_0x300a19(0x307)](_0x393f1f,_0x3984e8,_0x300a19(0x16e));return;}if(typeof _0x58a835[_0x300a19(0x202)]==='string'){this[_0x300a19(0x2f8)](_0x1b2f25,_0x3984e8),this[_0x300a19(0x1e9)](_0x1b2f25),this[_0x300a19(0x307)](_0x393f1f,_0x3984e8,'behavior',_0x58a835[_0x300a19(0x202)]);return;}if(_0x58a835[_0x300a19(0x202)]===!![]){this[_0x300a19(0x2f8)](_0x1b2f25,_0x3984e8),this['displaySummary'](_0x1b2f25),this[_0x300a19(0x307)](_0x393f1f,_0x3984e8,_0x300a19(0x1c4));return;}this[_0x300a19(0x200)](_0x1b2f25),this[_0x300a19(0x2f8)](_0x1b2f25,_0x3984e8),this[_0x300a19(0x29f)](_0x1b2f25),this[_0x300a19(0x1e9)](_0x1b2f25),this[_0x300a19(0x307)](_0x393f1f,_0x3984e8,_0x300a19(0x2cd));}[a31_0x278ad1(0x29f)](_0x23d026){displayRealtimeValidation(_0x23d026);}[a31_0x278ad1(0x307)](_0x4f38a8,_0x44b734,_0x3b8d03,_0xff3313){const _0x585cad=a31_0x278ad1;console[_0x585cad(0x14b)]('\x0a'+a31_0x2f8622[_0x585cad(0x2e9)](_0x585cad(0x249)));const _0x21215a=_0x44b734!==_0x585cad(0x2a9)?_0x585cad(0x1c0)+_0x44b734:'';if(_0x3b8d03==='attribute'&&_0xff3313)console[_0x585cad(0x14b)]('\x20\x20'+a31_0x2f8622[_0x585cad(0x2e9)](_0x585cad(0x2e2)+_0x4f38a8+_0x585cad(0x23c)+_0xff3313+'\x22'+_0x21215a));else{if(_0x3b8d03===_0x585cad(0x202)&&_0xff3313)console[_0x585cad(0x14b)]('\x20\x20'+a31_0x2f8622[_0x585cad(0x2e9)](_0x585cad(0x2e2)+_0x4f38a8+_0x585cad(0x240)+_0xff3313+'\x22'+_0x21215a));else(_0x3b8d03===_0x585cad(0x16e)||_0x3b8d03===_0x585cad(0x2cd))&&console['error']('\x20\x20'+a31_0x2f8622[_0x585cad(0x2e9)](_0x585cad(0x2e2)+_0x4f38a8+_0x585cad(0x17f)+_0x21215a));}(_0x3b8d03===_0x585cad(0x1c4)||_0x3b8d03===_0x585cad(0x2cd))&&console[_0x585cad(0x14b)]('\x20\x20'+a31_0x2f8622['dim'](_0x585cad(0x2e2)+_0x4f38a8+_0x585cad(0x187)+_0x21215a)),_0x3b8d03===_0x585cad(0x2cd)&&console['error']('\x20\x20'+a31_0x2f8622[_0x585cad(0x2e9)](_0x585cad(0x2e2)+_0x4f38a8+'\x20--enriched'+_0x21215a));}['displayMasterInfo'](_0x23093d){const _0xcee70e=a31_0x278ad1,{master:_0x145318}=_0x23093d,_0x5f3abf=_0x145318[_0xcee70e(0x119)]?a31_0x2f8622[_0xcee70e(0x1ed)]('✔'):a31_0x2f8622[_0xcee70e(0x179)]('✘');console[_0xcee70e(0x14b)]('\x0a'+a31_0x2f8622['dim'](_0xcee70e(0x2d2))),console[_0xcee70e(0x14b)](_0x5f3abf+'\x20'+a31_0x2f8622['bold'](_0x145318[_0xcee70e(0x232)]+'.'+_0x145318[_0xcee70e(0x107)])),_0x145318[_0xcee70e(0x119)]?_0x145318['rowCount']!==undefined&&console[_0xcee70e(0x14b)]('\x20\x20'+a31_0x2f8622[_0xcee70e(0x2e9)](_0xcee70e(0x14f))+'\x20'+a31_0x2f8622[_0xcee70e(0x248)](formatRows(_0x145318['rowCount']))):console[_0xcee70e(0x14b)]('\x20\x20'+a31_0x2f8622[_0xcee70e(0x179)](_0xcee70e(0x11a))+'\x20'+_0x145318['schemaError']);}[a31_0x278ad1(0x200)](_0x4a5ac0){const _0x958fcb=a31_0x278ad1;if(_0x4a5ac0['attributes'][_0x958fcb(0x19d)]===0x0)return;console[_0x958fcb(0x14b)]('\x0a'+a31_0x2f8622[_0x958fcb(0x2e9)](_0x958fcb(0x147)));for(const _0x27047e of _0x4a5ac0[_0x958fcb(0x16e)]){const _0x4d5a7e=_0x27047e[_0x958fcb(0x119)]?a31_0x2f8622[_0x958fcb(0x1ed)]('✔'):a31_0x2f8622[_0x958fcb(0x179)]('✘');let _0x3c1a6f='';if(_0x27047e[_0x958fcb(0x119)]&&_0x27047e[_0x958fcb(0x2ad)]!==undefined&&_0x27047e[_0x958fcb(0x29b)]!==undefined){const _0x4f526e=_0x27047e['coveragePercent'][_0x958fcb(0x173)](0x1),_0x5414d6=_0x27047e['coveragePercent']>=0x50?a31_0x2f8622[_0x958fcb(0x1ed)]:_0x27047e[_0x958fcb(0x29b)]>=0x32?a31_0x2f8622[_0x958fcb(0x1c7)]:a31_0x2f8622['red'];_0x3c1a6f='\x20'+a31_0x2f8622[_0x958fcb(0x2e9)]('Coverage:')+'\x20'+_0x5414d6(_0x4f526e+'%')+'\x20('+formatRows(_0x27047e[_0x958fcb(0x2ad)])+_0x958fcb(0x2ca);}console[_0x958fcb(0x14b)](_0x4d5a7e+'\x20'+a31_0x2f8622[_0x958fcb(0x1ad)](_0x27047e[_0x958fcb(0x18b)])+_0x3c1a6f),console[_0x958fcb(0x14b)]('\x20\x20'+a31_0x2f8622['dim'](_0x958fcb(0x304))+'\x20'+a31_0x2f8622[_0x958fcb(0x1ad)](_0x27047e[_0x958fcb(0x232)]+'.'+_0x27047e[_0x958fcb(0x107)]));const _0x17bb1e=_0x27047e[_0x958fcb(0x211)]===_0x27047e[_0x958fcb(0x2e4)]?a31_0x2f8622[_0x958fcb(0x2e9)](_0x958fcb(0x1ba))+'\x20'+_0x27047e[_0x958fcb(0x211)]:a31_0x2f8622['dim'](_0x958fcb(0x138))+'\x20'+_0x27047e[_0x958fcb(0x211)]+_0x958fcb(0x197)+_0x27047e[_0x958fcb(0x2e4)];console[_0x958fcb(0x14b)]('\x20\x20'+_0x17bb1e),console[_0x958fcb(0x14b)]('\x20\x20'+a31_0x2f8622[_0x958fcb(0x2e9)](_0x958fcb(0x29d))),this[_0x958fcb(0x22c)](_0x27047e[_0x958fcb(0x152)]),!_0x27047e[_0x958fcb(0x119)]&&console[_0x958fcb(0x14b)]('\x20\x20'+a31_0x2f8622[_0x958fcb(0x179)]('Error:')+'\x20'+_0x27047e['schemaError']);}}[a31_0x278ad1(0x2f8)](_0x4e088d,_0x1d51e2){const _0x2c997f=a31_0x278ad1;if(_0x4e088d[_0x2c997f(0x1c4)][_0x2c997f(0x19d)]===0x0)return;console['error']('\x0a'+a31_0x2f8622[_0x2c997f(0x2e9)]('Behaviors')+'\x20'+a31_0x2f8622['dim']('('+_0x1d51e2+')'));for(const _0x1f587c of _0x4e088d[_0x2c997f(0x1c4)]){const _0x4312d2=_0x1f587c[_0x2c997f(0x119)]?a31_0x2f8622['green']('✔'):a31_0x2f8622['red']('✘');let _0x8d9b11='';if(_0x1f587c[_0x2c997f(0x119)]&&_0x1f587c[_0x2c997f(0x127)]!==undefined&&_0x1f587c[_0x2c997f(0x1ab)]!==undefined){const _0x12bf67=_0x1f587c[_0x2c997f(0x267)]?.[_0x2c997f(0x173)](0x1)||'?',_0x4b999f=(_0x1f587c[_0x2c997f(0x267)]??0x0)>=0x32?a31_0x2f8622[_0x2c997f(0x1ed)]:(_0x1f587c['customerPercent']??0x0)>=0x14?a31_0x2f8622['yellow']:a31_0x2f8622[_0x2c997f(0x179)];_0x8d9b11='\x20'+a31_0x2f8622[_0x2c997f(0x2e9)](_0x2c997f(0x116))+'\x20'+_0x4b999f(formatRows(_0x1f587c[_0x2c997f(0x127)]))+'\x20('+_0x12bf67+_0x2c997f(0x2c5)+a31_0x2f8622[_0x2c997f(0x2e9)](_0x2c997f(0x279))+'\x20'+a31_0x2f8622[_0x2c997f(0x248)](formatRows(_0x1f587c[_0x2c997f(0x1ab)]));}console[_0x2c997f(0x14b)](_0x4312d2+'\x20'+a31_0x2f8622['bold'](_0x1f587c[_0x2c997f(0x18b)])+_0x8d9b11),console[_0x2c997f(0x14b)]('\x20\x20'+a31_0x2f8622[_0x2c997f(0x2e9)](_0x2c997f(0x304))+'\x20'+a31_0x2f8622[_0x2c997f(0x1ad)](_0x1f587c['database']+'.'+_0x1f587c['table']));const _0x36cef3=_0x1f587c[_0x2c997f(0x211)]===_0x1f587c[_0x2c997f(0x2e4)]?a31_0x2f8622[_0x2c997f(0x2e9)](_0x2c997f(0x1ba))+'\x20'+_0x1f587c[_0x2c997f(0x211)]:a31_0x2f8622[_0x2c997f(0x2e9)]('Join:')+'\x20'+_0x1f587c[_0x2c997f(0x211)]+_0x2c997f(0x197)+_0x1f587c[_0x2c997f(0x2e4)];console['error']('\x20\x20'+_0x36cef3),console[_0x2c997f(0x14b)]('\x20\x20'+a31_0x2f8622[_0x2c997f(0x2e9)]('Columns:')),this[_0x2c997f(0x22c)](_0x1f587c[_0x2c997f(0x152)]),!_0x1f587c['schemaValid']&&console['error']('\x20\x20'+a31_0x2f8622[_0x2c997f(0x179)]('Error:')+'\x20'+_0x1f587c[_0x2c997f(0x162)]);}}[a31_0x278ad1(0x22c)](_0x2e150a){const _0x528fda=a31_0x278ad1;for(const _0x1a6f3a of _0x2e150a){_0x1a6f3a['label']===_0x1a6f3a[_0x528fda(0x2c8)]||_0x1a6f3a['column']==='*'?console[_0x528fda(0x14b)](_0x528fda(0x1d2)+_0x1a6f3a[_0x528fda(0xfb)]):console[_0x528fda(0x14b)]('\x20\x20\x20\x20-\x20'+_0x1a6f3a[_0x528fda(0xfb)]+'\x20'+a31_0x2f8622['dim']('('+_0x1a6f3a['column']+')'));}}[a31_0x278ad1(0x1e9)](_0x1e60ef){const _0x478339=a31_0x278ad1;console['error']('─'[_0x478339(0x209)](0x3c));if(_0x1e60ef['errors']['length']>0x0){console['error']('\x0a'+a31_0x2f8622[_0x478339(0x179)]('Errors:'));for(const _0x492a3f of _0x1e60ef[_0x478339(0x12c)]){console[_0x478339(0x14b)]('\x20\x20'+a31_0x2f8622[_0x478339(0x179)]('•')+'\x20'+_0x492a3f);}}_0x1e60ef[_0x478339(0x283)]&&console[_0x478339(0x14b)]('\x0a'+a31_0x2f8622[_0x478339(0x1ed)]('✔')+_0x478339(0x27c));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a31_0x278ad1(0x18b)]=a31_0x278ad1(0x212);['description']='Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration';async[a31_0x278ad1(0x1e4)](_0x319078){const _0xd76e03=a31_0x278ad1,{options:_0x1ecc90,args:_0x3cee44,tdx:_0x5c6a80}=_0x319078,_0x182aac=_0x1ecc90,_0x4dc060=_0x3cee44[0x0]||_0x1ecc90[_0xd76e03(0x174)];if(!_0x4dc060)return showParentSegmentNotSetError(_0xd76e03(0x289)+_0xd76e03(0x206)+'Options\x20(one\x20required):\x0a'+'\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a'+_0xd76e03(0x221)+_0xd76e03(0x10a)+_0xd76e03(0x26d)+_0xd76e03(0x234)),0x1;if(!_0x182aac[_0xd76e03(0x214)]&&!_0x182aac['attribute']&&!_0x182aac[_0xd76e03(0x202)]&&!_0x182aac[_0xd76e03(0x261)])return console[_0xd76e03(0x14b)](a31_0x2f8622['red'](_0xd76e03(0x205))),console[_0xd76e03(0x14b)](_0xd76e03(0x1ec)),console[_0xd76e03(0x14b)](_0xd76e03(0x1c1)),console['error'](_0xd76e03(0x265)),console[_0xd76e03(0x14b)]('\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute'),console['error'](_0xd76e03(0x2cb)),console[_0xd76e03(0x14b)]('\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data'),0x1;const _0x21d399=resolveYamlFile(_0x4dc060);if(!existsSync(_0x21d399))return showFileNotFoundError(_0x21d399,_0x4dc060),0x1;_0x182aac[_0xd76e03(0x189)]&&(console[_0xd76e03(0x14b)]('Site:\x20'+_0x182aac['site']),console[_0xd76e03(0x14b)](_0xd76e03(0x1c8)+_0x21d399));let _0x3cdf0b;try{_0x3cdf0b=readFileSync(_0x21d399,_0xd76e03(0x24f));}catch(_0x306b24){const _0x4fa29c=_0x306b24 instanceof Error?_0x306b24[_0xd76e03(0x23f)]:String(_0x306b24);return console[_0xd76e03(0x14b)]('Error\x20reading\x20file:\x20'+_0x4fa29c),0x1;}let _0xd21ac8;try{_0xd21ac8=parseDef(_0x3cdf0b);}catch(_0x53d6d2){const _0x389884=_0x53d6d2 instanceof Error?_0x53d6d2[_0xd76e03(0x23f)]:String(_0x53d6d2);return console['error'](a31_0x2f8622[_0xd76e03(0x179)](_0xd76e03(0x2c0)+_0x389884)),0x1;}if(_0x182aac['attribute']===!![]||_0x182aac[_0xd76e03(0x256)]===''){const _0x4d1389=_0xd21ac8[_0xd76e03(0x16e)]?.['map'](_0x1a7d26=>_0x1a7d26[_0xd76e03(0x18b)])||[];if(_0x4d1389[_0xd76e03(0x19d)]===0x0)console[_0xd76e03(0x14b)](a31_0x2f8622[_0xd76e03(0x179)]('Error:\x20No\x20attributes\x20defined\x20in\x20configuration'));else{console[_0xd76e03(0x14b)](a31_0x2f8622[_0xd76e03(0x179)]('Error:\x20--attribute\x20requires\x20a\x20name\x0a')),console[_0xd76e03(0x14b)](_0xd76e03(0x2e5));for(const _0x53bcc1 of _0x4d1389){console[_0xd76e03(0x14b)]('\x20\x20'+a31_0x2f8622[_0xd76e03(0x248)](_0x53bcc1));}console[_0xd76e03(0x14b)](_0xd76e03(0x27b)+_0x4dc060+_0xd76e03(0x23c)+_0x4d1389[0x0]+'\x22');}return 0x1;}if(_0x182aac[_0xd76e03(0x202)]===!![]||_0x182aac[_0xd76e03(0x202)]===''){const _0x336a22=_0xd21ac8[_0xd76e03(0x1c4)]?.[_0xd76e03(0x257)](_0x981a93=>_0x981a93[_0xd76e03(0x18b)])||[];if(_0x336a22[_0xd76e03(0x19d)]===0x0)console['error'](a31_0x2f8622['red'](_0xd76e03(0x1f4)));else{console[_0xd76e03(0x14b)](a31_0x2f8622[_0xd76e03(0x179)]('Error:\x20--behavior\x20requires\x20a\x20name\x0a')),console[_0xd76e03(0x14b)](_0xd76e03(0x144));for(const _0xd82364 of _0x336a22){console[_0xd76e03(0x14b)]('\x20\x20'+a31_0x2f8622[_0xd76e03(0x248)](_0xd82364));}console[_0xd76e03(0x14b)](_0xd76e03(0x27b)+_0x4dc060+_0xd76e03(0x240)+_0x336a22[0x0]+'\x22');}return 0x1;}const _0x2e9f70=createCommandSpinner(a31_0x2f8622[_0xd76e03(0x2e9)](_0xd76e03(0x2e1)),{'verbose':_0x182aac[_0xd76e03(0x189)]});_0x2e9f70[_0xd76e03(0x16c)]();const _0x28cec7={'onProgress':_0x36f282=>{_0x2e9f70['text']=formatProgressMessage(_0x36f282);}};if(_0x182aac[_0xd76e03(0x214)])_0x28cec7[_0xd76e03(0x214)]=!![];if(_0x182aac[_0xd76e03(0x256)]&&typeof _0x182aac[_0xd76e03(0x256)]===_0xd76e03(0x2cc))_0x28cec7['attribute']=_0x182aac[_0xd76e03(0x256)];if(_0x182aac['behavior']&&typeof _0x182aac[_0xd76e03(0x202)]===_0xd76e03(0x2cc))_0x28cec7['behavior']=_0x182aac[_0xd76e03(0x202)];if(_0x182aac['enriched'])_0x28cec7['enriched']=!![];if(_0x182aac[_0xd76e03(0x17d)])_0x28cec7['interval']=_0x182aac[_0xd76e03(0x17d)];let _0x204f93;try{_0x204f93=await _0x5c6a80[_0xd76e03(0x114)]['previewParentYaml'](_0x3cdf0b,_0x28cec7),_0x2e9f70[_0xd76e03(0x12a)]();}catch(_0x2c0078){_0x2e9f70['stop']();throw _0x2c0078;}return await this[_0xd76e03(0x153)](_0x204f93,{'master':_0x182aac[_0xd76e03(0x214)],'attribute':typeof _0x182aac[_0xd76e03(0x256)]===_0xd76e03(0x2cc)?_0x182aac[_0xd76e03(0x256)]:undefined,'behavior':typeof _0x182aac[_0xd76e03(0x202)]===_0xd76e03(0x2cc)?_0x182aac['behavior']:undefined,'enriched':_0x182aac[_0xd76e03(0x261)]}),_0x204f93['allValid']?0x0:0x1;}async[a31_0x278ad1(0x153)](_0x489310,_0x24d4c8){const _0x5136e5=a31_0x278ad1;console[_0x5136e5(0x14b)]('\x0a'+a31_0x2f8622['bold'](_0x5136e5(0x13b))+'\x20'+_0x489310[_0x5136e5(0x18b)]),console[_0x5136e5(0x14b)]('═'[_0x5136e5(0x209)](0x3c));if(_0x24d4c8[_0x5136e5(0x214)]&&_0x489310[_0x5136e5(0x1a4)]){const _0x3faf39=a31_0x2f8622[_0x5136e5(0x2e9)](_0x5136e5(0x11f))+'\x20'+a31_0x2f8622[_0x5136e5(0x1ad)](_0x489310['master'][_0x5136e5(0x232)]+'.'+_0x489310[_0x5136e5(0x214)][_0x5136e5(0x107)]);await this[_0x5136e5(0x14c)](_0x3faf39,_0x489310[_0x5136e5(0x1a4)]);}else{if(_0x24d4c8[_0x5136e5(0x256)]&&_0x489310[_0x5136e5(0x1a4)]){const _0xd12aa9=a31_0x2f8622[_0x5136e5(0x2e9)](_0x5136e5(0x15f))+'\x20'+a31_0x2f8622['bold'](_0x24d4c8[_0x5136e5(0x256)]);await this['displaySampleData'](_0xd12aa9,_0x489310['sampleData']);}else{if(_0x24d4c8[_0x5136e5(0x202)]&&_0x489310['sampleData']){const _0x26147f=a31_0x2f8622[_0x5136e5(0x2e9)]('Behavior:')+'\x20'+a31_0x2f8622[_0x5136e5(0x1ad)](_0x24d4c8['behavior']);await this[_0x5136e5(0x14c)](_0x26147f,_0x489310[_0x5136e5(0x1a4)]);}else{if(_0x24d4c8[_0x5136e5(0x261)]&&_0x489310[_0x5136e5(0x1a4)]){const _0x1529eb=a31_0x2f8622[_0x5136e5(0x2e9)](_0x5136e5(0x1a8))+'\x20'+a31_0x2f8622[_0x5136e5(0x1ad)](_0x5136e5(0xf8));await this['displaySampleData'](_0x1529eb,_0x489310[_0x5136e5(0x1a4)]);}else!_0x489310[_0x5136e5(0x1a4)]&&console[_0x5136e5(0x14b)]('\x0aNo\x20sample\x20data\x20available');}}}if(_0x489310['errors'][_0x5136e5(0x19d)]>0x0){console[_0x5136e5(0x14b)]('─'[_0x5136e5(0x209)](0x3c)),console[_0x5136e5(0x14b)]('\x0a'+a31_0x2f8622[_0x5136e5(0x179)](_0x5136e5(0x1c9)));for(const _0x2ef10c of _0x489310[_0x5136e5(0x12c)]){console[_0x5136e5(0x14b)]('\x20\x20'+a31_0x2f8622['red']('•')+'\x20'+_0x2ef10c);}}}async[a31_0x278ad1(0x14c)](_0x2face6,_0x588366){const _0x2882dd=a31_0x278ad1;if(_0x588366[_0x2882dd(0x19d)]===0x0){console['error']('\x0a'+_0x2face6),console[_0x2882dd(0x14b)](_0x2882dd(0x29e));return;}console[_0x2882dd(0x14b)]('\x0a'+_0x2face6);const _0x6e17ad=Object[_0x2882dd(0x15d)](_0x588366[0x0])[_0x2882dd(0x257)](_0x2050c6=>({'name':_0x2050c6,'type':typeof _0x588366[0x0][_0x2050c6]==='number'?_0x2882dd(0x2b8):_0x2882dd(0x274)})),_0x514eb8={'queryId':'preview','columns':_0x6e17ad,'data':_0x588366,'stats':{'state':'FINISHED','queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x588366[_0x2882dd(0x19d)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x7bc07a=formatAsTable(_0x514eb8,_0x588366['length'],!![]);await writeOutput(_0x7bc07a,undefined,_0x2882dd(0x107));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a31_0x278ad1(0x18b)]='segment:parent:run';[a31_0x278ad1(0x225)]=a31_0x278ad1(0x21b);async['execute'](_0x35abc8){const _0x5408d6=a31_0x278ad1,{options:_0x4930a0,args:_0x5223eb,tdx:_0x1dfc39}=_0x35abc8,_0x478a69=_0x4930a0,_0x221a87=_0x5223eb[0x0]||_0x4930a0[_0x5408d6(0x174)];if(!_0x221a87)return showParentSegmentNotSetError(_0x5408d6(0x246)+_0x5408d6(0x224)),0x1;const _0x241f0e=resolveYamlFile(_0x221a87);if(existsSync(_0x241f0e)){_0x478a69['verbose']&&console[_0x5408d6(0x14b)](_0x5408d6(0x285)+_0x241f0e);let _0x55bcb9;try{_0x55bcb9=readFileSync(_0x241f0e,_0x5408d6(0x24f));}catch(_0x242c32){const _0x104871=_0x242c32 instanceof Error?_0x242c32[_0x5408d6(0x23f)]:String(_0x242c32);return console[_0x5408d6(0x14b)](_0x5408d6(0x30f)+_0x104871),0x1;}const _0x38c342=await withSpinner(_0x5408d6(0x286),()=>_0x1dfc39[_0x5408d6(0x114)]['pushParentYaml'](_0x55bcb9),{'verbose':_0x478a69[_0x5408d6(0x189)]}),_0x4fbdc1=_0x38c342[_0x5408d6(0x1d4)],{isNew:_0x44b0af,name:_0x4f8399,hasChanges:_0x15b98e,diffFormatted:_0x2d38dc}=_0x4fbdc1;if(_0x15b98e){_0x44b0af?console['error'](_0x5408d6(0x11b)+_0x4f8399+'\x27:'):console[_0x5408d6(0x14b)]('\x0aChanges\x20to\x20apply\x20to\x20\x27'+_0x4f8399+'\x27:');console['error']('─'['repeat'](0x3c)),console[_0x5408d6(0x14b)](_0x2d38dc),console[_0x5408d6(0x14b)]('─'[_0x5408d6(0x209)](0x3c));const _0x4e946b=_0x44b0af?_0x5408d6(0x2ed)+_0x4f8399+'\x27\x20and\x20run\x20workflow?':_0x5408d6(0x135)+_0x4f8399+'\x27\x20and\x20run\x20workflow?';if(!_0x478a69[_0x5408d6(0x26e)]){if(!isInteractive())return console['error'](a31_0x2f8622['red']('\x0aError:'),_0x5408d6(0x251)),console[_0x5408d6(0x14b)](a31_0x2f8622['dim'](_0x5408d6(0x28d))),0x1;const _0x19fd07=await confirmKey(_0x4e946b);if(!_0x19fd07)return console[_0x5408d6(0x14b)](a31_0x2f8622['yellow'](_0x5408d6(0x164))),0x1;}const _0xfe8c7=_0x44b0af?_0x5408d6(0x110):'Updating';await withSpinner(_0xfe8c7+_0x5408d6(0x271)+_0x4f8399+_0x5408d6(0x2fa),()=>_0x4fbdc1[_0x5408d6(0x11e)](),{'verbose':_0x478a69[_0x5408d6(0x189)]});const _0x1ec468=_0x44b0af?_0x5408d6(0x1ca):_0x5408d6(0x287);console[_0x5408d6(0x14b)]('✔\x20'+_0x1ec468+_0x5408d6(0x271)+_0x4f8399+'\x27');}else console[_0x5408d6(0x14b)](_0x5408d6(0x11c)+_0x4f8399+_0x5408d6(0xfc));}const _0x40ab94=await withSpinner(_0x5408d6(0x273)+_0x221a87+'\x27...',()=>_0x1dfc39[_0x5408d6(0x114)][_0x5408d6(0x124)](_0x221a87),{'verbose':_0x478a69[_0x5408d6(0x189)]}),_0x4a7294=_0x40ab94[_0x5408d6(0x1d4)],_0x308d36=getConsoleUrl(_0x478a69[_0x5408d6(0x28b)],_0x5408d6(0x302)+_0x4a7294[_0x5408d6(0x282)]+_0x5408d6(0x113)+_0x4a7294[_0x5408d6(0x230)]+'/attempt/'+_0x4a7294[_0x5408d6(0x25a)]);return console[_0x5408d6(0x14b)]('\x0a✔\x20Workflow\x20started'),console[_0x5408d6(0x14b)]('\x20\x20'+a31_0x2f8622['dim'](_0x5408d6(0x2c4))+'\x20'+_0x4a7294[_0x5408d6(0x2f0)]),console[_0x5408d6(0x14b)]('\x20\x20'+a31_0x2f8622[_0x5408d6(0x2e9)](_0x5408d6(0x1f8))+'\x20'+_0x4a7294[_0x5408d6(0x2bb)]),console['error']('\x20\x20'+a31_0x2f8622[_0x5408d6(0x2e9)](_0x5408d6(0x177))+'\x20'+_0x4a7294[_0x5408d6(0x230)]),console[_0x5408d6(0x14b)]('\x20\x20'+a31_0x2f8622[_0x5408d6(0x2e9)](_0x5408d6(0xff))+'\x20'+_0x4a7294[_0x5408d6(0x25a)]),console[_0x5408d6(0x14b)]('\x20\x20'+_0x308d36),console[_0x5408d6(0x14b)]('\x0a'+a31_0x2f8622['dim'](_0x5408d6(0x2ff))+_0x5408d6(0x2c7)+_0x4a7294[_0x5408d6(0x25a)]+'\x20kill'),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a31_0x278ad1(0x18b)]=a31_0x278ad1(0x293);[a31_0x278ad1(0x225)]=a31_0x278ad1(0x1ef);async[a31_0x278ad1(0x1e4)](_0xa55a4e){const _0x17058e=a31_0x278ad1,{options:_0x97d650,args:_0x43920b,tdx:_0x532140}=_0xa55a4e,_0x35bfa6=_0x43920b[0x0]||_0x97d650['parentSegment'];if(!_0x35bfa6)return showParentSegmentNotSetError(_0x17058e(0x30e)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment'),0x1;_0x97d650['verbose']&&(console[_0x17058e(0x14b)](_0x17058e(0x18d)+_0x97d650[_0x17058e(0x28b)]),console['error']('Parent\x20segment:\x20'+_0x35bfa6));const _0x2a2514=await withSpinner(_0x17058e(0x308)+_0x35bfa6+'\x27...',()=>_0x532140[_0x17058e(0x114)]['listFields'](_0x35bfa6),{'verbose':_0x97d650[_0x17058e(0x189)]}),_0x14ebab=_0x2a2514[_0x17058e(0x1d4)];console['error'](_0x17058e(0x16a)+_0x14ebab[_0x17058e(0x19d)]+_0x17058e(0x28c)+(_0x14ebab[_0x17058e(0x19d)]!==0x1?'s':''));if(_0x97d650[_0x17058e(0x129)]||_0x97d650[_0x17058e(0x215)])return await handleSDKOutput(_0x14ebab,_0x97d650),0x0;return displayFieldsHumanReadable(_0x14ebab,_0x35bfa6),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a31_0x278ad1(0x18b)]=a31_0x278ad1(0x1bb);[a31_0x278ad1(0x225)]=a31_0x278ad1(0x207);async[a31_0x278ad1(0x1e4)](_0x3b92be){const _0xdc3c41=a31_0x278ad1,{options:_0x563f64,args:_0x146e0c,tdx:_0x40b2e7}=_0x3b92be,_0x3f197f=_0x563f64,_0x3e8404=_0x146e0c[0x0]||_0x563f64[_0xdc3c41(0x174)];if(!_0x3e8404)return showParentSegmentNotSetError(_0xdc3c41(0x26c)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a'+'Options:\x0a'+_0xdc3c41(0x2dd)),0x1;_0x563f64[_0xdc3c41(0x189)]&&(console[_0xdc3c41(0x14b)](_0xdc3c41(0x18d)+_0x563f64[_0xdc3c41(0x28b)]),console[_0xdc3c41(0x14b)](_0xdc3c41(0x170)+_0x3e8404));const _0x4807ef=await withSpinner(_0xdc3c41(0x208)+_0x3e8404+_0xdc3c41(0x2fa),()=>_0x40b2e7[_0xdc3c41(0x114)]['getParentFull'](_0x3e8404),{'verbose':_0x563f64[_0xdc3c41(0x189)]}),_0x347b72=_0x4807ef[_0xdc3c41(0x1d4)];if(_0x3f197f['web']){const _0x54b0c5=getConsoleNextUrl(_0x3f197f[_0xdc3c41(0x28b)],_0xdc3c41(0x1fb)+_0x347b72['id']);return console[_0xdc3c41(0x14b)](a31_0x2f8622[_0xdc3c41(0x1ed)]('✔')+'\x20Opening\x20'+a31_0x2f8622[_0xdc3c41(0x248)](_0x54b0c5)),openBrowser(_0x54b0c5),0x0;}return await handleSingleObjectOutput(_0x347b72,_0x563f64),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a31_0x278ad1(0x18b)]=a31_0x278ad1(0x23e);[a31_0x278ad1(0x225)]='Show\x20parent\x20segment\x20schema\x20(column\x20types)';async['execute'](_0x532f6f){const _0x23034a=a31_0x278ad1,{options:_0x1fdc8a,args:_0xb389c1,tdx:_0x3549e1}=_0x532f6f,_0x12456c=_0x1fdc8a,_0x4e8b37=_0xb389c1[0x0]||_0x1fdc8a[_0x23034a(0x174)];if(!_0x4e8b37)return showParentSegmentNotSetError(_0x23034a(0x298)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20all\x20tables\x20for\x20parent\x20segment\x0a\x0a'+'Options:\x0a'+'\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path'),0x1;_0x1fdc8a[_0x23034a(0x189)]&&(console[_0x23034a(0x14b)](_0x23034a(0x18d)+_0x1fdc8a[_0x23034a(0x28b)]),console[_0x23034a(0x14b)]('Parent\x20segment:\x20'+_0x4e8b37));const _0x488764=await withSpinner(_0x23034a(0x112)+_0x4e8b37+'\x27...',()=>_0x3549e1[_0x23034a(0x114)][_0x23034a(0x222)](_0x4e8b37),{'verbose':_0x1fdc8a[_0x23034a(0x189)]}),_0x4b5b06=_0x488764[_0x23034a(0x1d4)],_0x3c3476=_0x3549e1[_0x23034a(0x114)][_0x23034a(0x12b)](_0x4b5b06);if(_0x12456c[_0x23034a(0x238)]){const _0x59aebd=await this['collectSchema'](_0x532f6f,_0x4e8b37,_0x4b5b06,_0x3c3476),_0x250fe3=this[_0x23034a(0x1b4)](_0x59aebd);writeFileSync(_0x12456c['output'],_0x250fe3);const _0x2c8efb=_0x59aebd[_0x23034a(0x1ff)]['columns'][_0x23034a(0x19d)]+_0x59aebd['behaviors']['reduce']((_0x547cf5,_0x3eb76d)=>_0x547cf5+_0x3eb76d[_0x23034a(0x152)]['length'],0x0),_0x4325a8=_0x59aebd[_0x23034a(0x1c4)][_0x23034a(0x1b0)](_0x5b57b6=>_0x5b57b6['columns'][_0x23034a(0x19d)]===0x0)[_0x23034a(0x19d)];return console[_0x23034a(0x19a)]('Schema\x20saved\x20to\x20'+_0x12456c[_0x23034a(0x238)]),console[_0x23034a(0x19a)](_0x23034a(0x1cf)+_0x3c3476),console[_0x23034a(0x19a)](_0x23034a(0x121)+_0x59aebd[_0x23034a(0x1c4)][_0x23034a(0x19d)]+'\x20behaviors'),console[_0x23034a(0x19a)](_0x23034a(0x192)+_0x2c8efb+_0x23034a(0x188)),_0x4325a8>0x0&&console[_0x23034a(0x19a)]('\x20\x20Note:\x20'+_0x4325a8+_0x23034a(0x243)),0x0;}console[_0x23034a(0x14b)]('\x0a'+a31_0x2f8622['bold'](_0x23034a(0x1aa))+'\x20'+a31_0x2f8622[_0x23034a(0x248)](_0x3c3476));const _0xc586b6=await withSpinner(_0x23034a(0x2c9),()=>_0x3549e1[_0x23034a(0x114)]['getParentSQL'](_0x4b5b06),{'verbose':_0x1fdc8a[_0x23034a(0x189)]});console[_0x23034a(0x14b)]('\x0a'+a31_0x2f8622[_0x23034a(0x1ad)](_0x23034a(0x1ff))+'\x20'+a31_0x2f8622['dim']('('+_0x3c3476+'.customers)'));const _0xf4d1bd=await executeSchemaQuery(_0xc586b6[_0x23034a(0x1d4)],_0x3549e1,_0x1fdc8a);await handleQueryOutput(_0xf4d1bd,_0x1fdc8a);const _0x27bc9e=await withSpinner(_0x23034a(0x1cc),()=>_0x3549e1['segment']['getBehaviorNames'](_0x4b5b06),{'verbose':_0x1fdc8a['verbose']});for(const _0x2a18af of _0x27bc9e[_0x23034a(0x1d4)]){const _0x807a17='behavior_'+_0x2a18af[_0x23034a(0x210)]()[_0x23034a(0x1f6)](/\s+/g,'_'),_0x6b81c9=_0x23034a(0x154)+_0x3c3476+'.'+_0x807a17;console[_0x23034a(0x14b)]('\x0a'+a31_0x2f8622[_0x23034a(0x1ad)](_0x2a18af)+'\x20'+a31_0x2f8622[_0x23034a(0x2e9)]('('+_0x3c3476+'.'+_0x807a17+')'));try{const _0xbbc59b=await executeSchemaQuery(_0x6b81c9,_0x3549e1,_0x1fdc8a);await handleQueryOutput(_0xbbc59b,_0x1fdc8a);}catch{console[_0x23034a(0x14b)](a31_0x2f8622[_0x23034a(0x1c7)](_0x23034a(0x101)));}}return 0x0;}async[a31_0x278ad1(0x1df)](_0x4b6589,_0x292a55,_0x591bd5,_0x2d9c7e){const _0x1774a7=a31_0x278ad1,{options:_0x132e35,tdx:_0x230eb8}=_0x4b6589,_0x146c74=await withSpinner(_0x1774a7(0x2c9),()=>_0x230eb8[_0x1774a7(0x114)][_0x1774a7(0x2b7)](_0x591bd5),{'verbose':_0x132e35[_0x1774a7(0x189)]}),_0x1226a7=await executeSchemaQuery(_0x146c74[_0x1774a7(0x1d4)],_0x230eb8,_0x132e35),_0x2df677=_0x1226a7[_0x1774a7(0x1d4)][_0x1774a7(0x257)](_0x11d56c=>({'name':_0x11d56c['column_name'],'type':_0x11d56c['column_type']})),_0x2f02cf=await withSpinner('Fetching\x20behavior\x20list...',()=>_0x230eb8[_0x1774a7(0x114)][_0x1774a7(0x30c)](_0x591bd5),{'verbose':_0x132e35[_0x1774a7(0x189)]}),_0x26417a=[];for(const _0x17f1ae of _0x2f02cf[_0x1774a7(0x1d4)]){const _0x376204=_0x1774a7(0x159)+_0x17f1ae[_0x1774a7(0x210)]()[_0x1774a7(0x1f6)](/\s+/g,'_'),_0x24d218=_0x1774a7(0x154)+_0x2d9c7e+'.'+_0x376204;let _0x391e8c=[];try{const _0x3516de=await executeSchemaQuery(_0x24d218,_0x230eb8,_0x132e35);_0x391e8c=_0x3516de[_0x1774a7(0x1d4)][_0x1774a7(0x257)](_0x415bb9=>({'name':_0x415bb9[_0x1774a7(0x171)],'type':_0x415bb9['column_type']}));}catch{}_0x26417a[_0x1774a7(0x1ae)]({'table':_0x376204,'columns':_0x391e8c});}return{'database':_0x2d9c7e,'parent_segment':_0x292a55,'parent_id':_0x591bd5,'customers':{'table':_0x1774a7(0x1ff),'columns':_0x2df677},'behaviors':_0x26417a};}['formatSchemaJson'](_0x179e9d){const _0x4ad9b0=a31_0x278ad1,_0xaf814b=_0x5eba69=>{const _0x28e12a=a31_0x4d90;if(_0x5eba69['length']===0x0)return'[]';const _0x4eceed=_0x5eba69[_0x28e12a(0x257)](_0x6a2cfc=>_0x28e12a(0x2d1)+_0x6a2cfc['name']+_0x28e12a(0x2be)+_0x6a2cfc[_0x28e12a(0x2a1)]+_0x28e12a(0x2c2));return'[\x0a'+_0x4eceed[_0x28e12a(0x2df)](',\x0a')+_0x28e12a(0x2c3);},_0x5397c0=_0x179e9d[_0x4ad9b0(0x1c4)]['map'](_0xcedae6=>{const _0x53db22=_0x4ad9b0;return _0x53db22(0x23d)+_0xcedae6[_0x53db22(0x107)]+'\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20'+_0xaf814b(_0xcedae6[_0x53db22(0x152)])[_0x53db22(0x1f6)](/^/gm,'\x20\x20')[_0x53db22(0x1b8)]()+'\x0a\x20\x20\x20\x20}';})[_0x4ad9b0(0x2df)](',\x0a');return _0x4ad9b0(0x218)+_0x179e9d['database']+_0x4ad9b0(0x2b2)+_0x179e9d[_0x4ad9b0(0x104)]+_0x4ad9b0(0x2aa)+_0x179e9d[_0x4ad9b0(0x166)]+_0x4ad9b0(0x1fc)+_0x179e9d[_0x4ad9b0(0x1ff)][_0x4ad9b0(0x107)]+_0x4ad9b0(0x184)+_0xaf814b(_0x179e9d[_0x4ad9b0(0x1ff)]['columns'])[_0x4ad9b0(0x1f6)](/^/gm,'\x20\x20')[_0x4ad9b0(0x1b8)]()+'\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a'+_0x5397c0+_0x4ad9b0(0x175);}}export class ParentSegmentSQLCommand extends BaseCommand{['name']=a31_0x278ad1(0x109);[a31_0x278ad1(0x225)]=a31_0x278ad1(0x194);async[a31_0x278ad1(0x1e4)](_0x16b87d){const _0x1bba92=a31_0x278ad1,{options:_0x28a192,args:_0x5480cc,tdx:_0x522677}=_0x16b87d,_0x5ab438=_0x5480cc[0x0]||_0x28a192[_0x1bba92(0x174)];if(!_0x5ab438)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'+_0x1bba92(0x19e)),0x1;_0x28a192[_0x1bba92(0x189)]&&(console[_0x1bba92(0x14b)]('Site:\x20'+_0x28a192[_0x1bba92(0x28b)]),console[_0x1bba92(0x14b)](_0x1bba92(0x170)+_0x5ab438));const _0x476e6a=await withSpinner(_0x1bba92(0x112)+_0x5ab438+_0x1bba92(0x2fa),()=>_0x522677['segment'][_0x1bba92(0x222)](_0x5ab438),{'verbose':_0x28a192[_0x1bba92(0x189)]}),_0x45bf28=_0x476e6a[_0x1bba92(0x1d4)],_0x4b3aaa=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x5ab438+_0x1bba92(0x2fa),()=>_0x522677[_0x1bba92(0x114)]['getParentSQL'](_0x45bf28),{'verbose':_0x28a192[_0x1bba92(0x189)]}),_0x31c03e=_0x4b3aaa[_0x1bba92(0x1d4)];return _0x28a192[_0x1bba92(0x1fd)]===_0x1bba92(0x129)||_0x28a192[_0x1bba92(0x1fd)]===_0x1bba92(0x215)?await handleSDKOutput([{'sql':_0x31c03e}],_0x28a192):console['log'](_0x31c03e),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a31_0x278ad1(0x18b)]=a31_0x278ad1(0x1e0);[a31_0x278ad1(0x225)]='Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results';async['execute'](_0x2e3707){const _0x1220b9=a31_0x278ad1,{options:_0x50d513,args:_0x4dd4c3,tdx:_0x2f421e}=_0x2e3707,_0x5508fd=_0x4dd4c3[0x0]||_0x50d513[_0x1220b9(0x174)];if(!_0x5508fd)return showParentSegmentNotSetError(_0x1220b9(0x254)+_0x1220b9(0x103)),0x1;_0x50d513['verbose']&&(console['error'](_0x1220b9(0x18d)+_0x50d513[_0x1220b9(0x28b)]),console[_0x1220b9(0x14b)](_0x1220b9(0x170)+_0x5508fd));const _0x5ceec1=await withSpinner(_0x1220b9(0x112)+_0x5508fd+_0x1220b9(0x2fa),()=>_0x2f421e[_0x1220b9(0x114)]['resolveParentId'](_0x5508fd),{'verbose':_0x50d513[_0x1220b9(0x189)]}),_0x9dba63=_0x5ceec1['data'],_0xc02010=await withSpinner(_0x1220b9(0x108)+_0x5508fd+_0x1220b9(0x2fa),()=>_0x2f421e[_0x1220b9(0x114)][_0x1220b9(0x2b7)](_0x9dba63),{'verbose':_0x50d513[_0x1220b9(0x189)]});let _0x4ff603=_0xc02010[_0x1220b9(0x1d4)];const _0x1c12e2=resolveLimit(_0x50d513[_0x1220b9(0x231)],DEFAULT_DISPLAY_LIMIT),_0x4ea15b=/\bLIMIT\s+\d+/i[_0x1220b9(0x2e6)](_0x4ff603);!_0x4ea15b&&(_0x4ff603=_0x4ff603[_0x1220b9(0x1b8)]()['replace'](/;+$/,''),_0x4ff603=_0x1220b9(0x158)+_0x4ff603+_0x1220b9(0x161)+_0x1c12e2);_0x50d513[_0x1220b9(0x189)]&&console[_0x1220b9(0x14b)](_0x1220b9(0x2bc)+_0x4ff603);const _0x50e60f=await withProgressSpinner(_0x1220b9(0x139),async _0xdff2b=>{const _0x528f92=_0x1220b9,_0x35c406=await _0x2f421e[_0x528f92(0x278)][_0x528f92(0x1e4)](_0x4ff603,{'catalog':'td','schema':'information_schema','onJobId':_0x3e8d8d=>{const _0x4c062b=_0x528f92;_0xdff2b[_0x4c062b(0x2d3)](_0x3e8d8d);}});return _0x35c406;},{'verbose':_0x50d513['verbose']}),_0x2b3634=_0x50e60f[_0x1220b9(0x1d4)],_0x5b2991=_0x2b3634[_0x1220b9(0x1c3)]?_0x1220b9(0x29a)+_0x2b3634[_0x1220b9(0x1c3)]+']':'';return console['error']('✔\x20Query\x20completed:\x20Processed\x20'+_0x2b3634[_0x1220b9(0x14e)][_0x1220b9(0x182)][_0x1220b9(0x263)]()+'\x20rows\x20'+('in\x20'+formatElapsed(_0x2b3634[_0x1220b9(0x14e)]['elapsedTimeMillis'])+_0x5b2991)),await handleQueryOutput(_0x2b3634,_0x50d513),0x0;}}export class PSRtListCommand extends BaseCommand{[a31_0x278ad1(0x18b)]=a31_0x278ad1(0x281);[a31_0x278ad1(0x225)]=a31_0x278ad1(0x2d0);async[a31_0x278ad1(0x1e4)](_0x4d0c32){const _0x3935cb=a31_0x278ad1,{options:_0x173a54,args:_0x2d2113,tdx:_0x4e75dd}=_0x4d0c32,_0x52b6e9=_0x2d2113[0x0],_0x242922=await withSpinner(_0x52b6e9?_0x3935cb(0x204)+_0x52b6e9+'\x27...':_0x3935cb(0x23a),()=>_0x4e75dd[_0x3935cb(0x1d7)][_0x3935cb(0x291)](),{'verbose':_0x173a54['verbose']});let _0x29a107=_0x242922[_0x3935cb(0x1d4)][_0x3935cb(0x1b0)](_0x2304c=>_0x2304c[_0x3935cb(0x259)]);if(_0x52b6e9){const _0x416304=_0x52b6e9[_0x3935cb(0x1f6)](/[.+^${}()|[\]\\]/g,'\x5c$&')['replace'](/\*/g,'.*')[_0x3935cb(0x1f6)](/\?/g,'.'),_0x3d85a0=new RegExp('^'+_0x416304+'$','i');_0x29a107=_0x29a107[_0x3935cb(0x1b0)](_0x376c7d=>_0x3d85a0['test'](_0x376c7d['name']));}_0x29a107[_0x3935cb(0x13a)]((_0x37be93,_0x2343ca)=>_0x37be93['name'][_0x3935cb(0x1b7)](_0x2343ca[_0x3935cb(0x18b)])),console[_0x3935cb(0x14b)](_0x3935cb(0x16a)+_0x29a107[_0x3935cb(0x19d)]+_0x3935cb(0x2ac)+(_0x29a107['length']!==0x1?'s':''));const _0x346986=_0x11cd2d=>{const _0x40fa7f=_0x3935cb;return getConsoleNextUrl(_0x173a54['site'],_0x40fa7f(0x1fb)+_0x11cd2d);};if(_0x173a54[_0x3935cb(0x1fd)]==='json'||_0x173a54['format']===_0x3935cb(0x215)){const _0x5e58da=_0x29a107[_0x3935cb(0x257)](_0xbbd40f=>({..._0xbbd40f,'url':_0x346986(_0xbbd40f['id'])}));await handleSDKOutput(_0x5e58da,_0x173a54);}else{if(_0x29a107[_0x3935cb(0x19d)]===0x0)console['log']('No\x20RT-enabled\x20parent\x20segments\x20found');else for(const _0x284ea6 of _0x29a107){const _0x356fd4=_0x284ea6[_0x3935cb(0x125)]?a31_0x2f8622[_0x3935cb(0x2e9)]('\x20('+formatRows(_0x284ea6[_0x3935cb(0x125)])+')'):'',_0x5de6b4=hyperlink(_0x284ea6['name'],_0x346986(_0x284ea6['id']));console[_0x3935cb(0x19a)]('⚡\x20'+_0x5de6b4+_0x356fd4);}}return 0x0;}}export class PSRtValidateCommand extends BaseParentSegmentCommand{[a31_0x278ad1(0x18b)]='ps:rt:validate';[a31_0x278ad1(0x225)]='Validate\x20RT\x202.0\x20configuration\x20from\x20parent\x20segment\x20YAML';async[a31_0x278ad1(0x1e4)](_0x5eac58){const _0x4a834b=a31_0x278ad1,{options:_0x4cd117,args:_0x175e06,tdx:_0x1148f5}=_0x5eac58,_0x189bba=_0x175e06[0x0]||_0x4cd117[_0x4a834b(0x174)];if(!_0x189bba)return showParentSegmentNotSetError(_0x4a834b(0x155)+_0x4a834b(0x1b5)),0x1;const _0x39f647=resolveYamlFile(_0x189bba);if(!existsSync(_0x39f647))return showFileNotFoundError(_0x39f647,_0x189bba),0x1;let _0x26e8ba;try{_0x26e8ba=readFileSync(_0x39f647,'utf-8');}catch(_0x7bd050){const _0x4f60cf=_0x7bd050 instanceof Error?_0x7bd050[_0x4a834b(0x23f)]:String(_0x7bd050);return console[_0x4a834b(0x14b)](_0x4a834b(0x30f)+_0x4f60cf),0x1;}const _0x4d4a67=createCommandSpinner(a31_0x2f8622[_0x4a834b(0x2e9)](_0x4a834b(0x288)),{'verbose':_0x4cd117[_0x4a834b(0x189)]});_0x4d4a67[_0x4a834b(0x16c)]();const _0x40d4d2={'realtime':!![],'onProgress':_0x29c449=>{const _0x1dccc4=_0x4a834b;_0x4d4a67[_0x1dccc4(0x21f)]=formatProgressMessage(_0x29c449);}};let _0x55b6fa;try{_0x55b6fa=await _0x1148f5['segment'][_0x4a834b(0x269)](_0x26e8ba,_0x40d4d2),_0x4d4a67[_0x4a834b(0x12a)]();}catch(_0x2fb1ef){_0x4d4a67[_0x4a834b(0x12a)]();throw _0x2fb1ef;}console[_0x4a834b(0x14b)]('\x0a'+a31_0x2f8622[_0x4a834b(0x1ad)](_0x4a834b(0x21e))+'\x20'+_0x55b6fa[_0x4a834b(0x18b)]),console[_0x4a834b(0x14b)]('═'[_0x4a834b(0x209)](0x3c)),displayRealtimeValidation(_0x55b6fa),console['error']('─'['repeat'](0x3c));if(_0x55b6fa[_0x4a834b(0x12c)]['length']>0x0){console[_0x4a834b(0x14b)]('\x0a'+a31_0x2f8622[_0x4a834b(0x179)](_0x4a834b(0x1c9)));for(const _0x7b4343 of _0x55b6fa[_0x4a834b(0x12c)]){console[_0x4a834b(0x14b)]('\x20\x20'+a31_0x2f8622[_0x4a834b(0x179)]('•')+'\x20'+_0x7b4343);}}return _0x55b6fa[_0x4a834b(0x283)]&&console[_0x4a834b(0x14b)]('\x0a'+a31_0x2f8622[_0x4a834b(0x1ed)]('✔')+_0x4a834b(0x2f2)),_0x55b6fa[_0x4a834b(0x283)]?0x0:0x1;}}export class PSRtJnListCommand extends BaseCommand{[a31_0x278ad1(0x18b)]='ps:rt:jn:list';[a31_0x278ad1(0x225)]=a31_0x278ad1(0x2bd);async['execute'](_0x4aee93){const _0x336bb5=a31_0x278ad1,{options:_0x6f9854,args:_0x3b8cfc,tdx:_0x27c9f2}=_0x4aee93,_0x5180d2=_0x3b8cfc[0x0]||_0x6f9854['parentSegment'];if(!_0x5180d2)return showParentSegmentNotSetError(_0x336bb5(0x228)+_0x336bb5(0x18e)),0x1;_0x6f9854[_0x336bb5(0x189)]&&(console[_0x336bb5(0x14b)](_0x336bb5(0x18d)+_0x6f9854[_0x336bb5(0x28b)]),console[_0x336bb5(0x14b)]('Parent\x20segment:\x20'+_0x5180d2));const _0x2aa3f2=await withSpinner(_0x336bb5(0x112)+_0x5180d2+_0x336bb5(0x2fa),()=>_0x27c9f2[_0x336bb5(0x114)]['resolveParentId'](_0x5180d2),{'verbose':_0x6f9854[_0x336bb5(0x189)]}),_0x48518c=_0x2aa3f2['data'],_0x145c99=await withSpinner(_0x336bb5(0x1ac)+_0x5180d2+_0x336bb5(0x2fa),()=>_0x27c9f2[_0x336bb5(0x1d7)][_0x336bb5(0x190)](_0x48518c),{'verbose':_0x6f9854[_0x336bb5(0x189)]}),_0x12dc0b=_0x145c99[_0x336bb5(0x1d4)];console['error'](_0x336bb5(0x16a)+_0x12dc0b[_0x336bb5(0x19d)]+'\x20RT\x20journey'+(_0x12dc0b[_0x336bb5(0x19d)]!==0x1?'s':''));if(_0x6f9854[_0x336bb5(0x1fd)]===_0x336bb5(0x129)||_0x6f9854[_0x336bb5(0x1fd)]==='jsonl')await handleSDKOutput(_0x12dc0b,_0x6f9854);else{if(_0x12dc0b[_0x336bb5(0x19d)]===0x0)console[_0x336bb5(0x19a)](_0x336bb5(0x142));else for(const _0x50abd3 of _0x12dc0b){const _0xe7f059=_0x50abd3['state']===_0x336bb5(0x15c)?'🚀':'📝',_0x14fbce=_0x50abd3[_0x336bb5(0x1bf)]?a31_0x2f8622[_0x336bb5(0x1c7)](_0x336bb5(0x20c)):'',_0x31ec90=a31_0x2f8622[_0x336bb5(0x2e9)]('\x20('+_0x50abd3[_0x336bb5(0x201)]+_0x336bb5(0xfd)+(_0x50abd3['stageCount']!==0x1?'s':'')+')');console[_0x336bb5(0x19a)](_0xe7f059+'\x20'+_0x50abd3[_0x336bb5(0x18b)]+_0x14fbce+_0x31ec90);}}return 0x0;}}export class PSRtJnPauseCommand extends BaseCommand{[a31_0x278ad1(0x18b)]=a31_0x278ad1(0x2b0);[a31_0x278ad1(0x225)]=a31_0x278ad1(0x1d5);async[a31_0x278ad1(0x1e4)](_0x23b01b){const _0x592f60=a31_0x278ad1,{options:_0x39162e,args:_0x1586b2,tdx:_0x2db44a}=_0x23b01b,_0x1fd88d=_0x1586b2[0x0];if(!_0x1fd88d)return console[_0x592f60(0x14b)](a31_0x2f8622[_0x592f60(0x179)](_0x592f60(0x1f0))),console[_0x592f60(0x14b)](_0x592f60(0x26b)),console[_0x592f60(0x14b)](a31_0x2f8622[_0x592f60(0x2e9)]('Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs')),0x1;_0x39162e[_0x592f60(0x189)]&&(console[_0x592f60(0x14b)]('Site:\x20'+_0x39162e[_0x592f60(0x28b)]),console[_0x592f60(0x14b)](_0x592f60(0x258)+_0x1fd88d));const _0x5bab17=await withSpinner(_0x592f60(0x24e)+_0x1fd88d+_0x592f60(0x2fa),()=>_0x2db44a[_0x592f60(0x1d7)]['pauseJourney'](_0x1fd88d),{'verbose':_0x39162e[_0x592f60(0x189)]}),_0x9d9e1d=_0x5bab17[_0x592f60(0x1d4)];console[_0x592f60(0x14b)]('✔\x20Paused\x20activations\x20for\x20RT\x20journey\x20\x27'+_0x9d9e1d[_0x592f60(0x18b)]+'\x27');if(_0x39162e[_0x592f60(0x1fd)]===_0x592f60(0x129)||_0x39162e[_0x592f60(0x1fd)]===_0x592f60(0x215))await handleSDKOutput([_0x9d9e1d],_0x39162e);else{const _0x16c8b8=_0x9d9e1d[_0x592f60(0x14a)]===_0x592f60(0x15c)?'🚀':'📝',_0x3f7b8b=_0x9d9e1d[_0x592f60(0x1bf)]?a31_0x2f8622[_0x592f60(0x1c7)](_0x592f60(0x20c)):'';console[_0x592f60(0x19a)](_0x16c8b8+'\x20'+_0x9d9e1d['name']+_0x3f7b8b);}return 0x0;}}export class PSRtJnResumeCommand extends BaseCommand{[a31_0x278ad1(0x18b)]=a31_0x278ad1(0x2e3);[a31_0x278ad1(0x225)]=a31_0x278ad1(0x2d5);async[a31_0x278ad1(0x1e4)](_0x34be1a){const _0x4cf53c=a31_0x278ad1,{options:_0x43bfed,args:_0x2cd5fe,tdx:_0x4a323d}=_0x34be1a,_0x7e47fe=_0x2cd5fe[0x0];if(!_0x7e47fe)return console[_0x4cf53c(0x14b)](a31_0x2f8622['red'](_0x4cf53c(0x1f0))),console[_0x4cf53c(0x14b)](_0x4cf53c(0xf9)),console[_0x4cf53c(0x14b)](a31_0x2f8622[_0x4cf53c(0x2e9)](_0x4cf53c(0x1b9))),0x1;_0x43bfed['verbose']&&(console[_0x4cf53c(0x14b)]('Site:\x20'+_0x43bfed[_0x4cf53c(0x28b)]),console['error'](_0x4cf53c(0x258)+_0x7e47fe));const _0x13fef9=await withSpinner(_0x4cf53c(0x30d)+_0x7e47fe+_0x4cf53c(0x2fa),()=>_0x4a323d[_0x4cf53c(0x1d7)][_0x4cf53c(0x111)](_0x7e47fe),{'verbose':_0x43bfed[_0x4cf53c(0x189)]}),_0x4ce247=_0x13fef9[_0x4cf53c(0x1d4)];console['error']('✔\x20Resumed\x20activations\x20for\x20RT\x20journey\x20\x27'+_0x4ce247['name']+'\x27');if(_0x43bfed['format']==='json'||_0x43bfed[_0x4cf53c(0x1fd)]==='jsonl')await handleSDKOutput([_0x4ce247],_0x43bfed);else{const _0x296bf3=_0x4ce247[_0x4cf53c(0x14a)]===_0x4cf53c(0x15c)?'🚀':'📝',_0x4da734=_0x4ce247[_0x4cf53c(0x1bf)]?a31_0x2f8622[_0x4cf53c(0x1c7)](_0x4cf53c(0x20c)):'';console[_0x4cf53c(0x19a)](_0x296bf3+'\x20'+_0x4ce247[_0x4cf53c(0x18b)]+_0x4da734);}return 0x0;}}export class PSRtConfigVersionCommand extends BaseCommand{[a31_0x278ad1(0x18b)]=a31_0x278ad1(0x280);[a31_0x278ad1(0x225)]=a31_0x278ad1(0x1f9);async[a31_0x278ad1(0x1e4)](_0x55e1ff){const _0x4532b5=a31_0x278ad1,{options:_0x401e39,args:_0x1763f3,tdx:_0x13ab66}=_0x55e1ff,_0xfde34b=_0x1763f3[0x0]||_0x401e39[_0x4532b5(0x174)];if(!_0xfde34b)return showParentSegmentNotSetError(_0x4532b5(0x2fe)+_0x4532b5(0x276)),0x1;_0x401e39[_0x4532b5(0x189)]&&(console[_0x4532b5(0x14b)](_0x4532b5(0x18d)+_0x401e39[_0x4532b5(0x28b)]),console[_0x4532b5(0x14b)](_0x4532b5(0x170)+_0xfde34b));const _0x267de0=await withSpinner(_0x4532b5(0x112)+_0xfde34b+_0x4532b5(0x2fa),()=>_0x13ab66[_0x4532b5(0x114)][_0x4532b5(0x222)](_0xfde34b),{'verbose':_0x401e39[_0x4532b5(0x189)]}),_0x37815e=_0x267de0[_0x4532b5(0x1d4)],_0x3181d6=await withSpinner(_0x4532b5(0x2af)+_0xfde34b+_0x4532b5(0x2fa),()=>_0x13ab66[_0x4532b5(0x1d7)][_0x4532b5(0x25e)](_0x37815e),{'verbose':_0x401e39['verbose']}),_0x27fc97=_0x3181d6[_0x4532b5(0x1d4)];return console[_0x4532b5(0x14b)](_0x4532b5(0x296)),_0x401e39[_0x4532b5(0x1fd)]===_0x4532b5(0x129)||_0x401e39['format']===_0x4532b5(0x215)?await handleSDKOutput([_0x27fc97],_0x401e39):(console[_0x4532b5(0x19a)]('id:\x20'+_0x27fc97['id']),console[_0x4532b5(0x19a)](_0x4532b5(0x203)+_0x27fc97[_0x4532b5(0x2f0)]),console[_0x4532b5(0x19a)]('identifier:\x20'+_0x27fc97[_0x4532b5(0x2e8)]),console[_0x4532b5(0x19a)](_0x4532b5(0x30b)+_0x27fc97[_0x4532b5(0x21d)]),console[_0x4532b5(0x19a)]('status:\x20'+_0x27fc97['status'])),0x0;}}export class PSPzServiceListCommand extends BaseCommand{['name']=a31_0x278ad1(0x1b1);[a31_0x278ad1(0x225)]=a31_0x278ad1(0x150);async[a31_0x278ad1(0x1e4)](_0x50df3f){const _0x766c53=a31_0x278ad1,{options:_0x11cee9,args:_0x4cc653,tdx:_0x4bc082}=_0x50df3f,_0x21f1fb=_0x4cc653[0x0]||_0x11cee9[_0x766c53(0x174)];if(!_0x21f1fb)return showParentSegmentNotSetError(_0x766c53(0x20e)+_0x766c53(0x2a5)),0x1;const _0x1fdb89=await withSpinner(_0x766c53(0x112)+_0x21f1fb+_0x766c53(0x2fa),()=>_0x4bc082[_0x766c53(0x114)]['resolveParentId'](_0x21f1fb),{'verbose':_0x11cee9[_0x766c53(0x189)]}),_0x4781e7=_0x1fdb89[_0x766c53(0x1d4)],_0x418a33=await withSpinner(_0x766c53(0xfe)+_0x21f1fb+_0x766c53(0x2fa),()=>_0x4bc082[_0x766c53(0x186)][_0x766c53(0x291)](_0x4781e7),{'verbose':_0x11cee9[_0x766c53(0x189)]}),_0x1320a5=_0x418a33[_0x766c53(0x1d4)];console[_0x766c53(0x14b)](_0x766c53(0x16a)+_0x1320a5['length']+_0x766c53(0x2fd)+(_0x1320a5[_0x766c53(0x19d)]!==0x1?'s':''));if(_0x11cee9[_0x766c53(0x1fd)]===_0x766c53(0x129)||_0x11cee9[_0x766c53(0x1fd)]===_0x766c53(0x215))await handleSDKOutput(_0x1320a5,_0x11cee9);else{if(_0x1320a5[_0x766c53(0x19d)]===0x0)console[_0x766c53(0x19a)](_0x766c53(0x27d)),console[_0x766c53(0x14b)](a31_0x2f8622['cyan'](_0x766c53(0x25b)));else for(const _0x51dd16 of _0x1320a5){console[_0x766c53(0x19a)](a31_0x2f8622[_0x766c53(0x1ad)](_0x51dd16[_0x766c53(0x18b)])+'\x20'+a31_0x2f8622[_0x766c53(0x2e9)](_0x766c53(0x2db)+_0x51dd16['id']+')'));_0x51dd16[_0x766c53(0x225)]&&console[_0x766c53(0x19a)]('\x20\x20'+a31_0x2f8622[_0x766c53(0x2e9)](_0x51dd16[_0x766c53(0x225)]));if(_0x51dd16[_0x766c53(0x1c2)]&&_0x51dd16[_0x766c53(0x1c2)]['length']>0x0)for(const _0x343d58 of _0x51dd16[_0x766c53(0x1c2)]){const _0x2e5380=_0x343d58['allowedIps']?.[_0x766c53(0x19d)]?_0x343d58[_0x766c53(0x167)]['join'](',\x20'):_0x766c53(0xfa);console['log']('\x20\x20'+a31_0x2f8622[_0x766c53(0x248)](_0x766c53(0x241))+'\x20'+_0x343d58[_0x766c53(0x18b)]+'\x20'+a31_0x2f8622['dim'](_0x766c53(0x2db)+_0x343d58['id']+')')),console[_0x766c53(0x19a)](_0x766c53(0x1d8)+a31_0x2f8622['dim']('allowed\x20IPs:')+'\x20'+_0x2e5380);}else console[_0x766c53(0x19a)]('\x20\x20'+a31_0x2f8622[_0x766c53(0x2e9)]('no\x20tokens\x20configured'));}}return 0x0;}}export class PSPzServiceCreateCommand extends BaseCommand{['name']=a31_0x278ad1(0x151);[a31_0x278ad1(0x225)]=a31_0x278ad1(0x1bc);async[a31_0x278ad1(0x1e4)](_0x17e473){const _0x34eb9d=a31_0x278ad1,{options:_0x2fe6ee,args:_0x18db38,tdx:_0x1992a2}=_0x17e473,_0x4fa7ca=_0x2fe6ee,_0x42d14a=_0x18db38[0x0],_0x2fad24=_0x18db38[0x1]||_0x2fe6ee[_0x34eb9d(0x174)];if(!_0x42d14a)return console['error'](_0x34eb9d(0x1de)),console[_0x34eb9d(0x14b)](_0x34eb9d(0x20a)),console['error'](_0x34eb9d(0x2a6)),0x1;if(!_0x2fad24)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]\x0a'+_0x34eb9d(0x2a6)),0x1;const _0x327702=await withSpinner(_0x34eb9d(0x112)+_0x2fad24+_0x34eb9d(0x2fa),()=>_0x1992a2[_0x34eb9d(0x114)]['resolveParentId'](_0x2fad24),{'verbose':_0x2fe6ee[_0x34eb9d(0x189)]}),_0x27a325=_0x327702[_0x34eb9d(0x1d4)],_0x11aa7f={'name':_0x42d14a,'description':_0x4fa7ca[_0x34eb9d(0x225)],'public':_0x4fa7ca[_0x34eb9d(0x22d)]},_0x118a83=await withSpinner(_0x34eb9d(0x25d)+_0x42d14a+'\x27...',()=>_0x1992a2[_0x34eb9d(0x186)][_0x34eb9d(0x181)](_0x27a325,_0x11aa7f),{'verbose':_0x2fe6ee[_0x34eb9d(0x189)]}),_0xf81e91=_0x118a83[_0x34eb9d(0x1d4)];return console[_0x34eb9d(0x14b)](_0x34eb9d(0x252)+_0xf81e91[_0x34eb9d(0x18b)]+_0x34eb9d(0x22b)+_0xf81e91['id']),await handleSDKOutput([_0xf81e91],_0x2fe6ee),0x0;}}export class PSPzServiceShowCommand extends BaseCommand{[a31_0x278ad1(0x18b)]='ps:pz:service:show';['description']=a31_0x278ad1(0x115);async['execute'](_0x663417){const _0x5bf311=a31_0x278ad1,{options:_0x3f5dc0,args:_0x2a33c4,tdx:_0x170bd4}=_0x663417,_0x52bba5=_0x2a33c4[0x0],_0x3c71f6=_0x2a33c4[0x1]||_0x3f5dc0[_0x5bf311(0x174)];if(!_0x52bba5)return console[_0x5bf311(0x14b)](_0x5bf311(0x12d)),console[_0x5bf311(0x14b)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]'),console[_0x5bf311(0x14b)](_0x5bf311(0x1d9)),0x1;if(!_0x3c71f6)return showParentSegmentNotSetError(_0x5bf311(0x157)+_0x5bf311(0x1d9)),0x1;const _0x73fe3c=await withSpinner(_0x5bf311(0x112)+_0x3c71f6+_0x5bf311(0x2fa),()=>_0x170bd4[_0x5bf311(0x114)]['resolveParentId'](_0x3c71f6),{'verbose':_0x3f5dc0['verbose']}),_0x1354e2=_0x73fe3c[_0x5bf311(0x1d4)],_0x420ed6=await withSpinner(_0x5bf311(0x10c)+_0x52bba5+_0x5bf311(0x2fa),()=>_0x170bd4[_0x5bf311(0x186)]['get'](_0x1354e2,_0x52bba5),{'verbose':_0x3f5dc0[_0x5bf311(0x189)]}),_0x1d8534=_0x420ed6[_0x5bf311(0x1d4)];if(_0x3f5dc0[_0x5bf311(0x129)]||_0x3f5dc0['jsonl'])await handleSDKOutput([_0x1d8534],_0x3f5dc0);else{console[_0x5bf311(0x19a)](a31_0x2f8622['bold'](_0x1d8534[_0x5bf311(0x18b)])+'\x20'+a31_0x2f8622['dim'](_0x5bf311(0x2db)+_0x1d8534['id']+')'));_0x1d8534[_0x5bf311(0x225)]&&console[_0x5bf311(0x19a)]('\x20\x20'+a31_0x2f8622[_0x5bf311(0x2e9)](_0x1d8534['description']));console[_0x5bf311(0x19a)]('\x20\x20'+a31_0x2f8622[_0x5bf311(0x248)](_0x5bf311(0x268))+'\x20'+(_0x1d8534['public']?_0x5bf311(0x26e):'no'));if(_0x1d8534['tokens']&&_0x1d8534[_0x5bf311(0x1c2)][_0x5bf311(0x19d)]>0x0)for(const _0x368743 of _0x1d8534[_0x5bf311(0x1c2)]){const _0x3cdbd0=_0x368743[_0x5bf311(0x167)]?.[_0x5bf311(0x19d)]?_0x368743[_0x5bf311(0x167)][_0x5bf311(0x2df)](',\x20'):_0x5bf311(0xfa);console[_0x5bf311(0x19a)]('\x20\x20'+a31_0x2f8622[_0x5bf311(0x248)]('token:')+'\x20'+_0x368743[_0x5bf311(0x18b)]+'\x20'+a31_0x2f8622[_0x5bf311(0x2e9)](_0x5bf311(0x2db)+_0x368743['id']+')')),console[_0x5bf311(0x19a)](_0x5bf311(0x1d8)+a31_0x2f8622[_0x5bf311(0x2e9)](_0x5bf311(0x309))+'\x20'+_0x3cdbd0);}else console[_0x5bf311(0x19a)]('\x20\x20'+a31_0x2f8622[_0x5bf311(0x2e9)](_0x5bf311(0x229)));}return 0x0;}}export class PSPzServiceDeleteCommand extends BaseCommand{[a31_0x278ad1(0x18b)]=a31_0x278ad1(0x2b4);[a31_0x278ad1(0x225)]=a31_0x278ad1(0x1f7);async[a31_0x278ad1(0x1e4)](_0x1509af){const _0x4f964f=a31_0x278ad1,{options:_0x3bc144,args:_0x66b9f8,tdx:_0x38f648}=_0x1509af,_0x295849=_0x66b9f8[0x0],_0x1b4a77=_0x66b9f8[0x1]||_0x3bc144[_0x4f964f(0x174)];if(!_0x295849)return console[_0x4f964f(0x14b)](_0x4f964f(0x12d)),console[_0x4f964f(0x14b)](_0x4f964f(0x1da)),console['error'](_0x4f964f(0x2eb)),0x1;if(!_0x1b4a77)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]\x0a'+_0x4f964f(0x2eb)),0x1;const _0x2e2e8c=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x1b4a77+_0x4f964f(0x2fa),()=>_0x38f648['segment'][_0x4f964f(0x222)](_0x1b4a77),{'verbose':_0x3bc144[_0x4f964f(0x189)]}),_0x439245=_0x2e2e8c[_0x4f964f(0x1d4)];return await withSpinner(_0x4f964f(0x169)+_0x295849+_0x4f964f(0x2fa),()=>_0x38f648['personalization'][_0x4f964f(0x2ce)](_0x439245,_0x295849),{'verbose':_0x3bc144[_0x4f964f(0x189)]}),console[_0x4f964f(0x14b)]('✔\x20Deleted\x20personalization\x20service\x20\x27'+_0x295849+'\x27'),0x0;}}export class PSPzServiceUpdateCommand extends BaseCommand{[a31_0x278ad1(0x18b)]='ps:pz:service:update';[a31_0x278ad1(0x225)]=a31_0x278ad1(0x22a);async['execute'](_0x10fddd){const _0x3ffb5c=a31_0x278ad1,{options:_0x148ea7,args:_0x42bb9e,tdx:_0x31282d}=_0x10fddd,_0x3ba513=_0x148ea7,_0x5c5495=_0x42bb9e[0x0],_0x5ee2b9=_0x42bb9e[0x1]||_0x148ea7['parentSegment'];if(!_0x5c5495)return console[_0x3ffb5c(0x14b)]('Error:\x20Service\x20ID\x20is\x20required'),console[_0x3ffb5c(0x14b)](_0x3ffb5c(0x27f)),console[_0x3ffb5c(0x14b)](_0x3ffb5c(0x2a4)),0x1;if(!_0x3ba513[_0x3ffb5c(0x18b)])return console['error'](_0x3ffb5c(0x2da)),console[_0x3ffb5c(0x14b)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]'),0x1;if(!_0x5ee2b9)return showParentSegmentNotSetError(_0x3ffb5c(0x2ee)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context'),0x1;const _0x212ede=await withSpinner(_0x3ffb5c(0x112)+_0x5ee2b9+_0x3ffb5c(0x2fa),()=>_0x31282d[_0x3ffb5c(0x114)][_0x3ffb5c(0x222)](_0x5ee2b9),{'verbose':_0x148ea7[_0x3ffb5c(0x189)]}),_0x46c16d=_0x212ede['data'],_0x11f06b={'name':_0x3ba513[_0x3ffb5c(0x18b)]};_0x3ba513[_0x3ffb5c(0x225)]!==undefined&&(_0x11f06b[_0x3ffb5c(0x225)]=_0x3ba513['description']);const _0x32d4a3=await withSpinner(_0x3ffb5c(0x2ec)+_0x5c5495+_0x3ffb5c(0x2fa),()=>_0x31282d[_0x3ffb5c(0x186)]['patch'](_0x46c16d,_0x5c5495,_0x11f06b),{'verbose':_0x148ea7[_0x3ffb5c(0x189)]}),_0xbd20f4=_0x32d4a3['data'];return console[_0x3ffb5c(0x14b)](_0x3ffb5c(0x2d4)+_0xbd20f4[_0x3ffb5c(0x18b)]+'\x27'),await handleSDKOutput([_0xbd20f4],_0x148ea7),0x0;}}export class PSPzServiceTokenCreateCommand extends BaseCommand{['name']=a31_0x278ad1(0x10d);[a31_0x278ad1(0x225)]='Create\x20a\x20token\x20for\x20a\x20personalization\x20service';async[a31_0x278ad1(0x1e4)](_0x578b68){const _0x286ef7=a31_0x278ad1,{options:_0x1e3559,args:_0x2837d6,tdx:_0x5ba881}=_0x578b68,_0x1885c7=_0x1e3559,_0xd69d3a=_0x2837d6[0x0],_0x2a1310=_0x2837d6[0x1],_0x21bdcf=_0x2837d6[0x2]||_0x1e3559['parentSegment'];if(!_0xd69d3a)return console[_0x286ef7(0x14b)]('Error:\x20Token\x20name\x20is\x20required'),console[_0x286ef7(0x14b)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]'),console[_0x286ef7(0x14b)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x2a1310)return console[_0x286ef7(0x14b)](_0x286ef7(0x12d)),console[_0x286ef7(0x14b)](_0x286ef7(0x183)),console[_0x286ef7(0x14b)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x21bdcf)return showParentSegmentNotSetError(_0x286ef7(0x1e6)+_0x286ef7(0x1a6)),0x1;const _0x330a3a=await withSpinner(_0x286ef7(0x112)+_0x21bdcf+_0x286ef7(0x2fa),()=>_0x5ba881[_0x286ef7(0x114)][_0x286ef7(0x222)](_0x21bdcf),{'verbose':_0x1e3559['verbose']}),_0x1757ef=_0x330a3a[_0x286ef7(0x1d4)],_0x56f056={'name':_0xd69d3a};_0x1885c7[_0x286ef7(0x167)]&&(_0x56f056[_0x286ef7(0x167)]=_0x1885c7[_0x286ef7(0x167)][_0x286ef7(0x24a)](',')['map'](_0x5aa048=>_0x5aa048[_0x286ef7(0x1b8)]()));_0x1885c7[_0x286ef7(0x225)]&&(_0x56f056[_0x286ef7(0x225)]=_0x1885c7[_0x286ef7(0x225)]);const _0x3e8706=await withSpinner(_0x286ef7(0x137)+_0xd69d3a+'\x27\x20for\x20service\x20\x27'+_0x2a1310+_0x286ef7(0x2fa),()=>_0x5ba881[_0x286ef7(0x186)]['createToken'](_0x1757ef,_0x2a1310,_0x56f056),{'verbose':_0x1e3559[_0x286ef7(0x189)]}),_0x404e47=_0x3e8706[_0x286ef7(0x1d4)];return console[_0x286ef7(0x14b)](_0x286ef7(0x1ee)+_0x404e47['name']+_0x286ef7(0x22b)+_0x404e47['id']),_0x404e47[_0x286ef7(0x132)]&&(console[_0x286ef7(0x14b)](a31_0x2f8622['yellow'](_0x286ef7(0x198))),console[_0x286ef7(0x14b)](a31_0x2f8622[_0x286ef7(0x248)](_0x404e47[_0x286ef7(0x132)])),console['error']('')),await handleSDKOutput([_0x404e47],_0x1e3559),0x0;}}export class PSPzServiceTokenDeleteCommand extends BaseCommand{['name']=a31_0x278ad1(0x2fc);[a31_0x278ad1(0x225)]='Delete\x20a\x20token\x20from\x20a\x20personalization\x20service';async['execute'](_0x3b177f){const _0x3639ce=a31_0x278ad1,{options:_0x2241ad,args:_0x40f0fc,tdx:_0x50d788}=_0x3b177f,_0x1cb01a=_0x40f0fc[0x0],_0x382d2a=_0x40f0fc[0x1]||_0x2241ad[_0x3639ce(0x174)];if(!_0x1cb01a)return console['error'](_0x3639ce(0x133)),console[_0x3639ce(0x14b)](_0x3639ce(0x275)),console[_0x3639ce(0x14b)](_0x3639ce(0x2bf)),0x1;if(!_0x382d2a)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]\x0a'+_0x3639ce(0x2bf)),0x1;const _0x5bd23d=await withSpinner(_0x3639ce(0x112)+_0x382d2a+_0x3639ce(0x2fa),()=>_0x50d788[_0x3639ce(0x114)]['resolveParentId'](_0x382d2a),{'verbose':_0x2241ad[_0x3639ce(0x189)]}),_0x2f77e4=_0x5bd23d['data'],_0x12589b=await withSpinner('Finding\x20service\x20for\x20token...',()=>_0x50d788[_0x3639ce(0x186)][_0x3639ce(0x291)](_0x2f77e4),{'verbose':_0x2241ad[_0x3639ce(0x189)]}),_0x12f5e9=_0x12589b[_0x3639ce(0x1d4)];let _0x328a08;for(const _0x267782 of _0x12f5e9){if(_0x267782['tokens']?.[_0x3639ce(0x2d7)](_0x4dddcb=>_0x4dddcb['id']===_0x1cb01a)){_0x328a08=_0x267782['id'];break;}}if(!_0x328a08)return console[_0x3639ce(0x14b)]('Error:\x20Token\x20\x27'+_0x1cb01a+_0x3639ce(0x226)),0x1;const _0x472c01=await withSpinner(_0x3639ce(0x18a)+_0x1cb01a+'\x27...',()=>_0x50d788[_0x3639ce(0x186)]['deleteToken'](_0x2f77e4,_0x328a08,_0x1cb01a),{'verbose':_0x2241ad[_0x3639ce(0x189)]}),_0xdfab11=_0x472c01[_0x3639ce(0x1d4)];return console['error']('✔\x20Deleted\x20token\x20\x27'+(_0xdfab11[_0x3639ce(0x18b)]||_0x1cb01a)+'\x27'),await handleSDKOutput([_0xdfab11],_0x2241ad),0x0;}}export class PSPzListCommand extends BaseCommand{[a31_0x278ad1(0x18b)]=a31_0x278ad1(0x178);[a31_0x278ad1(0x225)]=a31_0x278ad1(0x1b3);async['execute'](_0x32bf84){const _0x55be98=a31_0x278ad1,{options:_0x4b1c2b,args:_0x3e0801,tdx:_0xc5af35}=_0x32bf84,_0x2b6cde=_0x3e0801[0x0]||_0x4b1c2b[_0x55be98(0x174)];if(!_0x2b6cde)return showParentSegmentNotSetError(_0x55be98(0x2a0)+_0x55be98(0x26a)),0x1;const _0x128703=await withSpinner(_0x55be98(0x112)+_0x2b6cde+'\x27...',()=>_0xc5af35[_0x55be98(0x114)][_0x55be98(0x222)](_0x2b6cde),{'verbose':_0x4b1c2b[_0x55be98(0x189)]}),_0x2554fc=_0x128703[_0x55be98(0x1d4)],_0x4c0061=await withSpinner(_0x55be98(0x12e)+_0x2b6cde+_0x55be98(0x2fa),()=>_0xc5af35[_0x55be98(0x186)][_0x55be98(0x13d)](_0x2554fc),{'verbose':_0x4b1c2b['verbose']}),_0x217004=_0x4c0061[_0x55be98(0x1d4)];console[_0x55be98(0x14b)](_0x55be98(0x16a)+_0x217004[_0x55be98(0x19d)]+_0x55be98(0x299)+(_0x217004[_0x55be98(0x19d)]!==0x1?'s':''));if(_0x4b1c2b[_0x55be98(0x1fd)]===_0x55be98(0x129)||_0x4b1c2b[_0x55be98(0x1fd)]==='jsonl')await handleSDKOutput(_0x217004,_0x4b1c2b);else{if(_0x217004[_0x55be98(0x19d)]===0x0)console['log']('No\x20personalizations\x20configured');else for(const _0x1b3f64 of _0x217004){console[_0x55be98(0x19a)](a31_0x2f8622[_0x55be98(0x1ad)](_0x1b3f64[_0x55be98(0x18b)])+'\x20'+a31_0x2f8622[_0x55be98(0x2e9)](_0x55be98(0x2db)+_0x1b3f64['id']+')'));_0x1b3f64[_0x55be98(0x225)]&&console['log']('\x20\x20'+a31_0x2f8622['dim'](_0x1b3f64['description']));const _0x36af72=_0x1b3f64[_0x55be98(0x17b)]?.[_0x55be98(0x19d)]||0x0;console[_0x55be98(0x19a)]('\x20\x20'+a31_0x2f8622[_0x55be98(0x248)](_0x55be98(0x18c))+'\x20'+_0x36af72);if(_0x1b3f64[_0x55be98(0x17b)]&&_0x1b3f64[_0x55be98(0x17b)][_0x55be98(0x19d)]>0x0)for(const _0x1d9ccb of _0x1b3f64['sections']){console[_0x55be98(0x19a)](_0x55be98(0x1d2)+_0x1d9ccb[_0x55be98(0x18b)]);}}}return 0x0;}}export class PSPzShowCommand extends BaseCommand{[a31_0x278ad1(0x18b)]=a31_0x278ad1(0x247);[a31_0x278ad1(0x225)]=a31_0x278ad1(0x255);async[a31_0x278ad1(0x1e4)](_0x19ca83){const _0x1a7027=a31_0x278ad1,{options:_0x5924f8,args:_0x2da00d,tdx:_0x1c8bb2}=_0x19ca83,_0x22468a=_0x2da00d[0x0];if(!_0x22468a)return console[_0x1a7027(0x14b)](_0x1a7027(0x22e)),console[_0x1a7027(0x14b)](_0x1a7027(0x1e5)),0x1;const _0x1be502=await withSpinner('Getting\x20personalization\x20\x27'+_0x22468a+_0x1a7027(0x2fa),()=>_0x1c8bb2[_0x1a7027(0x186)]['getPersonalization'](_0x22468a),{'verbose':_0x5924f8['verbose']}),_0xbda48f=_0x1be502[_0x1a7027(0x1d4)];console[_0x1a7027(0x14b)](_0x1a7027(0x156)+_0xbda48f['name']+'\x27');if(_0x5924f8[_0x1a7027(0x1fd)]===_0x1a7027(0x129)||_0x5924f8[_0x1a7027(0x1fd)]==='jsonl')await handleSDKOutput([_0xbda48f],_0x5924f8);else{console['log'](a31_0x2f8622[_0x1a7027(0x1ad)](_0xbda48f['name'])+'\x20'+a31_0x2f8622[_0x1a7027(0x2e9)](_0x1a7027(0x2db)+_0xbda48f['id']+')'));_0xbda48f['description']&&console[_0x1a7027(0x19a)]('\x20\x20'+a31_0x2f8622[_0x1a7027(0x2e9)](_0xbda48f[_0x1a7027(0x225)]));_0xbda48f[_0x1a7027(0x2f0)]&&console[_0x1a7027(0x19a)]('\x20\x20'+a31_0x2f8622[_0x1a7027(0x248)](_0x1a7027(0x250))+'\x20'+_0xbda48f['audienceId']);console[_0x1a7027(0x19a)]('\x20\x20'+a31_0x2f8622[_0x1a7027(0x248)](_0x1a7027(0x15a))+'\x20'+_0xbda48f[_0x1a7027(0x1c6)]),console[_0x1a7027(0x19a)]('\x20\x20'+a31_0x2f8622['cyan'](_0x1a7027(0x1a2))+'\x20'+_0xbda48f[_0x1a7027(0x2f9)]);const _0x4105e7=_0xbda48f[_0x1a7027(0x17b)]?.[_0x1a7027(0x19d)]||0x0;console[_0x1a7027(0x19a)]('\x20\x20'+a31_0x2f8622['cyan'](_0x1a7027(0x18c))+'\x20'+_0x4105e7);if(_0xbda48f[_0x1a7027(0x17b)]&&_0xbda48f[_0x1a7027(0x17b)]['length']>0x0)for(const _0x9ca2f5 of _0xbda48f[_0x1a7027(0x17b)]){console[_0x1a7027(0x19a)](_0x1a7027(0x1d8)+a31_0x2f8622[_0x1a7027(0x1ad)](_0x9ca2f5[_0x1a7027(0x18b)])+'\x20'+a31_0x2f8622['dim'](_0x1a7027(0x2db)+_0x9ca2f5['id']+')')),_0x9ca2f5[_0x1a7027(0x2c6)]&&(console['log']('\x20\x20\x20\x20\x20\x20'+a31_0x2f8622['cyan'](_0x1a7027(0x2c1))+'\x20'+_0x9ca2f5[_0x1a7027(0x2c6)][_0x1a7027(0x18b)]),_0x9ca2f5[_0x1a7027(0x2c6)][_0x1a7027(0x28f)]?.['keyEventId']&&console[_0x1a7027(0x19a)](_0x1a7027(0x102)+a31_0x2f8622[_0x1a7027(0x248)](_0x1a7027(0x134))+'\x20'+_0x9ca2f5['entryCriteria'][_0x1a7027(0x28f)][_0x1a7027(0x217)])),_0x9ca2f5[_0x1a7027(0x30a)]&&console[_0x1a7027(0x19a)](_0x1a7027(0x1d3)+a31_0x2f8622[_0x1a7027(0x248)](_0x1a7027(0x1d6))+'\x20'+JSON['stringify'](_0x9ca2f5[_0x1a7027(0x30a)])),_0x9ca2f5['includeSensitive']&&console[_0x1a7027(0x19a)](_0x1a7027(0x1d3)+a31_0x2f8622[_0x1a7027(0x248)](_0x1a7027(0x2a7))+'\x20true');}}return 0x0;}}export class PSPzDeleteCommand extends BaseCommand{[a31_0x278ad1(0x18b)]=a31_0x278ad1(0x163);[a31_0x278ad1(0x225)]=a31_0x278ad1(0x1be);async[a31_0x278ad1(0x1e4)](_0x139c44){const _0x1d8df8=a31_0x278ad1,{options:_0x5541fc,args:_0x962600,tdx:_0x403859}=_0x139c44,_0x270a6b=_0x962600[0x0];if(!_0x270a6b)return console[_0x1d8df8(0x14b)]('Error:\x20Personalization\x20ID\x20is\x20required'),console['error']('Usage:\x20tdx\x20ps\x20pz\x20delete\x20<personalization_id>'),0x1;return await withSpinner(_0x1d8df8(0x165)+_0x270a6b+_0x1d8df8(0x2fa),()=>_0x403859[_0x1d8df8(0x186)][_0x1d8df8(0x19b)](_0x270a6b),{'verbose':_0x5541fc[_0x1d8df8(0x189)]}),console[_0x1d8df8(0x14b)]('✔\x20Deleted\x20personalization\x20\x27'+_0x270a6b+'\x27'),0x0;}}export class PSPzCreateCommand extends BaseCommand{[a31_0x278ad1(0x18b)]=a31_0x278ad1(0x260);[a31_0x278ad1(0x225)]=a31_0x278ad1(0x1ea);async['execute'](_0x2a9408){const _0xd93858=a31_0x278ad1,{options:_0x4c887f,tdx:_0x49f9aa}=_0x2a9408,_0x1213e9=_0x4c887f;let _0x502a71;if(_0x1213e9[_0xd93858(0x16f)]){_0x502a71=await loadJSON(_0x1213e9[_0xd93858(0x16f)],!![]);if(!_0x502a71[_0xd93858(0x28a)]?.['parentFolder'])return console[_0xd93858(0x14b)]('Error:\x20\x22relationships.parentFolder\x22\x20is\x20required\x20in\x20the\x20JSON\x20file.'),console[_0xd93858(0x14b)](_0xd93858(0x223)),console['error'](_0xd93858(0x1a5)),0x1;}else{if(!_0x1213e9['name'])return console[_0xd93858(0x14b)]('Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)'),console[_0xd93858(0x14b)](_0xd93858(0x10f)),console[_0xd93858(0x14b)](_0xd93858(0x2a8)),0x1;if(_0x1213e9['description']===undefined)return console[_0xd93858(0x14b)](_0xd93858(0x306)),console[_0xd93858(0x14b)](_0xd93858(0x10f)),console[_0xd93858(0x14b)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>'),0x1;if(_0x1213e9[_0xd93858(0x266)]===undefined)return console[_0xd93858(0x14b)](_0xd93858(0x168)),console['error']('\x20\x20\x20\x20\x20\x20\x20Pass\x20null\x20to\x20place\x20in\x20the\x20root\x20folder.'),0x1;let _0x3ca43c=_0x1213e9[_0xd93858(0x2f0)];if(!_0x3ca43c&&_0x4c887f[_0xd93858(0x174)]){const _0x5df37e=await withSpinner(_0xd93858(0x112)+_0x4c887f['parentSegment']+_0xd93858(0x2fa),()=>_0x49f9aa[_0xd93858(0x114)][_0xd93858(0x222)](_0x4c887f[_0xd93858(0x174)]),{'verbose':_0x4c887f[_0xd93858(0x189)]});_0x3ca43c=_0x5df37e['data'];}let _0xa35d52;_0x1213e9[_0xd93858(0x17b)]&&(_0xa35d52=await loadJSON(_0x1213e9[_0xd93858(0x17b)],![]));const _0x11c8b5=_0x1213e9[_0xd93858(0x266)]===_0xd93858(0x272)?null:{'id':_0x1213e9[_0xd93858(0x266)],'type':_0xd93858(0x141)};_0x502a71={'attributes':{'name':_0x1213e9[_0xd93858(0x18b)],'description':_0x1213e9[_0xd93858(0x225)]||null,..._0x3ca43c!==undefined&&{'audienceId':_0x3ca43c},..._0xa35d52!==undefined&&{'sections':_0xa35d52}},'relationships':{'parentFolder':{'data':_0x11c8b5}}};}const _0x451571=await withSpinner(_0xd93858(0x2d9)+(_0x502a71[_0xd93858(0x16e)]?.['name']??'')+_0xd93858(0x2fa),()=>_0x49f9aa[_0xd93858(0x186)]['createPersonalization'](_0x502a71),{'verbose':_0x4c887f['verbose']}),_0x9797df=_0x451571[_0xd93858(0x1d4)];return console[_0xd93858(0x14b)](_0xd93858(0x2f3)+_0x9797df[_0xd93858(0x18b)]+_0xd93858(0x22b)+_0x9797df['id']),await handleSDKOutput([_0x9797df],_0x4c887f),0x0;}}export class PSPzPatchCommand extends BaseCommand{[a31_0x278ad1(0x18b)]='ps:pz:patch';['description']=a31_0x278ad1(0x130);async[a31_0x278ad1(0x1e4)](_0x3cb35a){const _0xd12332=a31_0x278ad1,{options:_0x3b20c1,args:_0x3fca34}=_0x3cb35a,_0x313305=_0x3b20c1,_0x231821=_0x3fca34[0x0];if(!_0x231821)return console[_0xd12332(0x14b)](_0xd12332(0x22e)),console['error'](_0xd12332(0x143)),console['error'](_0xd12332(0x2b6)),0x1;let _0xc82411;if(_0x313305[_0xd12332(0x16f)])_0xc82411=await loadJSON(_0x313305[_0xd12332(0x16f)],!![]);else{if(!_0x313305[_0xd12332(0x18b)])return console['error']('Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)'),console['error'](_0xd12332(0x143)),0x1;if(_0x313305[_0xd12332(0x225)]===undefined)return console[_0xd12332(0x14b)](_0xd12332(0x306)),console[_0xd12332(0x14b)](_0xd12332(0x143)),0x1;let _0x1399fe;_0x313305['sections']&&(_0x1399fe=await loadJSON(_0x313305[_0xd12332(0x17b)],![])),_0xc82411={'attributes':{'name':_0x313305['name'],'description':_0x313305[_0xd12332(0x225)]||null,..._0x1399fe!==undefined&&{'sections':_0x1399fe}}};}const {tdx:_0x52174a}=_0x3cb35a,_0x40a84f=await withSpinner(_0xd12332(0x1fe)+_0x231821+'\x27...',()=>_0x52174a[_0xd12332(0x186)][_0xd12332(0x118)](_0x231821,_0xc82411),{'verbose':_0x3b20c1[_0xd12332(0x189)]}),_0x1ca186=_0x40a84f[_0xd12332(0x1d4)];return console[_0xd12332(0x14b)]('✔\x20Updated\x20personalization\x20\x27'+_0x1ca186[_0xd12332(0x18b)]+_0xd12332(0x264)+_0x1ca186['id']+')'),await handleSDKOutput([_0x1ca186],_0x3b20c1),0x0;}}function a31_0x4d90(_0x48cfe6,_0x5d8a31){_0x48cfe6=_0x48cfe6-0xf8;const _0x447c9c=a31_0x447c();let _0x4d90f9=_0x447c9c[_0x48cfe6];return _0x4d90f9;}export class PSPzInitCommand extends BaseParentSegmentCommand{[a31_0x278ad1(0x18b)]='ps:pz:init';[a31_0x278ad1(0x225)]='Add\x20template\x20personalization\x20section\x20to\x20parent\x20segment\x20YAML';async[a31_0x278ad1(0x1e4)](_0x5c5cc0){const _0x5bfe6b=a31_0x278ad1,{options:_0x1ddf62,args:_0x1c044f}=_0x5c5cc0,_0x133b10=_0x1c044f[0x0]||_0x1ddf62[_0x5bfe6b(0x174)];if(!_0x133b10)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20init\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Add\x20PZ\x20template\x20(requires\x20context)\x0a'+_0x5bfe6b(0x105)),0x1;const _0x51523a=resolveYamlFile(_0x133b10);if(!existsSync(_0x51523a))return showFileNotFoundError(_0x51523a,_0x133b10),0x1;let _0x2315fa;try{_0x2315fa=readFileSync(_0x51523a,'utf-8');}catch(_0x2b61d9){const _0x5e4d96=_0x2b61d9 instanceof Error?_0x2b61d9['message']:String(_0x2b61d9);return console[_0x5bfe6b(0x14b)](_0x5bfe6b(0x30f)+_0x5e4d96),0x1;}let _0x23e97d;try{_0x23e97d=parseDef(_0x2315fa);}catch(_0x293832){const _0x3bb44f=_0x293832 instanceof Error?_0x293832[_0x5bfe6b(0x23f)]:String(_0x293832);return console[_0x5bfe6b(0x14b)](a31_0x2f8622[_0x5bfe6b(0x179)]('Error\x20parsing\x20YAML:\x20'+_0x3bb44f)),0x1;}if(_0x23e97d[_0x5bfe6b(0x18f)]&&_0x23e97d[_0x5bfe6b(0x18f)][_0x5bfe6b(0x19d)]>0x0)return console[_0x5bfe6b(0x14b)](a31_0x2f8622[_0x5bfe6b(0x1c7)]('⚠️\x20\x20personalization_services\x20section\x20already\x20exists\x20in\x20'+_0x51523a)),console[_0x5bfe6b(0x14b)](a31_0x2f8622[_0x5bfe6b(0x2e9)](_0x5bfe6b(0x17e)+_0x23e97d[_0x5bfe6b(0x18f)]['length']+_0x5bfe6b(0x253))),0x1;!_0x23e97d[_0x5bfe6b(0x1d7)]&&(_0x23e97d[_0x5bfe6b(0x1d7)]={'events':[{'name':_0x5bfe6b(0x2f7),'source_table':'<database>.<table>'}],'attributes':[{'name':'last_page_viewed','type':_0x5bfe6b(0x28e)}],'id_stitching':{'primary_key':_0x23e97d[_0x5bfe6b(0x214)][_0x5bfe6b(0x107)]===_0x5bfe6b(0x1ff)?_0x5bfe6b(0x2e0):_0x5bfe6b(0x2cf)}});_0x23e97d[_0x5bfe6b(0x18f)]=[{'name':'My\x20Service','description':_0x5bfe6b(0x295),'trigger_event':_0x5bfe6b(0x2f7),'sections':[{'name':'Default','criteria':'true','attributes':[_0x5bfe6b(0x23b)]}]}];const _0x2cad04=serializeDef(_0x23e97d);return writeFileSync(_0x51523a,_0x2cad04,_0x5bfe6b(0x24f)),console[_0x5bfe6b(0x14b)](a31_0x2f8622[_0x5bfe6b(0x1ed)]('✔')+_0x5bfe6b(0x140)+a31_0x2f8622['cyan'](_0x51523a)),(!_0x23e97d['realtime']||_0x2315fa[_0x5bfe6b(0x1f5)](_0x5bfe6b(0x122))===-0x1)&&console['error'](a31_0x2f8622['green']('✔')+_0x5bfe6b(0x117)),console[_0x5bfe6b(0x14b)]('\x0a'+a31_0x2f8622[_0x5bfe6b(0x2e9)](_0x5bfe6b(0x1a9))),console[_0x5bfe6b(0x14b)]('\x20\x201.\x20Edit\x20'+_0x51523a+_0x5bfe6b(0x227)),console[_0x5bfe6b(0x14b)](_0x5bfe6b(0x2f4)+a31_0x2f8622[_0x5bfe6b(0x2e9)](_0x5bfe6b(0x191)+_0x133b10)+_0x5bfe6b(0x292)),0x0;}}