@treasuredata/tdx 2026.3.39 → 2026.3.40
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.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-login-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a32_0x51f12c=a32_0x1aab;(function(_0x160221,_0x4f9c37){const _0x23654a=a32_0x1aab,_0x3efb63=_0x160221();while(!![]){try{const _0x5a4532=-parseInt(_0x23654a(0x210))/0x1*(parseInt(_0x23654a(0x230))/0x2)+parseInt(_0x23654a(0x12b))/0x3*(parseInt(_0x23654a(0x165))/0x4)+parseInt(_0x23654a(0x11d))/0x5+parseInt(_0x23654a(0xe8))/0x6*(-parseInt(_0x23654a(0x1de))/0x7)+parseInt(_0x23654a(0x91))/0x8+parseInt(_0x23654a(0x198))/0x9*(parseInt(_0x23654a(0x254))/0xa)+parseInt(_0x23654a(0xcf))/0xb;if(_0x5a4532===_0x4f9c37)break;else _0x3efb63['push'](_0x3efb63['shift']());}catch(_0x22ebd3){_0x3efb63['push'](_0x3efb63['shift']());}}}(a32_0x44ac,0xc6b39));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a32_0x4881da from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';function a32_0x1aab(_0x35ae26,_0x4ef574){_0x35ae26=_0x35ae26-0x8a;const _0x44acb5=a32_0x44ac();let _0x1aabd1=_0x44acb5[_0x35ae26];return _0x1aabd1;}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 a32_0x265203 from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../sdk/segment/fields-display.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';const PARENT_SEGMENT_DIR='parent_segments',LEGACY_PARENT_SEGMENT_DIR='parent_segment';function openBrowser(_0x9e23c5){const _0x582b67=a32_0x1aab,_0x91000c=process[_0x582b67(0x113)],_0x2d2a0e=_0x91000c===_0x582b67(0x158)?_0x582b67(0x1e5):_0x91000c==='win32'?'start':_0x582b67(0x223);spawn(_0x2d2a0e,[_0x9e23c5],{'detached':!![],'stdio':_0x582b67(0x1dc)})['unref']();}function migrateLegacyDirectory(){const _0x415c9a=a32_0x1aab;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x2ba7b9=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x2ba7b9[_0x415c9a(0x1f4)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x415c9a(0x25f)](a32_0x265203['yellow'](_0x415c9a(0x14d)+LEGACY_PARENT_SEGMENT_DIR+'/\x20and\x20'+PARENT_SEGMENT_DIR+'/\x20directories\x20exist.')),console[_0x415c9a(0x25f)](a32_0x265203[_0x415c9a(0x1c2)](_0x415c9a(0x1a4)+LEGACY_PARENT_SEGMENT_DIR+_0x415c9a(0x8b))),![];console[_0x415c9a(0x25f)](a32_0x265203[_0x415c9a(0xb5)](_0x415c9a(0x241)+LEGACY_PARENT_SEGMENT_DIR+_0x415c9a(0x21f)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x415c9a(0x25f)](a32_0x265203['green']('✔\x20Renamed\x20directory\x20to\x20'+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x43092a){const _0x54dd3b=_0x43092a instanceof Error?_0x43092a[_0x415c9a(0x183)]:String(_0x43092a);return console[_0x415c9a(0x25f)](a32_0x265203[_0x415c9a(0x153)](_0x415c9a(0x219)+_0x54dd3b+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a32_0x51f12c(0x186)](_0xe95cde){return migrateLegacyDirectory(),super['run'](_0xe95cde);}}function resolveYamlFile(_0x5bc596){const _0x1c64a4=a32_0x51f12c;if(_0x5bc596[_0x1c64a4(0x25a)](_0x1c64a4(0xde))||_0x5bc596[_0x1c64a4(0x25a)](_0x1c64a4(0x9c)))return _0x5bc596;return a32_0x4881da[_0x1c64a4(0x97)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x5bc596)+_0x1c64a4(0xde));}function formatProgressMessage(_0x20d14c){const _0xcdd987=a32_0x51f12c,_0x7749c7=_0x20d14c[_0xcdd987(0xc9)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x7749c7){const [,_0x86f448,_0x5433d7,_0x5b91a2='']=_0x7749c7;return a32_0x265203[_0xcdd987(0x1c2)](_0x86f448+':')+'\x20'+_0x5433d7+a32_0x265203[_0xcdd987(0x1c2)](_0x5b91a2);}return a32_0x265203[_0xcdd987(0x1c2)](_0x20d14c);}function showFileNotFoundError(_0x29713b,_0xa66799){const _0x513052=a32_0x51f12c;console[_0x513052(0x25f)](a32_0x265203[_0x513052(0x153)](_0x513052(0x268)+_0x29713b+'\x0a')),console['error'](a32_0x265203[_0x513052(0xcd)]('Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20'+_0xa66799+_0x513052(0xab)));}function displayRealtimeValidation(_0xa97455){const _0x7fed1d=a32_0x51f12c;if(!_0xa97455[_0x7fed1d(0x23e)])return;const _0x5c0b28=_0xa97455['realtime'],_0x51a62e=_0x5c0b28[_0x7fed1d(0x1ef)]?a32_0x265203['green']('⚡\x20Enabled'):a32_0x265203['yellow'](_0x7fed1d(0x19c));console[_0x7fed1d(0x25f)]('\x0a'+a32_0x265203[_0x7fed1d(0x1c2)](_0x7fed1d(0x213))+'\x20'+_0x51a62e);if(_0x5c0b28[_0x7fed1d(0x121)]&&_0x5c0b28[_0x7fed1d(0x121)][_0x7fed1d(0x1ad)]>0x0){console[_0x7fed1d(0x25f)]('\x20\x20'+a32_0x265203[_0x7fed1d(0x1c2)](_0x7fed1d(0xfb))+'\x20'+_0x5c0b28[_0x7fed1d(0x121)][_0x7fed1d(0x1ad)]+_0x7fed1d(0x1e3));for(const _0x30ca65 of _0x5c0b28['events']){const _0x13730a=_0x30ca65['sourceTableValid']===![]?a32_0x265203['red']('✘'):a32_0x265203[_0x7fed1d(0xff)]('✔');console[_0x7fed1d(0x25f)](_0x7fed1d(0x1cd)+_0x13730a+'\x20'+_0x30ca65[_0x7fed1d(0x282)]),_0x30ca65[_0x7fed1d(0x127)]&&console[_0x7fed1d(0x25f)](_0x7fed1d(0x202)+a32_0x265203[_0x7fed1d(0x153)](_0x30ca65[_0x7fed1d(0x127)]));}}if(_0x5c0b28[_0x7fed1d(0x170)]&&_0x5c0b28['attributes'][_0x7fed1d(0x1ad)]>0x0){console[_0x7fed1d(0x25f)]('\x20\x20'+a32_0x265203[_0x7fed1d(0x1c2)](_0x7fed1d(0xa9))+'\x20'+_0x5c0b28['attributes']['length']+_0x7fed1d(0x1e3));for(const _0x4723cf of _0x5c0b28[_0x7fed1d(0x170)]){const _0x5bba1c=_0x4723cf[_0x7fed1d(0x263)]?a32_0x265203[_0x7fed1d(0xff)]('✔'):a32_0x265203['red']('✘');console['error'](_0x7fed1d(0x1cd)+_0x5bba1c+'\x20'+_0x4723cf[_0x7fed1d(0x282)]+'\x20'+a32_0x265203[_0x7fed1d(0x1c2)]('('+_0x4723cf['type']+')'));}}if(_0x5c0b28['idStitching']){const _0x4f81d1=_0x5c0b28[_0x7fed1d(0xe5)][_0x7fed1d(0xc0)]?.[_0x7fed1d(0x1ad)]?_0x7fed1d(0x258)+_0x5c0b28[_0x7fed1d(0xe5)]['stitchingKeys']['join'](',\x20')+']':'';console['error']('\x20\x20'+a32_0x265203['dim'](_0x7fed1d(0x125))+'\x20'+_0x5c0b28[_0x7fed1d(0xe5)]['primaryKey']+_0x4f81d1);}if(_0x5c0b28['personalizationServices']&&_0x5c0b28[_0x7fed1d(0xf9)][_0x7fed1d(0x1ad)]>0x0){console['error']('\x20\x20'+a32_0x265203[_0x7fed1d(0x1c2)](_0x7fed1d(0x1f9))+'\x20'+_0x5c0b28['personalizationServices'][_0x7fed1d(0x1ad)]+_0x7fed1d(0x237)+(_0x5c0b28[_0x7fed1d(0xf9)][_0x7fed1d(0x1ad)]!==0x1?'s':''));for(const _0x3acab8 of _0x5c0b28[_0x7fed1d(0xf9)]){console[_0x7fed1d(0x25f)](_0x7fed1d(0x25b)+_0x3acab8[_0x7fed1d(0x282)]);}}}function showParentSegmentNotSetError(_0x548746){const _0x2b66d3=a32_0x51f12c;console['error'](a32_0x265203['yellow']('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x2b66d3(0x25f)](_0x548746);}export class ParentSegmentListCommand extends BaseCommand{[a32_0x51f12c(0x282)]='segment:parent:list';[a32_0x51f12c(0x12a)]='List\x20parent\x20segments';async[a32_0x51f12c(0x1fc)](_0x13b280){const _0x119b08=a32_0x51f12c,{options:_0x72b8af,args:_0x1d56e2,tdx:_0x188561}=_0x13b280,_0x4c6774=_0x1d56e2[0x0];_0x72b8af[_0x119b08(0x188)]&&(console['error'](_0x119b08(0x267)+_0x72b8af[_0x119b08(0xa0)]),_0x4c6774&&console[_0x119b08(0x25f)](_0x119b08(0x179)+_0x4c6774));const _0x81fb71=await withSpinner(_0x4c6774?_0x119b08(0xc4)+_0x4c6774+_0x119b08(0x138):_0x119b08(0x1b2),()=>_0x188561['segment'][_0x119b08(0x215)](),{'verbose':_0x72b8af[_0x119b08(0x188)]});let _0x2b8af4=_0x81fb71[_0x119b08(0xef)];if(_0x4c6774){const _0x497db2=_0x4c6774[_0x119b08(0xf6)](/[.+^${}()|[\]\\]/g,_0x119b08(0x1fd))[_0x119b08(0xf6)](/\*/g,'.*')['replace'](/\?/g,'.'),_0xa343c4=new RegExp('^'+_0x497db2+'$','i');_0x2b8af4=_0x2b8af4[_0x119b08(0x21d)](_0x3dabe7=>_0xa343c4[_0x119b08(0x1f5)](_0x3dabe7[_0x119b08(0x170)][_0x119b08(0x282)]));}_0x2b8af4[_0x119b08(0xbc)]((_0x3569e7,_0x43c6fd)=>_0x3569e7[_0x119b08(0x170)][_0x119b08(0x282)]['localeCompare'](_0x43c6fd[_0x119b08(0x170)][_0x119b08(0x282)])),console['error']('✔\x20Found\x20'+_0x2b8af4[_0x119b08(0x1ad)]+'\x20parent\x20segment'+(_0x2b8af4[_0x119b08(0x1ad)]!==0x1?'s':''));const _0x366601=_0x405c2a=>{const _0x2bb619=_0x119b08;return getConsoleNextUrl(_0x72b8af[_0x2bb619(0xa0)],'/app/dw/parentSegments/'+_0x405c2a);};if(_0x72b8af[_0x119b08(0x1bc)]===_0x119b08(0x1c6)||_0x72b8af[_0x119b08(0x1bc)]==='jsonl'){const _0x87c8f2=_0x2b8af4[_0x119b08(0xe1)](_0x18728e=>({..._0x18728e,'url':_0x366601(_0x18728e['id'])}));await handleSDKOutput(_0x87c8f2,_0x72b8af);}else{if(_0x2b8af4[_0x119b08(0x1ad)]===0x0)_0x4c6774?console[_0x119b08(0x16d)](_0x119b08(0x199)+_0x4c6774):console[_0x119b08(0x16d)]('No\x20parent\x20segments\x20found');else for(const _0x1e11af of _0x2b8af4){const _0x585df1=_0x1e11af[_0x119b08(0x170)]['population']?a32_0x265203[_0x119b08(0x1c2)]('\x20('+formatRows(_0x1e11af[_0x119b08(0x170)][_0x119b08(0xee)])+')'):'',_0x5d23f1=hyperlink(_0x1e11af[_0x119b08(0x170)][_0x119b08(0x282)],_0x366601(_0x1e11af['id']));console['log'](_0x119b08(0x1d3)+_0x5d23f1+_0x585df1);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a32_0x51f12c(0x282)]='segment:parent:create';[a32_0x51f12c(0x12a)]=a32_0x51f12c(0xda);async['execute'](_0x2d30e8){const _0x2e96af=a32_0x51f12c,{options:_0xd0880e,args:_0x1c5773,tdx:_0x59896f}=_0x2d30e8;console['error']('\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a'+'\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a'+_0x2e96af(0x1c5));const _0x568387=_0xd0880e;if(_0x1c5773[_0x2e96af(0x1ad)]===0x0)return console[_0x2e96af(0x25f)](a32_0x265203[_0x2e96af(0x153)]('Error:\x20Parent\x20segment\x20name\x20is\x20required')),console[_0x2e96af(0x25f)](_0x2e96af(0x1bd)),0x1;const _0x1b7e2a=_0x1c5773[0x0];if(!_0x568387['database']||!_0x568387[_0x2e96af(0x203)])return console[_0x2e96af(0x25f)](_0x2e96af(0x1d0)),console[_0x2e96af(0x25f)](_0x2e96af(0x1bd)),0x1;_0x568387[_0x2e96af(0x188)]&&(console[_0x2e96af(0x25f)]('Site:\x20'+_0x568387[_0x2e96af(0xa0)]),console[_0x2e96af(0x25f)](_0x2e96af(0x200)+_0x1b7e2a),console[_0x2e96af(0x25f)](_0x2e96af(0x1b3)+_0x568387[_0x2e96af(0x197)]),console[_0x2e96af(0x25f)](_0x2e96af(0x249)+_0x568387[_0x2e96af(0x203)]));const _0x5a9a56=await loadJSONFromOptions(_0x568387[_0x2e96af(0x170)],_0x568387[_0x2e96af(0x235)]),_0x3fab6a=await loadJSONFromOptions(_0x568387[_0x2e96af(0x144)],_0x568387['behaviorsFile']),_0x1a50b2=await loadJSONFromOptions(_0x568387['customerGroup'],_0x568387['customerGroupFile']),_0xb5475e={'name':_0x1b7e2a,'description':_0x568387['description'],'scheduleType':_0x568387['scheduleType'],'scheduleOption':_0x568387[_0x2e96af(0x240)],'timezone':_0x568387[_0x2e96af(0x174)],'master':{'parentDatabaseName':_0x568387[_0x2e96af(0x197)],'parentTableName':_0x568387[_0x2e96af(0x203)]},'attributes':_0x5a9a56,'behaviors':_0x3fab6a,'customerGroup':_0x1a50b2},_0x3529a8=await withSpinner(_0x2e96af(0x1b9)+_0x1b7e2a+'\x27...',()=>_0x59896f[_0x2e96af(0x1c1)][_0x2e96af(0x28f)](_0xb5475e),{'verbose':_0xd0880e[_0x2e96af(0x188)]}),_0x318823=_0x3529a8[_0x2e96af(0xef)];return console[_0x2e96af(0x25f)](_0x2e96af(0x15e)+_0x318823[_0x2e96af(0x282)]+_0x2e96af(0x225)+_0x318823['id']),await handleSDKOutput([_0x318823],_0xd0880e),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a32_0x51f12c(0x282)]=a32_0x51f12c(0xea);[a32_0x51f12c(0x12a)]='Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]';async[a32_0x51f12c(0x1fc)](_0x3ade76){const _0x1d0bd4=a32_0x51f12c,{options:_0x1e083b,args:_0x1e44ec,tdx:_0x173f3e}=_0x3ade76;console[_0x1d0bd4(0x25f)]('\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a'+_0x1d0bd4(0x152)+_0x1d0bd4(0x1c5));const _0x2082dc=_0x1e083b;if(_0x1e44ec[_0x1d0bd4(0x1ad)]===0x0)return console[_0x1d0bd4(0x25f)](a32_0x265203[_0x1d0bd4(0x153)](_0x1d0bd4(0x1db))),console[_0x1d0bd4(0x25f)](_0x1d0bd4(0x23c)),0x1;const _0x3dc74c=_0x1e44ec[0x0];_0x2082dc['verbose']&&(console[_0x1d0bd4(0x25f)](_0x1d0bd4(0x267)+_0x2082dc['site']),console[_0x1d0bd4(0x25f)]('Parent\x20segment:\x20'+_0x3dc74c));const _0x3ccc61=await withSpinner('Fetching\x20current\x20configuration\x20for\x20\x27'+_0x3dc74c+_0x1d0bd4(0x138),()=>_0x173f3e[_0x1d0bd4(0x1c1)][_0x1d0bd4(0x195)](_0x3dc74c),{'verbose':_0x2082dc[_0x1d0bd4(0x188)]}),_0x1d4ed4=_0x3ccc61[_0x1d0bd4(0xef)],_0x13a08c=await loadJSONFromOptions(_0x2082dc[_0x1d0bd4(0x16e)],_0x2082dc[_0x1d0bd4(0x160)]),_0x493ff0=await loadJSONFromOptions(_0x2082dc['addBehaviors'],_0x2082dc[_0x1d0bd4(0x1c9)]),_0x103f8b={'name':_0x1d4ed4[_0x1d0bd4(0x282)],'description':_0x2082dc['description']!==undefined?_0x2082dc[_0x1d0bd4(0x12a)]:_0x1d4ed4['description'],'scheduleType':_0x2082dc[_0x1d0bd4(0x292)]!==undefined?_0x2082dc[_0x1d0bd4(0x292)]:_0x1d4ed4[_0x1d0bd4(0x292)],'scheduleOption':_0x2082dc[_0x1d0bd4(0x240)]!==undefined?_0x2082dc[_0x1d0bd4(0x240)]:_0x1d4ed4[_0x1d0bd4(0x240)],'timezone':_0x2082dc[_0x1d0bd4(0x174)]!==undefined?_0x2082dc[_0x1d0bd4(0x174)]:_0x1d4ed4[_0x1d0bd4(0x174)],'master':_0x1d4ed4['master'],'attributes':_0x13a08c?[..._0x1d4ed4[_0x1d0bd4(0x170)]||[],..._0x13a08c]:_0x1d4ed4[_0x1d0bd4(0x170)],'behaviors':_0x493ff0?[..._0x1d4ed4[_0x1d0bd4(0x144)]||[],..._0x493ff0]:_0x1d4ed4[_0x1d0bd4(0x144)],'customerGroup':_0x1d4ed4['customerGroup']},_0x1115e7=await withSpinner('Updating\x20parent\x20segment\x20\x27'+_0x3dc74c+_0x1d0bd4(0x138),()=>_0x173f3e[_0x1d0bd4(0x1c1)]['updateParent'](_0x3dc74c,_0x103f8b),{'verbose':_0x2082dc['verbose']}),_0xe5322b=_0x1115e7[_0x1d0bd4(0xef)];return console['error'](_0x1d0bd4(0x143)+_0xe5322b[_0x1d0bd4(0x282)]+'\x27'),await handleSDKOutput([_0xe5322b],_0x2082dc),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a32_0x51f12c(0x282)]=a32_0x51f12c(0xa7);[a32_0x51f12c(0x12a)]=a32_0x51f12c(0x159);async['execute'](_0x10aadd){const _0xc1ae91=a32_0x51f12c,{options:_0x1cac9c,args:_0x376406,tdx:_0x480704}=_0x10aadd,_0x12855a=_0x1cac9c,_0x3ab13d=_0x376406[0x0]||_0x1cac9c[_0xc1ae91(0x196)];if(!_0x3ab13d)return showParentSegmentNotSetError(_0xc1ae91(0x277)+_0xc1ae91(0xb7)),0x1;if(_0x12855a['use']&&_0x12855a[_0xc1ae91(0x96)])return console['error'](a32_0x265203[_0xc1ae91(0x153)](_0xc1ae91(0xbe))),console['error'](a32_0x265203[_0xc1ae91(0x1c2)](_0xc1ae91(0x1f0))),console['error'](a32_0x265203[_0xc1ae91(0x1c2)]('using\x20the\x20default\x20path:\x20'+PARENT_SEGMENT_DIR+'/{name}.yml\x0a')),console[_0xc1ae91(0x25f)](a32_0x265203[_0xc1ae91(0xcd)](_0xc1ae91(0x27e))),0x1;const _0x26ef58=_0x12855a['output']||a32_0x4881da[_0xc1ae91(0x97)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x3ab13d)+_0xc1ae91(0xde));_0x12855a[_0xc1ae91(0x188)]&&(console[_0xc1ae91(0x25f)](_0xc1ae91(0x267)+_0x12855a[_0xc1ae91(0xa0)]),console[_0xc1ae91(0x25f)](_0xc1ae91(0x234)+_0x3ab13d),console[_0xc1ae91(0x25f)](_0xc1ae91(0x1e7)+_0x26ef58));const _0x431f16=await withSpinner(_0xc1ae91(0xd0)+_0x3ab13d+_0xc1ae91(0x138),()=>_0x480704[_0xc1ae91(0x1c1)][_0xc1ae91(0xf7)](_0x3ab13d),{'verbose':_0x12855a[_0xc1ae91(0x188)]}),_0x3a8b52=_0x431f16[_0xc1ae91(0xef)];if(existsSync(_0x26ef58)){const _0x4a3f8b=readFileSync(_0x26ef58,_0xc1ae91(0x1f8)),_0x36b1d9=generateDiff(_0x4a3f8b,_0x3a8b52);if(!hasChanges(_0x36b1d9))console[_0xc1ae91(0x25f)](a32_0x265203[_0xc1ae91(0xff)]('✔')+_0xc1ae91(0x222)+a32_0x265203[_0xc1ae91(0xcd)](_0x26ef58)+_0xc1ae91(0xbd));else{console[_0xc1ae91(0x25f)](_0xc1ae91(0x9f)+_0x26ef58+'\x27:'),console[_0xc1ae91(0x25f)]('─'[_0xc1ae91(0x12e)](0x3c)),console[_0xc1ae91(0x25f)](formatDiffWithColors(_0x36b1d9)),console[_0xc1ae91(0x25f)]('─'[_0xc1ae91(0x12e)](0x3c));if(!_0x12855a[_0xc1ae91(0x21e)]){if(!isInteractive())return console[_0xc1ae91(0x25f)](a32_0x265203[_0xc1ae91(0x153)](_0xc1ae91(0x18e)),_0xc1ae91(0x173)),console[_0xc1ae91(0x25f)](a32_0x265203[_0xc1ae91(0x1c2)](_0xc1ae91(0x26c))),0x1;const _0x56e208=await confirmKey(_0xc1ae91(0x1df)+_0x26ef58+'\x27?');if(!_0x56e208)return console[_0xc1ae91(0x25f)](a32_0x265203[_0xc1ae91(0xb5)]('Aborted.')),0x1;}writeFileSync(_0x26ef58,_0x3a8b52,_0xc1ae91(0x1f8)),console['error'](a32_0x265203['green']('✔')+_0xc1ae91(0x1ec)+a32_0x265203[_0xc1ae91(0xcd)](_0x26ef58));}}else{const _0x31e5ae=a32_0x4881da['dirname'](_0x26ef58);!existsSync(_0x31e5ae)&&mkdirSync(_0x31e5ae,{'recursive':!![]}),writeFileSync(_0x26ef58,_0x3a8b52,_0xc1ae91(0x1f8)),console['error'](a32_0x265203['green']('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a32_0x265203[_0xc1ae91(0xcd)](_0x26ef58));}return saveSessionContext({'parent_segment':_0x3ab13d},_0x12855a[_0xc1ae91(0x142)]),console[_0xc1ae91(0x25f)](a32_0x265203[_0xc1ae91(0xff)]('✔')+_0xc1ae91(0x11f)+a32_0x265203[_0xc1ae91(0x1c2)](_0xc1ae91(0x207))+_0xc1ae91(0x100)+a32_0x265203['cyan'](_0x3ab13d)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a32_0x51f12c(0x282)]=a32_0x51f12c(0x1ca);[a32_0x51f12c(0x12a)]=a32_0x51f12c(0x1a1);async[a32_0x51f12c(0x1fc)](_0x245edf){const _0x4844bd=a32_0x51f12c,{options:_0x3fe2ab,args:_0x50751f,tdx:_0x3496af}=_0x245edf,_0x25fc42=_0x3fe2ab,_0x4864f8=_0x50751f[0x0]||_0x3fe2ab[_0x4844bd(0x196)];if(!_0x4864f8)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a'+_0x4844bd(0x255)),0x1;const _0xae1bfe=resolveYamlFile(_0x4864f8);if(!existsSync(_0xae1bfe))return showFileNotFoundError(_0xae1bfe,_0x4864f8),0x1;_0x25fc42[_0x4844bd(0x188)]&&(console[_0x4844bd(0x25f)](_0x4844bd(0x267)+_0x25fc42['site']),console[_0x4844bd(0x25f)](_0x4844bd(0x295)+_0xae1bfe));let _0x56291e;try{_0x56291e=readFileSync(_0xae1bfe,_0x4844bd(0x1f8));}catch(_0x55bd39){const _0x2f60e2=_0x55bd39 instanceof Error?_0x55bd39[_0x4844bd(0x183)]:String(_0x55bd39);return console[_0x4844bd(0x25f)](_0x4844bd(0x1d1)+_0x2f60e2),0x1;}const _0x22944b=await withSpinner(_0x4844bd(0x270),()=>_0x3496af['segment'][_0x4844bd(0x285)](_0x56291e),{'verbose':_0x25fc42[_0x4844bd(0x188)]}),_0x5c508b=_0x22944b['data'],{isNew:_0x376f43,name:_0x2e2463,hasChanges:_0x461801,diffFormatted:_0x3d15d7}=_0x5c508b;if(!_0x461801)return console[_0x4844bd(0x25f)](_0x4844bd(0x178)+_0x2e2463+'\x27\x20is\x20already\x20up\x20to\x20date'),0x0;_0x376f43?console[_0x4844bd(0x25f)](_0x4844bd(0x10d)+_0x2e2463+'\x27:'):console[_0x4844bd(0x25f)](_0x4844bd(0x1a6)+_0x2e2463+'\x27:');console[_0x4844bd(0x25f)]('─'[_0x4844bd(0x12e)](0x3c)),console[_0x4844bd(0x25f)](_0x3d15d7),console[_0x4844bd(0x25f)]('─'[_0x4844bd(0x12e)](0x3c));const _0x2e78d0=_0x376f43?_0x4844bd(0x109)+_0x2e2463+'\x27?':_0x4844bd(0x92)+_0x2e2463+'\x27?';if(!_0x25fc42['yes']){if(!isInteractive())return console[_0x4844bd(0x25f)](a32_0x265203[_0x4844bd(0x153)](_0x4844bd(0x18e)),_0x4844bd(0x173)),console[_0x4844bd(0x25f)](a32_0x265203[_0x4844bd(0x1c2)](_0x4844bd(0x26c))),0x1;const _0x5d3e27=await confirmKey(_0x2e78d0);if(!_0x5d3e27)return console[_0x4844bd(0x25f)](a32_0x265203['yellow'](_0x4844bd(0x126))),0x1;}const _0x29e088=_0x376f43?_0x4844bd(0x19e):_0x4844bd(0x1f6),_0x30e783=await withSpinner(_0x29e088+_0x4844bd(0x19b)+_0x2e2463+_0x4844bd(0x138),()=>_0x5c508b[_0x4844bd(0x10a)](),{'verbose':_0x25fc42[_0x4844bd(0x188)]}),_0x501256=_0x30e783['data'],_0x36c14b=getConsoleNextUrl(_0x25fc42[_0x4844bd(0xa0)],'/app/dw/parentSegments/'+_0x501256['id']),_0x59925a=_0x376f43?_0x4844bd(0x1bf):_0x4844bd(0x1cf);return console[_0x4844bd(0x25f)]('✔\x20'+_0x59925a+_0x4844bd(0x19b)+_0x501256[_0x4844bd(0x282)]+'\x27'),console[_0x4844bd(0x25f)]('\x20\x20'+_0x36c14b),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a32_0x51f12c(0x282)]='segment:parent:validate';[a32_0x51f12c(0x12a)]=a32_0x51f12c(0x10c);async[a32_0x51f12c(0x1fc)](_0x267d0f){const _0x1e16b3=a32_0x51f12c,{options:_0x34fd99,args:_0x8a819a,tdx:_0x35d479}=_0x267d0f,_0x263d15=_0x34fd99,_0x409a1d=_0x8a819a[0x0]||_0x34fd99[_0x1e16b3(0x196)];if(!_0x409a1d)return showParentSegmentNotSetError(_0x1e16b3(0x22b)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a'+_0x1e16b3(0x122)+_0x1e16b3(0x1e2)+_0x1e16b3(0x28c)+_0x1e16b3(0x18c)),0x1;const _0x414879=resolveYamlFile(_0x409a1d);if(!existsSync(_0x414879))return showFileNotFoundError(_0x414879,_0x409a1d),0x1;_0x263d15[_0x1e16b3(0x188)]&&(console[_0x1e16b3(0x25f)](_0x1e16b3(0x267)+_0x263d15['site']),console[_0x1e16b3(0x25f)](_0x1e16b3(0x295)+_0x414879));let _0x555a9d;try{_0x555a9d=readFileSync(_0x414879,_0x1e16b3(0x1f8));}catch(_0x5522bb){const _0x9cf894=_0x5522bb instanceof Error?_0x5522bb['message']:String(_0x5522bb);return console[_0x1e16b3(0x25f)]('Error\x20reading\x20file:\x20'+_0x9cf894),0x1;}const _0xa2617a=createCommandSpinner(a32_0x265203[_0x1e16b3(0x1c2)](_0x1e16b3(0x13b)),{'verbose':_0x263d15[_0x1e16b3(0x188)]});_0xa2617a[_0x1e16b3(0x17a)]();const _0x190988={'onProgress':_0x184a1f=>{const _0x35d432=_0x1e16b3;_0xa2617a[_0x35d432(0x190)]=formatProgressMessage(_0x184a1f);}};if(_0x263d15['master'])_0x190988[_0x1e16b3(0x257)]=!![];if(_0x263d15[_0x1e16b3(0x22c)])_0x190988[_0x1e16b3(0x22c)]=!![];_0x263d15[_0x1e16b3(0x8e)]&&(_0x190988[_0x1e16b3(0x8e)]=_0x263d15[_0x1e16b3(0x8e)]);_0x263d15[_0x1e16b3(0x94)]&&(_0x190988[_0x1e16b3(0x94)]=_0x263d15['behavior']);if(_0x263d15[_0x1e16b3(0x208)])_0x190988['interval']=_0x263d15[_0x1e16b3(0x208)];let _0x4d16f4;try{_0x4d16f4=await _0x35d479['segment'][_0x1e16b3(0xbb)](_0x555a9d,_0x190988),_0xa2617a[_0x1e16b3(0x1ea)]();}catch(_0x138af0){_0xa2617a[_0x1e16b3(0x1ea)]();throw _0x138af0;}const _0xe6a79b=_0x263d15[_0x1e16b3(0x208)]||'-1d';return this[_0x1e16b3(0x192)](_0x4d16f4,_0x190988,_0x414879,_0xe6a79b),_0x4d16f4[_0x1e16b3(0x220)]?0x0:0x1;}[a32_0x51f12c(0x192)](_0x428431,_0x5193b4,_0x585104,_0x3f5a5c){const _0x326e5d=a32_0x51f12c;console[_0x326e5d(0x25f)]('\x0a'+a32_0x265203[_0x326e5d(0x27a)](_0x326e5d(0xce))+'\x20'+_0x428431[_0x326e5d(0x282)]),console[_0x326e5d(0x25f)]('═'[_0x326e5d(0x12e)](0x3c)),this[_0x326e5d(0x13c)](_0x428431);if(typeof _0x5193b4[_0x326e5d(0x8e)]==='string'){this['displayAttributesStats'](_0x428431),this[_0x326e5d(0x110)](_0x428431),this[_0x326e5d(0xdf)](_0x585104,_0x3f5a5c,_0x326e5d(0x8e),_0x5193b4[_0x326e5d(0x8e)]);return;}if(_0x5193b4['attribute']===!![]){this[_0x326e5d(0xdb)](_0x428431),this[_0x326e5d(0x110)](_0x428431),this[_0x326e5d(0xdf)](_0x585104,_0x3f5a5c,_0x326e5d(0x170));return;}if(typeof _0x5193b4[_0x326e5d(0x94)]==='string'){this[_0x326e5d(0x18d)](_0x428431,_0x3f5a5c),this[_0x326e5d(0x110)](_0x428431),this['displayPreviewHints'](_0x585104,_0x3f5a5c,'behavior',_0x5193b4[_0x326e5d(0x94)]);return;}if(_0x5193b4[_0x326e5d(0x94)]===!![]){this[_0x326e5d(0x18d)](_0x428431,_0x3f5a5c),this['displaySummary'](_0x428431),this['displayPreviewHints'](_0x585104,_0x3f5a5c,_0x326e5d(0x144));return;}this['displayAttributesStats'](_0x428431),this[_0x326e5d(0x18d)](_0x428431,_0x3f5a5c),this[_0x326e5d(0xe6)](_0x428431),this[_0x326e5d(0x110)](_0x428431),this[_0x326e5d(0xdf)](_0x585104,_0x3f5a5c,_0x326e5d(0x1a3));}[a32_0x51f12c(0xe6)](_0x25321c){displayRealtimeValidation(_0x25321c);}[a32_0x51f12c(0xdf)](_0x29a28d,_0x4544bc,_0x36bcde,_0x1fc394){const _0x58a540=a32_0x51f12c;console[_0x58a540(0x25f)]('\x0a'+a32_0x265203[_0x58a540(0x1c2)]('To\x20view\x20sample\x20data:'));const _0x488e1a=_0x4544bc!==_0x58a540(0x25e)?_0x58a540(0x105)+_0x4544bc:'';if(_0x36bcde==='attribute'&&_0x1fc394)console[_0x58a540(0x25f)]('\x20\x20'+a32_0x265203[_0x58a540(0x1c2)](_0x58a540(0x28a)+_0x29a28d+_0x58a540(0x251)+_0x1fc394+'\x22'+_0x488e1a));else{if(_0x36bcde===_0x58a540(0x94)&&_0x1fc394)console['error']('\x20\x20'+a32_0x265203[_0x58a540(0x1c2)]('tdx\x20ps\x20preview\x20'+_0x29a28d+_0x58a540(0x15f)+_0x1fc394+'\x22'+_0x488e1a));else(_0x36bcde===_0x58a540(0x170)||_0x36bcde===_0x58a540(0x1a3))&&console[_0x58a540(0x25f)]('\x20\x20'+a32_0x265203[_0x58a540(0x1c2)](_0x58a540(0x28a)+_0x29a28d+_0x58a540(0x20b)+_0x488e1a));}(_0x36bcde===_0x58a540(0x144)||_0x36bcde===_0x58a540(0x1a3))&&console[_0x58a540(0x25f)]('\x20\x20'+a32_0x265203[_0x58a540(0x1c2)]('tdx\x20ps\x20preview\x20'+_0x29a28d+'\x20--behavior\x20\x22<name>\x22'+_0x488e1a)),_0x36bcde===_0x58a540(0x1a3)&&console[_0x58a540(0x25f)]('\x20\x20'+a32_0x265203[_0x58a540(0x1c2)](_0x58a540(0x28a)+_0x29a28d+_0x58a540(0x26a)+_0x488e1a));}[a32_0x51f12c(0x13c)](_0x18f986){const _0x5668ba=a32_0x51f12c,{master:_0x278de4}=_0x18f986,_0x4c56b6=_0x278de4[_0x5668ba(0x247)]?a32_0x265203['green']('✔'):a32_0x265203[_0x5668ba(0x153)]('✘');console[_0x5668ba(0x25f)]('\x0a'+a32_0x265203[_0x5668ba(0x1c2)]('Master\x20Table')),console[_0x5668ba(0x25f)](_0x4c56b6+'\x20'+a32_0x265203[_0x5668ba(0x27a)](_0x278de4[_0x5668ba(0x197)]+'.'+_0x278de4[_0x5668ba(0x203)])),_0x278de4[_0x5668ba(0x247)]?_0x278de4[_0x5668ba(0x1dd)]!==undefined&&console[_0x5668ba(0x25f)]('\x20\x20'+a32_0x265203['dim'](_0x5668ba(0x106))+'\x20'+a32_0x265203[_0x5668ba(0xcd)](formatRows(_0x278de4[_0x5668ba(0x1dd)]))):console[_0x5668ba(0x25f)]('\x20\x20'+a32_0x265203[_0x5668ba(0x153)]('Error:')+'\x20'+_0x278de4[_0x5668ba(0x9e)]);}['displayAttributesStats'](_0x3dba7f){const _0x428457=a32_0x51f12c;if(_0x3dba7f[_0x428457(0x170)]['length']===0x0)return;console[_0x428457(0x25f)]('\x0a'+a32_0x265203['dim'](_0x428457(0xec)));for(const _0x38e49f of _0x3dba7f[_0x428457(0x170)]){const _0xbd7421=_0x38e49f['schemaValid']?a32_0x265203[_0x428457(0xff)]('✔'):a32_0x265203[_0x428457(0x153)]('✘');let _0x3bc990='';if(_0x38e49f[_0x428457(0x247)]&&_0x38e49f[_0x428457(0x1d7)]!==undefined&&_0x38e49f[_0x428457(0xb0)]!==undefined){const _0x40e768=_0x38e49f[_0x428457(0xb0)]['toFixed'](0x1),_0x3b11f6=_0x38e49f[_0x428457(0xb0)]>=0x50?a32_0x265203[_0x428457(0xff)]:_0x38e49f[_0x428457(0xb0)]>=0x32?a32_0x265203[_0x428457(0xb5)]:a32_0x265203[_0x428457(0x153)];_0x3bc990='\x20'+a32_0x265203[_0x428457(0x1c2)](_0x428457(0x260))+'\x20'+_0x3b11f6(_0x40e768+'%')+'\x20('+formatRows(_0x38e49f[_0x428457(0x1d7)])+_0x428457(0x28b);}console[_0x428457(0x25f)](_0xbd7421+'\x20'+a32_0x265203[_0x428457(0x27a)](_0x38e49f[_0x428457(0x282)])+_0x3bc990),console[_0x428457(0x25f)]('\x20\x20'+a32_0x265203[_0x428457(0x1c2)](_0x428457(0x1f3))+'\x20'+a32_0x265203[_0x428457(0x27a)](_0x38e49f['database']+'.'+_0x38e49f[_0x428457(0x203)]));const _0x341036=_0x38e49f[_0x428457(0x141)]===_0x38e49f['foreignKey']?a32_0x265203['dim'](_0x428457(0x1c4))+'\x20'+_0x38e49f['joinKey']:a32_0x265203[_0x428457(0x1c2)]('Join:')+'\x20'+_0x38e49f[_0x428457(0x141)]+_0x428457(0x100)+_0x38e49f[_0x428457(0x120)];console['error']('\x20\x20'+_0x341036),console[_0x428457(0x25f)]('\x20\x20'+a32_0x265203[_0x428457(0x1c2)](_0x428457(0x22f))),this['displayColumns'](_0x38e49f[_0x428457(0x17f)]),!_0x38e49f['schemaValid']&&console[_0x428457(0x25f)]('\x20\x20'+a32_0x265203[_0x428457(0x153)](_0x428457(0x163))+'\x20'+_0x38e49f[_0x428457(0x9e)]);}}[a32_0x51f12c(0x18d)](_0x43d3f7,_0x1a2d1a){const _0x4dc6b1=a32_0x51f12c;if(_0x43d3f7[_0x4dc6b1(0x144)][_0x4dc6b1(0x1ad)]===0x0)return;console[_0x4dc6b1(0x25f)]('\x0a'+a32_0x265203[_0x4dc6b1(0x1c2)](_0x4dc6b1(0x14a))+'\x20'+a32_0x265203[_0x4dc6b1(0x1c2)]('('+_0x1a2d1a+')'));for(const _0x5d4b21 of _0x43d3f7[_0x4dc6b1(0x144)]){const _0x223cf9=_0x5d4b21[_0x4dc6b1(0x247)]?a32_0x265203[_0x4dc6b1(0xff)]('✔'):a32_0x265203['red']('✘');let _0x458311='';if(_0x5d4b21[_0x4dc6b1(0x247)]&&_0x5d4b21[_0x4dc6b1(0x27f)]!==undefined&&_0x5d4b21['totalEvents']!==undefined){const _0x3fbd1d=_0x5d4b21[_0x4dc6b1(0x1fe)]?.[_0x4dc6b1(0x19a)](0x1)||'?',_0x43afe2=(_0x5d4b21[_0x4dc6b1(0x1fe)]??0x0)>=0x32?a32_0x265203['green']:(_0x5d4b21[_0x4dc6b1(0x1fe)]??0x0)>=0x14?a32_0x265203[_0x4dc6b1(0xb5)]:a32_0x265203['red'];_0x458311='\x20'+a32_0x265203[_0x4dc6b1(0x1c2)]('Customers:')+'\x20'+_0x43afe2(formatRows(_0x5d4b21[_0x4dc6b1(0x27f)]))+'\x20('+_0x3fbd1d+_0x4dc6b1(0x24d)+a32_0x265203[_0x4dc6b1(0x1c2)](_0x4dc6b1(0xfb))+'\x20'+a32_0x265203[_0x4dc6b1(0xcd)](formatRows(_0x5d4b21[_0x4dc6b1(0x1d2)]));}console[_0x4dc6b1(0x25f)](_0x223cf9+'\x20'+a32_0x265203[_0x4dc6b1(0x27a)](_0x5d4b21[_0x4dc6b1(0x282)])+_0x458311),console[_0x4dc6b1(0x25f)]('\x20\x20'+a32_0x265203[_0x4dc6b1(0x1c2)](_0x4dc6b1(0x1f3))+'\x20'+a32_0x265203[_0x4dc6b1(0x27a)](_0x5d4b21[_0x4dc6b1(0x197)]+'.'+_0x5d4b21[_0x4dc6b1(0x203)]));const _0x3b7ff1=_0x5d4b21['joinKey']===_0x5d4b21['foreignKey']?a32_0x265203[_0x4dc6b1(0x1c2)]('Join\x20on:')+'\x20'+_0x5d4b21[_0x4dc6b1(0x141)]:a32_0x265203[_0x4dc6b1(0x1c2)](_0x4dc6b1(0x104))+'\x20'+_0x5d4b21[_0x4dc6b1(0x141)]+_0x4dc6b1(0x100)+_0x5d4b21[_0x4dc6b1(0x120)];console[_0x4dc6b1(0x25f)]('\x20\x20'+_0x3b7ff1),console[_0x4dc6b1(0x25f)]('\x20\x20'+a32_0x265203[_0x4dc6b1(0x1c2)](_0x4dc6b1(0x22f))),this[_0x4dc6b1(0x130)](_0x5d4b21[_0x4dc6b1(0x17f)]),!_0x5d4b21['schemaValid']&&console[_0x4dc6b1(0x25f)]('\x20\x20'+a32_0x265203[_0x4dc6b1(0x153)](_0x4dc6b1(0x163))+'\x20'+_0x5d4b21['schemaError']);}}['displayColumns'](_0xaae546){const _0x50d1bb=a32_0x51f12c;for(const _0x134e24 of _0xaae546){_0x134e24['label']===_0x134e24[_0x50d1bb(0x8c)]||_0x134e24[_0x50d1bb(0x8c)]==='*'?console[_0x50d1bb(0x25f)](_0x50d1bb(0x25b)+_0x134e24[_0x50d1bb(0x24b)]):console['error'](_0x50d1bb(0x25b)+_0x134e24[_0x50d1bb(0x24b)]+'\x20'+a32_0x265203[_0x50d1bb(0x1c2)]('('+_0x134e24[_0x50d1bb(0x8c)]+')'));}}[a32_0x51f12c(0x110)](_0x1effa2){const _0x353c99=a32_0x51f12c;console[_0x353c99(0x25f)]('─'[_0x353c99(0x12e)](0x3c));if(_0x1effa2[_0x353c99(0x232)][_0x353c99(0x1ad)]>0x0){console[_0x353c99(0x25f)]('\x0a'+a32_0x265203[_0x353c99(0x153)]('Errors:'));for(const _0x13dfbd of _0x1effa2[_0x353c99(0x232)]){console[_0x353c99(0x25f)]('\x20\x20'+a32_0x265203['red']('•')+'\x20'+_0x13dfbd);}}_0x1effa2[_0x353c99(0x220)]&&console[_0x353c99(0x25f)]('\x0a'+a32_0x265203[_0x353c99(0xff)]('✔')+_0x353c99(0x148));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a32_0x51f12c(0x282)]=a32_0x51f12c(0x1a7);[a32_0x51f12c(0x12a)]=a32_0x51f12c(0xfe);async['execute'](_0x1872d6){const _0x43c954=a32_0x51f12c,{options:_0x33745a,args:_0x5a3624,tdx:_0x4e27ae}=_0x1872d6,_0x5c6c2c=_0x33745a,_0x476823=_0x5a3624[0x0]||_0x33745a[_0x43c954(0x196)];if(!_0x476823)return showParentSegmentNotSetError(_0x43c954(0x10e)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a'+_0x43c954(0xe7)+_0x43c954(0x149)+_0x43c954(0xf8)+_0x43c954(0x274)+_0x43c954(0xd7)+_0x43c954(0x18c)),0x1;if(!_0x5c6c2c[_0x43c954(0x257)]&&!_0x5c6c2c[_0x43c954(0x8e)]&&!_0x5c6c2c[_0x43c954(0x94)]&&!_0x5c6c2c[_0x43c954(0x22c)])return console[_0x43c954(0x25f)](a32_0x265203[_0x43c954(0x153)](_0x43c954(0x239))),console[_0x43c954(0x25f)](_0x43c954(0xaf)),console[_0x43c954(0x25f)](_0x43c954(0x24f)),console[_0x43c954(0x25f)](_0x43c954(0x17b)),console[_0x43c954(0x25f)](_0x43c954(0x132)),console[_0x43c954(0x25f)]('\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior'),console[_0x43c954(0x25f)](_0x43c954(0x15c)),0x1;const _0x2b3a44=resolveYamlFile(_0x476823);if(!existsSync(_0x2b3a44))return showFileNotFoundError(_0x2b3a44,_0x476823),0x1;_0x5c6c2c['verbose']&&(console[_0x43c954(0x25f)](_0x43c954(0x267)+_0x5c6c2c['site']),console['error'](_0x43c954(0x295)+_0x2b3a44));let _0x414606;try{_0x414606=readFileSync(_0x2b3a44,_0x43c954(0x1f8));}catch(_0x3b9746){const _0x1de781=_0x3b9746 instanceof Error?_0x3b9746['message']:String(_0x3b9746);return console[_0x43c954(0x25f)]('Error\x20reading\x20file:\x20'+_0x1de781),0x1;}let _0x5ad31d;try{_0x5ad31d=parseDef(_0x414606);}catch(_0x31f7f9){const _0x57a9d0=_0x31f7f9 instanceof Error?_0x31f7f9[_0x43c954(0x183)]:String(_0x31f7f9);return console[_0x43c954(0x25f)](a32_0x265203[_0x43c954(0x153)](_0x43c954(0x99)+_0x57a9d0)),0x1;}if(_0x5c6c2c['attribute']===!![]||_0x5c6c2c[_0x43c954(0x8e)]===''){const _0xf3fa1b=_0x5ad31d[_0x43c954(0x170)]?.[_0x43c954(0xe1)](_0x2c38f7=>_0x2c38f7[_0x43c954(0x282)])||[];if(_0xf3fa1b[_0x43c954(0x1ad)]===0x0)console[_0x43c954(0x25f)](a32_0x265203['red'](_0x43c954(0xdd)));else{console[_0x43c954(0x25f)](a32_0x265203[_0x43c954(0x153)](_0x43c954(0xc1))),console['error']('Available\x20attributes:');for(const _0x35f23f of _0xf3fa1b){console[_0x43c954(0x25f)]('\x20\x20'+a32_0x265203[_0x43c954(0xcd)](_0x35f23f));}console[_0x43c954(0x25f)](_0x43c954(0x276)+_0x476823+_0x43c954(0x251)+_0xf3fa1b[0x0]+'\x22');}return 0x1;}if(_0x5c6c2c[_0x43c954(0x94)]===!![]||_0x5c6c2c[_0x43c954(0x94)]===''){const _0x1492b0=_0x5ad31d[_0x43c954(0x144)]?.[_0x43c954(0xe1)](_0x170805=>_0x170805[_0x43c954(0x282)])||[];if(_0x1492b0[_0x43c954(0x1ad)]===0x0)console[_0x43c954(0x25f)](a32_0x265203['red'](_0x43c954(0x1e0)));else{console[_0x43c954(0x25f)](a32_0x265203[_0x43c954(0x153)](_0x43c954(0xb8))),console['error']('Available\x20behaviors:');for(const _0x4198b3 of _0x1492b0){console[_0x43c954(0x25f)]('\x20\x20'+a32_0x265203[_0x43c954(0xcd)](_0x4198b3));}console[_0x43c954(0x25f)](_0x43c954(0x276)+_0x476823+_0x43c954(0x15f)+_0x1492b0[0x0]+'\x22');}return 0x1;}const _0x4e15aa=createCommandSpinner(a32_0x265203[_0x43c954(0x1c2)](_0x43c954(0xc8)),{'verbose':_0x5c6c2c[_0x43c954(0x188)]});_0x4e15aa[_0x43c954(0x17a)]();const _0x2987f3={'onProgress':_0x53adeb=>{const _0x3b5aaf=_0x43c954;_0x4e15aa[_0x3b5aaf(0x190)]=formatProgressMessage(_0x53adeb);}};if(_0x5c6c2c[_0x43c954(0x257)])_0x2987f3[_0x43c954(0x257)]=!![];if(_0x5c6c2c[_0x43c954(0x8e)]&&typeof _0x5c6c2c[_0x43c954(0x8e)]===_0x43c954(0x18f))_0x2987f3[_0x43c954(0x8e)]=_0x5c6c2c[_0x43c954(0x8e)];if(_0x5c6c2c['behavior']&&typeof _0x5c6c2c[_0x43c954(0x94)]===_0x43c954(0x18f))_0x2987f3['behavior']=_0x5c6c2c['behavior'];if(_0x5c6c2c[_0x43c954(0x22c)])_0x2987f3[_0x43c954(0x22c)]=!![];if(_0x5c6c2c['interval'])_0x2987f3[_0x43c954(0x208)]=_0x5c6c2c[_0x43c954(0x208)];let _0x37e0b2;try{_0x37e0b2=await _0x4e27ae[_0x43c954(0x1c1)][_0x43c954(0x9d)](_0x414606,_0x2987f3),_0x4e15aa[_0x43c954(0x1ea)]();}catch(_0x162d3e){_0x4e15aa[_0x43c954(0x1ea)]();throw _0x162d3e;}return await this['displayPreviewResults'](_0x37e0b2,{'master':_0x5c6c2c[_0x43c954(0x257)],'attribute':typeof _0x5c6c2c[_0x43c954(0x8e)]==='string'?_0x5c6c2c[_0x43c954(0x8e)]:undefined,'behavior':typeof _0x5c6c2c[_0x43c954(0x94)]===_0x43c954(0x18f)?_0x5c6c2c[_0x43c954(0x94)]:undefined,'enriched':_0x5c6c2c[_0x43c954(0x22c)]}),_0x37e0b2[_0x43c954(0x220)]?0x0:0x1;}async[a32_0x51f12c(0x294)](_0xea5b1b,_0x23a5cc){const _0x2ca8a2=a32_0x51f12c;console['error']('\x0a'+a32_0x265203[_0x2ca8a2(0x27a)](_0x2ca8a2(0x172))+'\x20'+_0xea5b1b[_0x2ca8a2(0x282)]),console[_0x2ca8a2(0x25f)]('═'[_0x2ca8a2(0x12e)](0x3c));if(_0x23a5cc[_0x2ca8a2(0x257)]&&_0xea5b1b[_0x2ca8a2(0x269)]){const _0x27fb72=a32_0x265203[_0x2ca8a2(0x1c2)](_0x2ca8a2(0xf0))+'\x20'+a32_0x265203[_0x2ca8a2(0x27a)](_0xea5b1b[_0x2ca8a2(0x257)][_0x2ca8a2(0x197)]+'.'+_0xea5b1b[_0x2ca8a2(0x257)][_0x2ca8a2(0x203)]);await this[_0x2ca8a2(0x189)](_0x27fb72,_0xea5b1b[_0x2ca8a2(0x269)]);}else{if(_0x23a5cc['attribute']&&_0xea5b1b[_0x2ca8a2(0x269)]){const _0x2a8ce8=a32_0x265203[_0x2ca8a2(0x1c2)](_0x2ca8a2(0x151))+'\x20'+a32_0x265203[_0x2ca8a2(0x27a)](_0x23a5cc['attribute']);await this[_0x2ca8a2(0x189)](_0x2a8ce8,_0xea5b1b[_0x2ca8a2(0x269)]);}else{if(_0x23a5cc[_0x2ca8a2(0x94)]&&_0xea5b1b[_0x2ca8a2(0x269)]){const _0x2ad307=a32_0x265203[_0x2ca8a2(0x1c2)](_0x2ca8a2(0xa4))+'\x20'+a32_0x265203['bold'](_0x23a5cc[_0x2ca8a2(0x94)]);await this['displaySampleData'](_0x2ad307,_0xea5b1b[_0x2ca8a2(0x269)]);}else{if(_0x23a5cc[_0x2ca8a2(0x22c)]&&_0xea5b1b[_0x2ca8a2(0x269)]){const _0x3fcc29=a32_0x265203['dim'](_0x2ca8a2(0x1e4))+'\x20'+a32_0x265203['bold']('Master\x20+\x20Attributes');await this[_0x2ca8a2(0x189)](_0x3fcc29,_0xea5b1b[_0x2ca8a2(0x269)]);}else!_0xea5b1b[_0x2ca8a2(0x269)]&&console[_0x2ca8a2(0x25f)]('\x0aNo\x20sample\x20data\x20available');}}}if(_0xea5b1b[_0x2ca8a2(0x232)][_0x2ca8a2(0x1ad)]>0x0){console[_0x2ca8a2(0x25f)]('─'['repeat'](0x3c)),console[_0x2ca8a2(0x25f)]('\x0a'+a32_0x265203[_0x2ca8a2(0x153)](_0x2ca8a2(0x161)));for(const _0xd9989 of _0xea5b1b[_0x2ca8a2(0x232)]){console[_0x2ca8a2(0x25f)]('\x20\x20'+a32_0x265203['red']('•')+'\x20'+_0xd9989);}}}async[a32_0x51f12c(0x189)](_0x202c6c,_0x2024b8){const _0x2153ad=a32_0x51f12c;if(_0x2024b8[_0x2153ad(0x1ad)]===0x0){console[_0x2153ad(0x25f)]('\x0a'+_0x202c6c),console[_0x2153ad(0x25f)](_0x2153ad(0x146));return;}console['error']('\x0a'+_0x202c6c);const _0x3ec699=Object['keys'](_0x2024b8[0x0])['map'](_0x149fbf=>({'name':_0x149fbf,'type':typeof _0x2024b8[0x0][_0x149fbf]==='number'?_0x2153ad(0x108):'varchar'})),_0x52d074={'queryId':_0x2153ad(0x177),'columns':_0x3ec699,'data':_0x2024b8,'stats':{'state':'FINISHED','queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x2024b8[_0x2153ad(0x1ad)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x56be66=formatAsTable(_0x52d074,_0x2024b8['length'],!![]);await writeOutput(_0x56be66,undefined,'table');}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a32_0x51f12c(0x282)]=a32_0x51f12c(0x23b);[a32_0x51f12c(0x12a)]=a32_0x51f12c(0xc2);async['execute'](_0x59b7f0){const _0x5d50ae=a32_0x51f12c,{options:_0x54fe5d,args:_0x494c6d,tdx:_0x568dc6}=_0x59b7f0,_0x28963a=_0x54fe5d,_0x1105a4=_0x494c6d[0x0]||_0x54fe5d['parentSegment'];if(!_0x1105a4)return showParentSegmentNotSetError(_0x5d50ae(0x9a)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment'),0x1;const _0xcd3402=resolveYamlFile(_0x1105a4);if(existsSync(_0xcd3402)){_0x28963a[_0x5d50ae(0x188)]&&console['error'](_0x5d50ae(0x166)+_0xcd3402);let _0xc647a6;try{_0xc647a6=readFileSync(_0xcd3402,_0x5d50ae(0x1f8));}catch(_0x266561){const _0x20c604=_0x266561 instanceof Error?_0x266561['message']:String(_0x266561);return console['error'](_0x5d50ae(0x1d1)+_0x20c604),0x1;}const _0x3e9861=await withSpinner(_0x5d50ae(0x270),()=>_0x568dc6[_0x5d50ae(0x1c1)][_0x5d50ae(0x285)](_0xc647a6),{'verbose':_0x28963a['verbose']}),_0x253818=_0x3e9861[_0x5d50ae(0xef)],{isNew:_0x414ed6,name:_0x536829,hasChanges:_0x5b8f71,diffFormatted:_0x1c36a3}=_0x253818;if(_0x5b8f71){_0x414ed6?console[_0x5d50ae(0x25f)](_0x5d50ae(0x10d)+_0x536829+'\x27:'):console[_0x5d50ae(0x25f)]('\x0aChanges\x20to\x20apply\x20to\x20\x27'+_0x536829+'\x27:');console[_0x5d50ae(0x25f)]('─'[_0x5d50ae(0x12e)](0x3c)),console[_0x5d50ae(0x25f)](_0x1c36a3),console[_0x5d50ae(0x25f)]('─'['repeat'](0x3c));const _0xde7371=_0x414ed6?'Create\x20parent\x20segment\x20\x27'+_0x536829+_0x5d50ae(0x211):_0x5d50ae(0x92)+_0x536829+_0x5d50ae(0x211);if(!_0x28963a[_0x5d50ae(0x21e)]){if(!isInteractive())return console['error'](a32_0x265203[_0x5d50ae(0x153)](_0x5d50ae(0x18e)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x5d50ae(0x25f)](a32_0x265203['dim'](_0x5d50ae(0x26c))),0x1;const _0x3443dd=await confirmKey(_0xde7371);if(!_0x3443dd)return console[_0x5d50ae(0x25f)](a32_0x265203[_0x5d50ae(0xb5)]('Aborted.')),0x1;}const _0xbeea8e=_0x414ed6?_0x5d50ae(0x19e):_0x5d50ae(0x1f6);await withSpinner(_0xbeea8e+_0x5d50ae(0x19b)+_0x536829+_0x5d50ae(0x138),()=>_0x253818[_0x5d50ae(0x10a)](),{'verbose':_0x28963a[_0x5d50ae(0x188)]});const _0x556a4f=_0x414ed6?_0x5d50ae(0x1bf):_0x5d50ae(0x1cf);console['error']('✔\x20'+_0x556a4f+_0x5d50ae(0x19b)+_0x536829+'\x27');}else console[_0x5d50ae(0x25f)](_0x5d50ae(0x178)+_0x536829+'\x27\x20is\x20up\x20to\x20date');}const _0x4e63bb=await withSpinner('Running\x20parent\x20segment\x20workflow\x20for\x20\x27'+_0x1105a4+_0x5d50ae(0x138),()=>_0x568dc6[_0x5d50ae(0x1c1)]['runParent'](_0x1105a4),{'verbose':_0x28963a[_0x5d50ae(0x188)]}),_0x24b90b=_0x4e63bb['data'],_0x49143f=getConsoleUrl(_0x28963a[_0x5d50ae(0xa0)],_0x5d50ae(0x233)+_0x24b90b[_0x5d50ae(0x1c7)]+_0x5d50ae(0x291)+_0x24b90b[_0x5d50ae(0x131)]+_0x5d50ae(0x217)+_0x24b90b['workflowAttemptId']);return console[_0x5d50ae(0x25f)](_0x5d50ae(0x1fb)),console[_0x5d50ae(0x25f)]('\x20\x20'+a32_0x265203['dim'](_0x5d50ae(0x181))+'\x20'+_0x24b90b[_0x5d50ae(0x231)]),console[_0x5d50ae(0x25f)]('\x20\x20'+a32_0x265203['dim'](_0x5d50ae(0x21c))+'\x20'+_0x24b90b[_0x5d50ae(0x252)]),console[_0x5d50ae(0x25f)]('\x20\x20'+a32_0x265203['dim'](_0x5d50ae(0x1f1))+'\x20'+_0x24b90b[_0x5d50ae(0x131)]),console[_0x5d50ae(0x25f)]('\x20\x20'+a32_0x265203[_0x5d50ae(0x1c2)](_0x5d50ae(0x95))+'\x20'+_0x24b90b[_0x5d50ae(0x1d8)]),console[_0x5d50ae(0x25f)]('\x20\x20'+_0x49143f),console[_0x5d50ae(0x25f)]('\x0a'+a32_0x265203[_0x5d50ae(0x1c2)]('To\x20cancel:')+'\x20tdx\x20wf\x20attempt\x20'+_0x24b90b[_0x5d50ae(0x1d8)]+_0x5d50ae(0x17c)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a32_0x51f12c(0x282)]=a32_0x51f12c(0x1ac);['description']=a32_0x51f12c(0x10f);async[a32_0x51f12c(0x1fc)](_0x5e6202){const _0x3a5523=a32_0x51f12c,{options:_0x9cc5c0,args:_0x23fb33,tdx:_0x2ecef6}=_0x5e6202,_0x24e1b1=_0x23fb33[0x0]||_0x9cc5c0['parentSegment'];if(!_0x24e1b1)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a'+'\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;_0x9cc5c0[_0x3a5523(0x188)]&&(console[_0x3a5523(0x25f)]('Site:\x20'+_0x9cc5c0['site']),console['error']('Parent\x20segment:\x20'+_0x24e1b1));const _0x1fdbbb=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x24e1b1+_0x3a5523(0x138),()=>_0x2ecef6['segment']['listFields'](_0x24e1b1),{'verbose':_0x9cc5c0[_0x3a5523(0x188)]}),_0x2c5771=_0x1fdbbb[_0x3a5523(0xef)];console[_0x3a5523(0x25f)]('✔\x20Found\x20'+_0x2c5771[_0x3a5523(0x1ad)]+_0x3a5523(0x218)+(_0x2c5771[_0x3a5523(0x1ad)]!==0x1?'s':''));if(_0x9cc5c0[_0x3a5523(0x1c6)]||_0x9cc5c0[_0x3a5523(0x114)])return await handleSDKOutput(_0x2c5771,_0x9cc5c0),0x0;return displayFieldsHumanReadable(_0x2c5771,_0x24e1b1),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a32_0x51f12c(0x282)]=a32_0x51f12c(0x212);[a32_0x51f12c(0x12a)]=a32_0x51f12c(0xcb);async[a32_0x51f12c(0x1fc)](_0xccec80){const _0x321e0a=a32_0x51f12c,{options:_0xeedeee,args:_0x36d658,tdx:_0x17c07b}=_0xccec80,_0x5c6423=_0xeedeee,_0x4a8e4b=_0x36d658[0x0]||_0xeedeee[_0x321e0a(0x196)];if(!_0x4a8e4b)return showParentSegmentNotSetError(_0x321e0a(0x20e)+_0x321e0a(0x22e)+_0x321e0a(0x122)+_0x321e0a(0x278)),0x1;_0xeedeee[_0x321e0a(0x188)]&&(console[_0x321e0a(0x25f)](_0x321e0a(0x267)+_0xeedeee[_0x321e0a(0xa0)]),console[_0x321e0a(0x25f)](_0x321e0a(0x234)+_0x4a8e4b));const _0x587e9a=await withSpinner('Fetching\x20parent\x20segment\x20\x27'+_0x4a8e4b+_0x321e0a(0x138),()=>_0x17c07b['segment'][_0x321e0a(0x195)](_0x4a8e4b),{'verbose':_0xeedeee[_0x321e0a(0x188)]}),_0x37f44c=_0x587e9a[_0x321e0a(0xef)];if(_0x5c6423[_0x321e0a(0x137)]){const _0x267d9b=getConsoleNextUrl(_0x5c6423[_0x321e0a(0xa0)],'/app/dw/parentSegments/'+_0x37f44c['id']);return console[_0x321e0a(0x25f)](a32_0x265203[_0x321e0a(0xff)]('✔')+_0x321e0a(0x124)+a32_0x265203[_0x321e0a(0xcd)](_0x267d9b)),openBrowser(_0x267d9b),0x0;}return await handleSingleObjectOutput(_0x37f44c,_0xeedeee),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a32_0x51f12c(0x282)]=a32_0x51f12c(0x139);[a32_0x51f12c(0x12a)]=a32_0x51f12c(0x13a);async[a32_0x51f12c(0x1fc)](_0x18eb0c){const _0x1ff74a=a32_0x51f12c,{options:_0x4e5fd3,args:_0x58c734,tdx:_0x5ca95d}=_0x18eb0c,_0x4adf28=_0x4e5fd3,_0x2adadf=_0x58c734[0x0]||_0x4e5fd3[_0x1ff74a(0x196)];if(!_0x2adadf)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'+_0x1ff74a(0x1da)+'Options:\x0a'+_0x1ff74a(0x17e)),0x1;_0x4e5fd3[_0x1ff74a(0x188)]&&(console[_0x1ff74a(0x25f)](_0x1ff74a(0x267)+_0x4e5fd3[_0x1ff74a(0xa0)]),console[_0x1ff74a(0x25f)](_0x1ff74a(0x234)+_0x2adadf));const _0x5da166=await withSpinner(_0x1ff74a(0x168)+_0x2adadf+_0x1ff74a(0x138),()=>_0x5ca95d[_0x1ff74a(0x1c1)][_0x1ff74a(0x242)](_0x2adadf),{'verbose':_0x4e5fd3[_0x1ff74a(0x188)]}),_0x9a90b8=_0x5da166[_0x1ff74a(0xef)],_0x4f4b06=_0x5ca95d[_0x1ff74a(0x1c1)][_0x1ff74a(0x1c0)](_0x9a90b8);if(_0x4adf28[_0x1ff74a(0x96)]){const _0x11f99c=await this[_0x1ff74a(0x287)](_0x18eb0c,_0x2adadf,_0x9a90b8,_0x4f4b06),_0x109365=this[_0x1ff74a(0x281)](_0x11f99c);writeFileSync(_0x4adf28[_0x1ff74a(0x96)],_0x109365);const _0x3d3e9a=_0x11f99c[_0x1ff74a(0x204)][_0x1ff74a(0x17f)][_0x1ff74a(0x1ad)]+_0x11f99c[_0x1ff74a(0x144)][_0x1ff74a(0x20a)]((_0xb5fadd,_0x42a2e0)=>_0xb5fadd+_0x42a2e0[_0x1ff74a(0x17f)][_0x1ff74a(0x1ad)],0x0),_0x393f=_0x11f99c[_0x1ff74a(0x144)][_0x1ff74a(0x21d)](_0x12d309=>_0x12d309['columns'][_0x1ff74a(0x1ad)]===0x0)[_0x1ff74a(0x1ad)];return console[_0x1ff74a(0x16d)](_0x1ff74a(0x15a)+_0x4adf28[_0x1ff74a(0x96)]),console['log'](_0x1ff74a(0xa6)+_0x4f4b06),console['log'](_0x1ff74a(0xba)+_0x11f99c['behaviors']['length']+_0x1ff74a(0x10b)),console[_0x1ff74a(0x16d)](_0x1ff74a(0xf1)+_0x3d3e9a+'\x20total'),_0x393f>0x0&&console[_0x1ff74a(0x16d)]('\x20\x20Note:\x20'+_0x393f+_0x1ff74a(0x229)),0x0;}console[_0x1ff74a(0x25f)]('\x0a'+a32_0x265203[_0x1ff74a(0x27a)](_0x1ff74a(0xfc))+'\x20'+a32_0x265203[_0x1ff74a(0xcd)](_0x4f4b06));const _0x31c1e7=await withSpinner('Fetching\x20customers\x20schema...',()=>_0x5ca95d[_0x1ff74a(0x1c1)][_0x1ff74a(0x1e9)](_0x9a90b8),{'verbose':_0x4e5fd3[_0x1ff74a(0x188)]});console[_0x1ff74a(0x25f)]('\x0a'+a32_0x265203[_0x1ff74a(0x27a)]('customers')+'\x20'+a32_0x265203[_0x1ff74a(0x1c2)]('('+_0x4f4b06+_0x1ff74a(0x118)));const _0x2aa6b1=await executeSchemaQuery(_0x31c1e7[_0x1ff74a(0xef)],_0x5ca95d,_0x4e5fd3);await handleQueryOutput(_0x2aa6b1,_0x4e5fd3);const _0x4ffb02=await withSpinner(_0x1ff74a(0x250),()=>_0x5ca95d[_0x1ff74a(0x1c1)][_0x1ff74a(0xc7)](_0x9a90b8),{'verbose':_0x4e5fd3[_0x1ff74a(0x188)]});for(const _0x580f89 of _0x4ffb02[_0x1ff74a(0xef)]){const _0x4a7bce='behavior_'+_0x580f89[_0x1ff74a(0x27d)]()[_0x1ff74a(0xf6)](/\s+/g,'_'),_0x5c9941=_0x1ff74a(0x228)+_0x4f4b06+'.'+_0x4a7bce;console['error']('\x0a'+a32_0x265203['bold'](_0x580f89)+'\x20'+a32_0x265203[_0x1ff74a(0x1c2)]('('+_0x4f4b06+'.'+_0x4a7bce+')'));try{const _0x2d6257=await executeSchemaQuery(_0x5c9941,_0x5ca95d,_0x4e5fd3);await handleQueryOutput(_0x2d6257,_0x4e5fd3);}catch{console['error'](a32_0x265203[_0x1ff74a(0xb5)](_0x1ff74a(0x20c)));}}return 0x0;}async[a32_0x51f12c(0x287)](_0x19e6da,_0x1fdfdd,_0x2ff90e,_0x28ce83){const _0x20befb=a32_0x51f12c,{options:_0x1b6d65,tdx:_0x20dc90}=_0x19e6da,_0x42cb5e=await withSpinner(_0x20befb(0x1e8),()=>_0x20dc90[_0x20befb(0x1c1)]['getParentSQL'](_0x2ff90e),{'verbose':_0x1b6d65[_0x20befb(0x188)]}),_0x4c769b=await executeSchemaQuery(_0x42cb5e[_0x20befb(0xef)],_0x20dc90,_0x1b6d65),_0x5b47a2=_0x4c769b[_0x20befb(0xef)][_0x20befb(0xe1)](_0x7a730a=>({'name':_0x7a730a[_0x20befb(0x26d)],'type':_0x7a730a[_0x20befb(0x1ed)]})),_0x1362a0=await withSpinner(_0x20befb(0x250),()=>_0x20dc90[_0x20befb(0x1c1)][_0x20befb(0xc7)](_0x2ff90e),{'verbose':_0x1b6d65[_0x20befb(0x188)]}),_0x3d9ddb=[];for(const _0x1d258c of _0x1362a0[_0x20befb(0xef)]){const _0x5901f1=_0x20befb(0xca)+_0x1d258c[_0x20befb(0x27d)]()[_0x20befb(0xf6)](/\s+/g,'_'),_0x494731=_0x20befb(0x228)+_0x28ce83+'.'+_0x5901f1;let _0x81b53c=[];try{const _0x477bf9=await executeSchemaQuery(_0x494731,_0x20dc90,_0x1b6d65);_0x81b53c=_0x477bf9[_0x20befb(0xef)][_0x20befb(0xe1)](_0x1f4fba=>({'name':_0x1f4fba[_0x20befb(0x26d)],'type':_0x1f4fba[_0x20befb(0x1ed)]}));}catch{}_0x3d9ddb['push']({'table':_0x5901f1,'columns':_0x81b53c});}return{'database':_0x28ce83,'parent_segment':_0x1fdfdd,'parent_id':_0x2ff90e,'customers':{'table':_0x20befb(0x204),'columns':_0x5b47a2},'behaviors':_0x3d9ddb};}[a32_0x51f12c(0x281)](_0x3256ed){const _0x52d2e5=a32_0x51f12c,_0xa5ef0c=_0x20aee1=>{const _0x2b14d2=a32_0x1aab;if(_0x20aee1[_0x2b14d2(0x1ad)]===0x0)return'[]';const _0x1c7c01=_0x20aee1['map'](_0x13c0ee=>_0x2b14d2(0x22d)+_0x13c0ee['name']+'\x22,\x20\x22type\x22:\x20\x22'+_0x13c0ee[_0x2b14d2(0x90)]+_0x2b14d2(0x134));return'[\x0a'+_0x1c7c01[_0x2b14d2(0x97)](',\x0a')+'\x0a\x20\x20\x20\x20]';},_0x3e742d=_0x3256ed['behaviors']['map'](_0x5d8564=>{const _0x543821=a32_0x1aab;return _0x543821(0xaa)+_0x5d8564[_0x543821(0x203)]+_0x543821(0x17d)+_0xa5ef0c(_0x5d8564['columns'])['replace'](/^/gm,'\x20\x20')[_0x543821(0x14e)]()+_0x543821(0x133);})[_0x52d2e5(0x97)](',\x0a');return _0x52d2e5(0x107)+_0x3256ed[_0x52d2e5(0x197)]+'\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22'+_0x3256ed[_0x52d2e5(0x207)]+_0x52d2e5(0x8a)+_0x3256ed[_0x52d2e5(0x272)]+_0x52d2e5(0x16b)+_0x3256ed['customers'][_0x52d2e5(0x203)]+_0x52d2e5(0x1a0)+_0xa5ef0c(_0x3256ed[_0x52d2e5(0x204)][_0x52d2e5(0x17f)])[_0x52d2e5(0xf6)](/^/gm,'\x20\x20')[_0x52d2e5(0x14e)]()+_0x52d2e5(0xc5)+_0x3e742d+'\x0a\x20\x20]\x0a}\x0a';}}export class ParentSegmentSQLCommand extends BaseCommand{[a32_0x51f12c(0x282)]=a32_0x51f12c(0x216);[a32_0x51f12c(0x12a)]=a32_0x51f12c(0x129);async['execute'](_0x561e88){const _0x274d2e=a32_0x51f12c,{options:_0x553177,args:_0x28461d,tdx:_0x56d698}=_0x561e88,_0x5217a6=_0x28461d[0x0]||_0x553177[_0x274d2e(0x196)];if(!_0x5217a6)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'+_0x274d2e(0x24a)),0x1;_0x553177[_0x274d2e(0x188)]&&(console['error'](_0x274d2e(0x267)+_0x553177[_0x274d2e(0xa0)]),console['error'](_0x274d2e(0x234)+_0x5217a6));const _0xf9e4bd=await withSpinner(_0x274d2e(0x168)+_0x5217a6+'\x27...',()=>_0x56d698['segment']['resolveParentId'](_0x5217a6),{'verbose':_0x553177[_0x274d2e(0x188)]}),_0xc3f436=_0xf9e4bd[_0x274d2e(0xef)],_0xe61fa=await withSpinner(_0x274d2e(0x246)+_0x5217a6+'\x27...',()=>_0x56d698['segment']['getParentSQL'](_0xc3f436),{'verbose':_0x553177[_0x274d2e(0x188)]}),_0x3e12d4=_0xe61fa[_0x274d2e(0xef)];return _0x553177[_0x274d2e(0x1bc)]===_0x274d2e(0x1c6)||_0x553177[_0x274d2e(0x1bc)]==='jsonl'?await handleSDKOutput([{'sql':_0x3e12d4}],_0x553177):console['log'](_0x3e12d4),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{['name']=a32_0x51f12c(0xae);[a32_0x51f12c(0x12a)]=a32_0x51f12c(0x16f);async['execute'](_0x3ec6ad){const _0x18bc2e=a32_0x51f12c,{options:_0x332ead,args:_0x37a482,tdx:_0x49d3a2}=_0x3ec6ad,_0x42de4b=_0x37a482[0x0]||_0x332ead[_0x18bc2e(0x196)];if(!_0x42de4b)return showParentSegmentNotSetError(_0x18bc2e(0x1af)+_0x18bc2e(0x1d5)),0x1;_0x332ead['verbose']&&(console['error']('Site:\x20'+_0x332ead[_0x18bc2e(0xa0)]),console[_0x18bc2e(0x25f)](_0x18bc2e(0x234)+_0x42de4b));const _0x1a0be7=await withSpinner(_0x18bc2e(0x168)+_0x42de4b+_0x18bc2e(0x138),()=>_0x49d3a2[_0x18bc2e(0x1c1)][_0x18bc2e(0x242)](_0x42de4b),{'verbose':_0x332ead[_0x18bc2e(0x188)]}),_0x531a6e=_0x1a0be7[_0x18bc2e(0xef)],_0x5e1e3f=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x42de4b+'\x27...',()=>_0x49d3a2[_0x18bc2e(0x1c1)]['getParentSQL'](_0x531a6e),{'verbose':_0x332ead[_0x18bc2e(0x188)]});let _0x6d092e=_0x5e1e3f[_0x18bc2e(0xef)];const _0x4655ce=resolveLimit(_0x332ead[_0x18bc2e(0x248)],DEFAULT_DISPLAY_LIMIT),_0x36e2e1=/\bLIMIT\s+\d+/i[_0x18bc2e(0x1f5)](_0x6d092e);!_0x36e2e1&&(_0x6d092e=_0x6d092e[_0x18bc2e(0x14e)]()[_0x18bc2e(0xf6)](/;+$/,''),_0x6d092e='SELECT\x20*\x20FROM\x20(\x0a'+_0x6d092e+_0x18bc2e(0x1eb)+_0x4655ce);_0x332ead[_0x18bc2e(0x188)]&&console[_0x18bc2e(0x25f)]('SQL\x20query:\x0a'+_0x6d092e);const _0x52cd6c=await withProgressSpinner(_0x18bc2e(0x209),async _0x402f25=>{const _0x4c1b2d=_0x18bc2e,_0x35cacd=await _0x49d3a2[_0x4c1b2d(0x26e)]['execute'](_0x6d092e,{'catalog':'td','schema':_0x4c1b2d(0x116),'onJobId':_0x70e7f=>{const _0x1a3716=_0x4c1b2d;_0x402f25[_0x1a3716(0xc3)](_0x70e7f);}});return _0x35cacd;},{'verbose':_0x332ead['verbose']}),_0x46f318=_0x52cd6c['data'],_0x5e98e7=_0x46f318['jobId']?_0x18bc2e(0x12c)+_0x46f318['jobId']+']':'';return console[_0x18bc2e(0x25f)](_0x18bc2e(0x264)+_0x46f318[_0x18bc2e(0xe9)][_0x18bc2e(0x28d)][_0x18bc2e(0x19d)]()+'\x20rows\x20'+(_0x18bc2e(0x286)+formatElapsed(_0x46f318['stats']['elapsedTimeMillis'])+_0x5e98e7)),await handleQueryOutput(_0x46f318,_0x332ead),0x0;}}export class PSRtListCommand extends BaseCommand{['name']=a32_0x51f12c(0x1b1);[a32_0x51f12c(0x12a)]='List\x20parent\x20segments\x20with\x20RT\x202.0\x20status';async[a32_0x51f12c(0x1fc)](_0x511fea){const _0x4ea294=a32_0x51f12c,{options:_0x4295e4,args:_0x417558,tdx:_0x146eb7}=_0x511fea,_0x9aa44f=_0x417558[0x0],_0x25076a=await withSpinner(_0x9aa44f?'Listing\x20RT-enabled\x20parent\x20segments\x20matching\x20\x27'+_0x9aa44f+_0x4ea294(0x138):_0x4ea294(0x1bb),()=>_0x146eb7['realtime'][_0x4ea294(0x227)](),{'verbose':_0x4295e4['verbose']});let _0x2fd71b=_0x25076a[_0x4ea294(0xef)]['filter'](_0x3c3f6b=>_0x3c3f6b[_0x4ea294(0x23a)]);if(_0x9aa44f){const _0x5c06c1=_0x9aa44f[_0x4ea294(0xf6)](/[.+^${}()|[\]\\]/g,'\x5c$&')[_0x4ea294(0xf6)](/\*/g,'.*')[_0x4ea294(0xf6)](/\?/g,'.'),_0x44d583=new RegExp('^'+_0x5c06c1+'$','i');_0x2fd71b=_0x2fd71b[_0x4ea294(0x21d)](_0x2761b5=>_0x44d583[_0x4ea294(0x1f5)](_0x2761b5[_0x4ea294(0x282)]));}_0x2fd71b['sort']((_0x219a6a,_0x5f5a54)=>_0x219a6a[_0x4ea294(0x282)][_0x4ea294(0x1ff)](_0x5f5a54['name'])),console[_0x4ea294(0x25f)](_0x4ea294(0x245)+_0x2fd71b[_0x4ea294(0x1ad)]+_0x4ea294(0x194)+(_0x2fd71b[_0x4ea294(0x1ad)]!==0x1?'s':''));const _0x2946f6=_0x43153a=>{const _0x24171d=_0x4ea294;return getConsoleNextUrl(_0x4295e4[_0x24171d(0xa0)],_0x24171d(0x140)+_0x43153a);};if(_0x4295e4['format']===_0x4ea294(0x1c6)||_0x4295e4[_0x4ea294(0x1bc)]==='jsonl'){const _0xf46f1f=_0x2fd71b[_0x4ea294(0xe1)](_0x14eee9=>({..._0x14eee9,'url':_0x2946f6(_0x14eee9['id'])}));await handleSDKOutput(_0xf46f1f,_0x4295e4);}else{if(_0x2fd71b[_0x4ea294(0x1ad)]===0x0)console[_0x4ea294(0x16d)]('No\x20RT-enabled\x20parent\x20segments\x20found');else for(const _0x3c1c37 of _0x2fd71b){const _0x2656c9=_0x3c1c37[_0x4ea294(0xee)]?a32_0x265203[_0x4ea294(0x1c2)]('\x20('+formatRows(_0x3c1c37['population'])+')'):'',_0x533db6=hyperlink(_0x3c1c37[_0x4ea294(0x282)],_0x2946f6(_0x3c1c37['id']));console[_0x4ea294(0x16d)]('⚡\x20'+_0x533db6+_0x2656c9);}}return 0x0;}}export class PSRtValidateCommand extends BaseParentSegmentCommand{[a32_0x51f12c(0x282)]='ps:rt:validate';[a32_0x51f12c(0x12a)]=a32_0x51f12c(0x1ae);async[a32_0x51f12c(0x1fc)](_0x3fb16a){const _0x27de8f=a32_0x51f12c,{options:_0xd9a7ca,args:_0x27bc83,tdx:_0x1d14bd}=_0x3fb16a,_0x3badab=_0x27bc83[0x0]||_0xd9a7ca['parentSegment'];if(!_0x3badab)return showParentSegmentNotSetError(_0x27de8f(0xb1)+_0x27de8f(0x1a8)),0x1;const _0x41b119=resolveYamlFile(_0x3badab);if(!existsSync(_0x41b119))return showFileNotFoundError(_0x41b119,_0x3badab),0x1;let _0x3a55cc;try{_0x3a55cc=readFileSync(_0x41b119,_0x27de8f(0x1f8));}catch(_0x98a121){const _0x280657=_0x98a121 instanceof Error?_0x98a121['message']:String(_0x98a121);return console[_0x27de8f(0x25f)]('Error\x20reading\x20file:\x20'+_0x280657),0x1;}const _0x3e6978=createCommandSpinner(a32_0x265203['dim'](_0x27de8f(0x175)),{'verbose':_0xd9a7ca[_0x27de8f(0x188)]});_0x3e6978[_0x27de8f(0x17a)]();const _0x5d8222={'realtime':!![],'onProgress':_0x5a3839=>{const _0x4a5fb2=_0x27de8f;_0x3e6978[_0x4a5fb2(0x190)]=formatProgressMessage(_0x5a3839);}};let _0x51ead6;try{_0x51ead6=await _0x1d14bd[_0x27de8f(0x1c1)]['validateParentYaml'](_0x3a55cc,_0x5d8222),_0x3e6978['stop']();}catch(_0x5d86ca){_0x3e6978[_0x27de8f(0x1ea)]();throw _0x5d86ca;}console['error']('\x0a'+a32_0x265203['bold']('RT\x202.0\x20Validate:')+'\x20'+_0x51ead6[_0x27de8f(0x282)]),console[_0x27de8f(0x25f)]('═'[_0x27de8f(0x12e)](0x3c)),displayRealtimeValidation(_0x51ead6),console['error']('─'['repeat'](0x3c));if(_0x51ead6['errors']['length']>0x0){console['error']('\x0a'+a32_0x265203[_0x27de8f(0x153)](_0x27de8f(0x161)));for(const _0x1d5b2b of _0x51ead6['errors']){console[_0x27de8f(0x25f)]('\x20\x20'+a32_0x265203['red']('•')+'\x20'+_0x1d5b2b);}}return _0x51ead6[_0x27de8f(0x220)]&&console['error']('\x0a'+a32_0x265203[_0x27de8f(0xff)]('✔')+_0x27de8f(0xf3)),_0x51ead6[_0x27de8f(0x220)]?0x0:0x1;}}export class PSRtJnListCommand extends BaseCommand{[a32_0x51f12c(0x282)]=a32_0x51f12c(0x16a);[a32_0x51f12c(0x12a)]=a32_0x51f12c(0x150);async[a32_0x51f12c(0x1fc)](_0x3f89d1){const _0x1e8570=a32_0x51f12c,{options:_0x49ff2e,args:_0xd3cb57,tdx:_0x331865}=_0x3f89d1,_0xa525e6=_0xd3cb57[0x0]||_0x49ff2e[_0x1e8570(0x196)];if(!_0xa525e6)return showParentSegmentNotSetError(_0x1e8570(0x187)+_0x1e8570(0x101)),0x1;_0x49ff2e[_0x1e8570(0x188)]&&(console[_0x1e8570(0x25f)](_0x1e8570(0x267)+_0x49ff2e[_0x1e8570(0xa0)]),console['error'](_0x1e8570(0x234)+_0xa525e6));const _0x84a0a1=await withSpinner(_0x1e8570(0x168)+_0xa525e6+_0x1e8570(0x138),()=>_0x331865[_0x1e8570(0x1c1)][_0x1e8570(0x242)](_0xa525e6),{'verbose':_0x49ff2e['verbose']}),_0x175748=_0x84a0a1[_0x1e8570(0xef)],_0x48a754=await withSpinner(_0x1e8570(0x288)+_0xa525e6+_0x1e8570(0x138),()=>_0x331865[_0x1e8570(0x23e)][_0x1e8570(0x221)](_0x175748),{'verbose':_0x49ff2e[_0x1e8570(0x188)]}),_0x2f089f=_0x48a754['data'];console[_0x1e8570(0x25f)]('✔\x20Found\x20'+_0x2f089f[_0x1e8570(0x1ad)]+_0x1e8570(0x1fa)+(_0x2f089f[_0x1e8570(0x1ad)]!==0x1?'s':''));if(_0x49ff2e[_0x1e8570(0x1bc)]===_0x1e8570(0x1c6)||_0x49ff2e[_0x1e8570(0x1bc)]===_0x1e8570(0x114))await handleSDKOutput(_0x2f089f,_0x49ff2e);else{if(_0x2f089f['length']===0x0)console[_0x1e8570(0x16d)](_0x1e8570(0x266));else for(const _0x5f2783 of _0x2f089f){const _0x22b0b9=_0x5f2783[_0x1e8570(0xed)]===_0x1e8570(0x236)?'🚀':'📝',_0x1174e6=_0x5f2783['paused']?a32_0x265203[_0x1e8570(0xb5)]('\x20(paused)'):'',_0x48271a=a32_0x265203[_0x1e8570(0x1c2)]('\x20('+_0x5f2783[_0x1e8570(0x205)]+_0x1e8570(0x193)+(_0x5f2783['stageCount']!==0x1?'s':'')+')');console[_0x1e8570(0x16d)](_0x22b0b9+'\x20'+_0x5f2783['name']+_0x1174e6+_0x48271a);}}return 0x0;}}export class PSRtJnPauseCommand extends BaseCommand{[a32_0x51f12c(0x282)]='ps:rt:jn:pause';['description']='Pause\x20activations\x20in\x20an\x20RT\x20journey';async['execute'](_0x430802){const _0x946d9a=a32_0x51f12c,{options:_0x43d8b2,args:_0x1b6957,tdx:_0x4dfa0f}=_0x430802,_0x185aa3=_0x1b6957[0x0];if(!_0x185aa3)return console[_0x946d9a(0x25f)](a32_0x265203[_0x946d9a(0x153)](_0x946d9a(0x293))),console[_0x946d9a(0x25f)]('Usage:\x20tdx\x20ps\x20rt\x20jn\x20pause_activations\x20<journeyId>\x0a'),console[_0x946d9a(0x25f)](a32_0x265203[_0x946d9a(0x1c2)](_0x946d9a(0x224))),0x1;_0x43d8b2[_0x946d9a(0x188)]&&(console['error'](_0x946d9a(0x267)+_0x43d8b2[_0x946d9a(0xa0)]),console[_0x946d9a(0x25f)](_0x946d9a(0x182)+_0x185aa3));const _0x46f157=await withSpinner('Pausing\x20activations\x20for\x20RT\x20journey\x20\x27'+_0x185aa3+_0x946d9a(0x138),()=>_0x4dfa0f['realtime'][_0x946d9a(0x1aa)](_0x185aa3),{'verbose':_0x43d8b2[_0x946d9a(0x188)]}),_0x21fa87=_0x46f157[_0x946d9a(0xef)];console[_0x946d9a(0x25f)]('✔\x20Paused\x20activations\x20for\x20RT\x20journey\x20\x27'+_0x21fa87[_0x946d9a(0x282)]+'\x27');if(_0x43d8b2[_0x946d9a(0x1bc)]===_0x946d9a(0x1c6)||_0x43d8b2[_0x946d9a(0x1bc)]===_0x946d9a(0x114))await handleSDKOutput([_0x21fa87],_0x43d8b2);else{const _0x5270a0=_0x21fa87[_0x946d9a(0xed)]==='launched'?'🚀':'📝',_0x5b4135=_0x21fa87[_0x946d9a(0x1d9)]?a32_0x265203['yellow']('\x20(paused)'):'';console[_0x946d9a(0x16d)](_0x5270a0+'\x20'+_0x21fa87[_0x946d9a(0x282)]+_0x5b4135);}return 0x0;}}export class PSRtJnResumeCommand extends BaseCommand{[a32_0x51f12c(0x282)]=a32_0x51f12c(0x1b4);[a32_0x51f12c(0x12a)]=a32_0x51f12c(0x290);async[a32_0x51f12c(0x1fc)](_0x7f2ee1){const _0x55eedd=a32_0x51f12c,{options:_0x27accb,args:_0x373912,tdx:_0x281a88}=_0x7f2ee1,_0x10c125=_0x373912[0x0];if(!_0x10c125)return console[_0x55eedd(0x25f)](a32_0x265203[_0x55eedd(0x153)](_0x55eedd(0x293))),console[_0x55eedd(0x25f)]('Usage:\x20tdx\x20ps\x20rt\x20jn\x20resume_activations\x20<journeyId>\x0a'),console[_0x55eedd(0x25f)](a32_0x265203[_0x55eedd(0x1c2)]('Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs')),0x1;_0x27accb['verbose']&&(console[_0x55eedd(0x25f)]('Site:\x20'+_0x27accb[_0x55eedd(0xa0)]),console['error'](_0x55eedd(0x182)+_0x10c125));const _0x366fd0=await withSpinner(_0x55eedd(0x185)+_0x10c125+_0x55eedd(0x138),()=>_0x281a88[_0x55eedd(0x23e)][_0x55eedd(0xb2)](_0x10c125),{'verbose':_0x27accb[_0x55eedd(0x188)]}),_0x9be421=_0x366fd0['data'];console[_0x55eedd(0x25f)](_0x55eedd(0x275)+_0x9be421[_0x55eedd(0x282)]+'\x27');if(_0x27accb[_0x55eedd(0x1bc)]==='json'||_0x27accb['format']===_0x55eedd(0x114))await handleSDKOutput([_0x9be421],_0x27accb);else{const _0x4658ca=_0x9be421[_0x55eedd(0xed)]===_0x55eedd(0x236)?'🚀':'📝',_0x165dbb=_0x9be421[_0x55eedd(0x1d9)]?a32_0x265203['yellow']('\x20(paused)'):'';console['log'](_0x4658ca+'\x20'+_0x9be421[_0x55eedd(0x282)]+_0x165dbb);}return 0x0;}}export class PSRtConfigVersionCommand extends BaseCommand{[a32_0x51f12c(0x282)]=a32_0x51f12c(0x1ee);[a32_0x51f12c(0x12a)]=a32_0x51f12c(0x12d);async[a32_0x51f12c(0x1fc)](_0x879e87){const _0x4de90e=a32_0x51f12c,{options:_0x485c67,args:_0x306944,tdx:_0x314470}=_0x879e87,_0x57cbb7=_0x306944[0x0]||_0x485c67[_0x4de90e(0x196)];if(!_0x57cbb7)return showParentSegmentNotSetError(_0x4de90e(0x136)+'\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'),0x1;_0x485c67[_0x4de90e(0x188)]&&(console[_0x4de90e(0x25f)]('Site:\x20'+_0x485c67['site']),console[_0x4de90e(0x25f)](_0x4de90e(0x234)+_0x57cbb7));const _0x46d796=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x57cbb7+'\x27...',()=>_0x314470[_0x4de90e(0x1c1)][_0x4de90e(0x242)](_0x57cbb7),{'verbose':_0x485c67[_0x4de90e(0x188)]}),_0x4ec27f=_0x46d796['data'],_0xe827d6=await withSpinner(_0x4de90e(0x12f)+_0x57cbb7+_0x4de90e(0x138),()=>_0x314470[_0x4de90e(0x23e)]['getCurrentConfigVersion'](_0x4ec27f),{'verbose':_0x485c67['verbose']}),_0x1357eb=_0xe827d6[_0x4de90e(0xef)];return console[_0x4de90e(0x25f)](_0x4de90e(0x238)),_0x485c67[_0x4de90e(0x1bc)]===_0x4de90e(0x1c6)||_0x485c67[_0x4de90e(0x1bc)]==='jsonl'?await handleSDKOutput([_0x1357eb],_0x485c67):(console['log'](_0x4de90e(0x1b8)+_0x1357eb['id']),console['log'](_0x4de90e(0x27c)+_0x1357eb[_0x4de90e(0x231)]),console[_0x4de90e(0x16d)](_0x4de90e(0x11e)+_0x1357eb[_0x4de90e(0xb4)]),console[_0x4de90e(0x16d)]('eventKind:\x20'+_0x1357eb[_0x4de90e(0xf5)]),console[_0x4de90e(0x16d)]('status:\x20'+_0x1357eb[_0x4de90e(0x252)])),0x0;}}export class PSPzServiceListCommand extends BaseCommand{['name']=a32_0x51f12c(0x112);[a32_0x51f12c(0x12a)]=a32_0x51f12c(0x21a);async[a32_0x51f12c(0x1fc)](_0x44a1b3){const _0xf7cfdd=a32_0x51f12c,{options:_0x1fbc69,args:_0x1293fa,tdx:_0x4d4de4}=_0x44a1b3,_0x8df2e4=_0x1293fa[0x0]||_0x1fbc69[_0xf7cfdd(0x196)];if(!_0x8df2e4)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20PZ\x20services\x20(requires\x20context)\x0a'+_0xf7cfdd(0x13f)),0x1;const _0xd30369=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x8df2e4+_0xf7cfdd(0x138),()=>_0x4d4de4[_0xf7cfdd(0x1c1)]['resolveParentId'](_0x8df2e4),{'verbose':_0x1fbc69['verbose']}),_0x1392d8=_0xd30369[_0xf7cfdd(0xef)],_0x2d7f44=await withSpinner(_0xf7cfdd(0x1ba)+_0x8df2e4+_0xf7cfdd(0x138),()=>_0x4d4de4[_0xf7cfdd(0x8f)][_0xf7cfdd(0x227)](_0x1392d8),{'verbose':_0x1fbc69['verbose']}),_0x4c51d5=_0x2d7f44[_0xf7cfdd(0xef)];console[_0xf7cfdd(0x25f)](_0xf7cfdd(0x245)+_0x4c51d5[_0xf7cfdd(0x1ad)]+'\x20personalization\x20service'+(_0x4c51d5[_0xf7cfdd(0x1ad)]!==0x1?'s':''));if(_0x1fbc69[_0xf7cfdd(0x1bc)]===_0xf7cfdd(0x1c6)||_0x1fbc69[_0xf7cfdd(0x1bc)]===_0xf7cfdd(0x114))await handleSDKOutput(_0x4c51d5,_0x1fbc69);else{if(_0x4c51d5[_0xf7cfdd(0x1ad)]===0x0)console[_0xf7cfdd(0x16d)](_0xf7cfdd(0x171)),console[_0xf7cfdd(0x25f)](a32_0x265203['cyan'](_0xf7cfdd(0x117)));else for(const _0x183470 of _0x4c51d5){console['log'](a32_0x265203[_0xf7cfdd(0x27a)](_0x183470[_0xf7cfdd(0x282)])+'\x20'+a32_0x265203[_0xf7cfdd(0x1c2)](_0xf7cfdd(0x23f)+_0x183470['id']+')'));_0x183470[_0xf7cfdd(0x12a)]&&console[_0xf7cfdd(0x16d)]('\x20\x20'+a32_0x265203[_0xf7cfdd(0x1c2)](_0x183470['description']));if(_0x183470[_0xf7cfdd(0x111)]&&_0x183470[_0xf7cfdd(0x111)][_0xf7cfdd(0x1ad)]>0x0)for(const _0xe095f5 of _0x183470[_0xf7cfdd(0x111)]){const _0x529049=_0xe095f5[_0xf7cfdd(0xb9)]?.[_0xf7cfdd(0x1ad)]?_0xe095f5[_0xf7cfdd(0xb9)]['join'](',\x20'):_0xf7cfdd(0x1d6);console[_0xf7cfdd(0x16d)]('\x20\x20'+a32_0x265203[_0xf7cfdd(0xcd)]('token:')+'\x20'+_0xe095f5['name']+'\x20'+a32_0x265203['dim'](_0xf7cfdd(0x23f)+_0xe095f5['id']+')')),console[_0xf7cfdd(0x16d)](_0xf7cfdd(0x1cd)+a32_0x265203[_0xf7cfdd(0x1c2)](_0xf7cfdd(0x103))+'\x20'+_0x529049);}else console[_0xf7cfdd(0x16d)]('\x20\x20'+a32_0x265203['dim'](_0xf7cfdd(0x243)));}}return 0x0;}}function a32_0x44ac(){const _0x3f0baa=['Events:','Output\x20Database:','ps:pz:show','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','green','\x20=\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20rt\x20jn\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20RT\x20journeys\x20for\x20specific\x20parent\x20segment','Default','allowed\x20IPs:','Join:','\x20--interval\x20','Rows:','{\x0a\x20\x20\x22database\x22:\x20\x22','double','Create\x20parent\x20segment\x20\x27','apply','\x20behaviors','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','\x0aNew\x20parent\x20segment\x20\x27','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','List\x20available\x20fields\x20for\x20segmentation','displaySummary','tokens','ps:pz:service:list','platform','jsonl','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]','information_schema','\x0aTip:\x20Run\x20`tdx\x20ps\x20pz\x20service\x20init`\x20to\x20add\x20a\x20template\x20personalization\x20section\x20to\x20your\x20YAML','.customers)','\x20\x20\x20\x20\x20\x20\x20\x20','\x20true','createToken','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]','3797225foTRRW','identifier:\x20','\x20Context\x20set:\x20','foreignKey','events','Options:\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context','\x20Opening\x20','ID\x20Stitching:','Aborted.','sourceTableError','Creating\x20token\x20\x27','Get\x20SQL\x20query\x20for\x20parent\x20segment','description','3uiPACX','\x20[Job\x20ID:\x20','Get\x20current\x20RT\x20configuration\x20version\x20status','repeat','Getting\x20RT\x20configuration\x20version\x20for\x20\x27','displayColumns','workflowSessionId','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','\x0a\x20\x20\x20\x20}','\x22\x20}','Update\x20a\x20realtime\x20personalization\x20entity','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','web','\x27...','segment:parent:desc','Show\x20parent\x20segment\x20schema\x20(column\x20types)','Validating\x20configuration...','displayMasterInfo','personalization_services','Create\x20a\x20personalization\x20service\x20for\x20a\x20parent\x20segment','\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','/app/dw/parentSegments/','joinKey','session','✔\x20Updated\x20parent\x20segment\x20\x27','behaviors','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]','\x20\x20No\x20sample\x20data\x20available','✔\x20Updated\x20personalization\x20\x27','\x20Configuration\x20is\x20valid','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','Behaviors','audienceId:','patch','\x0a⚠️\x20\x20Both\x20','trim','ps:pz:patch','List\x20RT\x20journeys','Attribute:','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','red','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context','\x20\x20\x20\x20\x20\x20\x20Pass\x20null\x20to\x20place\x20in\x20the\x20root\x20folder.','relationships','darwin','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','Schema\x20saved\x20to\x20','sections:','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','✔\x20Deleted\x20personalization\x20\x27','✔\x20Created\x20parent\x20segment\x20\x27','\x20--behavior\x20\x22','addAttributesFile','Errors:','\x20service(s)\x20configured','Error:','✔\x20Deleted\x20token\x20\x27','6091828LoiADW','Found\x20YAML\x20file:\x20','Deleting\x20personalization\x20\x27','Resolving\x20parent\x20segment\x20\x27','Error:\x20Service\x20name\x20is\x20required','ps:rt:jn:list','\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22','Create\x20a\x20realtime\x20personalization\x20entity','log','addAttributes','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','attributes','No\x20personalization\x20services\x20configured','Preview:','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','timezone','Validating\x20RT\x20configuration...','Error:\x20Service\x20ID\x20is\x20required','preview','✔\x20No\x20changes\x20-\x20\x27','Pattern:\x20','start','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','\x20kill','\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20','\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path','columns','\x20personalization','Audience\x20ID:','RT\x20Journey\x20ID:\x20','message','ps:pz:list','Resuming\x20activations\x20for\x20RT\x20journey\x20\x27','run','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','verbose','displaySampleData','\x27\x20for\x20service\x20\x27','\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','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','displayBehaviorsStats','\x0aError:','string','text','Listing\x20personalizations\x20for\x20\x27','displayValidateResults','\x20stage','\x20RT-enabled\x20parent\x20segment','getParentFull','parentSegment','database','3609UBExwR','No\x20parent\x20segments\x20match\x20pattern:\x20','toFixed','\x20parent\x20segment\x20\x27','⚡\x20Not\x20enabled','toLocaleString','Creating','createPersonalization','\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','Error:\x20Token\x20\x27','all','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','get','\x0aChanges\x20to\x20apply\x20to\x20\x27','segment:parent:preview','\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','value','pauseJourney','entryCriteria:','segment:parent:fields','length','Validate\x20RT\x202.0\x20configuration\x20from\x20parent\x20segment\x20YAML','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','public:','ps:rt:list','Listing\x20parent\x20segments...','Database:\x20','ps:rt:jn:resume','token:','Updating\x20personalization\x20service\x20\x27','Error:\x20--name\x20is\x20required','id:\x20','Creating\x20parent\x20segment\x20\x27','Listing\x20personalization\x20services\x20for\x20\x27','Listing\x20RT-enabled\x20parent\x20segments...','format','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','\x0a⚠\x20Save\x20this\x20token\x20value\x20-\x20it\x20will\x20not\x20be\x20shown\x20again:','Created','getOutputDatabaseName','segment','dim','Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','Join\x20on:','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','json','workflowId','My\x20Service','addBehaviorsFile','segment:parent:push','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]\x0a','Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]','\x20\x20\x20\x20','getPersonalization','Updated','Error:\x20--database\x20and\x20--table\x20are\x20required','Error\x20reading\x20file:\x20','totalEvents','👥\x20','Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','any','matchedCount','workflowAttemptId','paused','\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','Error:\x20Parent\x20segment\x20name\x20is\x20required','ignore','rowCount','2310427QtesSR','Overwrite\x20\x27','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','ps:pz:init','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','\x20configured','Enriched:','open','split','Output\x20file:\x20','Fetching\x20customers\x20schema...','getParentSQL','stop','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','column_type','ps:rt:configuration_versions','enabled','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','Session:','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]','Source:','isDirectory','test','Updating','\x20\x201.\x20Edit\x20','utf-8','Personalization:','\x20RT\x20journey','\x0a✔\x20Workflow\x20started','execute','\x5c$&','customerPercent','localeCompare','Name:\x20','ps:pz:service:update','\x20\x20\x20\x20\x20\x20','table','customers','stageCount','listPersonalizations','parent_segment','interval','Executing\x20parent\x20segment\x20query...','reduce','\x20--attribute\x20\x22<name>\x22','\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)','Usage:\x20tdx\x20ps\x20pz\x20delete\x20<personalization_id>','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','Error:\x20\x22relationships.parentFolder\x22\x20is\x20required\x20in\x20the\x20JSON\x20file.','33ARBtnJ','\x27\x20and\x20run\x20workflow?','segment:parent:view','RT\x202.0:','✔\x20Deleted\x20personalization\x20service\x20\x27','listParents','segment:parent:sql','/attempt/','\x20field','✘\x20Failed\x20to\x20rename\x20directory:\x20','List\x20personalization\x20services\x20for\x20a\x20parent\x20segment','\x27\x20not\x20found\x20in\x20any\x20personalization\x20service','Status:','filter','yes','/\x20→\x20','allValid','listJourneys','\x20No\x20changes\x20-\x20','xdg-open','Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs','\x27\x20with\x20ID:\x20','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]','list','SELECT\x20*\x20FROM\x20','\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','enriched','\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','Columns:','95034TrYBWY','audienceId','errors','/app/workflows/','Parent\x20segment:\x20','attributesFile','launched','\x20service','✔\x20Retrieved\x20RT\x20configuration\x20version','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','realtime_enabled','segment:parent:run','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','deleteToken','realtime','(id:\x20','scheduleOption','\x0a⚠️\x20\x20Migrating:\x20','resolveParentId','no\x20tokens\x20configured','Delete\x20a\x20personalization\x20service','✔\x20Found\x20','Fetching\x20SQL\x20for\x20\x27','schemaValid','limit','Table:\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','label','List\x20realtime\x20personalizations\x20for\x20a\x20parent\x20segment','%)\x20','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','Options:','Fetching\x20behavior\x20list...','\x20--attribute\x20\x22','status','Error:\x20--folder-id\x20is\x20required.\x20Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID.','860dpHZPk','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','Error:\x20Personalization\x20ID\x20is\x20required','master','\x20+\x20[','Delete\x20a\x20token\x20from\x20a\x20personalization\x20service','endsWith','\x20\x20\x20\x20-\x20','✔\x20Created\x20personalization\x20service\x20\x27','realtime:','-1d','error','Coverage:','page_view','indexOf','valid','✔\x20Query\x20completed:\x20Processed\x20','Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID,\x20then\x20add:','No\x20RT\x20journeys\x20found','Site:\x20','Error:\x20File\x20not\x20found:\x20','sampleData','\x20--enriched','sections','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','column_name','query','payload','Analyzing\x20changes...','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>','parent_id','keyEventId','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','✔\x20Resumed\x20activations\x20for\x20RT\x20journey\x20\x27','\x0aUsage:\x20tdx\x20ps\x20preview\x20','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','Creating\x20personalization\x20service\x20\x27','bold','file','audienceId:\x20','toLowerCase','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','customersWithEvents','includeSensitive:','formatSchemaJson','name','Update\x20a\x20personalization\x20service\x20name\x20and/or\x20description','✔\x20Found\x20personalization\x20\x27','pushParentYaml','in\x20','collectSchema','Listing\x20RT\x20journeys\x20for\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context','tdx\x20ps\x20preview\x20','\x20rows)','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','processedRows','<database>.<table>','createParent','Resume\x20activations\x20in\x20an\x20RT\x20journey','/sessions/','scheduleType','Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a','displayPreviewResults','YAML\x20file:\x20','\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22','/\x20directory.\x0a','column','payload:','attribute','personalization','type','7800104gRmtJl','Apply\x20changes\x20to\x20\x27','ps:pz:service:token:create','behavior','Attempt:','output','join','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--file\x20<path>','Error\x20parsing\x20YAML:\x20','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','Error:\x20Token\x20ID\x20is\x20required','.yaml','previewParentYaml','schemaError','\x0aChanges\x20to\x20\x27','site','includeSensitive','\x20Added\x20personalization\x20template\x20to\x20','Getting\x20personalization\x20\x27','Behavior:','\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\x20Database:\x20','segment:parent:pull','ps:pz:service:delete','Attributes:','\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22','`\x20to\x20download\x20the\x20configuration\x20first','Next\x20steps:','single','segment:parent:show','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','coveragePercent','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','resumeJourney','No\x20personalizations\x20configured','identifier','yellow','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','Error:\x20--behavior\x20requires\x20a\x20name\x0a','allowedIps','\x20\x20Tables:\x201\x20customers\x20+\x20','validateParentYaml','sort','\x20is\x20already\x20up\x20to\x20date','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','updatedAt','stitchingKeys','Error:\x20--attribute\x20requires\x20a\x20name\x0a','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','setJobId','Listing\x20parent\x20segments\x20matching\x20\x27','\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a','Finding\x20service\x20for\x20token...','getBehaviorNames','Fetching\x20sample\x20data...','match','behavior_','Show\x20parent\x20segment\x20details','entryCriteria','cyan','Validate:','4513135ILeDOs','Fetching\x20parent\x20segment\x20\x27','ps:pz:delete','Creating\x20personalization\x20\x27','Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]','keyEventCriteria','create','some','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','folderId','updated:','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','displayAttributesStats','⚠️\x20\x20personalization_services\x20section\x20already\x20exists\x20in\x20','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','.yml','displayPreviewHints','deletePersonalization','map','Personalization\x20service\x20description','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context','Delete\x20a\x20realtime\x20personalization','idStitching','displayRealtimeInfo','Options\x20(one\x20required):\x0a','24iViVwb','stats','segment:parent:update','last_page_viewed','Attributes','state','population','data','Master:','\x20\x20Columns:\x20','Usage:\x20tdx\x20ps\x20pz\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20personalizations\x20(requires\x20context)\x0a','\x20RT\x20configuration\x20is\x20valid','parentFolder','eventKind','replace','pullParentYaml','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','personalizationServices','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context'];a32_0x44ac=function(){return _0x3f0baa;};return a32_0x44ac();}export class PSPzServiceCreateCommand extends BaseCommand{[a32_0x51f12c(0x282)]='ps:pz:service:create';[a32_0x51f12c(0x12a)]=a32_0x51f12c(0x13e);async[a32_0x51f12c(0x1fc)](_0x41d339){const _0x1ab3bc=a32_0x51f12c,{options:_0x58c94a,args:_0xcf4ce2,tdx:_0x41f3f4}=_0x41d339,_0x6b71db=_0x58c94a,_0x46de47=_0xcf4ce2[0x0],_0x4ee936=_0xcf4ce2[0x1]||_0x58c94a['parentSegment'];if(!_0x46de47)return console[_0x1ab3bc(0x25f)](_0x1ab3bc(0x169)),console[_0x1ab3bc(0x25f)](_0x1ab3bc(0x154)),console[_0x1ab3bc(0x25f)](_0x1ab3bc(0xe3)),0x1;if(!_0x4ee936)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]\x0a'+_0x1ab3bc(0xe3)),0x1;const _0x1512d9=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x4ee936+_0x1ab3bc(0x138),()=>_0x41f3f4['segment'][_0x1ab3bc(0x242)](_0x4ee936),{'verbose':_0x58c94a['verbose']}),_0x317c8f=_0x1512d9[_0x1ab3bc(0xef)],_0x387603={'name':_0x46de47,'description':_0x6b71db[_0x1ab3bc(0x12a)],'public':_0x6b71db['public']},_0x40c82c=await withSpinner(_0x1ab3bc(0x279)+_0x46de47+_0x1ab3bc(0x138),()=>_0x41f3f4[_0x1ab3bc(0x8f)][_0x1ab3bc(0xd5)](_0x317c8f,_0x387603),{'verbose':_0x58c94a[_0x1ab3bc(0x188)]}),_0x29d4e5=_0x40c82c['data'];return console[_0x1ab3bc(0x25f)](_0x1ab3bc(0x25c)+_0x29d4e5[_0x1ab3bc(0x282)]+_0x1ab3bc(0x225)+_0x29d4e5['id']),await handleSDKOutput([_0x29d4e5],_0x58c94a),0x0;}}export class PSPzServiceShowCommand extends BaseCommand{[a32_0x51f12c(0x282)]='ps:pz:service:show';[a32_0x51f12c(0x12a)]='Show\x20personalization\x20service\x20details';async['execute'](_0x7345e6){const _0x1339d7=a32_0x51f12c,{options:_0x3c6df7,args:_0x4848e5,tdx:_0x41c7d3}=_0x7345e6,_0x55159a=_0x4848e5[0x0],_0x534041=_0x4848e5[0x1]||_0x3c6df7[_0x1339d7(0x196)];if(!_0x55159a)return console['error'](_0x1339d7(0x176)),console[_0x1339d7(0x25f)](_0x1339d7(0x226)),console['error'](_0x1339d7(0x123)),0x1;if(!_0x534041)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]\x0a'+_0x1339d7(0x123)),0x1;const _0x1c3648=await withSpinner(_0x1339d7(0x168)+_0x534041+'\x27...',()=>_0x41c7d3['segment'][_0x1339d7(0x242)](_0x534041),{'verbose':_0x3c6df7['verbose']}),_0x23bae1=_0x1c3648['data'],_0x909a46=await withSpinner('Fetching\x20personalization\x20service\x20\x27'+_0x55159a+'\x27...',()=>_0x41c7d3['personalization'][_0x1339d7(0x1a5)](_0x23bae1,_0x55159a),{'verbose':_0x3c6df7[_0x1339d7(0x188)]}),_0x15156c=_0x909a46[_0x1339d7(0xef)];if(_0x3c6df7[_0x1339d7(0x1c6)]||_0x3c6df7[_0x1339d7(0x114)])await handleSDKOutput([_0x15156c],_0x3c6df7);else{console[_0x1339d7(0x16d)](a32_0x265203[_0x1339d7(0x27a)](_0x15156c[_0x1339d7(0x282)])+'\x20'+a32_0x265203[_0x1339d7(0x1c2)](_0x1339d7(0x23f)+_0x15156c['id']+')'));_0x15156c['description']&&console['log']('\x20\x20'+a32_0x265203['dim'](_0x15156c[_0x1339d7(0x12a)]));console[_0x1339d7(0x16d)]('\x20\x20'+a32_0x265203['cyan'](_0x1339d7(0x1b0))+'\x20'+(_0x15156c['public']?_0x1339d7(0x21e):'no'));if(_0x15156c[_0x1339d7(0x111)]&&_0x15156c['tokens'][_0x1339d7(0x1ad)]>0x0)for(const _0x228923 of _0x15156c[_0x1339d7(0x111)]){const _0x3ae8c3=_0x228923['allowedIps']?.[_0x1339d7(0x1ad)]?_0x228923['allowedIps'][_0x1339d7(0x97)](',\x20'):'any';console[_0x1339d7(0x16d)]('\x20\x20'+a32_0x265203[_0x1339d7(0xcd)](_0x1339d7(0x1b5))+'\x20'+_0x228923[_0x1339d7(0x282)]+'\x20'+a32_0x265203[_0x1339d7(0x1c2)](_0x1339d7(0x23f)+_0x228923['id']+')')),console[_0x1339d7(0x16d)](_0x1339d7(0x1cd)+a32_0x265203['dim'](_0x1339d7(0x103))+'\x20'+_0x3ae8c3);}else console['log']('\x20\x20'+a32_0x265203[_0x1339d7(0x1c2)](_0x1339d7(0x243)));}return 0x0;}}export class PSPzServiceDeleteCommand extends BaseCommand{[a32_0x51f12c(0x282)]=a32_0x51f12c(0xa8);[a32_0x51f12c(0x12a)]=a32_0x51f12c(0x244);async['execute'](_0x113f10){const _0x3cb874=a32_0x51f12c,{options:_0x70c816,args:_0x432b90,tdx:_0x292468}=_0x113f10,_0x3a0e54=_0x432b90[0x0],_0x82a8cd=_0x432b90[0x1]||_0x70c816[_0x3cb874(0x196)];if(!_0x3a0e54)return console['error']('Error:\x20Service\x20ID\x20is\x20required'),console[_0x3cb874(0x25f)](_0x3cb874(0x1f2)),console[_0x3cb874(0x25f)](_0x3cb874(0x22a)),0x1;if(!_0x82a8cd)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]\x0a'+_0x3cb874(0x22a)),0x1;const _0x3b7628=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x82a8cd+_0x3cb874(0x138),()=>_0x292468[_0x3cb874(0x1c1)][_0x3cb874(0x242)](_0x82a8cd),{'verbose':_0x70c816['verbose']}),_0x16bc74=_0x3b7628[_0x3cb874(0xef)];return await withSpinner('Deleting\x20personalization\x20service\x20\x27'+_0x3a0e54+'\x27...',()=>_0x292468[_0x3cb874(0x8f)]['delete'](_0x16bc74,_0x3a0e54),{'verbose':_0x70c816[_0x3cb874(0x188)]}),console['error'](_0x3cb874(0x214)+_0x3a0e54+'\x27'),0x0;}}export class PSPzServiceUpdateCommand extends BaseCommand{['name']=a32_0x51f12c(0x201);[a32_0x51f12c(0x12a)]=a32_0x51f12c(0x283);async[a32_0x51f12c(0x1fc)](_0x5494b7){const _0x18596c=a32_0x51f12c,{options:_0x2d8d20,args:_0x5b491c,tdx:_0xf06359}=_0x5494b7,_0x178c0d=_0x2d8d20,_0x56eae9=_0x5b491c[0x0],_0x10e87b=_0x5b491c[0x1]||_0x2d8d20['parentSegment'];if(!_0x56eae9)return console[_0x18596c(0x25f)](_0x18596c(0x176)),console['error'](_0x18596c(0x145)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x178c0d[_0x18596c(0x282)])return console[_0x18596c(0x25f)](_0x18596c(0x1b7)),console[_0x18596c(0x25f)](_0x18596c(0x145)),0x1;if(!_0x10e87b)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]\x0a'+_0x18596c(0x289)),0x1;const _0x22e1ce=await withSpinner(_0x18596c(0x168)+_0x10e87b+'\x27...',()=>_0xf06359[_0x18596c(0x1c1)]['resolveParentId'](_0x10e87b),{'verbose':_0x2d8d20[_0x18596c(0x188)]}),_0x5105b7=_0x22e1ce['data'],_0x24f841={'name':_0x178c0d[_0x18596c(0x282)]};_0x178c0d[_0x18596c(0x12a)]!==undefined&&(_0x24f841[_0x18596c(0x12a)]=_0x178c0d[_0x18596c(0x12a)]);const _0x1bd9d2=await withSpinner(_0x18596c(0x1b6)+_0x56eae9+'\x27...',()=>_0xf06359[_0x18596c(0x8f)][_0x18596c(0x14c)](_0x5105b7,_0x56eae9,_0x24f841),{'verbose':_0x2d8d20[_0x18596c(0x188)]}),_0x3d570d=_0x1bd9d2[_0x18596c(0xef)];return console[_0x18596c(0x25f)]('✔\x20Updated\x20personalization\x20service\x20\x27'+_0x3d570d[_0x18596c(0x282)]+'\x27'),await handleSDKOutput([_0x3d570d],_0x2d8d20),0x0;}}export class PSPzServiceTokenCreateCommand extends BaseCommand{['name']=a32_0x51f12c(0x93);['description']='Create\x20a\x20token\x20for\x20a\x20personalization\x20service';async[a32_0x51f12c(0x1fc)](_0x47ef89){const _0x3b0558=a32_0x51f12c,{options:_0x30c0b9,args:_0x10b918,tdx:_0x45aedf}=_0x47ef89,_0x3f736f=_0x30c0b9,_0x3fdbfd=_0x10b918[0x0],_0x358b2d=_0x10b918[0x1],_0x2f572a=_0x10b918[0x2]||_0x30c0b9[_0x3b0558(0x196)];if(!_0x3fdbfd)return console[_0x3b0558(0x25f)]('Error:\x20Token\x20name\x20is\x20required'),console['error'](_0x3b0558(0x11c)),console['error'](_0x3b0558(0x155)),0x1;if(!_0x358b2d)return console['error'](_0x3b0558(0x176)),console['error']('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]'),console[_0x3b0558(0x25f)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x2f572a)return showParentSegmentNotSetError(_0x3b0558(0xb6)+_0x3b0558(0x155)),0x1;const _0x1aabee=await withSpinner(_0x3b0558(0x168)+_0x2f572a+_0x3b0558(0x138),()=>_0x45aedf['segment'][_0x3b0558(0x242)](_0x2f572a),{'verbose':_0x30c0b9[_0x3b0558(0x188)]}),_0xd0655d=_0x1aabee[_0x3b0558(0xef)],_0x201266={'name':_0x3fdbfd};_0x3f736f['allowedIps']&&(_0x201266['allowedIps']=_0x3f736f[_0x3b0558(0xb9)][_0x3b0558(0x1e6)](',')['map'](_0x4febe1=>_0x4febe1['trim']()));_0x3f736f[_0x3b0558(0x12a)]&&(_0x201266[_0x3b0558(0x12a)]=_0x3f736f['description']);const _0x304dee=await withSpinner(_0x3b0558(0x128)+_0x3fdbfd+_0x3b0558(0x18a)+_0x358b2d+_0x3b0558(0x138),()=>_0x45aedf['personalization'][_0x3b0558(0x11b)](_0xd0655d,_0x358b2d,_0x201266),{'verbose':_0x30c0b9[_0x3b0558(0x188)]}),_0x40a07b=_0x304dee['data'];return console[_0x3b0558(0x25f)]('✔\x20Created\x20token\x20\x27'+_0x40a07b[_0x3b0558(0x282)]+'\x27\x20with\x20ID:\x20'+_0x40a07b['id']),_0x40a07b['value']&&(console[_0x3b0558(0x25f)](a32_0x265203[_0x3b0558(0xb5)](_0x3b0558(0x1be))),console[_0x3b0558(0x25f)](a32_0x265203[_0x3b0558(0xcd)](_0x40a07b[_0x3b0558(0x1a9)])),console[_0x3b0558(0x25f)]('')),await handleSDKOutput([_0x40a07b],_0x30c0b9),0x0;}}export class PSPzServiceTokenDeleteCommand extends BaseCommand{[a32_0x51f12c(0x282)]='ps:pz:service:token:delete';[a32_0x51f12c(0x12a)]=a32_0x51f12c(0x259);async[a32_0x51f12c(0x1fc)](_0x8041a5){const _0x378832=a32_0x51f12c,{options:_0x543cf1,args:_0x418d68,tdx:_0x3eca5c}=_0x8041a5,_0x473042=_0x418d68[0x0],_0x43b158=_0x418d68[0x1]||_0x543cf1['parentSegment'];if(!_0x473042)return console[_0x378832(0x25f)](_0x378832(0x9b)),console['error'](_0x378832(0x115)),console[_0x378832(0x25f)](_0x378832(0xfa)),0x1;if(!_0x43b158)return showParentSegmentNotSetError(_0x378832(0x1cb)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context'),0x1;const _0x5c421f=await withSpinner(_0x378832(0x168)+_0x43b158+_0x378832(0x138),()=>_0x3eca5c[_0x378832(0x1c1)][_0x378832(0x242)](_0x43b158),{'verbose':_0x543cf1['verbose']}),_0x5dcd2a=_0x5c421f[_0x378832(0xef)],_0x588f91=await withSpinner(_0x378832(0xc6),()=>_0x3eca5c[_0x378832(0x8f)][_0x378832(0x227)](_0x5dcd2a),{'verbose':_0x543cf1['verbose']}),_0x7a167c=_0x588f91['data'];let _0x62c3a6;for(const _0x7358be of _0x7a167c){if(_0x7358be[_0x378832(0x111)]?.[_0x378832(0xd6)](_0x4c7701=>_0x4c7701['id']===_0x473042)){_0x62c3a6=_0x7358be['id'];break;}}if(!_0x62c3a6)return console[_0x378832(0x25f)](_0x378832(0x1a2)+_0x473042+_0x378832(0x21b)),0x1;const _0x2aba88=await withSpinner('Deleting\x20token\x20\x27'+_0x473042+_0x378832(0x138),()=>_0x3eca5c[_0x378832(0x8f)][_0x378832(0x23d)](_0x5dcd2a,_0x62c3a6,_0x473042),{'verbose':_0x543cf1[_0x378832(0x188)]}),_0x462e79=_0x2aba88[_0x378832(0xef)];return console[_0x378832(0x25f)](_0x378832(0x164)+(_0x462e79[_0x378832(0x282)]||_0x473042)+'\x27'),await handleSDKOutput([_0x462e79],_0x543cf1),0x0;}}export class PSPzListCommand extends BaseCommand{[a32_0x51f12c(0x282)]=a32_0x51f12c(0x184);[a32_0x51f12c(0x12a)]=a32_0x51f12c(0x24c);async[a32_0x51f12c(0x1fc)](_0x2adf10){const _0x333418=a32_0x51f12c,{options:_0x5c97a5,args:_0x1c255b,tdx:_0x4e4fd5}=_0x2adf10,_0x5515f5=_0x1c255b[0x0]||_0x5c97a5[_0x333418(0x196)];if(!_0x5515f5)return showParentSegmentNotSetError(_0x333418(0xf2)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20personalizations\x20for\x20specific\x20parent\x20segment'),0x1;const _0x3808c6=await withSpinner(_0x333418(0x168)+_0x5515f5+'\x27...',()=>_0x4e4fd5[_0x333418(0x1c1)][_0x333418(0x242)](_0x5515f5),{'verbose':_0x5c97a5[_0x333418(0x188)]}),_0xf75d52=_0x3808c6[_0x333418(0xef)],_0x545a86=await withSpinner(_0x333418(0x191)+_0x5515f5+_0x333418(0x138),()=>_0x4e4fd5[_0x333418(0x8f)][_0x333418(0x206)](_0xf75d52),{'verbose':_0x5c97a5['verbose']}),_0x33892a=_0x545a86[_0x333418(0xef)];console[_0x333418(0x25f)]('✔\x20Found\x20'+_0x33892a[_0x333418(0x1ad)]+_0x333418(0x180)+(_0x33892a[_0x333418(0x1ad)]!==0x1?'s':''));if(_0x5c97a5[_0x333418(0x1bc)]===_0x333418(0x1c6)||_0x5c97a5[_0x333418(0x1bc)]===_0x333418(0x114))await handleSDKOutput(_0x33892a,_0x5c97a5);else{if(_0x33892a[_0x333418(0x1ad)]===0x0)console['log'](_0x333418(0xb3));else for(const _0x3de453 of _0x33892a){console[_0x333418(0x16d)](a32_0x265203[_0x333418(0x27a)](_0x3de453[_0x333418(0x282)])+'\x20'+a32_0x265203[_0x333418(0x1c2)]('(id:\x20'+_0x3de453['id']+')'));_0x3de453[_0x333418(0x12a)]&&console[_0x333418(0x16d)]('\x20\x20'+a32_0x265203[_0x333418(0x1c2)](_0x3de453[_0x333418(0x12a)]));const _0x179f6d=_0x3de453['sections']?.[_0x333418(0x1ad)]||0x0;console[_0x333418(0x16d)]('\x20\x20'+a32_0x265203[_0x333418(0xcd)]('sections:')+'\x20'+_0x179f6d);if(_0x3de453[_0x333418(0x26b)]&&_0x3de453[_0x333418(0x26b)][_0x333418(0x1ad)]>0x0)for(const _0x530175 of _0x3de453['sections']){console[_0x333418(0x16d)]('\x20\x20\x20\x20-\x20'+_0x530175['name']);}}}return 0x0;}}export class PSPzShowCommand extends BaseCommand{[a32_0x51f12c(0x282)]=a32_0x51f12c(0xfd);[a32_0x51f12c(0x12a)]='Show\x20a\x20specific\x20realtime\x20personalization';async[a32_0x51f12c(0x1fc)](_0x4b66ca){const _0x200e75=a32_0x51f12c,{options:_0x34ab9d,args:_0x646ac,tdx:_0x36f75d}=_0x4b66ca,_0x176c5f=_0x646ac[0x0];if(!_0x176c5f)return console[_0x200e75(0x25f)](_0x200e75(0x256)),console[_0x200e75(0x25f)]('Usage:\x20tdx\x20ps\x20pz\x20show\x20<personalization_id>'),0x1;const _0x36ab4d=await withSpinner(_0x200e75(0xa3)+_0x176c5f+_0x200e75(0x138),()=>_0x36f75d['personalization'][_0x200e75(0x1ce)](_0x176c5f),{'verbose':_0x34ab9d['verbose']}),_0x20e0d8=_0x36ab4d['data'];console[_0x200e75(0x25f)](_0x200e75(0x284)+_0x20e0d8[_0x200e75(0x282)]+'\x27');if(_0x34ab9d[_0x200e75(0x1bc)]===_0x200e75(0x1c6)||_0x34ab9d[_0x200e75(0x1bc)]==='jsonl')await handleSDKOutput([_0x20e0d8],_0x34ab9d);else{console[_0x200e75(0x16d)](a32_0x265203['bold'](_0x20e0d8[_0x200e75(0x282)])+'\x20'+a32_0x265203['dim'](_0x200e75(0x23f)+_0x20e0d8['id']+')'));_0x20e0d8[_0x200e75(0x12a)]&&console[_0x200e75(0x16d)]('\x20\x20'+a32_0x265203['dim'](_0x20e0d8[_0x200e75(0x12a)]));_0x20e0d8[_0x200e75(0x231)]&&console[_0x200e75(0x16d)]('\x20\x20'+a32_0x265203[_0x200e75(0xcd)](_0x200e75(0x14b))+'\x20'+_0x20e0d8[_0x200e75(0x231)]);console[_0x200e75(0x16d)]('\x20\x20'+a32_0x265203[_0x200e75(0xcd)]('created:')+'\x20'+_0x20e0d8['createdAt']),console[_0x200e75(0x16d)]('\x20\x20'+a32_0x265203[_0x200e75(0xcd)](_0x200e75(0xd9))+'\x20'+_0x20e0d8[_0x200e75(0xbf)]);const _0x41b3ab=_0x20e0d8[_0x200e75(0x26b)]?.[_0x200e75(0x1ad)]||0x0;console['log']('\x20\x20'+a32_0x265203[_0x200e75(0xcd)](_0x200e75(0x15b))+'\x20'+_0x41b3ab);if(_0x20e0d8[_0x200e75(0x26b)]&&_0x20e0d8[_0x200e75(0x26b)][_0x200e75(0x1ad)]>0x0)for(const _0x26fa48 of _0x20e0d8['sections']){console[_0x200e75(0x16d)]('\x20\x20\x20\x20'+a32_0x265203[_0x200e75(0x27a)](_0x26fa48[_0x200e75(0x282)])+'\x20'+a32_0x265203['dim'](_0x200e75(0x23f)+_0x26fa48['id']+')')),_0x26fa48[_0x200e75(0xcc)]&&(console[_0x200e75(0x16d)](_0x200e75(0x202)+a32_0x265203['cyan'](_0x200e75(0x1ab))+'\x20'+_0x26fa48[_0x200e75(0xcc)]['name']),_0x26fa48[_0x200e75(0xcc)][_0x200e75(0xd4)]?.[_0x200e75(0x273)]&&console[_0x200e75(0x16d)](_0x200e75(0x119)+a32_0x265203[_0x200e75(0xcd)]('keyEventId:')+'\x20'+_0x26fa48[_0x200e75(0xcc)][_0x200e75(0xd4)][_0x200e75(0x273)])),_0x26fa48[_0x200e75(0x26f)]&&console[_0x200e75(0x16d)](_0x200e75(0x202)+a32_0x265203[_0x200e75(0xcd)](_0x200e75(0x8d))+'\x20'+JSON['stringify'](_0x26fa48[_0x200e75(0x26f)])),_0x26fa48[_0x200e75(0xa1)]&&console[_0x200e75(0x16d)](_0x200e75(0x202)+a32_0x265203['cyan'](_0x200e75(0x280))+_0x200e75(0x11a));}}return 0x0;}}export class PSPzDeleteCommand extends BaseCommand{['name']=a32_0x51f12c(0xd1);[a32_0x51f12c(0x12a)]=a32_0x51f12c(0xe4);async[a32_0x51f12c(0x1fc)](_0x1170d6){const _0x3c6ef2=a32_0x51f12c,{options:_0x1c220a,args:_0x57918a,tdx:_0x2e93a2}=_0x1170d6,_0x2cdc71=_0x57918a[0x0];if(!_0x2cdc71)return console['error'](_0x3c6ef2(0x256)),console[_0x3c6ef2(0x25f)](_0x3c6ef2(0x20d)),0x1;return await withSpinner(_0x3c6ef2(0x167)+_0x2cdc71+'\x27...',()=>_0x2e93a2['personalization'][_0x3c6ef2(0xe0)](_0x2cdc71),{'verbose':_0x1c220a['verbose']}),console['error'](_0x3c6ef2(0x15d)+_0x2cdc71+'\x27'),0x0;}}export class PSPzCreateCommand extends BaseCommand{[a32_0x51f12c(0x282)]='ps:pz:create';['description']=a32_0x51f12c(0x16c);async[a32_0x51f12c(0x1fc)](_0x386d41){const _0x18a867=a32_0x51f12c,{options:_0x2ba36e,tdx:_0x158b39}=_0x386d41,_0xc6502c=_0x2ba36e;let _0x13b196;if(_0xc6502c['file']){_0x13b196=await loadJSON(_0xc6502c[_0x18a867(0x27b)],!![]);if(!_0x13b196[_0x18a867(0x157)]?.[_0x18a867(0xf4)])return console[_0x18a867(0x25f)](_0x18a867(0x20f)),console[_0x18a867(0x25f)](_0x18a867(0x265)),console['error'](_0x18a867(0xa5)),0x1;}else{if(!_0xc6502c[_0x18a867(0x282)])return console[_0x18a867(0x25f)](_0x18a867(0x1d4)),console[_0x18a867(0x25f)](_0x18a867(0x1cc)),console[_0x18a867(0x25f)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>'),0x1;if(_0xc6502c['description']===undefined)return console['error'](_0x18a867(0x1c3)),console[_0x18a867(0x25f)](_0x18a867(0x1cc)),console['error'](_0x18a867(0x271)),0x1;if(_0xc6502c[_0x18a867(0xd8)]===undefined)return console['error'](_0x18a867(0x253)),console[_0x18a867(0x25f)](_0x18a867(0x156)),0x1;let _0x5980cd=_0xc6502c[_0x18a867(0x231)];if(!_0x5980cd&&_0x2ba36e[_0x18a867(0x196)]){const _0x5a9e14=await withSpinner(_0x18a867(0x168)+_0x2ba36e[_0x18a867(0x196)]+_0x18a867(0x138),()=>_0x158b39[_0x18a867(0x1c1)][_0x18a867(0x242)](_0x2ba36e['parentSegment']),{'verbose':_0x2ba36e[_0x18a867(0x188)]});_0x5980cd=_0x5a9e14['data'];}let _0x249dda;_0xc6502c[_0x18a867(0x26b)]&&(_0x249dda=await loadJSON(_0xc6502c[_0x18a867(0x26b)],![]));const _0x3ad584=_0xc6502c['folderId']==='null'?null:{'id':_0xc6502c[_0x18a867(0xd8)],'type':'folder-segment'};_0x13b196={'attributes':{'name':_0xc6502c['name'],'description':_0xc6502c[_0x18a867(0x12a)]||null,..._0x5980cd!==undefined&&{'audienceId':_0x5980cd},..._0x249dda!==undefined&&{'sections':_0x249dda}},'relationships':{'parentFolder':{'data':_0x3ad584}}};}const _0x2c916e=await withSpinner(_0x18a867(0xd2)+(_0x13b196[_0x18a867(0x170)]?.[_0x18a867(0x282)]??'')+_0x18a867(0x138),()=>_0x158b39[_0x18a867(0x8f)][_0x18a867(0x19f)](_0x13b196),{'verbose':_0x2ba36e[_0x18a867(0x188)]}),_0x1f7069=_0x2c916e[_0x18a867(0xef)];return console[_0x18a867(0x25f)]('✔\x20Created\x20personalization\x20\x27'+_0x1f7069['name']+_0x18a867(0x225)+_0x1f7069['id']),await handleSDKOutput([_0x1f7069],_0x2ba36e),0x0;}}export class PSPzPatchCommand extends BaseCommand{[a32_0x51f12c(0x282)]=a32_0x51f12c(0x14f);[a32_0x51f12c(0x12a)]=a32_0x51f12c(0x135);async[a32_0x51f12c(0x1fc)](_0x1cf496){const _0xecdc0f=a32_0x51f12c,{options:_0x397cc2,args:_0x4a174e}=_0x1cf496,_0x49637c=_0x397cc2,_0x423d82=_0x4a174e[0x0];if(!_0x423d82)return console[_0xecdc0f(0x25f)](_0xecdc0f(0x256)),console[_0xecdc0f(0x25f)]('Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]'),console[_0xecdc0f(0x25f)](_0xecdc0f(0x98)),0x1;let _0xad3a56;if(_0x49637c[_0xecdc0f(0x27b)])_0xad3a56=await loadJSON(_0x49637c['file'],!![]);else{if(!_0x49637c['name'])return console[_0xecdc0f(0x25f)](_0xecdc0f(0x1d4)),console[_0xecdc0f(0x25f)](_0xecdc0f(0xd3)),0x1;if(_0x49637c[_0xecdc0f(0x12a)]===undefined)return console[_0xecdc0f(0x25f)](_0xecdc0f(0x1c3)),console['error'](_0xecdc0f(0xd3)),0x1;let _0x1bab98;_0x49637c['sections']&&(_0x1bab98=await loadJSON(_0x49637c['sections'],![])),_0xad3a56={'attributes':{'name':_0x49637c[_0xecdc0f(0x282)],'description':_0x49637c[_0xecdc0f(0x12a)]||null,..._0x1bab98!==undefined&&{'sections':_0x1bab98}}};}const {tdx:_0xf1724d}=_0x1cf496,_0x2b0af8=await withSpinner('Patching\x20personalization\x20\x27'+_0x423d82+_0xecdc0f(0x138),()=>_0xf1724d[_0xecdc0f(0x8f)]['patchPersonalization'](_0x423d82,_0xad3a56),{'verbose':_0x397cc2[_0xecdc0f(0x188)]}),_0x5ea57b=_0x2b0af8[_0xecdc0f(0xef)];return console['error'](_0xecdc0f(0x147)+_0x5ea57b[_0xecdc0f(0x282)]+'\x27\x20(id:\x20'+_0x5ea57b['id']+')'),await handleSDKOutput([_0x5ea57b],_0x397cc2),0x0;}}export class PSPzInitCommand extends BaseParentSegmentCommand{[a32_0x51f12c(0x282)]=a32_0x51f12c(0x1e1);[a32_0x51f12c(0x12a)]='Add\x20template\x20personalization\x20section\x20to\x20parent\x20segment\x20YAML';async[a32_0x51f12c(0x1fc)](_0x1bfe3d){const _0x10579b=a32_0x51f12c,{options:_0xe69f50,args:_0xb32b66}=_0x1bfe3d,_0x249ccd=_0xb32b66[0x0]||_0xe69f50[_0x10579b(0x196)];if(!_0x249ccd)return showParentSegmentNotSetError(_0x10579b(0x24e)+_0x10579b(0x18b)),0x1;const _0x5775c1=resolveYamlFile(_0x249ccd);if(!existsSync(_0x5775c1))return showFileNotFoundError(_0x5775c1,_0x249ccd),0x1;let _0x12047a;try{_0x12047a=readFileSync(_0x5775c1,'utf-8');}catch(_0x2a134b){const _0x3a1dce=_0x2a134b instanceof Error?_0x2a134b['message']:String(_0x2a134b);return console[_0x10579b(0x25f)](_0x10579b(0x1d1)+_0x3a1dce),0x1;}let _0x36a1c9;try{_0x36a1c9=parseDef(_0x12047a);}catch(_0x54f055){const _0x37126b=_0x54f055 instanceof Error?_0x54f055[_0x10579b(0x183)]:String(_0x54f055);return console[_0x10579b(0x25f)](a32_0x265203[_0x10579b(0x153)](_0x10579b(0x99)+_0x37126b)),0x1;}if(_0x36a1c9[_0x10579b(0x13d)]&&_0x36a1c9['personalization_services']['length']>0x0)return console[_0x10579b(0x25f)](a32_0x265203[_0x10579b(0xb5)](_0x10579b(0xdc)+_0x5775c1)),console[_0x10579b(0x25f)](a32_0x265203[_0x10579b(0x1c2)]('\x20\x20\x20'+_0x36a1c9['personalization_services'][_0x10579b(0x1ad)]+_0x10579b(0x162))),0x1;!_0x36a1c9['realtime']&&(_0x36a1c9[_0x10579b(0x23e)]={'events':[{'name':_0x10579b(0x261),'source_table':_0x10579b(0x28e)}],'attributes':[{'name':_0x10579b(0xeb),'type':_0x10579b(0xad)}],'id_stitching':{'primary_key':_0x36a1c9[_0x10579b(0x257)][_0x10579b(0x203)]===_0x10579b(0x204)?'td_client_id':'user_id'}});_0x36a1c9[_0x10579b(0x13d)]=[{'name':_0x10579b(0x1c8),'description':_0x10579b(0xe2),'trigger_event':_0x10579b(0x261),'sections':[{'name':_0x10579b(0x102),'criteria':'true','attributes':['last_page_viewed']}]}];const _0x5bc5dc=serializeDef(_0x36a1c9);return writeFileSync(_0x5775c1,_0x5bc5dc,'utf-8'),console['error'](a32_0x265203[_0x10579b(0xff)]('✔')+_0x10579b(0xa2)+a32_0x265203[_0x10579b(0xcd)](_0x5775c1)),(!_0x36a1c9[_0x10579b(0x23e)]||_0x12047a[_0x10579b(0x262)](_0x10579b(0x25d))===-0x1)&&console[_0x10579b(0x25f)](a32_0x265203[_0x10579b(0xff)]('✔')+'\x20Added\x20RT\x202.0\x20template\x20section'),console[_0x10579b(0x25f)]('\x0a'+a32_0x265203[_0x10579b(0x1c2)](_0x10579b(0xac))),console[_0x10579b(0x25f)](_0x10579b(0x1f7)+_0x5775c1+'\x20to\x20configure\x20your\x20personalization\x20service'),console[_0x10579b(0x25f)]('\x20\x202.\x20Run\x20'+a32_0x265203[_0x10579b(0x1c2)]('tdx\x20ps\x20push\x20'+_0x249ccd)+'\x20to\x20push\x20the\x20configuration'),0x0;}}
|
|
1
|
+
const a32_0x246bc7=a32_0x2ba9;(function(_0x3e7ee1,_0x17e69e){const _0x44dabf=a32_0x2ba9,_0x1d4897=_0x3e7ee1();while(!![]){try{const _0x23ebfd=parseInt(_0x44dabf(0x383))/0x1+parseInt(_0x44dabf(0x205))/0x2*(parseInt(_0x44dabf(0x3c1))/0x3)+parseInt(_0x44dabf(0x3ce))/0x4*(parseInt(_0x44dabf(0x305))/0x5)+-parseInt(_0x44dabf(0x3af))/0x6*(parseInt(_0x44dabf(0x35a))/0x7)+-parseInt(_0x44dabf(0x399))/0x8*(-parseInt(_0x44dabf(0x3de))/0x9)+parseInt(_0x44dabf(0x3cf))/0xa*(-parseInt(_0x44dabf(0x2a8))/0xb)+-parseInt(_0x44dabf(0x289))/0xc*(parseInt(_0x44dabf(0x395))/0xd);if(_0x23ebfd===_0x17e69e)break;else _0x1d4897['push'](_0x1d4897['shift']());}catch(_0x175f1d){_0x1d4897['push'](_0x1d4897['shift']());}}}(a32_0x12ff,0x2bc0c));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a32_0x434382 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';function a32_0x12ff(){const _0x4cce79=['Usage:\x20tdx\x20ps\x20rt\x20jn\x20resume_activations\x20<journeyId>\x0a','parent_id','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','✔\x20Deleted\x20personalization\x20service\x20\x27','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]\x0a','1671080MDPtCB','log','sourceTableError','behaviorsFile','\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path','\x0a⚠\x20Save\x20this\x20token\x20value\x20-\x20it\x20will\x20not\x20be\x20shown\x20again:','Master\x20+\x20Attributes','No\x20RT-enabled\x20parent\x20segments\x20found','apply','\x0a\x20\x20\x20\x20]','Database:\x20','segment:parent:validate','segment:parent:pull','\x20parent\x20segment\x20\x27','isDirectory','limit','Error:\x20Personalization\x20ID\x20is\x20required','bold','personalization_services','Creating\x20personalization\x20\x27','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','Aborted.','\x27\x20and\x20run\x20workflow?','Attempt:','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','description','customerPercent','errors','text','patchPersonalization','rowCount','To\x20cancel:','createPersonalization','\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','verbose','Enriched:','displaySummary','ps:pz:service:show','List\x20realtime\x20personalizations\x20for\x20a\x20parent\x20segment','Error:','getCurrentConfigVersion','\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)','`\x20to\x20download\x20the\x20configuration\x20first','segment:parent:view','format','any','toLocaleString','\x20\x20No\x20sample\x20data\x20available','Resolving\x20parent\x20segment\x20\x27','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]','\x20tdx\x20wf\x20attempt\x20','Error:\x20--behavior\x20requires\x20a\x20name\x0a','Join:','Pattern:\x20','Fetching\x20sample\x20data...','Output\x20file:\x20','sections:','timezone','✔\x20Query\x20completed:\x20Processed\x20','create','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context','Session:','✔\x20Created\x20personalization\x20\x27','schemaValid','folder-segment','List\x20RT\x20journeys','enriched','jsonl','personalization','ps:rt:validate','✔\x20Retrieved\x20RT\x20configuration\x20version','YAML\x20file:\x20','unref','ps:pz:service:create','ps:pz:create','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','entryCriteria','stop','ps:pz:init','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','Create\x20a\x20realtime\x20personalization\x20entity','Updating\x20personalization\x20service\x20\x27','green','\x0a⚠️\x20\x20Migrating:\x20','stageCount','2359peoGna','List\x20personalization\x20services\x20for\x20a\x20parent\x20segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','No\x20parent\x20segments\x20found','RT\x202.0:','displayAttributesStats','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context','joinKey','ps:pz:service:update','.yaml','Update\x20a\x20realtime\x20personalization\x20entity','start','true','identifier','map','state','getParentFull','\x20+\x20[','\x20Context\x20set:\x20','scheduleOption','segment:parent:run','\x22,\x20\x22type\x22:\x20\x22','\x20RT\x20configuration\x20is\x20valid','\x0aNo\x20sample\x20data\x20available','public','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','resolveParentId','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','darwin','\x20--attribute\x20\x22','\x20--enriched','table','Analyzing\x20changes...','tdx\x20ps\x20preview\x20','\x20is\x20already\x20up\x20to\x20date','Updating','.yml','launched','realtime','type','parent_segment','309668rVyqTF','/\x20directory.\x0a','getParentSQL','<database>.<table>','population','ID\x20Stitching:','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','customersWithEvents','\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}','Preview:','\x27\x20not\x20found\x20in\x20any\x20personalization\x20service','Pausing\x20activations\x20for\x20RT\x20journey\x20\x27','customerGroupFile','Site:\x20','segment','Updated','deletePersonalization','\x20--behavior\x20\x22<name>\x22','1027YnYqPE','Usage:\x20tdx\x20ps\x20rt\x20jn\x20pause_activations\x20<journeyId>\x0a','enabled','\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22','115224kIuecZ','paused','payload:','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','Apply\x20changes\x20to\x20\x27','segment:parent:update','in\x20','Listing\x20personalization\x20services\x20for\x20\x27','customers','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','✔\x20Created\x20token\x20\x27','realtime:','/app/workflows/','Fetching\x20personalization\x20service\x20\x27','Listing\x20RT-enabled\x20parent\x20segments...','List\x20available\x20fields\x20for\x20segmentation','workflowAttemptId','list','segment:parent:sql','SELECT\x20*\x20FROM\x20(\x0a','⚠️\x20\x20personalization_services\x20section\x20already\x20exists\x20in\x20','4794QZhXdK','\x20Configuration\x20is\x20valid','✔\x20Paused\x20activations\x20for\x20RT\x20journey\x20\x27','FINISHED','\x20kill','\x27\x20with\x20ID:\x20','Delete\x20a\x20token\x20from\x20a\x20personalization\x20service','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','xdg-open','✔\x20No\x20changes\x20-\x20\x27','workflowSessionId','includeSensitive','Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]','Name:\x20','displayRealtimeInfo','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','6rXRYPZ','value','Rows:','trim','\x27\x20is\x20already\x20up\x20to\x20date','user_id','split','✔\x20Created\x20parent\x20segment\x20\x27','Error:\x20\x22relationships.parentFolder\x22\x20is\x20required\x20in\x20the\x20JSON\x20file.','match','primaryKey','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','listParents','4zWqvuU','3040gqcexv','replace','json','Fetching\x20current\x20configuration\x20for\x20\x27','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','\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22','displaySampleData','\x20\x201.\x20Edit\x20','✔\x20Found\x20','No\x20parent\x20segments\x20match\x20pattern:\x20','Listing\x20RT-enabled\x20parent\x20segments\x20matching\x20\x27','\x20rows\x20','My\x20Service','Patching\x20personalization\x20\x27','Table:\x20','108aHfZOA','behaviors','run','addAttributes','audienceId','output','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]\x0a','✔\x20Updated\x20parent\x20segment\x20\x27','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','Error:\x20Service\x20ID\x20is\x20required','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','Error:\x20Service\x20name\x20is\x20required','\x5c$&','displayPreviewResults','Listing\x20RT\x20journeys\x20for\x20\x27','Next\x20steps:','\x20--attribute\x20\x22<name>\x22','runParent','Join\x20on:','Error\x20parsing\x20YAML:\x20','Usage:\x20tdx\x20ps\x20pz\x20delete\x20<personalization_id>','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context','pullParentYaml','Options\x20(one\x20required):\x0a','validateParentYaml','localeCompare','database','/sessions/','✔\x20Renamed\x20directory\x20to\x20','idStitching','Error:\x20--folder-id\x20is\x20required.\x20Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID.','string','keyEventId:','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','allowed\x20IPs:','No\x20personalization\x20services\x20configured','Create\x20a\x20personalization\x20service\x20for\x20a\x20parent\x20segment','getBehaviorNames','\x0a⚠️\x20\x20Both\x20','pauseJourney','✔\x20Updated\x20personalization\x20service\x20\x27','Options:\x0a','\x20--behavior\x20\x22','\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','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','parent_segments','Default','Options:','\x20to\x20configure\x20your\x20personalization\x20service','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context','\x20service','\x20Added\x20RT\x202.0\x20template\x20section','\x20\x20Note:\x20','Finding\x20service\x20for\x20token...','column_type','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','getOutputDatabaseName','getPersonalization','createdAt','patch','length','98874hXkhLQ','setJobId','Error:\x20Parent\x20segment\x20name\x20is\x20required','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]\x0a','name','Pause\x20activations\x20in\x20an\x20RT\x20journey','SELECT\x20*\x20FROM\x20','message','Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22','{\x0a\x20\x20\x22database\x22:\x20\x22','formatSchemaJson','✔\x20Resumed\x20activations\x20for\x20RT\x20journey\x20\x27','yes','Error:\x20--database\x20and\x20--table\x20are\x20required','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>','master','ps:pz:list','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','Validate:','test','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','sampleData','Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a','attributes','Error:\x20Token\x20\x27','repeat','tokens','Coverage:','addBehaviors','no\x20tokens\x20configured','\x20RT\x20journey','personalizationServices','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','all','\x27...','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','label','Validating\x20RT\x20configuration...','displayPreviewHints','Available\x20attributes:','audienceId:','segment:parent:preview','Available\x20behaviors:','\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','schemaError','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','addBehaviorsFile','behavior','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context','file','updateParent','endsWith','\x20stage','data','\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a','double','column','\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)','\x20\x202.\x20Run\x20','toLowerCase','single','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]\x0a','\x0aChanges\x20to\x20\x27','customerGroup','execute','segment:parent:list','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','allowedIps','ignore','\x20\x20\x20\x20\x20\x20','\x20to\x20push\x20the\x20configuration','allValid','keyEventId','Add\x20template\x20personalization\x20section\x20to\x20parent\x20segment\x20YAML','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','resumeJourney','coveragePercent','\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','Delete\x20a\x20personalization\x20service','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','Error:\x20--attribute\x20requires\x20a\x20name\x0a','delete','Events:','Deleting\x20personalization\x20\x27','Create\x20a\x20token\x20for\x20a\x20personalization\x20service','eventKind:\x20','/app/dw/parentSegments/','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','valid','Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]','createParent','column_name','\x0a✔\x20Workflow\x20started','displayColumns','Resume\x20activations\x20in\x20an\x20RT\x20journey','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]\x0a','totalEvents','page_view','listJourneys','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','\x0aUsage:\x20tdx\x20ps\x20preview\x20','previewParentYaml','Personalization:','✔\x20Updated\x20personalization\x20\x27','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','\x0a\x20\x20\x20\x20}','audienceId:\x20','web','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','red','List\x20parent\x20segments','Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID,\x20then\x20add:','\x20\x20\x20\x20\x20\x20\x20\x20','RT\x202.0\x20Validate:','deleteToken','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','Listing\x20parent\x20segments...','Delete\x20a\x20realtime\x20personalization','\x27\x20is\x20up\x20to\x20date','eventKind','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\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','td_client_id','last_page_viewed','.customers)','\x0a\x20\x20]\x0a}\x0a','scheduleType','\x22\x20}','\x20rows)','18636JsJwkI','\x20\x20\x20\x20','Validate\x20RT\x202.0\x20configuration\x20from\x20parent\x20segment\x20YAML','identifier:\x20','Creating\x20personalization\x20service\x20\x27','Creating\x20parent\x20segment\x20\x27','filter','join','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','\x27\x20for\x20service\x20\x27','Listing\x20fields\x20for\x20\x27','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','interval','\x20=\x20','Master:','Attribute:','workflowId','segment:parent:desc','toFixed','Update\x20a\x20personalization\x20service\x20name\x20and/or\x20description','Fetching\x20customers\x20schema...','pushParentYaml','Attributes:','sort','Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs','get','Show\x20parent\x20segment\x20details','Listing\x20parent\x20segments\x20matching\x20\x27','Error\x20reading\x20file:\x20','status:\x20','Source:','12463AXBxwK','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20PZ\x20services\x20for\x20specific\x20parent\x20segment','\x20\x20\x20\x20\x20\x20\x20Pass\x20null\x20to\x20place\x20in\x20the\x20root\x20folder.','Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','columns','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','attribute','(id:\x20','foreignKey','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]','Output\x20Database:','token:','status','/\x20→\x20','public:','SQL\x20query:\x0a','\x0aNew\x20parent\x20segment\x20\x27','Create\x20parent\x20segment\x20\x27','cyan','number','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','\x20\x20\x20\x20-\x20','processedRows','behavior_','Deleting\x20personalization\x20service\x20\x27','keyEventCriteria','\x20\x20Database:\x20','\x20personalization','id:\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','Error:\x20Token\x20name\x20is\x20required','\x20\x20Columns:\x20','Error:\x20--name\x20is\x20required','stats','ps:pz:delete','\x20field','Fetching\x20parent\x20segment\x20\x27','\x20RT-enabled\x20parent\x20segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','yellow','ps:pz:patch','Behavior:','Fetching\x20behavior\x20list...','updatedAt','sections','Fetching\x20SQL\x20for\x20\x27','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','\x20configured','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','/attempt/','tdx\x20ps\x20push\x20','createToken','listFields','stitchingKeys','collectSchema','payload','dim','error','parentSegment','utf-8','⚡\x20Enabled','Usage:\x20tdx\x20ps\x20pz\x20show\x20<personalization_id>','ps:pz:service:list','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','some','site','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20(paused)','Audience\x20ID:','\x0aError:','platform','Parent\x20segment:\x20','push','\x0aTip:\x20Run\x20`tdx\x20ps\x20pz\x20service\x20init`\x20to\x20add\x20a\x20template\x20personalization\x20section\x20to\x20your\x20YAML','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','Creating','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','events','RT\x20Journey\x20ID:\x20','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','displayBehaviorsStats','\x20behaviors','elapsedTimeMillis','folderId','\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22','No\x20personalizations\x20configured'];a32_0x12ff=function(){return _0x4cce79;};return a32_0x12ff();}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 a32_0x50bd38 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=a32_0x246bc7(0x1f5),LEGACY_PARENT_SEGMENT_DIR=a32_0x246bc7(0x382);function openBrowser(_0x51c396){const _0x22e496=a32_0x246bc7,_0x1356b0=process[_0x22e496(0x2f0)],_0x33b478=_0x1356b0===_0x22e496(0x376)?'open':_0x1356b0==='win32'?_0x22e496(0x365):_0x22e496(0x3b7);spawn(_0x33b478,[_0x51c396],{'detached':!![],'stdio':_0x22e496(0x24a)})[_0x22e496(0x34d)]();}function migrateLegacyDirectory(){const _0x362008=a32_0x246bc7;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x3713b9=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x3713b9[_0x362008(0x313)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x362008(0x2e3)](a32_0x50bd38[_0x362008(0x2d1)](_0x362008(0x1ee)+LEGACY_PARENT_SEGMENT_DIR+'/\x20and\x20'+PARENT_SEGMENT_DIR+'/\x20directories\x20exist.')),console['error'](a32_0x50bd38['dim'](_0x362008(0x31d)+LEGACY_PARENT_SEGMENT_DIR+_0x362008(0x384))),![];console['error'](a32_0x50bd38[_0x362008(0x2d1)](_0x362008(0x358)+LEGACY_PARENT_SEGMENT_DIR+_0x362008(0x2b5)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console['error'](a32_0x50bd38[_0x362008(0x357)](_0x362008(0x1e4)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x4038f0){const _0x2483eb=_0x4038f0 instanceof Error?_0x4038f0['message']:String(_0x4038f0);return console['error'](a32_0x50bd38[_0x362008(0x275)]('✘\x20Failed\x20to\x20rename\x20directory:\x20'+_0x2483eb+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a32_0x246bc7(0x3e0)](_0x305f39){const _0x49300f=a32_0x246bc7;return migrateLegacyDirectory(),super[_0x49300f(0x3e0)](_0x305f39);}}function resolveYamlFile(_0x268753){const _0x2bb6e4=a32_0x246bc7;if(_0x268753['endsWith']('.yml')||_0x268753[_0x2bb6e4(0x239)](_0x2bb6e4(0x363)))return _0x268753;return a32_0x434382[_0x2bb6e4(0x290)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x268753)+'.yml');}function formatProgressMessage(_0x1d7b43){const _0x5e7498=a32_0x246bc7,_0x2c28dc=_0x1d7b43[_0x5e7498(0x3ca)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x2c28dc){const [,_0x52fe5c,_0x481ea0,_0x514973='']=_0x2c28dc;return a32_0x50bd38[_0x5e7498(0x2e2)](_0x52fe5c+':')+'\x20'+_0x481ea0+a32_0x50bd38[_0x5e7498(0x2e2)](_0x514973);}return a32_0x50bd38[_0x5e7498(0x2e2)](_0x1d7b43);}function showFileNotFoundError(_0x497595,_0x54a4cf){const _0x36c28d=a32_0x246bc7;console[_0x36c28d(0x2e3)](a32_0x50bd38['red']('Error:\x20File\x20not\x20found:\x20'+_0x497595+'\x0a')),console['error'](a32_0x50bd38[_0x36c28d(0x2ba)](_0x36c28d(0x291)+_0x54a4cf+_0x36c28d(0x32f)));}function displayRealtimeValidation(_0x338376){const _0x26f25e=a32_0x246bc7;if(!_0x338376[_0x26f25e(0x380)])return;const _0x1ef169=_0x338376[_0x26f25e(0x380)],_0x1ce33b=_0x1ef169[_0x26f25e(0x397)]?a32_0x50bd38[_0x26f25e(0x357)](_0x26f25e(0x2e6)):a32_0x50bd38[_0x26f25e(0x2d1)]('⚡\x20Not\x20enabled');console['error']('\x0a'+a32_0x50bd38[_0x26f25e(0x2e2)](_0x26f25e(0x35e))+'\x20'+_0x1ce33b);if(_0x1ef169['events']&&_0x1ef169[_0x26f25e(0x2f7)][_0x26f25e(0x204)]>0x0){console[_0x26f25e(0x2e3)]('\x20\x20'+a32_0x50bd38[_0x26f25e(0x2e2)](_0x26f25e(0x258))+'\x20'+_0x1ef169[_0x26f25e(0x2f7)]['length']+_0x26f25e(0x2d9));for(const _0x3f80ff of _0x1ef169['events']){const _0x1e9faa=_0x3f80ff['sourceTableValid']===![]?a32_0x50bd38[_0x26f25e(0x275)]('✘'):a32_0x50bd38[_0x26f25e(0x357)]('✔');console[_0x26f25e(0x2e3)](_0x26f25e(0x28a)+_0x1e9faa+'\x20'+_0x3f80ff[_0x26f25e(0x209)]),_0x3f80ff[_0x26f25e(0x307)]&&console[_0x26f25e(0x2e3)](_0x26f25e(0x24b)+a32_0x50bd38[_0x26f25e(0x275)](_0x3f80ff['sourceTableError']));}}if(_0x1ef169[_0x26f25e(0x21d)]&&_0x1ef169['attributes'][_0x26f25e(0x204)]>0x0){console['error']('\x20\x20'+a32_0x50bd38['dim'](_0x26f25e(0x29f))+'\x20'+_0x1ef169[_0x26f25e(0x21d)][_0x26f25e(0x204)]+_0x26f25e(0x2d9));for(const _0x240a5c of _0x1ef169[_0x26f25e(0x21d)]){const _0x46a5a3=_0x240a5c[_0x26f25e(0x25e)]?a32_0x50bd38['green']('✔'):a32_0x50bd38[_0x26f25e(0x275)]('✘');console[_0x26f25e(0x2e3)](_0x26f25e(0x28a)+_0x46a5a3+'\x20'+_0x240a5c['name']+'\x20'+a32_0x50bd38[_0x26f25e(0x2e2)]('('+_0x240a5c[_0x26f25e(0x381)]+')'));}}if(_0x1ef169[_0x26f25e(0x1e5)]){const _0x535ca8=_0x1ef169[_0x26f25e(0x1e5)][_0x26f25e(0x2df)]?.[_0x26f25e(0x204)]?_0x26f25e(0x36b)+_0x1ef169[_0x26f25e(0x1e5)][_0x26f25e(0x2df)][_0x26f25e(0x290)](',\x20')+']':'';console[_0x26f25e(0x2e3)]('\x20\x20'+a32_0x50bd38[_0x26f25e(0x2e2)](_0x26f25e(0x388))+'\x20'+_0x1ef169[_0x26f25e(0x1e5)][_0x26f25e(0x3cb)]+_0x535ca8);}if(_0x1ef169[_0x26f25e(0x225)]&&_0x1ef169[_0x26f25e(0x225)][_0x26f25e(0x204)]>0x0){console[_0x26f25e(0x2e3)]('\x20\x20'+a32_0x50bd38[_0x26f25e(0x2e2)](_0x26f25e(0x26d))+'\x20'+_0x1ef169[_0x26f25e(0x225)]['length']+_0x26f25e(0x1fa)+(_0x1ef169[_0x26f25e(0x225)][_0x26f25e(0x204)]!==0x1?'s':''));for(const _0x5d31a0 of _0x1ef169[_0x26f25e(0x225)]){console[_0x26f25e(0x2e3)](_0x26f25e(0x2bd)+_0x5d31a0[_0x26f25e(0x209)]);}}}function showParentSegmentNotSetError(_0x52b581){const _0x3a7649=a32_0x246bc7;console['error'](a32_0x50bd38[_0x3a7649(0x2d1)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x3a7649(0x2e3)](_0x52b581);}function a32_0x2ba9(_0x27b7c6,_0x444099){_0x27b7c6=_0x27b7c6-0x1dd;const _0x12fffe=a32_0x12ff();let _0x2ba9aa=_0x12fffe[_0x27b7c6];return _0x2ba9aa;}export class ParentSegmentListCommand extends BaseCommand{[a32_0x246bc7(0x209)]=a32_0x246bc7(0x247);[a32_0x246bc7(0x31e)]=a32_0x246bc7(0x276);async['execute'](_0x3d1c71){const _0x3c053=a32_0x246bc7,{options:_0x2c4919,args:_0x3018f1,tdx:_0x1dca6a}=_0x3d1c71,_0x3f6d8b=_0x3018f1[0x0];_0x2c4919[_0x3c053(0x327)]&&(console[_0x3c053(0x2e3)](_0x3c053(0x390)+_0x2c4919[_0x3c053(0x2eb)]),_0x3f6d8b&&console[_0x3c053(0x2e3)](_0x3c053(0x33a)+_0x3f6d8b));const _0x8ace64=await withSpinner(_0x3f6d8b?_0x3c053(0x2a4)+_0x3f6d8b+_0x3c053(0x228):_0x3c053(0x27c),()=>_0x1dca6a[_0x3c053(0x391)][_0x3c053(0x3cd)](),{'verbose':_0x2c4919[_0x3c053(0x327)]});let _0x30f579=_0x8ace64[_0x3c053(0x23b)];if(_0x3f6d8b){const _0x1431aa=_0x3f6d8b[_0x3c053(0x3d0)](/[.+^${}()|[\]\\]/g,_0x3c053(0x3ea))[_0x3c053(0x3d0)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x22a328=new RegExp('^'+_0x1431aa+'$','i');_0x30f579=_0x30f579[_0x3c053(0x28f)](_0x1558d1=>_0x22a328[_0x3c053(0x219)](_0x1558d1['attributes'][_0x3c053(0x209)]));}_0x30f579[_0x3c053(0x2a0)]((_0x177d7c,_0x47766e)=>_0x177d7c[_0x3c053(0x21d)][_0x3c053(0x209)][_0x3c053(0x1e1)](_0x47766e['attributes']['name'])),console[_0x3c053(0x2e3)](_0x3c053(0x3d7)+_0x30f579[_0x3c053(0x204)]+'\x20parent\x20segment'+(_0x30f579['length']!==0x1?'s':''));const _0x5d8f7b=_0x8471f7=>{const _0x3fdc53=_0x3c053;return getConsoleNextUrl(_0x2c4919['site'],_0x3fdc53(0x25c)+_0x8471f7);};if(_0x2c4919[_0x3c053(0x331)]===_0x3c053(0x3d1)||_0x2c4919[_0x3c053(0x331)]==='jsonl'){const _0x59065e=_0x30f579[_0x3c053(0x368)](_0x5d6000=>({..._0x5d6000,'url':_0x5d8f7b(_0x5d6000['id'])}));await handleSDKOutput(_0x59065e,_0x2c4919);}else{if(_0x30f579[_0x3c053(0x204)]===0x0)_0x3f6d8b?console['log'](_0x3c053(0x3d8)+_0x3f6d8b):console[_0x3c053(0x306)](_0x3c053(0x35d));else for(const _0x850937 of _0x30f579){const _0x4ade0d=_0x850937[_0x3c053(0x21d)][_0x3c053(0x387)]?a32_0x50bd38['dim']('\x20('+formatRows(_0x850937[_0x3c053(0x21d)][_0x3c053(0x387)])+')'):'',_0xc4f3d8=hyperlink(_0x850937[_0x3c053(0x21d)][_0x3c053(0x209)],_0x5d8f7b(_0x850937['id']));console['log']('👥\x20'+_0xc4f3d8+_0x4ade0d);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a32_0x246bc7(0x209)]='segment:parent:create';[a32_0x246bc7(0x31e)]=a32_0x246bc7(0x375);async['execute'](_0x55fac3){const _0xa46412=a32_0x246bc7,{options:_0x58e29b,args:_0x406c7a,tdx:_0x2ed501}=_0x55fac3;console[_0xa46412(0x2e3)](_0xa46412(0x226)+_0xa46412(0x2d0)+'\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a');const _0x23d14c=_0x58e29b;if(_0x406c7a[_0xa46412(0x204)]===0x0)return console[_0xa46412(0x2e3)](a32_0x50bd38[_0xa46412(0x275)](_0xa46412(0x207))),console[_0xa46412(0x2e3)]('Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>'),0x1;const _0x96349e=_0x406c7a[0x0];if(!_0x23d14c[_0xa46412(0x1e2)]||!_0x23d14c[_0xa46412(0x379)])return console[_0xa46412(0x2e3)](_0xa46412(0x213)),console[_0xa46412(0x2e3)](_0xa46412(0x3e6)),0x1;_0x23d14c[_0xa46412(0x327)]&&(console['error'](_0xa46412(0x390)+_0x23d14c[_0xa46412(0x2eb)]),console[_0xa46412(0x2e3)](_0xa46412(0x3bd)+_0x96349e),console[_0xa46412(0x2e3)](_0xa46412(0x30f)+_0x23d14c['database']),console[_0xa46412(0x2e3)](_0xa46412(0x3dd)+_0x23d14c['table']));const _0x26f6cb=await loadJSONFromOptions(_0x23d14c[_0xa46412(0x21d)],_0x23d14c['attributesFile']),_0x504527=await loadJSONFromOptions(_0x23d14c[_0xa46412(0x3df)],_0x23d14c[_0xa46412(0x308)]),_0x2ce818=await loadJSONFromOptions(_0x23d14c[_0xa46412(0x245)],_0x23d14c[_0xa46412(0x38f)]),_0x38be4e={'name':_0x96349e,'description':_0x23d14c[_0xa46412(0x31e)],'scheduleType':_0x23d14c[_0xa46412(0x286)],'scheduleOption':_0x23d14c['scheduleOption'],'timezone':_0x23d14c['timezone'],'master':{'parentDatabaseName':_0x23d14c['database'],'parentTableName':_0x23d14c[_0xa46412(0x379)]},'attributes':_0x26f6cb,'behaviors':_0x504527,'customerGroup':_0x2ce818},_0x32fe16=await withSpinner(_0xa46412(0x28e)+_0x96349e+'\x27...',()=>_0x2ed501[_0xa46412(0x391)][_0xa46412(0x260)](_0x38be4e),{'verbose':_0x58e29b[_0xa46412(0x327)]}),_0x4a8673=_0x32fe16['data'];return console['error'](_0xa46412(0x3c8)+_0x4a8673[_0xa46412(0x209)]+_0xa46412(0x3b4)+_0x4a8673['id']),await handleSDKOutput([_0x4a8673],_0x58e29b),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a32_0x246bc7(0x209)]=a32_0x246bc7(0x39f);[a32_0x246bc7(0x31e)]=a32_0x246bc7(0x1ff);async['execute'](_0x4da144){const _0x399160=a32_0x246bc7,{options:_0x51ad53,args:_0x57525a,tdx:_0x21d399}=_0x4da144;console[_0x399160(0x2e3)](_0x399160(0x233)+_0x399160(0x2d0)+_0x399160(0x27b));const _0x16d227=_0x51ad53;if(_0x57525a[_0x399160(0x204)]===0x0)return console['error'](a32_0x50bd38[_0x399160(0x275)](_0x399160(0x207))),console[_0x399160(0x2e3)](_0x399160(0x39d)),0x1;const _0xc91a79=_0x57525a[0x0];_0x16d227['verbose']&&(console[_0x399160(0x2e3)]('Site:\x20'+_0x16d227[_0x399160(0x2eb)]),console['error'](_0x399160(0x2f1)+_0xc91a79));const _0x4057ae=await withSpinner(_0x399160(0x3d2)+_0xc91a79+_0x399160(0x228),()=>_0x21d399[_0x399160(0x391)][_0x399160(0x36a)](_0xc91a79),{'verbose':_0x16d227[_0x399160(0x327)]}),_0x398f64=_0x4057ae[_0x399160(0x23b)],_0x3bd322=await loadJSONFromOptions(_0x16d227[_0x399160(0x3e1)],_0x16d227['addAttributesFile']),_0xb8b9=await loadJSONFromOptions(_0x16d227[_0x399160(0x222)],_0x16d227[_0x399160(0x234)]),_0x75f3e2={'name':_0x398f64[_0x399160(0x209)],'description':_0x16d227[_0x399160(0x31e)]!==undefined?_0x16d227['description']:_0x398f64[_0x399160(0x31e)],'scheduleType':_0x16d227['scheduleType']!==undefined?_0x16d227[_0x399160(0x286)]:_0x398f64['scheduleType'],'scheduleOption':_0x16d227[_0x399160(0x36d)]!==undefined?_0x16d227['scheduleOption']:_0x398f64[_0x399160(0x36d)],'timezone':_0x16d227['timezone']!==undefined?_0x16d227[_0x399160(0x33e)]:_0x398f64[_0x399160(0x33e)],'master':_0x398f64[_0x399160(0x215)],'attributes':_0x3bd322?[..._0x398f64[_0x399160(0x21d)]||[],..._0x3bd322]:_0x398f64['attributes'],'behaviors':_0xb8b9?[..._0x398f64[_0x399160(0x3df)]||[],..._0xb8b9]:_0x398f64[_0x399160(0x3df)],'customerGroup':_0x398f64['customerGroup']},_0x4576f9=await withSpinner('Updating\x20parent\x20segment\x20\x27'+_0xc91a79+'\x27...',()=>_0x21d399[_0x399160(0x391)][_0x399160(0x238)](_0xc91a79,_0x75f3e2),{'verbose':_0x16d227[_0x399160(0x327)]}),_0x389976=_0x4576f9[_0x399160(0x23b)];return console[_0x399160(0x2e3)](_0x399160(0x3e5)+_0x389976[_0x399160(0x209)]+'\x27'),await handleSDKOutput([_0x389976],_0x16d227),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{['name']=a32_0x246bc7(0x311);['description']=a32_0x246bc7(0x255);async['execute'](_0x11a17a){const _0x5dda1b=a32_0x246bc7,{options:_0x265b28,args:_0x44972b,tdx:_0x54aef5}=_0x11a17a,_0x78e852=_0x265b28,_0x34c8e7=_0x44972b[0x0]||_0x265b28[_0x5dda1b(0x2e4)];if(!_0x34c8e7)return showParentSegmentNotSetError(_0x5dda1b(0x3cc)+_0x5dda1b(0x265)),0x1;if(_0x78e852['use']&&_0x78e852[_0x5dda1b(0x3e3)])return console[_0x5dda1b(0x2e3)](a32_0x50bd38['red'](_0x5dda1b(0x3b6))),console['error'](a32_0x50bd38['dim'](_0x5dda1b(0x2ad))),console['error'](a32_0x50bd38['dim']('using\x20the\x20default\x20path:\x20'+PARENT_SEGMENT_DIR+'/{name}.yml\x0a')),console['error'](a32_0x50bd38[_0x5dda1b(0x2ba)](_0x5dda1b(0x229))),0x1;const _0x1ae318=_0x78e852[_0x5dda1b(0x3e3)]||a32_0x434382['join'](PARENT_SEGMENT_DIR,sanitizeFileName(_0x34c8e7)+_0x5dda1b(0x37e));_0x78e852[_0x5dda1b(0x327)]&&(console[_0x5dda1b(0x2e3)](_0x5dda1b(0x390)+_0x78e852[_0x5dda1b(0x2eb)]),console[_0x5dda1b(0x2e3)](_0x5dda1b(0x2f1)+_0x34c8e7),console[_0x5dda1b(0x2e3)](_0x5dda1b(0x33c)+_0x1ae318));const _0x477169=await withSpinner(_0x5dda1b(0x2cc)+_0x34c8e7+_0x5dda1b(0x228),()=>_0x54aef5[_0x5dda1b(0x391)][_0x5dda1b(0x1de)](_0x34c8e7),{'verbose':_0x78e852[_0x5dda1b(0x327)]}),_0x1e23f5=_0x477169[_0x5dda1b(0x23b)];if(existsSync(_0x1ae318)){const _0x2436f3=readFileSync(_0x1ae318,_0x5dda1b(0x2e5)),_0x234867=generateDiff(_0x2436f3,_0x1e23f5);if(!hasChanges(_0x234867))console[_0x5dda1b(0x2e3)](a32_0x50bd38[_0x5dda1b(0x357)]('✔')+'\x20No\x20changes\x20-\x20'+a32_0x50bd38['cyan'](_0x1ae318)+_0x5dda1b(0x37c));else{console[_0x5dda1b(0x2e3)](_0x5dda1b(0x244)+_0x1ae318+'\x27:'),console[_0x5dda1b(0x2e3)]('─'[_0x5dda1b(0x21f)](0x3c)),console[_0x5dda1b(0x2e3)](formatDiffWithColors(_0x234867)),console[_0x5dda1b(0x2e3)]('─'['repeat'](0x3c));if(!_0x78e852[_0x5dda1b(0x212)]){if(!isInteractive())return console[_0x5dda1b(0x2e3)](a32_0x50bd38[_0x5dda1b(0x275)](_0x5dda1b(0x2ef)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x5dda1b(0x2e3)](a32_0x50bd38[_0x5dda1b(0x2e2)](_0x5dda1b(0x1f4))),0x1;const _0x55bbf5=await confirmKey('Overwrite\x20\x27'+_0x1ae318+'\x27?');if(!_0x55bbf5)return console[_0x5dda1b(0x2e3)](a32_0x50bd38[_0x5dda1b(0x2d1)](_0x5dda1b(0x31a))),0x1;}writeFileSync(_0x1ae318,_0x1e23f5,_0x5dda1b(0x2e5)),console['error'](a32_0x50bd38['green']('✔')+_0x5dda1b(0x274)+a32_0x50bd38[_0x5dda1b(0x2ba)](_0x1ae318));}}else{const _0xa3c684=a32_0x434382['dirname'](_0x1ae318);!existsSync(_0xa3c684)&&mkdirSync(_0xa3c684,{'recursive':!![]}),writeFileSync(_0x1ae318,_0x1e23f5,'utf-8'),console[_0x5dda1b(0x2e3)](a32_0x50bd38[_0x5dda1b(0x357)]('✔')+_0x5dda1b(0x274)+a32_0x50bd38[_0x5dda1b(0x2ba)](_0x1ae318));}return saveSessionContext({'parent_segment':_0x34c8e7},_0x78e852['session']),console[_0x5dda1b(0x2e3)](a32_0x50bd38[_0x5dda1b(0x357)]('✔')+_0x5dda1b(0x36c)+a32_0x50bd38[_0x5dda1b(0x2e2)](_0x5dda1b(0x382))+'\x20=\x20'+a32_0x50bd38[_0x5dda1b(0x2ba)](_0x34c8e7)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a32_0x246bc7(0x209)]='segment:parent:push';['description']=a32_0x246bc7(0x319);async[a32_0x246bc7(0x246)](_0x19f7a2){const _0x14ad59=a32_0x246bc7,{options:_0x16f315,args:_0x47f777,tdx:_0xcdd5e4}=_0x19f7a2,_0x10bc80=_0x16f315,_0x5c24b8=_0x47f777[0x0]||_0x16f315[_0x14ad59(0x2e4)];if(!_0x5c24b8)return showParentSegmentNotSetError(_0x14ad59(0x350)+_0x14ad59(0x280)),0x1;const _0x4962d6=resolveYamlFile(_0x5c24b8);if(!existsSync(_0x4962d6))return showFileNotFoundError(_0x4962d6,_0x5c24b8),0x1;_0x10bc80[_0x14ad59(0x327)]&&(console[_0x14ad59(0x2e3)](_0x14ad59(0x390)+_0x10bc80[_0x14ad59(0x2eb)]),console[_0x14ad59(0x2e3)](_0x14ad59(0x34c)+_0x4962d6));let _0x4df936;try{_0x4df936=readFileSync(_0x4962d6,'utf-8');}catch(_0x35c352){const _0x5bbcc4=_0x35c352 instanceof Error?_0x35c352['message']:String(_0x35c352);return console[_0x14ad59(0x2e3)]('Error\x20reading\x20file:\x20'+_0x5bbcc4),0x1;}const _0x49cb0e=await withSpinner(_0x14ad59(0x37a),()=>_0xcdd5e4[_0x14ad59(0x391)]['pushParentYaml'](_0x4df936),{'verbose':_0x10bc80[_0x14ad59(0x327)]}),_0x5cc66a=_0x49cb0e['data'],{isNew:_0x2cad4d,name:_0x485615,hasChanges:_0x4cce2b,diffFormatted:_0x3f0eae}=_0x5cc66a;if(!_0x4cce2b)return console['error'](_0x14ad59(0x3b8)+_0x485615+_0x14ad59(0x3c5)),0x0;_0x2cad4d?console[_0x14ad59(0x2e3)](_0x14ad59(0x2b8)+_0x485615+'\x27:'):console[_0x14ad59(0x2e3)]('\x0aChanges\x20to\x20apply\x20to\x20\x27'+_0x485615+'\x27:');console['error']('─'[_0x14ad59(0x21f)](0x3c)),console[_0x14ad59(0x2e3)](_0x3f0eae),console['error']('─'[_0x14ad59(0x21f)](0x3c));const _0x31cc30=_0x2cad4d?'Create\x20parent\x20segment\x20\x27'+_0x485615+'\x27?':_0x14ad59(0x39e)+_0x485615+'\x27?';if(!_0x10bc80[_0x14ad59(0x212)]){if(!isInteractive())return console[_0x14ad59(0x2e3)](a32_0x50bd38[_0x14ad59(0x275)]('\x0aError:'),_0x14ad59(0x2ec)),console[_0x14ad59(0x2e3)](a32_0x50bd38[_0x14ad59(0x2e2)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x37e2a1=await confirmKey(_0x31cc30);if(!_0x37e2a1)return console[_0x14ad59(0x2e3)](a32_0x50bd38['yellow'](_0x14ad59(0x31a))),0x1;}const _0x2f3b13=_0x2cad4d?_0x14ad59(0x2f5):_0x14ad59(0x37d),_0x25de0a=await withSpinner(_0x2f3b13+_0x14ad59(0x312)+_0x485615+_0x14ad59(0x228),()=>_0x5cc66a[_0x14ad59(0x30d)](),{'verbose':_0x10bc80[_0x14ad59(0x327)]}),_0x2339df=_0x25de0a['data'],_0x38c950=getConsoleNextUrl(_0x10bc80['site'],_0x14ad59(0x25c)+_0x2339df['id']),_0x3613fe=_0x2cad4d?'Created':'Updated';return console[_0x14ad59(0x2e3)]('✔\x20'+_0x3613fe+_0x14ad59(0x312)+_0x2339df[_0x14ad59(0x209)]+'\x27'),console[_0x14ad59(0x2e3)]('\x20\x20'+_0x38c950),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{['name']=a32_0x246bc7(0x310);['description']='Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics';async['execute'](_0x11d182){const _0x42094b=a32_0x246bc7,{options:_0x496799,args:_0x118b8e,tdx:_0x5a65c1}=_0x11d182,_0x41768f=_0x496799,_0x3f49cb=_0x118b8e[0x0]||_0x496799['parentSegment'];if(!_0x3f49cb)return showParentSegmentNotSetError(_0x42094b(0x2f9)+_0x42094b(0x2f6)+'Options:\x0a'+'\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a'+_0x42094b(0x294)+_0x42094b(0x1e9)),0x1;const _0x4ffda2=resolveYamlFile(_0x3f49cb);if(!existsSync(_0x4ffda2))return showFileNotFoundError(_0x4ffda2,_0x3f49cb),0x1;_0x41768f[_0x42094b(0x327)]&&(console[_0x42094b(0x2e3)]('Site:\x20'+_0x41768f[_0x42094b(0x2eb)]),console[_0x42094b(0x2e3)]('YAML\x20file:\x20'+_0x4ffda2));let _0x1f11ba;try{_0x1f11ba=readFileSync(_0x4ffda2,_0x42094b(0x2e5));}catch(_0x451e44){const _0x2a0756=_0x451e44 instanceof Error?_0x451e44[_0x42094b(0x20c)]:String(_0x451e44);return console[_0x42094b(0x2e3)](_0x42094b(0x2a5)+_0x2a0756),0x1;}const _0x145e67=createCommandSpinner(a32_0x50bd38[_0x42094b(0x2e2)]('Validating\x20configuration...'),{'verbose':_0x41768f[_0x42094b(0x327)]});_0x145e67[_0x42094b(0x365)]();const _0x563378={'onProgress':_0x25e872=>{_0x145e67['text']=formatProgressMessage(_0x25e872);}};if(_0x41768f[_0x42094b(0x215)])_0x563378[_0x42094b(0x215)]=!![];if(_0x41768f['enriched'])_0x563378[_0x42094b(0x347)]=!![];_0x41768f['attribute']&&(_0x563378[_0x42094b(0x2ae)]=_0x41768f['attribute']);_0x41768f[_0x42094b(0x235)]&&(_0x563378[_0x42094b(0x235)]=_0x41768f[_0x42094b(0x235)]);if(_0x41768f[_0x42094b(0x295)])_0x563378[_0x42094b(0x295)]=_0x41768f[_0x42094b(0x295)];let _0x2d38c8;try{_0x2d38c8=await _0x5a65c1['segment'][_0x42094b(0x1e0)](_0x1f11ba,_0x563378),_0x145e67[_0x42094b(0x352)]();}catch(_0x2d1458){_0x145e67[_0x42094b(0x352)]();throw _0x2d1458;}const _0x45f77a=_0x41768f[_0x42094b(0x295)]||'-1d';return this['displayValidateResults'](_0x2d38c8,_0x563378,_0x4ffda2,_0x45f77a),_0x2d38c8['allValid']?0x0:0x1;}['displayValidateResults'](_0x3f0235,_0x20389b,_0x36d169,_0x51093e){const _0x2dcaf5=a32_0x246bc7;console['error']('\x0a'+a32_0x50bd38[_0x2dcaf5(0x316)](_0x2dcaf5(0x218))+'\x20'+_0x3f0235[_0x2dcaf5(0x209)]),console[_0x2dcaf5(0x2e3)]('═'['repeat'](0x3c)),this['displayMasterInfo'](_0x3f0235);if(typeof _0x20389b[_0x2dcaf5(0x2ae)]===_0x2dcaf5(0x1e7)){this[_0x2dcaf5(0x35f)](_0x3f0235),this[_0x2dcaf5(0x329)](_0x3f0235),this[_0x2dcaf5(0x22c)](_0x36d169,_0x51093e,_0x2dcaf5(0x2ae),_0x20389b[_0x2dcaf5(0x2ae)]);return;}if(_0x20389b[_0x2dcaf5(0x2ae)]===!![]){this['displayAttributesStats'](_0x3f0235),this[_0x2dcaf5(0x329)](_0x3f0235),this[_0x2dcaf5(0x22c)](_0x36d169,_0x51093e,_0x2dcaf5(0x21d));return;}if(typeof _0x20389b[_0x2dcaf5(0x235)]===_0x2dcaf5(0x1e7)){this[_0x2dcaf5(0x2fa)](_0x3f0235,_0x51093e),this[_0x2dcaf5(0x329)](_0x3f0235),this[_0x2dcaf5(0x22c)](_0x36d169,_0x51093e,'behavior',_0x20389b[_0x2dcaf5(0x235)]);return;}if(_0x20389b['behavior']===!![]){this[_0x2dcaf5(0x2fa)](_0x3f0235,_0x51093e),this['displaySummary'](_0x3f0235),this[_0x2dcaf5(0x22c)](_0x36d169,_0x51093e,_0x2dcaf5(0x3df));return;}this['displayAttributesStats'](_0x3f0235),this[_0x2dcaf5(0x2fa)](_0x3f0235,_0x51093e),this[_0x2dcaf5(0x3be)](_0x3f0235),this[_0x2dcaf5(0x329)](_0x3f0235),this[_0x2dcaf5(0x22c)](_0x36d169,_0x51093e,'all');}[a32_0x246bc7(0x3be)](_0x2d78c7){displayRealtimeValidation(_0x2d78c7);}[a32_0x246bc7(0x22c)](_0xbbe6e1,_0x4a5774,_0x4e43bb,_0xa648d0){const _0x4d5734=a32_0x246bc7;console[_0x4d5734(0x2e3)]('\x0a'+a32_0x50bd38[_0x4d5734(0x2e2)]('To\x20view\x20sample\x20data:'));const _0x3decb5=_0x4a5774!=='-1d'?'\x20--interval\x20'+_0x4a5774:'';if(_0x4e43bb===_0x4d5734(0x2ae)&&_0xa648d0)console['error']('\x20\x20'+a32_0x50bd38[_0x4d5734(0x2e2)]('tdx\x20ps\x20preview\x20'+_0xbbe6e1+_0x4d5734(0x377)+_0xa648d0+'\x22'+_0x3decb5));else{if(_0x4e43bb==='behavior'&&_0xa648d0)console[_0x4d5734(0x2e3)]('\x20\x20'+a32_0x50bd38[_0x4d5734(0x2e2)]('tdx\x20ps\x20preview\x20'+_0xbbe6e1+_0x4d5734(0x1f2)+_0xa648d0+'\x22'+_0x3decb5));else(_0x4e43bb===_0x4d5734(0x21d)||_0x4e43bb===_0x4d5734(0x227))&&console['error']('\x20\x20'+a32_0x50bd38[_0x4d5734(0x2e2)](_0x4d5734(0x37b)+_0xbbe6e1+_0x4d5734(0x3ee)+_0x3decb5));}(_0x4e43bb===_0x4d5734(0x3df)||_0x4e43bb===_0x4d5734(0x227))&&console[_0x4d5734(0x2e3)]('\x20\x20'+a32_0x50bd38['dim'](_0x4d5734(0x37b)+_0xbbe6e1+_0x4d5734(0x394)+_0x3decb5)),_0x4e43bb===_0x4d5734(0x227)&&console[_0x4d5734(0x2e3)]('\x20\x20'+a32_0x50bd38[_0x4d5734(0x2e2)]('tdx\x20ps\x20preview\x20'+_0xbbe6e1+_0x4d5734(0x378)+_0x3decb5));}['displayMasterInfo'](_0x27f27c){const _0x146745=a32_0x246bc7,{master:_0x1bb4cd}=_0x27f27c,_0x373c95=_0x1bb4cd[_0x146745(0x344)]?a32_0x50bd38['green']('✔'):a32_0x50bd38[_0x146745(0x275)]('✘');console[_0x146745(0x2e3)]('\x0a'+a32_0x50bd38[_0x146745(0x2e2)]('Master\x20Table')),console[_0x146745(0x2e3)](_0x373c95+'\x20'+a32_0x50bd38[_0x146745(0x316)](_0x1bb4cd[_0x146745(0x1e2)]+'.'+_0x1bb4cd[_0x146745(0x379)])),_0x1bb4cd[_0x146745(0x344)]?_0x1bb4cd[_0x146745(0x323)]!==undefined&&console[_0x146745(0x2e3)]('\x20\x20'+a32_0x50bd38[_0x146745(0x2e2)](_0x146745(0x3c3))+'\x20'+a32_0x50bd38['cyan'](formatRows(_0x1bb4cd[_0x146745(0x323)]))):console[_0x146745(0x2e3)]('\x20\x20'+a32_0x50bd38['red'](_0x146745(0x32c))+'\x20'+_0x1bb4cd[_0x146745(0x232)]);}['displayAttributesStats'](_0x1f4cca){const _0x34db13=a32_0x246bc7;if(_0x1f4cca[_0x34db13(0x21d)][_0x34db13(0x204)]===0x0)return;console[_0x34db13(0x2e3)]('\x0a'+a32_0x50bd38['dim']('Attributes'));for(const _0x3e6096 of _0x1f4cca[_0x34db13(0x21d)]){const _0x7cbdd1=_0x3e6096[_0x34db13(0x344)]?a32_0x50bd38[_0x34db13(0x357)]('✔'):a32_0x50bd38[_0x34db13(0x275)]('✘');let _0x22c3c5='';if(_0x3e6096[_0x34db13(0x344)]&&_0x3e6096['matchedCount']!==undefined&&_0x3e6096[_0x34db13(0x252)]!==undefined){const _0x164e3b=_0x3e6096['coveragePercent'][_0x34db13(0x29b)](0x1),_0x1f1f6d=_0x3e6096[_0x34db13(0x252)]>=0x50?a32_0x50bd38[_0x34db13(0x357)]:_0x3e6096[_0x34db13(0x252)]>=0x32?a32_0x50bd38[_0x34db13(0x2d1)]:a32_0x50bd38[_0x34db13(0x275)];_0x22c3c5='\x20'+a32_0x50bd38[_0x34db13(0x2e2)](_0x34db13(0x221))+'\x20'+_0x1f1f6d(_0x164e3b+'%')+'\x20('+formatRows(_0x3e6096['matchedCount'])+_0x34db13(0x288);}console['error'](_0x7cbdd1+'\x20'+a32_0x50bd38[_0x34db13(0x316)](_0x3e6096[_0x34db13(0x209)])+_0x22c3c5),console[_0x34db13(0x2e3)]('\x20\x20'+a32_0x50bd38[_0x34db13(0x2e2)](_0x34db13(0x2a7))+'\x20'+a32_0x50bd38[_0x34db13(0x316)](_0x3e6096[_0x34db13(0x1e2)]+'.'+_0x3e6096[_0x34db13(0x379)]));const _0x59ba27=_0x3e6096[_0x34db13(0x361)]===_0x3e6096[_0x34db13(0x2b0)]?a32_0x50bd38[_0x34db13(0x2e2)](_0x34db13(0x3f0))+'\x20'+_0x3e6096[_0x34db13(0x361)]:a32_0x50bd38[_0x34db13(0x2e2)](_0x34db13(0x339))+'\x20'+_0x3e6096[_0x34db13(0x361)]+_0x34db13(0x296)+_0x3e6096[_0x34db13(0x2b0)];console[_0x34db13(0x2e3)]('\x20\x20'+_0x59ba27),console[_0x34db13(0x2e3)]('\x20\x20'+a32_0x50bd38['dim']('Columns:')),this['displayColumns'](_0x3e6096[_0x34db13(0x2ac)]),!_0x3e6096[_0x34db13(0x344)]&&console['error']('\x20\x20'+a32_0x50bd38[_0x34db13(0x275)](_0x34db13(0x32c))+'\x20'+_0x3e6096[_0x34db13(0x232)]);}}['displayBehaviorsStats'](_0x556b2a,_0x16f34d){const _0x191c09=a32_0x246bc7;if(_0x556b2a[_0x191c09(0x3df)][_0x191c09(0x204)]===0x0)return;console[_0x191c09(0x2e3)]('\x0a'+a32_0x50bd38[_0x191c09(0x2e2)]('Behaviors')+'\x20'+a32_0x50bd38['dim']('('+_0x16f34d+')'));for(const _0x315232 of _0x556b2a['behaviors']){const _0x561c0d=_0x315232[_0x191c09(0x344)]?a32_0x50bd38['green']('✔'):a32_0x50bd38[_0x191c09(0x275)]('✘');let _0x371b17='';if(_0x315232['schemaValid']&&_0x315232[_0x191c09(0x38a)]!==undefined&&_0x315232['totalEvents']!==undefined){const _0x766998=_0x315232[_0x191c09(0x31f)]?.[_0x191c09(0x29b)](0x1)||'?',_0x7837fb=(_0x315232[_0x191c09(0x31f)]??0x0)>=0x32?a32_0x50bd38[_0x191c09(0x357)]:(_0x315232[_0x191c09(0x31f)]??0x0)>=0x14?a32_0x50bd38[_0x191c09(0x2d1)]:a32_0x50bd38[_0x191c09(0x275)];_0x371b17='\x20'+a32_0x50bd38[_0x191c09(0x2e2)]('Customers:')+'\x20'+_0x7837fb(formatRows(_0x315232[_0x191c09(0x38a)]))+'\x20('+_0x766998+'%)\x20'+a32_0x50bd38[_0x191c09(0x2e2)](_0x191c09(0x258))+'\x20'+a32_0x50bd38[_0x191c09(0x2ba)](formatRows(_0x315232[_0x191c09(0x267)]));}console['error'](_0x561c0d+'\x20'+a32_0x50bd38['bold'](_0x315232[_0x191c09(0x209)])+_0x371b17),console[_0x191c09(0x2e3)]('\x20\x20'+a32_0x50bd38[_0x191c09(0x2e2)](_0x191c09(0x2a7))+'\x20'+a32_0x50bd38[_0x191c09(0x316)](_0x315232[_0x191c09(0x1e2)]+'.'+_0x315232['table']));const _0x3c13f6=_0x315232[_0x191c09(0x361)]===_0x315232['foreignKey']?a32_0x50bd38[_0x191c09(0x2e2)]('Join\x20on:')+'\x20'+_0x315232['joinKey']:a32_0x50bd38[_0x191c09(0x2e2)]('Join:')+'\x20'+_0x315232[_0x191c09(0x361)]+_0x191c09(0x296)+_0x315232[_0x191c09(0x2b0)];console['error']('\x20\x20'+_0x3c13f6),console[_0x191c09(0x2e3)]('\x20\x20'+a32_0x50bd38[_0x191c09(0x2e2)]('Columns:')),this[_0x191c09(0x263)](_0x315232[_0x191c09(0x2ac)]),!_0x315232['schemaValid']&&console['error']('\x20\x20'+a32_0x50bd38[_0x191c09(0x275)](_0x191c09(0x32c))+'\x20'+_0x315232[_0x191c09(0x232)]);}}[a32_0x246bc7(0x263)](_0x420b7b){const _0x230aa2=a32_0x246bc7;for(const _0x5a0231 of _0x420b7b){_0x5a0231['label']===_0x5a0231[_0x230aa2(0x23e)]||_0x5a0231['column']==='*'?console[_0x230aa2(0x2e3)](_0x230aa2(0x2bd)+_0x5a0231[_0x230aa2(0x22a)]):console['error'](_0x230aa2(0x2bd)+_0x5a0231[_0x230aa2(0x22a)]+'\x20'+a32_0x50bd38['dim']('('+_0x5a0231[_0x230aa2(0x23e)]+')'));}}[a32_0x246bc7(0x329)](_0x5f2242){const _0x5721a0=a32_0x246bc7;console[_0x5721a0(0x2e3)]('─'[_0x5721a0(0x21f)](0x3c));if(_0x5f2242[_0x5721a0(0x320)][_0x5721a0(0x204)]>0x0){console[_0x5721a0(0x2e3)]('\x0a'+a32_0x50bd38[_0x5721a0(0x275)]('Errors:'));for(const _0x602b0 of _0x5f2242[_0x5721a0(0x320)]){console['error']('\x20\x20'+a32_0x50bd38[_0x5721a0(0x275)]('•')+'\x20'+_0x602b0);}}_0x5f2242[_0x5721a0(0x24d)]&&console['error']('\x0a'+a32_0x50bd38['green']('✔')+_0x5721a0(0x3b0));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a32_0x246bc7(0x209)]=a32_0x246bc7(0x22f);[a32_0x246bc7(0x31e)]=a32_0x246bc7(0x26a);async[a32_0x246bc7(0x246)](_0x4cbc0d){const _0xf88d39=a32_0x246bc7,{options:_0x37f693,args:_0x555a15,tdx:_0x47a891}=_0x4cbc0d,_0x3abcd6=_0x37f693,_0x582426=_0x555a15[0x0]||_0x37f693[_0xf88d39(0x2e4)];if(!_0x582426)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a'+_0xf88d39(0x2bc)+_0xf88d39(0x1df)+_0xf88d39(0x3bf)+_0xf88d39(0x3a3)+_0xf88d39(0x39c)+_0xf88d39(0x21a)+_0xf88d39(0x1e9)),0x1;if(!_0x3abcd6[_0xf88d39(0x215)]&&!_0x3abcd6[_0xf88d39(0x2ae)]&&!_0x3abcd6['behavior']&&!_0x3abcd6['enriched'])return console['error'](a32_0x50bd38['red']('Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a')),console[_0xf88d39(0x2e3)]('Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a'),console[_0xf88d39(0x2e3)](_0xf88d39(0x1f7)),console[_0xf88d39(0x2e3)](_0xf88d39(0x217)),console[_0xf88d39(0x2e3)](_0xf88d39(0x3c0)),console['error'](_0xf88d39(0x2cf)),console[_0xf88d39(0x2e3)](_0xf88d39(0x2d8)),0x1;const _0x3e4c18=resolveYamlFile(_0x582426);if(!existsSync(_0x3e4c18))return showFileNotFoundError(_0x3e4c18,_0x582426),0x1;_0x3abcd6['verbose']&&(console['error']('Site:\x20'+_0x3abcd6[_0xf88d39(0x2eb)]),console['error']('YAML\x20file:\x20'+_0x3e4c18));let _0x4f6887;try{_0x4f6887=readFileSync(_0x3e4c18,_0xf88d39(0x2e5));}catch(_0x1de69b){const _0x15afea=_0x1de69b instanceof Error?_0x1de69b['message']:String(_0x1de69b);return console[_0xf88d39(0x2e3)](_0xf88d39(0x2a5)+_0x15afea),0x1;}let _0x3ddf94;try{_0x3ddf94=parseDef(_0x4f6887);}catch(_0xc8cacb){const _0x1f99c7=_0xc8cacb instanceof Error?_0xc8cacb['message']:String(_0xc8cacb);return console[_0xf88d39(0x2e3)](a32_0x50bd38['red'](_0xf88d39(0x3f1)+_0x1f99c7)),0x1;}if(_0x3abcd6[_0xf88d39(0x2ae)]===!![]||_0x3abcd6[_0xf88d39(0x2ae)]===''){const _0x397cda=_0x3ddf94[_0xf88d39(0x21d)]?.[_0xf88d39(0x368)](_0x1881dd=>_0x1881dd[_0xf88d39(0x209)])||[];if(_0x397cda[_0xf88d39(0x204)]===0x0)console[_0xf88d39(0x2e3)](a32_0x50bd38[_0xf88d39(0x275)](_0xf88d39(0x25d)));else{console[_0xf88d39(0x2e3)](a32_0x50bd38[_0xf88d39(0x275)](_0xf88d39(0x256))),console[_0xf88d39(0x2e3)](_0xf88d39(0x22d));for(const _0x502c4f of _0x397cda){console[_0xf88d39(0x2e3)]('\x20\x20'+a32_0x50bd38[_0xf88d39(0x2ba)](_0x502c4f));}console['error'](_0xf88d39(0x26b)+_0x582426+_0xf88d39(0x377)+_0x397cda[0x0]+'\x22');}return 0x1;}if(_0x3abcd6[_0xf88d39(0x235)]===!![]||_0x3abcd6[_0xf88d39(0x235)]===''){const _0x4b9165=_0x3ddf94[_0xf88d39(0x3df)]?.[_0xf88d39(0x368)](_0x13867f=>_0x13867f['name'])||[];if(_0x4b9165[_0xf88d39(0x204)]===0x0)console['error'](a32_0x50bd38[_0xf88d39(0x275)]('Error:\x20No\x20behaviors\x20defined\x20in\x20configuration'));else{console[_0xf88d39(0x2e3)](a32_0x50bd38['red'](_0xf88d39(0x338))),console[_0xf88d39(0x2e3)](_0xf88d39(0x230));for(const _0x417620 of _0x4b9165){console['error']('\x20\x20'+a32_0x50bd38[_0xf88d39(0x2ba)](_0x417620));}console[_0xf88d39(0x2e3)]('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0x582426+_0xf88d39(0x1f2)+_0x4b9165[0x0]+'\x22');}return 0x1;}const _0x52d4b7=createCommandSpinner(a32_0x50bd38[_0xf88d39(0x2e2)](_0xf88d39(0x33b)),{'verbose':_0x3abcd6[_0xf88d39(0x327)]});_0x52d4b7[_0xf88d39(0x365)]();const _0x520c46={'onProgress':_0x18d2eb=>{_0x52d4b7['text']=formatProgressMessage(_0x18d2eb);}};if(_0x3abcd6[_0xf88d39(0x215)])_0x520c46[_0xf88d39(0x215)]=!![];if(_0x3abcd6[_0xf88d39(0x2ae)]&&typeof _0x3abcd6[_0xf88d39(0x2ae)]===_0xf88d39(0x1e7))_0x520c46['attribute']=_0x3abcd6['attribute'];if(_0x3abcd6[_0xf88d39(0x235)]&&typeof _0x3abcd6['behavior']===_0xf88d39(0x1e7))_0x520c46[_0xf88d39(0x235)]=_0x3abcd6['behavior'];if(_0x3abcd6['enriched'])_0x520c46[_0xf88d39(0x347)]=!![];if(_0x3abcd6[_0xf88d39(0x295)])_0x520c46[_0xf88d39(0x295)]=_0x3abcd6[_0xf88d39(0x295)];let _0x5c3da5;try{_0x5c3da5=await _0x47a891['segment'][_0xf88d39(0x26c)](_0x4f6887,_0x520c46),_0x52d4b7['stop']();}catch(_0x757565){_0x52d4b7['stop']();throw _0x757565;}return await this[_0xf88d39(0x3eb)](_0x5c3da5,{'master':_0x3abcd6[_0xf88d39(0x215)],'attribute':typeof _0x3abcd6[_0xf88d39(0x2ae)]===_0xf88d39(0x1e7)?_0x3abcd6[_0xf88d39(0x2ae)]:undefined,'behavior':typeof _0x3abcd6[_0xf88d39(0x235)]==='string'?_0x3abcd6[_0xf88d39(0x235)]:undefined,'enriched':_0x3abcd6[_0xf88d39(0x347)]}),_0x5c3da5[_0xf88d39(0x24d)]?0x0:0x1;}async[a32_0x246bc7(0x3eb)](_0x5945f6,_0x5d51e1){const _0x58cfe8=a32_0x246bc7;console[_0x58cfe8(0x2e3)]('\x0a'+a32_0x50bd38['bold'](_0x58cfe8(0x38c))+'\x20'+_0x5945f6['name']),console['error']('═'[_0x58cfe8(0x21f)](0x3c));if(_0x5d51e1['master']&&_0x5945f6[_0x58cfe8(0x21b)]){const _0x29591e=a32_0x50bd38[_0x58cfe8(0x2e2)](_0x58cfe8(0x297))+'\x20'+a32_0x50bd38[_0x58cfe8(0x316)](_0x5945f6[_0x58cfe8(0x215)][_0x58cfe8(0x1e2)]+'.'+_0x5945f6[_0x58cfe8(0x215)][_0x58cfe8(0x379)]);await this['displaySampleData'](_0x29591e,_0x5945f6['sampleData']);}else{if(_0x5d51e1[_0x58cfe8(0x2ae)]&&_0x5945f6[_0x58cfe8(0x21b)]){const _0x142f2c=a32_0x50bd38[_0x58cfe8(0x2e2)](_0x58cfe8(0x298))+'\x20'+a32_0x50bd38[_0x58cfe8(0x316)](_0x5d51e1[_0x58cfe8(0x2ae)]);await this['displaySampleData'](_0x142f2c,_0x5945f6[_0x58cfe8(0x21b)]);}else{if(_0x5d51e1['behavior']&&_0x5945f6[_0x58cfe8(0x21b)]){const _0x15bcb9=a32_0x50bd38[_0x58cfe8(0x2e2)](_0x58cfe8(0x2d3))+'\x20'+a32_0x50bd38['bold'](_0x5d51e1[_0x58cfe8(0x235)]);await this[_0x58cfe8(0x3d5)](_0x15bcb9,_0x5945f6['sampleData']);}else{if(_0x5d51e1[_0x58cfe8(0x347)]&&_0x5945f6[_0x58cfe8(0x21b)]){const _0x140fa9=a32_0x50bd38[_0x58cfe8(0x2e2)](_0x58cfe8(0x328))+'\x20'+a32_0x50bd38[_0x58cfe8(0x316)](_0x58cfe8(0x30b));await this[_0x58cfe8(0x3d5)](_0x140fa9,_0x5945f6[_0x58cfe8(0x21b)]);}else!_0x5945f6['sampleData']&&console[_0x58cfe8(0x2e3)](_0x58cfe8(0x371));}}}if(_0x5945f6[_0x58cfe8(0x320)][_0x58cfe8(0x204)]>0x0){console[_0x58cfe8(0x2e3)]('─'['repeat'](0x3c)),console['error']('\x0a'+a32_0x50bd38[_0x58cfe8(0x275)]('Errors:'));for(const _0x26fb4e of _0x5945f6[_0x58cfe8(0x320)]){console[_0x58cfe8(0x2e3)]('\x20\x20'+a32_0x50bd38[_0x58cfe8(0x275)]('•')+'\x20'+_0x26fb4e);}}}async[a32_0x246bc7(0x3d5)](_0x596933,_0x3445cf){const _0x369b74=a32_0x246bc7;if(_0x3445cf[_0x369b74(0x204)]===0x0){console[_0x369b74(0x2e3)]('\x0a'+_0x596933),console[_0x369b74(0x2e3)](_0x369b74(0x334));return;}console[_0x369b74(0x2e3)]('\x0a'+_0x596933);const _0x114651=Object['keys'](_0x3445cf[0x0])[_0x369b74(0x368)](_0x4d4a82=>({'name':_0x4d4a82,'type':typeof _0x3445cf[0x0][_0x4d4a82]===_0x369b74(0x2bb)?_0x369b74(0x23d):'varchar'})),_0x138121={'queryId':'preview','columns':_0x114651,'data':_0x3445cf,'stats':{'state':_0x369b74(0x3b2),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x3445cf[_0x369b74(0x204)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x3ea4b2=formatAsTable(_0x138121,_0x3445cf[_0x369b74(0x204)],!![]);await writeOutput(_0x3ea4b2,undefined,'table');}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a32_0x246bc7(0x209)]=a32_0x246bc7(0x36e);[a32_0x246bc7(0x31e)]=a32_0x246bc7(0x2da);async[a32_0x246bc7(0x246)](_0x421fe5){const _0x2b1ff5=a32_0x246bc7,{options:_0x381535,args:_0x20d4e4,tdx:_0x4a7be7}=_0x421fe5,_0x3745f5=_0x381535,_0x2524eb=_0x20d4e4[0x0]||_0x381535[_0x2b1ff5(0x2e4)];if(!_0x2524eb)return showParentSegmentNotSetError(_0x2b1ff5(0x2f4)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment'),0x1;const _0x356b73=resolveYamlFile(_0x2524eb);if(existsSync(_0x356b73)){_0x3745f5[_0x2b1ff5(0x327)]&&console[_0x2b1ff5(0x2e3)]('Found\x20YAML\x20file:\x20'+_0x356b73);let _0x5d56a6;try{_0x5d56a6=readFileSync(_0x356b73,_0x2b1ff5(0x2e5));}catch(_0x4dbfbf){const _0xa31b7c=_0x4dbfbf instanceof Error?_0x4dbfbf[_0x2b1ff5(0x20c)]:String(_0x4dbfbf);return console[_0x2b1ff5(0x2e3)](_0x2b1ff5(0x2a5)+_0xa31b7c),0x1;}const _0x3d10ca=await withSpinner(_0x2b1ff5(0x37a),()=>_0x4a7be7['segment'][_0x2b1ff5(0x29e)](_0x5d56a6),{'verbose':_0x3745f5[_0x2b1ff5(0x327)]}),_0x36f2f1=_0x3d10ca[_0x2b1ff5(0x23b)],{isNew:_0x332f30,name:_0x7631e7,hasChanges:_0x24d50f,diffFormatted:_0x13c3fb}=_0x36f2f1;if(_0x24d50f){_0x332f30?console[_0x2b1ff5(0x2e3)](_0x2b1ff5(0x2b8)+_0x7631e7+'\x27:'):console['error']('\x0aChanges\x20to\x20apply\x20to\x20\x27'+_0x7631e7+'\x27:');console['error']('─'[_0x2b1ff5(0x21f)](0x3c)),console['error'](_0x13c3fb),console[_0x2b1ff5(0x2e3)]('─'[_0x2b1ff5(0x21f)](0x3c));const _0x2c40b0=_0x332f30?_0x2b1ff5(0x2b9)+_0x7631e7+_0x2b1ff5(0x31b):_0x2b1ff5(0x39e)+_0x7631e7+_0x2b1ff5(0x31b);if(!_0x3745f5[_0x2b1ff5(0x212)]){if(!isInteractive())return console[_0x2b1ff5(0x2e3)](a32_0x50bd38[_0x2b1ff5(0x275)](_0x2b1ff5(0x2ef)),_0x2b1ff5(0x2ec)),console['error'](a32_0x50bd38[_0x2b1ff5(0x2e2)](_0x2b1ff5(0x1f4))),0x1;const _0x3d1bff=await confirmKey(_0x2c40b0);if(!_0x3d1bff)return console[_0x2b1ff5(0x2e3)](a32_0x50bd38[_0x2b1ff5(0x2d1)](_0x2b1ff5(0x31a))),0x1;}const _0x581385=_0x332f30?'Creating':_0x2b1ff5(0x37d);await withSpinner(_0x581385+_0x2b1ff5(0x312)+_0x7631e7+_0x2b1ff5(0x228),()=>_0x36f2f1[_0x2b1ff5(0x30d)](),{'verbose':_0x3745f5[_0x2b1ff5(0x327)]});const _0x2e10ce=_0x332f30?'Created':_0x2b1ff5(0x392);console[_0x2b1ff5(0x2e3)]('✔\x20'+_0x2e10ce+_0x2b1ff5(0x312)+_0x7631e7+'\x27');}else console[_0x2b1ff5(0x2e3)](_0x2b1ff5(0x3b8)+_0x7631e7+_0x2b1ff5(0x27e));}const _0x4342bf=await withSpinner(_0x2b1ff5(0x248)+_0x2524eb+_0x2b1ff5(0x228),()=>_0x4a7be7['segment'][_0x2b1ff5(0x3ef)](_0x2524eb),{'verbose':_0x3745f5['verbose']}),_0x28b18a=_0x4342bf[_0x2b1ff5(0x23b)],_0x4ed3f3=getConsoleUrl(_0x3745f5[_0x2b1ff5(0x2eb)],_0x2b1ff5(0x3a6)+_0x28b18a[_0x2b1ff5(0x299)]+_0x2b1ff5(0x1e3)+_0x28b18a[_0x2b1ff5(0x3b9)]+_0x2b1ff5(0x2db)+_0x28b18a[_0x2b1ff5(0x3aa)]);return console[_0x2b1ff5(0x2e3)](_0x2b1ff5(0x262)),console[_0x2b1ff5(0x2e3)]('\x20\x20'+a32_0x50bd38['dim'](_0x2b1ff5(0x2ee))+'\x20'+_0x28b18a[_0x2b1ff5(0x3e2)]),console[_0x2b1ff5(0x2e3)]('\x20\x20'+a32_0x50bd38[_0x2b1ff5(0x2e2)]('Status:')+'\x20'+_0x28b18a[_0x2b1ff5(0x2b4)]),console['error']('\x20\x20'+a32_0x50bd38[_0x2b1ff5(0x2e2)](_0x2b1ff5(0x342))+'\x20'+_0x28b18a[_0x2b1ff5(0x3b9)]),console[_0x2b1ff5(0x2e3)]('\x20\x20'+a32_0x50bd38[_0x2b1ff5(0x2e2)](_0x2b1ff5(0x31c))+'\x20'+_0x28b18a['workflowAttemptId']),console[_0x2b1ff5(0x2e3)]('\x20\x20'+_0x4ed3f3),console[_0x2b1ff5(0x2e3)]('\x0a'+a32_0x50bd38[_0x2b1ff5(0x2e2)](_0x2b1ff5(0x324))+_0x2b1ff5(0x337)+_0x28b18a[_0x2b1ff5(0x3aa)]+_0x2b1ff5(0x3b3)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a32_0x246bc7(0x209)]='segment:parent:fields';['description']=a32_0x246bc7(0x3a9);async[a32_0x246bc7(0x246)](_0x396ede){const _0x23e155=a32_0x246bc7,{options:_0x3a4585,args:_0x525f32,tdx:_0x5e0686}=_0x396ede,_0xb7b702=_0x525f32[0x0]||_0x3a4585[_0x23e155(0x2e4)];if(!_0xb7b702)return showParentSegmentNotSetError(_0x23e155(0x373)+_0x23e155(0x35c)),0x1;_0x3a4585[_0x23e155(0x327)]&&(console['error']('Site:\x20'+_0x3a4585[_0x23e155(0x2eb)]),console['error'](_0x23e155(0x2f1)+_0xb7b702));const _0xff0d83=await withSpinner(_0x23e155(0x293)+_0xb7b702+_0x23e155(0x228),()=>_0x5e0686[_0x23e155(0x391)][_0x23e155(0x2de)](_0xb7b702),{'verbose':_0x3a4585['verbose']}),_0x2ac075=_0xff0d83[_0x23e155(0x23b)];console[_0x23e155(0x2e3)](_0x23e155(0x3d7)+_0x2ac075['length']+_0x23e155(0x2cb)+(_0x2ac075[_0x23e155(0x204)]!==0x1?'s':''));if(_0x3a4585[_0x23e155(0x3d1)]||_0x3a4585[_0x23e155(0x348)])return await handleSDKOutput(_0x2ac075,_0x3a4585),0x0;return displayFieldsHumanReadable(_0x2ac075,_0xb7b702),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a32_0x246bc7(0x209)]=a32_0x246bc7(0x330);['description']=a32_0x246bc7(0x2a3);async[a32_0x246bc7(0x246)](_0x2edb8f){const _0x16ec51=a32_0x246bc7,{options:_0x376144,args:_0x4772dd,tdx:_0x3c4424}=_0x2edb8f,_0x368a50=_0x376144,_0x4b56cf=_0x4772dd[0x0]||_0x376144['parentSegment'];if(!_0x4b56cf)return showParentSegmentNotSetError(_0x16ec51(0x354)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a'+_0x16ec51(0x1f1)+_0x16ec51(0x302)),0x1;_0x376144[_0x16ec51(0x327)]&&(console[_0x16ec51(0x2e3)]('Site:\x20'+_0x376144[_0x16ec51(0x2eb)]),console[_0x16ec51(0x2e3)](_0x16ec51(0x2f1)+_0x4b56cf));const _0x1cb483=await withSpinner(_0x16ec51(0x2cc)+_0x4b56cf+_0x16ec51(0x228),()=>_0x3c4424['segment']['getParentFull'](_0x4b56cf),{'verbose':_0x376144[_0x16ec51(0x327)]}),_0x3a8d02=_0x1cb483['data'];if(_0x368a50[_0x16ec51(0x272)]){const _0x1b8b9c=getConsoleNextUrl(_0x368a50[_0x16ec51(0x2eb)],_0x16ec51(0x25c)+_0x3a8d02['id']);return console[_0x16ec51(0x2e3)](a32_0x50bd38[_0x16ec51(0x357)]('✔')+'\x20Opening\x20'+a32_0x50bd38['cyan'](_0x1b8b9c)),openBrowser(_0x1b8b9c),0x0;}return await handleSingleObjectOutput(_0x3a8d02,_0x376144),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{['name']=a32_0x246bc7(0x29a);['description']='Show\x20parent\x20segment\x20schema\x20(column\x20types)';async['execute'](_0x1668cb){const _0x2728b2=a32_0x246bc7,{options:_0x182a0e,args:_0x1b6687,tdx:_0x56b03d}=_0x1668cb,_0x17bca4=_0x182a0e,_0xc926e2=_0x1b6687[0x0]||_0x182a0e[_0x2728b2(0x2e4)];if(!_0xc926e2)return showParentSegmentNotSetError(_0x2728b2(0x26f)+_0x2728b2(0x231)+'Options:\x0a'+_0x2728b2(0x309)),0x1;_0x182a0e[_0x2728b2(0x327)]&&(console[_0x2728b2(0x2e3)](_0x2728b2(0x390)+_0x182a0e['site']),console[_0x2728b2(0x2e3)](_0x2728b2(0x2f1)+_0xc926e2));const _0x14a66d=await withSpinner(_0x2728b2(0x335)+_0xc926e2+_0x2728b2(0x228),()=>_0x56b03d['segment'][_0x2728b2(0x374)](_0xc926e2),{'verbose':_0x182a0e[_0x2728b2(0x327)]}),_0x5e7816=_0x14a66d['data'],_0x538997=_0x56b03d[_0x2728b2(0x391)][_0x2728b2(0x200)](_0x5e7816);if(_0x17bca4[_0x2728b2(0x3e3)]){const _0x1fc980=await this[_0x2728b2(0x2e0)](_0x1668cb,_0xc926e2,_0x5e7816,_0x538997),_0x22bda8=this[_0x2728b2(0x210)](_0x1fc980);writeFileSync(_0x17bca4[_0x2728b2(0x3e3)],_0x22bda8);const _0x3fccae=_0x1fc980['customers'][_0x2728b2(0x2ac)][_0x2728b2(0x204)]+_0x1fc980[_0x2728b2(0x3df)]['reduce']((_0x12a88c,_0x6e2531)=>_0x12a88c+_0x6e2531[_0x2728b2(0x2ac)][_0x2728b2(0x204)],0x0),_0x557779=_0x1fc980[_0x2728b2(0x3df)]['filter'](_0x5d2d3e=>_0x5d2d3e[_0x2728b2(0x2ac)][_0x2728b2(0x204)]===0x0)['length'];return console[_0x2728b2(0x306)]('Schema\x20saved\x20to\x20'+_0x17bca4[_0x2728b2(0x3e3)]),console[_0x2728b2(0x306)](_0x2728b2(0x2c2)+_0x538997),console[_0x2728b2(0x306)]('\x20\x20Tables:\x201\x20customers\x20+\x20'+_0x1fc980[_0x2728b2(0x3df)][_0x2728b2(0x204)]+_0x2728b2(0x2fb)),console['log'](_0x2728b2(0x2c7)+_0x3fccae+'\x20total'),_0x557779>0x0&&console[_0x2728b2(0x306)](_0x2728b2(0x1fc)+_0x557779+_0x2728b2(0x32e)),0x0;}console['error']('\x0a'+a32_0x50bd38[_0x2728b2(0x316)](_0x2728b2(0x2b2))+'\x20'+a32_0x50bd38['cyan'](_0x538997));const _0x3e39f2=await withSpinner('Fetching\x20customers\x20schema...',()=>_0x56b03d[_0x2728b2(0x391)][_0x2728b2(0x385)](_0x5e7816),{'verbose':_0x182a0e[_0x2728b2(0x327)]});console[_0x2728b2(0x2e3)]('\x0a'+a32_0x50bd38['bold'](_0x2728b2(0x3a2))+'\x20'+a32_0x50bd38[_0x2728b2(0x2e2)]('('+_0x538997+_0x2728b2(0x284)));const _0x5c9d71=await executeSchemaQuery(_0x3e39f2[_0x2728b2(0x23b)],_0x56b03d,_0x182a0e);await handleQueryOutput(_0x5c9d71,_0x182a0e);const _0x53b0c1=await withSpinner('Fetching\x20behavior\x20list...',()=>_0x56b03d[_0x2728b2(0x391)][_0x2728b2(0x1ed)](_0x5e7816),{'verbose':_0x182a0e[_0x2728b2(0x327)]});for(const _0x49751b of _0x53b0c1[_0x2728b2(0x23b)]){const _0x19a436=_0x2728b2(0x2bf)+_0x49751b['toLowerCase']()[_0x2728b2(0x3d0)](/\s+/g,'_'),_0x44cf13=_0x2728b2(0x20b)+_0x538997+'.'+_0x19a436;console[_0x2728b2(0x2e3)]('\x0a'+a32_0x50bd38['bold'](_0x49751b)+'\x20'+a32_0x50bd38[_0x2728b2(0x2e2)]('('+_0x538997+'.'+_0x19a436+')'));try{const _0x1aedc8=await executeSchemaQuery(_0x44cf13,_0x56b03d,_0x182a0e);await handleQueryOutput(_0x1aedc8,_0x182a0e);}catch{console['error'](a32_0x50bd38[_0x2728b2(0x2d1)](_0x2728b2(0x23f)));}}return 0x0;}async[a32_0x246bc7(0x2e0)](_0x31940a,_0x3eb22a,_0x28e9c9,_0x334531){const _0x19eb20=a32_0x246bc7,{options:_0x3a31f7,tdx:_0x31e699}=_0x31940a,_0x26ca8f=await withSpinner(_0x19eb20(0x29d),()=>_0x31e699[_0x19eb20(0x391)]['getParentSQL'](_0x28e9c9),{'verbose':_0x3a31f7[_0x19eb20(0x327)]}),_0x15df59=await executeSchemaQuery(_0x26ca8f[_0x19eb20(0x23b)],_0x31e699,_0x3a31f7),_0x40512d=_0x15df59[_0x19eb20(0x23b)][_0x19eb20(0x368)](_0x310c30=>({'name':_0x310c30[_0x19eb20(0x261)],'type':_0x310c30[_0x19eb20(0x1fe)]})),_0xf222a4=await withSpinner(_0x19eb20(0x2d4),()=>_0x31e699[_0x19eb20(0x391)][_0x19eb20(0x1ed)](_0x28e9c9),{'verbose':_0x3a31f7[_0x19eb20(0x327)]}),_0x343d61=[];for(const _0x329fce of _0xf222a4[_0x19eb20(0x23b)]){const _0x2fc913=_0x19eb20(0x2bf)+_0x329fce[_0x19eb20(0x241)]()[_0x19eb20(0x3d0)](/\s+/g,'_'),_0x5b69f0=_0x19eb20(0x20b)+_0x334531+'.'+_0x2fc913;let _0x2959a7=[];try{const _0x169a4e=await executeSchemaQuery(_0x5b69f0,_0x31e699,_0x3a31f7);_0x2959a7=_0x169a4e['data'][_0x19eb20(0x368)](_0x430213=>({'name':_0x430213[_0x19eb20(0x261)],'type':_0x430213[_0x19eb20(0x1fe)]}));}catch{}_0x343d61[_0x19eb20(0x2f2)]({'table':_0x2fc913,'columns':_0x2959a7});}return{'database':_0x334531,'parent_segment':_0x3eb22a,'parent_id':_0x28e9c9,'customers':{'table':_0x19eb20(0x3a2),'columns':_0x40512d},'behaviors':_0x343d61};}[a32_0x246bc7(0x210)](_0x2c448f){const _0x33e1ed=a32_0x246bc7,_0x6a913c=_0x4363dc=>{const _0x1bf99d=a32_0x2ba9;if(_0x4363dc['length']===0x0)return'[]';const _0x4e81a5=_0x4363dc[_0x1bf99d(0x368)](_0x41fc2f=>_0x1bf99d(0x2fe)+_0x41fc2f[_0x1bf99d(0x209)]+_0x1bf99d(0x36f)+_0x41fc2f[_0x1bf99d(0x381)]+_0x1bf99d(0x287));return'[\x0a'+_0x4e81a5['join'](',\x0a')+_0x1bf99d(0x30e);},_0x42f7ac=_0x2c448f[_0x33e1ed(0x3df)][_0x33e1ed(0x368)](_0x2f1de7=>{const _0x310f93=_0x33e1ed;return _0x310f93(0x3d4)+_0x2f1de7['table']+'\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20'+_0x6a913c(_0x2f1de7[_0x310f93(0x2ac)])[_0x310f93(0x3d0)](/^/gm,'\x20\x20')[_0x310f93(0x3c4)]()+_0x310f93(0x270);})[_0x33e1ed(0x290)](',\x0a');return _0x33e1ed(0x20f)+_0x2c448f[_0x33e1ed(0x1e2)]+_0x33e1ed(0x398)+_0x2c448f['parent_segment']+'\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22'+_0x2c448f[_0x33e1ed(0x301)]+_0x33e1ed(0x20e)+_0x2c448f['customers'][_0x33e1ed(0x379)]+'\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20'+_0x6a913c(_0x2c448f[_0x33e1ed(0x3a2)][_0x33e1ed(0x2ac)])[_0x33e1ed(0x3d0)](/^/gm,'\x20\x20')[_0x33e1ed(0x3c4)]()+_0x33e1ed(0x23c)+_0x42f7ac+_0x33e1ed(0x285);}}export class ParentSegmentSQLCommand extends BaseCommand{[a32_0x246bc7(0x209)]=a32_0x246bc7(0x3ac);[a32_0x246bc7(0x31e)]='Get\x20SQL\x20query\x20for\x20parent\x20segment';async[a32_0x246bc7(0x246)](_0xa2de19){const _0x5c0af7=a32_0x246bc7,{options:_0x20abf1,args:_0x10be83,tdx:_0x3d7ffa}=_0xa2de19,_0x258567=_0x10be83[0x0]||_0x20abf1['parentSegment'];if(!_0x258567)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'+_0x5c0af7(0x2c5)),0x1;_0x20abf1[_0x5c0af7(0x327)]&&(console[_0x5c0af7(0x2e3)](_0x5c0af7(0x390)+_0x20abf1[_0x5c0af7(0x2eb)]),console['error']('Parent\x20segment:\x20'+_0x258567));const _0x11757a=await withSpinner(_0x5c0af7(0x335)+_0x258567+_0x5c0af7(0x228),()=>_0x3d7ffa[_0x5c0af7(0x391)][_0x5c0af7(0x374)](_0x258567),{'verbose':_0x20abf1['verbose']}),_0xbf6d66=_0x11757a[_0x5c0af7(0x23b)],_0x78b1cf=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x258567+_0x5c0af7(0x228),()=>_0x3d7ffa[_0x5c0af7(0x391)][_0x5c0af7(0x385)](_0xbf6d66),{'verbose':_0x20abf1[_0x5c0af7(0x327)]}),_0x2be2e4=_0x78b1cf[_0x5c0af7(0x23b)];return _0x20abf1[_0x5c0af7(0x331)]===_0x5c0af7(0x3d1)||_0x20abf1[_0x5c0af7(0x331)]===_0x5c0af7(0x348)?await handleSDKOutput([{'sql':_0x2be2e4}],_0x20abf1):console[_0x5c0af7(0x306)](_0x2be2e4),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a32_0x246bc7(0x209)]='segment:parent:show';[a32_0x246bc7(0x31e)]='Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results';async[a32_0x246bc7(0x246)](_0x2a8c8b){const _0x53d210=a32_0x246bc7,{options:_0x476ade,args:_0x2e8b09,tdx:_0x13087d}=_0x2a8c8b,_0x4d15fb=_0x2e8b09[0x0]||_0x476ade[_0x53d210(0x2e4)];if(!_0x4d15fb)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a'+_0x53d210(0x250)),0x1;_0x476ade[_0x53d210(0x327)]&&(console[_0x53d210(0x2e3)](_0x53d210(0x390)+_0x476ade['site']),console[_0x53d210(0x2e3)]('Parent\x20segment:\x20'+_0x4d15fb));const _0x1d3ad3=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x4d15fb+'\x27...',()=>_0x13087d[_0x53d210(0x391)][_0x53d210(0x374)](_0x4d15fb),{'verbose':_0x476ade[_0x53d210(0x327)]}),_0x23dc21=_0x1d3ad3['data'],_0x29f005=await withSpinner(_0x53d210(0x2d7)+_0x4d15fb+'\x27...',()=>_0x13087d[_0x53d210(0x391)][_0x53d210(0x385)](_0x23dc21),{'verbose':_0x476ade[_0x53d210(0x327)]});let _0x138bfc=_0x29f005['data'];const _0x313efd=resolveLimit(_0x476ade[_0x53d210(0x314)],DEFAULT_DISPLAY_LIMIT),_0x480019=/\bLIMIT\s+\d+/i['test'](_0x138bfc);!_0x480019&&(_0x138bfc=_0x138bfc[_0x53d210(0x3c4)]()[_0x53d210(0x3d0)](/;+$/,''),_0x138bfc=_0x53d210(0x3ad)+_0x138bfc+_0x53d210(0x389)+_0x313efd);_0x476ade[_0x53d210(0x327)]&&console[_0x53d210(0x2e3)](_0x53d210(0x2b7)+_0x138bfc);const _0x3a6c29=await withProgressSpinner('Executing\x20parent\x20segment\x20query...',async _0x4633cd=>{const _0x4742dc=await _0x13087d['query']['execute'](_0x138bfc,{'catalog':'td','schema':'information_schema','onJobId':_0x4029b9=>{const _0x3cbbe0=a32_0x2ba9;_0x4633cd[_0x3cbbe0(0x206)](_0x4029b9);}});return _0x4742dc;},{'verbose':_0x476ade[_0x53d210(0x327)]}),_0x5386f3=_0x3a6c29['data'],_0x4c4dac=_0x5386f3['jobId']?'\x20[Job\x20ID:\x20'+_0x5386f3['jobId']+']':'';return console[_0x53d210(0x2e3)](_0x53d210(0x33f)+_0x5386f3['stats'][_0x53d210(0x2be)][_0x53d210(0x333)]()+_0x53d210(0x3da)+(_0x53d210(0x3a0)+formatElapsed(_0x5386f3[_0x53d210(0x2c9)][_0x53d210(0x2fc)])+_0x4c4dac)),await handleQueryOutput(_0x5386f3,_0x476ade),0x0;}}export class PSRtListCommand extends BaseCommand{[a32_0x246bc7(0x209)]='ps:rt:list';[a32_0x246bc7(0x31e)]='List\x20parent\x20segments\x20with\x20RT\x202.0\x20status';async[a32_0x246bc7(0x246)](_0x28c51d){const _0x578fcb=a32_0x246bc7,{options:_0x1f48fb,args:_0x370329,tdx:_0x1962ee}=_0x28c51d,_0xe5b78=_0x370329[0x0],_0xb49494=await withSpinner(_0xe5b78?_0x578fcb(0x3d9)+_0xe5b78+_0x578fcb(0x228):_0x578fcb(0x3a8),()=>_0x1962ee[_0x578fcb(0x380)][_0x578fcb(0x3ab)](),{'verbose':_0x1f48fb['verbose']});let _0x268266=_0xb49494['data']['filter'](_0x3a378d=>_0x3a378d['realtime_enabled']);if(_0xe5b78){const _0x2feec3=_0xe5b78[_0x578fcb(0x3d0)](/[.+^${}()|[\]\\]/g,_0x578fcb(0x3ea))[_0x578fcb(0x3d0)](/\*/g,'.*')[_0x578fcb(0x3d0)](/\?/g,'.'),_0x20c1c1=new RegExp('^'+_0x2feec3+'$','i');_0x268266=_0x268266[_0x578fcb(0x28f)](_0x6dc78a=>_0x20c1c1[_0x578fcb(0x219)](_0x6dc78a[_0x578fcb(0x209)]));}_0x268266[_0x578fcb(0x2a0)]((_0x5228d9,_0x8b72f1)=>_0x5228d9[_0x578fcb(0x209)][_0x578fcb(0x1e1)](_0x8b72f1['name'])),console[_0x578fcb(0x2e3)](_0x578fcb(0x3d7)+_0x268266[_0x578fcb(0x204)]+_0x578fcb(0x2cd)+(_0x268266['length']!==0x1?'s':''));const _0x31cf87=_0x4bea63=>{const _0x3ed1dc=_0x578fcb;return getConsoleNextUrl(_0x1f48fb[_0x3ed1dc(0x2eb)],_0x3ed1dc(0x25c)+_0x4bea63);};if(_0x1f48fb[_0x578fcb(0x331)]==='json'||_0x1f48fb[_0x578fcb(0x331)]===_0x578fcb(0x348)){const _0x1532e5=_0x268266[_0x578fcb(0x368)](_0x5dd40d=>({..._0x5dd40d,'url':_0x31cf87(_0x5dd40d['id'])}));await handleSDKOutput(_0x1532e5,_0x1f48fb);}else{if(_0x268266[_0x578fcb(0x204)]===0x0)console[_0x578fcb(0x306)](_0x578fcb(0x30c));else for(const _0x539d37 of _0x268266){const _0x30e80e=_0x539d37['population']?a32_0x50bd38['dim']('\x20('+formatRows(_0x539d37[_0x578fcb(0x387)])+')'):'',_0x5a1138=hyperlink(_0x539d37[_0x578fcb(0x209)],_0x31cf87(_0x539d37['id']));console[_0x578fcb(0x306)]('⚡\x20'+_0x5a1138+_0x30e80e);}}return 0x0;}}export class PSRtValidateCommand extends BaseParentSegmentCommand{[a32_0x246bc7(0x209)]=a32_0x246bc7(0x34a);[a32_0x246bc7(0x31e)]=a32_0x246bc7(0x28b);async[a32_0x246bc7(0x246)](_0x30514e){const _0x4499c5=a32_0x246bc7,{options:_0x54a936,args:_0x1c7d41,tdx:_0x530cda}=_0x30514e,_0xf448ad=_0x1c7d41[0x0]||_0x54a936['parentSegment'];if(!_0xf448ad)return showParentSegmentNotSetError(_0x4499c5(0x3d3)+_0x4499c5(0x1f3)),0x1;const _0x376a65=resolveYamlFile(_0xf448ad);if(!existsSync(_0x376a65))return showFileNotFoundError(_0x376a65,_0xf448ad),0x1;let _0x47f129;try{_0x47f129=readFileSync(_0x376a65,'utf-8');}catch(_0x571c2c){const _0x4760f8=_0x571c2c instanceof Error?_0x571c2c['message']:String(_0x571c2c);return console[_0x4499c5(0x2e3)](_0x4499c5(0x2a5)+_0x4760f8),0x1;}const _0x6914a4=createCommandSpinner(a32_0x50bd38['dim'](_0x4499c5(0x22b)),{'verbose':_0x54a936['verbose']});_0x6914a4[_0x4499c5(0x365)]();const _0x29110c={'realtime':!![],'onProgress':_0x3b9a79=>{const _0x33df59=_0x4499c5;_0x6914a4[_0x33df59(0x321)]=formatProgressMessage(_0x3b9a79);}};let _0x3a0ca4;try{_0x3a0ca4=await _0x530cda[_0x4499c5(0x391)][_0x4499c5(0x1e0)](_0x47f129,_0x29110c),_0x6914a4[_0x4499c5(0x352)]();}catch(_0x4e8864){_0x6914a4[_0x4499c5(0x352)]();throw _0x4e8864;}console[_0x4499c5(0x2e3)]('\x0a'+a32_0x50bd38[_0x4499c5(0x316)](_0x4499c5(0x279))+'\x20'+_0x3a0ca4[_0x4499c5(0x209)]),console[_0x4499c5(0x2e3)]('═'['repeat'](0x3c)),displayRealtimeValidation(_0x3a0ca4),console[_0x4499c5(0x2e3)]('─'['repeat'](0x3c));if(_0x3a0ca4[_0x4499c5(0x320)][_0x4499c5(0x204)]>0x0){console[_0x4499c5(0x2e3)]('\x0a'+a32_0x50bd38[_0x4499c5(0x275)]('Errors:'));for(const _0x530be2 of _0x3a0ca4[_0x4499c5(0x320)]){console[_0x4499c5(0x2e3)]('\x20\x20'+a32_0x50bd38['red']('•')+'\x20'+_0x530be2);}}return _0x3a0ca4[_0x4499c5(0x24d)]&&console[_0x4499c5(0x2e3)]('\x0a'+a32_0x50bd38['green']('✔')+_0x4499c5(0x370)),_0x3a0ca4[_0x4499c5(0x24d)]?0x0:0x1;}}export class PSRtJnListCommand extends BaseCommand{[a32_0x246bc7(0x209)]='ps:rt:jn:list';[a32_0x246bc7(0x31e)]=a32_0x246bc7(0x346);async[a32_0x246bc7(0x246)](_0x2f84ed){const _0x482f68=a32_0x246bc7,{options:_0x2fdbde,args:_0x193618,tdx:_0x93b9d1}=_0x2f84ed,_0x11bb92=_0x193618[0x0]||_0x2fdbde['parentSegment'];if(!_0x11bb92)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'+_0x482f68(0x326)),0x1;_0x2fdbde[_0x482f68(0x327)]&&(console[_0x482f68(0x2e3)](_0x482f68(0x390)+_0x2fdbde[_0x482f68(0x2eb)]),console[_0x482f68(0x2e3)](_0x482f68(0x2f1)+_0x11bb92));const _0x7b54e1=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x11bb92+'\x27...',()=>_0x93b9d1['segment'][_0x482f68(0x374)](_0x11bb92),{'verbose':_0x2fdbde[_0x482f68(0x327)]}),_0x340806=_0x7b54e1[_0x482f68(0x23b)],_0x343880=await withSpinner(_0x482f68(0x3ec)+_0x11bb92+'\x27...',()=>_0x93b9d1[_0x482f68(0x380)][_0x482f68(0x269)](_0x340806),{'verbose':_0x2fdbde[_0x482f68(0x327)]}),_0x227a61=_0x343880[_0x482f68(0x23b)];console['error']('✔\x20Found\x20'+_0x227a61[_0x482f68(0x204)]+_0x482f68(0x224)+(_0x227a61['length']!==0x1?'s':''));if(_0x2fdbde[_0x482f68(0x331)]===_0x482f68(0x3d1)||_0x2fdbde['format']===_0x482f68(0x348))await handleSDKOutput(_0x227a61,_0x2fdbde);else{if(_0x227a61[_0x482f68(0x204)]===0x0)console['log']('No\x20RT\x20journeys\x20found');else for(const _0x581f45 of _0x227a61){const _0x9b1510=_0x581f45['state']==='launched'?'🚀':'📝',_0x367175=_0x581f45[_0x482f68(0x39a)]?a32_0x50bd38[_0x482f68(0x2d1)]('\x20(paused)'):'',_0x18715f=a32_0x50bd38['dim']('\x20('+_0x581f45[_0x482f68(0x359)]+_0x482f68(0x23a)+(_0x581f45[_0x482f68(0x359)]!==0x1?'s':'')+')');console[_0x482f68(0x306)](_0x9b1510+'\x20'+_0x581f45['name']+_0x367175+_0x18715f);}}return 0x0;}}export class PSRtJnPauseCommand extends BaseCommand{[a32_0x246bc7(0x209)]='ps:rt:jn:pause';[a32_0x246bc7(0x31e)]=a32_0x246bc7(0x20a);async['execute'](_0x2c856e){const _0x3b973f=a32_0x246bc7,{options:_0x1e8a50,args:_0x3c1470,tdx:_0x39eddc}=_0x2c856e,_0x7fc6a0=_0x3c1470[0x0];if(!_0x7fc6a0)return console[_0x3b973f(0x2e3)](a32_0x50bd38[_0x3b973f(0x275)](_0x3b973f(0x21c))),console[_0x3b973f(0x2e3)](_0x3b973f(0x396)),console['error'](a32_0x50bd38[_0x3b973f(0x2e2)](_0x3b973f(0x2a1))),0x1;_0x1e8a50[_0x3b973f(0x327)]&&(console[_0x3b973f(0x2e3)](_0x3b973f(0x390)+_0x1e8a50[_0x3b973f(0x2eb)]),console[_0x3b973f(0x2e3)]('RT\x20Journey\x20ID:\x20'+_0x7fc6a0));const _0x5e0c2f=await withSpinner(_0x3b973f(0x38e)+_0x7fc6a0+_0x3b973f(0x228),()=>_0x39eddc[_0x3b973f(0x380)][_0x3b973f(0x1ef)](_0x7fc6a0),{'verbose':_0x1e8a50[_0x3b973f(0x327)]}),_0x5a9c36=_0x5e0c2f[_0x3b973f(0x23b)];console[_0x3b973f(0x2e3)](_0x3b973f(0x3b1)+_0x5a9c36[_0x3b973f(0x209)]+'\x27');if(_0x1e8a50[_0x3b973f(0x331)]==='json'||_0x1e8a50['format']===_0x3b973f(0x348))await handleSDKOutput([_0x5a9c36],_0x1e8a50);else{const _0x34d757=_0x5a9c36[_0x3b973f(0x369)]===_0x3b973f(0x37f)?'🚀':'📝',_0x1f66f3=_0x5a9c36[_0x3b973f(0x39a)]?a32_0x50bd38[_0x3b973f(0x2d1)](_0x3b973f(0x2ed)):'';console[_0x3b973f(0x306)](_0x34d757+'\x20'+_0x5a9c36[_0x3b973f(0x209)]+_0x1f66f3);}return 0x0;}}export class PSRtJnResumeCommand extends BaseCommand{[a32_0x246bc7(0x209)]='ps:rt:jn:resume';[a32_0x246bc7(0x31e)]=a32_0x246bc7(0x264);async['execute'](_0x56519a){const _0x5d9b53=a32_0x246bc7,{options:_0x45f9a3,args:_0x123224,tdx:_0x40a5f0}=_0x56519a,_0x2a41f0=_0x123224[0x0];if(!_0x2a41f0)return console['error'](a32_0x50bd38[_0x5d9b53(0x275)]('Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a')),console[_0x5d9b53(0x2e3)](_0x5d9b53(0x300)),console['error'](a32_0x50bd38[_0x5d9b53(0x2e2)]('Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs')),0x1;_0x45f9a3[_0x5d9b53(0x327)]&&(console[_0x5d9b53(0x2e3)](_0x5d9b53(0x390)+_0x45f9a3[_0x5d9b53(0x2eb)]),console['error'](_0x5d9b53(0x2f8)+_0x2a41f0));const _0xb17265=await withSpinner('Resuming\x20activations\x20for\x20RT\x20journey\x20\x27'+_0x2a41f0+_0x5d9b53(0x228),()=>_0x40a5f0[_0x5d9b53(0x380)][_0x5d9b53(0x251)](_0x2a41f0),{'verbose':_0x45f9a3['verbose']}),_0x242fbf=_0xb17265[_0x5d9b53(0x23b)];console[_0x5d9b53(0x2e3)](_0x5d9b53(0x211)+_0x242fbf[_0x5d9b53(0x209)]+'\x27');if(_0x45f9a3[_0x5d9b53(0x331)]===_0x5d9b53(0x3d1)||_0x45f9a3[_0x5d9b53(0x331)]==='jsonl')await handleSDKOutput([_0x242fbf],_0x45f9a3);else{const _0x4878b7=_0x242fbf[_0x5d9b53(0x369)]===_0x5d9b53(0x37f)?'🚀':'📝',_0x161f36=_0x242fbf[_0x5d9b53(0x39a)]?a32_0x50bd38[_0x5d9b53(0x2d1)](_0x5d9b53(0x2ed)):'';console['log'](_0x4878b7+'\x20'+_0x242fbf[_0x5d9b53(0x209)]+_0x161f36);}return 0x0;}}export class PSRtConfigVersionCommand extends BaseCommand{['name']='ps:rt:configuration_versions';[a32_0x246bc7(0x31e)]='Get\x20current\x20RT\x20configuration\x20version\x20status';async[a32_0x246bc7(0x246)](_0x40f0a6){const _0x124d24=a32_0x246bc7,{options:_0x1f0fda,args:_0x139384,tdx:_0x1f30cf}=_0x40f0a6,_0x1321db=_0x139384[0x0]||_0x1f0fda[_0x124d24(0x2e4)];if(!_0x1321db)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'+_0x124d24(0x253)),0x1;_0x1f0fda[_0x124d24(0x327)]&&(console[_0x124d24(0x2e3)](_0x124d24(0x390)+_0x1f0fda['site']),console[_0x124d24(0x2e3)](_0x124d24(0x2f1)+_0x1321db));const _0x1b2230=await withSpinner(_0x124d24(0x335)+_0x1321db+_0x124d24(0x228),()=>_0x1f30cf['segment'][_0x124d24(0x374)](_0x1321db),{'verbose':_0x1f0fda[_0x124d24(0x327)]}),_0xfd4767=_0x1b2230[_0x124d24(0x23b)],_0x124f50=await withSpinner('Getting\x20RT\x20configuration\x20version\x20for\x20\x27'+_0x1321db+_0x124d24(0x228),()=>_0x1f30cf[_0x124d24(0x380)][_0x124d24(0x32d)](_0xfd4767),{'verbose':_0x1f0fda[_0x124d24(0x327)]}),_0x12c2b2=_0x124f50[_0x124d24(0x23b)];return console[_0x124d24(0x2e3)](_0x124d24(0x34b)),_0x1f0fda[_0x124d24(0x331)]===_0x124d24(0x3d1)||_0x1f0fda[_0x124d24(0x331)]===_0x124d24(0x348)?await handleSDKOutput([_0x12c2b2],_0x1f0fda):(console[_0x124d24(0x306)](_0x124d24(0x2c4)+_0x12c2b2['id']),console[_0x124d24(0x306)](_0x124d24(0x271)+_0x12c2b2[_0x124d24(0x3e2)]),console[_0x124d24(0x306)](_0x124d24(0x28c)+_0x12c2b2[_0x124d24(0x367)]),console[_0x124d24(0x306)](_0x124d24(0x25b)+_0x12c2b2[_0x124d24(0x27f)]),console['log'](_0x124d24(0x2a6)+_0x12c2b2[_0x124d24(0x2b4)])),0x0;}}export class PSPzServiceListCommand extends BaseCommand{[a32_0x246bc7(0x209)]=a32_0x246bc7(0x2e8);[a32_0x246bc7(0x31e)]=a32_0x246bc7(0x35b);async['execute'](_0x1d22c5){const _0x1b2439=a32_0x246bc7,{options:_0x34cac3,args:_0x5e2f7d,tdx:_0x252d5e}=_0x1d22c5,_0x3dbf32=_0x5e2f7d[0x0]||_0x34cac3['parentSegment'];if(!_0x3dbf32)return showParentSegmentNotSetError(_0x1b2439(0x3e8)+_0x1b2439(0x2a9)),0x1;const _0x10729d=await withSpinner(_0x1b2439(0x335)+_0x3dbf32+_0x1b2439(0x228),()=>_0x252d5e[_0x1b2439(0x391)][_0x1b2439(0x374)](_0x3dbf32),{'verbose':_0x34cac3[_0x1b2439(0x327)]}),_0x3eaf25=_0x10729d['data'],_0x56afe8=await withSpinner(_0x1b2439(0x3a1)+_0x3dbf32+_0x1b2439(0x228),()=>_0x252d5e['personalization'][_0x1b2439(0x3ab)](_0x3eaf25),{'verbose':_0x34cac3[_0x1b2439(0x327)]}),_0x2a0c8a=_0x56afe8[_0x1b2439(0x23b)];console[_0x1b2439(0x2e3)]('✔\x20Found\x20'+_0x2a0c8a['length']+'\x20personalization\x20service'+(_0x2a0c8a[_0x1b2439(0x204)]!==0x1?'s':''));if(_0x34cac3[_0x1b2439(0x331)]===_0x1b2439(0x3d1)||_0x34cac3[_0x1b2439(0x331)]===_0x1b2439(0x348))await handleSDKOutput(_0x2a0c8a,_0x34cac3);else{if(_0x2a0c8a[_0x1b2439(0x204)]===0x0)console[_0x1b2439(0x306)](_0x1b2439(0x1eb)),console['error'](a32_0x50bd38['cyan'](_0x1b2439(0x2f3)));else for(const _0x4a05ab of _0x2a0c8a){console['log'](a32_0x50bd38['bold'](_0x4a05ab[_0x1b2439(0x209)])+'\x20'+a32_0x50bd38[_0x1b2439(0x2e2)](_0x1b2439(0x2af)+_0x4a05ab['id']+')'));_0x4a05ab[_0x1b2439(0x31e)]&&console[_0x1b2439(0x306)]('\x20\x20'+a32_0x50bd38[_0x1b2439(0x2e2)](_0x4a05ab[_0x1b2439(0x31e)]));if(_0x4a05ab['tokens']&&_0x4a05ab[_0x1b2439(0x220)]['length']>0x0)for(const _0x33bf92 of _0x4a05ab[_0x1b2439(0x220)]){const _0x1cc37c=_0x33bf92[_0x1b2439(0x249)]?.[_0x1b2439(0x204)]?_0x33bf92[_0x1b2439(0x249)][_0x1b2439(0x290)](',\x20'):_0x1b2439(0x332);console[_0x1b2439(0x306)]('\x20\x20'+a32_0x50bd38[_0x1b2439(0x2ba)](_0x1b2439(0x2b3))+'\x20'+_0x33bf92[_0x1b2439(0x209)]+'\x20'+a32_0x50bd38[_0x1b2439(0x2e2)]('(id:\x20'+_0x33bf92['id']+')')),console[_0x1b2439(0x306)]('\x20\x20\x20\x20'+a32_0x50bd38[_0x1b2439(0x2e2)](_0x1b2439(0x1ea))+'\x20'+_0x1cc37c);}else console[_0x1b2439(0x306)]('\x20\x20'+a32_0x50bd38[_0x1b2439(0x2e2)](_0x1b2439(0x223)));}}return 0x0;}}export class PSPzServiceCreateCommand extends BaseCommand{[a32_0x246bc7(0x209)]=a32_0x246bc7(0x34e);[a32_0x246bc7(0x31e)]=a32_0x246bc7(0x1ec);async[a32_0x246bc7(0x246)](_0x218990){const _0x318292=a32_0x246bc7,{options:_0x284506,args:_0xa0316f,tdx:_0x554bec}=_0x218990,_0x480c8a=_0x284506,_0xbcf199=_0xa0316f[0x0],_0x433ffe=_0xa0316f[0x1]||_0x284506['parentSegment'];if(!_0xbcf199)return console[_0x318292(0x2e3)](_0x318292(0x3e9)),console[_0x318292(0x2e3)](_0x318292(0x3bc)),console[_0x318292(0x2e3)](_0x318292(0x2ce)),0x1;if(!_0x433ffe)return showParentSegmentNotSetError(_0x318292(0x243)+_0x318292(0x2ce)),0x1;const _0x589d80=await withSpinner(_0x318292(0x335)+_0x433ffe+_0x318292(0x228),()=>_0x554bec[_0x318292(0x391)][_0x318292(0x374)](_0x433ffe),{'verbose':_0x284506[_0x318292(0x327)]}),_0x5f0a09=_0x589d80[_0x318292(0x23b)],_0x440006={'name':_0xbcf199,'description':_0x480c8a[_0x318292(0x31e)],'public':_0x480c8a[_0x318292(0x372)]},_0x4de91c=await withSpinner(_0x318292(0x28d)+_0xbcf199+_0x318292(0x228),()=>_0x554bec[_0x318292(0x349)][_0x318292(0x340)](_0x5f0a09,_0x440006),{'verbose':_0x284506[_0x318292(0x327)]}),_0x1d0145=_0x4de91c[_0x318292(0x23b)];return console[_0x318292(0x2e3)]('✔\x20Created\x20personalization\x20service\x20\x27'+_0x1d0145[_0x318292(0x209)]+_0x318292(0x3b4)+_0x1d0145['id']),await handleSDKOutput([_0x1d0145],_0x284506),0x0;}}export class PSPzServiceShowCommand extends BaseCommand{[a32_0x246bc7(0x209)]=a32_0x246bc7(0x32a);['description']='Show\x20personalization\x20service\x20details';async[a32_0x246bc7(0x246)](_0x1fe737){const _0x1458f6=a32_0x246bc7,{options:_0x279a88,args:_0x2ed4a7,tdx:_0x2a3328}=_0x1fe737,_0x2fc9eb=_0x2ed4a7[0x0],_0x51b8f1=_0x2ed4a7[0x1]||_0x279a88[_0x1458f6(0x2e4)];if(!_0x2fc9eb)return console[_0x1458f6(0x2e3)](_0x1458f6(0x3e7)),console[_0x1458f6(0x2e3)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]'),console['error'](_0x1458f6(0x360)),0x1;if(!_0x51b8f1)return showParentSegmentNotSetError(_0x1458f6(0x266)+_0x1458f6(0x360)),0x1;const _0x322238=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x51b8f1+_0x1458f6(0x228),()=>_0x2a3328[_0x1458f6(0x391)][_0x1458f6(0x374)](_0x51b8f1),{'verbose':_0x279a88[_0x1458f6(0x327)]}),_0x2ddd3b=_0x322238['data'],_0x5eb3f7=await withSpinner(_0x1458f6(0x3a7)+_0x2fc9eb+_0x1458f6(0x228),()=>_0x2a3328['personalization'][_0x1458f6(0x2a2)](_0x2ddd3b,_0x2fc9eb),{'verbose':_0x279a88[_0x1458f6(0x327)]}),_0x1b78b7=_0x5eb3f7[_0x1458f6(0x23b)];if(_0x279a88['json']||_0x279a88[_0x1458f6(0x348)])await handleSDKOutput([_0x1b78b7],_0x279a88);else{console[_0x1458f6(0x306)](a32_0x50bd38[_0x1458f6(0x316)](_0x1b78b7[_0x1458f6(0x209)])+'\x20'+a32_0x50bd38[_0x1458f6(0x2e2)](_0x1458f6(0x2af)+_0x1b78b7['id']+')'));_0x1b78b7[_0x1458f6(0x31e)]&&console[_0x1458f6(0x306)]('\x20\x20'+a32_0x50bd38[_0x1458f6(0x2e2)](_0x1b78b7[_0x1458f6(0x31e)]));console['log']('\x20\x20'+a32_0x50bd38[_0x1458f6(0x2ba)](_0x1458f6(0x2b6))+'\x20'+(_0x1b78b7[_0x1458f6(0x372)]?_0x1458f6(0x212):'no'));if(_0x1b78b7['tokens']&&_0x1b78b7[_0x1458f6(0x220)][_0x1458f6(0x204)]>0x0)for(const _0x6ad24f of _0x1b78b7[_0x1458f6(0x220)]){const _0x46fdca=_0x6ad24f[_0x1458f6(0x249)]?.['length']?_0x6ad24f[_0x1458f6(0x249)][_0x1458f6(0x290)](',\x20'):_0x1458f6(0x332);console[_0x1458f6(0x306)]('\x20\x20'+a32_0x50bd38[_0x1458f6(0x2ba)](_0x1458f6(0x2b3))+'\x20'+_0x6ad24f['name']+'\x20'+a32_0x50bd38['dim'](_0x1458f6(0x2af)+_0x6ad24f['id']+')')),console[_0x1458f6(0x306)](_0x1458f6(0x28a)+a32_0x50bd38[_0x1458f6(0x2e2)](_0x1458f6(0x1ea))+'\x20'+_0x46fdca);}else console[_0x1458f6(0x306)]('\x20\x20'+a32_0x50bd38[_0x1458f6(0x2e2)](_0x1458f6(0x223)));}return 0x0;}}export class PSPzServiceDeleteCommand extends BaseCommand{[a32_0x246bc7(0x209)]='ps:pz:service:delete';['description']=a32_0x246bc7(0x254);async['execute'](_0x2abf75){const _0x63cf5e=a32_0x246bc7,{options:_0x36698e,args:_0x1010db,tdx:_0x225aa0}=_0x2abf75,_0x576b65=_0x1010db[0x0],_0x4738cd=_0x1010db[0x1]||_0x36698e[_0x63cf5e(0x2e4)];if(!_0x576b65)return console[_0x63cf5e(0x2e3)](_0x63cf5e(0x3e7)),console[_0x63cf5e(0x2e3)](_0x63cf5e(0x2b1)),console[_0x63cf5e(0x2e3)](_0x63cf5e(0x1dd)),0x1;if(!_0x4738cd)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;const _0x100d00=await withSpinner(_0x63cf5e(0x335)+_0x4738cd+_0x63cf5e(0x228),()=>_0x225aa0[_0x63cf5e(0x391)]['resolveParentId'](_0x4738cd),{'verbose':_0x36698e['verbose']}),_0x48005e=_0x100d00[_0x63cf5e(0x23b)];return await withSpinner(_0x63cf5e(0x2c0)+_0x576b65+_0x63cf5e(0x228),()=>_0x225aa0[_0x63cf5e(0x349)][_0x63cf5e(0x257)](_0x48005e,_0x576b65),{'verbose':_0x36698e[_0x63cf5e(0x327)]}),console[_0x63cf5e(0x2e3)](_0x63cf5e(0x303)+_0x576b65+'\x27'),0x0;}}export class PSPzServiceUpdateCommand extends BaseCommand{[a32_0x246bc7(0x209)]=a32_0x246bc7(0x362);['description']=a32_0x246bc7(0x29c);async[a32_0x246bc7(0x246)](_0xd14bc7){const _0x50001d=a32_0x246bc7,{options:_0x2cdf0a,args:_0x452074,tdx:_0x38582c}=_0xd14bc7,_0x5c3b44=_0x2cdf0a,_0x194424=_0x452074[0x0],_0xa62894=_0x452074[0x1]||_0x2cdf0a['parentSegment'];if(!_0x194424)return console[_0x50001d(0x2e3)](_0x50001d(0x3e7)),console[_0x50001d(0x2e3)](_0x50001d(0x273)),console[_0x50001d(0x2e3)](_0x50001d(0x1f9)),0x1;if(!_0x5c3b44[_0x50001d(0x209)])return console[_0x50001d(0x2e3)](_0x50001d(0x2c8)),console[_0x50001d(0x2e3)](_0x50001d(0x273)),0x1;if(!_0xa62894)return showParentSegmentNotSetError(_0x50001d(0x208)+_0x50001d(0x1f9)),0x1;const _0x49846e=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0xa62894+'\x27...',()=>_0x38582c[_0x50001d(0x391)][_0x50001d(0x374)](_0xa62894),{'verbose':_0x2cdf0a[_0x50001d(0x327)]}),_0x1227be=_0x49846e[_0x50001d(0x23b)],_0x1f79cc={'name':_0x5c3b44[_0x50001d(0x209)]};_0x5c3b44['description']!==undefined&&(_0x1f79cc[_0x50001d(0x31e)]=_0x5c3b44[_0x50001d(0x31e)]);const _0x1ae2c5=await withSpinner(_0x50001d(0x356)+_0x194424+'\x27...',()=>_0x38582c['personalization'][_0x50001d(0x203)](_0x1227be,_0x194424,_0x1f79cc),{'verbose':_0x2cdf0a['verbose']}),_0x25b4b1=_0x1ae2c5[_0x50001d(0x23b)];return console['error'](_0x50001d(0x1f0)+_0x25b4b1[_0x50001d(0x209)]+'\x27'),await handleSDKOutput([_0x25b4b1],_0x2cdf0a),0x0;}}export class PSPzServiceTokenCreateCommand extends BaseCommand{[a32_0x246bc7(0x209)]='ps:pz:service:token:create';[a32_0x246bc7(0x31e)]=a32_0x246bc7(0x25a);async['execute'](_0x5c4f5a){const _0x591e0a=a32_0x246bc7,{options:_0x532592,args:_0x34b0bc,tdx:_0x1e6706}=_0x5c4f5a,_0x1ac00c=_0x532592,_0x5cb4df=_0x34b0bc[0x0],_0x7f5ce5=_0x34b0bc[0x1],_0x4e764e=_0x34b0bc[0x2]||_0x532592[_0x591e0a(0x2e4)];if(!_0x5cb4df)return console['error'](_0x591e0a(0x2c6)),console[_0x591e0a(0x2e3)](_0x591e0a(0x336)),console[_0x591e0a(0x2e3)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x7f5ce5)return console[_0x591e0a(0x2e3)]('Error:\x20Service\x20ID\x20is\x20required'),console[_0x591e0a(0x2e3)](_0x591e0a(0x336)),console[_0x591e0a(0x2e3)](_0x591e0a(0x236)),0x1;if(!_0x4e764e)return showParentSegmentNotSetError(_0x591e0a(0x304)+_0x591e0a(0x236)),0x1;const _0x636476=await withSpinner(_0x591e0a(0x335)+_0x4e764e+'\x27...',()=>_0x1e6706['segment'][_0x591e0a(0x374)](_0x4e764e),{'verbose':_0x532592[_0x591e0a(0x327)]}),_0x3e1c07=_0x636476[_0x591e0a(0x23b)],_0x2ef19d={'name':_0x5cb4df};_0x1ac00c[_0x591e0a(0x249)]&&(_0x2ef19d[_0x591e0a(0x249)]=_0x1ac00c[_0x591e0a(0x249)][_0x591e0a(0x3c7)](',')[_0x591e0a(0x368)](_0xca5225=>_0xca5225['trim']()));_0x1ac00c['description']&&(_0x2ef19d[_0x591e0a(0x31e)]=_0x1ac00c[_0x591e0a(0x31e)]);const _0x3342dd=await withSpinner('Creating\x20token\x20\x27'+_0x5cb4df+_0x591e0a(0x292)+_0x7f5ce5+_0x591e0a(0x228),()=>_0x1e6706['personalization'][_0x591e0a(0x2dd)](_0x3e1c07,_0x7f5ce5,_0x2ef19d),{'verbose':_0x532592['verbose']}),_0x364b85=_0x3342dd[_0x591e0a(0x23b)];return console[_0x591e0a(0x2e3)](_0x591e0a(0x3a4)+_0x364b85[_0x591e0a(0x209)]+_0x591e0a(0x3b4)+_0x364b85['id']),_0x364b85[_0x591e0a(0x3c2)]&&(console[_0x591e0a(0x2e3)](a32_0x50bd38[_0x591e0a(0x2d1)](_0x591e0a(0x30a))),console['error'](a32_0x50bd38[_0x591e0a(0x2ba)](_0x364b85[_0x591e0a(0x3c2)])),console['error']('')),await handleSDKOutput([_0x364b85],_0x532592),0x0;}}export class PSPzServiceTokenDeleteCommand extends BaseCommand{[a32_0x246bc7(0x209)]='ps:pz:service:token:delete';[a32_0x246bc7(0x31e)]=a32_0x246bc7(0x3b5);async[a32_0x246bc7(0x246)](_0x519e01){const _0x275cb2=a32_0x246bc7,{options:_0x2939d5,args:_0x4f4ece,tdx:_0x41d7e7}=_0x519e01,_0x471305=_0x4f4ece[0x0],_0x5db3b8=_0x4f4ece[0x1]||_0x2939d5['parentSegment'];if(!_0x471305)return console['error']('Error:\x20Token\x20ID\x20is\x20required'),console[_0x275cb2(0x2e3)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]'),console[_0x275cb2(0x2e3)](_0x275cb2(0x341)),0x1;if(!_0x5db3b8)return showParentSegmentNotSetError(_0x275cb2(0x3e4)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context'),0x1;const _0x29f6ef=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x5db3b8+'\x27...',()=>_0x41d7e7['segment'][_0x275cb2(0x374)](_0x5db3b8),{'verbose':_0x2939d5[_0x275cb2(0x327)]}),_0x29938e=_0x29f6ef['data'],_0x3a3599=await withSpinner(_0x275cb2(0x1fd),()=>_0x41d7e7['personalization'][_0x275cb2(0x3ab)](_0x29938e),{'verbose':_0x2939d5[_0x275cb2(0x327)]}),_0x90327d=_0x3a3599['data'];let _0x528ccb;for(const _0x15c42a of _0x90327d){if(_0x15c42a[_0x275cb2(0x220)]?.[_0x275cb2(0x2ea)](_0xf94f3a=>_0xf94f3a['id']===_0x471305)){_0x528ccb=_0x15c42a['id'];break;}}if(!_0x528ccb)return console[_0x275cb2(0x2e3)](_0x275cb2(0x21e)+_0x471305+_0x275cb2(0x38d)),0x1;const _0x4c58e3=await withSpinner('Deleting\x20token\x20\x27'+_0x471305+_0x275cb2(0x228),()=>_0x41d7e7['personalization'][_0x275cb2(0x27a)](_0x29938e,_0x528ccb,_0x471305),{'verbose':_0x2939d5[_0x275cb2(0x327)]}),_0x22aa1b=_0x4c58e3[_0x275cb2(0x23b)];return console[_0x275cb2(0x2e3)]('✔\x20Deleted\x20token\x20\x27'+(_0x22aa1b['name']||_0x471305)+'\x27'),await handleSDKOutput([_0x22aa1b],_0x2939d5),0x0;}}export class PSPzListCommand extends BaseCommand{[a32_0x246bc7(0x209)]=a32_0x246bc7(0x216);[a32_0x246bc7(0x31e)]=a32_0x246bc7(0x32b);async['execute'](_0x19ee26){const _0x56324a=a32_0x246bc7,{options:_0x5ece8,args:_0x54eb69,tdx:_0x59b038}=_0x19ee26,_0x3944ba=_0x54eb69[0x0]||_0x5ece8[_0x56324a(0x2e4)];if(!_0x3944ba)return showParentSegmentNotSetError(_0x56324a(0x2e9)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20personalizations\x20for\x20specific\x20parent\x20segment'),0x1;const _0x1df3de=await withSpinner(_0x56324a(0x335)+_0x3944ba+_0x56324a(0x228),()=>_0x59b038[_0x56324a(0x391)][_0x56324a(0x374)](_0x3944ba),{'verbose':_0x5ece8['verbose']}),_0x3fc68c=_0x1df3de[_0x56324a(0x23b)],_0x1fd44f=await withSpinner('Listing\x20personalizations\x20for\x20\x27'+_0x3944ba+_0x56324a(0x228),()=>_0x59b038[_0x56324a(0x349)]['listPersonalizations'](_0x3fc68c),{'verbose':_0x5ece8[_0x56324a(0x327)]}),_0x23d42e=_0x1fd44f[_0x56324a(0x23b)];console['error'](_0x56324a(0x3d7)+_0x23d42e['length']+_0x56324a(0x2c3)+(_0x23d42e[_0x56324a(0x204)]!==0x1?'s':''));if(_0x5ece8['format']===_0x56324a(0x3d1)||_0x5ece8[_0x56324a(0x331)]===_0x56324a(0x348))await handleSDKOutput(_0x23d42e,_0x5ece8);else{if(_0x23d42e[_0x56324a(0x204)]===0x0)console[_0x56324a(0x306)](_0x56324a(0x2ff));else for(const _0x549b19 of _0x23d42e){console[_0x56324a(0x306)](a32_0x50bd38['bold'](_0x549b19[_0x56324a(0x209)])+'\x20'+a32_0x50bd38['dim']('(id:\x20'+_0x549b19['id']+')'));_0x549b19[_0x56324a(0x31e)]&&console[_0x56324a(0x306)]('\x20\x20'+a32_0x50bd38[_0x56324a(0x2e2)](_0x549b19[_0x56324a(0x31e)]));const _0x1de6ff=_0x549b19['sections']?.[_0x56324a(0x204)]||0x0;console['log']('\x20\x20'+a32_0x50bd38[_0x56324a(0x2ba)](_0x56324a(0x33d))+'\x20'+_0x1de6ff);if(_0x549b19[_0x56324a(0x2d6)]&&_0x549b19[_0x56324a(0x2d6)][_0x56324a(0x204)]>0x0)for(const _0x2bb632 of _0x549b19[_0x56324a(0x2d6)]){console[_0x56324a(0x306)](_0x56324a(0x2bd)+_0x2bb632[_0x56324a(0x209)]);}}}return 0x0;}}export class PSPzShowCommand extends BaseCommand{[a32_0x246bc7(0x209)]='ps:pz:show';['description']='Show\x20a\x20specific\x20realtime\x20personalization';async[a32_0x246bc7(0x246)](_0x23cad7){const _0xae21c6=a32_0x246bc7,{options:_0x2be3e4,args:_0x5deb08,tdx:_0x492f94}=_0x23cad7,_0x4f9089=_0x5deb08[0x0];if(!_0x4f9089)return console[_0xae21c6(0x2e3)](_0xae21c6(0x315)),console[_0xae21c6(0x2e3)](_0xae21c6(0x2e7)),0x1;const _0x324da0=await withSpinner('Getting\x20personalization\x20\x27'+_0x4f9089+_0xae21c6(0x228),()=>_0x492f94[_0xae21c6(0x349)][_0xae21c6(0x201)](_0x4f9089),{'verbose':_0x2be3e4[_0xae21c6(0x327)]}),_0x5c4639=_0x324da0[_0xae21c6(0x23b)];console[_0xae21c6(0x2e3)]('✔\x20Found\x20personalization\x20\x27'+_0x5c4639[_0xae21c6(0x209)]+'\x27');if(_0x2be3e4[_0xae21c6(0x331)]==='json'||_0x2be3e4[_0xae21c6(0x331)]===_0xae21c6(0x348))await handleSDKOutput([_0x5c4639],_0x2be3e4);else{console[_0xae21c6(0x306)](a32_0x50bd38['bold'](_0x5c4639['name'])+'\x20'+a32_0x50bd38['dim'](_0xae21c6(0x2af)+_0x5c4639['id']+')'));_0x5c4639[_0xae21c6(0x31e)]&&console[_0xae21c6(0x306)]('\x20\x20'+a32_0x50bd38['dim'](_0x5c4639[_0xae21c6(0x31e)]));_0x5c4639[_0xae21c6(0x3e2)]&&console[_0xae21c6(0x306)]('\x20\x20'+a32_0x50bd38[_0xae21c6(0x2ba)](_0xae21c6(0x22e))+'\x20'+_0x5c4639[_0xae21c6(0x3e2)]);console['log']('\x20\x20'+a32_0x50bd38[_0xae21c6(0x2ba)]('created:')+'\x20'+_0x5c4639[_0xae21c6(0x202)]),console['log']('\x20\x20'+a32_0x50bd38['cyan']('updated:')+'\x20'+_0x5c4639[_0xae21c6(0x2d5)]);const _0x18bc21=_0x5c4639[_0xae21c6(0x2d6)]?.['length']||0x0;console[_0xae21c6(0x306)]('\x20\x20'+a32_0x50bd38[_0xae21c6(0x2ba)](_0xae21c6(0x33d))+'\x20'+_0x18bc21);if(_0x5c4639[_0xae21c6(0x2d6)]&&_0x5c4639[_0xae21c6(0x2d6)][_0xae21c6(0x204)]>0x0)for(const _0x4eb287 of _0x5c4639[_0xae21c6(0x2d6)]){console[_0xae21c6(0x306)](_0xae21c6(0x28a)+a32_0x50bd38[_0xae21c6(0x316)](_0x4eb287[_0xae21c6(0x209)])+'\x20'+a32_0x50bd38[_0xae21c6(0x2e2)](_0xae21c6(0x2af)+_0x4eb287['id']+')')),_0x4eb287[_0xae21c6(0x351)]&&(console[_0xae21c6(0x306)](_0xae21c6(0x24b)+a32_0x50bd38[_0xae21c6(0x2ba)]('entryCriteria:')+'\x20'+_0x4eb287['entryCriteria'][_0xae21c6(0x209)]),_0x4eb287[_0xae21c6(0x351)][_0xae21c6(0x2c1)]?.[_0xae21c6(0x24e)]&&console['log'](_0xae21c6(0x278)+a32_0x50bd38[_0xae21c6(0x2ba)](_0xae21c6(0x1e8))+'\x20'+_0x4eb287[_0xae21c6(0x351)]['keyEventCriteria'][_0xae21c6(0x24e)])),_0x4eb287[_0xae21c6(0x2e1)]&&console[_0xae21c6(0x306)](_0xae21c6(0x24b)+a32_0x50bd38[_0xae21c6(0x2ba)](_0xae21c6(0x39b))+'\x20'+JSON['stringify'](_0x4eb287['payload'])),_0x4eb287[_0xae21c6(0x3ba)]&&console[_0xae21c6(0x306)](_0xae21c6(0x24b)+a32_0x50bd38[_0xae21c6(0x2ba)]('includeSensitive:')+'\x20true');}}return 0x0;}}export class PSPzDeleteCommand extends BaseCommand{[a32_0x246bc7(0x209)]=a32_0x246bc7(0x2ca);[a32_0x246bc7(0x31e)]=a32_0x246bc7(0x27d);async['execute'](_0x24d2c3){const _0x2e80d9=a32_0x246bc7,{options:_0x3ac9ee,args:_0x2c9b54,tdx:_0x46054c}=_0x24d2c3,_0xc210d4=_0x2c9b54[0x0];if(!_0xc210d4)return console[_0x2e80d9(0x2e3)](_0x2e80d9(0x315)),console[_0x2e80d9(0x2e3)](_0x2e80d9(0x3f2)),0x1;return await withSpinner(_0x2e80d9(0x259)+_0xc210d4+'\x27...',()=>_0x46054c[_0x2e80d9(0x349)][_0x2e80d9(0x393)](_0xc210d4),{'verbose':_0x3ac9ee['verbose']}),console['error']('✔\x20Deleted\x20personalization\x20\x27'+_0xc210d4+'\x27'),0x0;}}export class PSPzCreateCommand extends BaseCommand{[a32_0x246bc7(0x209)]=a32_0x246bc7(0x34f);[a32_0x246bc7(0x31e)]=a32_0x246bc7(0x355);async['execute'](_0x32fddf){const _0x14f05d=a32_0x246bc7,{options:_0x538f5d,tdx:_0x17a205}=_0x32fddf,_0x584ffc=_0x538f5d;let _0x4df17b;if(_0x584ffc['file']){_0x4df17b=await loadJSON(_0x584ffc[_0x14f05d(0x237)],!![]);if(!_0x4df17b['relationships']?.['parentFolder'])return console['error'](_0x14f05d(0x3c9)),console[_0x14f05d(0x2e3)](_0x14f05d(0x277)),console['error'](_0x14f05d(0x38b)),0x1;}else{if(!_0x584ffc[_0x14f05d(0x209)])return console[_0x14f05d(0x2e3)](_0x14f05d(0x2ab)),console['error'](_0x14f05d(0x25f)),console[_0x14f05d(0x2e3)](_0x14f05d(0x214)),0x1;if(_0x584ffc['description']===undefined)return console['error'](_0x14f05d(0x20d)),console[_0x14f05d(0x2e3)](_0x14f05d(0x25f)),console[_0x14f05d(0x2e3)](_0x14f05d(0x214)),0x1;if(_0x584ffc[_0x14f05d(0x2fd)]===undefined)return console[_0x14f05d(0x2e3)](_0x14f05d(0x1e6)),console['error'](_0x14f05d(0x2aa)),0x1;let _0x324f9f=_0x584ffc[_0x14f05d(0x3e2)];if(!_0x324f9f&&_0x538f5d[_0x14f05d(0x2e4)]){const _0x3984da=await withSpinner(_0x14f05d(0x335)+_0x538f5d[_0x14f05d(0x2e4)]+_0x14f05d(0x228),()=>_0x17a205[_0x14f05d(0x391)][_0x14f05d(0x374)](_0x538f5d[_0x14f05d(0x2e4)]),{'verbose':_0x538f5d[_0x14f05d(0x327)]});_0x324f9f=_0x3984da['data'];}let _0x563ae4;_0x584ffc[_0x14f05d(0x2d6)]&&(_0x563ae4=await loadJSON(_0x584ffc[_0x14f05d(0x2d6)],![]));const _0x2e6de7=_0x584ffc[_0x14f05d(0x2fd)]==='null'?null:{'id':_0x584ffc[_0x14f05d(0x2fd)],'type':_0x14f05d(0x345)};_0x4df17b={'attributes':{'name':_0x584ffc[_0x14f05d(0x209)],'description':_0x584ffc[_0x14f05d(0x31e)]||null,..._0x324f9f!==undefined&&{'audienceId':_0x324f9f},..._0x563ae4!==undefined&&{'sections':_0x563ae4}},'relationships':{'parentFolder':{'data':_0x2e6de7}}};}const _0xa2104e=await withSpinner(_0x14f05d(0x318)+(_0x4df17b[_0x14f05d(0x21d)]?.[_0x14f05d(0x209)]??'')+_0x14f05d(0x228),()=>_0x17a205['personalization'][_0x14f05d(0x325)](_0x4df17b),{'verbose':_0x538f5d['verbose']}),_0x4dc49f=_0xa2104e[_0x14f05d(0x23b)];return console['error'](_0x14f05d(0x343)+_0x4dc49f[_0x14f05d(0x209)]+_0x14f05d(0x3b4)+_0x4dc49f['id']),await handleSDKOutput([_0x4dc49f],_0x538f5d),0x0;}}export class PSPzPatchCommand extends BaseCommand{[a32_0x246bc7(0x209)]=a32_0x246bc7(0x2d2);[a32_0x246bc7(0x31e)]=a32_0x246bc7(0x364);async['execute'](_0x27d250){const _0x53aa0=a32_0x246bc7,{options:_0xc22438,args:_0x12adea}=_0x27d250,_0x356703=_0xc22438,_0x20c7d6=_0x12adea[0x0];if(!_0x20c7d6)return console[_0x53aa0(0x2e3)](_0x53aa0(0x315)),console[_0x53aa0(0x2e3)](_0x53aa0(0x3bb)),console[_0x53aa0(0x2e3)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--file\x20<path>'),0x1;let _0x396fb9;if(_0x356703['file'])_0x396fb9=await loadJSON(_0x356703[_0x53aa0(0x237)],!![]);else{if(!_0x356703[_0x53aa0(0x209)])return console[_0x53aa0(0x2e3)](_0x53aa0(0x2ab)),console[_0x53aa0(0x2e3)](_0x53aa0(0x3bb)),0x1;if(_0x356703['description']===undefined)return console['error'](_0x53aa0(0x20d)),console[_0x53aa0(0x2e3)](_0x53aa0(0x3bb)),0x1;let _0x2f059f;_0x356703[_0x53aa0(0x2d6)]&&(_0x2f059f=await loadJSON(_0x356703[_0x53aa0(0x2d6)],![])),_0x396fb9={'attributes':{'name':_0x356703[_0x53aa0(0x209)],'description':_0x356703[_0x53aa0(0x31e)]||null,..._0x2f059f!==undefined&&{'sections':_0x2f059f}}};}const {tdx:_0x28b66c}=_0x27d250,_0x2384e6=await withSpinner(_0x53aa0(0x3dc)+_0x20c7d6+_0x53aa0(0x228),()=>_0x28b66c[_0x53aa0(0x349)][_0x53aa0(0x322)](_0x20c7d6,_0x396fb9),{'verbose':_0xc22438[_0x53aa0(0x327)]}),_0x6e8fed=_0x2384e6[_0x53aa0(0x23b)];return console[_0x53aa0(0x2e3)](_0x53aa0(0x26e)+_0x6e8fed[_0x53aa0(0x209)]+'\x27\x20(id:\x20'+_0x6e8fed['id']+')'),await handleSDKOutput([_0x6e8fed],_0xc22438),0x0;}}export class PSPzInitCommand extends BaseParentSegmentCommand{[a32_0x246bc7(0x209)]=a32_0x246bc7(0x353);[a32_0x246bc7(0x31e)]=a32_0x246bc7(0x24f);async[a32_0x246bc7(0x246)](_0x4f49fd){const _0x4ab79f=a32_0x246bc7,{options:_0x173331,args:_0x4d3814}=_0x4f49fd,_0x1c38b8=_0x4d3814[0x0]||_0x173331[_0x4ab79f(0x2e4)];if(!_0x1c38b8)return showParentSegmentNotSetError(_0x4ab79f(0x281)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20init\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Add\x20PZ\x20template\x20for\x20specific\x20parent\x20segment'),0x1;const _0x9feaad=resolveYamlFile(_0x1c38b8);if(!existsSync(_0x9feaad))return showFileNotFoundError(_0x9feaad,_0x1c38b8),0x1;let _0x55fe93;try{_0x55fe93=readFileSync(_0x9feaad,_0x4ab79f(0x2e5));}catch(_0x1c42e9){const _0x485064=_0x1c42e9 instanceof Error?_0x1c42e9[_0x4ab79f(0x20c)]:String(_0x1c42e9);return console[_0x4ab79f(0x2e3)](_0x4ab79f(0x2a5)+_0x485064),0x1;}let _0x34ee4a;try{_0x34ee4a=parseDef(_0x55fe93);}catch(_0x226e57){const _0x4e3832=_0x226e57 instanceof Error?_0x226e57[_0x4ab79f(0x20c)]:String(_0x226e57);return console[_0x4ab79f(0x2e3)](a32_0x50bd38[_0x4ab79f(0x275)](_0x4ab79f(0x3f1)+_0x4e3832)),0x1;}if(_0x34ee4a['personalization_services']&&_0x34ee4a[_0x4ab79f(0x317)]['length']>0x0)return console[_0x4ab79f(0x2e3)](a32_0x50bd38['yellow'](_0x4ab79f(0x3ae)+_0x9feaad)),console[_0x4ab79f(0x2e3)](a32_0x50bd38['dim']('\x20\x20\x20'+_0x34ee4a[_0x4ab79f(0x317)]['length']+'\x20service(s)\x20configured')),0x1;!_0x34ee4a[_0x4ab79f(0x380)]&&(_0x34ee4a[_0x4ab79f(0x380)]={'events':[{'name':_0x4ab79f(0x268),'source_table':_0x4ab79f(0x386)}],'attributes':[{'name':_0x4ab79f(0x283),'type':_0x4ab79f(0x242)}],'id_stitching':{'primary_key':_0x34ee4a[_0x4ab79f(0x215)][_0x4ab79f(0x379)]===_0x4ab79f(0x3a2)?_0x4ab79f(0x282):_0x4ab79f(0x3c6)}});_0x34ee4a['personalization_services']=[{'name':_0x4ab79f(0x3db),'description':'Personalization\x20service\x20description','trigger_event':_0x4ab79f(0x268),'sections':[{'name':_0x4ab79f(0x1f6),'criteria':_0x4ab79f(0x366),'attributes':[_0x4ab79f(0x283)]}]}];const _0x132a18=serializeDef(_0x34ee4a);return writeFileSync(_0x9feaad,_0x132a18,_0x4ab79f(0x2e5)),console['error'](a32_0x50bd38[_0x4ab79f(0x357)]('✔')+'\x20Added\x20personalization\x20template\x20to\x20'+a32_0x50bd38[_0x4ab79f(0x2ba)](_0x9feaad)),(!_0x34ee4a[_0x4ab79f(0x380)]||_0x55fe93['indexOf'](_0x4ab79f(0x3a5))===-0x1)&&console[_0x4ab79f(0x2e3)](a32_0x50bd38[_0x4ab79f(0x357)]('✔')+_0x4ab79f(0x1fb)),console[_0x4ab79f(0x2e3)]('\x0a'+a32_0x50bd38[_0x4ab79f(0x2e2)](_0x4ab79f(0x3ed))),console[_0x4ab79f(0x2e3)](_0x4ab79f(0x3d6)+_0x9feaad+_0x4ab79f(0x1f8)),console['error'](_0x4ab79f(0x240)+a32_0x50bd38['dim'](_0x4ab79f(0x2dc)+_0x1c38b8)+_0x4ab79f(0x24c)),0x0;}}
|