@treasuredata/tdx 2026.4.15 → 2026.4.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (220) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/cas-command.js +1 -1
  11. package/dist/commands/cas-segment-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/claude-statusline-command.js +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/connection-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/delivery-command.js +1 -1
  20. package/dist/commands/describe.js +1 -1
  21. package/dist/commands/engage-campaign-pull-command.js +1 -1
  22. package/dist/commands/engage-campaign-push-command.js +1 -1
  23. package/dist/commands/engage-campaign-validate-command.js +1 -1
  24. package/dist/commands/engage-command.js +1 -1
  25. package/dist/commands/engage-template-pull-command.js +1 -1
  26. package/dist/commands/engage-template-push-command.js +1 -1
  27. package/dist/commands/engage-template-validate-command.js +1 -1
  28. package/dist/commands/job-command.js +1 -1
  29. package/dist/commands/journey-command.js +1 -1
  30. package/dist/commands/journey-validate-command.js +1 -1
  31. package/dist/commands/llm-command.js +1 -1
  32. package/dist/commands/mcp-command.js +1 -1
  33. package/dist/commands/parent-segment-command.js +1 -1
  34. package/dist/commands/policy-command.js +1 -1
  35. package/dist/commands/profile-command.js +1 -1
  36. package/dist/commands/profiles-command.js +1 -1
  37. package/dist/commands/query-command.js +1 -1
  38. package/dist/commands/schedule-command.js +1 -1
  39. package/dist/commands/segment-command.js +1 -1
  40. package/dist/commands/segment-create-command.js +1 -1
  41. package/dist/commands/segment-fields-command.js +1 -1
  42. package/dist/commands/segment-pull-command.js +1 -1
  43. package/dist/commands/segment-push-command.js +1 -1
  44. package/dist/commands/segment-update-command.js +1 -1
  45. package/dist/commands/segment-use-command.js +1 -1
  46. package/dist/commands/segment-validate-command.js +1 -1
  47. package/dist/commands/segments.js +1 -1
  48. package/dist/commands/show.js +1 -1
  49. package/dist/commands/status-command.js +1 -1
  50. package/dist/commands/tables.js +1 -1
  51. package/dist/commands/unset-command.js +1 -1
  52. package/dist/commands/upgrade-command.js +1 -1
  53. package/dist/commands/use-command.js +1 -1
  54. package/dist/commands/user-command.js +1 -1
  55. package/dist/commands/work-command.js +1 -1
  56. package/dist/commands/workflow-command.js +1 -1
  57. package/dist/core/auth.js +1 -1
  58. package/dist/core/command-output.js +1 -1
  59. package/dist/core/config.js +1 -1
  60. package/dist/core/connection-cache.js +1 -1
  61. package/dist/core/constants.js +1 -1
  62. package/dist/core/credential-cache.js +1 -1
  63. package/dist/core/global-context.js +1 -1
  64. package/dist/core/keychain.js +1 -1
  65. package/dist/core/oauth-keychain.js +1 -1
  66. package/dist/core/oauth.js +1 -1
  67. package/dist/core/profile.js +1 -1
  68. package/dist/core/project-config.js +1 -1
  69. package/dist/core/session.js +1 -1
  70. package/dist/core/user-cache.js +1 -1
  71. package/dist/core/version.js +1 -1
  72. package/dist/index.js +1 -1
  73. package/dist/mcp/server.js +1 -1
  74. package/dist/mcp/tools/index.js +1 -1
  75. package/dist/mcp/tools/tdx-run.js +1 -1
  76. package/dist/mcp/tools/tdx-search.js +1 -1
  77. package/dist/mcp/tools/work-create-item.js +1 -1
  78. package/dist/mcp/utils.js +1 -1
  79. package/dist/proxy/claude-usage-tracker.js +1 -1
  80. package/dist/proxy/passthrough-server.js +1 -1
  81. package/dist/proxy/sse-usage-parser.js +1 -1
  82. package/dist/sdk/agent/agent-config.js +1 -1
  83. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  84. package/dist/sdk/agent/agent-yaml.js +1 -1
  85. package/dist/sdk/agent/test/evaluator.js +1 -1
  86. package/dist/sdk/agent/test/executor.js +1 -1
  87. package/dist/sdk/agent/test/index.js +1 -1
  88. package/dist/sdk/agent/test/output.js +1 -1
  89. package/dist/sdk/agent/test/parser.js +1 -1
  90. package/dist/sdk/agent/tool-target-registry.js +1 -1
  91. package/dist/sdk/api.js +1 -1
  92. package/dist/sdk/cas/cas-api-client.js +1 -1
  93. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  94. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  95. package/dist/sdk/cas/index.js +1 -1
  96. package/dist/sdk/cas/pull-workflow.js +1 -1
  97. package/dist/sdk/cas/push-workflow.js +1 -1
  98. package/dist/sdk/client/cdp-api-client.js +1 -1
  99. package/dist/sdk/client/delivery-api-client.js +1 -1
  100. package/dist/sdk/client/endpoints.js +1 -1
  101. package/dist/sdk/client/engage-api-client.js +1 -1
  102. package/dist/sdk/client/http-client.js +1 -1
  103. package/dist/sdk/client/llm-api-client.js +1 -1
  104. package/dist/sdk/client/oauth-refresh.js +1 -1
  105. package/dist/sdk/client/rate-limiter.js +1 -1
  106. package/dist/sdk/client/td-api-client.js +1 -1
  107. package/dist/sdk/client/trino-api-client.js +1 -1
  108. package/dist/sdk/client/workflow-client.js +1 -1
  109. package/dist/sdk/connection-validator.js +1 -1
  110. package/dist/sdk/connection.js +1 -1
  111. package/dist/sdk/delivery.js +1 -1
  112. package/dist/sdk/engage/campaign-pull.js +1 -1
  113. package/dist/sdk/engage/campaign-push.js +1 -1
  114. package/dist/sdk/engage/campaign-validator.js +1 -1
  115. package/dist/sdk/engage/campaign-yaml.js +1 -1
  116. package/dist/sdk/engage/template-pull.js +1 -1
  117. package/dist/sdk/engage/template-push.js +1 -1
  118. package/dist/sdk/engage/template-validator.js +1 -1
  119. package/dist/sdk/engage/template-yaml.js +1 -1
  120. package/dist/sdk/engage/types/campaign-def.js +1 -1
  121. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  122. package/dist/sdk/engage/types/template-schema.js +1 -1
  123. package/dist/sdk/engage.js +1 -1
  124. package/dist/sdk/errors.js +1 -1
  125. package/dist/sdk/index.js +1 -1
  126. package/dist/sdk/io/index.js +1 -1
  127. package/dist/sdk/io/node-filesystem.js +1 -1
  128. package/dist/sdk/job.js +1 -1
  129. package/dist/sdk/journey.js +1 -1
  130. package/dist/sdk/llm/chat-cache.js +1 -1
  131. package/dist/sdk/llm/index.js +1 -1
  132. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  133. package/dist/sdk/llm/model-factors.js +1 -1
  134. package/dist/sdk/personalization.js +1 -1
  135. package/dist/sdk/policy.js +1 -1
  136. package/dist/sdk/query/index.js +1 -1
  137. package/dist/sdk/query/sql-parser.js +1 -1
  138. package/dist/sdk/realtime.js +1 -1
  139. package/dist/sdk/schedule.js +1 -1
  140. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  141. package/dist/sdk/segment/fields-display.js +1 -1
  142. package/dist/sdk/segment/file-discovery.js +1 -1
  143. package/dist/sdk/segment/journey-utils.js +1 -1
  144. package/dist/sdk/segment/journey-validator.js +1 -1
  145. package/dist/sdk/segment/journey-yaml.js +1 -1
  146. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  147. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  148. package/dist/sdk/segment/pull-workflow.js +1 -1
  149. package/dist/sdk/segment/push-recovery.js +1 -1
  150. package/dist/sdk/segment/push-workflow.js +1 -1
  151. package/dist/sdk/segment/resolution-context.js +1 -1
  152. package/dist/sdk/segment/segment-path-parser.js +1 -1
  153. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  154. package/dist/sdk/segment/segment-validator.js +1 -1
  155. package/dist/sdk/segment/target-resolution.js +1 -1
  156. package/dist/sdk/segment/tdx-config.js +1 -1
  157. package/dist/sdk/segment/types/activation-schema.js +1 -1
  158. package/dist/sdk/segment/types/journey-def.js +1 -1
  159. package/dist/sdk/segment/types/journey-schema.js +1 -1
  160. package/dist/sdk/segment/types/segment-def.js +1 -1
  161. package/dist/sdk/segment/types/segment-schema.js +1 -1
  162. package/dist/sdk/segment/validate-files.js +1 -1
  163. package/dist/sdk/segment/yaml-validator.js +1 -1
  164. package/dist/sdk/segment.js +1 -1
  165. package/dist/sdk/types/index.js +1 -1
  166. package/dist/sdk/types/progress.js +1 -1
  167. package/dist/sdk/types/workspace.js +1 -1
  168. package/dist/sdk/user.js +1 -1
  169. package/dist/sdk/util/format-detector.js +1 -1
  170. package/dist/sdk/util/formatters.js +1 -1
  171. package/dist/sdk/util/index.js +1 -1
  172. package/dist/sdk/util/paginate.js +1 -1
  173. package/dist/sdk/util/tree-formatter.js +1 -1
  174. package/dist/sdk/workflow/archive-validation.js +1 -1
  175. package/dist/sdk/workflow/clone-workflow.js +1 -1
  176. package/dist/sdk/workflow/index.js +1 -1
  177. package/dist/sdk/workflow/pull-workflow.js +1 -1
  178. package/dist/sdk/workflow/push-workflow.js +1 -1
  179. package/dist/sdk/workflow/tdx-config.js +1 -1
  180. package/dist/sdk/workflow/workflow-utils.js +1 -1
  181. package/dist/sdk/workspace/access-tracker.js +1 -1
  182. package/dist/sdk/workspace/frontmatter.js +1 -1
  183. package/dist/sdk/workspace/git.js +1 -1
  184. package/dist/sdk/workspace/index.js +1 -1
  185. package/dist/sdk/workspace/templates.js +1 -1
  186. package/dist/sdk/workspace/weekly.js +1 -1
  187. package/dist/sdk/workspace/wikilinks.js +1 -1
  188. package/dist/test-utils/command-runner.js +1 -1
  189. package/dist/test-utils/factories.js +1 -1
  190. package/dist/test-utils/fixtures.js +1 -1
  191. package/dist/test-utils/http-mock.js +1 -1
  192. package/dist/test-utils/index.js +1 -1
  193. package/dist/utils/async.js +1 -1
  194. package/dist/utils/colors.js +1 -1
  195. package/dist/utils/diff.js +1 -1
  196. package/dist/utils/file-permissions.js +1 -1
  197. package/dist/utils/file-reader.js +1 -1
  198. package/dist/utils/github-releases.js +1 -1
  199. package/dist/utils/global-cache.js +1 -1
  200. package/dist/utils/json-loader.js +1 -1
  201. package/dist/utils/local-cache.js +1 -1
  202. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  203. package/dist/utils/logger/formatters/index.js +1 -1
  204. package/dist/utils/logger/handlers/console-handler.js +1 -1
  205. package/dist/utils/logger/handlers/file-handler.js +1 -1
  206. package/dist/utils/logger/handlers/index.js +1 -1
  207. package/dist/utils/logger/handlers/null-handler.js +1 -1
  208. package/dist/utils/logger/index.js +1 -1
  209. package/dist/utils/logger/logger.js +1 -1
  210. package/dist/utils/logger/types.js +1 -1
  211. package/dist/utils/option-validation.js +1 -1
  212. package/dist/utils/process.js +1 -1
  213. package/dist/utils/prompt.js +1 -1
  214. package/dist/utils/spinner.js +1 -1
  215. package/dist/utils/sse-parser.js +1 -1
  216. package/dist/utils/string-utils.js +1 -1
  217. package/dist/utils/table-ref-parser.js +1 -1
  218. package/dist/utils/tdx-logger.js +1 -1
  219. package/dist/utils/version-check.js +1 -1
  220. package/package.json +1 -1
@@ -1 +1 @@
1
- const a31_0x59c470=a31_0x21a0;(function(_0x5d6502,_0x77b816){const _0x133ba3=a31_0x21a0,_0xbeb156=_0x5d6502();while(!![]){try{const _0x51803a=-parseInt(_0x133ba3(0x363))/0x1*(-parseInt(_0x133ba3(0x37b))/0x2)+parseInt(_0x133ba3(0x385))/0x3*(parseInt(_0x133ba3(0x1f4))/0x4)+-parseInt(_0x133ba3(0x2fd))/0x5*(-parseInt(_0x133ba3(0x271))/0x6)+parseInt(_0x133ba3(0x324))/0x7+-parseInt(_0x133ba3(0x1d6))/0x8+-parseInt(_0x133ba3(0x2e2))/0x9*(-parseInt(_0x133ba3(0x30e))/0xa)+-parseInt(_0x133ba3(0x359))/0xb*(parseInt(_0x133ba3(0x3af))/0xc);if(_0x51803a===_0x77b816)break;else _0xbeb156['push'](_0xbeb156['shift']());}catch(_0x5a2e71){_0xbeb156['push'](_0xbeb156['shift']());}}}(a31_0x5e65,0x4f27f));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a31_0x2b29d0 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_0x388bb2 from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../sdk/segment/fields-display.js';function a31_0x21a0(_0x224209,_0x215e83){_0x224209=_0x224209-0x1a3;const _0x5e65cf=a31_0x5e65();let _0x21a0b2=_0x5e65cf[_0x224209];return _0x21a0b2;}import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';const PARENT_SEGMENT_DIR=a31_0x59c470(0x2dd),LEGACY_PARENT_SEGMENT_DIR=a31_0x59c470(0x202);function openBrowser(_0x367163){const _0x59b7dd=a31_0x59c470,_0x2da1f2=process[_0x59b7dd(0x1f0)],_0x479cbf=_0x2da1f2===_0x59b7dd(0x307)?_0x59b7dd(0x2bf):_0x2da1f2===_0x59b7dd(0x22f)?'start':_0x59b7dd(0x23e);spawn(_0x479cbf,[_0x367163],{'detached':!![],'stdio':_0x59b7dd(0x38e)})[_0x59b7dd(0x352)]();}function migrateLegacyDirectory(){const _0x48d2c9=a31_0x59c470;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x17b0ae=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x17b0ae['isDirectory']())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x48d2c9(0x2f0)](a31_0x388bb2[_0x48d2c9(0x361)](_0x48d2c9(0x2d6)+LEGACY_PARENT_SEGMENT_DIR+_0x48d2c9(0x3a0)+PARENT_SEGMENT_DIR+_0x48d2c9(0x3a5))),console[_0x48d2c9(0x2f0)](a31_0x388bb2[_0x48d2c9(0x396)](_0x48d2c9(0x2ef)+LEGACY_PARENT_SEGMENT_DIR+'/\x20directory.\x0a')),![];console[_0x48d2c9(0x2f0)](a31_0x388bb2['yellow'](_0x48d2c9(0x1fd)+LEGACY_PARENT_SEGMENT_DIR+_0x48d2c9(0x366)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console['error'](a31_0x388bb2[_0x48d2c9(0x327)](_0x48d2c9(0x1e1)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x20de33){const _0x5281a5=_0x20de33 instanceof Error?_0x20de33['message']:String(_0x20de33);return console[_0x48d2c9(0x2f0)](a31_0x388bb2[_0x48d2c9(0x37a)]('✘\x20Failed\x20to\x20rename\x20directory:\x20'+_0x5281a5+'\x0a')),![];}}function a31_0x5e65(){const _0x5853b3=['personalizationServices','trim','Errors:','segment:parent:push','\x20stage','Master\x20+\x20Attributes','\x20Context\x20set:\x20','events','Validate\x20RT\x202.0\x20configuration\x20from\x20parent\x20segment\x20YAML','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','customersWithEvents','Default','Usage:\x20tdx\x20ps\x20pz\x20delete\x20<personalization_id>','localeCompare','test','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','\x20service(s)\x20configured','launched','payload','coveragePercent','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','audienceId','✔\x20Resumed\x20activations\x20for\x20RT\x20journey\x20\x27','stop','updated:','List\x20personalization\x20services\x20for\x20a\x20parent\x20segment','listParents','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]\x0a','identifier:\x20','status:\x20','\x0aNew\x20parent\x20segment\x20\x27','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]','all','win32','workflowAttemptId','Error:\x20--folder-id\x20is\x20required.\x20Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID.','sampleData','keyEventCriteria','\x0aUsage:\x20tdx\x20ps\x20preview\x20','\x20(paused)','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','Attributes','identifier','ps:pz:service:delete','\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22','\x20true','\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context','xdg-open','validateParentYaml','Fetching\x20current\x20configuration\x20for\x20\x27','\x20\x20\x20\x20\x20\x20\x20Pass\x20null\x20to\x20place\x20in\x20the\x20root\x20folder.','realtime_enabled','Show\x20parent\x20segment\x20schema\x20(column\x20types)','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','\x27\x20not\x20found\x20in\x20any\x20personalization\x20service','displayValidateResults','Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context','\x27\x20for\x20service\x20\x27','Listing\x20personalization\x20services\x20for\x20\x27','format','name','\x20\x20Database:\x20','pullParentYaml','payload:','Getting\x20RT\x20configuration\x20version\x20for\x20\x27','replace','\x0a\x20\x20\x20\x20]','Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]','\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20','attribute','Error:\x20Token\x20name\x20is\x20required','some','Personalization\x20service\x20description','allowedIps','Error:\x20Token\x20ID\x20is\x20required','\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22','Master\x20Table','execute','Parent\x20segment:\x20','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','displayBehaviorsStats','Error:\x20\x22relationships.parentFolder\x22\x20is\x20required\x20in\x20the\x20JSON\x20file.','Site:\x20','✔\x20Created\x20parent\x20segment\x20\x27','behaviors','foreignKey','Error:\x20Service\x20name\x20is\x20required','\x20is\x20already\x20up\x20to\x20date','token:','\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)','✔\x20Paused\x20activations\x20for\x20RT\x20journey\x20\x27','Audience\x20ID:','getBehaviorNames','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]\x0a','last_page_viewed','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','Updating\x20personalization\x20service\x20\x27','466674FpFjfB','schemaValid','Creating\x20personalization\x20service\x20\x27','\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','any','\x20\x20Tables:\x201\x20customers\x20+\x20','Columns:','number','Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs','segment:parent:create','/{name}.yml\x0a','segment:parent:fields','Listing\x20RT\x20journeys\x20for\x20\x27','FINISHED','createParent','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context','repeat','✔\x20Found\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','addBehaviorsFile','Fetching\x20customers\x20schema...','behavior','displayRealtimeInfo','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','Listing\x20parent\x20segments\x20matching\x20\x27','id:\x20','relationships','Join\x20on:','segment:parent:pull','Usage:\x20tdx\x20ps\x20pz\x20show\x20<personalization_id>','reduce','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','status','SQL\x20query:\x0a','Creating\x20parent\x20segment\x20\x27','label','\x20personalization\x20service','timezone','Error:\x20--behavior\x20requires\x20a\x20name\x0a','verbose','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','column_type','/app/dw/parentSegments/','Validating\x20RT\x20configuration...','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','attributes','realtime','create','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context','Resume\x20activations\x20in\x20an\x20RT\x20journey','query','resolveParentId','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a','ID\x20Stitching:','yes','jsonl','Behaviors','entryCriteria:','\x27...','updatedAt','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','log','\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path','Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID,\x20then\x20add:','listPersonalizations','deletePersonalization','message','Pausing\x20activations\x20for\x20RT\x20journey\x20\x27','td_client_id','\x0a⚠\x20Save\x20this\x20token\x20value\x20-\x20it\x20will\x20not\x20be\x20shown\x20again:','-1d','ps:pz:service:list','sourceTableError','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]','No\x20personalization\x20services\x20configured','open','start','endsWith','filter','joinKey','Show\x20personalization\x20service\x20details','updateParent','segment:parent:show','List\x20available\x20fields\x20for\x20segmentation','Output\x20file:\x20','allValid','interval','Listing\x20RT-enabled\x20parent\x20segments\x20matching\x20\x27','no\x20tokens\x20configured','✔\x20Deleted\x20personalization\x20\x27','\x20field','description','text','getCurrentConfigVersion','paused','Source:','\x20to\x20configure\x20your\x20personalization\x20service','parentSegment','\x0a⚠️\x20\x20Both\x20','Deleting\x20personalization\x20\x27','single','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','No\x20personalizations\x20configured','Delete\x20a\x20personalization\x20service','parent_segments','segment:parent:update','displayAttributesStats','/attempt/','join','537237qdghWP','entryCriteria','setJobId','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','\x20\x20Note:\x20','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','\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','toFixed','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]','addAttributesFile','\x0a\x20\x20]\x0a}\x0a','split','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','error','Database:\x20','state','enriched','\x27\x20is\x20up\x20to\x20date','Listing\x20personalizations\x20for\x20\x27','Join:','getParentSQL','personalization','✔\x20Created\x20token\x20\x27','scheduleOption','.yaml','✔\x20Deleted\x20token\x20\x27','5REeVAb','Listing\x20fields\x20for\x20\x27','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]','\x20--behavior\x20\x22','✔\x20Created\x20personalization\x20service\x20\x27','Created','.yml','keyEventId','Options:\x0a','segment:parent:run','darwin','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','web','List\x20parent\x20segments','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context','\x20RT\x20journey','50lvLqgF','Analyzing\x20changes...','tdx\x20ps\x20preview\x20','\x27\x20with\x20ID:\x20','sections','site','stageCount','segment:parent:desc','\x0aChanges\x20to\x20\x27','Available\x20behaviors:','use','\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\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','\x20\x202.\x20Run\x20','\x0a\x20\x20\x20\x20}','Listing\x20parent\x20segments...','population','Patching\x20personalization\x20\x27','customers','Coverage:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','\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','3234861ElTlbN','list','output','green','Enriched:','totalEvents','createToken','\x20configured','Error:\x20Personalization\x20ID\x20is\x20required','Delete\x20a\x20realtime\x20personalization','`\x20to\x20download\x20the\x20configuration\x20first','\x20--attribute\x20\x22','data','\x20\x20\x20','attributesFile','\x20\x201.\x20Edit\x20','errors','/app/workflows/','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','ps:pz:show','type','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--file\x20<path>','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','Update\x20a\x20personalization\x20service\x20name\x20and/or\x20description','customerGroup','\x20Opening\x20','\x20Added\x20RT\x202.0\x20template\x20section','Attempt:','pauseJourney','primaryKey','elapsedTimeMillis','Creating\x20personalization\x20\x27','Table:\x20','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','\x20--interval\x20','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','file','Behavior:','\x20to\x20push\x20the\x20configuration','Validating\x20configuration...','folder-segment','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','push','processedRows','cyan','unref','displayMasterInfo','⚡\x20Enabled','audienceId:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>','Creating','preview','8800vGiwYZ','Error:\x20Parent\x20segment\x20name\x20is\x20required','Show\x20a\x20specific\x20realtime\x20personalization','\x20parent\x20segment\x20\x27','\x20behaviors','toLocaleString','ps:rt:jn:list','createPersonalization','yellow','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','341413Imuthi','\x22,\x20\x22type\x22:\x20\x22','page_view','/\x20→\x20','{\x0a\x20\x20\x22database\x22:\x20\x22','\x20\x20\x20\x20-\x20','Create\x20a\x20personalization\x20service\x20for\x20a\x20parent\x20segment','\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22','includeSensitive:','parentFolder','\x20[Job\x20ID:\x20','toLowerCase','Resolving\x20parent\x20segment\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context','YAML\x20file:\x20','collectSchema','Error:\x20Service\x20ID\x20is\x20required','ps:pz:service:token:create','workflowSessionId','behavior_','.customers)','customerPercent','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','red','2eQNlhI','Options:','rowCount','Fetching\x20behavior\x20list...','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','⚡\x20Not\x20enabled','columns','List\x20RT\x20journeys','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:patch','732nykqQh','Apply\x20changes\x20to\x20\x27','column_name','No\x20RT\x20journeys\x20found','\x20No\x20changes\x20-\x20','bold','/sessions/','addAttributes','\x5c$&','ignore','resumeJourney','scheduleType','\x20personalization','stitchingKeys','\x22\x20}','✔\x20Updated\x20personalization\x20\x27','\x20\x20Columns:\x20','dim','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','sections:','✔\x20No\x20changes\x20-\x20\x27','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','addBehaviors','\x20total','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','\x20rows\x20','/\x20and\x20','\x0aChanges\x20to\x20apply\x20to\x20\x27','column','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','segment:parent:view','/\x20directories\x20exist.','Get\x20SQL\x20query\x20for\x20parent\x20segment','Delete\x20a\x20token\x20from\x20a\x20personalization\x20service','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','created:','Creating\x20token\x20\x27','patch','List\x20realtime\x20personalizations\x20for\x20a\x20parent\x20segment','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','Create\x20a\x20token\x20for\x20a\x20personalization\x20service','16476BxLufH','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','Aborted.','\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','Error:\x20--database\x20and\x20--table\x20are\x20required','table','includeSensitive','eventKind:\x20','(id:\x20','ps:rt:list','session','keys','length','\x20RT-enabled\x20parent\x20segment','realtime:','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Fetching\x20parent\x20segment\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','\x0aTip:\x20Run\x20`tdx\x20ps\x20pz\x20service\x20init`\x20to\x20add\x20a\x20template\x20personalization\x20section\x20to\x20your\x20YAML','utf-8','No\x20parent\x20segments\x20match\x20pattern:\x20','parent_id','pushParentYaml','patchPersonalization','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]','Resuming\x20activations\x20for\x20RT\x20journey\x20\x27','Options\x20(one\x20required):\x0a','Update\x20a\x20realtime\x20personalization\x20entity','Updating','ps:pz:service:create','double','audienceId:','To\x20view\x20sample\x20data:','\x0aError:','Master:','Deleting\x20token\x20\x27','run','delete','\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','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]','Get\x20current\x20RT\x20configuration\x20version\x20status','map','Rows:','personalization_services','Add\x20template\x20personalization\x20section\x20to\x20parent\x20segment\x20YAML','Getting\x20personalization\x20\x27','\x20Configuration\x20is\x20valid','\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)','\x20\x20\x20\x20\x20\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20init\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Add\x20PZ\x20template\x20for\x20specific\x20parent\x20segment','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','string','Customers:','✔\x20Updated\x20personalization\x20service\x20\x27','✔\x20Query\x20completed:\x20Processed\x20','displayColumns','master','Fetching\x20SQL\x20for\x20\x27','json','\x20--enriched','public','Error:\x20--attribute\x20requires\x20a\x20name\x0a','apply','createdAt','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','keyEventId:','Error\x20parsing\x20YAML:\x20','\x20tdx\x20wf\x20attempt\x20','2306760rWSJDa','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','displayPreviewResults','✔\x20Found\x20personalization\x20\x27','\x20=\x20','✔\x20Deleted\x20personalization\x20service\x20\x27','displaySummary','Updated','folderId','formatSchemaJson','stringify','✔\x20Renamed\x20directory\x20to\x20','SELECT\x20*\x20FROM\x20','Preview:','public:','getParentFull','\x20\x20No\x20sample\x20data\x20available','Error\x20reading\x20file:\x20','Usage:\x20tdx\x20ps\x20rt\x20jn\x20pause_activations\x20<journeyId>\x0a','ps:pz:service:update','segment:parent:sql','tokens','\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a','ps:rt:jn:pause','Error:','Found\x20YAML\x20file:\x20','platform','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','\x27\x20(id:\x20','previewParentYaml','8708qLATOj','matchedCount','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','idStitching','No\x20parent\x20segments\x20found','displayPreviewHints','schemaError','\x20\x20\x20\x20','allowed\x20IPs:','\x0a⚠️\x20\x20Migrating:\x20','database','match','Events:','displaySampleData','parent_segment','runParent','segment','Personalization:','\x27\x20and\x20run\x20workflow?','⚠️\x20\x20personalization_services\x20section\x20already\x20exists\x20in\x20','varchar','List\x20parent\x20segments\x20with\x20RT\x202.0\x20status','RT\x202.0:','Fetching\x20personalization\x20service\x20\x27','in\x20'];a31_0x5e65=function(){return _0x5853b3;};return a31_0x5e65();}class BaseParentSegmentCommand extends BaseCommand{async[a31_0x59c470(0x1b6)](_0x415a7b){const _0x1c4364=a31_0x59c470;return migrateLegacyDirectory(),super[_0x1c4364(0x1b6)](_0x415a7b);}}function resolveYamlFile(_0x19629c){const _0x2bb70a=a31_0x59c470;if(_0x19629c[_0x2bb70a(0x2c1)](_0x2bb70a(0x303))||_0x19629c[_0x2bb70a(0x2c1)](_0x2bb70a(0x2fb)))return _0x19629c;return a31_0x2b29d0['join'](PARENT_SEGMENT_DIR,sanitizeFileName(_0x19629c)+'.yml');}function formatProgressMessage(_0x3bef51){const _0x252e37=a31_0x59c470,_0x2ab156=_0x3bef51[_0x252e37(0x1ff)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x2ab156){const [,_0x2f5e34,_0x43e7c7,_0x427fe0='']=_0x2ab156;return a31_0x388bb2[_0x252e37(0x396)](_0x2f5e34+':')+'\x20'+_0x43e7c7+a31_0x388bb2[_0x252e37(0x396)](_0x427fe0);}return a31_0x388bb2[_0x252e37(0x396)](_0x3bef51);}function showFileNotFoundError(_0x425ebe,_0x31c9a3){const _0x580e96=a31_0x59c470;console[_0x580e96(0x2f0)](a31_0x388bb2[_0x580e96(0x37a)]('Error:\x20File\x20not\x20found:\x20'+_0x425ebe+'\x0a')),console['error'](a31_0x388bb2[_0x580e96(0x351)]('Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20'+_0x31c9a3+_0x580e96(0x32e)));}function displayRealtimeValidation(_0x1c07c4){const _0x172552=a31_0x59c470;if(!_0x1c07c4['realtime'])return;const _0x3797e4=_0x1c07c4['realtime'],_0x239631=_0x3797e4['enabled']?a31_0x388bb2['green'](_0x172552(0x354)):a31_0x388bb2[_0x172552(0x361)](_0x172552(0x380));console['error']('\x0a'+a31_0x388bb2['dim'](_0x172552(0x20a))+'\x20'+_0x239631);if(_0x3797e4[_0x172552(0x214)]&&_0x3797e4[_0x172552(0x214)]['length']>0x0){console[_0x172552(0x2f0)]('\x20\x20'+a31_0x388bb2[_0x172552(0x396)](_0x172552(0x200))+'\x20'+_0x3797e4['events']['length']+_0x172552(0x32b));for(const _0x3b23ba of _0x3797e4[_0x172552(0x214)]){const _0xf0f342=_0x3b23ba['sourceTableValid']===![]?a31_0x388bb2[_0x172552(0x37a)]('✘'):a31_0x388bb2['green']('✔');console['error']('\x20\x20\x20\x20'+_0xf0f342+'\x20'+_0x3b23ba[_0x172552(0x24c)]),_0x3b23ba[_0x172552(0x2bc)]&&console[_0x172552(0x2f0)]('\x20\x20\x20\x20\x20\x20'+a31_0x388bb2[_0x172552(0x37a)](_0x3b23ba[_0x172552(0x2bc)]));}}if(_0x3797e4['attributes']&&_0x3797e4[_0x172552(0x2a0)]['length']>0x0){console['error']('\x20\x20'+a31_0x388bb2[_0x172552(0x396)]('Attributes:')+'\x20'+_0x3797e4[_0x172552(0x2a0)][_0x172552(0x3bd)]+_0x172552(0x32b));for(const _0x4c9442 of _0x3797e4[_0x172552(0x2a0)]){const _0xe7882=_0x4c9442['valid']?a31_0x388bb2[_0x172552(0x327)]('✔'):a31_0x388bb2['red']('✘');console['error']('\x20\x20\x20\x20'+_0xe7882+'\x20'+_0x4c9442[_0x172552(0x24c)]+'\x20'+a31_0x388bb2['dim']('('+_0x4c9442[_0x172552(0x338)]+')'));}}if(_0x3797e4[_0x172552(0x1f7)]){const _0x5b13bd=_0x3797e4['idStitching']['stitchingKeys']?.[_0x172552(0x3bd)]?'\x20+\x20['+_0x3797e4['idStitching'][_0x172552(0x392)]['join'](',\x20')+']':'';console[_0x172552(0x2f0)]('\x20\x20'+a31_0x388bb2[_0x172552(0x396)](_0x172552(0x2a9))+'\x20'+_0x3797e4[_0x172552(0x1f7)][_0x172552(0x342)]+_0x5b13bd);}if(_0x3797e4[_0x172552(0x20d)]&&_0x3797e4[_0x172552(0x20d)]['length']>0x0){console['error']('\x20\x20'+a31_0x388bb2[_0x172552(0x396)](_0x172552(0x205))+'\x20'+_0x3797e4['personalizationServices'][_0x172552(0x3bd)]+'\x20service'+(_0x3797e4[_0x172552(0x20d)][_0x172552(0x3bd)]!==0x1?'s':''));for(const _0x382f64 of _0x3797e4[_0x172552(0x20d)]){console[_0x172552(0x2f0)](_0x172552(0x368)+_0x382f64['name']);}}}function showParentSegmentNotSetError(_0x585313){const _0x219640=a31_0x59c470;console['error'](a31_0x388bb2[_0x219640(0x361)](_0x219640(0x2d9))),console[_0x219640(0x2f0)](_0x585313);}export class ParentSegmentListCommand extends BaseCommand{[a31_0x59c470(0x24c)]='segment:parent:list';['description']=a31_0x59c470(0x30a);async[a31_0x59c470(0x25d)](_0x4f26cd){const _0x41c18e=a31_0x59c470,{options:_0xca0a23,args:_0x40b77e,tdx:_0x17e9f0}=_0x4f26cd,_0x495d4a=_0x40b77e[0x0];_0xca0a23[_0x41c18e(0x29a)]&&(console['error'](_0x41c18e(0x262)+_0xca0a23['site']),_0x495d4a&&console[_0x41c18e(0x2f0)]('Pattern:\x20'+_0x495d4a));const _0x4ba081=await withSpinner(_0x495d4a?_0x41c18e(0x28b)+_0x495d4a+_0x41c18e(0x2ae):_0x41c18e(0x31d),()=>_0x17e9f0['segment'][_0x41c18e(0x227)](),{'verbose':_0xca0a23[_0x41c18e(0x29a)]});let _0x5db660=_0x4ba081[_0x41c18e(0x330)];if(_0x495d4a){const _0x1676be=_0x495d4a[_0x41c18e(0x251)](/[.+^${}()|[\]\\]/g,'\x5c$&')['replace'](/\*/g,'.*')[_0x41c18e(0x251)](/\?/g,'.'),_0xf48f1f=new RegExp('^'+_0x1676be+'$','i');_0x5db660=_0x5db660[_0x41c18e(0x2c2)](_0x38783a=>_0xf48f1f[_0x41c18e(0x21b)](_0x38783a[_0x41c18e(0x2a0)]['name']));}_0x5db660['sort']((_0x3981de,_0x44c3f8)=>_0x3981de['attributes'][_0x41c18e(0x24c)][_0x41c18e(0x21a)](_0x44c3f8[_0x41c18e(0x2a0)]['name'])),console[_0x41c18e(0x2f0)](_0x41c18e(0x283)+_0x5db660['length']+'\x20parent\x20segment'+(_0x5db660[_0x41c18e(0x3bd)]!==0x1?'s':''));const _0x4f67dc=_0x24f9cd=>{const _0x4a2ab7=_0x41c18e;return getConsoleNextUrl(_0xca0a23[_0x4a2ab7(0x313)],_0x4a2ab7(0x29d)+_0x24f9cd);};if(_0xca0a23['format']==='json'||_0xca0a23['format']===_0x41c18e(0x2ab)){const _0x1c9846=_0x5db660[_0x41c18e(0x1bb)](_0x399312=>({..._0x399312,'url':_0x4f67dc(_0x399312['id'])}));await handleSDKOutput(_0x1c9846,_0xca0a23);}else{if(_0x5db660[_0x41c18e(0x3bd)]===0x0)_0x495d4a?console['log'](_0x41c18e(0x1a6)+_0x495d4a):console[_0x41c18e(0x2b1)](_0x41c18e(0x1f8));else for(const _0x474f32 of _0x5db660){const _0x35a477=_0x474f32['attributes'][_0x41c18e(0x31e)]?a31_0x388bb2[_0x41c18e(0x396)]('\x20('+formatRows(_0x474f32[_0x41c18e(0x2a0)][_0x41c18e(0x31e)])+')'):'',_0x1ae949=hyperlink(_0x474f32['attributes']['name'],_0x4f67dc(_0x474f32['id']));console['log']('👥\x20'+_0x1ae949+_0x35a477);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{['name']=a31_0x59c470(0x27a);['description']=a31_0x59c470(0x37f);async['execute'](_0x728c67){const _0x38da62=a31_0x59c470,{options:_0x150fe6,args:_0x2568a3,tdx:_0x551891}=_0x728c67;console['error'](_0x38da62(0x2da)+_0x38da62(0x39a)+_0x38da62(0x339));const _0x4da747=_0x150fe6;if(_0x2568a3[_0x38da62(0x3bd)]===0x0)return console[_0x38da62(0x2f0)](a31_0x388bb2[_0x38da62(0x37a)](_0x38da62(0x35a))),console[_0x38da62(0x2f0)](_0x38da62(0x292)),0x1;const _0x2c788b=_0x2568a3[0x0];if(!_0x4da747['database']||!_0x4da747['table'])return console[_0x38da62(0x2f0)](_0x38da62(0x3b5)),console['error'](_0x38da62(0x292)),0x1;_0x4da747[_0x38da62(0x29a)]&&(console[_0x38da62(0x2f0)](_0x38da62(0x262)+_0x4da747['site']),console['error']('Name:\x20'+_0x2c788b),console[_0x38da62(0x2f0)](_0x38da62(0x2f1)+_0x4da747['database']),console[_0x38da62(0x2f0)](_0x38da62(0x345)+_0x4da747[_0x38da62(0x3b6)]));const _0x1df9d9=await loadJSONFromOptions(_0x4da747[_0x38da62(0x2a0)],_0x4da747[_0x38da62(0x332)]),_0x15859a=await loadJSONFromOptions(_0x4da747[_0x38da62(0x264)],_0x4da747['behaviorsFile']),_0x133fec=await loadJSONFromOptions(_0x4da747[_0x38da62(0x33d)],_0x4da747['customerGroupFile']),_0x3ce0c9={'name':_0x2c788b,'description':_0x4da747[_0x38da62(0x2cf)],'scheduleType':_0x4da747['scheduleType'],'scheduleOption':_0x4da747[_0x38da62(0x2fa)],'timezone':_0x4da747['timezone'],'master':{'parentDatabaseName':_0x4da747[_0x38da62(0x1fe)],'parentTableName':_0x4da747['table']},'attributes':_0x1df9d9,'behaviors':_0x15859a,'customerGroup':_0x133fec},_0x21c5e1=await withSpinner(_0x38da62(0x295)+_0x2c788b+_0x38da62(0x2ae),()=>_0x551891[_0x38da62(0x204)][_0x38da62(0x27f)](_0x3ce0c9),{'verbose':_0x150fe6[_0x38da62(0x29a)]}),_0x39897b=_0x21c5e1['data'];return console[_0x38da62(0x2f0)](_0x38da62(0x263)+_0x39897b[_0x38da62(0x24c)]+_0x38da62(0x311)+_0x39897b['id']),await handleSDKOutput([_0x39897b],_0x150fe6),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{['name']=a31_0x59c470(0x2de);[a31_0x59c470(0x2cf)]=a31_0x59c470(0x1d7);async['execute'](_0x1dda1e){const _0x1420a0=a31_0x59c470,{options:_0x1c0d93,args:_0x35acc7,tdx:_0x133400}=_0x1dda1e;console[_0x1420a0(0x2f0)]('\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a'+_0x1420a0(0x39a)+_0x1420a0(0x339));const _0x1b3180=_0x1c0d93;if(_0x35acc7[_0x1420a0(0x3bd)]===0x0)return console[_0x1420a0(0x2f0)](a31_0x388bb2['red'](_0x1420a0(0x35a))),console[_0x1420a0(0x2f0)](_0x1420a0(0x3b0)),0x1;const _0x1cbe82=_0x35acc7[0x0];_0x1b3180['verbose']&&(console[_0x1420a0(0x2f0)](_0x1420a0(0x262)+_0x1b3180[_0x1420a0(0x313)]),console[_0x1420a0(0x2f0)](_0x1420a0(0x25e)+_0x1cbe82));const _0x2b3a74=await withSpinner(_0x1420a0(0x240)+_0x1cbe82+_0x1420a0(0x2ae),()=>_0x133400[_0x1420a0(0x204)]['getParentFull'](_0x1cbe82),{'verbose':_0x1b3180[_0x1420a0(0x29a)]}),_0x17000a=_0x2b3a74[_0x1420a0(0x330)],_0x55a90a=await loadJSONFromOptions(_0x1b3180[_0x1420a0(0x38c)],_0x1b3180[_0x1420a0(0x2eb)]),_0x3fa320=await loadJSONFromOptions(_0x1b3180[_0x1420a0(0x39b)],_0x1b3180[_0x1420a0(0x286)]),_0x5e97e1={'name':_0x17000a[_0x1420a0(0x24c)],'description':_0x1b3180['description']!==undefined?_0x1b3180['description']:_0x17000a[_0x1420a0(0x2cf)],'scheduleType':_0x1b3180[_0x1420a0(0x390)]!==undefined?_0x1b3180['scheduleType']:_0x17000a[_0x1420a0(0x390)],'scheduleOption':_0x1b3180['scheduleOption']!==undefined?_0x1b3180[_0x1420a0(0x2fa)]:_0x17000a[_0x1420a0(0x2fa)],'timezone':_0x1b3180[_0x1420a0(0x298)]!==undefined?_0x1b3180[_0x1420a0(0x298)]:_0x17000a[_0x1420a0(0x298)],'master':_0x17000a[_0x1420a0(0x1ca)],'attributes':_0x55a90a?[..._0x17000a[_0x1420a0(0x2a0)]||[],..._0x55a90a]:_0x17000a[_0x1420a0(0x2a0)],'behaviors':_0x3fa320?[..._0x17000a[_0x1420a0(0x264)]||[],..._0x3fa320]:_0x17000a[_0x1420a0(0x264)],'customerGroup':_0x17000a[_0x1420a0(0x33d)]},_0x4090ef=await withSpinner('Updating\x20parent\x20segment\x20\x27'+_0x1cbe82+_0x1420a0(0x2ae),()=>_0x133400[_0x1420a0(0x204)][_0x1420a0(0x2c5)](_0x1cbe82,_0x5e97e1),{'verbose':_0x1b3180[_0x1420a0(0x29a)]}),_0x576196=_0x4090ef[_0x1420a0(0x330)];return console[_0x1420a0(0x2f0)]('✔\x20Updated\x20parent\x20segment\x20\x27'+_0x576196['name']+'\x27'),await handleSDKOutput([_0x576196],_0x1b3180),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{['name']=a31_0x59c470(0x28f);[a31_0x59c470(0x2cf)]=a31_0x59c470(0x346);async[a31_0x59c470(0x25d)](_0x3329d5){const _0x5a8ba5=a31_0x59c470,{options:_0xd11737,args:_0xb24a88,tdx:_0xf8fc3}=_0x3329d5,_0x24f864=_0xd11737,_0x8bd229=_0xb24a88[0x0]||_0xd11737['parentSegment'];if(!_0x8bd229)return showParentSegmentNotSetError(_0x5a8ba5(0x221)+_0x5a8ba5(0x2e5)),0x1;if(_0x24f864[_0x5a8ba5(0x318)]&&_0x24f864[_0x5a8ba5(0x326)])return console['error'](a31_0x388bb2[_0x5a8ba5(0x37a)](_0x5a8ba5(0x397))),console[_0x5a8ba5(0x2f0)](a31_0x388bb2[_0x5a8ba5(0x396)](_0x5a8ba5(0x26f))),console[_0x5a8ba5(0x2f0)](a31_0x388bb2[_0x5a8ba5(0x396)]('using\x20the\x20default\x20path:\x20'+PARENT_SEGMENT_DIR+_0x5a8ba5(0x27b))),console[_0x5a8ba5(0x2f0)](a31_0x388bb2[_0x5a8ba5(0x351)](_0x5a8ba5(0x3b3))),0x1;const _0x31f5c0=_0x24f864[_0x5a8ba5(0x326)]||a31_0x2b29d0[_0x5a8ba5(0x2e1)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x8bd229)+_0x5a8ba5(0x303));_0x24f864['verbose']&&(console[_0x5a8ba5(0x2f0)](_0x5a8ba5(0x262)+_0x24f864[_0x5a8ba5(0x313)]),console[_0x5a8ba5(0x2f0)](_0x5a8ba5(0x25e)+_0x8bd229),console[_0x5a8ba5(0x2f0)](_0x5a8ba5(0x2c8)+_0x31f5c0));const _0x5c940d=await withSpinner(_0x5a8ba5(0x3c1)+_0x8bd229+_0x5a8ba5(0x2ae),()=>_0xf8fc3['segment'][_0x5a8ba5(0x24e)](_0x8bd229),{'verbose':_0x24f864[_0x5a8ba5(0x29a)]}),_0x4c8e54=_0x5c940d[_0x5a8ba5(0x330)];if(existsSync(_0x31f5c0)){const _0x5247c8=readFileSync(_0x31f5c0,_0x5a8ba5(0x1a5)),_0x49212d=generateDiff(_0x5247c8,_0x4c8e54);if(!hasChanges(_0x49212d))console[_0x5a8ba5(0x2f0)](a31_0x388bb2['green']('✔')+_0x5a8ba5(0x389)+a31_0x388bb2[_0x5a8ba5(0x351)](_0x31f5c0)+_0x5a8ba5(0x267));else{console[_0x5a8ba5(0x2f0)](_0x5a8ba5(0x316)+_0x31f5c0+'\x27:'),console[_0x5a8ba5(0x2f0)]('─'['repeat'](0x3c)),console['error'](formatDiffWithColors(_0x49212d)),console['error']('─'[_0x5a8ba5(0x282)](0x3c));if(!_0x24f864[_0x5a8ba5(0x2aa)]){if(!isInteractive())return console['error'](a31_0x388bb2[_0x5a8ba5(0x37a)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x5a8ba5(0x2f0)](a31_0x388bb2[_0x5a8ba5(0x396)](_0x5a8ba5(0x3c0))),0x1;const _0x70a492=await confirmKey('Overwrite\x20\x27'+_0x31f5c0+'\x27?');if(!_0x70a492)return console[_0x5a8ba5(0x2f0)](a31_0x388bb2[_0x5a8ba5(0x361)](_0x5a8ba5(0x3b1))),0x1;}writeFileSync(_0x31f5c0,_0x4c8e54,'utf-8'),console['error'](a31_0x388bb2['green']('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a31_0x388bb2[_0x5a8ba5(0x351)](_0x31f5c0));}}else{const _0x56e242=a31_0x2b29d0['dirname'](_0x31f5c0);!existsSync(_0x56e242)&&mkdirSync(_0x56e242,{'recursive':!![]}),writeFileSync(_0x31f5c0,_0x4c8e54,_0x5a8ba5(0x1a5)),console[_0x5a8ba5(0x2f0)](a31_0x388bb2[_0x5a8ba5(0x327)]('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a31_0x388bb2[_0x5a8ba5(0x351)](_0x31f5c0));}return saveSessionContext({'parent_segment':_0x8bd229},_0x24f864[_0x5a8ba5(0x3bb)]),console[_0x5a8ba5(0x2f0)](a31_0x388bb2[_0x5a8ba5(0x327)]('✔')+_0x5a8ba5(0x213)+a31_0x388bb2[_0x5a8ba5(0x396)](_0x5a8ba5(0x202))+_0x5a8ba5(0x1da)+a31_0x388bb2[_0x5a8ba5(0x351)](_0x8bd229)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a31_0x59c470(0x24c)]=a31_0x59c470(0x210);[a31_0x59c470(0x2cf)]=a31_0x59c470(0x2e7);async[a31_0x59c470(0x25d)](_0x46ce09){const _0x40d03c=a31_0x59c470,{options:_0x214e76,args:_0x450df7,tdx:_0x2b10e9}=_0x46ce09,_0x3b07b7=_0x214e76,_0x3e1bba=_0x450df7[0x0]||_0x214e76[_0x40d03c(0x2d5)];if(!_0x3e1bba)return showParentSegmentNotSetError(_0x40d03c(0x362)+_0x40d03c(0x284)),0x1;const _0x2bb37e=resolveYamlFile(_0x3e1bba);if(!existsSync(_0x2bb37e))return showFileNotFoundError(_0x2bb37e,_0x3e1bba),0x1;_0x3b07b7['verbose']&&(console[_0x40d03c(0x2f0)](_0x40d03c(0x262)+_0x3b07b7[_0x40d03c(0x313)]),console['error']('YAML\x20file:\x20'+_0x2bb37e));let _0x4bbe1d;try{_0x4bbe1d=readFileSync(_0x2bb37e,'utf-8');}catch(_0x5685ae){const _0x405ade=_0x5685ae instanceof Error?_0x5685ae[_0x40d03c(0x2b6)]:String(_0x5685ae);return console[_0x40d03c(0x2f0)](_0x40d03c(0x1e7)+_0x405ade),0x1;}const _0x278605=await withSpinner(_0x40d03c(0x30f),()=>_0x2b10e9['segment'][_0x40d03c(0x1a8)](_0x4bbe1d),{'verbose':_0x3b07b7[_0x40d03c(0x29a)]}),_0x2c8da3=_0x278605[_0x40d03c(0x330)],{isNew:_0x471c21,name:_0x7dde9a,hasChanges:_0x21fd52,diffFormatted:_0x45a936}=_0x2c8da3;if(!_0x21fd52)return console[_0x40d03c(0x2f0)]('✔\x20No\x20changes\x20-\x20\x27'+_0x7dde9a+'\x27\x20is\x20already\x20up\x20to\x20date'),0x0;_0x471c21?console['error'](_0x40d03c(0x22b)+_0x7dde9a+'\x27:'):console[_0x40d03c(0x2f0)](_0x40d03c(0x3a1)+_0x7dde9a+'\x27:');console[_0x40d03c(0x2f0)]('─'[_0x40d03c(0x282)](0x3c)),console[_0x40d03c(0x2f0)](_0x45a936),console[_0x40d03c(0x2f0)]('─'[_0x40d03c(0x282)](0x3c));const _0x2d0567=_0x471c21?'Create\x20parent\x20segment\x20\x27'+_0x7dde9a+'\x27?':_0x40d03c(0x386)+_0x7dde9a+'\x27?';if(!_0x3b07b7[_0x40d03c(0x2aa)]){if(!isInteractive())return console['error'](a31_0x388bb2['red'](_0x40d03c(0x1b3)),_0x40d03c(0x280)),console[_0x40d03c(0x2f0)](a31_0x388bb2['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x287a36=await confirmKey(_0x2d0567);if(!_0x287a36)return console[_0x40d03c(0x2f0)](a31_0x388bb2['yellow'](_0x40d03c(0x3b1))),0x1;}const _0x1c726f=_0x471c21?_0x40d03c(0x357):_0x40d03c(0x1ae),_0x466802=await withSpinner(_0x1c726f+'\x20parent\x20segment\x20\x27'+_0x7dde9a+_0x40d03c(0x2ae),()=>_0x2c8da3[_0x40d03c(0x1d0)](),{'verbose':_0x3b07b7[_0x40d03c(0x29a)]}),_0x4d805a=_0x466802[_0x40d03c(0x330)],_0x485a1c=getConsoleNextUrl(_0x3b07b7[_0x40d03c(0x313)],_0x40d03c(0x29d)+_0x4d805a['id']),_0x28729f=_0x471c21?_0x40d03c(0x302):_0x40d03c(0x1dd);return console[_0x40d03c(0x2f0)]('✔\x20'+_0x28729f+_0x40d03c(0x35c)+_0x4d805a['name']+'\x27'),console[_0x40d03c(0x2f0)]('\x20\x20'+_0x485a1c),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a31_0x59c470(0x24c)]='segment:parent:validate';[a31_0x59c470(0x2cf)]=a31_0x59c470(0x3a8);async[a31_0x59c470(0x25d)](_0x842a4d){const _0x1428f7=a31_0x59c470,{options:_0x233d9f,args:_0x2c4371,tdx:_0x151546}=_0x842a4d,_0x138adc=_0x233d9f,_0x284c39=_0x2c4371[0x0]||_0x233d9f[_0x1428f7(0x2d5)];if(!_0x284c39)return showParentSegmentNotSetError(_0x1428f7(0x308)+_0x1428f7(0x322)+_0x1428f7(0x305)+'\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a'+_0x1428f7(0x236)+_0x1428f7(0x1f1)),0x1;const _0x18269b=resolveYamlFile(_0x284c39);if(!existsSync(_0x18269b))return showFileNotFoundError(_0x18269b,_0x284c39),0x1;_0x138adc[_0x1428f7(0x29a)]&&(console['error'](_0x1428f7(0x262)+_0x138adc[_0x1428f7(0x313)]),console[_0x1428f7(0x2f0)](_0x1428f7(0x371)+_0x18269b));let _0x2010c3;try{_0x2010c3=readFileSync(_0x18269b,'utf-8');}catch(_0x4268b7){const _0x1d3789=_0x4268b7 instanceof Error?_0x4268b7[_0x1428f7(0x2b6)]:String(_0x4268b7);return console[_0x1428f7(0x2f0)](_0x1428f7(0x1e7)+_0x1d3789),0x1;}const _0x3faa11=createCommandSpinner(a31_0x388bb2[_0x1428f7(0x396)](_0x1428f7(0x34c)),{'verbose':_0x138adc[_0x1428f7(0x29a)]});_0x3faa11[_0x1428f7(0x2c0)]();const _0x302874={'onProgress':_0x45da99=>{const _0x537c02=_0x1428f7;_0x3faa11[_0x537c02(0x2d0)]=formatProgressMessage(_0x45da99);}};if(_0x138adc[_0x1428f7(0x1ca)])_0x302874[_0x1428f7(0x1ca)]=!![];if(_0x138adc['enriched'])_0x302874['enriched']=!![];_0x138adc[_0x1428f7(0x255)]&&(_0x302874[_0x1428f7(0x255)]=_0x138adc[_0x1428f7(0x255)]);_0x138adc[_0x1428f7(0x288)]&&(_0x302874[_0x1428f7(0x288)]=_0x138adc[_0x1428f7(0x288)]);if(_0x138adc[_0x1428f7(0x2ca)])_0x302874[_0x1428f7(0x2ca)]=_0x138adc['interval'];let _0x53398b;try{_0x53398b=await _0x151546['segment'][_0x1428f7(0x23f)](_0x2010c3,_0x302874),_0x3faa11[_0x1428f7(0x224)]();}catch(_0xe81207){_0x3faa11['stop']();throw _0xe81207;}const _0x5e59f6=_0x138adc[_0x1428f7(0x2ca)]||_0x1428f7(0x2ba);return this[_0x1428f7(0x246)](_0x53398b,_0x302874,_0x18269b,_0x5e59f6),_0x53398b[_0x1428f7(0x2c9)]?0x0:0x1;}[a31_0x59c470(0x246)](_0x44082c,_0x252f55,_0xf303c9,_0x3f9317){const _0x4130ec=a31_0x59c470;console[_0x4130ec(0x2f0)]('\x0a'+a31_0x388bb2[_0x4130ec(0x38a)]('Validate:')+'\x20'+_0x44082c[_0x4130ec(0x24c)]),console['error']('═'[_0x4130ec(0x282)](0x3c)),this['displayMasterInfo'](_0x44082c);if(typeof _0x252f55[_0x4130ec(0x255)]==='string'){this[_0x4130ec(0x2df)](_0x44082c),this[_0x4130ec(0x1dc)](_0x44082c),this[_0x4130ec(0x1f9)](_0xf303c9,_0x3f9317,_0x4130ec(0x255),_0x252f55[_0x4130ec(0x255)]);return;}if(_0x252f55[_0x4130ec(0x255)]===!![]){this[_0x4130ec(0x2df)](_0x44082c),this[_0x4130ec(0x1dc)](_0x44082c),this[_0x4130ec(0x1f9)](_0xf303c9,_0x3f9317,_0x4130ec(0x2a0));return;}if(typeof _0x252f55[_0x4130ec(0x288)]===_0x4130ec(0x1c5)){this['displayBehaviorsStats'](_0x44082c,_0x3f9317),this[_0x4130ec(0x1dc)](_0x44082c),this[_0x4130ec(0x1f9)](_0xf303c9,_0x3f9317,_0x4130ec(0x288),_0x252f55[_0x4130ec(0x288)]);return;}if(_0x252f55[_0x4130ec(0x288)]===!![]){this[_0x4130ec(0x260)](_0x44082c,_0x3f9317),this['displaySummary'](_0x44082c),this['displayPreviewHints'](_0xf303c9,_0x3f9317,'behaviors');return;}this[_0x4130ec(0x2df)](_0x44082c),this[_0x4130ec(0x260)](_0x44082c,_0x3f9317),this[_0x4130ec(0x289)](_0x44082c),this[_0x4130ec(0x1dc)](_0x44082c),this[_0x4130ec(0x1f9)](_0xf303c9,_0x3f9317,_0x4130ec(0x22e));}[a31_0x59c470(0x289)](_0x4e5851){displayRealtimeValidation(_0x4e5851);}[a31_0x59c470(0x1f9)](_0x103a24,_0x3413c2,_0x112819,_0x834d95){const _0x3a37ad=a31_0x59c470;console[_0x3a37ad(0x2f0)]('\x0a'+a31_0x388bb2[_0x3a37ad(0x396)](_0x3a37ad(0x1b2)));const _0x4acc51=_0x3413c2!=='-1d'?_0x3a37ad(0x347)+_0x3413c2:'';if(_0x112819==='attribute'&&_0x834d95)console[_0x3a37ad(0x2f0)]('\x20\x20'+a31_0x388bb2[_0x3a37ad(0x396)](_0x3a37ad(0x310)+_0x103a24+'\x20--attribute\x20\x22'+_0x834d95+'\x22'+_0x4acc51));else{if(_0x112819===_0x3a37ad(0x288)&&_0x834d95)console[_0x3a37ad(0x2f0)]('\x20\x20'+a31_0x388bb2['dim'](_0x3a37ad(0x310)+_0x103a24+_0x3a37ad(0x300)+_0x834d95+'\x22'+_0x4acc51));else(_0x112819==='attributes'||_0x112819===_0x3a37ad(0x22e))&&console[_0x3a37ad(0x2f0)]('\x20\x20'+a31_0x388bb2[_0x3a37ad(0x396)](_0x3a37ad(0x310)+_0x103a24+'\x20--attribute\x20\x22<name>\x22'+_0x4acc51));}(_0x112819==='behaviors'||_0x112819==='all')&&console['error']('\x20\x20'+a31_0x388bb2[_0x3a37ad(0x396)](_0x3a37ad(0x310)+_0x103a24+'\x20--behavior\x20\x22<name>\x22'+_0x4acc51)),_0x112819===_0x3a37ad(0x22e)&&console['error']('\x20\x20'+a31_0x388bb2[_0x3a37ad(0x396)](_0x3a37ad(0x310)+_0x103a24+_0x3a37ad(0x1cd)+_0x4acc51));}[a31_0x59c470(0x353)](_0x279ad0){const _0x47040f=a31_0x59c470,{master:_0x45cd42}=_0x279ad0,_0x207fa4=_0x45cd42[_0x47040f(0x272)]?a31_0x388bb2[_0x47040f(0x327)]('✔'):a31_0x388bb2[_0x47040f(0x37a)]('✘');console[_0x47040f(0x2f0)]('\x0a'+a31_0x388bb2[_0x47040f(0x396)](_0x47040f(0x25c))),console[_0x47040f(0x2f0)](_0x207fa4+'\x20'+a31_0x388bb2[_0x47040f(0x38a)](_0x45cd42[_0x47040f(0x1fe)]+'.'+_0x45cd42[_0x47040f(0x3b6)])),_0x45cd42['schemaValid']?_0x45cd42[_0x47040f(0x37d)]!==undefined&&console[_0x47040f(0x2f0)]('\x20\x20'+a31_0x388bb2[_0x47040f(0x396)](_0x47040f(0x1bc))+'\x20'+a31_0x388bb2['cyan'](formatRows(_0x45cd42[_0x47040f(0x37d)]))):console[_0x47040f(0x2f0)]('\x20\x20'+a31_0x388bb2['red'](_0x47040f(0x1ee))+'\x20'+_0x45cd42['schemaError']);}[a31_0x59c470(0x2df)](_0x4815e0){const _0x3aee49=a31_0x59c470;if(_0x4815e0[_0x3aee49(0x2a0)][_0x3aee49(0x3bd)]===0x0)return;console[_0x3aee49(0x2f0)]('\x0a'+a31_0x388bb2[_0x3aee49(0x396)](_0x3aee49(0x237)));for(const _0x5a52c3 of _0x4815e0[_0x3aee49(0x2a0)]){const _0x52c47e=_0x5a52c3[_0x3aee49(0x272)]?a31_0x388bb2[_0x3aee49(0x327)]('✔'):a31_0x388bb2[_0x3aee49(0x37a)]('✘');let _0x42031a='';if(_0x5a52c3[_0x3aee49(0x272)]&&_0x5a52c3[_0x3aee49(0x1f5)]!==undefined&&_0x5a52c3[_0x3aee49(0x220)]!==undefined){const _0x2f115d=_0x5a52c3[_0x3aee49(0x220)][_0x3aee49(0x2e9)](0x1),_0x21f8f2=_0x5a52c3[_0x3aee49(0x220)]>=0x50?a31_0x388bb2['green']:_0x5a52c3[_0x3aee49(0x220)]>=0x32?a31_0x388bb2['yellow']:a31_0x388bb2[_0x3aee49(0x37a)];_0x42031a='\x20'+a31_0x388bb2[_0x3aee49(0x396)](_0x3aee49(0x321))+'\x20'+_0x21f8f2(_0x2f115d+'%')+'\x20('+formatRows(_0x5a52c3[_0x3aee49(0x1f5)])+'\x20rows)';}console[_0x3aee49(0x2f0)](_0x52c47e+'\x20'+a31_0x388bb2['bold'](_0x5a52c3[_0x3aee49(0x24c)])+_0x42031a),console['error']('\x20\x20'+a31_0x388bb2['dim'](_0x3aee49(0x2d3))+'\x20'+a31_0x388bb2[_0x3aee49(0x38a)](_0x5a52c3[_0x3aee49(0x1fe)]+'.'+_0x5a52c3['table']));const _0x38fd8a=_0x5a52c3[_0x3aee49(0x2c3)]===_0x5a52c3[_0x3aee49(0x265)]?a31_0x388bb2[_0x3aee49(0x396)]('Join\x20on:')+'\x20'+_0x5a52c3[_0x3aee49(0x2c3)]:a31_0x388bb2['dim'](_0x3aee49(0x2f6))+'\x20'+_0x5a52c3[_0x3aee49(0x2c3)]+_0x3aee49(0x1da)+_0x5a52c3[_0x3aee49(0x265)];console[_0x3aee49(0x2f0)]('\x20\x20'+_0x38fd8a),console[_0x3aee49(0x2f0)]('\x20\x20'+a31_0x388bb2[_0x3aee49(0x396)](_0x3aee49(0x277))),this[_0x3aee49(0x1c9)](_0x5a52c3[_0x3aee49(0x381)]),!_0x5a52c3[_0x3aee49(0x272)]&&console[_0x3aee49(0x2f0)]('\x20\x20'+a31_0x388bb2[_0x3aee49(0x37a)]('Error:')+'\x20'+_0x5a52c3[_0x3aee49(0x1fa)]);}}[a31_0x59c470(0x260)](_0x1efecb,_0x3ceced){const _0x8ebf3f=a31_0x59c470;if(_0x1efecb[_0x8ebf3f(0x264)][_0x8ebf3f(0x3bd)]===0x0)return;console[_0x8ebf3f(0x2f0)]('\x0a'+a31_0x388bb2['dim'](_0x8ebf3f(0x2ac))+'\x20'+a31_0x388bb2[_0x8ebf3f(0x396)]('('+_0x3ceced+')'));for(const _0x3b6013 of _0x1efecb[_0x8ebf3f(0x264)]){const _0x434146=_0x3b6013['schemaValid']?a31_0x388bb2[_0x8ebf3f(0x327)]('✔'):a31_0x388bb2['red']('✘');let _0x568602='';if(_0x3b6013[_0x8ebf3f(0x272)]&&_0x3b6013[_0x8ebf3f(0x217)]!==undefined&&_0x3b6013[_0x8ebf3f(0x329)]!==undefined){const _0x114976=_0x3b6013['customerPercent']?.[_0x8ebf3f(0x2e9)](0x1)||'?',_0x50a270=(_0x3b6013[_0x8ebf3f(0x378)]??0x0)>=0x32?a31_0x388bb2[_0x8ebf3f(0x327)]:(_0x3b6013[_0x8ebf3f(0x378)]??0x0)>=0x14?a31_0x388bb2[_0x8ebf3f(0x361)]:a31_0x388bb2[_0x8ebf3f(0x37a)];_0x568602='\x20'+a31_0x388bb2[_0x8ebf3f(0x396)](_0x8ebf3f(0x1c6))+'\x20'+_0x50a270(formatRows(_0x3b6013[_0x8ebf3f(0x217)]))+'\x20('+_0x114976+'%)\x20'+a31_0x388bb2[_0x8ebf3f(0x396)](_0x8ebf3f(0x200))+'\x20'+a31_0x388bb2[_0x8ebf3f(0x351)](formatRows(_0x3b6013[_0x8ebf3f(0x329)]));}console[_0x8ebf3f(0x2f0)](_0x434146+'\x20'+a31_0x388bb2['bold'](_0x3b6013[_0x8ebf3f(0x24c)])+_0x568602),console[_0x8ebf3f(0x2f0)]('\x20\x20'+a31_0x388bb2[_0x8ebf3f(0x396)]('Source:')+'\x20'+a31_0x388bb2[_0x8ebf3f(0x38a)](_0x3b6013[_0x8ebf3f(0x1fe)]+'.'+_0x3b6013[_0x8ebf3f(0x3b6)]));const _0x8adcad=_0x3b6013[_0x8ebf3f(0x2c3)]===_0x3b6013[_0x8ebf3f(0x265)]?a31_0x388bb2[_0x8ebf3f(0x396)](_0x8ebf3f(0x28e))+'\x20'+_0x3b6013[_0x8ebf3f(0x2c3)]:a31_0x388bb2['dim'](_0x8ebf3f(0x2f6))+'\x20'+_0x3b6013['joinKey']+_0x8ebf3f(0x1da)+_0x3b6013[_0x8ebf3f(0x265)];console[_0x8ebf3f(0x2f0)]('\x20\x20'+_0x8adcad),console[_0x8ebf3f(0x2f0)]('\x20\x20'+a31_0x388bb2['dim'](_0x8ebf3f(0x277))),this[_0x8ebf3f(0x1c9)](_0x3b6013[_0x8ebf3f(0x381)]),!_0x3b6013[_0x8ebf3f(0x272)]&&console[_0x8ebf3f(0x2f0)]('\x20\x20'+a31_0x388bb2[_0x8ebf3f(0x37a)](_0x8ebf3f(0x1ee))+'\x20'+_0x3b6013[_0x8ebf3f(0x1fa)]);}}[a31_0x59c470(0x1c9)](_0x1cd843){const _0x14e4dd=a31_0x59c470;for(const _0x1fbb03 of _0x1cd843){_0x1fbb03['label']===_0x1fbb03[_0x14e4dd(0x3a2)]||_0x1fbb03[_0x14e4dd(0x3a2)]==='*'?console[_0x14e4dd(0x2f0)](_0x14e4dd(0x368)+_0x1fbb03[_0x14e4dd(0x296)]):console[_0x14e4dd(0x2f0)](_0x14e4dd(0x368)+_0x1fbb03[_0x14e4dd(0x296)]+'\x20'+a31_0x388bb2['dim']('('+_0x1fbb03[_0x14e4dd(0x3a2)]+')'));}}[a31_0x59c470(0x1dc)](_0x1f34a0){const _0xcd7bd4=a31_0x59c470;console[_0xcd7bd4(0x2f0)]('─'[_0xcd7bd4(0x282)](0x3c));if(_0x1f34a0[_0xcd7bd4(0x334)][_0xcd7bd4(0x3bd)]>0x0){console[_0xcd7bd4(0x2f0)]('\x0a'+a31_0x388bb2[_0xcd7bd4(0x37a)](_0xcd7bd4(0x20f)));for(const _0x3d491f of _0x1f34a0[_0xcd7bd4(0x334)]){console[_0xcd7bd4(0x2f0)]('\x20\x20'+a31_0x388bb2['red']('•')+'\x20'+_0x3d491f);}}_0x1f34a0[_0xcd7bd4(0x2c9)]&&console[_0xcd7bd4(0x2f0)]('\x0a'+a31_0x388bb2[_0xcd7bd4(0x327)]('✔')+_0xcd7bd4(0x1c0));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{['name']='segment:parent:preview';[a31_0x59c470(0x2cf)]=a31_0x59c470(0x348);async[a31_0x59c470(0x25d)](_0xcdc57d){const _0x47ba67=a31_0x59c470,{options:_0x238b99,args:_0x1dfae2,tdx:_0x2ea181}=_0xcdc57d,_0x5b7590=_0x238b99,_0x20de22=_0x1dfae2[0x0]||_0x238b99['parentSegment'];if(!_0x20de22)return showParentSegmentNotSetError(_0x47ba67(0x3ad)+_0x47ba67(0x2a7)+_0x47ba67(0x1ac)+'\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a'+_0x47ba67(0x39d)+_0x47ba67(0x21c)+_0x47ba67(0x1d2)+'\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)'),0x1;if(!_0x5b7590[_0x47ba67(0x1ca)]&&!_0x5b7590[_0x47ba67(0x255)]&&!_0x5b7590[_0x47ba67(0x288)]&&!_0x5b7590[_0x47ba67(0x2f3)])return console[_0x47ba67(0x2f0)](a31_0x388bb2['red'](_0x47ba67(0x244))),console[_0x47ba67(0x2f0)]('Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a'),console[_0x47ba67(0x2f0)](_0x47ba67(0x37c)),console[_0x47ba67(0x2f0)]('\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data'),console['error']('\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute'),console[_0x47ba67(0x2f0)](_0x47ba67(0x3b4)),console[_0x47ba67(0x2f0)]('\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data'),0x1;const _0x520171=resolveYamlFile(_0x20de22);if(!existsSync(_0x520171))return showFileNotFoundError(_0x520171,_0x20de22),0x1;_0x5b7590[_0x47ba67(0x29a)]&&(console[_0x47ba67(0x2f0)](_0x47ba67(0x262)+_0x5b7590[_0x47ba67(0x313)]),console[_0x47ba67(0x2f0)]('YAML\x20file:\x20'+_0x520171));let _0x2b71b6;try{_0x2b71b6=readFileSync(_0x520171,'utf-8');}catch(_0x34304a){const _0x46db65=_0x34304a instanceof Error?_0x34304a[_0x47ba67(0x2b6)]:String(_0x34304a);return console[_0x47ba67(0x2f0)](_0x47ba67(0x1e7)+_0x46db65),0x1;}let _0x45d288;try{_0x45d288=parseDef(_0x2b71b6);}catch(_0x40d47c){const _0x28a350=_0x40d47c instanceof Error?_0x40d47c['message']:String(_0x40d47c);return console[_0x47ba67(0x2f0)](a31_0x388bb2[_0x47ba67(0x37a)]('Error\x20parsing\x20YAML:\x20'+_0x28a350)),0x1;}if(_0x5b7590[_0x47ba67(0x255)]===!![]||_0x5b7590[_0x47ba67(0x255)]===''){const _0xf18aef=_0x45d288[_0x47ba67(0x2a0)]?.[_0x47ba67(0x1bb)](_0x57d709=>_0x57d709[_0x47ba67(0x24c)])||[];if(_0xf18aef[_0x47ba67(0x3bd)]===0x0)console[_0x47ba67(0x2f0)](a31_0x388bb2[_0x47ba67(0x37a)](_0x47ba67(0x3a3)));else{console[_0x47ba67(0x2f0)](a31_0x388bb2[_0x47ba67(0x37a)](_0x47ba67(0x1cf))),console[_0x47ba67(0x2f0)]('Available\x20attributes:');for(const _0x5bbc6c of _0xf18aef){console['error']('\x20\x20'+a31_0x388bb2[_0x47ba67(0x351)](_0x5bbc6c));}console['error']('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0x20de22+_0x47ba67(0x32f)+_0xf18aef[0x0]+'\x22');}return 0x1;}if(_0x5b7590[_0x47ba67(0x288)]===!![]||_0x5b7590['behavior']===''){const _0x165070=_0x45d288['behaviors']?.[_0x47ba67(0x1bb)](_0x29798e=>_0x29798e['name'])||[];if(_0x165070[_0x47ba67(0x3bd)]===0x0)console[_0x47ba67(0x2f0)](a31_0x388bb2[_0x47ba67(0x37a)]('Error:\x20No\x20behaviors\x20defined\x20in\x20configuration'));else{console['error'](a31_0x388bb2[_0x47ba67(0x37a)](_0x47ba67(0x299))),console[_0x47ba67(0x2f0)](_0x47ba67(0x317));for(const _0x478dc1 of _0x165070){console['error']('\x20\x20'+a31_0x388bb2[_0x47ba67(0x351)](_0x478dc1));}console[_0x47ba67(0x2f0)](_0x47ba67(0x234)+_0x20de22+_0x47ba67(0x300)+_0x165070[0x0]+'\x22');}return 0x1;}const _0x46e955=createCommandSpinner(a31_0x388bb2[_0x47ba67(0x396)]('Fetching\x20sample\x20data...'),{'verbose':_0x5b7590[_0x47ba67(0x29a)]});_0x46e955[_0x47ba67(0x2c0)]();const _0x525c99={'onProgress':_0x31401a=>{const _0x28bab2=_0x47ba67;_0x46e955[_0x28bab2(0x2d0)]=formatProgressMessage(_0x31401a);}};if(_0x5b7590[_0x47ba67(0x1ca)])_0x525c99[_0x47ba67(0x1ca)]=!![];if(_0x5b7590[_0x47ba67(0x255)]&&typeof _0x5b7590[_0x47ba67(0x255)]==='string')_0x525c99['attribute']=_0x5b7590['attribute'];if(_0x5b7590[_0x47ba67(0x288)]&&typeof _0x5b7590[_0x47ba67(0x288)]===_0x47ba67(0x1c5))_0x525c99[_0x47ba67(0x288)]=_0x5b7590[_0x47ba67(0x288)];if(_0x5b7590[_0x47ba67(0x2f3)])_0x525c99[_0x47ba67(0x2f3)]=!![];if(_0x5b7590[_0x47ba67(0x2ca)])_0x525c99[_0x47ba67(0x2ca)]=_0x5b7590[_0x47ba67(0x2ca)];let _0x157bbb;try{_0x157bbb=await _0x2ea181[_0x47ba67(0x204)][_0x47ba67(0x1f3)](_0x2b71b6,_0x525c99),_0x46e955['stop']();}catch(_0x1a821a){_0x46e955[_0x47ba67(0x224)]();throw _0x1a821a;}return await this[_0x47ba67(0x1d8)](_0x157bbb,{'master':_0x5b7590['master'],'attribute':typeof _0x5b7590[_0x47ba67(0x255)]===_0x47ba67(0x1c5)?_0x5b7590[_0x47ba67(0x255)]:undefined,'behavior':typeof _0x5b7590['behavior']===_0x47ba67(0x1c5)?_0x5b7590[_0x47ba67(0x288)]:undefined,'enriched':_0x5b7590[_0x47ba67(0x2f3)]}),_0x157bbb[_0x47ba67(0x2c9)]?0x0:0x1;}async[a31_0x59c470(0x1d8)](_0x425fd6,_0x4ab6f0){const _0x1ac5e0=a31_0x59c470;console['error']('\x0a'+a31_0x388bb2['bold'](_0x1ac5e0(0x1e3))+'\x20'+_0x425fd6[_0x1ac5e0(0x24c)]),console['error']('═'[_0x1ac5e0(0x282)](0x3c));if(_0x4ab6f0[_0x1ac5e0(0x1ca)]&&_0x425fd6['sampleData']){const _0x49d4d7=a31_0x388bb2[_0x1ac5e0(0x396)](_0x1ac5e0(0x1b4))+'\x20'+a31_0x388bb2[_0x1ac5e0(0x38a)](_0x425fd6['master'][_0x1ac5e0(0x1fe)]+'.'+_0x425fd6['master'][_0x1ac5e0(0x3b6)]);await this['displaySampleData'](_0x49d4d7,_0x425fd6[_0x1ac5e0(0x232)]);}else{if(_0x4ab6f0['attribute']&&_0x425fd6['sampleData']){const _0x314936=a31_0x388bb2['dim']('Attribute:')+'\x20'+a31_0x388bb2[_0x1ac5e0(0x38a)](_0x4ab6f0[_0x1ac5e0(0x255)]);await this[_0x1ac5e0(0x201)](_0x314936,_0x425fd6[_0x1ac5e0(0x232)]);}else{if(_0x4ab6f0[_0x1ac5e0(0x288)]&&_0x425fd6[_0x1ac5e0(0x232)]){const _0x5ad726=a31_0x388bb2['dim'](_0x1ac5e0(0x34a))+'\x20'+a31_0x388bb2[_0x1ac5e0(0x38a)](_0x4ab6f0['behavior']);await this['displaySampleData'](_0x5ad726,_0x425fd6['sampleData']);}else{if(_0x4ab6f0['enriched']&&_0x425fd6[_0x1ac5e0(0x232)]){const _0x1c23dd=a31_0x388bb2['dim'](_0x1ac5e0(0x328))+'\x20'+a31_0x388bb2['bold'](_0x1ac5e0(0x212));await this[_0x1ac5e0(0x201)](_0x1c23dd,_0x425fd6['sampleData']);}else!_0x425fd6[_0x1ac5e0(0x232)]&&console['error']('\x0aNo\x20sample\x20data\x20available');}}}if(_0x425fd6[_0x1ac5e0(0x334)]['length']>0x0){console[_0x1ac5e0(0x2f0)]('─'['repeat'](0x3c)),console[_0x1ac5e0(0x2f0)]('\x0a'+a31_0x388bb2['red'](_0x1ac5e0(0x20f)));for(const _0x4d27c0 of _0x425fd6[_0x1ac5e0(0x334)]){console['error']('\x20\x20'+a31_0x388bb2[_0x1ac5e0(0x37a)]('•')+'\x20'+_0x4d27c0);}}}async[a31_0x59c470(0x201)](_0x36d058,_0x21c5b8){const _0x2a3f5b=a31_0x59c470;if(_0x21c5b8[_0x2a3f5b(0x3bd)]===0x0){console[_0x2a3f5b(0x2f0)]('\x0a'+_0x36d058),console[_0x2a3f5b(0x2f0)](_0x2a3f5b(0x1e6));return;}console['error']('\x0a'+_0x36d058);const _0xcda6ac=Object[_0x2a3f5b(0x3bc)](_0x21c5b8[0x0])[_0x2a3f5b(0x1bb)](_0x3e25d0=>({'name':_0x3e25d0,'type':typeof _0x21c5b8[0x0][_0x3e25d0]===_0x2a3f5b(0x278)?_0x2a3f5b(0x1b0):_0x2a3f5b(0x208)})),_0x24b966={'queryId':_0x2a3f5b(0x358),'columns':_0xcda6ac,'data':_0x21c5b8,'stats':{'state':_0x2a3f5b(0x27e),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x21c5b8['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x20321c=formatAsTable(_0x24b966,_0x21c5b8[_0x2a3f5b(0x3bd)],!![]);await writeOutput(_0x20321c,undefined,'table');}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{['name']=a31_0x59c470(0x306);[a31_0x59c470(0x2cf)]=a31_0x59c470(0x216);async[a31_0x59c470(0x25d)](_0x1d4c8a){const _0x3ec1b7=a31_0x59c470,{options:_0x50d1a0,args:_0xc00351,tdx:_0x2e7f2c}=_0x1d4c8a,_0x5d9e13=_0x50d1a0,_0x496047=_0xc00351[0x0]||_0x50d1a0['parentSegment'];if(!_0x496047)return showParentSegmentNotSetError(_0x3ec1b7(0x383)+_0x3ec1b7(0x285)),0x1;const _0x3dca26=resolveYamlFile(_0x496047);if(existsSync(_0x3dca26)){_0x5d9e13[_0x3ec1b7(0x29a)]&&console[_0x3ec1b7(0x2f0)](_0x3ec1b7(0x1ef)+_0x3dca26);let _0x2e9ad0;try{_0x2e9ad0=readFileSync(_0x3dca26,_0x3ec1b7(0x1a5));}catch(_0x5067a2){const _0x2c483e=_0x5067a2 instanceof Error?_0x5067a2[_0x3ec1b7(0x2b6)]:String(_0x5067a2);return console[_0x3ec1b7(0x2f0)]('Error\x20reading\x20file:\x20'+_0x2c483e),0x1;}const _0x4dddf7=await withSpinner(_0x3ec1b7(0x30f),()=>_0x2e7f2c[_0x3ec1b7(0x204)][_0x3ec1b7(0x1a8)](_0x2e9ad0),{'verbose':_0x5d9e13[_0x3ec1b7(0x29a)]}),_0x412bef=_0x4dddf7['data'],{isNew:_0x50c439,name:_0x2e1ebf,hasChanges:_0x1aee74,diffFormatted:_0x2f5d98}=_0x412bef;if(_0x1aee74){_0x50c439?console[_0x3ec1b7(0x2f0)](_0x3ec1b7(0x22b)+_0x2e1ebf+'\x27:'):console[_0x3ec1b7(0x2f0)](_0x3ec1b7(0x3a1)+_0x2e1ebf+'\x27:');console[_0x3ec1b7(0x2f0)]('─'[_0x3ec1b7(0x282)](0x3c)),console[_0x3ec1b7(0x2f0)](_0x2f5d98),console[_0x3ec1b7(0x2f0)]('─'['repeat'](0x3c));const _0x254f3e=_0x50c439?'Create\x20parent\x20segment\x20\x27'+_0x2e1ebf+_0x3ec1b7(0x206):'Apply\x20changes\x20to\x20\x27'+_0x2e1ebf+'\x27\x20and\x20run\x20workflow?';if(!_0x5d9e13[_0x3ec1b7(0x2aa)]){if(!isInteractive())return console[_0x3ec1b7(0x2f0)](a31_0x388bb2[_0x3ec1b7(0x37a)](_0x3ec1b7(0x1b3)),_0x3ec1b7(0x280)),console[_0x3ec1b7(0x2f0)](a31_0x388bb2['dim'](_0x3ec1b7(0x3c0))),0x1;const _0x4ebaba=await confirmKey(_0x254f3e);if(!_0x4ebaba)return console[_0x3ec1b7(0x2f0)](a31_0x388bb2[_0x3ec1b7(0x361)](_0x3ec1b7(0x3b1))),0x1;}const _0x4686a8=_0x50c439?'Creating':'Updating';await withSpinner(_0x4686a8+_0x3ec1b7(0x35c)+_0x2e1ebf+_0x3ec1b7(0x2ae),()=>_0x412bef[_0x3ec1b7(0x1d0)](),{'verbose':_0x5d9e13[_0x3ec1b7(0x29a)]});const _0xacc1a9=_0x50c439?_0x3ec1b7(0x302):'Updated';console[_0x3ec1b7(0x2f0)]('✔\x20'+_0xacc1a9+'\x20parent\x20segment\x20\x27'+_0x2e1ebf+'\x27');}else console[_0x3ec1b7(0x2f0)](_0x3ec1b7(0x399)+_0x2e1ebf+_0x3ec1b7(0x2f4));}const _0x55929a=await withSpinner(_0x3ec1b7(0x22c)+_0x496047+_0x3ec1b7(0x2ae),()=>_0x2e7f2c['segment'][_0x3ec1b7(0x203)](_0x496047),{'verbose':_0x5d9e13[_0x3ec1b7(0x29a)]}),_0x491cf0=_0x55929a[_0x3ec1b7(0x330)],_0x123ac9=getConsoleUrl(_0x5d9e13[_0x3ec1b7(0x313)],_0x3ec1b7(0x335)+_0x491cf0['workflowId']+_0x3ec1b7(0x38b)+_0x491cf0['workflowSessionId']+_0x3ec1b7(0x2e0)+_0x491cf0['workflowAttemptId']);return console['error']('\x0a✔\x20Workflow\x20started'),console[_0x3ec1b7(0x2f0)]('\x20\x20'+a31_0x388bb2[_0x3ec1b7(0x396)](_0x3ec1b7(0x26b))+'\x20'+_0x491cf0['audienceId']),console[_0x3ec1b7(0x2f0)]('\x20\x20'+a31_0x388bb2['dim']('Status:')+'\x20'+_0x491cf0[_0x3ec1b7(0x293)]),console[_0x3ec1b7(0x2f0)]('\x20\x20'+a31_0x388bb2[_0x3ec1b7(0x396)]('Session:')+'\x20'+_0x491cf0[_0x3ec1b7(0x375)]),console[_0x3ec1b7(0x2f0)]('\x20\x20'+a31_0x388bb2[_0x3ec1b7(0x396)](_0x3ec1b7(0x340))+'\x20'+_0x491cf0['workflowAttemptId']),console[_0x3ec1b7(0x2f0)]('\x20\x20'+_0x123ac9),console[_0x3ec1b7(0x2f0)]('\x0a'+a31_0x388bb2[_0x3ec1b7(0x396)]('To\x20cancel:')+_0x3ec1b7(0x1d5)+_0x491cf0[_0x3ec1b7(0x230)]+'\x20kill'),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a31_0x59c470(0x24c)]=a31_0x59c470(0x27c);[a31_0x59c470(0x2cf)]=a31_0x59c470(0x2c7);async[a31_0x59c470(0x25d)](_0x1e9fbd){const _0x3a3643=a31_0x59c470,{options:_0x5d31c3,args:_0x29b1e3,tdx:_0x36fdc9}=_0x1e9fbd,_0x5da550=_0x29b1e3[0x0]||_0x5d31c3[_0x3a3643(0x2d5)];if(!_0x5da550)return showParentSegmentNotSetError(_0x3a3643(0x29b)+_0x3a3643(0x1a3)),0x1;_0x5d31c3[_0x3a3643(0x29a)]&&(console[_0x3a3643(0x2f0)](_0x3a3643(0x262)+_0x5d31c3['site']),console[_0x3a3643(0x2f0)](_0x3a3643(0x25e)+_0x5da550));const _0x19de77=await withSpinner(_0x3a3643(0x2fe)+_0x5da550+_0x3a3643(0x2ae),()=>_0x36fdc9[_0x3a3643(0x204)]['listFields'](_0x5da550),{'verbose':_0x5d31c3[_0x3a3643(0x29a)]}),_0x5eeb9a=_0x19de77[_0x3a3643(0x330)];console['error']('✔\x20Found\x20'+_0x5eeb9a[_0x3a3643(0x3bd)]+_0x3a3643(0x2ce)+(_0x5eeb9a[_0x3a3643(0x3bd)]!==0x1?'s':''));if(_0x5d31c3[_0x3a3643(0x1cc)]||_0x5d31c3['jsonl'])return await handleSDKOutput(_0x5eeb9a,_0x5d31c3),0x0;return displayFieldsHumanReadable(_0x5eeb9a,_0x5da550),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{['name']=a31_0x59c470(0x3a4);[a31_0x59c470(0x2cf)]='Show\x20parent\x20segment\x20details';async['execute'](_0x47279c){const _0x24290c=a31_0x59c470,{options:_0x51e061,args:_0x9e4dc6,tdx:_0x4a345f}=_0x47279c,_0x31c760=_0x51e061,_0x57f47f=_0x9e4dc6[0x0]||_0x51e061[_0x24290c(0x2d5)];if(!_0x57f47f)return showParentSegmentNotSetError(_0x24290c(0x25f)+_0x24290c(0x31a)+_0x24290c(0x305)+_0x24290c(0x336)),0x1;_0x51e061[_0x24290c(0x29a)]&&(console['error']('Site:\x20'+_0x51e061[_0x24290c(0x313)]),console[_0x24290c(0x2f0)](_0x24290c(0x25e)+_0x57f47f));const _0x31e807=await withSpinner(_0x24290c(0x3c1)+_0x57f47f+_0x24290c(0x2ae),()=>_0x4a345f[_0x24290c(0x204)][_0x24290c(0x1e5)](_0x57f47f),{'verbose':_0x51e061[_0x24290c(0x29a)]}),_0x2169f0=_0x31e807['data'];if(_0x31c760[_0x24290c(0x309)]){const _0x1f7ac9=getConsoleNextUrl(_0x31c760[_0x24290c(0x313)],_0x24290c(0x29d)+_0x2169f0['id']);return console[_0x24290c(0x2f0)](a31_0x388bb2['green']('✔')+_0x24290c(0x33e)+a31_0x388bb2[_0x24290c(0x351)](_0x1f7ac9)),openBrowser(_0x1f7ac9),0x0;}return await handleSingleObjectOutput(_0x2169f0,_0x51e061),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a31_0x59c470(0x24c)]=a31_0x59c470(0x315);[a31_0x59c470(0x2cf)]=a31_0x59c470(0x243);async[a31_0x59c470(0x25d)](_0x5b7ccd){const _0x42e6e2=a31_0x59c470,{options:_0x5629b6,args:_0x33e527,tdx:_0x3fec85}=_0x5b7ccd,_0x16631f=_0x5629b6,_0x19d7c3=_0x33e527[0x0]||_0x5629b6['parentSegment'];if(!_0x19d7c3)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20all\x20tables\x20(requires\x20context)\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20all\x20tables\x20for\x20parent\x20segment\x0a\x0a'+'Options:\x0a'+_0x42e6e2(0x2b2)),0x1;_0x5629b6[_0x42e6e2(0x29a)]&&(console['error'](_0x42e6e2(0x262)+_0x5629b6['site']),console[_0x42e6e2(0x2f0)](_0x42e6e2(0x25e)+_0x19d7c3));const _0xe5918d=await withSpinner(_0x42e6e2(0x36f)+_0x19d7c3+_0x42e6e2(0x2ae),()=>_0x3fec85['segment'][_0x42e6e2(0x2a6)](_0x19d7c3),{'verbose':_0x5629b6['verbose']}),_0x2e6a4d=_0xe5918d[_0x42e6e2(0x330)],_0x399e08=_0x3fec85[_0x42e6e2(0x204)]['getOutputDatabaseName'](_0x2e6a4d);if(_0x16631f['output']){const _0x419d3f=await this['collectSchema'](_0x5b7ccd,_0x19d7c3,_0x2e6a4d,_0x399e08),_0x500016=this[_0x42e6e2(0x1df)](_0x419d3f);writeFileSync(_0x16631f['output'],_0x500016);const _0x2b40cf=_0x419d3f[_0x42e6e2(0x320)][_0x42e6e2(0x381)]['length']+_0x419d3f[_0x42e6e2(0x264)][_0x42e6e2(0x291)]((_0x529b72,_0x13a957)=>_0x529b72+_0x13a957[_0x42e6e2(0x381)][_0x42e6e2(0x3bd)],0x0),_0x55079f=_0x419d3f[_0x42e6e2(0x264)][_0x42e6e2(0x2c2)](_0xa73785=>_0xa73785[_0x42e6e2(0x381)][_0x42e6e2(0x3bd)]===0x0)['length'];return console[_0x42e6e2(0x2b1)]('Schema\x20saved\x20to\x20'+_0x16631f[_0x42e6e2(0x326)]),console['log'](_0x42e6e2(0x24d)+_0x399e08),console['log'](_0x42e6e2(0x276)+_0x419d3f[_0x42e6e2(0x264)][_0x42e6e2(0x3bd)]+_0x42e6e2(0x35d)),console[_0x42e6e2(0x2b1)](_0x42e6e2(0x395)+_0x2b40cf+_0x42e6e2(0x39c)),_0x55079f>0x0&&console[_0x42e6e2(0x2b1)](_0x42e6e2(0x2e6)+_0x55079f+_0x42e6e2(0x1c1)),0x0;}console[_0x42e6e2(0x2f0)]('\x0a'+a31_0x388bb2[_0x42e6e2(0x38a)]('Output\x20Database:')+'\x20'+a31_0x388bb2[_0x42e6e2(0x351)](_0x399e08));const _0x450dde=await withSpinner('Fetching\x20customers\x20schema...',()=>_0x3fec85['segment'][_0x42e6e2(0x2f7)](_0x2e6a4d),{'verbose':_0x5629b6['verbose']});console[_0x42e6e2(0x2f0)]('\x0a'+a31_0x388bb2[_0x42e6e2(0x38a)](_0x42e6e2(0x320))+'\x20'+a31_0x388bb2[_0x42e6e2(0x396)]('('+_0x399e08+_0x42e6e2(0x377)));const _0x55c771=await executeSchemaQuery(_0x450dde[_0x42e6e2(0x330)],_0x3fec85,_0x5629b6);await handleQueryOutput(_0x55c771,_0x5629b6);const _0x13ef73=await withSpinner(_0x42e6e2(0x37e),()=>_0x3fec85['segment']['getBehaviorNames'](_0x2e6a4d),{'verbose':_0x5629b6[_0x42e6e2(0x29a)]});for(const _0x9f1f92 of _0x13ef73[_0x42e6e2(0x330)]){const _0x48e011=_0x42e6e2(0x376)+_0x9f1f92['toLowerCase']()['replace'](/\s+/g,'_'),_0x4d612b=_0x42e6e2(0x1e2)+_0x399e08+'.'+_0x48e011;console[_0x42e6e2(0x2f0)]('\x0a'+a31_0x388bb2['bold'](_0x9f1f92)+'\x20'+a31_0x388bb2[_0x42e6e2(0x396)]('('+_0x399e08+'.'+_0x48e011+')'));try{const _0x381277=await executeSchemaQuery(_0x4d612b,_0x3fec85,_0x5629b6);await handleQueryOutput(_0x381277,_0x5629b6);}catch{console[_0x42e6e2(0x2f0)](a31_0x388bb2[_0x42e6e2(0x361)](_0x42e6e2(0x269)));}}return 0x0;}async[a31_0x59c470(0x372)](_0xf1e14c,_0x54754f,_0x1e252b,_0x55f708){const _0x33deb5=a31_0x59c470,{options:_0x1d8c94,tdx:_0xd15a30}=_0xf1e14c,_0x24e85c=await withSpinner(_0x33deb5(0x287),()=>_0xd15a30[_0x33deb5(0x204)]['getParentSQL'](_0x1e252b),{'verbose':_0x1d8c94[_0x33deb5(0x29a)]}),_0x2d91bd=await executeSchemaQuery(_0x24e85c['data'],_0xd15a30,_0x1d8c94),_0x27345a=_0x2d91bd[_0x33deb5(0x330)][_0x33deb5(0x1bb)](_0x34df59=>({'name':_0x34df59[_0x33deb5(0x387)],'type':_0x34df59[_0x33deb5(0x29c)]})),_0x2ab899=await withSpinner(_0x33deb5(0x37e),()=>_0xd15a30[_0x33deb5(0x204)][_0x33deb5(0x26c)](_0x1e252b),{'verbose':_0x1d8c94[_0x33deb5(0x29a)]}),_0x42a62e=[];for(const _0x95095b of _0x2ab899[_0x33deb5(0x330)]){const _0x3b6ce8=_0x33deb5(0x376)+_0x95095b[_0x33deb5(0x36e)]()[_0x33deb5(0x251)](/\s+/g,'_'),_0x214801=_0x33deb5(0x1e2)+_0x55f708+'.'+_0x3b6ce8;let _0x1e1947=[];try{const _0x33ef5c=await executeSchemaQuery(_0x214801,_0xd15a30,_0x1d8c94);_0x1e1947=_0x33ef5c[_0x33deb5(0x330)][_0x33deb5(0x1bb)](_0x4124bf=>({'name':_0x4124bf[_0x33deb5(0x387)],'type':_0x4124bf[_0x33deb5(0x29c)]}));}catch{}_0x42a62e[_0x33deb5(0x34f)]({'table':_0x3b6ce8,'columns':_0x1e1947});}return{'database':_0x55f708,'parent_segment':_0x54754f,'parent_id':_0x1e252b,'customers':{'table':_0x33deb5(0x320),'columns':_0x27345a},'behaviors':_0x42a62e};}[a31_0x59c470(0x1df)](_0x560b54){const _0x528ad8=a31_0x59c470,_0x3871c0=_0x2c6ef4=>{const _0x508b9b=a31_0x21a0;if(_0x2c6ef4['length']===0x0)return'[]';const _0x36664f=_0x2c6ef4[_0x508b9b(0x1bb)](_0x5b2e66=>_0x508b9b(0x36a)+_0x5b2e66['name']+_0x508b9b(0x364)+_0x5b2e66[_0x508b9b(0x338)]+_0x508b9b(0x393));return'[\x0a'+_0x36664f[_0x508b9b(0x2e1)](',\x0a')+_0x508b9b(0x252);},_0x440514=_0x560b54[_0x528ad8(0x264)][_0x528ad8(0x1bb)](_0x1f3cc1=>{const _0x4bd034=_0x528ad8;return _0x4bd034(0x3b2)+_0x1f3cc1[_0x4bd034(0x3b6)]+_0x4bd034(0x254)+_0x3871c0(_0x1f3cc1[_0x4bd034(0x381)])[_0x4bd034(0x251)](/^/gm,'\x20\x20')['trim']()+_0x4bd034(0x31c);})['join'](',\x0a');return _0x528ad8(0x367)+_0x560b54[_0x528ad8(0x1fe)]+_0x528ad8(0x23c)+_0x560b54['parent_segment']+_0x528ad8(0x25b)+_0x560b54[_0x528ad8(0x1a7)]+_0x528ad8(0x23a)+_0x560b54[_0x528ad8(0x320)][_0x528ad8(0x3b6)]+'\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20'+_0x3871c0(_0x560b54[_0x528ad8(0x320)]['columns'])[_0x528ad8(0x251)](/^/gm,'\x20\x20')['trim']()+_0x528ad8(0x1ec)+_0x440514+_0x528ad8(0x2ec);}}export class ParentSegmentSQLCommand extends BaseCommand{[a31_0x59c470(0x24c)]=a31_0x59c470(0x1ea);[a31_0x59c470(0x2cf)]=a31_0x59c470(0x3a6);async['execute'](_0x14a25d){const _0x28712e=a31_0x59c470,{options:_0x5b7e5d,args:_0x3d4323,tdx:_0x5384ea}=_0x14a25d,_0x973c84=_0x3d4323[0x0]||_0x5b7e5d[_0x28712e(0x2d5)];if(!_0x973c84)return showParentSegmentNotSetError(_0x28712e(0x33b)+_0x28712e(0x2b0)),0x1;_0x5b7e5d[_0x28712e(0x29a)]&&(console['error'](_0x28712e(0x262)+_0x5b7e5d[_0x28712e(0x313)]),console[_0x28712e(0x2f0)](_0x28712e(0x25e)+_0x973c84));const _0x477793=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x973c84+'\x27...',()=>_0x5384ea['segment'][_0x28712e(0x2a6)](_0x973c84),{'verbose':_0x5b7e5d[_0x28712e(0x29a)]}),_0x1cb405=_0x477793[_0x28712e(0x330)],_0x52f754=await withSpinner(_0x28712e(0x1cb)+_0x973c84+_0x28712e(0x2ae),()=>_0x5384ea['segment'][_0x28712e(0x2f7)](_0x1cb405),{'verbose':_0x5b7e5d[_0x28712e(0x29a)]}),_0x40ddd7=_0x52f754[_0x28712e(0x330)];return _0x5b7e5d['format']===_0x28712e(0x1cc)||_0x5b7e5d[_0x28712e(0x24b)]===_0x28712e(0x2ab)?await handleSDKOutput([{'sql':_0x40ddd7}],_0x5b7e5d):console[_0x28712e(0x2b1)](_0x40ddd7),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a31_0x59c470(0x24c)]=a31_0x59c470(0x2c6);['description']=a31_0x59c470(0x34e);async[a31_0x59c470(0x25d)](_0x3187ec){const _0x5570cf=a31_0x59c470,{options:_0x192e64,args:_0x16838d,tdx:_0x201574}=_0x3187ec,_0x20bf9f=_0x16838d[0x0]||_0x192e64[_0x5570cf(0x2d5)];if(!_0x20bf9f)return showParentSegmentNotSetError(_0x5570cf(0x39e)+_0x5570cf(0x1f6)),0x1;_0x192e64[_0x5570cf(0x29a)]&&(console[_0x5570cf(0x2f0)](_0x5570cf(0x262)+_0x192e64[_0x5570cf(0x313)]),console[_0x5570cf(0x2f0)]('Parent\x20segment:\x20'+_0x20bf9f));const _0x2395c0=await withSpinner(_0x5570cf(0x36f)+_0x20bf9f+_0x5570cf(0x2ae),()=>_0x201574['segment'][_0x5570cf(0x2a6)](_0x20bf9f),{'verbose':_0x192e64[_0x5570cf(0x29a)]}),_0x4a1185=_0x2395c0[_0x5570cf(0x330)],_0x4b25c0=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x20bf9f+'\x27...',()=>_0x201574[_0x5570cf(0x204)]['getParentSQL'](_0x4a1185),{'verbose':_0x192e64[_0x5570cf(0x29a)]});let _0x4cefdd=_0x4b25c0[_0x5570cf(0x330)];const _0x3c122a=resolveLimit(_0x192e64['limit'],DEFAULT_DISPLAY_LIMIT),_0x9882d9=/\bLIMIT\s+\d+/i[_0x5570cf(0x21b)](_0x4cefdd);!_0x9882d9&&(_0x4cefdd=_0x4cefdd[_0x5570cf(0x20e)]()[_0x5570cf(0x251)](/;+$/,''),_0x4cefdd='SELECT\x20*\x20FROM\x20(\x0a'+_0x4cefdd+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x3c122a);_0x192e64[_0x5570cf(0x29a)]&&console[_0x5570cf(0x2f0)](_0x5570cf(0x294)+_0x4cefdd);const _0x20a196=await withProgressSpinner('Executing\x20parent\x20segment\x20query...',async _0xb4e061=>{const _0x358670=_0x5570cf,_0x25ea64=await _0x201574[_0x358670(0x2a5)][_0x358670(0x25d)](_0x4cefdd,{'catalog':'td','schema':'information_schema','onJobId':_0x5be5a4=>{const _0x57a3ac=_0x358670;_0xb4e061[_0x57a3ac(0x2e4)](_0x5be5a4);}});return _0x25ea64;},{'verbose':_0x192e64[_0x5570cf(0x29a)]}),_0x5e82db=_0x20a196[_0x5570cf(0x330)],_0x190b77=_0x5e82db['jobId']?_0x5570cf(0x36d)+_0x5e82db['jobId']+']':'';return console[_0x5570cf(0x2f0)](_0x5570cf(0x1c8)+_0x5e82db['stats'][_0x5570cf(0x350)][_0x5570cf(0x35e)]()+_0x5570cf(0x39f)+(_0x5570cf(0x20c)+formatElapsed(_0x5e82db['stats'][_0x5570cf(0x343)])+_0x190b77)),await handleQueryOutput(_0x5e82db,_0x192e64),0x0;}}export class PSRtListCommand extends BaseCommand{[a31_0x59c470(0x24c)]=a31_0x59c470(0x3ba);[a31_0x59c470(0x2cf)]=a31_0x59c470(0x209);async[a31_0x59c470(0x25d)](_0x23a3d6){const _0x9f99e3=a31_0x59c470,{options:_0x207e25,args:_0x86fc4c,tdx:_0x3cd26f}=_0x23a3d6,_0x3a828b=_0x86fc4c[0x0],_0x4f3a5f=await withSpinner(_0x3a828b?_0x9f99e3(0x2cb)+_0x3a828b+_0x9f99e3(0x2ae):'Listing\x20RT-enabled\x20parent\x20segments...',()=>_0x3cd26f[_0x9f99e3(0x2a1)][_0x9f99e3(0x325)](),{'verbose':_0x207e25[_0x9f99e3(0x29a)]});let _0x41e46e=_0x4f3a5f[_0x9f99e3(0x330)]['filter'](_0x17bbb3=>_0x17bbb3[_0x9f99e3(0x242)]);if(_0x3a828b){const _0x5e90ab=_0x3a828b[_0x9f99e3(0x251)](/[.+^${}()|[\]\\]/g,_0x9f99e3(0x38d))[_0x9f99e3(0x251)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x5385e6=new RegExp('^'+_0x5e90ab+'$','i');_0x41e46e=_0x41e46e[_0x9f99e3(0x2c2)](_0x516652=>_0x5385e6[_0x9f99e3(0x21b)](_0x516652[_0x9f99e3(0x24c)]));}_0x41e46e['sort']((_0x34da14,_0x31b837)=>_0x34da14[_0x9f99e3(0x24c)][_0x9f99e3(0x21a)](_0x31b837[_0x9f99e3(0x24c)])),console[_0x9f99e3(0x2f0)](_0x9f99e3(0x283)+_0x41e46e['length']+_0x9f99e3(0x3be)+(_0x41e46e['length']!==0x1?'s':''));const _0x579f30=_0x33f203=>{const _0x4eab1a=_0x9f99e3;return getConsoleNextUrl(_0x207e25[_0x4eab1a(0x313)],'/app/dw/parentSegments/'+_0x33f203);};if(_0x207e25[_0x9f99e3(0x24b)]===_0x9f99e3(0x1cc)||_0x207e25['format']===_0x9f99e3(0x2ab)){const _0x3f3315=_0x41e46e[_0x9f99e3(0x1bb)](_0x3c7a49=>({..._0x3c7a49,'url':_0x579f30(_0x3c7a49['id'])}));await handleSDKOutput(_0x3f3315,_0x207e25);}else{if(_0x41e46e[_0x9f99e3(0x3bd)]===0x0)console[_0x9f99e3(0x2b1)]('No\x20RT-enabled\x20parent\x20segments\x20found');else for(const _0x236560 of _0x41e46e){const _0x2f5ae2=_0x236560['population']?a31_0x388bb2[_0x9f99e3(0x396)]('\x20('+formatRows(_0x236560[_0x9f99e3(0x31e)])+')'):'',_0x135667=hyperlink(_0x236560[_0x9f99e3(0x24c)],_0x579f30(_0x236560['id']));console['log']('⚡\x20'+_0x135667+_0x2f5ae2);}}return 0x0;}}export class PSRtValidateCommand extends BaseParentSegmentCommand{['name']='ps:rt:validate';['description']=a31_0x59c470(0x215);async['execute'](_0x4b8104){const _0x4cece7=a31_0x59c470,{options:_0x5b08f2,args:_0x6b58ab,tdx:_0x27e9ca}=_0x4b8104,_0x33a687=_0x6b58ab[0x0]||_0x5b08f2['parentSegment'];if(!_0x33a687)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20rt\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20RT\x20config\x20(requires\x20context)\x0a'+_0x4cece7(0x1b8)),0x1;const _0x18a2cf=resolveYamlFile(_0x33a687);if(!existsSync(_0x18a2cf))return showFileNotFoundError(_0x18a2cf,_0x33a687),0x1;let _0xca1f8a;try{_0xca1f8a=readFileSync(_0x18a2cf,_0x4cece7(0x1a5));}catch(_0x330f79){const _0xaa4a3e=_0x330f79 instanceof Error?_0x330f79[_0x4cece7(0x2b6)]:String(_0x330f79);return console[_0x4cece7(0x2f0)]('Error\x20reading\x20file:\x20'+_0xaa4a3e),0x1;}const _0x123e90=createCommandSpinner(a31_0x388bb2[_0x4cece7(0x396)](_0x4cece7(0x29e)),{'verbose':_0x5b08f2[_0x4cece7(0x29a)]});_0x123e90['start']();const _0x580384={'realtime':!![],'onProgress':_0x39917a=>{const _0x10f8df=_0x4cece7;_0x123e90[_0x10f8df(0x2d0)]=formatProgressMessage(_0x39917a);}};let _0x2e86d1;try{_0x2e86d1=await _0x27e9ca[_0x4cece7(0x204)][_0x4cece7(0x23f)](_0xca1f8a,_0x580384),_0x123e90[_0x4cece7(0x224)]();}catch(_0x18fd1a){_0x123e90['stop']();throw _0x18fd1a;}console[_0x4cece7(0x2f0)]('\x0a'+a31_0x388bb2['bold']('RT\x202.0\x20Validate:')+'\x20'+_0x2e86d1[_0x4cece7(0x24c)]),console[_0x4cece7(0x2f0)]('═'[_0x4cece7(0x282)](0x3c)),displayRealtimeValidation(_0x2e86d1),console[_0x4cece7(0x2f0)]('─'[_0x4cece7(0x282)](0x3c));if(_0x2e86d1[_0x4cece7(0x334)][_0x4cece7(0x3bd)]>0x0){console[_0x4cece7(0x2f0)]('\x0a'+a31_0x388bb2[_0x4cece7(0x37a)](_0x4cece7(0x20f)));for(const _0x537baa of _0x2e86d1[_0x4cece7(0x334)]){console[_0x4cece7(0x2f0)]('\x20\x20'+a31_0x388bb2[_0x4cece7(0x37a)]('•')+'\x20'+_0x537baa);}}return _0x2e86d1[_0x4cece7(0x2c9)]&&console[_0x4cece7(0x2f0)]('\x0a'+a31_0x388bb2[_0x4cece7(0x327)]('✔')+'\x20RT\x20configuration\x20is\x20valid'),_0x2e86d1['allValid']?0x0:0x1;}}export class PSRtJnListCommand extends BaseCommand{[a31_0x59c470(0x24c)]=a31_0x59c470(0x35f);[a31_0x59c470(0x2cf)]=a31_0x59c470(0x382);async[a31_0x59c470(0x25d)](_0x54e0a1){const _0x4c887b=a31_0x59c470,{options:_0x1e68f3,args:_0x4aff78,tdx:_0x1435c5}=_0x54e0a1,_0x5c92c7=_0x4aff78[0x0]||_0x1e68f3[_0x4c887b(0x2d5)];if(!_0x5c92c7)return showParentSegmentNotSetError(_0x4c887b(0x28a)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20rt\x20jn\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20RT\x20journeys\x20for\x20specific\x20parent\x20segment'),0x1;_0x1e68f3[_0x4c887b(0x29a)]&&(console[_0x4c887b(0x2f0)](_0x4c887b(0x262)+_0x1e68f3['site']),console[_0x4c887b(0x2f0)](_0x4c887b(0x25e)+_0x5c92c7));const _0x196da6=await withSpinner(_0x4c887b(0x36f)+_0x5c92c7+_0x4c887b(0x2ae),()=>_0x1435c5[_0x4c887b(0x204)]['resolveParentId'](_0x5c92c7),{'verbose':_0x1e68f3['verbose']}),_0x5c4ce9=_0x196da6[_0x4c887b(0x330)],_0x44b6d8=await withSpinner(_0x4c887b(0x27d)+_0x5c92c7+_0x4c887b(0x2ae),()=>_0x1435c5[_0x4c887b(0x2a1)]['listJourneys'](_0x5c4ce9),{'verbose':_0x1e68f3[_0x4c887b(0x29a)]}),_0x581ebd=_0x44b6d8[_0x4c887b(0x330)];console['error'](_0x4c887b(0x283)+_0x581ebd['length']+_0x4c887b(0x30d)+(_0x581ebd[_0x4c887b(0x3bd)]!==0x1?'s':''));if(_0x1e68f3[_0x4c887b(0x24b)]===_0x4c887b(0x1cc)||_0x1e68f3[_0x4c887b(0x24b)]==='jsonl')await handleSDKOutput(_0x581ebd,_0x1e68f3);else{if(_0x581ebd[_0x4c887b(0x3bd)]===0x0)console['log'](_0x4c887b(0x388));else for(const _0x1dc90f of _0x581ebd){const _0x70147d=_0x1dc90f[_0x4c887b(0x2f2)]===_0x4c887b(0x21e)?'🚀':'📝',_0x4db47d=_0x1dc90f[_0x4c887b(0x2d2)]?a31_0x388bb2[_0x4c887b(0x361)](_0x4c887b(0x235)):'',_0x51ff05=a31_0x388bb2[_0x4c887b(0x396)]('\x20('+_0x1dc90f[_0x4c887b(0x314)]+_0x4c887b(0x211)+(_0x1dc90f[_0x4c887b(0x314)]!==0x1?'s':'')+')');console['log'](_0x70147d+'\x20'+_0x1dc90f['name']+_0x4db47d+_0x51ff05);}}return 0x0;}}export class PSRtJnPauseCommand extends BaseCommand{[a31_0x59c470(0x24c)]=a31_0x59c470(0x1ed);['description']='Pause\x20activations\x20in\x20an\x20RT\x20journey';async[a31_0x59c470(0x25d)](_0x8b0fcc){const _0x160af9=a31_0x59c470,{options:_0x35b240,args:_0x5269f0,tdx:_0x2e7a24}=_0x8b0fcc,_0x112cdd=_0x5269f0[0x0];if(!_0x112cdd)return console[_0x160af9(0x2f0)](a31_0x388bb2[_0x160af9(0x37a)](_0x160af9(0x2a8))),console[_0x160af9(0x2f0)](_0x160af9(0x1e8)),console[_0x160af9(0x2f0)](a31_0x388bb2['dim']('Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs')),0x1;_0x35b240[_0x160af9(0x29a)]&&(console[_0x160af9(0x2f0)]('Site:\x20'+_0x35b240[_0x160af9(0x313)]),console[_0x160af9(0x2f0)]('RT\x20Journey\x20ID:\x20'+_0x112cdd));const _0x159e01=await withSpinner(_0x160af9(0x2b7)+_0x112cdd+_0x160af9(0x2ae),()=>_0x2e7a24[_0x160af9(0x2a1)][_0x160af9(0x341)](_0x112cdd),{'verbose':_0x35b240[_0x160af9(0x29a)]}),_0x3da1f4=_0x159e01['data'];console[_0x160af9(0x2f0)](_0x160af9(0x26a)+_0x3da1f4['name']+'\x27');if(_0x35b240[_0x160af9(0x24b)]===_0x160af9(0x1cc)||_0x35b240[_0x160af9(0x24b)]===_0x160af9(0x2ab))await handleSDKOutput([_0x3da1f4],_0x35b240);else{const _0x23791e=_0x3da1f4[_0x160af9(0x2f2)]===_0x160af9(0x21e)?'🚀':'📝',_0x565250=_0x3da1f4[_0x160af9(0x2d2)]?a31_0x388bb2[_0x160af9(0x361)]('\x20(paused)'):'';console[_0x160af9(0x2b1)](_0x23791e+'\x20'+_0x3da1f4[_0x160af9(0x24c)]+_0x565250);}return 0x0;}}export class PSRtJnResumeCommand extends BaseCommand{[a31_0x59c470(0x24c)]='ps:rt:jn:resume';[a31_0x59c470(0x2cf)]=a31_0x59c470(0x2a4);async[a31_0x59c470(0x25d)](_0x20c449){const _0x17e438=a31_0x59c470,{options:_0x5124a0,args:_0x1ec41a,tdx:_0x4bb306}=_0x20c449,_0x50803a=_0x1ec41a[0x0];if(!_0x50803a)return console[_0x17e438(0x2f0)](a31_0x388bb2['red'](_0x17e438(0x2a8))),console[_0x17e438(0x2f0)]('Usage:\x20tdx\x20ps\x20rt\x20jn\x20resume_activations\x20<journeyId>\x0a'),console[_0x17e438(0x2f0)](a31_0x388bb2[_0x17e438(0x396)](_0x17e438(0x279))),0x1;_0x5124a0[_0x17e438(0x29a)]&&(console[_0x17e438(0x2f0)](_0x17e438(0x262)+_0x5124a0[_0x17e438(0x313)]),console[_0x17e438(0x2f0)]('RT\x20Journey\x20ID:\x20'+_0x50803a));const _0x7855a6=await withSpinner(_0x17e438(0x1ab)+_0x50803a+_0x17e438(0x2ae),()=>_0x4bb306[_0x17e438(0x2a1)][_0x17e438(0x38f)](_0x50803a),{'verbose':_0x5124a0['verbose']}),_0x47ad78=_0x7855a6['data'];console[_0x17e438(0x2f0)](_0x17e438(0x223)+_0x47ad78['name']+'\x27');if(_0x5124a0['format']===_0x17e438(0x1cc)||_0x5124a0['format']==='jsonl')await handleSDKOutput([_0x47ad78],_0x5124a0);else{const _0x3165e5=_0x47ad78['state']==='launched'?'🚀':'📝',_0x4f4faf=_0x47ad78['paused']?a31_0x388bb2['yellow'](_0x17e438(0x235)):'';console['log'](_0x3165e5+'\x20'+_0x47ad78[_0x17e438(0x24c)]+_0x4f4faf);}return 0x0;}}export class PSRtConfigVersionCommand extends BaseCommand{['name']='ps:rt:configuration_versions';['description']=a31_0x59c470(0x1ba);async[a31_0x59c470(0x25d)](_0x5d81c3){const _0x2c5ba0=a31_0x59c470,{options:_0x380f29,args:_0x386d1b,tdx:_0x5788b2}=_0x5d81c3,_0x273fa1=_0x386d1b[0x0]||_0x380f29[_0x2c5ba0(0x2d5)];if(!_0x273fa1)return showParentSegmentNotSetError('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'+_0x2c5ba0(0x274)),0x1;_0x380f29[_0x2c5ba0(0x29a)]&&(console['error']('Site:\x20'+_0x380f29['site']),console[_0x2c5ba0(0x2f0)](_0x2c5ba0(0x25e)+_0x273fa1));const _0x1ddbf8=await withSpinner(_0x2c5ba0(0x36f)+_0x273fa1+_0x2c5ba0(0x2ae),()=>_0x5788b2['segment'][_0x2c5ba0(0x2a6)](_0x273fa1),{'verbose':_0x380f29[_0x2c5ba0(0x29a)]}),_0x515071=_0x1ddbf8['data'],_0x65e1d2=await withSpinner(_0x2c5ba0(0x250)+_0x273fa1+_0x2c5ba0(0x2ae),()=>_0x5788b2[_0x2c5ba0(0x2a1)][_0x2c5ba0(0x2d1)](_0x515071),{'verbose':_0x380f29['verbose']}),_0x20f982=_0x65e1d2['data'];return console['error']('✔\x20Retrieved\x20RT\x20configuration\x20version'),_0x380f29['format']===_0x2c5ba0(0x1cc)||_0x380f29[_0x2c5ba0(0x24b)]===_0x2c5ba0(0x2ab)?await handleSDKOutput([_0x20f982],_0x380f29):(console[_0x2c5ba0(0x2b1)](_0x2c5ba0(0x28c)+_0x20f982['id']),console[_0x2c5ba0(0x2b1)](_0x2c5ba0(0x355)+_0x20f982['audienceId']),console[_0x2c5ba0(0x2b1)](_0x2c5ba0(0x229)+_0x20f982[_0x2c5ba0(0x238)]),console[_0x2c5ba0(0x2b1)](_0x2c5ba0(0x3b8)+_0x20f982['eventKind']),console['log'](_0x2c5ba0(0x22a)+_0x20f982[_0x2c5ba0(0x293)])),0x0;}}export class PSPzServiceListCommand extends BaseCommand{[a31_0x59c470(0x24c)]=a31_0x59c470(0x2bb);[a31_0x59c470(0x2cf)]=a31_0x59c470(0x226);async[a31_0x59c470(0x25d)](_0x341a73){const _0x4cf122=a31_0x59c470,{options:_0x457c5f,args:_0x39d1a7,tdx:_0x1a1a24}=_0x341a73,_0x3203d0=_0x39d1a7[0x0]||_0x457c5f[_0x4cf122(0x2d5)];if(!_0x3203d0)return showParentSegmentNotSetError(_0x4cf122(0x29f)+_0x4cf122(0x323)),0x1;const _0x2a82ae=await withSpinner(_0x4cf122(0x36f)+_0x3203d0+_0x4cf122(0x2ae),()=>_0x1a1a24[_0x4cf122(0x204)][_0x4cf122(0x2a6)](_0x3203d0),{'verbose':_0x457c5f[_0x4cf122(0x29a)]}),_0x45d6e9=_0x2a82ae[_0x4cf122(0x330)],_0xe8223b=await withSpinner(_0x4cf122(0x24a)+_0x3203d0+_0x4cf122(0x2ae),()=>_0x1a1a24['personalization'][_0x4cf122(0x325)](_0x45d6e9),{'verbose':_0x457c5f[_0x4cf122(0x29a)]}),_0x32317c=_0xe8223b[_0x4cf122(0x330)];console[_0x4cf122(0x2f0)](_0x4cf122(0x283)+_0x32317c[_0x4cf122(0x3bd)]+_0x4cf122(0x297)+(_0x32317c[_0x4cf122(0x3bd)]!==0x1?'s':''));if(_0x457c5f[_0x4cf122(0x24b)]===_0x4cf122(0x1cc)||_0x457c5f[_0x4cf122(0x24b)]===_0x4cf122(0x2ab))await handleSDKOutput(_0x32317c,_0x457c5f);else{if(_0x32317c['length']===0x0)console['log'](_0x4cf122(0x2be)),console[_0x4cf122(0x2f0)](a31_0x388bb2[_0x4cf122(0x351)](_0x4cf122(0x1a4)));else for(const _0x3fa04f of _0x32317c){console[_0x4cf122(0x2b1)](a31_0x388bb2[_0x4cf122(0x38a)](_0x3fa04f[_0x4cf122(0x24c)])+'\x20'+a31_0x388bb2[_0x4cf122(0x396)](_0x4cf122(0x3b9)+_0x3fa04f['id']+')'));_0x3fa04f['description']&&console['log']('\x20\x20'+a31_0x388bb2[_0x4cf122(0x396)](_0x3fa04f[_0x4cf122(0x2cf)]));if(_0x3fa04f[_0x4cf122(0x1eb)]&&_0x3fa04f['tokens']['length']>0x0)for(const _0x2f37c4 of _0x3fa04f[_0x4cf122(0x1eb)]){const _0x4a4a25=_0x2f37c4[_0x4cf122(0x259)]?.[_0x4cf122(0x3bd)]?_0x2f37c4[_0x4cf122(0x259)][_0x4cf122(0x2e1)](',\x20'):_0x4cf122(0x275);console[_0x4cf122(0x2b1)]('\x20\x20'+a31_0x388bb2['cyan'](_0x4cf122(0x268))+'\x20'+_0x2f37c4[_0x4cf122(0x24c)]+'\x20'+a31_0x388bb2['dim'](_0x4cf122(0x3b9)+_0x2f37c4['id']+')')),console[_0x4cf122(0x2b1)](_0x4cf122(0x1fb)+a31_0x388bb2[_0x4cf122(0x396)](_0x4cf122(0x1fc))+'\x20'+_0x4a4a25);}else console[_0x4cf122(0x2b1)]('\x20\x20'+a31_0x388bb2[_0x4cf122(0x396)]('no\x20tokens\x20configured'));}}return 0x0;}}export class PSPzServiceCreateCommand extends BaseCommand{['name']=a31_0x59c470(0x1af);['description']=a31_0x59c470(0x369);async['execute'](_0x2c3174){const _0x4de92f=a31_0x59c470,{options:_0x5b300c,args:_0x379c9e,tdx:_0x144589}=_0x2c3174,_0x321fff=_0x5b300c,_0xd9025d=_0x379c9e[0x0],_0x3cfb13=_0x379c9e[0x1]||_0x5b300c['parentSegment'];if(!_0xd9025d)return console['error'](_0x4de92f(0x266)),console['error'](_0x4de92f(0x1aa)),console[_0x4de92f(0x2f0)](_0x4de92f(0x23d)),0x1;if(!_0x3cfb13)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]\x0a'+_0x4de92f(0x23d)),0x1;const _0x587fad=await withSpinner(_0x4de92f(0x36f)+_0x3cfb13+_0x4de92f(0x2ae),()=>_0x144589['segment'][_0x4de92f(0x2a6)](_0x3cfb13),{'verbose':_0x5b300c[_0x4de92f(0x29a)]}),_0x2b98d6=_0x587fad[_0x4de92f(0x330)],_0x4d248e={'name':_0xd9025d,'description':_0x321fff[_0x4de92f(0x2cf)],'public':_0x321fff[_0x4de92f(0x1ce)]},_0x2285ff=await withSpinner(_0x4de92f(0x273)+_0xd9025d+_0x4de92f(0x2ae),()=>_0x144589[_0x4de92f(0x2f8)][_0x4de92f(0x2a2)](_0x2b98d6,_0x4d248e),{'verbose':_0x5b300c['verbose']}),_0x31fcbf=_0x2285ff['data'];return console[_0x4de92f(0x2f0)](_0x4de92f(0x301)+_0x31fcbf[_0x4de92f(0x24c)]+_0x4de92f(0x311)+_0x31fcbf['id']),await handleSDKOutput([_0x31fcbf],_0x5b300c),0x0;}}export class PSPzServiceShowCommand extends BaseCommand{['name']='ps:pz:service:show';['description']=a31_0x59c470(0x2c4);async[a31_0x59c470(0x25d)](_0x414da8){const _0x230a3d=a31_0x59c470,{options:_0xaec453,args:_0x2163b8,tdx:_0x354b1c}=_0x414da8,_0x524adc=_0x2163b8[0x0],_0x162a22=_0x2163b8[0x1]||_0xaec453['parentSegment'];if(!_0x524adc)return console[_0x230a3d(0x2f0)]('Error:\x20Service\x20ID\x20is\x20required'),console[_0x230a3d(0x2f0)](_0x230a3d(0x2ee)),console[_0x230a3d(0x2f0)](_0x230a3d(0x2a3)),0x1;if(!_0x162a22)return showParentSegmentNotSetError(_0x230a3d(0x26d)+_0x230a3d(0x2a3)),0x1;const _0x3c6aaa=await withSpinner(_0x230a3d(0x36f)+_0x162a22+_0x230a3d(0x2ae),()=>_0x354b1c[_0x230a3d(0x204)]['resolveParentId'](_0x162a22),{'verbose':_0xaec453[_0x230a3d(0x29a)]}),_0x5171a5=_0x3c6aaa['data'],_0x36e6c5=await withSpinner(_0x230a3d(0x20b)+_0x524adc+_0x230a3d(0x2ae),()=>_0x354b1c[_0x230a3d(0x2f8)]['get'](_0x5171a5,_0x524adc),{'verbose':_0xaec453[_0x230a3d(0x29a)]}),_0x5f3639=_0x36e6c5[_0x230a3d(0x330)];if(_0xaec453[_0x230a3d(0x1cc)]||_0xaec453[_0x230a3d(0x2ab)])await handleSDKOutput([_0x5f3639],_0xaec453);else{console[_0x230a3d(0x2b1)](a31_0x388bb2[_0x230a3d(0x38a)](_0x5f3639[_0x230a3d(0x24c)])+'\x20'+a31_0x388bb2[_0x230a3d(0x396)](_0x230a3d(0x3b9)+_0x5f3639['id']+')'));_0x5f3639[_0x230a3d(0x2cf)]&&console[_0x230a3d(0x2b1)]('\x20\x20'+a31_0x388bb2[_0x230a3d(0x396)](_0x5f3639[_0x230a3d(0x2cf)]));console[_0x230a3d(0x2b1)]('\x20\x20'+a31_0x388bb2[_0x230a3d(0x351)](_0x230a3d(0x1e4))+'\x20'+(_0x5f3639[_0x230a3d(0x1ce)]?'yes':'no'));if(_0x5f3639[_0x230a3d(0x1eb)]&&_0x5f3639['tokens']['length']>0x0)for(const _0x4fb4dd of _0x5f3639['tokens']){const _0x3872ba=_0x4fb4dd[_0x230a3d(0x259)]?.[_0x230a3d(0x3bd)]?_0x4fb4dd[_0x230a3d(0x259)]['join'](',\x20'):'any';console[_0x230a3d(0x2b1)]('\x20\x20'+a31_0x388bb2[_0x230a3d(0x351)](_0x230a3d(0x268))+'\x20'+_0x4fb4dd[_0x230a3d(0x24c)]+'\x20'+a31_0x388bb2[_0x230a3d(0x396)]('(id:\x20'+_0x4fb4dd['id']+')')),console['log'](_0x230a3d(0x1fb)+a31_0x388bb2[_0x230a3d(0x396)](_0x230a3d(0x1fc))+'\x20'+_0x3872ba);}else console['log']('\x20\x20'+a31_0x388bb2[_0x230a3d(0x396)](_0x230a3d(0x2cc)));}return 0x0;}}export class PSPzServiceDeleteCommand extends BaseCommand{['name']=a31_0x59c470(0x239);['description']=a31_0x59c470(0x2dc);async['execute'](_0x56c884){const _0x3d6251=a31_0x59c470,{options:_0x49c6b8,args:_0x1453f8,tdx:_0x29b0d8}=_0x56c884,_0x15addb=_0x1453f8[0x0],_0x6a440a=_0x1453f8[0x1]||_0x49c6b8[_0x3d6251(0x2d5)];if(!_0x15addb)return console[_0x3d6251(0x2f0)](_0x3d6251(0x373)),console['error'](_0x3d6251(0x2bd)),console[_0x3d6251(0x2f0)](_0x3d6251(0x248)),0x1;if(!_0x6a440a)return showParentSegmentNotSetError(_0x3d6251(0x228)+_0x3d6251(0x248)),0x1;const _0x57d497=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x6a440a+_0x3d6251(0x2ae),()=>_0x29b0d8[_0x3d6251(0x204)][_0x3d6251(0x2a6)](_0x6a440a),{'verbose':_0x49c6b8[_0x3d6251(0x29a)]}),_0x430ef6=_0x57d497[_0x3d6251(0x330)];return await withSpinner('Deleting\x20personalization\x20service\x20\x27'+_0x15addb+'\x27...',()=>_0x29b0d8[_0x3d6251(0x2f8)][_0x3d6251(0x1b7)](_0x430ef6,_0x15addb),{'verbose':_0x49c6b8[_0x3d6251(0x29a)]}),console['error'](_0x3d6251(0x1db)+_0x15addb+'\x27'),0x0;}}export class PSPzServiceUpdateCommand extends BaseCommand{[a31_0x59c470(0x24c)]=a31_0x59c470(0x1e9);[a31_0x59c470(0x2cf)]=a31_0x59c470(0x33c);async['execute'](_0x37ff39){const _0x103d43=a31_0x59c470,{options:_0x805536,args:_0x3293de,tdx:_0x23aa22}=_0x37ff39,_0x16432d=_0x805536,_0x5b573d=_0x3293de[0x0],_0x49ae28=_0x3293de[0x1]||_0x805536[_0x103d43(0x2d5)];if(!_0x5b573d)return console[_0x103d43(0x2f0)](_0x103d43(0x373)),console[_0x103d43(0x2f0)](_0x103d43(0x1b9)),console[_0x103d43(0x2f0)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x16432d['name'])return console[_0x103d43(0x2f0)]('Error:\x20--name\x20is\x20required'),console[_0x103d43(0x2f0)](_0x103d43(0x1b9)),0x1;if(!_0x49ae28)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]\x0a'+_0x103d43(0x30c)),0x1;const _0x10cbcb=await withSpinner(_0x103d43(0x36f)+_0x49ae28+_0x103d43(0x2ae),()=>_0x23aa22[_0x103d43(0x204)][_0x103d43(0x2a6)](_0x49ae28),{'verbose':_0x805536[_0x103d43(0x29a)]}),_0x1d18d4=_0x10cbcb[_0x103d43(0x330)],_0x1e9ab3={'name':_0x16432d[_0x103d43(0x24c)]};_0x16432d['description']!==undefined&&(_0x1e9ab3[_0x103d43(0x2cf)]=_0x16432d[_0x103d43(0x2cf)]);const _0xfe1397=await withSpinner(_0x103d43(0x270)+_0x5b573d+_0x103d43(0x2ae),()=>_0x23aa22['personalization'][_0x103d43(0x3ab)](_0x1d18d4,_0x5b573d,_0x1e9ab3),{'verbose':_0x805536['verbose']}),_0x49f2ea=_0xfe1397[_0x103d43(0x330)];return console[_0x103d43(0x2f0)](_0x103d43(0x1c7)+_0x49f2ea['name']+'\x27'),await handleSDKOutput([_0x49f2ea],_0x805536),0x0;}}export class PSPzServiceTokenCreateCommand extends BaseCommand{[a31_0x59c470(0x24c)]=a31_0x59c470(0x374);[a31_0x59c470(0x2cf)]=a31_0x59c470(0x3ae);async[a31_0x59c470(0x25d)](_0x2c3522){const _0x4e2a69=a31_0x59c470,{options:_0x3e9d11,args:_0x1a2c68,tdx:_0x1ef876}=_0x2c3522,_0xde2ae1=_0x3e9d11,_0xdbebb=_0x1a2c68[0x0],_0x29f7f9=_0x1a2c68[0x1],_0x369a2d=_0x1a2c68[0x2]||_0x3e9d11['parentSegment'];if(!_0xdbebb)return console[_0x4e2a69(0x2f0)](_0x4e2a69(0x256)),console[_0x4e2a69(0x2f0)](_0x4e2a69(0x2ea)),console[_0x4e2a69(0x2f0)](_0x4e2a69(0x281)),0x1;if(!_0x29f7f9)return console[_0x4e2a69(0x2f0)]('Error:\x20Service\x20ID\x20is\x20required'),console[_0x4e2a69(0x2f0)](_0x4e2a69(0x2ea)),console[_0x4e2a69(0x2f0)](_0x4e2a69(0x281)),0x1;if(!_0x369a2d)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]\x0a'+_0x4e2a69(0x281)),0x1;const _0x42aebb=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x369a2d+_0x4e2a69(0x2ae),()=>_0x1ef876[_0x4e2a69(0x204)]['resolveParentId'](_0x369a2d),{'verbose':_0x3e9d11[_0x4e2a69(0x29a)]}),_0x55b7f0=_0x42aebb['data'],_0x4b804d={'name':_0xdbebb};_0xde2ae1['allowedIps']&&(_0x4b804d[_0x4e2a69(0x259)]=_0xde2ae1['allowedIps'][_0x4e2a69(0x2ed)](',')[_0x4e2a69(0x1bb)](_0x32f799=>_0x32f799[_0x4e2a69(0x20e)]()));_0xde2ae1[_0x4e2a69(0x2cf)]&&(_0x4b804d['description']=_0xde2ae1['description']);const _0x5e7f8f=await withSpinner(_0x4e2a69(0x3aa)+_0xdbebb+_0x4e2a69(0x249)+_0x29f7f9+'\x27...',()=>_0x1ef876['personalization'][_0x4e2a69(0x32a)](_0x55b7f0,_0x29f7f9,_0x4b804d),{'verbose':_0x3e9d11[_0x4e2a69(0x29a)]}),_0x105b5b=_0x5e7f8f[_0x4e2a69(0x330)];return console[_0x4e2a69(0x2f0)](_0x4e2a69(0x2f9)+_0x105b5b['name']+_0x4e2a69(0x311)+_0x105b5b['id']),_0x105b5b['value']&&(console[_0x4e2a69(0x2f0)](a31_0x388bb2['yellow'](_0x4e2a69(0x2b9))),console[_0x4e2a69(0x2f0)](a31_0x388bb2[_0x4e2a69(0x351)](_0x105b5b['value'])),console[_0x4e2a69(0x2f0)]('')),await handleSDKOutput([_0x105b5b],_0x3e9d11),0x0;}}export class PSPzServiceTokenDeleteCommand extends BaseCommand{[a31_0x59c470(0x24c)]='ps:pz:service:token:delete';['description']=a31_0x59c470(0x3a7);async[a31_0x59c470(0x25d)](_0x336dd2){const _0x4429c8=a31_0x59c470,{options:_0xeb4a99,args:_0x25c7d9,tdx:_0x56c149}=_0x336dd2,_0x5952e6=_0x25c7d9[0x0],_0x4dde80=_0x25c7d9[0x1]||_0xeb4a99[_0x4429c8(0x2d5)];if(!_0x5952e6)return console[_0x4429c8(0x2f0)](_0x4429c8(0x25a)),console[_0x4429c8(0x2f0)](_0x4429c8(0x2ff)),console[_0x4429c8(0x2f0)](_0x4429c8(0x370)),0x1;if(!_0x4dde80)return showParentSegmentNotSetError(_0x4429c8(0x30b)+_0x4429c8(0x370)),0x1;const _0x48fbc2=await withSpinner(_0x4429c8(0x36f)+_0x4dde80+'\x27...',()=>_0x56c149[_0x4429c8(0x204)][_0x4429c8(0x2a6)](_0x4dde80),{'verbose':_0xeb4a99[_0x4429c8(0x29a)]}),_0x209bd9=_0x48fbc2[_0x4429c8(0x330)],_0x2676b9=await withSpinner('Finding\x20service\x20for\x20token...',()=>_0x56c149[_0x4429c8(0x2f8)][_0x4429c8(0x325)](_0x209bd9),{'verbose':_0xeb4a99[_0x4429c8(0x29a)]}),_0x41e809=_0x2676b9[_0x4429c8(0x330)];let _0x621f9a;for(const _0x57b287 of _0x41e809){if(_0x57b287[_0x4429c8(0x1eb)]?.[_0x4429c8(0x257)](_0x51f0e2=>_0x51f0e2['id']===_0x5952e6)){_0x621f9a=_0x57b287['id'];break;}}if(!_0x621f9a)return console[_0x4429c8(0x2f0)]('Error:\x20Token\x20\x27'+_0x5952e6+_0x4429c8(0x245)),0x1;const _0x1c6324=await withSpinner(_0x4429c8(0x1b5)+_0x5952e6+'\x27...',()=>_0x56c149[_0x4429c8(0x2f8)]['deleteToken'](_0x209bd9,_0x621f9a,_0x5952e6),{'verbose':_0xeb4a99[_0x4429c8(0x29a)]}),_0x5639b3=_0x1c6324[_0x4429c8(0x330)];return console[_0x4429c8(0x2f0)](_0x4429c8(0x2fc)+(_0x5639b3['name']||_0x5952e6)+'\x27'),await handleSDKOutput([_0x5639b3],_0xeb4a99),0x0;}}export class PSPzListCommand extends BaseCommand{[a31_0x59c470(0x24c)]='ps:pz:list';[a31_0x59c470(0x2cf)]=a31_0x59c470(0x3ac);async['execute'](_0x314ef7){const _0x57838b=a31_0x59c470,{options:_0x56b8bc,args:_0x312663,tdx:_0x12dc07}=_0x314ef7,_0x4c84b4=_0x312663[0x0]||_0x56b8bc[_0x57838b(0x2d5)];if(!_0x4c84b4)return showParentSegmentNotSetError(_0x57838b(0x379)+_0x57838b(0x2e8)),0x1;const _0xcb86e0=await withSpinner(_0x57838b(0x36f)+_0x4c84b4+'\x27...',()=>_0x12dc07['segment'][_0x57838b(0x2a6)](_0x4c84b4),{'verbose':_0x56b8bc[_0x57838b(0x29a)]}),_0x2472ef=_0xcb86e0[_0x57838b(0x330)],_0x5b696a=await withSpinner(_0x57838b(0x2f5)+_0x4c84b4+_0x57838b(0x2ae),()=>_0x12dc07[_0x57838b(0x2f8)][_0x57838b(0x2b4)](_0x2472ef),{'verbose':_0x56b8bc[_0x57838b(0x29a)]}),_0x55a820=_0x5b696a[_0x57838b(0x330)];console[_0x57838b(0x2f0)](_0x57838b(0x283)+_0x55a820[_0x57838b(0x3bd)]+_0x57838b(0x391)+(_0x55a820['length']!==0x1?'s':''));if(_0x56b8bc['format']==='json'||_0x56b8bc['format']===_0x57838b(0x2ab))await handleSDKOutput(_0x55a820,_0x56b8bc);else{if(_0x55a820[_0x57838b(0x3bd)]===0x0)console[_0x57838b(0x2b1)](_0x57838b(0x2db));else for(const _0x4c79e9 of _0x55a820){console[_0x57838b(0x2b1)](a31_0x388bb2[_0x57838b(0x38a)](_0x4c79e9[_0x57838b(0x24c)])+'\x20'+a31_0x388bb2[_0x57838b(0x396)]('(id:\x20'+_0x4c79e9['id']+')'));_0x4c79e9['description']&&console[_0x57838b(0x2b1)]('\x20\x20'+a31_0x388bb2[_0x57838b(0x396)](_0x4c79e9['description']));const _0x2f2769=_0x4c79e9['sections']?.[_0x57838b(0x3bd)]||0x0;console[_0x57838b(0x2b1)]('\x20\x20'+a31_0x388bb2[_0x57838b(0x351)](_0x57838b(0x398))+'\x20'+_0x2f2769);if(_0x4c79e9['sections']&&_0x4c79e9[_0x57838b(0x312)]['length']>0x0)for(const _0x1a5957 of _0x4c79e9[_0x57838b(0x312)]){console[_0x57838b(0x2b1)](_0x57838b(0x368)+_0x1a5957[_0x57838b(0x24c)]);}}}return 0x0;}}export class PSPzShowCommand extends BaseCommand{['name']=a31_0x59c470(0x337);[a31_0x59c470(0x2cf)]=a31_0x59c470(0x35b);async[a31_0x59c470(0x25d)](_0x3801d5){const _0x5608a9=a31_0x59c470,{options:_0xd0bd7d,args:_0x1dfd27,tdx:_0x29a428}=_0x3801d5,_0x17c80c=_0x1dfd27[0x0];if(!_0x17c80c)return console[_0x5608a9(0x2f0)](_0x5608a9(0x32c)),console[_0x5608a9(0x2f0)](_0x5608a9(0x290)),0x1;const _0x2d277d=await withSpinner(_0x5608a9(0x1bf)+_0x17c80c+_0x5608a9(0x2ae),()=>_0x29a428[_0x5608a9(0x2f8)]['getPersonalization'](_0x17c80c),{'verbose':_0xd0bd7d[_0x5608a9(0x29a)]}),_0x3574fa=_0x2d277d[_0x5608a9(0x330)];console[_0x5608a9(0x2f0)](_0x5608a9(0x1d9)+_0x3574fa['name']+'\x27');if(_0xd0bd7d['format']===_0x5608a9(0x1cc)||_0xd0bd7d[_0x5608a9(0x24b)]===_0x5608a9(0x2ab))await handleSDKOutput([_0x3574fa],_0xd0bd7d);else{console[_0x5608a9(0x2b1)](a31_0x388bb2[_0x5608a9(0x38a)](_0x3574fa['name'])+'\x20'+a31_0x388bb2[_0x5608a9(0x396)](_0x5608a9(0x3b9)+_0x3574fa['id']+')'));_0x3574fa['description']&&console['log']('\x20\x20'+a31_0x388bb2[_0x5608a9(0x396)](_0x3574fa[_0x5608a9(0x2cf)]));_0x3574fa[_0x5608a9(0x222)]&&console[_0x5608a9(0x2b1)]('\x20\x20'+a31_0x388bb2[_0x5608a9(0x351)](_0x5608a9(0x1b1))+'\x20'+_0x3574fa['audienceId']);console[_0x5608a9(0x2b1)]('\x20\x20'+a31_0x388bb2[_0x5608a9(0x351)](_0x5608a9(0x3a9))+'\x20'+_0x3574fa[_0x5608a9(0x1d1)]),console[_0x5608a9(0x2b1)]('\x20\x20'+a31_0x388bb2[_0x5608a9(0x351)](_0x5608a9(0x225))+'\x20'+_0x3574fa[_0x5608a9(0x2af)]);const _0x7b0605=_0x3574fa[_0x5608a9(0x312)]?.[_0x5608a9(0x3bd)]||0x0;console['log']('\x20\x20'+a31_0x388bb2['cyan'](_0x5608a9(0x398))+'\x20'+_0x7b0605);if(_0x3574fa[_0x5608a9(0x312)]&&_0x3574fa[_0x5608a9(0x312)]['length']>0x0)for(const _0x4bd9d3 of _0x3574fa[_0x5608a9(0x312)]){console[_0x5608a9(0x2b1)](_0x5608a9(0x1fb)+a31_0x388bb2[_0x5608a9(0x38a)](_0x4bd9d3[_0x5608a9(0x24c)])+'\x20'+a31_0x388bb2['dim'](_0x5608a9(0x3b9)+_0x4bd9d3['id']+')')),_0x4bd9d3[_0x5608a9(0x2e3)]&&(console[_0x5608a9(0x2b1)](_0x5608a9(0x1c2)+a31_0x388bb2['cyan'](_0x5608a9(0x2ad))+'\x20'+_0x4bd9d3[_0x5608a9(0x2e3)]['name']),_0x4bd9d3[_0x5608a9(0x2e3)][_0x5608a9(0x233)]?.[_0x5608a9(0x304)]&&console['log']('\x20\x20\x20\x20\x20\x20\x20\x20'+a31_0x388bb2[_0x5608a9(0x351)](_0x5608a9(0x1d3))+'\x20'+_0x4bd9d3[_0x5608a9(0x2e3)]['keyEventCriteria'][_0x5608a9(0x304)])),_0x4bd9d3[_0x5608a9(0x21f)]&&console['log'](_0x5608a9(0x1c2)+a31_0x388bb2[_0x5608a9(0x351)](_0x5608a9(0x24f))+'\x20'+JSON[_0x5608a9(0x1e0)](_0x4bd9d3[_0x5608a9(0x21f)])),_0x4bd9d3[_0x5608a9(0x3b7)]&&console[_0x5608a9(0x2b1)](_0x5608a9(0x1c2)+a31_0x388bb2['cyan'](_0x5608a9(0x36b))+_0x5608a9(0x23b));}}return 0x0;}}export class PSPzDeleteCommand extends BaseCommand{['name']='ps:pz:delete';['description']=a31_0x59c470(0x32d);async[a31_0x59c470(0x25d)](_0x240153){const _0x4b26cc=a31_0x59c470,{options:_0x8126bc,args:_0x38fd61,tdx:_0x25a8fa}=_0x240153,_0x191d67=_0x38fd61[0x0];if(!_0x191d67)return console['error'](_0x4b26cc(0x32c)),console[_0x4b26cc(0x2f0)](_0x4b26cc(0x219)),0x1;return await withSpinner(_0x4b26cc(0x2d7)+_0x191d67+_0x4b26cc(0x2ae),()=>_0x25a8fa['personalization'][_0x4b26cc(0x2b5)](_0x191d67),{'verbose':_0x8126bc[_0x4b26cc(0x29a)]}),console[_0x4b26cc(0x2f0)](_0x4b26cc(0x2cd)+_0x191d67+'\x27'),0x0;}}export class PSPzCreateCommand extends BaseCommand{[a31_0x59c470(0x24c)]='ps:pz:create';[a31_0x59c470(0x2cf)]='Create\x20a\x20realtime\x20personalization\x20entity';async[a31_0x59c470(0x25d)](_0x8b2748){const _0x4c571f=a31_0x59c470,{options:_0xfaddef,tdx:_0x19089c}=_0x8b2748,_0x3311d2=_0xfaddef;let _0x279a4e;if(_0x3311d2[_0x4c571f(0x349)]){_0x279a4e=await loadJSON(_0x3311d2[_0x4c571f(0x349)],!![]);if(!_0x279a4e[_0x4c571f(0x28d)]?.[_0x4c571f(0x36c)])return console[_0x4c571f(0x2f0)](_0x4c571f(0x261)),console['error'](_0x4c571f(0x2b3)),console[_0x4c571f(0x2f0)](_0x4c571f(0x319)),0x1;}else{if(!_0x3311d2['name'])return console[_0x4c571f(0x2f0)]('Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)'),console[_0x4c571f(0x2f0)](_0x4c571f(0x253)),console[_0x4c571f(0x2f0)](_0x4c571f(0x356)),0x1;if(_0x3311d2['description']===undefined)return console[_0x4c571f(0x2f0)]('Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)'),console['error'](_0x4c571f(0x253)),console['error'](_0x4c571f(0x356)),0x1;if(_0x3311d2['folderId']===undefined)return console[_0x4c571f(0x2f0)](_0x4c571f(0x231)),console[_0x4c571f(0x2f0)](_0x4c571f(0x241)),0x1;let _0x40f317=_0x3311d2[_0x4c571f(0x222)];if(!_0x40f317&&_0xfaddef[_0x4c571f(0x2d5)]){const _0x4c3876=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0xfaddef[_0x4c571f(0x2d5)]+'\x27...',()=>_0x19089c[_0x4c571f(0x204)]['resolveParentId'](_0xfaddef[_0x4c571f(0x2d5)]),{'verbose':_0xfaddef[_0x4c571f(0x29a)]});_0x40f317=_0x4c3876[_0x4c571f(0x330)];}let _0x4cba9f;_0x3311d2[_0x4c571f(0x312)]&&(_0x4cba9f=await loadJSON(_0x3311d2[_0x4c571f(0x312)],![]));const _0x325394=_0x3311d2[_0x4c571f(0x1de)]==='null'?null:{'id':_0x3311d2[_0x4c571f(0x1de)],'type':_0x4c571f(0x34d)};_0x279a4e={'attributes':{'name':_0x3311d2[_0x4c571f(0x24c)],'description':_0x3311d2['description']||null,..._0x40f317!==undefined&&{'audienceId':_0x40f317},..._0x4cba9f!==undefined&&{'sections':_0x4cba9f}},'relationships':{'parentFolder':{'data':_0x325394}}};}const _0x357d03=await withSpinner(_0x4c571f(0x344)+(_0x279a4e[_0x4c571f(0x2a0)]?.[_0x4c571f(0x24c)]??'')+_0x4c571f(0x2ae),()=>_0x19089c[_0x4c571f(0x2f8)][_0x4c571f(0x360)](_0x279a4e),{'verbose':_0xfaddef[_0x4c571f(0x29a)]}),_0x3a2e0d=_0x357d03['data'];return console[_0x4c571f(0x2f0)]('✔\x20Created\x20personalization\x20\x27'+_0x3a2e0d[_0x4c571f(0x24c)]+'\x27\x20with\x20ID:\x20'+_0x3a2e0d['id']),await handleSDKOutput([_0x3a2e0d],_0xfaddef),0x0;}}export class PSPzPatchCommand extends BaseCommand{[a31_0x59c470(0x24c)]=a31_0x59c470(0x384);[a31_0x59c470(0x2cf)]=a31_0x59c470(0x1ad);async[a31_0x59c470(0x25d)](_0x5a4795){const _0x1c0a99=a31_0x59c470,{options:_0x39a725,args:_0x268410}=_0x5a4795,_0x7a63f9=_0x39a725,_0x1f91ef=_0x268410[0x0];if(!_0x1f91ef)return console[_0x1c0a99(0x2f0)](_0x1c0a99(0x32c)),console[_0x1c0a99(0x2f0)](_0x1c0a99(0x22d)),console[_0x1c0a99(0x2f0)](_0x1c0a99(0x33a)),0x1;let _0x4fdf4f;if(_0x7a63f9[_0x1c0a99(0x349)])_0x4fdf4f=await loadJSON(_0x7a63f9[_0x1c0a99(0x349)],!![]);else{if(!_0x7a63f9[_0x1c0a99(0x24c)])return console[_0x1c0a99(0x2f0)]('Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)'),console[_0x1c0a99(0x2f0)](_0x1c0a99(0x22d)),0x1;if(_0x7a63f9['description']===undefined)return console['error'](_0x1c0a99(0x247)),console['error'](_0x1c0a99(0x22d)),0x1;let _0x324230;_0x7a63f9[_0x1c0a99(0x312)]&&(_0x324230=await loadJSON(_0x7a63f9[_0x1c0a99(0x312)],![])),_0x4fdf4f={'attributes':{'name':_0x7a63f9[_0x1c0a99(0x24c)],'description':_0x7a63f9[_0x1c0a99(0x2cf)]||null,..._0x324230!==undefined&&{'sections':_0x324230}}};}const {tdx:_0xb57b54}=_0x5a4795,_0x3247e6=await withSpinner(_0x1c0a99(0x31f)+_0x1f91ef+'\x27...',()=>_0xb57b54[_0x1c0a99(0x2f8)][_0x1c0a99(0x1a9)](_0x1f91ef,_0x4fdf4f),{'verbose':_0x39a725[_0x1c0a99(0x29a)]}),_0x1e4e55=_0x3247e6[_0x1c0a99(0x330)];return console[_0x1c0a99(0x2f0)](_0x1c0a99(0x394)+_0x1e4e55['name']+_0x1c0a99(0x1f2)+_0x1e4e55['id']+')'),await handleSDKOutput([_0x1e4e55],_0x39a725),0x0;}}export class PSPzInitCommand extends BaseParentSegmentCommand{[a31_0x59c470(0x24c)]='ps:pz:init';[a31_0x59c470(0x2cf)]=a31_0x59c470(0x1be);async[a31_0x59c470(0x25d)](_0x33b1b7){const _0x14982c=a31_0x59c470,{options:_0x30cb27,args:_0x3f607a}=_0x33b1b7,_0xb66cbd=_0x3f607a[0x0]||_0x30cb27[_0x14982c(0x2d5)];if(!_0xb66cbd)return showParentSegmentNotSetError(_0x14982c(0x1c4)+_0x14982c(0x1c3)),0x1;const _0x5f10f4=resolveYamlFile(_0xb66cbd);if(!existsSync(_0x5f10f4))return showFileNotFoundError(_0x5f10f4,_0xb66cbd),0x1;let _0x1c936f;try{_0x1c936f=readFileSync(_0x5f10f4,_0x14982c(0x1a5));}catch(_0x42b43f){const _0x596f80=_0x42b43f instanceof Error?_0x42b43f[_0x14982c(0x2b6)]:String(_0x42b43f);return console['error'](_0x14982c(0x1e7)+_0x596f80),0x1;}let _0x516e06;try{_0x516e06=parseDef(_0x1c936f);}catch(_0x32b1f5){const _0x3c2987=_0x32b1f5 instanceof Error?_0x32b1f5['message']:String(_0x32b1f5);return console[_0x14982c(0x2f0)](a31_0x388bb2['red'](_0x14982c(0x1d4)+_0x3c2987)),0x1;}if(_0x516e06['personalization_services']&&_0x516e06['personalization_services'][_0x14982c(0x3bd)]>0x0)return console['error'](a31_0x388bb2[_0x14982c(0x361)](_0x14982c(0x207)+_0x5f10f4)),console['error'](a31_0x388bb2[_0x14982c(0x396)](_0x14982c(0x331)+_0x516e06[_0x14982c(0x1bd)][_0x14982c(0x3bd)]+_0x14982c(0x21d))),0x1;!_0x516e06[_0x14982c(0x2a1)]&&(_0x516e06[_0x14982c(0x2a1)]={'events':[{'name':_0x14982c(0x365),'source_table':'<database>.<table>'}],'attributes':[{'name':'last_page_viewed','type':_0x14982c(0x2d8)}],'id_stitching':{'primary_key':_0x516e06[_0x14982c(0x1ca)][_0x14982c(0x3b6)]===_0x14982c(0x320)?_0x14982c(0x2b8):'user_id'}});_0x516e06[_0x14982c(0x1bd)]=[{'name':'My\x20Service','description':_0x14982c(0x258),'trigger_event':_0x14982c(0x365),'sections':[{'name':_0x14982c(0x218),'criteria':'true','attributes':[_0x14982c(0x26e)]}]}];const _0x55373b=serializeDef(_0x516e06);return writeFileSync(_0x5f10f4,_0x55373b,'utf-8'),console[_0x14982c(0x2f0)](a31_0x388bb2['green']('✔')+'\x20Added\x20personalization\x20template\x20to\x20'+a31_0x388bb2['cyan'](_0x5f10f4)),(!_0x516e06[_0x14982c(0x2a1)]||_0x1c936f['indexOf'](_0x14982c(0x3bf))===-0x1)&&console[_0x14982c(0x2f0)](a31_0x388bb2[_0x14982c(0x327)]('✔')+_0x14982c(0x33f)),console[_0x14982c(0x2f0)]('\x0a'+a31_0x388bb2['dim']('Next\x20steps:')),console[_0x14982c(0x2f0)](_0x14982c(0x333)+_0x5f10f4+_0x14982c(0x2d4)),console[_0x14982c(0x2f0)](_0x14982c(0x31b)+a31_0x388bb2[_0x14982c(0x396)]('tdx\x20ps\x20push\x20'+_0xb66cbd)+_0x14982c(0x34b)),0x0;}}
1
+ const a31_0x344d96=a31_0x2ed7;(function(_0x178abb,_0x12e2ee){const _0x3b1b25=a31_0x2ed7,_0x110131=_0x178abb();while(!![]){try{const _0xc3267b=-parseInt(_0x3b1b25(0x1ee))/0x1+parseInt(_0x3b1b25(0x1c2))/0x2+-parseInt(_0x3b1b25(0x29c))/0x3*(parseInt(_0x3b1b25(0x22d))/0x4)+parseInt(_0x3b1b25(0x322))/0x5*(-parseInt(_0x3b1b25(0x265))/0x6)+parseInt(_0x3b1b25(0x17d))/0x7*(parseInt(_0x3b1b25(0x21e))/0x8)+-parseInt(_0x3b1b25(0x261))/0x9+-parseInt(_0x3b1b25(0x2ec))/0xa*(-parseInt(_0x3b1b25(0x187))/0xb);if(_0xc3267b===_0x12e2ee)break;else _0x110131['push'](_0x110131['shift']());}catch(_0x289b19){_0x110131['push'](_0x110131['shift']());}}}(a31_0x5a67,0xf1b5b));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a31_0x4a85ff from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,createCommandSpinner,formatElapsed}from'../utils/spinner.js';function a31_0x5a67(){const _0x539407=['td_client_id','SQL\x20query:\x0a','reduce','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','createPersonalization','Master\x20+\x20Attributes','Finding\x20service\x20for\x20token...','attributes','segment:parent:view','Default','/attempt/','pullParentYaml','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','site','behavior_','Update\x20a\x20realtime\x20personalization\x20entity','displaySampleData','\x20behaviors','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','328QBuxMg','No\x20personalization\x20services\x20configured','log','✔\x20Created\x20token\x20\x27','jsonl','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','keyEventCriteria','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context','stop','Errors:','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','xdg-open','/\x20→\x20','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','validateParentYaml','4gMDMvr','\x0a⚠️\x20\x20Both\x20','\x20(paused)','\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a','includeSensitive','\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22','Create\x20a\x20personalization\x20service\x20for\x20a\x20parent\x20segment','Personalization:','\x0aNo\x20sample\x20data\x20available','segment:parent:push','true','some','double','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context','Found\x20YAML\x20file:\x20','isDirectory','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','parent_segment','segment:parent:desc','displayBehaviorsStats','workflowSessionId','My\x20Service','✔\x20Found\x20','Schema\x20saved\x20to\x20','ps:pz:service:create','updateParent','sourceTableError','(id:\x20','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','Coverage:','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','.yaml','Error:\x20Parent\x20segment\x20name\x20is\x20required','Error:\x20\x22relationships.parentFolder\x22\x20is\x20required\x20in\x20the\x20JSON\x20file.','\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20','start','Attempt:','YAML\x20file:\x20','\x0a\x20\x20]\x0a}\x0a','✔\x20Retrieved\x20RT\x20configuration\x20version','allValid','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','Attribute:','Show\x20parent\x20segment\x20schema\x20(column\x20types)','personalization_services','Get\x20SQL\x20query\x20for\x20parent\x20segment','.yml','displayRealtimeInfo','displayMasterInfo','RT\x202.0\x20Validate:','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','13865193nlfnbS','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','Source:','create','18LKGyUm','bold','customerGroupFile','errors','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20rt\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20RT\x20config\x20for\x20specific\x20parent\x20segment','joinKey','\x20service(s)\x20configured','enriched','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID,\x20then\x20add:','Options\x20(one\x20required):\x0a','population','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','Available\x20behaviors:','audienceId:\x20','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','\x0a\x20\x20\x20\x20]','identifier:\x20','indexOf','segment:parent:fields','personalization','ps:rt:jn:resume','\x20\x20\x22relationships\x22:\x20{\x20\x22parentFolder\x22:\x20{\x20\x22data\x22:\x20{\x20\x22id\x22:\x20\x22<id>\x22,\x20\x22type\x22:\x20\x22folder-segment\x22\x20}\x20}\x20}','\x20tdx\x20wf\x20attempt\x20','replace','getCurrentConfigVersion','displayPreviewHints','-1d','session','behaviors','test','ps:pz:service:show','output','Aborted.','Executing\x20parent\x20segment\x20query...','map','Creating\x20token\x20\x27','Usage:\x20tdx\x20ps\x20pz\x20show\x20<personalization_id>','Updating\x20parent\x20segment\x20\x27','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]\x0a','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','utf-8','\x20configured','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','Overwrite\x20\x27','jobId','personalizationServices','Show\x20personalization\x20service\x20details','\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22','Error:\x20--folder-id\x20is\x20required.\x20Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID.','idStitching','Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]','attribute','Error:\x20Service\x20ID\x20is\x20required','2752845IhVqtQ','Fetching\x20customers\x20schema...','\x20Opening\x20','getBehaviorNames','eventKind:\x20','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','value','customerPercent','Show\x20a\x20specific\x20realtime\x20personalization','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]','table','description','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20rt\x20configuration_versions\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Get\x20RT\x20config\x20version\x20for\x20specific\x20parent\x20segment','\x20--behavior\x20\x22','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','%)\x20','Validate\x20RT\x202.0\x20configuration\x20from\x20parent\x20segment\x20YAML','\x0aTip:\x20Run\x20`tdx\x20ps\x20pz\x20service\x20init`\x20to\x20add\x20a\x20template\x20personalization\x20section\x20to\x20your\x20YAML','keys','entryCriteria','allowedIps','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','sampleData','Listing\x20RT\x20journeys\x20for\x20\x27','ps:pz:service:update','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','\x27\x20for\x20service\x20\x27','Join:','\x20personalization','Creating\x20personalization\x20\x27','payload:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20PZ\x20services\x20for\x20specific\x20parent\x20segment','behaviorsFile','Master\x20Table','\x22\x20}','Pattern:\x20','addAttributesFile','No\x20parent\x20segments\x20found','createParent','⚡\x20Not\x20enabled','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22','file','\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','limit','resolveParentId','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--file\x20<path>','length','Usage:\x20tdx\x20ps\x20rt\x20jn\x20pause_activations\x20<journeyId>\x0a','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]','addAttributes','Pausing\x20activations\x20for\x20RT\x20journey\x20\x27','created:','displayValidateResults','segment:parent:show','\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path','filter','List\x20realtime\x20personalizations\x20for\x20a\x20parent\x20segment','foreignKey','Resuming\x20activations\x20for\x20RT\x20journey\x20\x27','Name:\x20','\x0aUsage:\x20tdx\x20ps\x20preview\x20','Create\x20parent\x20segment\x20\x27','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','public','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','parentFolder','keyEventId','Usage:\x20tdx\x20ps\x20pz\x20delete\x20<personalization_id>','single','parent_id','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context','audienceId:','split','List\x20available\x20fields\x20for\x20segmentation','eventKind','totalEvents','\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)','32228110IjftEl','win32','\x20field','Usage:\x20tdx\x20ps\x20pz\x20service\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20PZ\x20services\x20(requires\x20context)\x0a','Fetching\x20sample\x20data...','SELECT\x20*\x20FROM\x20(\x0a','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','✔\x20Updated\x20parent\x20segment\x20\x27','sections:','✔\x20Resumed\x20activations\x20for\x20RT\x20journey\x20\x27','Usage:\x20tdx\x20ps\x20pz\x20init\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Add\x20PZ\x20template\x20(requires\x20context)\x0a','⚡\x20Enabled','\x27\x20(id:\x20','segment:parent:create','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','realtime','\x20is\x20already\x20up\x20to\x20date','\x20\x20\x20\x20\x20\x20\x20Pass\x20null\x20to\x20place\x20in\x20the\x20root\x20folder.','\x20true','\x27...','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20rt\x20jn\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20RT\x20journeys\x20for\x20specific\x20parent\x20segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>','Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a','localeCompare','sort','page_view','updated:','Usage:\x20tdx\x20ps\x20rt\x20jn\x20resume_activations\x20<journeyId>\x0a','Customers:','/\x20directory.\x0a','Error:','number','folder-segment','\x0a\x20\x20\x20\x20}','Columns:','Validating\x20RT\x20configuration...','⚠️\x20\x20personalization_services\x20section\x20already\x20exists\x20in\x20','allowed\x20IPs:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20init\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Add\x20PZ\x20template\x20for\x20specific\x20parent\x20segment','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','public:','formatSchemaJson','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','scheduleType','Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20all\x20tables\x20(requires\x20context)\x0a','👥\x20','\x20\x20Database:\x20','column','RT\x20Journey\x20ID:\x20','token:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context','previewParentYaml','3069085HTlncE','toFixed','collectSchema','tdx\x20ps\x20preview\x20','\x27\x20not\x20found\x20in\x20any\x20personalization\x20service','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','endsWith','all','addBehaviorsFile','matchedCount','Error:\x20Token\x20\x27','column_type','\x0aNew\x20parent\x20segment\x20\x27','Error:\x20Personalization\x20ID\x20is\x20required','/sessions/','dirname','message','Apply\x20changes\x20to\x20\x27','red','\x20=\x20','Listing\x20RT-enabled\x20parent\x20segments\x20matching\x20\x27','scheduleOption','name','green','label','getParentFull','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','state','List\x20parent\x20segments','{\x0a\x20\x20\x22database\x22:\x20\x22','\x20\x20\x20','processedRows','Patching\x20personalization\x20\x27','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','trim','stageCount','\x20[Job\x20ID:\x20','Master:','displaySummary','Fetching\x20current\x20configuration\x20for\x20\x27','join','null','\x22,\x20\x22type\x22:\x20\x22','column_name','getPersonalization','\x0aError:','Preview:','any','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]','events','schemaValid','\x20service','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','Join\x20on:','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','ps:rt:validate','columns','launched','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','No\x20RT-enabled\x20parent\x20segments\x20found','includeSensitive:','\x27\x20and\x20run\x20workflow?','Listing\x20fields\x20for\x20\x27','Listing\x20parent\x20segments...','\x20\x20\x20\x20','segment:parent:sql','coveragePercent','customersWithEvents','RT\x202.0:','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]\x0a','\x20total','✔\x20No\x20changes\x20-\x20\x27','yes','behavior','schemaError','Delete\x20a\x20personalization\x20service','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]\x0a','timezone','Error:\x20--name\x20is\x20required','pushParentYaml','Getting\x20personalization\x20\x27','paused','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]','\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20','toLowerCase','list','✔\x20Deleted\x20personalization\x20\x27','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','varchar','identifier','web','\x20Added\x20personalization\x20template\x20to\x20','Events:','ID\x20Stitching:','\x0a✔\x20Workflow\x20started','Error:\x20Token\x20name\x20is\x20required','cyan','/{name}.yml\x0a','Analyzing\x20changes...','\x20to\x20push\x20the\x20configuration','Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]','yellow','To\x20view\x20sample\x20data:','Options:','realtime_enabled','✔\x20Created\x20personalization\x20service\x20\x27','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','Attributes:','\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22','listFields','database','ps:pz:service:token:delete','Fetching\x20personalization\x20service\x20\x27','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','No\x20personalizations\x20configured','ps:pz:init','payload','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20all\x20tables\x20for\x20parent\x20segment\x0a\x0a','Resume\x20activations\x20in\x20an\x20RT\x20journey','\x0aChanges\x20to\x20\x27','Site:\x20','Usage:\x20tdx\x20ps\x20rt\x20configuration_versions\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Get\x20RT\x20config\x20version\x20(requires\x20context)\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20personalizations\x20for\x20specific\x20parent\x20segment','ps:pz:show','listPersonalizations','232043nduPsP','data','Personalization\x20service\x20description','stitchingKeys','ps:pz:delete','Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]','user_id','Enriched:','setJobId','Getting\x20RT\x20configuration\x20version\x20for\x20\x27','11GPFSUz','Fetching\x20behavior\x20list...','getOutputDatabaseName','\x27\x20with\x20ID:\x20','Options:\x0a','customers','folderId','/app/dw/parentSegments/','master','sections','Validate:','\x20\x20Note:\x20','status','Fetching\x20parent\x20segment\x20\x27','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','\x20stage','\x20\x20\x20\x20\x20\x20','tokens','stats','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','type','format','Listing\x20personalizations\x20for\x20\x27','\x20--interval\x20','ps:pz:service:token:create','relationships','SELECT\x20*\x20FROM\x20','\x20parent\x20segment','Usage:\x20tdx\x20ps\x20pz\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20personalizations\x20(requires\x20context)\x0a','audienceId','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context','displayAttributesStats','Error\x20parsing\x20YAML:\x20','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','execute','elapsedTimeMillis','ps:pz:create','\x20\x20Columns:\x20','Listing\x20personalization\x20services\x20for\x20\x27','string','ps:rt:configuration_versions','getParentSQL','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','Error\x20reading\x20file:\x20','✔\x20Updated\x20personalization\x20service\x20\x27','Attributes','No\x20RT\x20journeys\x20found','attributesFile','`\x20to\x20download\x20the\x20configuration\x20first','Deleting\x20personalization\x20service\x20\x27','text','dim','Create\x20a\x20token\x20for\x20a\x20personalization\x20service','✔\x20Renamed\x20directory\x20to\x20','Created','Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','\x20parent\x20segment\x20\x27','✔\x20Query\x20completed:\x20Processed\x20','List\x20parent\x20segments\x20with\x20RT\x202.0\x20status','3722362AhtQCt','\x20\x20Tables:\x201\x20customers\x20+\x20','\x5c$&','keyEventId:','List\x20personalization\x20services\x20for\x20a\x20parent\x20segment','\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22','Parent\x20segment:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','tdx\x20ps\x20push\x20','customerGroup','realtime:','Creating','segment:parent:list','segment:parent:validate','information_schema','✘\x20Failed\x20to\x20rename\x20directory:\x20','Updated','delete','repeat','Resolving\x20parent\x20segment\x20\x27','Delete\x20a\x20token\x20from\x20a\x20personalization\x20service','Show\x20parent\x20segment\x20details','ignore','/\x20directories\x20exist.','error','Deleting\x20token\x20\x27','Create\x20a\x20realtime\x20personalization\x20entity','\x20--behavior\x20\x22<name>\x22','parentSegment','interval','status:\x20','Fetching\x20SQL\x20for\x20\x27','parent_segments','json','apply','in\x20','darwin','segment:parent:preview','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','<database>.<table>','Updating','workflowAttemptId','Behaviors','verbose','1153415aEIPxY','createdAt','updatedAt','listParents','Get\x20current\x20RT\x20configuration\x20version\x20status','Status:','displayPreviewResults','Error:\x20--behavior\x20requires\x20a\x20name\x0a','rowCount','.customers)','Audience\x20ID:','displayColumns','\x20\x20\x20\x20-\x20','Next\x20steps:','\x20personalization\x20service','Database:\x20','match','\x0aChanges\x20to\x20apply\x20to\x20\x27','run','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','segment','createToken','\x20rows\x20','preview','\x20No\x20changes\x20-\x20','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','\x20--attribute\x20\x22','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a'];a31_0x5a67=function(){return _0x539407;};return a31_0x5a67();}import{loadJSONFromOptions,loadJSON}from'../utils/json-loader.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{getConsoleUrl,getConsoleNextUrl}from'../sdk/client/endpoints.js';import{formatRows,formatAsTable,hyperlink}from'../sdk/util/formatters.js';import{parseDef,serializeDef}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import a31_0x251538 from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../sdk/segment/fields-display.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';const PARENT_SEGMENT_DIR=a31_0x344d96(0x1e2),LEGACY_PARENT_SEGMENT_DIR=a31_0x344d96(0x23e);function openBrowser(_0x12b4f4){const _0x3c5afa=a31_0x344d96,_0x554c72=process['platform'],_0x55b201=_0x554c72===_0x3c5afa(0x1e6)?'open':_0x554c72===_0x3c5afa(0x2ed)?_0x3c5afa(0x250):_0x3c5afa(0x229);spawn(_0x55b201,[_0x12b4f4],{'detached':!![],'stdio':_0x3c5afa(0x1d8)})['unref']();}function migrateLegacyDirectory(){const _0x5c0073=a31_0x344d96;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x1ec928=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x1ec928[_0x5c0073(0x23c)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x5c0073(0x1da)](a31_0x251538[_0x5c0073(0x387)](_0x5c0073(0x22e)+LEGACY_PARENT_SEGMENT_DIR+'/\x20and\x20'+PARENT_SEGMENT_DIR+_0x5c0073(0x1d9))),console[_0x5c0073(0x1da)](a31_0x251538['dim'](_0x5c0073(0x358)+LEGACY_PARENT_SEGMENT_DIR+_0x5c0073(0x30b))),![];console['error'](a31_0x251538[_0x5c0073(0x387)]('\x0a⚠️\x20\x20Migrating:\x20'+LEGACY_PARENT_SEGMENT_DIR+_0x5c0073(0x22a)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x5c0073(0x1da)](a31_0x251538[_0x5c0073(0x339)](_0x5c0073(0x1bc)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x442dcd){const _0x6157ef=_0x442dcd instanceof Error?_0x442dcd['message']:String(_0x442dcd);return console[_0x5c0073(0x1da)](a31_0x251538[_0x5c0073(0x334)](_0x5c0073(0x1d1)+_0x6157ef+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async['run'](_0x7ba6fa){const _0x3b5e25=a31_0x344d96;return migrateLegacyDirectory(),super[_0x3b5e25(0x200)](_0x7ba6fa);}}function resolveYamlFile(_0x3c56ee){const _0x4569b7=a31_0x344d96;if(_0x3c56ee[_0x4569b7(0x328)](_0x4569b7(0x25b))||_0x3c56ee[_0x4569b7(0x328)](_0x4569b7(0x24c)))return _0x3c56ee;return a31_0x4a85ff['join'](PARENT_SEGMENT_DIR,sanitizeFileName(_0x3c56ee)+_0x4569b7(0x25b));}function formatProgressMessage(_0x2b18dc){const _0x3ee773=a31_0x344d96,_0x55267d=_0x2b18dc[_0x3ee773(0x1fe)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x55267d){const [,_0x553d1d,_0x5281ec,_0x59cc6a='']=_0x55267d;return a31_0x251538[_0x3ee773(0x1ba)](_0x553d1d+':')+'\x20'+_0x5281ec+a31_0x251538[_0x3ee773(0x1ba)](_0x59cc6a);}return a31_0x251538[_0x3ee773(0x1ba)](_0x2b18dc);}function showFileNotFoundError(_0x33f61c,_0x103664){const _0x599f35=a31_0x344d96;console[_0x599f35(0x1da)](a31_0x251538[_0x599f35(0x334)]('Error:\x20File\x20not\x20found:\x20'+_0x33f61c+'\x0a')),console['error'](a31_0x251538['cyan'](_0x599f35(0x19a)+_0x103664+_0x599f35(0x1b7)));}function a31_0x2ed7(_0xc64dad,_0x5a33e3){_0xc64dad=_0xc64dad-0x169;const _0x5a6779=a31_0x5a67();let _0x2ed7bb=_0x5a6779[_0xc64dad];return _0x2ed7bb;}function displayRealtimeValidation(_0x3a6d74){const _0x1467c0=a31_0x344d96;if(!_0x3a6d74[_0x1467c0(0x2fd)])return;const _0x6f78e3=_0x3a6d74[_0x1467c0(0x2fd)],_0x110d89=_0x6f78e3['enabled']?a31_0x251538['green'](_0x1467c0(0x2f9)):a31_0x251538['yellow'](_0x1467c0(0x2c4));console[_0x1467c0(0x1da)]('\x0a'+a31_0x251538[_0x1467c0(0x1ba)](_0x1467c0(0x366))+'\x20'+_0x110d89);if(_0x6f78e3['events']&&_0x6f78e3[_0x1467c0(0x353)][_0x1467c0(0x2cd)]>0x0){console['error']('\x20\x20'+a31_0x251538['dim'](_0x1467c0(0x37e))+'\x20'+_0x6f78e3['events']['length']+_0x1467c0(0x28f));for(const _0x4f78a7 of _0x6f78e3[_0x1467c0(0x353)]){const _0xa6f877=_0x4f78a7['sourceTableValid']===![]?a31_0x251538[_0x1467c0(0x334)]('✘'):a31_0x251538['green']('✔');console[_0x1467c0(0x1da)](_0x1467c0(0x362)+_0xa6f877+'\x20'+_0x4f78a7['name']),_0x4f78a7['sourceTableError']&&console[_0x1467c0(0x1da)](_0x1467c0(0x197)+a31_0x251538[_0x1467c0(0x334)](_0x4f78a7[_0x1467c0(0x247)]));}}if(_0x6f78e3[_0x1467c0(0x211)]&&_0x6f78e3[_0x1467c0(0x211)][_0x1467c0(0x2cd)]>0x0){console[_0x1467c0(0x1da)]('\x20\x20'+a31_0x251538[_0x1467c0(0x1ba)](_0x1467c0(0x16b))+'\x20'+_0x6f78e3['attributes']['length']+'\x20configured');for(const _0x2eea95 of _0x6f78e3[_0x1467c0(0x211)]){const _0x1fa865=_0x2eea95['valid']?a31_0x251538[_0x1467c0(0x339)]('✔'):a31_0x251538[_0x1467c0(0x334)]('✘');console['error']('\x20\x20\x20\x20'+_0x1fa865+'\x20'+_0x2eea95[_0x1467c0(0x338)]+'\x20'+a31_0x251538[_0x1467c0(0x1ba)]('('+_0x2eea95[_0x1467c0(0x19b)]+')'));}}if(_0x6f78e3[_0x1467c0(0x297)]){const _0x42ab78=_0x6f78e3[_0x1467c0(0x297)][_0x1467c0(0x180)]?.['length']?'\x20+\x20['+_0x6f78e3['idStitching'][_0x1467c0(0x180)][_0x1467c0(0x34a)](',\x20')+']':'';console[_0x1467c0(0x1da)]('\x20\x20'+a31_0x251538['dim'](_0x1467c0(0x37f))+'\x20'+_0x6f78e3[_0x1467c0(0x297)]['primaryKey']+_0x42ab78);}if(_0x6f78e3[_0x1467c0(0x293)]&&_0x6f78e3[_0x1467c0(0x293)]['length']>0x0){console[_0x1467c0(0x1da)]('\x20\x20'+a31_0x251538[_0x1467c0(0x1ba)](_0x1467c0(0x234))+'\x20'+_0x6f78e3[_0x1467c0(0x293)]['length']+_0x1467c0(0x355)+(_0x6f78e3[_0x1467c0(0x293)]['length']!==0x1?'s':''));for(const _0x1007a1 of _0x6f78e3['personalizationServices']){console[_0x1467c0(0x1da)](_0x1467c0(0x1fa)+_0x1007a1[_0x1467c0(0x338)]);}}}function showParentSegmentNotSetError(_0x2dc399){const _0x3593ac=a31_0x344d96;console[_0x3593ac(0x1da)](a31_0x251538[_0x3593ac(0x387)](_0x3593ac(0x343))),console['error'](_0x2dc399);}export class ParentSegmentListCommand extends BaseCommand{['name']=a31_0x344d96(0x1ce);[a31_0x344d96(0x2a7)]=a31_0x344d96(0x33e);async[a31_0x344d96(0x1a9)](_0x5d2bd8){const _0x76bdc5=a31_0x344d96,{options:_0x2b1c7f,args:_0x44a2cb,tdx:_0x3d2e44}=_0x5d2bd8,_0x36ed03=_0x44a2cb[0x0];_0x2b1c7f[_0x76bdc5(0x1ed)]&&(console[_0x76bdc5(0x1da)](_0x76bdc5(0x178)+_0x2b1c7f[_0x76bdc5(0x217)]),_0x36ed03&&console[_0x76bdc5(0x1da)](_0x76bdc5(0x2c0)+_0x36ed03));const _0x284c2f=await withSpinner(_0x36ed03?'Listing\x20parent\x20segments\x20matching\x20\x27'+_0x36ed03+_0x76bdc5(0x301):_0x76bdc5(0x361),()=>_0x3d2e44[_0x76bdc5(0x202)][_0x76bdc5(0x1f1)](),{'verbose':_0x2b1c7f[_0x76bdc5(0x1ed)]});let _0x1a0127=_0x284c2f['data'];if(_0x36ed03){const _0x2138f5=_0x36ed03[_0x76bdc5(0x27d)](/[.+^${}()|[\]\\]/g,'\x5c$&')[_0x76bdc5(0x27d)](/\*/g,'.*')[_0x76bdc5(0x27d)](/\?/g,'.'),_0x1fdde8=new RegExp('^'+_0x2138f5+'$','i');_0x1a0127=_0x1a0127['filter'](_0x21064c=>_0x1fdde8[_0x76bdc5(0x283)](_0x21064c[_0x76bdc5(0x211)]['name']));}_0x1a0127[_0x76bdc5(0x306)]((_0x2f4b7f,_0x2219f9)=>_0x2f4b7f[_0x76bdc5(0x211)][_0x76bdc5(0x338)][_0x76bdc5(0x305)](_0x2219f9['attributes']['name'])),console[_0x76bdc5(0x1da)]('✔\x20Found\x20'+_0x1a0127[_0x76bdc5(0x2cd)]+_0x76bdc5(0x1a2)+(_0x1a0127[_0x76bdc5(0x2cd)]!==0x1?'s':''));const _0x384839=_0x46b95e=>{const _0x50548b=_0x76bdc5;return getConsoleNextUrl(_0x2b1c7f['site'],_0x50548b(0x18e)+_0x46b95e);};if(_0x2b1c7f['format']===_0x76bdc5(0x1e3)||_0x2b1c7f['format']===_0x76bdc5(0x222)){const _0x193b07=_0x1a0127['map'](_0x3047ce=>({..._0x3047ce,'url':_0x384839(_0x3047ce['id'])}));await handleSDKOutput(_0x193b07,_0x2b1c7f);}else{if(_0x1a0127[_0x76bdc5(0x2cd)]===0x0)_0x36ed03?console[_0x76bdc5(0x220)]('No\x20parent\x20segments\x20match\x20pattern:\x20'+_0x36ed03):console[_0x76bdc5(0x220)](_0x76bdc5(0x2c2));else for(const _0x403a11 of _0x1a0127){const _0x3cf8e4=_0x403a11['attributes']['population']?a31_0x251538[_0x76bdc5(0x1ba)]('\x20('+formatRows(_0x403a11[_0x76bdc5(0x211)]['population'])+')'):'',_0xcf1113=hyperlink(_0x403a11[_0x76bdc5(0x211)][_0x76bdc5(0x338)],_0x384839(_0x403a11['id']));console[_0x76bdc5(0x220)](_0x76bdc5(0x31b)+_0xcf1113+_0x3cf8e4);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a31_0x344d96(0x338)]=a31_0x344d96(0x2fb);[a31_0x344d96(0x2a7)]=a31_0x344d96(0x20d);async['execute'](_0x5bf65f){const _0x57142e=a31_0x344d96,{options:_0xb76178,args:_0x5c9145,tdx:_0x4a716a}=_0x5bf65f;console[_0x57142e(0x1da)](_0x57142e(0x28d)+_0x57142e(0x2c5)+_0x57142e(0x209));const _0x339933=_0xb76178;if(_0x5c9145['length']===0x0)return console['error'](a31_0x251538['red']('Error:\x20Parent\x20segment\x20name\x20is\x20required')),console[_0x57142e(0x1da)](_0x57142e(0x23d)),0x1;const _0x320e68=_0x5c9145[0x0];if(!_0x339933[_0x57142e(0x16e)]||!_0x339933[_0x57142e(0x2a6)])return console[_0x57142e(0x1da)]('Error:\x20--database\x20and\x20--table\x20are\x20required'),console['error'](_0x57142e(0x23d)),0x1;_0x339933['verbose']&&(console['error'](_0x57142e(0x178)+_0x339933['site']),console[_0x57142e(0x1da)](_0x57142e(0x2da)+_0x320e68),console[_0x57142e(0x1da)](_0x57142e(0x1fd)+_0x339933[_0x57142e(0x16e)]),console[_0x57142e(0x1da)]('Table:\x20'+_0x339933[_0x57142e(0x2a6)]));const _0x181d1c=await loadJSONFromOptions(_0x339933[_0x57142e(0x211)],_0x339933[_0x57142e(0x1b6)]),_0x5bbae6=await loadJSONFromOptions(_0x339933[_0x57142e(0x282)],_0x339933[_0x57142e(0x2bd)]),_0x137c7b=await loadJSONFromOptions(_0x339933[_0x57142e(0x1cb)],_0x339933[_0x57142e(0x267)]),_0x848b81={'name':_0x320e68,'description':_0x339933['description'],'scheduleType':_0x339933['scheduleType'],'scheduleOption':_0x339933[_0x57142e(0x337)],'timezone':_0x339933[_0x57142e(0x36f)],'master':{'parentDatabaseName':_0x339933[_0x57142e(0x16e)],'parentTableName':_0x339933[_0x57142e(0x2a6)]},'attributes':_0x181d1c,'behaviors':_0x5bbae6,'customerGroup':_0x137c7b},_0x1e47be=await withSpinner('Creating\x20parent\x20segment\x20\x27'+_0x320e68+_0x57142e(0x301),()=>_0x4a716a['segment'][_0x57142e(0x2c3)](_0x848b81),{'verbose':_0xb76178[_0x57142e(0x1ed)]}),_0x55bd07=_0x1e47be['data'];return console[_0x57142e(0x1da)]('✔\x20Created\x20parent\x20segment\x20\x27'+_0x55bd07[_0x57142e(0x338)]+_0x57142e(0x18a)+_0x55bd07['id']),await handleSDKOutput([_0x55bd07],_0xb76178),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a31_0x344d96(0x338)]='segment:parent:update';[a31_0x344d96(0x2a7)]=a31_0x344d96(0x2fc);async['execute'](_0x5b6f21){const _0x3b8ce8=a31_0x344d96,{options:_0x2ad74c,args:_0x21e103,tdx:_0x3c4d34}=_0x5b6f21;console[_0x3b8ce8(0x1da)](_0x3b8ce8(0x24b)+'\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a'+_0x3b8ce8(0x209));const _0x2295d2=_0x2ad74c;if(_0x21e103[_0x3b8ce8(0x2cd)]===0x0)return console['error'](a31_0x251538[_0x3b8ce8(0x334)](_0x3b8ce8(0x24d))),console['error'](_0x3b8ce8(0x33c)),0x1;const _0x18f436=_0x21e103[0x0];_0x2295d2[_0x3b8ce8(0x1ed)]&&(console[_0x3b8ce8(0x1da)](_0x3b8ce8(0x178)+_0x2295d2[_0x3b8ce8(0x217)]),console[_0x3b8ce8(0x1da)](_0x3b8ce8(0x1c8)+_0x18f436));const _0x4e65b4=await withSpinner(_0x3b8ce8(0x349)+_0x18f436+_0x3b8ce8(0x301),()=>_0x3c4d34[_0x3b8ce8(0x202)][_0x3b8ce8(0x33b)](_0x18f436),{'verbose':_0x2295d2[_0x3b8ce8(0x1ed)]}),_0x36ce12=_0x4e65b4[_0x3b8ce8(0x17e)],_0x16be88=await loadJSONFromOptions(_0x2295d2[_0x3b8ce8(0x2d0)],_0x2295d2[_0x3b8ce8(0x2c1)]),_0x27837d=await loadJSONFromOptions(_0x2295d2['addBehaviors'],_0x2295d2[_0x3b8ce8(0x32a)]),_0x32c4cb={'name':_0x36ce12['name'],'description':_0x2295d2[_0x3b8ce8(0x2a7)]!==undefined?_0x2295d2[_0x3b8ce8(0x2a7)]:_0x36ce12[_0x3b8ce8(0x2a7)],'scheduleType':_0x2295d2[_0x3b8ce8(0x319)]!==undefined?_0x2295d2[_0x3b8ce8(0x319)]:_0x36ce12[_0x3b8ce8(0x319)],'scheduleOption':_0x2295d2['scheduleOption']!==undefined?_0x2295d2[_0x3b8ce8(0x337)]:_0x36ce12[_0x3b8ce8(0x337)],'timezone':_0x2295d2[_0x3b8ce8(0x36f)]!==undefined?_0x2295d2[_0x3b8ce8(0x36f)]:_0x36ce12[_0x3b8ce8(0x36f)],'master':_0x36ce12[_0x3b8ce8(0x18f)],'attributes':_0x16be88?[..._0x36ce12['attributes']||[],..._0x16be88]:_0x36ce12[_0x3b8ce8(0x211)],'behaviors':_0x27837d?[..._0x36ce12[_0x3b8ce8(0x282)]||[],..._0x27837d]:_0x36ce12[_0x3b8ce8(0x282)],'customerGroup':_0x36ce12[_0x3b8ce8(0x1cb)]},_0x23bb33=await withSpinner(_0x3b8ce8(0x28b)+_0x18f436+_0x3b8ce8(0x301),()=>_0x3c4d34['segment'][_0x3b8ce8(0x246)](_0x18f436,_0x32c4cb),{'verbose':_0x2295d2['verbose']}),_0x1d8324=_0x23bb33[_0x3b8ce8(0x17e)];return console[_0x3b8ce8(0x1da)](_0x3b8ce8(0x2f5)+_0x1d8324[_0x3b8ce8(0x338)]+'\x27'),await handleSDKOutput([_0x1d8324],_0x2295d2),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a31_0x344d96(0x338)]='segment:parent:pull';[a31_0x344d96(0x2a7)]=a31_0x344d96(0x201);async['execute'](_0x4147d){const _0x429025=a31_0x344d96,{options:_0x1bd7f1,args:_0x2447f7,tdx:_0x739242}=_0x4147d,_0x1a21af=_0x1bd7f1,_0x41f734=_0x2447f7[0x0]||_0x1bd7f1[_0x429025(0x1de)];if(!_0x41f734)return showParentSegmentNotSetError(_0x429025(0x2dd)+_0x429025(0x2f4)),0x1;if(_0x1a21af['use']&&_0x1a21af[_0x429025(0x285)])return console[_0x429025(0x1da)](a31_0x251538['red'](_0x429025(0x2a1))),console[_0x429025(0x1da)](a31_0x251538[_0x429025(0x1ba)]('The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires')),console[_0x429025(0x1da)](a31_0x251538[_0x429025(0x1ba)]('using\x20the\x20default\x20path:\x20'+PARENT_SEGMENT_DIR+_0x429025(0x383))),console[_0x429025(0x1da)](a31_0x251538[_0x429025(0x382)](_0x429025(0x262))),0x1;const _0x302ac8=_0x1a21af[_0x429025(0x285)]||a31_0x4a85ff[_0x429025(0x34a)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x41f734)+_0x429025(0x25b));_0x1a21af[_0x429025(0x1ed)]&&(console['error'](_0x429025(0x178)+_0x1a21af[_0x429025(0x217)]),console['error']('Parent\x20segment:\x20'+_0x41f734),console['error']('Output\x20file:\x20'+_0x302ac8));const _0x2ddcad=await withSpinner(_0x429025(0x194)+_0x41f734+'\x27...',()=>_0x739242['segment'][_0x429025(0x215)](_0x41f734),{'verbose':_0x1a21af[_0x429025(0x1ed)]}),_0x3686d2=_0x2ddcad['data'];if(existsSync(_0x302ac8)){const _0x32d4a2=readFileSync(_0x302ac8,_0x429025(0x28e)),_0x58b60d=generateDiff(_0x32d4a2,_0x3686d2);if(!hasChanges(_0x58b60d))console[_0x429025(0x1da)](a31_0x251538['green']('✔')+_0x429025(0x206)+a31_0x251538['cyan'](_0x302ac8)+_0x429025(0x2fe));else{console[_0x429025(0x1da)](_0x429025(0x177)+_0x302ac8+'\x27:'),console['error']('─'[_0x429025(0x1d4)](0x3c)),console[_0x429025(0x1da)](formatDiffWithColors(_0x58b60d)),console['error']('─'[_0x429025(0x1d4)](0x3c));if(!_0x1a21af[_0x429025(0x36a)]){if(!isInteractive())return console[_0x429025(0x1da)](a31_0x251538[_0x429025(0x334)](_0x429025(0x34f)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x429025(0x1da)](a31_0x251538[_0x429025(0x1ba)](_0x429025(0x379))),0x1;const _0x26416e=await confirmKey(_0x429025(0x291)+_0x302ac8+'\x27?');if(!_0x26416e)return console[_0x429025(0x1da)](a31_0x251538[_0x429025(0x387)]('Aborted.')),0x1;}writeFileSync(_0x302ac8,_0x3686d2,_0x429025(0x28e)),console[_0x429025(0x1da)](a31_0x251538[_0x429025(0x339)]('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a31_0x251538[_0x429025(0x382)](_0x302ac8));}}else{const _0x145881=a31_0x4a85ff[_0x429025(0x331)](_0x302ac8);!existsSync(_0x145881)&&mkdirSync(_0x145881,{'recursive':!![]}),writeFileSync(_0x302ac8,_0x3686d2,_0x429025(0x28e)),console[_0x429025(0x1da)](a31_0x251538[_0x429025(0x339)]('✔')+_0x429025(0x1e8)+a31_0x251538[_0x429025(0x382)](_0x302ac8));}return saveSessionContext({'parent_segment':_0x41f734},_0x1a21af[_0x429025(0x281)]),console[_0x429025(0x1da)](a31_0x251538['green']('✔')+'\x20Context\x20set:\x20'+a31_0x251538['dim'](_0x429025(0x23e))+_0x429025(0x335)+a31_0x251538[_0x429025(0x382)](_0x41f734)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a31_0x344d96(0x338)]=a31_0x344d96(0x236);[a31_0x344d96(0x2a7)]='Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file';async[a31_0x344d96(0x1a9)](_0x346f71){const _0x251ee9=a31_0x344d96,{options:_0x47ddfc,args:_0x10de82,tdx:_0x146e9e}=_0x346f71,_0x16ccaa=_0x47ddfc,_0x54c882=_0x10de82[0x0]||_0x47ddfc[_0x251ee9(0x1de)];if(!_0x54c882)return showParentSegmentNotSetError(_0x251ee9(0x2ab)+_0x251ee9(0x223)),0x1;const _0x444fbd=resolveYamlFile(_0x54c882);if(!existsSync(_0x444fbd))return showFileNotFoundError(_0x444fbd,_0x54c882),0x1;_0x16ccaa[_0x251ee9(0x1ed)]&&(console[_0x251ee9(0x1da)](_0x251ee9(0x178)+_0x16ccaa[_0x251ee9(0x217)]),console[_0x251ee9(0x1da)](_0x251ee9(0x252)+_0x444fbd));let _0x3051b6;try{_0x3051b6=readFileSync(_0x444fbd,_0x251ee9(0x28e));}catch(_0x547247){const _0x453e3d=_0x547247 instanceof Error?_0x547247[_0x251ee9(0x332)]:String(_0x547247);return console['error']('Error\x20reading\x20file:\x20'+_0x453e3d),0x1;}const _0x1a30b8=await withSpinner(_0x251ee9(0x384),()=>_0x146e9e[_0x251ee9(0x202)][_0x251ee9(0x371)](_0x3051b6),{'verbose':_0x16ccaa[_0x251ee9(0x1ed)]}),_0x1a55ef=_0x1a30b8[_0x251ee9(0x17e)],{isNew:_0x6f6212,name:_0x32fdbf,hasChanges:_0xd2b2b7,diffFormatted:_0x4e50ae}=_0x1a55ef;if(!_0xd2b2b7)return console[_0x251ee9(0x1da)](_0x251ee9(0x369)+_0x32fdbf+'\x27\x20is\x20already\x20up\x20to\x20date'),0x0;_0x6f6212?console[_0x251ee9(0x1da)]('\x0aNew\x20parent\x20segment\x20\x27'+_0x32fdbf+'\x27:'):console[_0x251ee9(0x1da)]('\x0aChanges\x20to\x20apply\x20to\x20\x27'+_0x32fdbf+'\x27:');console[_0x251ee9(0x1da)]('─'['repeat'](0x3c)),console[_0x251ee9(0x1da)](_0x4e50ae),console[_0x251ee9(0x1da)]('─'['repeat'](0x3c));const _0x193423=_0x6f6212?_0x251ee9(0x2dc)+_0x32fdbf+'\x27?':_0x251ee9(0x333)+_0x32fdbf+'\x27?';if(!_0x16ccaa[_0x251ee9(0x36a)]){if(!isInteractive())return console[_0x251ee9(0x1da)](a31_0x251538[_0x251ee9(0x334)](_0x251ee9(0x34f)),_0x251ee9(0x21d)),console[_0x251ee9(0x1da)](a31_0x251538[_0x251ee9(0x1ba)](_0x251ee9(0x379))),0x1;const _0x2ae491=await confirmKey(_0x193423);if(!_0x2ae491)return console['error'](a31_0x251538[_0x251ee9(0x387)](_0x251ee9(0x286))),0x1;}const _0x6620c3=_0x6f6212?_0x251ee9(0x1cd):_0x251ee9(0x1ea),_0x2a5be0=await withSpinner(_0x6620c3+_0x251ee9(0x1bf)+_0x32fdbf+_0x251ee9(0x301),()=>_0x1a55ef[_0x251ee9(0x1e4)](),{'verbose':_0x16ccaa[_0x251ee9(0x1ed)]}),_0x33e91e=_0x2a5be0[_0x251ee9(0x17e)],_0x5d774e=getConsoleNextUrl(_0x16ccaa[_0x251ee9(0x217)],_0x251ee9(0x18e)+_0x33e91e['id']),_0x32bac9=_0x6f6212?_0x251ee9(0x1bd):'Updated';return console['error']('✔\x20'+_0x32bac9+_0x251ee9(0x1bf)+_0x33e91e[_0x251ee9(0x338)]+'\x27'),console[_0x251ee9(0x1da)]('\x20\x20'+_0x5d774e),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{['name']=a31_0x344d96(0x1cf);[a31_0x344d96(0x2a7)]=a31_0x344d96(0x2f3);async['execute'](_0x15e2ae){const _0x205ade=a31_0x344d96,{options:_0xf1cb3c,args:_0x55374c,tdx:_0x129175}=_0x15e2ae,_0x36fdf3=_0xf1cb3c,_0x2dd3f7=_0x55374c[0x0]||_0xf1cb3c['parentSegment'];if(!_0x2dd3f7)return showParentSegmentNotSetError(_0x205ade(0x2f2)+_0x205ade(0x26d)+_0x205ade(0x18b)+_0x205ade(0x16a)+_0x205ade(0x256)+_0x205ade(0x35c)),0x1;const _0x243a1d=resolveYamlFile(_0x2dd3f7);if(!existsSync(_0x243a1d))return showFileNotFoundError(_0x243a1d,_0x2dd3f7),0x1;_0x36fdf3[_0x205ade(0x1ed)]&&(console['error'](_0x205ade(0x178)+_0x36fdf3[_0x205ade(0x217)]),console['error'](_0x205ade(0x252)+_0x243a1d));let _0x245393;try{_0x245393=readFileSync(_0x243a1d,_0x205ade(0x28e));}catch(_0x458fa2){const _0x3e2c9b=_0x458fa2 instanceof Error?_0x458fa2[_0x205ade(0x332)]:String(_0x458fa2);return console[_0x205ade(0x1da)]('Error\x20reading\x20file:\x20'+_0x3e2c9b),0x1;}const _0x20c3dd=createCommandSpinner(a31_0x251538['dim']('Validating\x20configuration...'),{'verbose':_0x36fdf3[_0x205ade(0x1ed)]});_0x20c3dd['start']();const _0x33f62e={'onProgress':_0x2be8ac=>{_0x20c3dd['text']=formatProgressMessage(_0x2be8ac);}};if(_0x36fdf3[_0x205ade(0x18f)])_0x33f62e[_0x205ade(0x18f)]=!![];if(_0x36fdf3[_0x205ade(0x26c)])_0x33f62e['enriched']=!![];_0x36fdf3['attribute']&&(_0x33f62e[_0x205ade(0x29a)]=_0x36fdf3[_0x205ade(0x29a)]);_0x36fdf3[_0x205ade(0x36b)]&&(_0x33f62e[_0x205ade(0x36b)]=_0x36fdf3['behavior']);if(_0x36fdf3[_0x205ade(0x1df)])_0x33f62e[_0x205ade(0x1df)]=_0x36fdf3[_0x205ade(0x1df)];let _0x29e3cb;try{_0x29e3cb=await _0x129175[_0x205ade(0x202)][_0x205ade(0x22c)](_0x245393,_0x33f62e),_0x20c3dd[_0x205ade(0x226)]();}catch(_0x48dc83){_0x20c3dd['stop']();throw _0x48dc83;}const _0x3ccdc1=_0x36fdf3['interval']||_0x205ade(0x280);return this[_0x205ade(0x2d3)](_0x29e3cb,_0x33f62e,_0x243a1d,_0x3ccdc1),_0x29e3cb['allValid']?0x0:0x1;}[a31_0x344d96(0x2d3)](_0xafd856,_0x3e64f6,_0x1195ab,_0x5b016f){const _0x51a27c=a31_0x344d96;console[_0x51a27c(0x1da)]('\x0a'+a31_0x251538[_0x51a27c(0x266)](_0x51a27c(0x191))+'\x20'+_0xafd856[_0x51a27c(0x338)]),console[_0x51a27c(0x1da)]('═'[_0x51a27c(0x1d4)](0x3c)),this[_0x51a27c(0x25d)](_0xafd856);if(typeof _0x3e64f6[_0x51a27c(0x29a)]===_0x51a27c(0x1ae)){this[_0x51a27c(0x1a6)](_0xafd856),this[_0x51a27c(0x348)](_0xafd856),this[_0x51a27c(0x27f)](_0x1195ab,_0x5b016f,_0x51a27c(0x29a),_0x3e64f6[_0x51a27c(0x29a)]);return;}if(_0x3e64f6[_0x51a27c(0x29a)]===!![]){this['displayAttributesStats'](_0xafd856),this['displaySummary'](_0xafd856),this['displayPreviewHints'](_0x1195ab,_0x5b016f,_0x51a27c(0x211));return;}if(typeof _0x3e64f6[_0x51a27c(0x36b)]===_0x51a27c(0x1ae)){this[_0x51a27c(0x240)](_0xafd856,_0x5b016f),this['displaySummary'](_0xafd856),this[_0x51a27c(0x27f)](_0x1195ab,_0x5b016f,_0x51a27c(0x36b),_0x3e64f6['behavior']);return;}if(_0x3e64f6[_0x51a27c(0x36b)]===!![]){this[_0x51a27c(0x240)](_0xafd856,_0x5b016f),this['displaySummary'](_0xafd856),this[_0x51a27c(0x27f)](_0x1195ab,_0x5b016f,_0x51a27c(0x282));return;}this[_0x51a27c(0x1a6)](_0xafd856),this[_0x51a27c(0x240)](_0xafd856,_0x5b016f),this[_0x51a27c(0x25c)](_0xafd856),this[_0x51a27c(0x348)](_0xafd856),this[_0x51a27c(0x27f)](_0x1195ab,_0x5b016f,_0x51a27c(0x329));}['displayRealtimeInfo'](_0x39c287){displayRealtimeValidation(_0x39c287);}['displayPreviewHints'](_0x3d0aad,_0x4b2dfc,_0x2c6f02,_0x2a337e){const _0x2ea5de=a31_0x344d96;console[_0x2ea5de(0x1da)]('\x0a'+a31_0x251538['dim'](_0x2ea5de(0x388)));const _0x2976be=_0x4b2dfc!==_0x2ea5de(0x280)?_0x2ea5de(0x19e)+_0x4b2dfc:'';if(_0x2c6f02===_0x2ea5de(0x29a)&&_0x2a337e)console['error']('\x20\x20'+a31_0x251538[_0x2ea5de(0x1ba)]('tdx\x20ps\x20preview\x20'+_0x3d0aad+_0x2ea5de(0x208)+_0x2a337e+'\x22'+_0x2976be));else{if(_0x2c6f02===_0x2ea5de(0x36b)&&_0x2a337e)console[_0x2ea5de(0x1da)]('\x20\x20'+a31_0x251538['dim']('tdx\x20ps\x20preview\x20'+_0x3d0aad+'\x20--behavior\x20\x22'+_0x2a337e+'\x22'+_0x2976be));else(_0x2c6f02==='attributes'||_0x2c6f02==='all')&&console[_0x2ea5de(0x1da)]('\x20\x20'+a31_0x251538['dim']('tdx\x20ps\x20preview\x20'+_0x3d0aad+'\x20--attribute\x20\x22<name>\x22'+_0x2976be));}(_0x2c6f02===_0x2ea5de(0x282)||_0x2c6f02===_0x2ea5de(0x329))&&console[_0x2ea5de(0x1da)]('\x20\x20'+a31_0x251538[_0x2ea5de(0x1ba)](_0x2ea5de(0x325)+_0x3d0aad+_0x2ea5de(0x1dd)+_0x2976be)),_0x2c6f02===_0x2ea5de(0x329)&&console[_0x2ea5de(0x1da)]('\x20\x20'+a31_0x251538[_0x2ea5de(0x1ba)](_0x2ea5de(0x325)+_0x3d0aad+'\x20--enriched'+_0x2976be));}[a31_0x344d96(0x25d)](_0x2eb8e3){const _0x20801f=a31_0x344d96,{master:_0xbd3ca5}=_0x2eb8e3,_0x5de66c=_0xbd3ca5[_0x20801f(0x354)]?a31_0x251538[_0x20801f(0x339)]('✔'):a31_0x251538[_0x20801f(0x334)]('✘');console['error']('\x0a'+a31_0x251538['dim'](_0x20801f(0x2be))),console[_0x20801f(0x1da)](_0x5de66c+'\x20'+a31_0x251538['bold'](_0xbd3ca5[_0x20801f(0x16e)]+'.'+_0xbd3ca5[_0x20801f(0x2a6)])),_0xbd3ca5[_0x20801f(0x354)]?_0xbd3ca5['rowCount']!==undefined&&console[_0x20801f(0x1da)]('\x20\x20'+a31_0x251538[_0x20801f(0x1ba)]('Rows:')+'\x20'+a31_0x251538['cyan'](formatRows(_0xbd3ca5[_0x20801f(0x1f6)]))):console[_0x20801f(0x1da)]('\x20\x20'+a31_0x251538[_0x20801f(0x334)](_0x20801f(0x30c))+'\x20'+_0xbd3ca5['schemaError']);}[a31_0x344d96(0x1a6)](_0x35634a){const _0x31804b=a31_0x344d96;if(_0x35634a[_0x31804b(0x211)][_0x31804b(0x2cd)]===0x0)return;console[_0x31804b(0x1da)]('\x0a'+a31_0x251538['dim'](_0x31804b(0x1b4)));for(const _0x2ad894 of _0x35634a[_0x31804b(0x211)]){const _0x20c4b9=_0x2ad894[_0x31804b(0x354)]?a31_0x251538['green']('✔'):a31_0x251538['red']('✘');let _0x53f44e='';if(_0x2ad894[_0x31804b(0x354)]&&_0x2ad894[_0x31804b(0x32b)]!==undefined&&_0x2ad894[_0x31804b(0x364)]!==undefined){const _0x1a1e92=_0x2ad894[_0x31804b(0x364)][_0x31804b(0x323)](0x1),_0x3d099b=_0x2ad894['coveragePercent']>=0x50?a31_0x251538['green']:_0x2ad894[_0x31804b(0x364)]>=0x32?a31_0x251538[_0x31804b(0x387)]:a31_0x251538[_0x31804b(0x334)];_0x53f44e='\x20'+a31_0x251538[_0x31804b(0x1ba)](_0x31804b(0x24a))+'\x20'+_0x3d099b(_0x1a1e92+'%')+'\x20('+formatRows(_0x2ad894['matchedCount'])+'\x20rows)';}console[_0x31804b(0x1da)](_0x20c4b9+'\x20'+a31_0x251538['bold'](_0x2ad894[_0x31804b(0x338)])+_0x53f44e),console['error']('\x20\x20'+a31_0x251538[_0x31804b(0x1ba)](_0x31804b(0x263))+'\x20'+a31_0x251538[_0x31804b(0x266)](_0x2ad894[_0x31804b(0x16e)]+'.'+_0x2ad894['table']));const _0x4bd3d0=_0x2ad894[_0x31804b(0x26a)]===_0x2ad894[_0x31804b(0x2d8)]?a31_0x251538[_0x31804b(0x1ba)]('Join\x20on:')+'\x20'+_0x2ad894[_0x31804b(0x26a)]:a31_0x251538[_0x31804b(0x1ba)]('Join:')+'\x20'+_0x2ad894[_0x31804b(0x26a)]+_0x31804b(0x335)+_0x2ad894[_0x31804b(0x2d8)];console[_0x31804b(0x1da)]('\x20\x20'+_0x4bd3d0),console[_0x31804b(0x1da)]('\x20\x20'+a31_0x251538['dim'](_0x31804b(0x310))),this[_0x31804b(0x1f9)](_0x2ad894['columns']),!_0x2ad894[_0x31804b(0x354)]&&console[_0x31804b(0x1da)]('\x20\x20'+a31_0x251538[_0x31804b(0x334)](_0x31804b(0x30c))+'\x20'+_0x2ad894[_0x31804b(0x36c)]);}}[a31_0x344d96(0x240)](_0x5af801,_0x42a6bf){const _0x527e95=a31_0x344d96;if(_0x5af801['behaviors'][_0x527e95(0x2cd)]===0x0)return;console[_0x527e95(0x1da)]('\x0a'+a31_0x251538[_0x527e95(0x1ba)](_0x527e95(0x1ec))+'\x20'+a31_0x251538[_0x527e95(0x1ba)]('('+_0x42a6bf+')'));for(const _0x2f8ea6 of _0x5af801['behaviors']){const _0x480977=_0x2f8ea6[_0x527e95(0x354)]?a31_0x251538[_0x527e95(0x339)]('✔'):a31_0x251538['red']('✘');let _0x4ddbda='';if(_0x2f8ea6[_0x527e95(0x354)]&&_0x2f8ea6['customersWithEvents']!==undefined&&_0x2f8ea6['totalEvents']!==undefined){const _0x392c30=_0x2f8ea6[_0x527e95(0x2a3)]?.[_0x527e95(0x323)](0x1)||'?',_0x200da3=(_0x2f8ea6['customerPercent']??0x0)>=0x32?a31_0x251538['green']:(_0x2f8ea6[_0x527e95(0x2a3)]??0x0)>=0x14?a31_0x251538[_0x527e95(0x387)]:a31_0x251538[_0x527e95(0x334)];_0x4ddbda='\x20'+a31_0x251538['dim'](_0x527e95(0x30a))+'\x20'+_0x200da3(formatRows(_0x2f8ea6[_0x527e95(0x365)]))+'\x20('+_0x392c30+_0x527e95(0x2ac)+a31_0x251538[_0x527e95(0x1ba)]('Events:')+'\x20'+a31_0x251538[_0x527e95(0x382)](formatRows(_0x2f8ea6[_0x527e95(0x2ea)]));}console[_0x527e95(0x1da)](_0x480977+'\x20'+a31_0x251538[_0x527e95(0x266)](_0x2f8ea6['name'])+_0x4ddbda),console[_0x527e95(0x1da)]('\x20\x20'+a31_0x251538['dim'](_0x527e95(0x263))+'\x20'+a31_0x251538[_0x527e95(0x266)](_0x2f8ea6['database']+'.'+_0x2f8ea6[_0x527e95(0x2a6)]));const _0x251e66=_0x2f8ea6['joinKey']===_0x2f8ea6['foreignKey']?a31_0x251538[_0x527e95(0x1ba)](_0x527e95(0x357))+'\x20'+_0x2f8ea6[_0x527e95(0x26a)]:a31_0x251538[_0x527e95(0x1ba)](_0x527e95(0x2b8))+'\x20'+_0x2f8ea6[_0x527e95(0x26a)]+'\x20=\x20'+_0x2f8ea6[_0x527e95(0x2d8)];console['error']('\x20\x20'+_0x251e66),console[_0x527e95(0x1da)]('\x20\x20'+a31_0x251538['dim'](_0x527e95(0x310))),this[_0x527e95(0x1f9)](_0x2f8ea6[_0x527e95(0x35a)]),!_0x2f8ea6[_0x527e95(0x354)]&&console[_0x527e95(0x1da)]('\x20\x20'+a31_0x251538['red']('Error:')+'\x20'+_0x2f8ea6['schemaError']);}}['displayColumns'](_0x40b0b6){const _0x25b458=a31_0x344d96;for(const _0x4d9ab6 of _0x40b0b6){_0x4d9ab6[_0x25b458(0x33a)]===_0x4d9ab6[_0x25b458(0x31d)]||_0x4d9ab6[_0x25b458(0x31d)]==='*'?console['error'](_0x25b458(0x1fa)+_0x4d9ab6[_0x25b458(0x33a)]):console[_0x25b458(0x1da)](_0x25b458(0x1fa)+_0x4d9ab6[_0x25b458(0x33a)]+'\x20'+a31_0x251538['dim']('('+_0x4d9ab6[_0x25b458(0x31d)]+')'));}}[a31_0x344d96(0x348)](_0x5126b6){const _0x2c7ca3=a31_0x344d96;console[_0x2c7ca3(0x1da)]('─'['repeat'](0x3c));if(_0x5126b6['errors'][_0x2c7ca3(0x2cd)]>0x0){console['error']('\x0a'+a31_0x251538[_0x2c7ca3(0x334)](_0x2c7ca3(0x227)));for(const _0x1f2879 of _0x5126b6['errors']){console['error']('\x20\x20'+a31_0x251538[_0x2c7ca3(0x334)]('•')+'\x20'+_0x1f2879);}}_0x5126b6[_0x2c7ca3(0x255)]&&console[_0x2c7ca3(0x1da)]('\x0a'+a31_0x251538[_0x2c7ca3(0x339)]('✔')+'\x20Configuration\x20is\x20valid');}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a31_0x344d96(0x338)]=a31_0x344d96(0x1e7);['description']=a31_0x344d96(0x318);async[a31_0x344d96(0x1a9)](_0x4533e4){const _0x123e8b=a31_0x344d96,{options:_0x1e87f7,args:_0x4d4439,tdx:_0xe65702}=_0x4533e4,_0x2b17e7=_0x1e87f7,_0x7b2be3=_0x4d4439[0x0]||_0x1e87f7['parentSegment'];if(!_0x7b2be3)return showParentSegmentNotSetError(_0x123e8b(0x2b6)+_0x123e8b(0x2df)+_0x123e8b(0x26f)+_0x123e8b(0x195)+_0x123e8b(0x207)+_0x123e8b(0x22b)+_0x123e8b(0x271)+_0x123e8b(0x35c)),0x1;if(!_0x2b17e7[_0x123e8b(0x18f)]&&!_0x2b17e7[_0x123e8b(0x29a)]&&!_0x2b17e7[_0x123e8b(0x36b)]&&!_0x2b17e7[_0x123e8b(0x26c)])return console[_0x123e8b(0x1da)](a31_0x251538[_0x123e8b(0x334)](_0x123e8b(0x315))),console[_0x123e8b(0x1da)](_0x123e8b(0x1a8)),console[_0x123e8b(0x1da)](_0x123e8b(0x389)),console[_0x123e8b(0x1da)](_0x123e8b(0x228)),console[_0x123e8b(0x1da)](_0x123e8b(0x249)),console[_0x123e8b(0x1da)](_0x123e8b(0x274)),console[_0x123e8b(0x1da)](_0x123e8b(0x290)),0x1;const _0x5490fd=resolveYamlFile(_0x7b2be3);if(!existsSync(_0x5490fd))return showFileNotFoundError(_0x5490fd,_0x7b2be3),0x1;_0x2b17e7[_0x123e8b(0x1ed)]&&(console[_0x123e8b(0x1da)](_0x123e8b(0x178)+_0x2b17e7[_0x123e8b(0x217)]),console['error'](_0x123e8b(0x252)+_0x5490fd));let _0x3291b7;try{_0x3291b7=readFileSync(_0x5490fd,'utf-8');}catch(_0xa99ff8){const _0x4b32d2=_0xa99ff8 instanceof Error?_0xa99ff8[_0x123e8b(0x332)]:String(_0xa99ff8);return console[_0x123e8b(0x1da)](_0x123e8b(0x1b2)+_0x4b32d2),0x1;}let _0x3edb5a;try{_0x3edb5a=parseDef(_0x3291b7);}catch(_0x3527ae){const _0x4a0ba7=_0x3527ae instanceof Error?_0x3527ae['message']:String(_0x3527ae);return console[_0x123e8b(0x1da)](a31_0x251538['red'](_0x123e8b(0x1a7)+_0x4a0ba7)),0x1;}if(_0x2b17e7[_0x123e8b(0x29a)]===!![]||_0x2b17e7[_0x123e8b(0x29a)]===''){const _0x4fd020=_0x3edb5a[_0x123e8b(0x211)]?.[_0x123e8b(0x288)](_0x4cd787=>_0x4cd787['name'])||[];if(_0x4fd020[_0x123e8b(0x2cd)]===0x0)console[_0x123e8b(0x1da)](a31_0x251538[_0x123e8b(0x334)](_0x123e8b(0x2c9)));else{console[_0x123e8b(0x1da)](a31_0x251538['red']('Error:\x20--attribute\x20requires\x20a\x20name\x0a')),console['error']('Available\x20attributes:');for(const _0x5d5641 of _0x4fd020){console[_0x123e8b(0x1da)]('\x20\x20'+a31_0x251538[_0x123e8b(0x382)](_0x5d5641));}console[_0x123e8b(0x1da)](_0x123e8b(0x2db)+_0x7b2be3+_0x123e8b(0x208)+_0x4fd020[0x0]+'\x22');}return 0x1;}if(_0x2b17e7[_0x123e8b(0x36b)]===!![]||_0x2b17e7[_0x123e8b(0x36b)]===''){const _0x475dd0=_0x3edb5a['behaviors']?.[_0x123e8b(0x288)](_0x325d87=>_0x325d87[_0x123e8b(0x338)])||[];if(_0x475dd0[_0x123e8b(0x2cd)]===0x0)console['error'](a31_0x251538['red']('Error:\x20No\x20behaviors\x20defined\x20in\x20configuration'));else{console[_0x123e8b(0x1da)](a31_0x251538[_0x123e8b(0x334)](_0x123e8b(0x1f5))),console[_0x123e8b(0x1da)](_0x123e8b(0x272));for(const _0x1975c8 of _0x475dd0){console[_0x123e8b(0x1da)]('\x20\x20'+a31_0x251538['cyan'](_0x1975c8));}console['error'](_0x123e8b(0x2db)+_0x7b2be3+_0x123e8b(0x2a9)+_0x475dd0[0x0]+'\x22');}return 0x1;}const _0x34a352=createCommandSpinner(a31_0x251538[_0x123e8b(0x1ba)](_0x123e8b(0x2f0)),{'verbose':_0x2b17e7['verbose']});_0x34a352[_0x123e8b(0x250)]();const _0x1b887f={'onProgress':_0x10c247=>{const _0x4d00f0=_0x123e8b;_0x34a352[_0x4d00f0(0x1b9)]=formatProgressMessage(_0x10c247);}};if(_0x2b17e7[_0x123e8b(0x18f)])_0x1b887f['master']=!![];if(_0x2b17e7['attribute']&&typeof _0x2b17e7['attribute']===_0x123e8b(0x1ae))_0x1b887f[_0x123e8b(0x29a)]=_0x2b17e7[_0x123e8b(0x29a)];if(_0x2b17e7[_0x123e8b(0x36b)]&&typeof _0x2b17e7[_0x123e8b(0x36b)]===_0x123e8b(0x1ae))_0x1b887f[_0x123e8b(0x36b)]=_0x2b17e7[_0x123e8b(0x36b)];if(_0x2b17e7[_0x123e8b(0x26c)])_0x1b887f[_0x123e8b(0x26c)]=!![];if(_0x2b17e7[_0x123e8b(0x1df)])_0x1b887f[_0x123e8b(0x1df)]=_0x2b17e7['interval'];let _0x88fa6b;try{_0x88fa6b=await _0xe65702[_0x123e8b(0x202)][_0x123e8b(0x321)](_0x3291b7,_0x1b887f),_0x34a352[_0x123e8b(0x226)]();}catch(_0x4da6f1){_0x34a352[_0x123e8b(0x226)]();throw _0x4da6f1;}return await this[_0x123e8b(0x1f4)](_0x88fa6b,{'master':_0x2b17e7[_0x123e8b(0x18f)],'attribute':typeof _0x2b17e7[_0x123e8b(0x29a)]===_0x123e8b(0x1ae)?_0x2b17e7['attribute']:undefined,'behavior':typeof _0x2b17e7[_0x123e8b(0x36b)]===_0x123e8b(0x1ae)?_0x2b17e7[_0x123e8b(0x36b)]:undefined,'enriched':_0x2b17e7[_0x123e8b(0x26c)]}),_0x88fa6b[_0x123e8b(0x255)]?0x0:0x1;}async['displayPreviewResults'](_0x2a9844,_0x520f19){const _0x2b8874=a31_0x344d96;console[_0x2b8874(0x1da)]('\x0a'+a31_0x251538[_0x2b8874(0x266)](_0x2b8874(0x350))+'\x20'+_0x2a9844[_0x2b8874(0x338)]),console[_0x2b8874(0x1da)]('═'['repeat'](0x3c));if(_0x520f19[_0x2b8874(0x18f)]&&_0x2a9844[_0x2b8874(0x2b3)]){const _0x37c7ac=a31_0x251538[_0x2b8874(0x1ba)](_0x2b8874(0x347))+'\x20'+a31_0x251538[_0x2b8874(0x266)](_0x2a9844['master'][_0x2b8874(0x16e)]+'.'+_0x2a9844['master']['table']);await this[_0x2b8874(0x21a)](_0x37c7ac,_0x2a9844[_0x2b8874(0x2b3)]);}else{if(_0x520f19[_0x2b8874(0x29a)]&&_0x2a9844['sampleData']){const _0x331cb4=a31_0x251538['dim'](_0x2b8874(0x257))+'\x20'+a31_0x251538[_0x2b8874(0x266)](_0x520f19[_0x2b8874(0x29a)]);await this[_0x2b8874(0x21a)](_0x331cb4,_0x2a9844['sampleData']);}else{if(_0x520f19['behavior']&&_0x2a9844[_0x2b8874(0x2b3)]){const _0x5cf8e3=a31_0x251538[_0x2b8874(0x1ba)]('Behavior:')+'\x20'+a31_0x251538[_0x2b8874(0x266)](_0x520f19[_0x2b8874(0x36b)]);await this[_0x2b8874(0x21a)](_0x5cf8e3,_0x2a9844[_0x2b8874(0x2b3)]);}else{if(_0x520f19[_0x2b8874(0x26c)]&&_0x2a9844['sampleData']){const _0x2f01fb=a31_0x251538[_0x2b8874(0x1ba)](_0x2b8874(0x184))+'\x20'+a31_0x251538[_0x2b8874(0x266)](_0x2b8874(0x20f));await this[_0x2b8874(0x21a)](_0x2f01fb,_0x2a9844['sampleData']);}else!_0x2a9844[_0x2b8874(0x2b3)]&&console[_0x2b8874(0x1da)](_0x2b8874(0x235));}}}if(_0x2a9844['errors'][_0x2b8874(0x2cd)]>0x0){console[_0x2b8874(0x1da)]('─'[_0x2b8874(0x1d4)](0x3c)),console[_0x2b8874(0x1da)]('\x0a'+a31_0x251538[_0x2b8874(0x334)]('Errors:'));for(const _0x426efe of _0x2a9844[_0x2b8874(0x268)]){console[_0x2b8874(0x1da)]('\x20\x20'+a31_0x251538['red']('•')+'\x20'+_0x426efe);}}}async[a31_0x344d96(0x21a)](_0x28b7ad,_0x57f380){const _0x371c3e=a31_0x344d96;if(_0x57f380[_0x371c3e(0x2cd)]===0x0){console[_0x371c3e(0x1da)]('\x0a'+_0x28b7ad),console[_0x371c3e(0x1da)]('\x20\x20No\x20sample\x20data\x20available');return;}console[_0x371c3e(0x1da)]('\x0a'+_0x28b7ad);const _0x32f339=Object[_0x371c3e(0x2af)](_0x57f380[0x0])[_0x371c3e(0x288)](_0x554946=>({'name':_0x554946,'type':typeof _0x57f380[0x0][_0x554946]===_0x371c3e(0x30d)?_0x371c3e(0x239):_0x371c3e(0x37a)})),_0x22ff28={'queryId':_0x371c3e(0x205),'columns':_0x32f339,'data':_0x57f380,'stats':{'state':'FINISHED','queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x57f380[_0x371c3e(0x2cd)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x26bd44=formatAsTable(_0x22ff28,_0x57f380[_0x371c3e(0x2cd)],!![]);await writeOutput(_0x26bd44,undefined,_0x371c3e(0x2a6));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a31_0x344d96(0x338)]='segment:parent:run';['description']=a31_0x344d96(0x216);async[a31_0x344d96(0x1a9)](_0xcc1160){const _0x39e21b=a31_0x344d96,{options:_0x456652,args:_0x3753fb,tdx:_0x595eb8}=_0xcc1160,_0x14cdcb=_0x456652,_0x565440=_0x3753fb[0x0]||_0x456652[_0x39e21b(0x1de)];if(!_0x565440)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment'),0x1;const _0x5a121c=resolveYamlFile(_0x565440);if(existsSync(_0x5a121c)){_0x14cdcb[_0x39e21b(0x1ed)]&&console[_0x39e21b(0x1da)](_0x39e21b(0x23b)+_0x5a121c);let _0x740d64;try{_0x740d64=readFileSync(_0x5a121c,_0x39e21b(0x28e));}catch(_0x43ee94){const _0x567604=_0x43ee94 instanceof Error?_0x43ee94['message']:String(_0x43ee94);return console[_0x39e21b(0x1da)]('Error\x20reading\x20file:\x20'+_0x567604),0x1;}const _0x242d55=await withSpinner(_0x39e21b(0x384),()=>_0x595eb8['segment'][_0x39e21b(0x371)](_0x740d64),{'verbose':_0x14cdcb[_0x39e21b(0x1ed)]}),_0xffe702=_0x242d55['data'],{isNew:_0x2f5e62,name:_0x418737,hasChanges:_0x5c8402,diffFormatted:_0x458eee}=_0xffe702;if(_0x5c8402){_0x2f5e62?console[_0x39e21b(0x1da)](_0x39e21b(0x32e)+_0x418737+'\x27:'):console['error'](_0x39e21b(0x1ff)+_0x418737+'\x27:');console[_0x39e21b(0x1da)]('─'[_0x39e21b(0x1d4)](0x3c)),console[_0x39e21b(0x1da)](_0x458eee),console['error']('─'['repeat'](0x3c));const _0x21521a=_0x2f5e62?_0x39e21b(0x2dc)+_0x418737+_0x39e21b(0x35f):_0x39e21b(0x333)+_0x418737+_0x39e21b(0x35f);if(!_0x14cdcb[_0x39e21b(0x36a)]){if(!isInteractive())return console[_0x39e21b(0x1da)](a31_0x251538['red'](_0x39e21b(0x34f)),_0x39e21b(0x21d)),console['error'](a31_0x251538[_0x39e21b(0x1ba)](_0x39e21b(0x379))),0x1;const _0x216aa6=await confirmKey(_0x21521a);if(!_0x216aa6)return console[_0x39e21b(0x1da)](a31_0x251538[_0x39e21b(0x387)](_0x39e21b(0x286))),0x1;}const _0x2eae57=_0x2f5e62?'Creating':_0x39e21b(0x1ea);await withSpinner(_0x2eae57+_0x39e21b(0x1bf)+_0x418737+'\x27...',()=>_0xffe702[_0x39e21b(0x1e4)](),{'verbose':_0x14cdcb[_0x39e21b(0x1ed)]});const _0x278300=_0x2f5e62?'Created':_0x39e21b(0x1d2);console['error']('✔\x20'+_0x278300+_0x39e21b(0x1bf)+_0x418737+'\x27');}else console[_0x39e21b(0x1da)](_0x39e21b(0x369)+_0x418737+'\x27\x20is\x20up\x20to\x20date');}const _0x2e130e=await withSpinner(_0x39e21b(0x171)+_0x565440+_0x39e21b(0x301),()=>_0x595eb8['segment']['runParent'](_0x565440),{'verbose':_0x14cdcb[_0x39e21b(0x1ed)]}),_0x300947=_0x2e130e[_0x39e21b(0x17e)],_0x4613a3=getConsoleUrl(_0x14cdcb[_0x39e21b(0x217)],'/app/workflows/'+_0x300947['workflowId']+_0x39e21b(0x330)+_0x300947[_0x39e21b(0x241)]+_0x39e21b(0x214)+_0x300947[_0x39e21b(0x1eb)]);return console[_0x39e21b(0x1da)](_0x39e21b(0x380)),console[_0x39e21b(0x1da)]('\x20\x20'+a31_0x251538[_0x39e21b(0x1ba)](_0x39e21b(0x1f8))+'\x20'+_0x300947[_0x39e21b(0x1a4)]),console[_0x39e21b(0x1da)]('\x20\x20'+a31_0x251538[_0x39e21b(0x1ba)](_0x39e21b(0x1f3))+'\x20'+_0x300947[_0x39e21b(0x193)]),console['error']('\x20\x20'+a31_0x251538['dim']('Session:')+'\x20'+_0x300947[_0x39e21b(0x241)]),console[_0x39e21b(0x1da)]('\x20\x20'+a31_0x251538[_0x39e21b(0x1ba)](_0x39e21b(0x251))+'\x20'+_0x300947[_0x39e21b(0x1eb)]),console[_0x39e21b(0x1da)]('\x20\x20'+_0x4613a3),console[_0x39e21b(0x1da)]('\x0a'+a31_0x251538[_0x39e21b(0x1ba)]('To\x20cancel:')+_0x39e21b(0x27c)+_0x300947['workflowAttemptId']+'\x20kill'),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{['name']=a31_0x344d96(0x278);[a31_0x344d96(0x2a7)]=a31_0x344d96(0x2e8);async[a31_0x344d96(0x1a9)](_0x52f7f6){const _0x2c8ffe=a31_0x344d96,{options:_0x32b108,args:_0x11b257,tdx:_0x1a2cc9}=_0x52f7f6,_0x3dd112=_0x11b257[0x0]||_0x32b108[_0x2c8ffe(0x1de)];if(!_0x3dd112)return showParentSegmentNotSetError(_0x2c8ffe(0x2aa)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment'),0x1;_0x32b108[_0x2c8ffe(0x1ed)]&&(console[_0x2c8ffe(0x1da)]('Site:\x20'+_0x32b108[_0x2c8ffe(0x217)]),console['error']('Parent\x20segment:\x20'+_0x3dd112));const _0x4f67d3=await withSpinner(_0x2c8ffe(0x360)+_0x3dd112+'\x27...',()=>_0x1a2cc9[_0x2c8ffe(0x202)][_0x2c8ffe(0x16d)](_0x3dd112),{'verbose':_0x32b108[_0x2c8ffe(0x1ed)]}),_0x30aae0=_0x4f67d3[_0x2c8ffe(0x17e)];console[_0x2c8ffe(0x1da)](_0x2c8ffe(0x243)+_0x30aae0['length']+_0x2c8ffe(0x2ee)+(_0x30aae0[_0x2c8ffe(0x2cd)]!==0x1?'s':''));if(_0x32b108['json']||_0x32b108['jsonl'])return await handleSDKOutput(_0x30aae0,_0x32b108),0x0;return displayFieldsHumanReadable(_0x30aae0,_0x3dd112),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a31_0x344d96(0x338)]=a31_0x344d96(0x212);[a31_0x344d96(0x2a7)]=a31_0x344d96(0x1d7);async['execute'](_0x55b11e){const _0x23272e=a31_0x344d96,{options:_0x551048,args:_0x5ebae7,tdx:_0x2f0835}=_0x55b11e,_0x19d592=_0x551048,_0x15036f=_0x5ebae7[0x0]||_0x551048[_0x23272e(0x1de)];if(!_0x15036f)return showParentSegmentNotSetError(_0x23272e(0x1b1)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a'+_0x23272e(0x18b)+_0x23272e(0x260)),0x1;_0x551048['verbose']&&(console['error'](_0x23272e(0x178)+_0x551048[_0x23272e(0x217)]),console[_0x23272e(0x1da)](_0x23272e(0x1c8)+_0x15036f));const _0x299bec=await withSpinner(_0x23272e(0x194)+_0x15036f+_0x23272e(0x301),()=>_0x2f0835[_0x23272e(0x202)]['getParentFull'](_0x15036f),{'verbose':_0x551048[_0x23272e(0x1ed)]}),_0x92d73f=_0x299bec[_0x23272e(0x17e)];if(_0x19d592[_0x23272e(0x37c)]){const _0x5906e7=getConsoleNextUrl(_0x19d592[_0x23272e(0x217)],_0x23272e(0x18e)+_0x92d73f['id']);return console[_0x23272e(0x1da)](a31_0x251538[_0x23272e(0x339)]('✔')+_0x23272e(0x29e)+a31_0x251538[_0x23272e(0x382)](_0x5906e7)),openBrowser(_0x5906e7),0x0;}return await handleSingleObjectOutput(_0x92d73f,_0x551048),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a31_0x344d96(0x338)]=a31_0x344d96(0x23f);[a31_0x344d96(0x2a7)]=a31_0x344d96(0x258);async[a31_0x344d96(0x1a9)](_0x12efc1){const _0x472170=a31_0x344d96,{options:_0x3608e7,args:_0x57c94e,tdx:_0x1a3d95}=_0x12efc1,_0x4b40fb=_0x3608e7,_0x5af1bb=_0x57c94e[0x0]||_0x3608e7[_0x472170(0x1de)];if(!_0x5af1bb)return showParentSegmentNotSetError(_0x472170(0x31a)+_0x472170(0x175)+_0x472170(0x18b)+_0x472170(0x2d5)),0x1;_0x3608e7['verbose']&&(console[_0x472170(0x1da)](_0x472170(0x178)+_0x3608e7[_0x472170(0x217)]),console[_0x472170(0x1da)](_0x472170(0x1c8)+_0x5af1bb));const _0x27351a=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x5af1bb+_0x472170(0x301),()=>_0x1a3d95[_0x472170(0x202)][_0x472170(0x2cb)](_0x5af1bb),{'verbose':_0x3608e7[_0x472170(0x1ed)]}),_0x279508=_0x27351a[_0x472170(0x17e)],_0x52edd0=_0x1a3d95[_0x472170(0x202)][_0x472170(0x189)](_0x279508);if(_0x4b40fb['output']){const _0x21a437=await this[_0x472170(0x324)](_0x12efc1,_0x5af1bb,_0x279508,_0x52edd0),_0xffa6ae=this[_0x472170(0x317)](_0x21a437);writeFileSync(_0x4b40fb[_0x472170(0x285)],_0xffa6ae);const _0x1dfb06=_0x21a437['customers'][_0x472170(0x35a)][_0x472170(0x2cd)]+_0x21a437[_0x472170(0x282)][_0x472170(0x20c)]((_0x59bf2a,_0x1088c)=>_0x59bf2a+_0x1088c[_0x472170(0x35a)][_0x472170(0x2cd)],0x0),_0x4c53c6=_0x21a437[_0x472170(0x282)]['filter'](_0x48451a=>_0x48451a[_0x472170(0x35a)][_0x472170(0x2cd)]===0x0)[_0x472170(0x2cd)];return console[_0x472170(0x220)](_0x472170(0x244)+_0x4b40fb['output']),console[_0x472170(0x220)](_0x472170(0x31c)+_0x52edd0),console['log'](_0x472170(0x1c3)+_0x21a437[_0x472170(0x282)][_0x472170(0x2cd)]+_0x472170(0x21b)),console['log'](_0x472170(0x1ac)+_0x1dfb06+_0x472170(0x368)),_0x4c53c6>0x0&&console[_0x472170(0x220)](_0x472170(0x192)+_0x4c53c6+_0x472170(0x2c8)),0x0;}console[_0x472170(0x1da)]('\x0a'+a31_0x251538[_0x472170(0x266)]('Output\x20Database:')+'\x20'+a31_0x251538['cyan'](_0x52edd0));const _0x3621b1=await withSpinner(_0x472170(0x29d),()=>_0x1a3d95[_0x472170(0x202)][_0x472170(0x1b0)](_0x279508),{'verbose':_0x3608e7['verbose']});console['error']('\x0a'+a31_0x251538[_0x472170(0x266)](_0x472170(0x18c))+'\x20'+a31_0x251538[_0x472170(0x1ba)]('('+_0x52edd0+_0x472170(0x1f7)));const _0x2e8e0c=await executeSchemaQuery(_0x3621b1[_0x472170(0x17e)],_0x1a3d95,_0x3608e7);await handleQueryOutput(_0x2e8e0c,_0x3608e7);const _0x267d23=await withSpinner('Fetching\x20behavior\x20list...',()=>_0x1a3d95[_0x472170(0x202)][_0x472170(0x29f)](_0x279508),{'verbose':_0x3608e7['verbose']});for(const _0x55246d of _0x267d23['data']){const _0x3338b7=_0x472170(0x218)+_0x55246d[_0x472170(0x376)]()['replace'](/\s+/g,'_'),_0x2c68c8=_0x472170(0x1a1)+_0x52edd0+'.'+_0x3338b7;console['error']('\x0a'+a31_0x251538[_0x472170(0x266)](_0x55246d)+'\x20'+a31_0x251538[_0x472170(0x1ba)]('('+_0x52edd0+'.'+_0x3338b7+')'));try{const _0x5115fe=await executeSchemaQuery(_0x2c68c8,_0x1a3d95,_0x3608e7);await handleQueryOutput(_0x5115fe,_0x3608e7);}catch{console[_0x472170(0x1da)](a31_0x251538['yellow'](_0x472170(0x2eb)));}}return 0x0;}async[a31_0x344d96(0x324)](_0x393fe3,_0x43d230,_0x1147c6,_0x12aeec){const _0x2944bc=a31_0x344d96,{options:_0x91f9c6,tdx:_0x18e7cb}=_0x393fe3,_0x1381c5=await withSpinner('Fetching\x20customers\x20schema...',()=>_0x18e7cb[_0x2944bc(0x202)]['getParentSQL'](_0x1147c6),{'verbose':_0x91f9c6['verbose']}),_0x329742=await executeSchemaQuery(_0x1381c5[_0x2944bc(0x17e)],_0x18e7cb,_0x91f9c6),_0x17e1af=_0x329742[_0x2944bc(0x17e)][_0x2944bc(0x288)](_0x5871ec=>({'name':_0x5871ec[_0x2944bc(0x34d)],'type':_0x5871ec['column_type']})),_0x8f4e4b=await withSpinner(_0x2944bc(0x188),()=>_0x18e7cb['segment'][_0x2944bc(0x29f)](_0x1147c6),{'verbose':_0x91f9c6['verbose']}),_0x26e0e2=[];for(const _0x3caba4 of _0x8f4e4b['data']){const _0x1e56e2=_0x2944bc(0x218)+_0x3caba4[_0x2944bc(0x376)]()[_0x2944bc(0x27d)](/\s+/g,'_'),_0x323e25='SELECT\x20*\x20FROM\x20'+_0x12aeec+'.'+_0x1e56e2;let _0x2ba536=[];try{const _0x2a23c8=await executeSchemaQuery(_0x323e25,_0x18e7cb,_0x91f9c6);_0x2ba536=_0x2a23c8['data'][_0x2944bc(0x288)](_0x545375=>({'name':_0x545375[_0x2944bc(0x34d)],'type':_0x545375[_0x2944bc(0x32d)]}));}catch{}_0x26e0e2['push']({'table':_0x1e56e2,'columns':_0x2ba536});}return{'database':_0x12aeec,'parent_segment':_0x43d230,'parent_id':_0x1147c6,'customers':{'table':_0x2944bc(0x18c),'columns':_0x17e1af},'behaviors':_0x26e0e2};}[a31_0x344d96(0x317)](_0x19bcd5){const _0x587b40=a31_0x344d96,_0x356d74=_0x5e933a=>{const _0x579987=a31_0x2ed7;if(_0x5e933a[_0x579987(0x2cd)]===0x0)return'[]';const _0x2ade2a=_0x5e933a[_0x579987(0x288)](_0x5a1d6b=>_0x579987(0x2c6)+_0x5a1d6b[_0x579987(0x338)]+_0x579987(0x34c)+_0x5a1d6b[_0x579987(0x19b)]+_0x579987(0x2bf));return'[\x0a'+_0x2ade2a[_0x579987(0x34a)](',\x0a')+_0x579987(0x275);},_0xe5f5b6=_0x19bcd5[_0x587b40(0x282)][_0x587b40(0x288)](_0x477c25=>{const _0x28ac0b=_0x587b40;return _0x28ac0b(0x1c7)+_0x477c25[_0x28ac0b(0x2a6)]+_0x28ac0b(0x24f)+_0x356d74(_0x477c25[_0x28ac0b(0x35a)])[_0x28ac0b(0x27d)](/^/gm,'\x20\x20')[_0x28ac0b(0x344)]()+_0x28ac0b(0x30f);})[_0x587b40(0x34a)](',\x0a');return _0x587b40(0x33f)+_0x19bcd5[_0x587b40(0x16e)]+_0x587b40(0x16c)+_0x19bcd5[_0x587b40(0x23e)]+_0x587b40(0x295)+_0x19bcd5[_0x587b40(0x2e4)]+_0x587b40(0x232)+_0x19bcd5[_0x587b40(0x18c)][_0x587b40(0x2a6)]+_0x587b40(0x375)+_0x356d74(_0x19bcd5['customers'][_0x587b40(0x35a)])[_0x587b40(0x27d)](/^/gm,'\x20\x20')[_0x587b40(0x344)]()+_0x587b40(0x230)+_0xe5f5b6+_0x587b40(0x253);}}export class ParentSegmentSQLCommand extends BaseCommand{['name']=a31_0x344d96(0x363);['description']=a31_0x344d96(0x25a);async[a31_0x344d96(0x1a9)](_0xe8c975){const _0x426a4c=a31_0x344d96,{options:_0x27dcb4,args:_0xd492c0,tdx:_0x56bccc}=_0xe8c975,_0x64029e=_0xd492c0[0x0]||_0x27dcb4[_0x426a4c(0x1de)];if(!_0x64029e)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a'+_0x426a4c(0x1c9)),0x1;_0x27dcb4['verbose']&&(console[_0x426a4c(0x1da)](_0x426a4c(0x178)+_0x27dcb4[_0x426a4c(0x217)]),console['error'](_0x426a4c(0x1c8)+_0x64029e));const _0x4dd15e=await withSpinner(_0x426a4c(0x1d5)+_0x64029e+_0x426a4c(0x301),()=>_0x56bccc[_0x426a4c(0x202)]['resolveParentId'](_0x64029e),{'verbose':_0x27dcb4[_0x426a4c(0x1ed)]}),_0x400062=_0x4dd15e[_0x426a4c(0x17e)],_0x1293fe=await withSpinner(_0x426a4c(0x1e1)+_0x64029e+'\x27...',()=>_0x56bccc[_0x426a4c(0x202)][_0x426a4c(0x1b0)](_0x400062),{'verbose':_0x27dcb4['verbose']}),_0x59f694=_0x1293fe[_0x426a4c(0x17e)];return _0x27dcb4[_0x426a4c(0x19c)]==='json'||_0x27dcb4[_0x426a4c(0x19c)]===_0x426a4c(0x222)?await handleSDKOutput([{'sql':_0x59f694}],_0x27dcb4):console[_0x426a4c(0x220)](_0x59f694),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a31_0x344d96(0x338)]=a31_0x344d96(0x2d4);[a31_0x344d96(0x2a7)]=a31_0x344d96(0x327);async['execute'](_0x86d7ef){const _0x16f0e8=a31_0x344d96,{options:_0xa30744,args:_0x4a9235,tdx:_0x396481}=_0x86d7ef,_0x5b8c2a=_0x4a9235[0x0]||_0xa30744[_0x16f0e8(0x1de)];if(!_0x5b8c2a)return showParentSegmentNotSetError(_0x16f0e8(0x356)+_0x16f0e8(0x21c)),0x1;_0xa30744['verbose']&&(console[_0x16f0e8(0x1da)]('Site:\x20'+_0xa30744[_0x16f0e8(0x217)]),console['error']('Parent\x20segment:\x20'+_0x5b8c2a));const _0x4b0331=await withSpinner(_0x16f0e8(0x1d5)+_0x5b8c2a+_0x16f0e8(0x301),()=>_0x396481[_0x16f0e8(0x202)]['resolveParentId'](_0x5b8c2a),{'verbose':_0xa30744[_0x16f0e8(0x1ed)]}),_0x19fc63=_0x4b0331[_0x16f0e8(0x17e)],_0x460e4b=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x5b8c2a+_0x16f0e8(0x301),()=>_0x396481[_0x16f0e8(0x202)][_0x16f0e8(0x1b0)](_0x19fc63),{'verbose':_0xa30744['verbose']});let _0x2abcd5=_0x460e4b['data'];const _0x4e8f4e=resolveLimit(_0xa30744[_0x16f0e8(0x2ca)],DEFAULT_DISPLAY_LIMIT),_0x3210e1=/\bLIMIT\s+\d+/i[_0x16f0e8(0x283)](_0x2abcd5);!_0x3210e1&&(_0x2abcd5=_0x2abcd5['trim']()['replace'](/;+$/,''),_0x2abcd5=_0x16f0e8(0x2f1)+_0x2abcd5+_0x16f0e8(0x2b2)+_0x4e8f4e);_0xa30744[_0x16f0e8(0x1ed)]&&console[_0x16f0e8(0x1da)](_0x16f0e8(0x20b)+_0x2abcd5);const _0x363795=await withProgressSpinner(_0x16f0e8(0x287),async _0x4010a3=>{const _0x5d2299=_0x16f0e8,_0x14d4a7=await _0x396481['query'][_0x5d2299(0x1a9)](_0x2abcd5,{'catalog':'td','schema':_0x5d2299(0x1d0),'onJobId':_0x556448=>{const _0xcebd6d=_0x5d2299;_0x4010a3[_0xcebd6d(0x185)](_0x556448);}});return _0x14d4a7;},{'verbose':_0xa30744[_0x16f0e8(0x1ed)]}),_0x30f8b2=_0x363795['data'],_0x1ad4c6=_0x30f8b2[_0x16f0e8(0x292)]?_0x16f0e8(0x346)+_0x30f8b2[_0x16f0e8(0x292)]+']':'';return console[_0x16f0e8(0x1da)](_0x16f0e8(0x1c0)+_0x30f8b2['stats'][_0x16f0e8(0x341)]['toLocaleString']()+_0x16f0e8(0x204)+(_0x16f0e8(0x1e5)+formatElapsed(_0x30f8b2[_0x16f0e8(0x199)][_0x16f0e8(0x1aa)])+_0x1ad4c6)),await handleQueryOutput(_0x30f8b2,_0xa30744),0x0;}}export class PSRtListCommand extends BaseCommand{[a31_0x344d96(0x338)]='ps:rt:list';[a31_0x344d96(0x2a7)]=a31_0x344d96(0x1c1);async[a31_0x344d96(0x1a9)](_0x60215c){const _0x391c98=a31_0x344d96,{options:_0x5a8387,args:_0x4131cd,tdx:_0x140468}=_0x60215c,_0x2adc91=_0x4131cd[0x0],_0x1869c3=await withSpinner(_0x2adc91?_0x391c98(0x336)+_0x2adc91+_0x391c98(0x301):'Listing\x20RT-enabled\x20parent\x20segments...',()=>_0x140468['realtime'][_0x391c98(0x377)](),{'verbose':_0x5a8387['verbose']});let _0x2fc121=_0x1869c3[_0x391c98(0x17e)][_0x391c98(0x2d6)](_0x1fb800=>_0x1fb800[_0x391c98(0x38a)]);if(_0x2adc91){const _0x4978d5=_0x2adc91['replace'](/[.+^${}()|[\]\\]/g,_0x391c98(0x1c4))[_0x391c98(0x27d)](/\*/g,'.*')[_0x391c98(0x27d)](/\?/g,'.'),_0x4eeba2=new RegExp('^'+_0x4978d5+'$','i');_0x2fc121=_0x2fc121[_0x391c98(0x2d6)](_0x4417c4=>_0x4eeba2[_0x391c98(0x283)](_0x4417c4['name']));}_0x2fc121[_0x391c98(0x306)]((_0x2dcc0a,_0x455ac2)=>_0x2dcc0a[_0x391c98(0x338)][_0x391c98(0x305)](_0x455ac2[_0x391c98(0x338)])),console['error'](_0x391c98(0x243)+_0x2fc121['length']+'\x20RT-enabled\x20parent\x20segment'+(_0x2fc121[_0x391c98(0x2cd)]!==0x1?'s':''));const _0x1b6d4e=_0xa8c460=>{const _0x20b74b=_0x391c98;return getConsoleNextUrl(_0x5a8387[_0x20b74b(0x217)],'/app/dw/parentSegments/'+_0xa8c460);};if(_0x5a8387[_0x391c98(0x19c)]===_0x391c98(0x1e3)||_0x5a8387[_0x391c98(0x19c)]===_0x391c98(0x222)){const _0x542228=_0x2fc121[_0x391c98(0x288)](_0x387d01=>({..._0x387d01,'url':_0x1b6d4e(_0x387d01['id'])}));await handleSDKOutput(_0x542228,_0x5a8387);}else{if(_0x2fc121[_0x391c98(0x2cd)]===0x0)console[_0x391c98(0x220)](_0x391c98(0x35d));else for(const _0x572cf7 of _0x2fc121){const _0x551818=_0x572cf7[_0x391c98(0x270)]?a31_0x251538[_0x391c98(0x1ba)]('\x20('+formatRows(_0x572cf7['population'])+')'):'',_0x49071e=hyperlink(_0x572cf7[_0x391c98(0x338)],_0x1b6d4e(_0x572cf7['id']));console[_0x391c98(0x220)]('⚡\x20'+_0x49071e+_0x551818);}}return 0x0;}}export class PSRtValidateCommand extends BaseParentSegmentCommand{[a31_0x344d96(0x338)]=a31_0x344d96(0x359);[a31_0x344d96(0x2a7)]=a31_0x344d96(0x2ad);async[a31_0x344d96(0x1a9)](_0x3fe2fb){const _0x317371=a31_0x344d96,{options:_0x913ac2,args:_0x1d01a9,tdx:_0x559bfd}=_0x3fe2fb,_0x43b920=_0x1d01a9[0x0]||_0x913ac2['parentSegment'];if(!_0x43b920)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20rt\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20RT\x20config\x20(requires\x20context)\x0a'+_0x317371(0x269)),0x1;const _0x502e1a=resolveYamlFile(_0x43b920);if(!existsSync(_0x502e1a))return showFileNotFoundError(_0x502e1a,_0x43b920),0x1;let _0x12e8d0;try{_0x12e8d0=readFileSync(_0x502e1a,'utf-8');}catch(_0x49152b){const _0x49b022=_0x49152b instanceof Error?_0x49152b[_0x317371(0x332)]:String(_0x49152b);return console['error'](_0x317371(0x1b2)+_0x49b022),0x1;}const _0x43243f=createCommandSpinner(a31_0x251538['dim'](_0x317371(0x311)),{'verbose':_0x913ac2[_0x317371(0x1ed)]});_0x43243f['start']();const _0x48d7c6={'realtime':!![],'onProgress':_0x276895=>{const _0x15a9b4=_0x317371;_0x43243f[_0x15a9b4(0x1b9)]=formatProgressMessage(_0x276895);}};let _0x408043;try{_0x408043=await _0x559bfd['segment'][_0x317371(0x22c)](_0x12e8d0,_0x48d7c6),_0x43243f[_0x317371(0x226)]();}catch(_0x59a379){_0x43243f[_0x317371(0x226)]();throw _0x59a379;}console['error']('\x0a'+a31_0x251538[_0x317371(0x266)](_0x317371(0x25e))+'\x20'+_0x408043[_0x317371(0x338)]),console[_0x317371(0x1da)]('═'[_0x317371(0x1d4)](0x3c)),displayRealtimeValidation(_0x408043),console['error']('─'[_0x317371(0x1d4)](0x3c));if(_0x408043[_0x317371(0x268)][_0x317371(0x2cd)]>0x0){console[_0x317371(0x1da)]('\x0a'+a31_0x251538[_0x317371(0x334)](_0x317371(0x227)));for(const _0x2a752b of _0x408043['errors']){console[_0x317371(0x1da)]('\x20\x20'+a31_0x251538['red']('•')+'\x20'+_0x2a752b);}}return _0x408043['allValid']&&console[_0x317371(0x1da)]('\x0a'+a31_0x251538['green']('✔')+'\x20RT\x20configuration\x20is\x20valid'),_0x408043[_0x317371(0x255)]?0x0:0x1;}}export class PSRtJnListCommand extends BaseCommand{[a31_0x344d96(0x338)]='ps:rt:jn:list';[a31_0x344d96(0x2a7)]='List\x20RT\x20journeys';async['execute'](_0x1766d3){const _0x1d44f7=a31_0x344d96,{options:_0x3c3475,args:_0x53acf2,tdx:_0x401ce9}=_0x1766d3,_0x223500=_0x53acf2[0x0]||_0x3c3475['parentSegment'];if(!_0x223500)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20rt\x20jn\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20RT\x20journeys\x20(requires\x20context)\x0a'+_0x1d44f7(0x302)),0x1;_0x3c3475[_0x1d44f7(0x1ed)]&&(console[_0x1d44f7(0x1da)](_0x1d44f7(0x178)+_0x3c3475['site']),console['error'](_0x1d44f7(0x1c8)+_0x223500));const _0x1420fb=await withSpinner(_0x1d44f7(0x1d5)+_0x223500+_0x1d44f7(0x301),()=>_0x401ce9[_0x1d44f7(0x202)][_0x1d44f7(0x2cb)](_0x223500),{'verbose':_0x3c3475[_0x1d44f7(0x1ed)]}),_0xd98937=_0x1420fb['data'],_0x204713=await withSpinner(_0x1d44f7(0x2b4)+_0x223500+_0x1d44f7(0x301),()=>_0x401ce9['realtime']['listJourneys'](_0xd98937),{'verbose':_0x3c3475['verbose']}),_0x3e3821=_0x204713[_0x1d44f7(0x17e)];console[_0x1d44f7(0x1da)](_0x1d44f7(0x243)+_0x3e3821[_0x1d44f7(0x2cd)]+'\x20RT\x20journey'+(_0x3e3821['length']!==0x1?'s':''));if(_0x3c3475[_0x1d44f7(0x19c)]===_0x1d44f7(0x1e3)||_0x3c3475['format']===_0x1d44f7(0x222))await handleSDKOutput(_0x3e3821,_0x3c3475);else{if(_0x3e3821[_0x1d44f7(0x2cd)]===0x0)console[_0x1d44f7(0x220)](_0x1d44f7(0x1b5));else for(const _0x9604f8 of _0x3e3821){const _0x31aa48=_0x9604f8['state']==='launched'?'🚀':'📝',_0x783525=_0x9604f8[_0x1d44f7(0x373)]?a31_0x251538['yellow'](_0x1d44f7(0x22f)):'',_0x289fb9=a31_0x251538[_0x1d44f7(0x1ba)]('\x20('+_0x9604f8[_0x1d44f7(0x345)]+_0x1d44f7(0x196)+(_0x9604f8[_0x1d44f7(0x345)]!==0x1?'s':'')+')');console[_0x1d44f7(0x220)](_0x31aa48+'\x20'+_0x9604f8[_0x1d44f7(0x338)]+_0x783525+_0x289fb9);}}return 0x0;}}export class PSRtJnPauseCommand extends BaseCommand{[a31_0x344d96(0x338)]='ps:rt:jn:pause';[a31_0x344d96(0x2a7)]='Pause\x20activations\x20in\x20an\x20RT\x20journey';async[a31_0x344d96(0x1a9)](_0x16ad8b){const _0xadf6a6=a31_0x344d96,{options:_0x2613e8,args:_0x39cb79,tdx:_0xb59a22}=_0x16ad8b,_0xdd82fa=_0x39cb79[0x0];if(!_0xdd82fa)return console['error'](a31_0x251538[_0xadf6a6(0x334)](_0xadf6a6(0x304))),console[_0xadf6a6(0x1da)](_0xadf6a6(0x2ce)),console[_0xadf6a6(0x1da)](a31_0x251538[_0xadf6a6(0x1ba)]('Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs')),0x1;_0x2613e8['verbose']&&(console[_0xadf6a6(0x1da)](_0xadf6a6(0x178)+_0x2613e8['site']),console[_0xadf6a6(0x1da)]('RT\x20Journey\x20ID:\x20'+_0xdd82fa));const _0xabb80e=await withSpinner(_0xadf6a6(0x2d1)+_0xdd82fa+_0xadf6a6(0x301),()=>_0xb59a22['realtime']['pauseJourney'](_0xdd82fa),{'verbose':_0x2613e8['verbose']}),_0x3a983c=_0xabb80e['data'];console[_0xadf6a6(0x1da)]('✔\x20Paused\x20activations\x20for\x20RT\x20journey\x20\x27'+_0x3a983c[_0xadf6a6(0x338)]+'\x27');if(_0x2613e8['format']===_0xadf6a6(0x1e3)||_0x2613e8['format']===_0xadf6a6(0x222))await handleSDKOutput([_0x3a983c],_0x2613e8);else{const _0x599d25=_0x3a983c[_0xadf6a6(0x33d)]===_0xadf6a6(0x35b)?'🚀':'📝',_0x9b7962=_0x3a983c[_0xadf6a6(0x373)]?a31_0x251538['yellow'](_0xadf6a6(0x22f)):'';console[_0xadf6a6(0x220)](_0x599d25+'\x20'+_0x3a983c[_0xadf6a6(0x338)]+_0x9b7962);}return 0x0;}}export class PSRtJnResumeCommand extends BaseCommand{[a31_0x344d96(0x338)]=a31_0x344d96(0x27a);['description']=a31_0x344d96(0x176);async['execute'](_0x1654be){const _0x1854c5=a31_0x344d96,{options:_0x423dea,args:_0x2e265d,tdx:_0x4d432d}=_0x1654be,_0x400373=_0x2e265d[0x0];if(!_0x400373)return console[_0x1854c5(0x1da)](a31_0x251538['red']('Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a')),console[_0x1854c5(0x1da)](_0x1854c5(0x309)),console[_0x1854c5(0x1da)](a31_0x251538['dim']('Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs')),0x1;_0x423dea[_0x1854c5(0x1ed)]&&(console[_0x1854c5(0x1da)](_0x1854c5(0x178)+_0x423dea[_0x1854c5(0x217)]),console['error'](_0x1854c5(0x31e)+_0x400373));const _0x686df0=await withSpinner(_0x1854c5(0x2d9)+_0x400373+'\x27...',()=>_0x4d432d[_0x1854c5(0x2fd)]['resumeJourney'](_0x400373),{'verbose':_0x423dea[_0x1854c5(0x1ed)]}),_0x359e52=_0x686df0[_0x1854c5(0x17e)];console[_0x1854c5(0x1da)](_0x1854c5(0x2f7)+_0x359e52['name']+'\x27');if(_0x423dea[_0x1854c5(0x19c)]===_0x1854c5(0x1e3)||_0x423dea[_0x1854c5(0x19c)]===_0x1854c5(0x222))await handleSDKOutput([_0x359e52],_0x423dea);else{const _0x235659=_0x359e52[_0x1854c5(0x33d)]===_0x1854c5(0x35b)?'🚀':'📝',_0x292fe7=_0x359e52[_0x1854c5(0x373)]?a31_0x251538[_0x1854c5(0x387)](_0x1854c5(0x22f)):'';console[_0x1854c5(0x220)](_0x235659+'\x20'+_0x359e52[_0x1854c5(0x338)]+_0x292fe7);}return 0x0;}}export class PSRtConfigVersionCommand extends BaseCommand{['name']=a31_0x344d96(0x1af);['description']=a31_0x344d96(0x1f2);async['execute'](_0x230ca1){const _0x4a43f0=a31_0x344d96,{options:_0x18e245,args:_0x1d99fe,tdx:_0x25be65}=_0x230ca1,_0x2effd5=_0x1d99fe[0x0]||_0x18e245['parentSegment'];if(!_0x2effd5)return showParentSegmentNotSetError(_0x4a43f0(0x179)+_0x4a43f0(0x2a8)),0x1;_0x18e245[_0x4a43f0(0x1ed)]&&(console[_0x4a43f0(0x1da)](_0x4a43f0(0x178)+_0x18e245[_0x4a43f0(0x217)]),console[_0x4a43f0(0x1da)](_0x4a43f0(0x1c8)+_0x2effd5));const _0x25fe29=await withSpinner(_0x4a43f0(0x1d5)+_0x2effd5+_0x4a43f0(0x301),()=>_0x25be65[_0x4a43f0(0x202)]['resolveParentId'](_0x2effd5),{'verbose':_0x18e245[_0x4a43f0(0x1ed)]}),_0x1fd7b9=_0x25fe29[_0x4a43f0(0x17e)],_0x263020=await withSpinner(_0x4a43f0(0x186)+_0x2effd5+_0x4a43f0(0x301),()=>_0x25be65[_0x4a43f0(0x2fd)][_0x4a43f0(0x27e)](_0x1fd7b9),{'verbose':_0x18e245['verbose']}),_0x555d77=_0x263020[_0x4a43f0(0x17e)];return console['error'](_0x4a43f0(0x254)),_0x18e245[_0x4a43f0(0x19c)]===_0x4a43f0(0x1e3)||_0x18e245[_0x4a43f0(0x19c)]===_0x4a43f0(0x222)?await handleSDKOutput([_0x555d77],_0x18e245):(console[_0x4a43f0(0x220)]('id:\x20'+_0x555d77['id']),console['log'](_0x4a43f0(0x273)+_0x555d77[_0x4a43f0(0x1a4)]),console[_0x4a43f0(0x220)](_0x4a43f0(0x276)+_0x555d77[_0x4a43f0(0x37b)]),console[_0x4a43f0(0x220)](_0x4a43f0(0x2a0)+_0x555d77[_0x4a43f0(0x2e9)]),console[_0x4a43f0(0x220)](_0x4a43f0(0x1e0)+_0x555d77[_0x4a43f0(0x193)])),0x0;}}export class PSPzServiceListCommand extends BaseCommand{[a31_0x344d96(0x338)]='ps:pz:service:list';[a31_0x344d96(0x2a7)]=a31_0x344d96(0x1c6);async[a31_0x344d96(0x1a9)](_0x5b5340){const _0x531b84=a31_0x344d96,{options:_0x33e686,args:_0x4ee117,tdx:_0x4df58f}=_0x5b5340,_0x4376db=_0x4ee117[0x0]||_0x33e686[_0x531b84(0x1de)];if(!_0x4376db)return showParentSegmentNotSetError(_0x531b84(0x2ef)+_0x531b84(0x2bc)),0x1;const _0x1bedb4=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x4376db+_0x531b84(0x301),()=>_0x4df58f[_0x531b84(0x202)][_0x531b84(0x2cb)](_0x4376db),{'verbose':_0x33e686[_0x531b84(0x1ed)]}),_0x2d49bb=_0x1bedb4[_0x531b84(0x17e)],_0x55bfeb=await withSpinner(_0x531b84(0x1ad)+_0x4376db+'\x27...',()=>_0x4df58f[_0x531b84(0x279)][_0x531b84(0x377)](_0x2d49bb),{'verbose':_0x33e686[_0x531b84(0x1ed)]}),_0x471a5a=_0x55bfeb[_0x531b84(0x17e)];console['error'](_0x531b84(0x243)+_0x471a5a[_0x531b84(0x2cd)]+_0x531b84(0x1fc)+(_0x471a5a[_0x531b84(0x2cd)]!==0x1?'s':''));if(_0x33e686['format']===_0x531b84(0x1e3)||_0x33e686['format']===_0x531b84(0x222))await handleSDKOutput(_0x471a5a,_0x33e686);else{if(_0x471a5a['length']===0x0)console[_0x531b84(0x220)](_0x531b84(0x21f)),console[_0x531b84(0x1da)](a31_0x251538['cyan'](_0x531b84(0x2ae)));else for(const _0x3b8a1e of _0x471a5a){console[_0x531b84(0x220)](a31_0x251538['bold'](_0x3b8a1e[_0x531b84(0x338)])+'\x20'+a31_0x251538[_0x531b84(0x1ba)](_0x531b84(0x248)+_0x3b8a1e['id']+')'));_0x3b8a1e[_0x531b84(0x2a7)]&&console[_0x531b84(0x220)]('\x20\x20'+a31_0x251538['dim'](_0x3b8a1e['description']));if(_0x3b8a1e['tokens']&&_0x3b8a1e[_0x531b84(0x198)][_0x531b84(0x2cd)]>0x0)for(const _0x5b65fd of _0x3b8a1e[_0x531b84(0x198)]){const _0x3fccb9=_0x5b65fd[_0x531b84(0x2b1)]?.[_0x531b84(0x2cd)]?_0x5b65fd[_0x531b84(0x2b1)][_0x531b84(0x34a)](',\x20'):_0x531b84(0x351);console[_0x531b84(0x220)]('\x20\x20'+a31_0x251538['cyan'](_0x531b84(0x31f))+'\x20'+_0x5b65fd['name']+'\x20'+a31_0x251538['dim'](_0x531b84(0x248)+_0x5b65fd['id']+')')),console[_0x531b84(0x220)](_0x531b84(0x362)+a31_0x251538[_0x531b84(0x1ba)](_0x531b84(0x313))+'\x20'+_0x3fccb9);}else console[_0x531b84(0x220)]('\x20\x20'+a31_0x251538['dim']('no\x20tokens\x20configured'));}}return 0x0;}}export class PSPzServiceCreateCommand extends BaseCommand{[a31_0x344d96(0x338)]=a31_0x344d96(0x245);['description']=a31_0x344d96(0x233);async[a31_0x344d96(0x1a9)](_0x3a79a3){const _0x41fc76=a31_0x344d96,{options:_0x554c99,args:_0x1432be,tdx:_0x2d8723}=_0x3a79a3,_0xbc0560=_0x554c99,_0x45926d=_0x1432be[0x0],_0x555a34=_0x1432be[0x1]||_0x554c99[_0x41fc76(0x1de)];if(!_0x45926d)return console[_0x41fc76(0x1da)]('Error:\x20Service\x20name\x20is\x20required'),console['error'](_0x41fc76(0x374)),console[_0x41fc76(0x1da)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x555a34)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]\x0a'+_0x41fc76(0x23a)),0x1;const _0x1c9953=await withSpinner(_0x41fc76(0x1d5)+_0x555a34+_0x41fc76(0x301),()=>_0x2d8723['segment'][_0x41fc76(0x2cb)](_0x555a34),{'verbose':_0x554c99[_0x41fc76(0x1ed)]}),_0x58bb4c=_0x1c9953[_0x41fc76(0x17e)],_0x34295e={'name':_0x45926d,'description':_0xbc0560[_0x41fc76(0x2a7)],'public':_0xbc0560[_0x41fc76(0x2de)]},_0x2ccb68=await withSpinner('Creating\x20personalization\x20service\x20\x27'+_0x45926d+_0x41fc76(0x301),()=>_0x2d8723[_0x41fc76(0x279)][_0x41fc76(0x264)](_0x58bb4c,_0x34295e),{'verbose':_0x554c99['verbose']}),_0x100939=_0x2ccb68['data'];return console[_0x41fc76(0x1da)](_0x41fc76(0x169)+_0x100939['name']+_0x41fc76(0x18a)+_0x100939['id']),await handleSDKOutput([_0x100939],_0x554c99),0x0;}}export class PSPzServiceShowCommand extends BaseCommand{[a31_0x344d96(0x338)]=a31_0x344d96(0x284);[a31_0x344d96(0x2a7)]=a31_0x344d96(0x294);async[a31_0x344d96(0x1a9)](_0x2a27ca){const _0x563d9a=a31_0x344d96,{options:_0x54cb22,args:_0x547f2e,tdx:_0x1d4fc5}=_0x2a27ca,_0x3d7673=_0x547f2e[0x0],_0x4ee0ce=_0x547f2e[0x1]||_0x54cb22[_0x563d9a(0x1de)];if(!_0x3d7673)return console[_0x563d9a(0x1da)](_0x563d9a(0x29b)),console['error'](_0x563d9a(0x352)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x4ee0ce)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;const _0x3d9891=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x4ee0ce+_0x563d9a(0x301),()=>_0x1d4fc5[_0x563d9a(0x202)]['resolveParentId'](_0x4ee0ce),{'verbose':_0x54cb22[_0x563d9a(0x1ed)]}),_0x257bd1=_0x3d9891[_0x563d9a(0x17e)],_0x42126f=await withSpinner(_0x563d9a(0x170)+_0x3d7673+_0x563d9a(0x301),()=>_0x1d4fc5[_0x563d9a(0x279)]['get'](_0x257bd1,_0x3d7673),{'verbose':_0x54cb22[_0x563d9a(0x1ed)]}),_0x567b6e=_0x42126f[_0x563d9a(0x17e)];if(_0x54cb22[_0x563d9a(0x1e3)]||_0x54cb22['jsonl'])await handleSDKOutput([_0x567b6e],_0x54cb22);else{console[_0x563d9a(0x220)](a31_0x251538[_0x563d9a(0x266)](_0x567b6e[_0x563d9a(0x338)])+'\x20'+a31_0x251538[_0x563d9a(0x1ba)](_0x563d9a(0x248)+_0x567b6e['id']+')'));_0x567b6e[_0x563d9a(0x2a7)]&&console['log']('\x20\x20'+a31_0x251538[_0x563d9a(0x1ba)](_0x567b6e[_0x563d9a(0x2a7)]));console[_0x563d9a(0x220)]('\x20\x20'+a31_0x251538[_0x563d9a(0x382)](_0x563d9a(0x316))+'\x20'+(_0x567b6e['public']?_0x563d9a(0x36a):'no'));if(_0x567b6e[_0x563d9a(0x198)]&&_0x567b6e[_0x563d9a(0x198)]['length']>0x0)for(const _0xc3b3c2 of _0x567b6e[_0x563d9a(0x198)]){const _0x5d45d0=_0xc3b3c2[_0x563d9a(0x2b1)]?.[_0x563d9a(0x2cd)]?_0xc3b3c2[_0x563d9a(0x2b1)][_0x563d9a(0x34a)](',\x20'):_0x563d9a(0x351);console[_0x563d9a(0x220)]('\x20\x20'+a31_0x251538[_0x563d9a(0x382)](_0x563d9a(0x31f))+'\x20'+_0xc3b3c2[_0x563d9a(0x338)]+'\x20'+a31_0x251538['dim'](_0x563d9a(0x248)+_0xc3b3c2['id']+')')),console[_0x563d9a(0x220)](_0x563d9a(0x362)+a31_0x251538[_0x563d9a(0x1ba)](_0x563d9a(0x313))+'\x20'+_0x5d45d0);}else console[_0x563d9a(0x220)]('\x20\x20'+a31_0x251538['dim']('no\x20tokens\x20configured'));}return 0x0;}}export class PSPzServiceDeleteCommand extends BaseCommand{[a31_0x344d96(0x338)]='ps:pz:service:delete';[a31_0x344d96(0x2a7)]=a31_0x344d96(0x36d);async[a31_0x344d96(0x1a9)](_0x112dfe){const _0xf836d5=a31_0x344d96,{options:_0x1d4dc4,args:_0x4ab282,tdx:_0x48333e}=_0x112dfe,_0x33d5c2=_0x4ab282[0x0],_0x3fe7b2=_0x4ab282[0x1]||_0x1d4dc4[_0xf836d5(0x1de)];if(!_0x33d5c2)return console['error'](_0xf836d5(0x29b)),console[_0xf836d5(0x1da)](_0xf836d5(0x299)),console[_0xf836d5(0x1da)](_0xf836d5(0x225)),0x1;if(!_0x3fe7b2)return showParentSegmentNotSetError(_0xf836d5(0x36e)+_0xf836d5(0x225)),0x1;const _0x4b132=await withSpinner(_0xf836d5(0x1d5)+_0x3fe7b2+_0xf836d5(0x301),()=>_0x48333e[_0xf836d5(0x202)][_0xf836d5(0x2cb)](_0x3fe7b2),{'verbose':_0x1d4dc4['verbose']}),_0x7e26=_0x4b132[_0xf836d5(0x17e)];return await withSpinner(_0xf836d5(0x1b8)+_0x33d5c2+'\x27...',()=>_0x48333e[_0xf836d5(0x279)][_0xf836d5(0x1d3)](_0x7e26,_0x33d5c2),{'verbose':_0x1d4dc4[_0xf836d5(0x1ed)]}),console[_0xf836d5(0x1da)]('✔\x20Deleted\x20personalization\x20service\x20\x27'+_0x33d5c2+'\x27'),0x0;}}export class PSPzServiceUpdateCommand extends BaseCommand{[a31_0x344d96(0x338)]=a31_0x344d96(0x2b5);[a31_0x344d96(0x2a7)]='Update\x20a\x20personalization\x20service\x20name\x20and/or\x20description';async[a31_0x344d96(0x1a9)](_0x4b6dea){const _0x246610=a31_0x344d96,{options:_0x558d76,args:_0x1cc67d,tdx:_0x1d380e}=_0x4b6dea,_0x1cff82=_0x558d76,_0x2296e4=_0x1cc67d[0x0],_0x4e3c3f=_0x1cc67d[0x1]||_0x558d76[_0x246610(0x1de)];if(!_0x2296e4)return console[_0x246610(0x1da)](_0x246610(0x29b)),console[_0x246610(0x1da)](_0x246610(0x2a5)),console[_0x246610(0x1da)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x1cff82['name'])return console[_0x246610(0x1da)](_0x246610(0x370)),console[_0x246610(0x1da)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]'),0x1;if(!_0x4e3c3f)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]\x0a'+_0x246610(0x2e5)),0x1;const _0x4842b4=await withSpinner(_0x246610(0x1d5)+_0x4e3c3f+'\x27...',()=>_0x1d380e['segment']['resolveParentId'](_0x4e3c3f),{'verbose':_0x558d76[_0x246610(0x1ed)]}),_0x367116=_0x4842b4['data'],_0x28d81b={'name':_0x1cff82['name']};_0x1cff82[_0x246610(0x2a7)]!==undefined&&(_0x28d81b[_0x246610(0x2a7)]=_0x1cff82['description']);const _0x26d784=await withSpinner('Updating\x20personalization\x20service\x20\x27'+_0x2296e4+_0x246610(0x301),()=>_0x1d380e[_0x246610(0x279)]['patch'](_0x367116,_0x2296e4,_0x28d81b),{'verbose':_0x558d76[_0x246610(0x1ed)]}),_0x189648=_0x26d784[_0x246610(0x17e)];return console[_0x246610(0x1da)](_0x246610(0x1b3)+_0x189648[_0x246610(0x338)]+'\x27'),await handleSDKOutput([_0x189648],_0x558d76),0x0;}}export class PSPzServiceTokenCreateCommand extends BaseCommand{[a31_0x344d96(0x338)]=a31_0x344d96(0x19f);['description']=a31_0x344d96(0x1bb);async['execute'](_0x1bf63f){const _0x2a9b61=a31_0x344d96,{options:_0x4f34af,args:_0x124bce,tdx:_0x105661}=_0x1bf63f,_0x4e25b7=_0x4f34af,_0x5f0e2d=_0x124bce[0x0],_0x544066=_0x124bce[0x1],_0x562c4d=_0x124bce[0x2]||_0x4f34af[_0x2a9b61(0x1de)];if(!_0x5f0e2d)return console[_0x2a9b61(0x1da)](_0x2a9b61(0x381)),console[_0x2a9b61(0x1da)](_0x2a9b61(0x2cf)),console['error'](_0x2a9b61(0x1a5)),0x1;if(!_0x544066)return console[_0x2a9b61(0x1da)](_0x2a9b61(0x29b)),console['error'](_0x2a9b61(0x2cf)),console['error'](_0x2a9b61(0x1a5)),0x1;if(!_0x562c4d)return showParentSegmentNotSetError(_0x2a9b61(0x367)+_0x2a9b61(0x1a5)),0x1;const _0x47d1b3=await withSpinner(_0x2a9b61(0x1d5)+_0x562c4d+_0x2a9b61(0x301),()=>_0x105661[_0x2a9b61(0x202)][_0x2a9b61(0x2cb)](_0x562c4d),{'verbose':_0x4f34af['verbose']}),_0x7fcd46=_0x47d1b3[_0x2a9b61(0x17e)],_0x3488bd={'name':_0x5f0e2d};_0x4e25b7[_0x2a9b61(0x2b1)]&&(_0x3488bd[_0x2a9b61(0x2b1)]=_0x4e25b7[_0x2a9b61(0x2b1)][_0x2a9b61(0x2e7)](',')[_0x2a9b61(0x288)](_0x5cd381=>_0x5cd381[_0x2a9b61(0x344)]()));_0x4e25b7[_0x2a9b61(0x2a7)]&&(_0x3488bd[_0x2a9b61(0x2a7)]=_0x4e25b7[_0x2a9b61(0x2a7)]);const _0x211a12=await withSpinner(_0x2a9b61(0x289)+_0x5f0e2d+_0x2a9b61(0x2b7)+_0x544066+_0x2a9b61(0x301),()=>_0x105661[_0x2a9b61(0x279)][_0x2a9b61(0x203)](_0x7fcd46,_0x544066,_0x3488bd),{'verbose':_0x4f34af[_0x2a9b61(0x1ed)]}),_0x298b34=_0x211a12[_0x2a9b61(0x17e)];return console[_0x2a9b61(0x1da)](_0x2a9b61(0x221)+_0x298b34[_0x2a9b61(0x338)]+_0x2a9b61(0x18a)+_0x298b34['id']),_0x298b34[_0x2a9b61(0x2a2)]&&(console[_0x2a9b61(0x1da)](a31_0x251538['yellow']('\x0a⚠\x20Save\x20this\x20token\x20value\x20-\x20it\x20will\x20not\x20be\x20shown\x20again:')),console[_0x2a9b61(0x1da)](a31_0x251538['cyan'](_0x298b34['value'])),console['error']('')),await handleSDKOutput([_0x298b34],_0x4f34af),0x0;}}export class PSPzServiceTokenDeleteCommand extends BaseCommand{[a31_0x344d96(0x338)]=a31_0x344d96(0x16f);[a31_0x344d96(0x2a7)]=a31_0x344d96(0x1d6);async[a31_0x344d96(0x1a9)](_0x4e1f48){const _0x5f3ee3=a31_0x344d96,{options:_0xfaee02,args:_0x48c8d8,tdx:_0x163ad6}=_0x4e1f48,_0x3e0665=_0x48c8d8[0x0],_0x367f98=_0x48c8d8[0x1]||_0xfaee02[_0x5f3ee3(0x1de)];if(!_0x3e0665)return console['error']('Error:\x20Token\x20ID\x20is\x20required'),console[_0x5f3ee3(0x1da)](_0x5f3ee3(0x25f)),console[_0x5f3ee3(0x1da)](_0x5f3ee3(0x320)),0x1;if(!_0x367f98)return showParentSegmentNotSetError(_0x5f3ee3(0x28c)+_0x5f3ee3(0x320)),0x1;const _0x4a6179=await withSpinner(_0x5f3ee3(0x1d5)+_0x367f98+_0x5f3ee3(0x301),()=>_0x163ad6[_0x5f3ee3(0x202)]['resolveParentId'](_0x367f98),{'verbose':_0xfaee02[_0x5f3ee3(0x1ed)]}),_0x2e81b7=_0x4a6179[_0x5f3ee3(0x17e)],_0x37741b=await withSpinner(_0x5f3ee3(0x210),()=>_0x163ad6[_0x5f3ee3(0x279)][_0x5f3ee3(0x377)](_0x2e81b7),{'verbose':_0xfaee02['verbose']}),_0x183eff=_0x37741b[_0x5f3ee3(0x17e)];let _0x5dd699;for(const _0x23a558 of _0x183eff){if(_0x23a558[_0x5f3ee3(0x198)]?.[_0x5f3ee3(0x238)](_0xfe0e5=>_0xfe0e5['id']===_0x3e0665)){_0x5dd699=_0x23a558['id'];break;}}if(!_0x5dd699)return console[_0x5f3ee3(0x1da)](_0x5f3ee3(0x32c)+_0x3e0665+_0x5f3ee3(0x326)),0x1;const _0x2ddcbb=await withSpinner(_0x5f3ee3(0x1db)+_0x3e0665+'\x27...',()=>_0x163ad6[_0x5f3ee3(0x279)]['deleteToken'](_0x2e81b7,_0x5dd699,_0x3e0665),{'verbose':_0xfaee02[_0x5f3ee3(0x1ed)]}),_0x5ead88=_0x2ddcbb[_0x5f3ee3(0x17e)];return console[_0x5f3ee3(0x1da)]('✔\x20Deleted\x20token\x20\x27'+(_0x5ead88[_0x5f3ee3(0x338)]||_0x3e0665)+'\x27'),await handleSDKOutput([_0x5ead88],_0xfaee02),0x0;}}export class PSPzListCommand extends BaseCommand{[a31_0x344d96(0x338)]='ps:pz:list';[a31_0x344d96(0x2a7)]=a31_0x344d96(0x2d7);async[a31_0x344d96(0x1a9)](_0x474f99){const _0x651b70=a31_0x344d96,{options:_0x2a1e32,args:_0x103762,tdx:_0x38446f}=_0x474f99,_0xfd8138=_0x103762[0x0]||_0x2a1e32[_0x651b70(0x1de)];if(!_0xfd8138)return showParentSegmentNotSetError(_0x651b70(0x1a3)+_0x651b70(0x17a)),0x1;const _0x582b55=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0xfd8138+_0x651b70(0x301),()=>_0x38446f[_0x651b70(0x202)][_0x651b70(0x2cb)](_0xfd8138),{'verbose':_0x2a1e32[_0x651b70(0x1ed)]}),_0x43352c=_0x582b55[_0x651b70(0x17e)],_0x21ebd1=await withSpinner(_0x651b70(0x19d)+_0xfd8138+_0x651b70(0x301),()=>_0x38446f[_0x651b70(0x279)][_0x651b70(0x17c)](_0x43352c),{'verbose':_0x2a1e32[_0x651b70(0x1ed)]}),_0x43f2bc=_0x21ebd1[_0x651b70(0x17e)];console['error'](_0x651b70(0x243)+_0x43f2bc[_0x651b70(0x2cd)]+_0x651b70(0x2b9)+(_0x43f2bc['length']!==0x1?'s':''));if(_0x2a1e32[_0x651b70(0x19c)]===_0x651b70(0x1e3)||_0x2a1e32[_0x651b70(0x19c)]===_0x651b70(0x222))await handleSDKOutput(_0x43f2bc,_0x2a1e32);else{if(_0x43f2bc[_0x651b70(0x2cd)]===0x0)console[_0x651b70(0x220)](_0x651b70(0x172));else for(const _0x19c090 of _0x43f2bc){console[_0x651b70(0x220)](a31_0x251538[_0x651b70(0x266)](_0x19c090[_0x651b70(0x338)])+'\x20'+a31_0x251538['dim']('(id:\x20'+_0x19c090['id']+')'));_0x19c090[_0x651b70(0x2a7)]&&console[_0x651b70(0x220)]('\x20\x20'+a31_0x251538['dim'](_0x19c090[_0x651b70(0x2a7)]));const _0x4178c7=_0x19c090[_0x651b70(0x190)]?.[_0x651b70(0x2cd)]||0x0;console[_0x651b70(0x220)]('\x20\x20'+a31_0x251538[_0x651b70(0x382)]('sections:')+'\x20'+_0x4178c7);if(_0x19c090[_0x651b70(0x190)]&&_0x19c090['sections']['length']>0x0)for(const _0x505f68 of _0x19c090[_0x651b70(0x190)]){console[_0x651b70(0x220)](_0x651b70(0x1fa)+_0x505f68[_0x651b70(0x338)]);}}}return 0x0;}}export class PSPzShowCommand extends BaseCommand{[a31_0x344d96(0x338)]=a31_0x344d96(0x17b);['description']=a31_0x344d96(0x2a4);async['execute'](_0xa0a67d){const _0x1e68e5=a31_0x344d96,{options:_0x3caa5d,args:_0x484df5,tdx:_0x5dcba3}=_0xa0a67d,_0x5cd3da=_0x484df5[0x0];if(!_0x5cd3da)return console['error']('Error:\x20Personalization\x20ID\x20is\x20required'),console['error'](_0x1e68e5(0x28a)),0x1;const _0x374416=await withSpinner(_0x1e68e5(0x372)+_0x5cd3da+'\x27...',()=>_0x5dcba3[_0x1e68e5(0x279)][_0x1e68e5(0x34e)](_0x5cd3da),{'verbose':_0x3caa5d['verbose']}),_0x527a2f=_0x374416[_0x1e68e5(0x17e)];console[_0x1e68e5(0x1da)]('✔\x20Found\x20personalization\x20\x27'+_0x527a2f[_0x1e68e5(0x338)]+'\x27');if(_0x3caa5d['format']===_0x1e68e5(0x1e3)||_0x3caa5d[_0x1e68e5(0x19c)]==='jsonl')await handleSDKOutput([_0x527a2f],_0x3caa5d);else{console[_0x1e68e5(0x220)](a31_0x251538[_0x1e68e5(0x266)](_0x527a2f[_0x1e68e5(0x338)])+'\x20'+a31_0x251538['dim'](_0x1e68e5(0x248)+_0x527a2f['id']+')'));_0x527a2f[_0x1e68e5(0x2a7)]&&console[_0x1e68e5(0x220)]('\x20\x20'+a31_0x251538[_0x1e68e5(0x1ba)](_0x527a2f[_0x1e68e5(0x2a7)]));_0x527a2f[_0x1e68e5(0x1a4)]&&console[_0x1e68e5(0x220)]('\x20\x20'+a31_0x251538['cyan'](_0x1e68e5(0x2e6))+'\x20'+_0x527a2f['audienceId']);console[_0x1e68e5(0x220)]('\x20\x20'+a31_0x251538['cyan'](_0x1e68e5(0x2d2))+'\x20'+_0x527a2f[_0x1e68e5(0x1ef)]),console[_0x1e68e5(0x220)]('\x20\x20'+a31_0x251538[_0x1e68e5(0x382)](_0x1e68e5(0x308))+'\x20'+_0x527a2f[_0x1e68e5(0x1f0)]);const _0x319e36=_0x527a2f[_0x1e68e5(0x190)]?.['length']||0x0;console[_0x1e68e5(0x220)]('\x20\x20'+a31_0x251538[_0x1e68e5(0x382)](_0x1e68e5(0x2f6))+'\x20'+_0x319e36);if(_0x527a2f['sections']&&_0x527a2f[_0x1e68e5(0x190)][_0x1e68e5(0x2cd)]>0x0)for(const _0x41a5e5 of _0x527a2f[_0x1e68e5(0x190)]){console['log'](_0x1e68e5(0x362)+a31_0x251538[_0x1e68e5(0x266)](_0x41a5e5['name'])+'\x20'+a31_0x251538[_0x1e68e5(0x1ba)](_0x1e68e5(0x248)+_0x41a5e5['id']+')')),_0x41a5e5['entryCriteria']&&(console['log'](_0x1e68e5(0x197)+a31_0x251538['cyan']('entryCriteria:')+'\x20'+_0x41a5e5['entryCriteria'][_0x1e68e5(0x338)]),_0x41a5e5[_0x1e68e5(0x2b0)][_0x1e68e5(0x224)]?.[_0x1e68e5(0x2e1)]&&console[_0x1e68e5(0x220)]('\x20\x20\x20\x20\x20\x20\x20\x20'+a31_0x251538[_0x1e68e5(0x382)](_0x1e68e5(0x1c5))+'\x20'+_0x41a5e5['entryCriteria']['keyEventCriteria'][_0x1e68e5(0x2e1)])),_0x41a5e5['payload']&&console[_0x1e68e5(0x220)]('\x20\x20\x20\x20\x20\x20'+a31_0x251538['cyan'](_0x1e68e5(0x2bb))+'\x20'+JSON['stringify'](_0x41a5e5[_0x1e68e5(0x174)])),_0x41a5e5[_0x1e68e5(0x231)]&&console[_0x1e68e5(0x220)]('\x20\x20\x20\x20\x20\x20'+a31_0x251538['cyan'](_0x1e68e5(0x35e))+_0x1e68e5(0x300));}}return 0x0;}}export class PSPzDeleteCommand extends BaseCommand{[a31_0x344d96(0x338)]=a31_0x344d96(0x181);['description']='Delete\x20a\x20realtime\x20personalization';async[a31_0x344d96(0x1a9)](_0x5b09ed){const _0x33f57a=a31_0x344d96,{options:_0x2b0918,args:_0x368c0a,tdx:_0x1e4af5}=_0x5b09ed,_0x46c39b=_0x368c0a[0x0];if(!_0x46c39b)return console[_0x33f57a(0x1da)]('Error:\x20Personalization\x20ID\x20is\x20required'),console[_0x33f57a(0x1da)](_0x33f57a(0x2e2)),0x1;return await withSpinner('Deleting\x20personalization\x20\x27'+_0x46c39b+_0x33f57a(0x301),()=>_0x1e4af5[_0x33f57a(0x279)]['deletePersonalization'](_0x46c39b),{'verbose':_0x2b0918[_0x33f57a(0x1ed)]}),console[_0x33f57a(0x1da)](_0x33f57a(0x378)+_0x46c39b+'\x27'),0x0;}}export class PSPzCreateCommand extends BaseCommand{[a31_0x344d96(0x338)]=a31_0x344d96(0x1ab);['description']=a31_0x344d96(0x1dc);async[a31_0x344d96(0x1a9)](_0x37a03a){const _0x45d846=a31_0x344d96,{options:_0x255547,tdx:_0x29b22a}=_0x37a03a,_0xfc13e6=_0x255547;let _0x1bbc1c;if(_0xfc13e6['file']){_0x1bbc1c=await loadJSON(_0xfc13e6[_0x45d846(0x2c7)],!![]);if(!_0x1bbc1c[_0x45d846(0x1a0)]?.[_0x45d846(0x2e0)])return console['error'](_0x45d846(0x24e)),console[_0x45d846(0x1da)](_0x45d846(0x26e)),console[_0x45d846(0x1da)](_0x45d846(0x27b)),0x1;}else{if(!_0xfc13e6[_0x45d846(0x338)])return console['error'](_0x45d846(0x1be)),console[_0x45d846(0x1da)](_0x45d846(0x182)),console['error'](_0x45d846(0x303)),0x1;if(_0xfc13e6[_0x45d846(0x2a7)]===undefined)return console['error']('Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)'),console['error'](_0x45d846(0x182)),console[_0x45d846(0x1da)](_0x45d846(0x303)),0x1;if(_0xfc13e6[_0x45d846(0x18d)]===undefined)return console[_0x45d846(0x1da)](_0x45d846(0x296)),console[_0x45d846(0x1da)](_0x45d846(0x2ff)),0x1;let _0x372f00=_0xfc13e6[_0x45d846(0x1a4)];if(!_0x372f00&&_0x255547[_0x45d846(0x1de)]){const _0x2d307a=await withSpinner(_0x45d846(0x1d5)+_0x255547[_0x45d846(0x1de)]+_0x45d846(0x301),()=>_0x29b22a[_0x45d846(0x202)][_0x45d846(0x2cb)](_0x255547[_0x45d846(0x1de)]),{'verbose':_0x255547[_0x45d846(0x1ed)]});_0x372f00=_0x2d307a['data'];}let _0x52b8ec;_0xfc13e6['sections']&&(_0x52b8ec=await loadJSON(_0xfc13e6[_0x45d846(0x190)],![]));const _0xd480f5=_0xfc13e6[_0x45d846(0x18d)]===_0x45d846(0x34b)?null:{'id':_0xfc13e6[_0x45d846(0x18d)],'type':_0x45d846(0x30e)};_0x1bbc1c={'attributes':{'name':_0xfc13e6['name'],'description':_0xfc13e6['description']||null,..._0x372f00!==undefined&&{'audienceId':_0x372f00},..._0x52b8ec!==undefined&&{'sections':_0x52b8ec}},'relationships':{'parentFolder':{'data':_0xd480f5}}};}const _0x5732f5=await withSpinner(_0x45d846(0x2ba)+(_0x1bbc1c[_0x45d846(0x211)]?.[_0x45d846(0x338)]??'')+_0x45d846(0x301),()=>_0x29b22a[_0x45d846(0x279)][_0x45d846(0x20e)](_0x1bbc1c),{'verbose':_0x255547[_0x45d846(0x1ed)]}),_0x44b3be=_0x5732f5[_0x45d846(0x17e)];return console[_0x45d846(0x1da)]('✔\x20Created\x20personalization\x20\x27'+_0x44b3be[_0x45d846(0x338)]+_0x45d846(0x18a)+_0x44b3be['id']),await handleSDKOutput([_0x44b3be],_0x255547),0x0;}}export class PSPzPatchCommand extends BaseCommand{[a31_0x344d96(0x338)]='ps:pz:patch';[a31_0x344d96(0x2a7)]=a31_0x344d96(0x219);async[a31_0x344d96(0x1a9)](_0x31c507){const _0x31d6e9=a31_0x344d96,{options:_0x7da36c,args:_0x4ae511}=_0x31c507,_0x3105c9=_0x7da36c,_0x53966e=_0x4ae511[0x0];if(!_0x53966e)return console[_0x31d6e9(0x1da)](_0x31d6e9(0x32f)),console[_0x31d6e9(0x1da)](_0x31d6e9(0x386)),console[_0x31d6e9(0x1da)](_0x31d6e9(0x2cc)),0x1;let _0xa97b72;if(_0x3105c9[_0x31d6e9(0x2c7)])_0xa97b72=await loadJSON(_0x3105c9['file'],!![]);else{if(!_0x3105c9[_0x31d6e9(0x338)])return console['error'](_0x31d6e9(0x1be)),console[_0x31d6e9(0x1da)](_0x31d6e9(0x386)),0x1;if(_0x3105c9[_0x31d6e9(0x2a7)]===undefined)return console[_0x31d6e9(0x1da)](_0x31d6e9(0x298)),console['error'](_0x31d6e9(0x386)),0x1;let _0x324a24;_0x3105c9[_0x31d6e9(0x190)]&&(_0x324a24=await loadJSON(_0x3105c9[_0x31d6e9(0x190)],![])),_0xa97b72={'attributes':{'name':_0x3105c9['name'],'description':_0x3105c9[_0x31d6e9(0x2a7)]||null,..._0x324a24!==undefined&&{'sections':_0x324a24}}};}const {tdx:_0x41abb6}=_0x31c507,_0x11659a=await withSpinner(_0x31d6e9(0x342)+_0x53966e+_0x31d6e9(0x301),()=>_0x41abb6[_0x31d6e9(0x279)]['patchPersonalization'](_0x53966e,_0xa97b72),{'verbose':_0x7da36c['verbose']}),_0x4ffbd3=_0x11659a['data'];return console[_0x31d6e9(0x1da)]('✔\x20Updated\x20personalization\x20\x27'+_0x4ffbd3['name']+_0x31d6e9(0x2fa)+_0x4ffbd3['id']+')'),await handleSDKOutput([_0x4ffbd3],_0x7da36c),0x0;}}export class PSPzInitCommand extends BaseParentSegmentCommand{['name']=a31_0x344d96(0x173);['description']='Add\x20template\x20personalization\x20section\x20to\x20parent\x20segment\x20YAML';async[a31_0x344d96(0x1a9)](_0x5dd70a){const _0x5541c3=a31_0x344d96,{options:_0x89df6e,args:_0x3102a2}=_0x5dd70a,_0x3b3819=_0x3102a2[0x0]||_0x89df6e['parentSegment'];if(!_0x3b3819)return showParentSegmentNotSetError(_0x5541c3(0x2f8)+_0x5541c3(0x314)),0x1;const _0x1a40b0=resolveYamlFile(_0x3b3819);if(!existsSync(_0x1a40b0))return showFileNotFoundError(_0x1a40b0,_0x3b3819),0x1;let _0x1a54ea;try{_0x1a54ea=readFileSync(_0x1a40b0,_0x5541c3(0x28e));}catch(_0x5a664b){const _0x185243=_0x5a664b instanceof Error?_0x5a664b[_0x5541c3(0x332)]:String(_0x5a664b);return console[_0x5541c3(0x1da)](_0x5541c3(0x1b2)+_0x185243),0x1;}let _0x17de9b;try{_0x17de9b=parseDef(_0x1a54ea);}catch(_0x27cc92){const _0xc4f15c=_0x27cc92 instanceof Error?_0x27cc92[_0x5541c3(0x332)]:String(_0x27cc92);return console['error'](a31_0x251538['red'](_0x5541c3(0x1a7)+_0xc4f15c)),0x1;}if(_0x17de9b[_0x5541c3(0x259)]&&_0x17de9b['personalization_services'][_0x5541c3(0x2cd)]>0x0)return console['error'](a31_0x251538['yellow'](_0x5541c3(0x312)+_0x1a40b0)),console[_0x5541c3(0x1da)](a31_0x251538[_0x5541c3(0x1ba)](_0x5541c3(0x340)+_0x17de9b[_0x5541c3(0x259)][_0x5541c3(0x2cd)]+_0x5541c3(0x26b))),0x1;!_0x17de9b[_0x5541c3(0x2fd)]&&(_0x17de9b[_0x5541c3(0x2fd)]={'events':[{'name':_0x5541c3(0x307),'source_table':_0x5541c3(0x1e9)}],'attributes':[{'name':'last_page_viewed','type':_0x5541c3(0x2e3)}],'id_stitching':{'primary_key':_0x17de9b[_0x5541c3(0x18f)][_0x5541c3(0x2a6)]===_0x5541c3(0x18c)?_0x5541c3(0x20a):_0x5541c3(0x183)}});_0x17de9b[_0x5541c3(0x259)]=[{'name':_0x5541c3(0x242),'description':_0x5541c3(0x17f),'trigger_event':_0x5541c3(0x307),'sections':[{'name':_0x5541c3(0x213),'criteria':_0x5541c3(0x237),'attributes':['last_page_viewed']}]}];const _0x203b37=serializeDef(_0x17de9b);return writeFileSync(_0x1a40b0,_0x203b37,_0x5541c3(0x28e)),console[_0x5541c3(0x1da)](a31_0x251538[_0x5541c3(0x339)]('✔')+_0x5541c3(0x37d)+a31_0x251538['cyan'](_0x1a40b0)),(!_0x17de9b['realtime']||_0x1a54ea[_0x5541c3(0x277)](_0x5541c3(0x1cc))===-0x1)&&console['error'](a31_0x251538['green']('✔')+'\x20Added\x20RT\x202.0\x20template\x20section'),console[_0x5541c3(0x1da)]('\x0a'+a31_0x251538['dim'](_0x5541c3(0x1fb))),console[_0x5541c3(0x1da)]('\x20\x201.\x20Edit\x20'+_0x1a40b0+'\x20to\x20configure\x20your\x20personalization\x20service'),console[_0x5541c3(0x1da)]('\x20\x202.\x20Run\x20'+a31_0x251538[_0x5541c3(0x1ba)](_0x5541c3(0x1ca)+_0x3b3819)+_0x5541c3(0x385)),0x0;}}