@treasuredata/tdx 0.26.0 → 0.26.1
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/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/describe.js +1 -1
- package/dist/commands/engage-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/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/use-command.js +1 -1
- package/dist/commands/user-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/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/api.js +1 -1
- package/dist/sdk/client/cdp-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/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/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/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/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.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/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/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/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/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.d.ts +2 -1
- package/dist/utils/local-cache.d.ts.map +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/local-cache.js.map +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/port.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 a22_0x39e7e0=a22_0x11d6;(function(_0x47756d,_0x4e7232){const _0x529e1f=a22_0x11d6,_0x319f9d=_0x47756d();while(!![]){try{const _0x5e607b=-parseInt(_0x529e1f(0x34b))/0x1+-parseInt(_0x529e1f(0x322))/0x2*(parseInt(_0x529e1f(0x287))/0x3)+-parseInt(_0x529e1f(0x2d1))/0x4*(parseInt(_0x529e1f(0x265))/0x5)+parseInt(_0x529e1f(0x29d))/0x6*(-parseInt(_0x529e1f(0x208))/0x7)+-parseInt(_0x529e1f(0x2fe))/0x8*(parseInt(_0x529e1f(0x2b9))/0x9)+parseInt(_0x529e1f(0x201))/0xa*(parseInt(_0x529e1f(0x30b))/0xb)+parseInt(_0x529e1f(0x2a1))/0xc;if(_0x5e607b===_0x4e7232)break;else _0x319f9d['push'](_0x319f9d['shift']());}catch(_0x438682){_0x319f9d['push'](_0x319f9d['shift']());}}}(a22_0x5da2,0xe803f));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a22_0x3435f8 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}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 a22_0x4b8b1a 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=a22_0x39e7e0(0x334),LEGACY_PARENT_SEGMENT_DIR=a22_0x39e7e0(0x233);function openBrowser(_0x5315a8){const _0x1955a6=a22_0x39e7e0,_0x5d0da0=process['platform'],_0x2670ae=_0x5d0da0===_0x1955a6(0x282)?_0x1955a6(0x29b):_0x5d0da0===_0x1955a6(0x343)?_0x1955a6(0x2cb):_0x1955a6(0x2f2);spawn(_0x2670ae,[_0x5315a8],{'detached':!![],'stdio':_0x1955a6(0x317)})[_0x1955a6(0x259)]();}function a22_0x5da2(){const _0x165e88=['\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','elapsedTimeMillis','Error:\x20--behavior\x20requires\x20a\x20name\x0a','\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22','\x20\x20Database:\x20','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','listParents','stitchingKeys','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','Parent\x20segment:\x20','parentSegment','\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)','parent_segment','length','schemaError','\x5c$&','customerPercent','/\x20directory.\x0a','Behavior:','trim','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','toFixed','\x20section','\x0aTip:\x20Run\x20`tdx\x20ps\x20pz\x20init`\x20to\x20add\x20a\x20template\x20personalization\x20section\x20to\x20your\x20YAML','\x20RT-enabled\x20parent\x20segment','displaySummary','allValid','\x20configured','Behaviors','customersWithEvents','%)\x20','Pattern:\x20','RT\x202.0:','valid','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','Events:','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','Resolving\x20parent\x20segment\x20\x27','List\x20personalization\x20services\x20for\x20a\x20parent\x20segment','<database>.<table>','displayPreviewHints','realtime_enabled','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','Site:\x20','data','page_view','session','unref','\x20rows)','Next\x20steps:','true','primaryKey','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','varchar','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','column_name','personalizationServices','Listing\x20personalization\x20services\x20for\x20\x27','7415WlwiVK','No\x20parent\x20segments\x20match\x20pattern:\x20','red','status','Fetching\x20SQL\x20for\x20\x27','log','Error:\x20Parent\x20segment\x20name\x20is\x20required','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20Opening\x20','rowCount','keys','attribute','user_id','⚠️\x20\x20personalization_services\x20section\x20already\x20exists\x20in\x20','\x20=\x20','\x20\x20Note:\x20','error','sampleData','\x20total','Error\x20reading\x20file:\x20','json','\x0a\x20\x20]\x0a}\x0a','dirname','utf-8','/app/dw/parentSegments/','segment:parent:update','limit','Options:\x0a','darwin','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','map','Session:','\x20--enriched','4155wOMrvU','\x20\x20\x20\x20','test','\x20\x201.\x20Edit\x20','\x27\x20is\x20already\x20up\x20to\x20date','\x20+\x20[','attributesFile','\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20','\x20RT\x20configuration\x20is\x20valid','/\x20→\x20','string','Preview:','scheduleOption','Customers:','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','\x20\x20No\x20sample\x20data\x20available','\x20tdx\x20wf\x20attempt\x20','\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22','\x0aNo\x20sample\x20data\x20available','SELECT\x20*\x20FROM\x20','open','\x22\x20}','2372334wlwamO','bold','localeCompare','\x20field','64644924dtemos','yes','segment:parent:view','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','runParent','Creating\x20parent\x20segment\x20\x27','ps:rt:list','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','Listing\x20RT-enabled\x20parent\x20segments\x20matching\x20\x27','message','/attempt/','\x20--attribute\x20\x22<name>\x22','setJobId','audienceId','Listing\x20RT-enabled\x20parent\x20segments...','table','Name:\x20','realtime','\x20Added\x20RT\x202.0\x20template\x20section','ps:rt:validate','dim','double','jobId','✔\x20Renamed\x20directory\x20to\x20','3411hGKsGb','Error:\x20File\x20not\x20found:\x20','push','\x0a⚠️\x20\x20Both\x20','Audience\x20ID:','timezone','\x0a\x20\x20\x20\x20}','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','\x0aChanges\x20to\x20apply\x20to\x20\x27','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','name','/\x20directories\x20exist.','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20rt\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20RT\x20config\x20for\x20specific\x20parent\x20segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','\x0aUsage:\x20tdx\x20ps\x20preview\x20','\x20kill','enriched','start','/app/workflows/','text','\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','\x20\x20\x20\x20\x20\x20','\x20personalization\x20service','1756wztHtu','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','✔\x20No\x20changes\x20-\x20\x27','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','getBehaviorNames','\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20','processedRows','\x20to\x20push\x20the\x20configuration','customerGroup','\x20\x20\x20\x20-\x20','workflowSessionId','behavior','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','ps:pz:list','output','\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22','Errors:','parent_id','✔\x20Found\x20','match','sourceTableError','displaySampleData','Output\x20Database:','Schema\x20saved\x20to\x20','Attributes:','trigger_event','execute','.yaml','Listing\x20parent\x20segments\x20matching\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','last_page_viewed','personalization_services','\x20--attribute\x20\x22','xdg-open','resolveParentId','updateParent','columns','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','apply','attributes','cyan','⚡\x20Not\x20enabled','reduce','Default','Analyzing\x20changes...','38120DtTEXY','\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path','all','\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)','toLowerCase','workflowId','run','segment:parent:pull','repeat','pullParentYaml','Fetching\x20parent\x20segment\x20\x27','Personalization\x20service\x20description','Database:\x20','11BnOHxe','addAttributes','\x20--behavior\x20\x22','Fetching\x20sample\x20data...','foreignKey','use','List\x20parent\x20segments','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','List\x20available\x20fields\x20for\x20segmentation','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','Error:','\x27\x20is\x20up\x20to\x20date','ignore','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','\x20\x202.\x20Run\x20','matchedCount','verbose','label','workflowAttemptId','segment:parent:fields','\x27\x20and\x20run\x20workflow?','displayAttributesStats','schemaValid','574aacxEv','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','behaviors','Master\x20Table','\x20behaviors','joinKey','collectSchema','No\x20parent\x20segments\x20found','Executing\x20parent\x20segment\x20query...','Fetching\x20behavior\x20list...','\x20Configuration\x20is\x20valid','\x0a\x20\x20\x20\x20]','yellow','master','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','sort','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','parent_segments','endsWith','interval','information_schema','Coverage:','segment:parent:show','Fetching\x20customers\x20schema...','Enriched:','displayPreviewResults','✔\x20Query\x20completed:\x20Processed\x20','database','Columns:','Show\x20parent\x20segment\x20schema\x20(column\x20types)','formatSchemaJson','Listing\x20parent\x20segments...','win32','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','YAML\x20file:\x20','SQL\x20query:\x0a','displayMasterInfo','Master\x20+\x20Attributes','query','preview','939642BRDUxF','replace','Status:','indexOf','totalEvents','segment:parent:preview','Aborted.','stop','toLocaleString','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','getParentSQL','events','Options\x20(one\x20required):\x0a','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','Join:','\x20parent\x20segment\x20\x27','jsonl','\x0a⚠️\x20\x20Migrating:\x20','Validate\x20RT\x202.0\x20configuration\x20from\x20parent\x20segment\x20YAML','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20PZ\x20services\x20for\x20specific\x20parent\x20segment','behavior_','addBehaviors','Usage:\x20tdx\x20ps\x20pz\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20PZ\x20services\x20(requires\x20context)\x0a','Validating\x20RT\x20configuration...','RT\x202.0\x20Validate:','getOutputDatabaseName','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','filter','Validate:','\x20trigger=','✔\x20Updated\x20parent\x20segment\x20\x27','pushParentYaml','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','Listing\x20fields\x20for\x20\x27','Rows:','getParentFull','Attributes','site','displayColumns','segment','column','population','list','\x0aChanges\x20to\x20\x27','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','Create\x20parent\x20segment\x20\x27','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','Validating\x20configuration...','\x20parent\x20segment','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','\x20service(s)\x20configured','coveragePercent','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','Fetching\x20current\x20configuration\x20for\x20\x27','`\x20to\x20download\x20the\x20configuration\x20first','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','stats','\x27...','customers','Available\x20behaviors:','join','scheduleType','validateParentYaml','tdx\x20ps\x20preview\x20','Updated','Available\x20attributes:','1481450hVXsXv','web','addBehaviorsFile','idStitching','Updating\x20parent\x20segment\x20\x27','Source:','green','14ehSyCL','segment:parent:validate','column_type','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','.yml','type','\x27\x20with\x20ID:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','-1d','\x0aNew\x20parent\x20segment\x20\x27','displayBehaviorsStats','Creating','\x20\x20Tables:\x201\x20customers\x20+\x20','Attempt:','Error:\x20--database\x20and\x20--table\x20are\x20required','\x20\x20\x20','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a','errors','Join\x20on:','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','behaviorsFile','td_client_id','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','description','✘\x20Failed\x20to\x20rename\x20directory:\x20','\x20Context\x20set:\x20','format','displayValidateResults','\x20to\x20configure\x20your\x20personalization\x20service','To\x20view\x20sample\x20data:'];a22_0x5da2=function(){return _0x165e88;};return a22_0x5da2();}function migrateLegacyDirectory(){const _0x1e2de1=a22_0x39e7e0;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x4ee434=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x4ee434['isDirectory']())return![];if(existsSync(PARENT_SEGMENT_DIR))return console['error'](a22_0x4b8b1a[_0x1e2de1(0x32e)](_0x1e2de1(0x2bc)+LEGACY_PARENT_SEGMENT_DIR+'/\x20and\x20'+PARENT_SEGMENT_DIR+_0x1e2de1(0x2c4))),console[_0x1e2de1(0x276)](a22_0x4b8b1a[_0x1e2de1(0x2b5)](_0x1e2de1(0x332)+LEGACY_PARENT_SEGMENT_DIR+_0x1e2de1(0x238))),![];console[_0x1e2de1(0x276)](a22_0x4b8b1a[_0x1e2de1(0x32e)](_0x1e2de1(0x35d)+LEGACY_PARENT_SEGMENT_DIR+_0x1e2de1(0x290)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x1e2de1(0x276)](a22_0x4b8b1a[_0x1e2de1(0x207)](_0x1e2de1(0x2b8)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x4af311){const _0x5e0292=_0x4af311 instanceof Error?_0x4af311[_0x1e2de1(0x2aa)]:String(_0x4af311);return console[_0x1e2de1(0x276)](a22_0x4b8b1a[_0x1e2de1(0x267)](_0x1e2de1(0x221)+_0x5e0292+'\x0a')),![];}}function a22_0x11d6(_0x43b0f8,_0x373023){_0x43b0f8=_0x43b0f8-0x1f3;const _0x5da2e7=a22_0x5da2();let _0x11d6fd=_0x5da2e7[_0x43b0f8];return _0x11d6fd;}class BaseParentSegmentCommand extends BaseCommand{async[a22_0x39e7e0(0x304)](_0x498d7a){const _0x51e00e=a22_0x39e7e0;return migrateLegacyDirectory(),super[_0x51e00e(0x304)](_0x498d7a);}}function resolveYamlFile(_0x592932){const _0x3fbc6b=a22_0x39e7e0;if(_0x592932['endsWith']('.yml')||_0x592932[_0x3fbc6b(0x335)](_0x3fbc6b(0x2ec)))return _0x592932;return a22_0x3435f8[_0x3fbc6b(0x1fb)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x592932)+_0x3fbc6b(0x20c));}function formatProgressMessage(_0x4542be){const _0x152078=a22_0x39e7e0,_0x5e6c50=_0x4542be[_0x152078(0x2e4)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x5e6c50){const [,_0xb5451f,_0x101e8f,_0x475fb1='']=_0x5e6c50;return a22_0x4b8b1a[_0x152078(0x2b5)](_0xb5451f+':')+'\x20'+_0x101e8f+a22_0x4b8b1a[_0x152078(0x2b5)](_0x475fb1);}return a22_0x4b8b1a[_0x152078(0x2b5)](_0x4542be);}function showFileNotFoundError(_0x218bd4,_0x1767b4){const _0x5e47c3=a22_0x39e7e0;console['error'](a22_0x4b8b1a['red'](_0x5e47c3(0x2ba)+_0x218bd4+'\x0a')),console[_0x5e47c3(0x276)](a22_0x4b8b1a['cyan']('Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20'+_0x1767b4+_0x5e47c3(0x1f5)));}function displayRealtimeValidation(_0x31fccd){const _0x2385e8=a22_0x39e7e0;if(!_0x31fccd[_0x2385e8(0x2b2)])return;const _0x50caaf=_0x31fccd[_0x2385e8(0x2b2)],_0x536a69=_0x50caaf['enabled']?a22_0x4b8b1a['green']('⚡\x20Enabled'):a22_0x4b8b1a[_0x2385e8(0x32e)](_0x2385e8(0x2fa));console[_0x2385e8(0x276)]('\x0a'+a22_0x4b8b1a[_0x2385e8(0x2b5)](_0x2385e8(0x248))+'\x20'+_0x536a69);if(_0x50caaf[_0x2385e8(0x357)]&&_0x50caaf[_0x2385e8(0x357)]['length']>0x0){console[_0x2385e8(0x276)]('\x20\x20'+a22_0x4b8b1a[_0x2385e8(0x2b5)](_0x2385e8(0x24d))+'\x20'+_0x50caaf[_0x2385e8(0x357)]['length']+_0x2385e8(0x243));for(const _0x3fdc92 of _0x50caaf[_0x2385e8(0x357)]){const _0x59dfd8=_0x3fdc92['sourceTableValid']===![]?a22_0x4b8b1a[_0x2385e8(0x267)]('✘'):a22_0x4b8b1a[_0x2385e8(0x207)]('✔');console[_0x2385e8(0x276)](_0x2385e8(0x288)+_0x59dfd8+'\x20'+_0x3fdc92[_0x2385e8(0x2c3)]),_0x3fdc92['sourceTableError']&&console[_0x2385e8(0x276)](_0x2385e8(0x2cf)+a22_0x4b8b1a[_0x2385e8(0x267)](_0x3fdc92[_0x2385e8(0x2e5)]));}}if(_0x50caaf[_0x2385e8(0x2f8)]&&_0x50caaf[_0x2385e8(0x2f8)][_0x2385e8(0x234)]>0x0){console['error']('\x20\x20'+a22_0x4b8b1a[_0x2385e8(0x2b5)](_0x2385e8(0x2e9))+'\x20'+_0x50caaf['attributes'][_0x2385e8(0x234)]+_0x2385e8(0x243));for(const _0x5d22a8 of _0x50caaf[_0x2385e8(0x2f8)]){const _0x5c6df2=_0x5d22a8[_0x2385e8(0x249)]?a22_0x4b8b1a[_0x2385e8(0x207)]('✔'):a22_0x4b8b1a[_0x2385e8(0x267)]('✘');console[_0x2385e8(0x276)](_0x2385e8(0x288)+_0x5c6df2+'\x20'+_0x5d22a8[_0x2385e8(0x2c3)]+'\x20'+a22_0x4b8b1a['dim']('('+_0x5d22a8[_0x2385e8(0x20d)]+')'));}}if(_0x50caaf[_0x2385e8(0x204)]){const _0x39e03a=_0x50caaf['idStitching']['stitchingKeys']?.[_0x2385e8(0x234)]?_0x2385e8(0x28c)+_0x50caaf[_0x2385e8(0x204)][_0x2385e8(0x22e)][_0x2385e8(0x1fb)](',\x20')+']':'';console[_0x2385e8(0x276)]('\x20\x20'+a22_0x4b8b1a[_0x2385e8(0x2b5)]('ID\x20Stitching:')+'\x20'+_0x50caaf['idStitching'][_0x2385e8(0x25d)]+_0x39e03a);}if(_0x50caaf[_0x2385e8(0x263)]&&_0x50caaf[_0x2385e8(0x263)][_0x2385e8(0x234)]>0x0){console['error']('\x20\x20'+a22_0x4b8b1a[_0x2385e8(0x2b5)]('Personalization:')+'\x20'+_0x50caaf[_0x2385e8(0x263)]['length']+'\x20service'+(_0x50caaf[_0x2385e8(0x263)][_0x2385e8(0x234)]!==0x1?'s':''));for(const _0x2d7a75 of _0x50caaf[_0x2385e8(0x263)]){console[_0x2385e8(0x276)](_0x2385e8(0x2da)+_0x2d7a75[_0x2385e8(0x2c3)]);}}}function showParentSegmentNotSetError(_0x573ccb){const _0x8b0a9=a22_0x39e7e0;console[_0x8b0a9(0x276)](a22_0x4b8b1a[_0x8b0a9(0x32e)](_0x8b0a9(0x2d4))),console[_0x8b0a9(0x276)](_0x573ccb);}export class ParentSegmentListCommand extends BaseCommand{['name']='segment:parent:list';['description']=a22_0x39e7e0(0x311);async[a22_0x39e7e0(0x2eb)](_0x6b2f08){const _0x33c9f8=a22_0x39e7e0,{options:_0x20a7ad,args:_0x11a9ef,tdx:_0x7ac9bf}=_0x6b2f08,_0x1dade3=_0x11a9ef[0x0];_0x20a7ad[_0x33c9f8(0x31b)]&&(console[_0x33c9f8(0x276)](_0x33c9f8(0x255)+_0x20a7ad['site']),_0x1dade3&&console[_0x33c9f8(0x276)](_0x33c9f8(0x247)+_0x1dade3));const _0x2a3b8e=await withSpinner(_0x1dade3?_0x33c9f8(0x2ed)+_0x1dade3+_0x33c9f8(0x1f8):_0x33c9f8(0x342),()=>_0x7ac9bf[_0x33c9f8(0x374)][_0x33c9f8(0x22d)](),{'verbose':_0x20a7ad['verbose']});let _0x47428d=_0x2a3b8e[_0x33c9f8(0x256)];if(_0x1dade3){const _0x4a8960=_0x1dade3[_0x33c9f8(0x34c)](/[.+^${}()|[\]\\]/g,_0x33c9f8(0x236))['replace'](/\*/g,'.*')[_0x33c9f8(0x34c)](/\?/g,'.'),_0xf59b20=new RegExp('^'+_0x4a8960+'$','i');_0x47428d=_0x47428d[_0x33c9f8(0x368)](_0x912278=>_0xf59b20[_0x33c9f8(0x289)](_0x912278['attributes'][_0x33c9f8(0x2c3)]));}_0x47428d['sort']((_0x5b5e89,_0x523e47)=>_0x5b5e89[_0x33c9f8(0x2f8)][_0x33c9f8(0x2c3)]['localeCompare'](_0x523e47[_0x33c9f8(0x2f8)][_0x33c9f8(0x2c3)])),console[_0x33c9f8(0x276)](_0x33c9f8(0x2e3)+_0x47428d[_0x33c9f8(0x234)]+_0x33c9f8(0x37d)+(_0x47428d[_0x33c9f8(0x234)]!==0x1?'s':''));const _0x183172=_0x1cf629=>{const _0x31259d=_0x33c9f8;return getConsoleNextUrl(_0x20a7ad['site'],_0x31259d(0x27e)+_0x1cf629);};if(_0x20a7ad['format']===_0x33c9f8(0x27a)||_0x20a7ad[_0x33c9f8(0x223)]===_0x33c9f8(0x35c)){const _0x10e163=_0x47428d[_0x33c9f8(0x284)](_0x30d582=>({..._0x30d582,'url':_0x183172(_0x30d582['id'])}));await handleSDKOutput(_0x10e163,_0x20a7ad);}else{if(_0x47428d['length']===0x0)_0x1dade3?console[_0x33c9f8(0x26a)](_0x33c9f8(0x266)+_0x1dade3):console['log'](_0x33c9f8(0x329));else for(const _0x27ede6 of _0x47428d){const _0x523542=_0x27ede6[_0x33c9f8(0x2f8)]['population']?a22_0x4b8b1a[_0x33c9f8(0x2b5)]('\x20('+formatRows(_0x27ede6['attributes'][_0x33c9f8(0x376)])+')'):'',_0x5bd5e2=hyperlink(_0x27ede6[_0x33c9f8(0x2f8)][_0x33c9f8(0x2c3)],_0x183172(_0x27ede6['id']));console[_0x33c9f8(0x26a)]('👥\x20'+_0x5bd5e2+_0x523542);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a22_0x39e7e0(0x2c3)]='segment:parent:create';[a22_0x39e7e0(0x220)]=a22_0x39e7e0(0x37b);async[a22_0x39e7e0(0x2eb)](_0x1fd4fa){const _0xce74d9=a22_0x39e7e0,{options:_0x3a35c7,args:_0xa1012e,tdx:_0x4616bd}=_0x1fd4fa;console['error'](_0xce74d9(0x2dd)+'\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a'+_0xce74d9(0x359));const _0x3f1cfa=_0x3a35c7;if(_0xa1012e[_0xce74d9(0x234)]===0x0)return console[_0xce74d9(0x276)](a22_0x4b8b1a[_0xce74d9(0x267)](_0xce74d9(0x26b))),console[_0xce74d9(0x276)](_0xce74d9(0x23c)),0x1;const _0x2e7027=_0xa1012e[0x0];if(!_0x3f1cfa[_0xce74d9(0x33e)]||!_0x3f1cfa[_0xce74d9(0x2b0)])return console[_0xce74d9(0x276)](_0xce74d9(0x216)),console[_0xce74d9(0x276)](_0xce74d9(0x23c)),0x1;_0x3f1cfa[_0xce74d9(0x31b)]&&(console['error'](_0xce74d9(0x255)+_0x3f1cfa[_0xce74d9(0x372)]),console[_0xce74d9(0x276)](_0xce74d9(0x2b1)+_0x2e7027),console[_0xce74d9(0x276)](_0xce74d9(0x30a)+_0x3f1cfa['database']),console[_0xce74d9(0x276)]('Table:\x20'+_0x3f1cfa[_0xce74d9(0x2b0)]));const _0x5a11f4=await loadJSONFromOptions(_0x3f1cfa[_0xce74d9(0x2f8)],_0x3f1cfa[_0xce74d9(0x28d)]),_0x136c93=await loadJSONFromOptions(_0x3f1cfa[_0xce74d9(0x324)],_0x3f1cfa[_0xce74d9(0x21d)]),_0x4df901=await loadJSONFromOptions(_0x3f1cfa[_0xce74d9(0x2d9)],_0x3f1cfa['customerGroupFile']),_0x3e0ed4={'name':_0x2e7027,'description':_0x3f1cfa[_0xce74d9(0x220)],'scheduleType':_0x3f1cfa[_0xce74d9(0x1fc)],'scheduleOption':_0x3f1cfa[_0xce74d9(0x293)],'timezone':_0x3f1cfa[_0xce74d9(0x2be)],'master':{'parentDatabaseName':_0x3f1cfa[_0xce74d9(0x33e)],'parentTableName':_0x3f1cfa[_0xce74d9(0x2b0)]},'attributes':_0x5a11f4,'behaviors':_0x136c93,'customerGroup':_0x4df901},_0x4a0ef6=await withSpinner(_0xce74d9(0x2a6)+_0x2e7027+'\x27...',()=>_0x4616bd['segment']['createParent'](_0x3e0ed4),{'verbose':_0x3a35c7['verbose']}),_0x2f4208=_0x4a0ef6[_0xce74d9(0x256)];return console[_0xce74d9(0x276)]('✔\x20Created\x20parent\x20segment\x20\x27'+_0x2f4208['name']+_0xce74d9(0x20e)+_0x2f4208['id']),await handleSDKOutput([_0x2f4208],_0x3a35c7),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{['name']=a22_0x39e7e0(0x27f);[a22_0x39e7e0(0x220)]=a22_0x39e7e0(0x25f);async[a22_0x39e7e0(0x2eb)](_0x49e949){const _0x359cd2=a22_0x39e7e0,{options:_0x2f1d6e,args:_0x140e86,tdx:_0x1f2fb2}=_0x49e949;console['error']('\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a'+_0x359cd2(0x24c)+_0x359cd2(0x359));const _0x520678=_0x2f1d6e;if(_0x140e86[_0x359cd2(0x234)]===0x0)return console[_0x359cd2(0x276)](a22_0x4b8b1a['red'](_0x359cd2(0x26b))),console[_0x359cd2(0x276)](_0x359cd2(0x2a8)),0x1;const _0x38e410=_0x140e86[0x0];_0x520678[_0x359cd2(0x31b)]&&(console['error']('Site:\x20'+_0x520678[_0x359cd2(0x372)]),console[_0x359cd2(0x276)]('Parent\x20segment:\x20'+_0x38e410));const _0x2460b6=await withSpinner(_0x359cd2(0x1f4)+_0x38e410+_0x359cd2(0x1f8),()=>_0x1f2fb2[_0x359cd2(0x374)][_0x359cd2(0x370)](_0x38e410),{'verbose':_0x520678[_0x359cd2(0x31b)]}),_0x1cb385=_0x2460b6[_0x359cd2(0x256)],_0x57e557=await loadJSONFromOptions(_0x520678[_0x359cd2(0x30c)],_0x520678['addAttributesFile']),_0x522696=await loadJSONFromOptions(_0x520678[_0x359cd2(0x361)],_0x520678[_0x359cd2(0x203)]),_0x194fd1={'name':_0x1cb385['name'],'description':_0x520678['description']!==undefined?_0x520678[_0x359cd2(0x220)]:_0x1cb385[_0x359cd2(0x220)],'scheduleType':_0x520678[_0x359cd2(0x1fc)]!==undefined?_0x520678['scheduleType']:_0x1cb385[_0x359cd2(0x1fc)],'scheduleOption':_0x520678[_0x359cd2(0x293)]!==undefined?_0x520678[_0x359cd2(0x293)]:_0x1cb385['scheduleOption'],'timezone':_0x520678[_0x359cd2(0x2be)]!==undefined?_0x520678[_0x359cd2(0x2be)]:_0x1cb385[_0x359cd2(0x2be)],'master':_0x1cb385[_0x359cd2(0x32f)],'attributes':_0x57e557?[..._0x1cb385['attributes']||[],..._0x57e557]:_0x1cb385['attributes'],'behaviors':_0x522696?[..._0x1cb385[_0x359cd2(0x324)]||[],..._0x522696]:_0x1cb385[_0x359cd2(0x324)],'customerGroup':_0x1cb385[_0x359cd2(0x2d9)]},_0x575bec=await withSpinner(_0x359cd2(0x205)+_0x38e410+'\x27...',()=>_0x1f2fb2[_0x359cd2(0x374)][_0x359cd2(0x2f4)](_0x38e410,_0x194fd1),{'verbose':_0x520678['verbose']}),_0x34abf2=_0x575bec[_0x359cd2(0x256)];return console[_0x359cd2(0x276)](_0x359cd2(0x36b)+_0x34abf2['name']+'\x27'),await handleSDKOutput([_0x34abf2],_0x520678),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a22_0x39e7e0(0x2c3)]=a22_0x39e7e0(0x305);['description']='Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file';async['execute'](_0x316c06){const _0x4eb428=a22_0x39e7e0,{options:_0x955889,args:_0x57c3aa,tdx:_0xa59aa3}=_0x316c06,_0x582fb1=_0x955889,_0x2f328b=_0x57c3aa[0x0]||_0x955889['parentSegment'];if(!_0x2f328b)return showParentSegmentNotSetError(_0x4eb428(0x367)+_0x4eb428(0x312)),0x1;if(_0x582fb1[_0x4eb428(0x310)]&&_0x582fb1[_0x4eb428(0x2df)])return console['error'](a22_0x4b8b1a[_0x4eb428(0x267)](_0x4eb428(0x295))),console[_0x4eb428(0x276)](a22_0x4b8b1a['dim'](_0x4eb428(0x379))),console[_0x4eb428(0x276)](a22_0x4b8b1a[_0x4eb428(0x2b5)]('using\x20the\x20default\x20path:\x20'+PARENT_SEGMENT_DIR+'/{name}.yml\x0a')),console[_0x4eb428(0x276)](a22_0x4b8b1a[_0x4eb428(0x2f9)](_0x4eb428(0x330))),0x1;const _0x501f9b=_0x582fb1[_0x4eb428(0x2df)]||a22_0x3435f8[_0x4eb428(0x1fb)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x2f328b)+_0x4eb428(0x20c));_0x582fb1[_0x4eb428(0x31b)]&&(console[_0x4eb428(0x276)]('Site:\x20'+_0x582fb1[_0x4eb428(0x372)]),console['error']('Parent\x20segment:\x20'+_0x2f328b),console[_0x4eb428(0x276)]('Output\x20file:\x20'+_0x501f9b));const _0x3b3a81=await withSpinner(_0x4eb428(0x308)+_0x2f328b+_0x4eb428(0x1f8),()=>_0xa59aa3[_0x4eb428(0x374)][_0x4eb428(0x307)](_0x2f328b),{'verbose':_0x582fb1[_0x4eb428(0x31b)]}),_0x538825=_0x3b3a81[_0x4eb428(0x256)];if(existsSync(_0x501f9b)){const _0x3d7098=readFileSync(_0x501f9b,'utf-8'),_0x24331a=generateDiff(_0x3d7098,_0x538825);if(!hasChanges(_0x24331a))console[_0x4eb428(0x276)](a22_0x4b8b1a[_0x4eb428(0x207)]('✔')+'\x20No\x20changes\x20-\x20'+a22_0x4b8b1a[_0x4eb428(0x2f9)](_0x501f9b)+'\x20is\x20already\x20up\x20to\x20date');else{console['error'](_0x4eb428(0x378)+_0x501f9b+'\x27:'),console[_0x4eb428(0x276)]('─'[_0x4eb428(0x306)](0x3c)),console[_0x4eb428(0x276)](formatDiffWithColors(_0x24331a)),console[_0x4eb428(0x276)]('─'[_0x4eb428(0x306)](0x3c));if(!_0x582fb1[_0x4eb428(0x2a2)]){if(!isInteractive())return console[_0x4eb428(0x276)](a22_0x4b8b1a[_0x4eb428(0x267)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x4eb428(0x276)](a22_0x4b8b1a['dim'](_0x4eb428(0x366))),0x1;const _0x1574e4=await confirmKey('Overwrite\x20\x27'+_0x501f9b+'\x27?');if(!_0x1574e4)return console[_0x4eb428(0x276)](a22_0x4b8b1a['yellow'](_0x4eb428(0x351))),0x1;}writeFileSync(_0x501f9b,_0x538825,_0x4eb428(0x27d)),console['error'](a22_0x4b8b1a[_0x4eb428(0x207)]('✔')+_0x4eb428(0x24b)+a22_0x4b8b1a[_0x4eb428(0x2f9)](_0x501f9b));}}else{const _0xe7df89=a22_0x3435f8[_0x4eb428(0x27c)](_0x501f9b);!existsSync(_0xe7df89)&&mkdirSync(_0xe7df89,{'recursive':!![]}),writeFileSync(_0x501f9b,_0x538825,_0x4eb428(0x27d)),console[_0x4eb428(0x276)](a22_0x4b8b1a[_0x4eb428(0x207)]('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a22_0x4b8b1a[_0x4eb428(0x2f9)](_0x501f9b));}return saveSessionContext({'parent_segment':_0x2f328b},_0x582fb1[_0x4eb428(0x258)]),console['error'](a22_0x4b8b1a[_0x4eb428(0x207)]('✔')+_0x4eb428(0x222)+a22_0x4b8b1a[_0x4eb428(0x2b5)](_0x4eb428(0x233))+_0x4eb428(0x274)+a22_0x4b8b1a[_0x4eb428(0x2f9)](_0x2f328b)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{['name']='segment:parent:push';[a22_0x39e7e0(0x220)]=a22_0x39e7e0(0x218);async[a22_0x39e7e0(0x2eb)](_0x1f2dd9){const _0x238060=a22_0x39e7e0,{options:_0x3e815f,args:_0x4b97ca,tdx:_0x8fd77}=_0x1f2dd9,_0x4ad64f=_0x3e815f,_0x192db3=_0x4b97ca[0x0]||_0x3e815f['parentSegment'];if(!_0x192db3)return showParentSegmentNotSetError(_0x238060(0x20b)+_0x238060(0x1f3)),0x1;const _0x3782a8=resolveYamlFile(_0x192db3);if(!existsSync(_0x3782a8))return showFileNotFoundError(_0x3782a8,_0x192db3),0x1;_0x4ad64f[_0x238060(0x31b)]&&(console[_0x238060(0x276)](_0x238060(0x255)+_0x4ad64f['site']),console[_0x238060(0x276)](_0x238060(0x345)+_0x3782a8));let _0x1a34f3;try{_0x1a34f3=readFileSync(_0x3782a8,_0x238060(0x27d));}catch(_0x331b08){const _0x47799f=_0x331b08 instanceof Error?_0x331b08['message']:String(_0x331b08);return console[_0x238060(0x276)]('Error\x20reading\x20file:\x20'+_0x47799f),0x1;}const _0x3cc781=await withSpinner(_0x238060(0x2fd),()=>_0x8fd77[_0x238060(0x374)][_0x238060(0x36c)](_0x1a34f3),{'verbose':_0x4ad64f[_0x238060(0x31b)]}),_0xde3a33=_0x3cc781[_0x238060(0x256)],{isNew:_0x4c23b4,name:_0x2e0738,hasChanges:_0x56000b,diffFormatted:_0x584415}=_0xde3a33;if(!_0x56000b)return console[_0x238060(0x276)](_0x238060(0x2d3)+_0x2e0738+_0x238060(0x28b)),0x0;_0x4c23b4?console['error'](_0x238060(0x211)+_0x2e0738+'\x27:'):console[_0x238060(0x276)](_0x238060(0x2c1)+_0x2e0738+'\x27:');console['error']('─'[_0x238060(0x306)](0x3c)),console[_0x238060(0x276)](_0x584415),console[_0x238060(0x276)]('─'[_0x238060(0x306)](0x3c));const _0x35c75a=_0x4c23b4?'Create\x20parent\x20segment\x20\x27'+_0x2e0738+'\x27?':'Apply\x20changes\x20to\x20\x27'+_0x2e0738+'\x27?';if(!_0x4ad64f['yes']){if(!isInteractive())return console['error'](a22_0x4b8b1a[_0x238060(0x267)]('\x0aError:'),_0x238060(0x26d)),console[_0x238060(0x276)](a22_0x4b8b1a[_0x238060(0x2b5)](_0x238060(0x366))),0x1;const _0x5370a0=await confirmKey(_0x35c75a);if(!_0x5370a0)return console['error'](a22_0x4b8b1a[_0x238060(0x32e)](_0x238060(0x351))),0x1;}const _0x3879fe=_0x4c23b4?_0x238060(0x213):'Updating',_0x3bd324=await withSpinner(_0x3879fe+_0x238060(0x35b)+_0x2e0738+_0x238060(0x1f8),()=>_0xde3a33[_0x238060(0x2f7)](),{'verbose':_0x4ad64f[_0x238060(0x31b)]}),_0x5ed433=_0x3bd324[_0x238060(0x256)],_0x18f434=getConsoleNextUrl(_0x4ad64f[_0x238060(0x372)],_0x238060(0x27e)+_0x5ed433['id']),_0x202965=_0x4c23b4?'Created':_0x238060(0x1ff);return console['error']('✔\x20'+_0x202965+_0x238060(0x35b)+_0x5ed433[_0x238060(0x2c3)]+'\x27'),console['error']('\x20\x20'+_0x18f434),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a22_0x39e7e0(0x2c3)]=a22_0x39e7e0(0x209);['description']='Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics';async[a22_0x39e7e0(0x2eb)](_0x44bf17){const _0xe76c58=a22_0x39e7e0,{options:_0x5e3093,args:_0x2198a1,tdx:_0x3901c4}=_0x44bf17,_0x23f419=_0x5e3093,_0x3298f4=_0x2198a1[0x0]||_0x5e3093[_0xe76c58(0x231)];if(!_0x3298f4)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a'+_0xe76c58(0x318)+_0xe76c58(0x281)+'\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a'+_0xe76c58(0x21f)+'\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)'),0x1;const _0xe4d35e=resolveYamlFile(_0x3298f4);if(!existsSync(_0xe4d35e))return showFileNotFoundError(_0xe4d35e,_0x3298f4),0x1;_0x23f419[_0xe76c58(0x31b)]&&(console[_0xe76c58(0x276)]('Site:\x20'+_0x23f419[_0xe76c58(0x372)]),console[_0xe76c58(0x276)](_0xe76c58(0x345)+_0xe4d35e));let _0x1fd768;try{_0x1fd768=readFileSync(_0xe4d35e,_0xe76c58(0x27d));}catch(_0x21a350){const _0x2d3f42=_0x21a350 instanceof Error?_0x21a350[_0xe76c58(0x2aa)]:String(_0x21a350);return console[_0xe76c58(0x276)](_0xe76c58(0x279)+_0x2d3f42),0x1;}const _0x3f4638=createCommandSpinner(a22_0x4b8b1a[_0xe76c58(0x2b5)](_0xe76c58(0x37c)),{'verbose':_0x23f419[_0xe76c58(0x31b)]});_0x3f4638[_0xe76c58(0x2cb)]();const _0x1ba8ae={'onProgress':_0x32172a=>{const _0x38fd9d=_0xe76c58;_0x3f4638[_0x38fd9d(0x2cd)]=formatProgressMessage(_0x32172a);}};if(_0x23f419[_0xe76c58(0x32f)])_0x1ba8ae[_0xe76c58(0x32f)]=!![];if(_0x23f419[_0xe76c58(0x2ca)])_0x1ba8ae[_0xe76c58(0x2ca)]=!![];_0x23f419[_0xe76c58(0x271)]&&(_0x1ba8ae[_0xe76c58(0x271)]=_0x23f419['attribute']);_0x23f419[_0xe76c58(0x2dc)]&&(_0x1ba8ae[_0xe76c58(0x2dc)]=_0x23f419[_0xe76c58(0x2dc)]);if(_0x23f419[_0xe76c58(0x336)])_0x1ba8ae[_0xe76c58(0x336)]=_0x23f419['interval'];let _0x5c5f94;try{_0x5c5f94=await _0x3901c4[_0xe76c58(0x374)][_0xe76c58(0x1fd)](_0x1fd768,_0x1ba8ae),_0x3f4638[_0xe76c58(0x352)]();}catch(_0x5d5893){_0x3f4638[_0xe76c58(0x352)]();throw _0x5d5893;}const _0x58739a=_0x23f419[_0xe76c58(0x336)]||_0xe76c58(0x210);return this[_0xe76c58(0x224)](_0x5c5f94,_0x1ba8ae,_0xe4d35e,_0x58739a),_0x5c5f94[_0xe76c58(0x242)]?0x0:0x1;}[a22_0x39e7e0(0x224)](_0x2a1f83,_0x252779,_0x34f034,_0x473b29){const _0x122c4b=a22_0x39e7e0;console[_0x122c4b(0x276)]('\x0a'+a22_0x4b8b1a[_0x122c4b(0x29e)](_0x122c4b(0x369))+'\x20'+_0x2a1f83[_0x122c4b(0x2c3)]),console['error']('═'[_0x122c4b(0x306)](0x3c)),this[_0x122c4b(0x347)](_0x2a1f83);if(typeof _0x252779['attribute']===_0x122c4b(0x291)){this[_0x122c4b(0x320)](_0x2a1f83),this[_0x122c4b(0x241)](_0x2a1f83),this['displayPreviewHints'](_0x34f034,_0x473b29,'attribute',_0x252779[_0x122c4b(0x271)]);return;}if(_0x252779[_0x122c4b(0x271)]===!![]){this[_0x122c4b(0x320)](_0x2a1f83),this[_0x122c4b(0x241)](_0x2a1f83),this[_0x122c4b(0x252)](_0x34f034,_0x473b29,'attributes');return;}if(typeof _0x252779['behavior']===_0x122c4b(0x291)){this[_0x122c4b(0x212)](_0x2a1f83,_0x473b29),this[_0x122c4b(0x241)](_0x2a1f83),this[_0x122c4b(0x252)](_0x34f034,_0x473b29,_0x122c4b(0x2dc),_0x252779[_0x122c4b(0x2dc)]);return;}if(_0x252779[_0x122c4b(0x2dc)]===!![]){this['displayBehaviorsStats'](_0x2a1f83,_0x473b29),this[_0x122c4b(0x241)](_0x2a1f83),this['displayPreviewHints'](_0x34f034,_0x473b29,'behaviors');return;}this[_0x122c4b(0x320)](_0x2a1f83),this[_0x122c4b(0x212)](_0x2a1f83,_0x473b29),this['displayRealtimeInfo'](_0x2a1f83),this[_0x122c4b(0x241)](_0x2a1f83),this[_0x122c4b(0x252)](_0x34f034,_0x473b29,_0x122c4b(0x300));}['displayRealtimeInfo'](_0x2073ff){displayRealtimeValidation(_0x2073ff);}['displayPreviewHints'](_0x404704,_0x5a2bb1,_0x4464f3,_0xc6c6ca){const _0x200058=a22_0x39e7e0;console[_0x200058(0x276)]('\x0a'+a22_0x4b8b1a[_0x200058(0x2b5)](_0x200058(0x226)));const _0x3746e5=_0x5a2bb1!==_0x200058(0x210)?'\x20--interval\x20'+_0x5a2bb1:'';if(_0x4464f3===_0x200058(0x271)&&_0xc6c6ca)console[_0x200058(0x276)]('\x20\x20'+a22_0x4b8b1a[_0x200058(0x2b5)]('tdx\x20ps\x20preview\x20'+_0x404704+_0x200058(0x2f1)+_0xc6c6ca+'\x22'+_0x3746e5));else{if(_0x4464f3===_0x200058(0x2dc)&&_0xc6c6ca)console[_0x200058(0x276)]('\x20\x20'+a22_0x4b8b1a[_0x200058(0x2b5)](_0x200058(0x1fe)+_0x404704+'\x20--behavior\x20\x22'+_0xc6c6ca+'\x22'+_0x3746e5));else(_0x4464f3===_0x200058(0x2f8)||_0x4464f3===_0x200058(0x300))&&console[_0x200058(0x276)]('\x20\x20'+a22_0x4b8b1a[_0x200058(0x2b5)](_0x200058(0x1fe)+_0x404704+_0x200058(0x2ac)+_0x3746e5));}(_0x4464f3===_0x200058(0x324)||_0x4464f3===_0x200058(0x300))&&console[_0x200058(0x276)]('\x20\x20'+a22_0x4b8b1a[_0x200058(0x2b5)](_0x200058(0x1fe)+_0x404704+'\x20--behavior\x20\x22<name>\x22'+_0x3746e5)),_0x4464f3===_0x200058(0x300)&&console[_0x200058(0x276)]('\x20\x20'+a22_0x4b8b1a[_0x200058(0x2b5)](_0x200058(0x1fe)+_0x404704+_0x200058(0x286)+_0x3746e5));}[a22_0x39e7e0(0x347)](_0x5bdc27){const _0x14639d=a22_0x39e7e0,{master:_0x29055a}=_0x5bdc27,_0x3f6bc2=_0x29055a[_0x14639d(0x321)]?a22_0x4b8b1a['green']('✔'):a22_0x4b8b1a[_0x14639d(0x267)]('✘');console[_0x14639d(0x276)]('\x0a'+a22_0x4b8b1a['dim'](_0x14639d(0x325))),console[_0x14639d(0x276)](_0x3f6bc2+'\x20'+a22_0x4b8b1a[_0x14639d(0x29e)](_0x29055a[_0x14639d(0x33e)]+'.'+_0x29055a['table'])),_0x29055a['schemaValid']?_0x29055a['rowCount']!==undefined&&console[_0x14639d(0x276)]('\x20\x20'+a22_0x4b8b1a[_0x14639d(0x2b5)](_0x14639d(0x36f))+'\x20'+a22_0x4b8b1a['cyan'](formatRows(_0x29055a[_0x14639d(0x26f)]))):console['error']('\x20\x20'+a22_0x4b8b1a[_0x14639d(0x267)](_0x14639d(0x315))+'\x20'+_0x29055a[_0x14639d(0x235)]);}['displayAttributesStats'](_0x31a99c){const _0x372449=a22_0x39e7e0;if(_0x31a99c['attributes'][_0x372449(0x234)]===0x0)return;console[_0x372449(0x276)]('\x0a'+a22_0x4b8b1a['dim'](_0x372449(0x371)));for(const _0xb17bfd of _0x31a99c['attributes']){const _0x2b5324=_0xb17bfd[_0x372449(0x321)]?a22_0x4b8b1a[_0x372449(0x207)]('✔'):a22_0x4b8b1a[_0x372449(0x267)]('✘');let _0x147a11='';if(_0xb17bfd[_0x372449(0x321)]&&_0xb17bfd[_0x372449(0x31a)]!==undefined&&_0xb17bfd['coveragePercent']!==undefined){const _0x381fa8=_0xb17bfd[_0x372449(0x380)][_0x372449(0x23d)](0x1),_0x459468=_0xb17bfd[_0x372449(0x380)]>=0x50?a22_0x4b8b1a['green']:_0xb17bfd[_0x372449(0x380)]>=0x32?a22_0x4b8b1a[_0x372449(0x32e)]:a22_0x4b8b1a[_0x372449(0x267)];_0x147a11='\x20'+a22_0x4b8b1a[_0x372449(0x2b5)](_0x372449(0x338))+'\x20'+_0x459468(_0x381fa8+'%')+'\x20('+formatRows(_0xb17bfd['matchedCount'])+_0x372449(0x25a);}console[_0x372449(0x276)](_0x2b5324+'\x20'+a22_0x4b8b1a['bold'](_0xb17bfd['name'])+_0x147a11),console['error']('\x20\x20'+a22_0x4b8b1a['dim'](_0x372449(0x206))+'\x20'+a22_0x4b8b1a[_0x372449(0x29e)](_0xb17bfd[_0x372449(0x33e)]+'.'+_0xb17bfd[_0x372449(0x2b0)]));const _0x575716=_0xb17bfd[_0x372449(0x327)]===_0xb17bfd[_0x372449(0x30f)]?a22_0x4b8b1a[_0x372449(0x2b5)](_0x372449(0x21b))+'\x20'+_0xb17bfd[_0x372449(0x327)]:a22_0x4b8b1a['dim'](_0x372449(0x35a))+'\x20'+_0xb17bfd[_0x372449(0x327)]+_0x372449(0x274)+_0xb17bfd['foreignKey'];console[_0x372449(0x276)]('\x20\x20'+_0x575716),console[_0x372449(0x276)]('\x20\x20'+a22_0x4b8b1a['dim'](_0x372449(0x33f))),this[_0x372449(0x373)](_0xb17bfd[_0x372449(0x2f5)]),!_0xb17bfd['schemaValid']&&console['error']('\x20\x20'+a22_0x4b8b1a[_0x372449(0x267)]('Error:')+'\x20'+_0xb17bfd['schemaError']);}}[a22_0x39e7e0(0x212)](_0x4f7393,_0x265faa){const _0x2a1fe5=a22_0x39e7e0;if(_0x4f7393['behaviors'][_0x2a1fe5(0x234)]===0x0)return;console['error']('\x0a'+a22_0x4b8b1a[_0x2a1fe5(0x2b5)](_0x2a1fe5(0x244))+'\x20'+a22_0x4b8b1a[_0x2a1fe5(0x2b5)]('('+_0x265faa+')'));for(const _0x261a33 of _0x4f7393[_0x2a1fe5(0x324)]){const _0x1eee3f=_0x261a33[_0x2a1fe5(0x321)]?a22_0x4b8b1a[_0x2a1fe5(0x207)]('✔'):a22_0x4b8b1a[_0x2a1fe5(0x267)]('✘');let _0x17816a='';if(_0x261a33[_0x2a1fe5(0x321)]&&_0x261a33[_0x2a1fe5(0x245)]!==undefined&&_0x261a33['totalEvents']!==undefined){const _0x4bc707=_0x261a33[_0x2a1fe5(0x237)]?.[_0x2a1fe5(0x23d)](0x1)||'?',_0x43ceef=(_0x261a33[_0x2a1fe5(0x237)]??0x0)>=0x32?a22_0x4b8b1a[_0x2a1fe5(0x207)]:(_0x261a33[_0x2a1fe5(0x237)]??0x0)>=0x14?a22_0x4b8b1a[_0x2a1fe5(0x32e)]:a22_0x4b8b1a['red'];_0x17816a='\x20'+a22_0x4b8b1a[_0x2a1fe5(0x2b5)](_0x2a1fe5(0x294))+'\x20'+_0x43ceef(formatRows(_0x261a33['customersWithEvents']))+'\x20('+_0x4bc707+_0x2a1fe5(0x246)+a22_0x4b8b1a[_0x2a1fe5(0x2b5)]('Events:')+'\x20'+a22_0x4b8b1a[_0x2a1fe5(0x2f9)](formatRows(_0x261a33[_0x2a1fe5(0x34f)]));}console[_0x2a1fe5(0x276)](_0x1eee3f+'\x20'+a22_0x4b8b1a[_0x2a1fe5(0x29e)](_0x261a33['name'])+_0x17816a),console['error']('\x20\x20'+a22_0x4b8b1a[_0x2a1fe5(0x2b5)](_0x2a1fe5(0x206))+'\x20'+a22_0x4b8b1a[_0x2a1fe5(0x29e)](_0x261a33['database']+'.'+_0x261a33[_0x2a1fe5(0x2b0)]));const _0x4805e9=_0x261a33[_0x2a1fe5(0x327)]===_0x261a33[_0x2a1fe5(0x30f)]?a22_0x4b8b1a[_0x2a1fe5(0x2b5)]('Join\x20on:')+'\x20'+_0x261a33[_0x2a1fe5(0x327)]:a22_0x4b8b1a[_0x2a1fe5(0x2b5)](_0x2a1fe5(0x35a))+'\x20'+_0x261a33[_0x2a1fe5(0x327)]+_0x2a1fe5(0x274)+_0x261a33[_0x2a1fe5(0x30f)];console[_0x2a1fe5(0x276)]('\x20\x20'+_0x4805e9),console[_0x2a1fe5(0x276)]('\x20\x20'+a22_0x4b8b1a[_0x2a1fe5(0x2b5)](_0x2a1fe5(0x33f))),this['displayColumns'](_0x261a33['columns']),!_0x261a33['schemaValid']&&console['error']('\x20\x20'+a22_0x4b8b1a['red'](_0x2a1fe5(0x315))+'\x20'+_0x261a33[_0x2a1fe5(0x235)]);}}[a22_0x39e7e0(0x373)](_0x208b3f){const _0xa68416=a22_0x39e7e0;for(const _0x24df5d of _0x208b3f){_0x24df5d[_0xa68416(0x31c)]===_0x24df5d['column']||_0x24df5d[_0xa68416(0x375)]==='*'?console[_0xa68416(0x276)](_0xa68416(0x2da)+_0x24df5d[_0xa68416(0x31c)]):console[_0xa68416(0x276)](_0xa68416(0x2da)+_0x24df5d[_0xa68416(0x31c)]+'\x20'+a22_0x4b8b1a[_0xa68416(0x2b5)]('('+_0x24df5d['column']+')'));}}[a22_0x39e7e0(0x241)](_0x25e5e5){const _0x3eacf3=a22_0x39e7e0;console[_0x3eacf3(0x276)]('─'[_0x3eacf3(0x306)](0x3c));if(_0x25e5e5[_0x3eacf3(0x21a)][_0x3eacf3(0x234)]>0x0){console['error']('\x0a'+a22_0x4b8b1a['red']('Errors:'));for(const _0x20a4a5 of _0x25e5e5['errors']){console[_0x3eacf3(0x276)]('\x20\x20'+a22_0x4b8b1a[_0x3eacf3(0x267)]('•')+'\x20'+_0x20a4a5);}}_0x25e5e5[_0x3eacf3(0x242)]&&console[_0x3eacf3(0x276)]('\x0a'+a22_0x4b8b1a[_0x3eacf3(0x207)]('✔')+_0x3eacf3(0x32c));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{['name']=a22_0x39e7e0(0x350);['description']=a22_0x39e7e0(0x22f);async['execute'](_0x1e298a){const _0xc1f975=a22_0x39e7e0,{options:_0x54a09e,args:_0xd38651,tdx:_0x198aef}=_0x1e298a,_0x125a1e=_0x54a09e,_0x1fed2d=_0xd38651[0x0]||_0x54a09e[_0xc1f975(0x231)];if(!_0x1fed2d)return showParentSegmentNotSetError(_0xc1f975(0x344)+_0xc1f975(0x20f)+_0xc1f975(0x358)+_0xc1f975(0x323)+_0xc1f975(0x21c)+_0xc1f975(0x37e)+'\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a'+_0xc1f975(0x283)),0x1;if(!_0x125a1e[_0xc1f975(0x32f)]&&!_0x125a1e[_0xc1f975(0x271)]&&!_0x125a1e[_0xc1f975(0x2dc)]&&!_0x125a1e['enriched'])return console[_0xc1f975(0x276)](a22_0x4b8b1a[_0xc1f975(0x267)](_0xc1f975(0x36d))),console[_0xc1f975(0x276)](_0xc1f975(0x2f6)),console[_0xc1f975(0x276)]('Options:'),console[_0xc1f975(0x276)](_0xc1f975(0x2c2)),console[_0xc1f975(0x276)](_0xc1f975(0x22c)),console[_0xc1f975(0x276)](_0xc1f975(0x24a)),console[_0xc1f975(0x276)](_0xc1f975(0x333)),0x1;const _0x40942a=resolveYamlFile(_0x1fed2d);if(!existsSync(_0x40942a))return showFileNotFoundError(_0x40942a,_0x1fed2d),0x1;_0x125a1e[_0xc1f975(0x31b)]&&(console[_0xc1f975(0x276)](_0xc1f975(0x255)+_0x125a1e[_0xc1f975(0x372)]),console[_0xc1f975(0x276)](_0xc1f975(0x345)+_0x40942a));let _0x247cfe;try{_0x247cfe=readFileSync(_0x40942a,_0xc1f975(0x27d));}catch(_0x2031cd){const _0x23c691=_0x2031cd instanceof Error?_0x2031cd[_0xc1f975(0x2aa)]:String(_0x2031cd);return console[_0xc1f975(0x276)](_0xc1f975(0x279)+_0x23c691),0x1;}let _0x38a1fa;try{_0x38a1fa=parseDef(_0x247cfe);}catch(_0x19b7d4){const _0x80a5d2=_0x19b7d4 instanceof Error?_0x19b7d4[_0xc1f975(0x2aa)]:String(_0x19b7d4);return console['error'](a22_0x4b8b1a[_0xc1f975(0x267)]('Error\x20parsing\x20YAML:\x20'+_0x80a5d2)),0x1;}if(_0x125a1e['attribute']===!![]||_0x125a1e[_0xc1f975(0x271)]===''){const _0x37f85b=_0x38a1fa[_0xc1f975(0x2f8)]?.['map'](_0x22c379=>_0x22c379[_0xc1f975(0x2c3)])||[];if(_0x37f85b[_0xc1f975(0x234)]===0x0)console[_0xc1f975(0x276)](a22_0x4b8b1a[_0xc1f975(0x267)](_0xc1f975(0x24e)));else{console[_0xc1f975(0x276)](a22_0x4b8b1a[_0xc1f975(0x267)]('Error:\x20--attribute\x20requires\x20a\x20name\x0a')),console['error'](_0xc1f975(0x200));for(const _0x3422dd of _0x37f85b){console[_0xc1f975(0x276)]('\x20\x20'+a22_0x4b8b1a[_0xc1f975(0x2f9)](_0x3422dd));}console[_0xc1f975(0x276)](_0xc1f975(0x2c8)+_0x1fed2d+'\x20--attribute\x20\x22'+_0x37f85b[0x0]+'\x22');}return 0x1;}if(_0x125a1e['behavior']===!![]||_0x125a1e[_0xc1f975(0x2dc)]===''){const _0x1bf605=_0x38a1fa['behaviors']?.['map'](_0x99e8ef=>_0x99e8ef[_0xc1f975(0x2c3)])||[];if(_0x1bf605[_0xc1f975(0x234)]===0x0)console[_0xc1f975(0x276)](a22_0x4b8b1a['red'](_0xc1f975(0x2a4)));else{console[_0xc1f975(0x276)](a22_0x4b8b1a['red'](_0xc1f975(0x229))),console[_0xc1f975(0x276)](_0xc1f975(0x1fa));for(const _0xf04bea of _0x1bf605){console['error']('\x20\x20'+a22_0x4b8b1a[_0xc1f975(0x2f9)](_0xf04bea));}console[_0xc1f975(0x276)](_0xc1f975(0x2c8)+_0x1fed2d+_0xc1f975(0x30d)+_0x1bf605[0x0]+'\x22');}return 0x1;}const _0x399a02=createCommandSpinner(a22_0x4b8b1a[_0xc1f975(0x2b5)](_0xc1f975(0x30e)),{'verbose':_0x125a1e['verbose']});_0x399a02[_0xc1f975(0x2cb)]();const _0xfaaa9b={'onProgress':_0x5179f5=>{const _0x5bd4ae=_0xc1f975;_0x399a02[_0x5bd4ae(0x2cd)]=formatProgressMessage(_0x5179f5);}};if(_0x125a1e[_0xc1f975(0x32f)])_0xfaaa9b[_0xc1f975(0x32f)]=!![];if(_0x125a1e[_0xc1f975(0x271)]&&typeof _0x125a1e['attribute']===_0xc1f975(0x291))_0xfaaa9b[_0xc1f975(0x271)]=_0x125a1e[_0xc1f975(0x271)];if(_0x125a1e[_0xc1f975(0x2dc)]&&typeof _0x125a1e[_0xc1f975(0x2dc)]===_0xc1f975(0x291))_0xfaaa9b[_0xc1f975(0x2dc)]=_0x125a1e[_0xc1f975(0x2dc)];if(_0x125a1e[_0xc1f975(0x2ca)])_0xfaaa9b[_0xc1f975(0x2ca)]=!![];if(_0x125a1e[_0xc1f975(0x336)])_0xfaaa9b[_0xc1f975(0x336)]=_0x125a1e[_0xc1f975(0x336)];let _0xc7a0ef;try{_0xc7a0ef=await _0x198aef['segment']['previewParentYaml'](_0x247cfe,_0xfaaa9b),_0x399a02[_0xc1f975(0x352)]();}catch(_0x65131e){_0x399a02[_0xc1f975(0x352)]();throw _0x65131e;}return await this[_0xc1f975(0x33c)](_0xc7a0ef,{'master':_0x125a1e[_0xc1f975(0x32f)],'attribute':typeof _0x125a1e['attribute']==='string'?_0x125a1e['attribute']:undefined,'behavior':typeof _0x125a1e[_0xc1f975(0x2dc)]===_0xc1f975(0x291)?_0x125a1e[_0xc1f975(0x2dc)]:undefined,'enriched':_0x125a1e['enriched']}),_0xc7a0ef[_0xc1f975(0x242)]?0x0:0x1;}async[a22_0x39e7e0(0x33c)](_0x16e1ed,_0x516611){const _0x1abcfa=a22_0x39e7e0;console[_0x1abcfa(0x276)]('\x0a'+a22_0x4b8b1a[_0x1abcfa(0x29e)](_0x1abcfa(0x292))+'\x20'+_0x16e1ed[_0x1abcfa(0x2c3)]),console[_0x1abcfa(0x276)]('═'[_0x1abcfa(0x306)](0x3c));if(_0x516611[_0x1abcfa(0x32f)]&&_0x16e1ed[_0x1abcfa(0x277)]){const _0x4c087b=a22_0x4b8b1a[_0x1abcfa(0x2b5)]('Master:')+'\x20'+a22_0x4b8b1a[_0x1abcfa(0x29e)](_0x16e1ed[_0x1abcfa(0x32f)][_0x1abcfa(0x33e)]+'.'+_0x16e1ed[_0x1abcfa(0x32f)][_0x1abcfa(0x2b0)]);await this['displaySampleData'](_0x4c087b,_0x16e1ed[_0x1abcfa(0x277)]);}else{if(_0x516611[_0x1abcfa(0x271)]&&_0x16e1ed[_0x1abcfa(0x277)]){const _0x1b6baa=a22_0x4b8b1a[_0x1abcfa(0x2b5)]('Attribute:')+'\x20'+a22_0x4b8b1a[_0x1abcfa(0x29e)](_0x516611['attribute']);await this[_0x1abcfa(0x2e6)](_0x1b6baa,_0x16e1ed[_0x1abcfa(0x277)]);}else{if(_0x516611[_0x1abcfa(0x2dc)]&&_0x16e1ed[_0x1abcfa(0x277)]){const _0x573ec1=a22_0x4b8b1a[_0x1abcfa(0x2b5)](_0x1abcfa(0x239))+'\x20'+a22_0x4b8b1a[_0x1abcfa(0x29e)](_0x516611['behavior']);await this[_0x1abcfa(0x2e6)](_0x573ec1,_0x16e1ed[_0x1abcfa(0x277)]);}else{if(_0x516611[_0x1abcfa(0x2ca)]&&_0x16e1ed[_0x1abcfa(0x277)]){const _0x561b6c=a22_0x4b8b1a['dim'](_0x1abcfa(0x33b))+'\x20'+a22_0x4b8b1a['bold'](_0x1abcfa(0x348));await this['displaySampleData'](_0x561b6c,_0x16e1ed[_0x1abcfa(0x277)]);}else!_0x16e1ed[_0x1abcfa(0x277)]&&console[_0x1abcfa(0x276)](_0x1abcfa(0x299));}}}if(_0x16e1ed[_0x1abcfa(0x21a)][_0x1abcfa(0x234)]>0x0){console['error']('─'[_0x1abcfa(0x306)](0x3c)),console[_0x1abcfa(0x276)]('\x0a'+a22_0x4b8b1a[_0x1abcfa(0x267)]('Errors:'));for(const _0x4c942e of _0x16e1ed[_0x1abcfa(0x21a)]){console[_0x1abcfa(0x276)]('\x20\x20'+a22_0x4b8b1a[_0x1abcfa(0x267)]('•')+'\x20'+_0x4c942e);}}}async[a22_0x39e7e0(0x2e6)](_0x365b82,_0xe36c94){const _0x1b1dd9=a22_0x39e7e0;if(_0xe36c94['length']===0x0){console[_0x1b1dd9(0x276)]('\x0a'+_0x365b82),console[_0x1b1dd9(0x276)](_0x1b1dd9(0x296));return;}console[_0x1b1dd9(0x276)]('\x0a'+_0x365b82);const _0x5c3fb4=Object[_0x1b1dd9(0x270)](_0xe36c94[0x0])[_0x1b1dd9(0x284)](_0x400e17=>({'name':_0x400e17,'type':typeof _0xe36c94[0x0][_0x400e17]==='number'?_0x1b1dd9(0x2b6):_0x1b1dd9(0x260)})),_0x171cc0={'queryId':_0x1b1dd9(0x34a),'columns':_0x5c3fb4,'data':_0xe36c94,'stats':{'state':'FINISHED','queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0xe36c94[_0x1b1dd9(0x234)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x45be2b=formatAsTable(_0x171cc0,_0xe36c94[_0x1b1dd9(0x234)],!![]);await writeOutput(_0x45be2b,undefined,_0x1b1dd9(0x2b0));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a22_0x39e7e0(0x2c3)]='segment:parent:run';[a22_0x39e7e0(0x220)]=a22_0x39e7e0(0x26c);async['execute'](_0x5ef2b4){const _0x2cf061=a22_0x39e7e0,{options:_0x2856fc,args:_0x539375,tdx:_0x4f0e51}=_0x5ef2b4,_0x5e8fa6=_0x2856fc,_0x4238de=_0x539375[0x0]||_0x2856fc['parentSegment'];if(!_0x4238de)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment'),0x1;const _0x25e500=resolveYamlFile(_0x4238de);if(existsSync(_0x25e500)){_0x5e8fa6[_0x2cf061(0x31b)]&&console[_0x2cf061(0x276)]('Found\x20YAML\x20file:\x20'+_0x25e500);let _0xf02e86;try{_0xf02e86=readFileSync(_0x25e500,_0x2cf061(0x27d));}catch(_0x51bd32){const _0x43d2a1=_0x51bd32 instanceof Error?_0x51bd32[_0x2cf061(0x2aa)]:String(_0x51bd32);return console['error'](_0x2cf061(0x279)+_0x43d2a1),0x1;}const _0x1d5f50=await withSpinner('Analyzing\x20changes...',()=>_0x4f0e51['segment'][_0x2cf061(0x36c)](_0xf02e86),{'verbose':_0x5e8fa6['verbose']}),_0x33365f=_0x1d5f50[_0x2cf061(0x256)],{isNew:_0x5421a8,name:_0x3593ed,hasChanges:_0x12f623,diffFormatted:_0x509413}=_0x33365f;if(_0x12f623){_0x5421a8?console[_0x2cf061(0x276)](_0x2cf061(0x211)+_0x3593ed+'\x27:'):console[_0x2cf061(0x276)](_0x2cf061(0x2c1)+_0x3593ed+'\x27:');console['error']('─'[_0x2cf061(0x306)](0x3c)),console[_0x2cf061(0x276)](_0x509413),console[_0x2cf061(0x276)]('─'[_0x2cf061(0x306)](0x3c));const _0x2fb835=_0x5421a8?_0x2cf061(0x37a)+_0x3593ed+_0x2cf061(0x31f):'Apply\x20changes\x20to\x20\x27'+_0x3593ed+_0x2cf061(0x31f);if(!_0x5e8fa6[_0x2cf061(0x2a2)]){if(!isInteractive())return console['error'](a22_0x4b8b1a[_0x2cf061(0x267)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a22_0x4b8b1a[_0x2cf061(0x2b5)](_0x2cf061(0x366))),0x1;const _0xb985a9=await confirmKey(_0x2fb835);if(!_0xb985a9)return console[_0x2cf061(0x276)](a22_0x4b8b1a['yellow'](_0x2cf061(0x351))),0x1;}const _0xb3dbf9=_0x5421a8?'Creating':'Updating';await withSpinner(_0xb3dbf9+_0x2cf061(0x35b)+_0x3593ed+_0x2cf061(0x1f8),()=>_0x33365f[_0x2cf061(0x2f7)](),{'verbose':_0x5e8fa6[_0x2cf061(0x31b)]});const _0x303022=_0x5421a8?'Created':_0x2cf061(0x1ff);console[_0x2cf061(0x276)]('✔\x20'+_0x303022+_0x2cf061(0x35b)+_0x3593ed+'\x27');}else console[_0x2cf061(0x276)]('✔\x20No\x20changes\x20-\x20\x27'+_0x3593ed+_0x2cf061(0x316));}const _0x43f1f9=await withSpinner(_0x2cf061(0x354)+_0x4238de+_0x2cf061(0x1f8),()=>_0x4f0e51[_0x2cf061(0x374)][_0x2cf061(0x2a5)](_0x4238de),{'verbose':_0x5e8fa6[_0x2cf061(0x31b)]}),_0x374251=_0x43f1f9[_0x2cf061(0x256)],_0x8921be=getConsoleUrl(_0x5e8fa6[_0x2cf061(0x372)],_0x2cf061(0x2cc)+_0x374251[_0x2cf061(0x303)]+'/sessions/'+_0x374251[_0x2cf061(0x2db)]+_0x2cf061(0x2ab)+_0x374251[_0x2cf061(0x31d)]);return console[_0x2cf061(0x276)]('\x0a✔\x20Workflow\x20started'),console[_0x2cf061(0x276)]('\x20\x20'+a22_0x4b8b1a['dim'](_0x2cf061(0x2bd))+'\x20'+_0x374251[_0x2cf061(0x2ae)]),console['error']('\x20\x20'+a22_0x4b8b1a['dim'](_0x2cf061(0x34d))+'\x20'+_0x374251[_0x2cf061(0x268)]),console['error']('\x20\x20'+a22_0x4b8b1a[_0x2cf061(0x2b5)](_0x2cf061(0x285))+'\x20'+_0x374251[_0x2cf061(0x2db)]),console[_0x2cf061(0x276)]('\x20\x20'+a22_0x4b8b1a[_0x2cf061(0x2b5)](_0x2cf061(0x215))+'\x20'+_0x374251[_0x2cf061(0x31d)]),console[_0x2cf061(0x276)]('\x20\x20'+_0x8921be),console[_0x2cf061(0x276)]('\x0a'+a22_0x4b8b1a[_0x2cf061(0x2b5)]('To\x20cancel:')+_0x2cf061(0x297)+_0x374251[_0x2cf061(0x31d)]+_0x2cf061(0x2c9)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a22_0x39e7e0(0x2c3)]=a22_0x39e7e0(0x31e);[a22_0x39e7e0(0x220)]=a22_0x39e7e0(0x313);async[a22_0x39e7e0(0x2eb)](_0x54144b){const _0x35bdab=a22_0x39e7e0,{options:_0x36df25,args:_0x46c5b0,tdx:_0x268d64}=_0x54144b,_0x1ef8ce=_0x46c5b0[0x0]||_0x36df25[_0x35bdab(0x231)];if(!_0x1ef8ce)return showParentSegmentNotSetError(_0x35bdab(0x23b)+_0x35bdab(0x2c7)),0x1;_0x36df25[_0x35bdab(0x31b)]&&(console[_0x35bdab(0x276)](_0x35bdab(0x255)+_0x36df25['site']),console['error'](_0x35bdab(0x230)+_0x1ef8ce));const _0xb2f3be=await withSpinner(_0x35bdab(0x36e)+_0x1ef8ce+'\x27...',()=>_0x268d64[_0x35bdab(0x374)]['listFields'](_0x1ef8ce),{'verbose':_0x36df25['verbose']}),_0x587a44=_0xb2f3be[_0x35bdab(0x256)];console['error'](_0x35bdab(0x2e3)+_0x587a44[_0x35bdab(0x234)]+_0x35bdab(0x2a0)+(_0x587a44['length']!==0x1?'s':''));if(_0x36df25[_0x35bdab(0x27a)]||_0x36df25['jsonl'])return await handleSDKOutput(_0x587a44,_0x36df25),0x0;return displayFieldsHumanReadable(_0x587a44,_0x1ef8ce),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{['name']=a22_0x39e7e0(0x2a3);[a22_0x39e7e0(0x220)]='Show\x20parent\x20segment\x20details';async['execute'](_0x34cccc){const _0x4b611f=a22_0x39e7e0,{options:_0x23fd82,args:_0x3f552f,tdx:_0x2e037f}=_0x34cccc,_0x132726=_0x23fd82,_0x26a0b4=_0x3f552f[0x0]||_0x23fd82['parentSegment'];if(!_0x26a0b4)return showParentSegmentNotSetError(_0x4b611f(0x25e)+_0x4b611f(0x1f6)+_0x4b611f(0x281)+_0x4b611f(0x254)),0x1;_0x23fd82[_0x4b611f(0x31b)]&&(console[_0x4b611f(0x276)](_0x4b611f(0x255)+_0x23fd82[_0x4b611f(0x372)]),console[_0x4b611f(0x276)]('Parent\x20segment:\x20'+_0x26a0b4));const _0x2a0478=await withSpinner(_0x4b611f(0x308)+_0x26a0b4+_0x4b611f(0x1f8),()=>_0x2e037f[_0x4b611f(0x374)]['getParentFull'](_0x26a0b4),{'verbose':_0x23fd82[_0x4b611f(0x31b)]}),_0x5c1b95=_0x2a0478['data'];if(_0x132726[_0x4b611f(0x202)]){const _0x2cec9a=getConsoleNextUrl(_0x132726['site'],_0x4b611f(0x27e)+_0x5c1b95['id']);return console[_0x4b611f(0x276)](a22_0x4b8b1a[_0x4b611f(0x207)]('✔')+_0x4b611f(0x26e)+a22_0x4b8b1a['cyan'](_0x2cec9a)),openBrowser(_0x2cec9a),0x0;}return await handleSingleObjectOutput(_0x5c1b95,_0x23fd82),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a22_0x39e7e0(0x2c3)]='segment:parent:desc';[a22_0x39e7e0(0x220)]=a22_0x39e7e0(0x340);async[a22_0x39e7e0(0x2eb)](_0x5a2bd1){const _0x2511a2=a22_0x39e7e0,{options:_0x589c11,args:_0x84ae02,tdx:_0x2eab37}=_0x5a2bd1,_0x354713=_0x589c11,_0x58f452=_0x84ae02[0x0]||_0x589c11['parentSegment'];if(!_0x58f452)return showParentSegmentNotSetError(_0x2511a2(0x2d2)+_0x2511a2(0x2ce)+_0x2511a2(0x281)+_0x2511a2(0x2ff)),0x1;_0x589c11[_0x2511a2(0x31b)]&&(console[_0x2511a2(0x276)]('Site:\x20'+_0x589c11[_0x2511a2(0x372)]),console[_0x2511a2(0x276)](_0x2511a2(0x230)+_0x58f452));const _0x2818e5=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x58f452+_0x2511a2(0x1f8),()=>_0x2eab37[_0x2511a2(0x374)][_0x2511a2(0x2f3)](_0x58f452),{'verbose':_0x589c11['verbose']}),_0x4cd2c0=_0x2818e5[_0x2511a2(0x256)],_0x378117=_0x2eab37[_0x2511a2(0x374)][_0x2511a2(0x365)](_0x4cd2c0);if(_0x354713[_0x2511a2(0x2df)]){const _0x5a1bcd=await this['collectSchema'](_0x5a2bd1,_0x58f452,_0x4cd2c0,_0x378117),_0x33f278=this[_0x2511a2(0x341)](_0x5a1bcd);writeFileSync(_0x354713[_0x2511a2(0x2df)],_0x33f278);const _0x4e3543=_0x5a1bcd['customers']['columns'][_0x2511a2(0x234)]+_0x5a1bcd[_0x2511a2(0x324)][_0x2511a2(0x2fb)]((_0x4deb17,_0x4c5564)=>_0x4deb17+_0x4c5564[_0x2511a2(0x2f5)][_0x2511a2(0x234)],0x0),_0x4dd3cb=_0x5a1bcd[_0x2511a2(0x324)][_0x2511a2(0x368)](_0x5a9cb8=>_0x5a9cb8[_0x2511a2(0x2f5)][_0x2511a2(0x234)]===0x0)[_0x2511a2(0x234)];return console[_0x2511a2(0x26a)](_0x2511a2(0x2e8)+_0x354713[_0x2511a2(0x2df)]),console['log'](_0x2511a2(0x22b)+_0x378117),console['log'](_0x2511a2(0x214)+_0x5a1bcd[_0x2511a2(0x324)]['length']+_0x2511a2(0x326)),console[_0x2511a2(0x26a)]('\x20\x20Columns:\x20'+_0x4e3543+_0x2511a2(0x278)),_0x4dd3cb>0x0&&console['log'](_0x2511a2(0x275)+_0x4dd3cb+_0x2511a2(0x232)),0x0;}console[_0x2511a2(0x276)]('\x0a'+a22_0x4b8b1a['bold'](_0x2511a2(0x2e7))+'\x20'+a22_0x4b8b1a['cyan'](_0x378117));const _0x1dab02=await withSpinner(_0x2511a2(0x33a),()=>_0x2eab37[_0x2511a2(0x374)][_0x2511a2(0x356)](_0x4cd2c0),{'verbose':_0x589c11[_0x2511a2(0x31b)]});console[_0x2511a2(0x276)]('\x0a'+a22_0x4b8b1a['bold']('customers')+'\x20'+a22_0x4b8b1a[_0x2511a2(0x2b5)]('('+_0x378117+'.customers)'));const _0x12a56d=await executeSchemaQuery(_0x1dab02[_0x2511a2(0x256)],_0x2eab37,_0x589c11);await handleQueryOutput(_0x12a56d,_0x589c11);const _0x496dd7=await withSpinner(_0x2511a2(0x32b),()=>_0x2eab37['segment'][_0x2511a2(0x2d5)](_0x4cd2c0),{'verbose':_0x589c11['verbose']});for(const _0x151e13 of _0x496dd7[_0x2511a2(0x256)]){const _0x18f251=_0x2511a2(0x360)+_0x151e13[_0x2511a2(0x302)]()[_0x2511a2(0x34c)](/\s+/g,'_'),_0x48889d=_0x2511a2(0x29a)+_0x378117+'.'+_0x18f251;console[_0x2511a2(0x276)]('\x0a'+a22_0x4b8b1a[_0x2511a2(0x29e)](_0x151e13)+'\x20'+a22_0x4b8b1a[_0x2511a2(0x2b5)]('('+_0x378117+'.'+_0x18f251+')'));try{const _0x297600=await executeSchemaQuery(_0x48889d,_0x2eab37,_0x589c11);await handleQueryOutput(_0x297600,_0x589c11);}catch{console[_0x2511a2(0x276)](a22_0x4b8b1a[_0x2511a2(0x32e)](_0x2511a2(0x301)));}}return 0x0;}async[a22_0x39e7e0(0x328)](_0x5b4dc8,_0x2f2746,_0x373ae7,_0x163c48){const _0x38b41f=a22_0x39e7e0,{options:_0x5497ee,tdx:_0x6f864b}=_0x5b4dc8,_0x4977e9=await withSpinner(_0x38b41f(0x33a),()=>_0x6f864b[_0x38b41f(0x374)]['getParentSQL'](_0x373ae7),{'verbose':_0x5497ee[_0x38b41f(0x31b)]}),_0x155315=await executeSchemaQuery(_0x4977e9[_0x38b41f(0x256)],_0x6f864b,_0x5497ee),_0x4df7c0=_0x155315[_0x38b41f(0x256)]['map'](_0x363936=>({'name':_0x363936[_0x38b41f(0x262)],'type':_0x363936[_0x38b41f(0x20a)]})),_0x4680bf=await withSpinner(_0x38b41f(0x32b),()=>_0x6f864b['segment'][_0x38b41f(0x2d5)](_0x373ae7),{'verbose':_0x5497ee['verbose']}),_0x2ec66c=[];for(const _0x53f8f7 of _0x4680bf[_0x38b41f(0x256)]){const _0x22156b=_0x38b41f(0x360)+_0x53f8f7[_0x38b41f(0x302)]()['replace'](/\s+/g,'_'),_0x52d13d=_0x38b41f(0x29a)+_0x163c48+'.'+_0x22156b;let _0x427231=[];try{const _0x44984c=await executeSchemaQuery(_0x52d13d,_0x6f864b,_0x5497ee);_0x427231=_0x44984c[_0x38b41f(0x256)]['map'](_0x28b0d7=>({'name':_0x28b0d7['column_name'],'type':_0x28b0d7[_0x38b41f(0x20a)]}));}catch{}_0x2ec66c[_0x38b41f(0x2bb)]({'table':_0x22156b,'columns':_0x427231});}return{'database':_0x163c48,'parent_segment':_0x2f2746,'parent_id':_0x373ae7,'customers':{'table':_0x38b41f(0x1f9),'columns':_0x4df7c0},'behaviors':_0x2ec66c};}[a22_0x39e7e0(0x341)](_0x216836){const _0x167f29=a22_0x39e7e0,_0x3f93cc=_0x442c3b=>{const _0x1d0979=a22_0x11d6;if(_0x442c3b[_0x1d0979(0x234)]===0x0)return'[]';const _0x2c244f=_0x442c3b[_0x1d0979(0x284)](_0x19af85=>_0x1d0979(0x22a)+_0x19af85[_0x1d0979(0x2c3)]+'\x22,\x20\x22type\x22:\x20\x22'+_0x19af85[_0x1d0979(0x20d)]+_0x1d0979(0x29c));return'[\x0a'+_0x2c244f['join'](',\x0a')+_0x1d0979(0x32d);},_0x415e8e=_0x216836[_0x167f29(0x324)][_0x167f29(0x284)](_0x561c94=>{const _0x255dc3=_0x167f29;return _0x255dc3(0x2e0)+_0x561c94[_0x255dc3(0x2b0)]+_0x255dc3(0x28e)+_0x3f93cc(_0x561c94[_0x255dc3(0x2f5)])[_0x255dc3(0x34c)](/^/gm,'\x20\x20')[_0x255dc3(0x23a)]()+_0x255dc3(0x2bf);})[_0x167f29(0x1fb)](',\x0a');return'{\x0a\x20\x20\x22database\x22:\x20\x22'+_0x216836['database']+'\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22'+_0x216836[_0x167f29(0x233)]+_0x167f29(0x298)+_0x216836[_0x167f29(0x2e2)]+'\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22'+_0x216836[_0x167f29(0x1f9)][_0x167f29(0x2b0)]+_0x167f29(0x2d6)+_0x3f93cc(_0x216836[_0x167f29(0x1f9)][_0x167f29(0x2f5)])[_0x167f29(0x34c)](/^/gm,'\x20\x20')[_0x167f29(0x23a)]()+_0x167f29(0x219)+_0x415e8e+_0x167f29(0x27b);}}export class ParentSegmentSQLCommand extends BaseCommand{[a22_0x39e7e0(0x2c3)]='segment:parent:sql';['description']='Get\x20SQL\x20query\x20for\x20parent\x20segment';async[a22_0x39e7e0(0x2eb)](_0x2ace3f){const _0x321b76=a22_0x39e7e0,{options:_0x497390,args:_0x39623f,tdx:_0x202d42}=_0x2ace3f,_0x50e73f=_0x39623f[0x0]||_0x497390[_0x321b76(0x231)];if(!_0x50e73f)return showParentSegmentNotSetError(_0x321b76(0x314)+_0x321b76(0x355)),0x1;_0x497390[_0x321b76(0x31b)]&&(console['error'](_0x321b76(0x255)+_0x497390['site']),console['error'](_0x321b76(0x230)+_0x50e73f));const _0x4b3915=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x50e73f+_0x321b76(0x1f8),()=>_0x202d42[_0x321b76(0x374)][_0x321b76(0x2f3)](_0x50e73f),{'verbose':_0x497390[_0x321b76(0x31b)]}),_0x3713a1=_0x4b3915[_0x321b76(0x256)],_0x64a18e=await withSpinner(_0x321b76(0x269)+_0x50e73f+_0x321b76(0x1f8),()=>_0x202d42[_0x321b76(0x374)][_0x321b76(0x356)](_0x3713a1),{'verbose':_0x497390[_0x321b76(0x31b)]}),_0x1c5cb7=_0x64a18e[_0x321b76(0x256)];return _0x497390[_0x321b76(0x223)]===_0x321b76(0x27a)||_0x497390[_0x321b76(0x223)]==='jsonl'?await handleSDKOutput([{'sql':_0x1c5cb7}],_0x497390):console[_0x321b76(0x26a)](_0x1c5cb7),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{['name']=a22_0x39e7e0(0x339);[a22_0x39e7e0(0x220)]=a22_0x39e7e0(0x2c5);async[a22_0x39e7e0(0x2eb)](_0xb132b3){const _0x422eed=a22_0x39e7e0,{options:_0x148481,args:_0x45bc3d,tdx:_0x31b185}=_0xb132b3,_0x4538fe=_0x45bc3d[0x0]||_0x148481[_0x422eed(0x231)];if(!_0x4538fe)return showParentSegmentNotSetError(_0x422eed(0x2c0)+_0x422eed(0x2ee)),0x1;_0x148481[_0x422eed(0x31b)]&&(console[_0x422eed(0x276)](_0x422eed(0x255)+_0x148481[_0x422eed(0x372)]),console[_0x422eed(0x276)](_0x422eed(0x230)+_0x4538fe));const _0x14cd7f=await withSpinner(_0x422eed(0x24f)+_0x4538fe+'\x27...',()=>_0x31b185[_0x422eed(0x374)][_0x422eed(0x2f3)](_0x4538fe),{'verbose':_0x148481[_0x422eed(0x31b)]}),_0x1dc2e8=_0x14cd7f[_0x422eed(0x256)],_0xbd52f7=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x4538fe+_0x422eed(0x1f8),()=>_0x31b185[_0x422eed(0x374)][_0x422eed(0x356)](_0x1dc2e8),{'verbose':_0x148481[_0x422eed(0x31b)]});let _0x43f8ff=_0xbd52f7[_0x422eed(0x256)];const _0x11ea4d=resolveLimit(_0x148481[_0x422eed(0x280)],DEFAULT_DISPLAY_LIMIT),_0x5e4c8a=/\bLIMIT\s+\d+/i[_0x422eed(0x289)](_0x43f8ff);!_0x5e4c8a&&(_0x43f8ff=_0x43f8ff['trim']()[_0x422eed(0x34c)](/;+$/,''),_0x43f8ff='SELECT\x20*\x20FROM\x20(\x0a'+_0x43f8ff+_0x422eed(0x227)+_0x11ea4d);_0x148481['verbose']&&console[_0x422eed(0x276)](_0x422eed(0x346)+_0x43f8ff);const _0x4287ae=await withProgressSpinner(_0x422eed(0x32a),async _0x42e93c=>{const _0x1aa479=_0x422eed,_0x15390e=await _0x31b185[_0x1aa479(0x349)]['execute'](_0x43f8ff,{'catalog':'td','schema':_0x1aa479(0x337),'onJobId':_0x1603eb=>{const _0x456274=_0x1aa479;_0x42e93c[_0x456274(0x2ad)](_0x1603eb);}});return _0x15390e;},{'verbose':_0x148481[_0x422eed(0x31b)]}),_0x264483=_0x4287ae[_0x422eed(0x256)],_0x35b651=_0x264483[_0x422eed(0x2b7)]?'\x20[Job\x20ID:\x20'+_0x264483[_0x422eed(0x2b7)]+']':'';return console['error'](_0x422eed(0x33d)+_0x264483[_0x422eed(0x1f7)][_0x422eed(0x2d7)][_0x422eed(0x353)]()+'\x20rows\x20'+('in\x20'+formatElapsed(_0x264483[_0x422eed(0x1f7)][_0x422eed(0x228)])+_0x35b651)),await handleQueryOutput(_0x264483,_0x148481),0x0;}}export class PSRtListCommand extends BaseCommand{[a22_0x39e7e0(0x2c3)]=a22_0x39e7e0(0x2a7);['description']='List\x20parent\x20segments\x20with\x20RT\x202.0\x20status';async['execute'](_0x335f76){const _0x2562b5=a22_0x39e7e0,{options:_0x4b646f,args:_0x75e15,tdx:_0x4f4595}=_0x335f76,_0x7e1d83=_0x75e15[0x0],_0x4e53e1=await withSpinner(_0x7e1d83?_0x2562b5(0x2a9)+_0x7e1d83+_0x2562b5(0x1f8):_0x2562b5(0x2af),()=>_0x4f4595[_0x2562b5(0x2b2)]['list'](),{'verbose':_0x4b646f[_0x2562b5(0x31b)]});let _0x4e088e=_0x4e53e1['data'][_0x2562b5(0x368)](_0x3160be=>_0x3160be[_0x2562b5(0x253)]);if(_0x7e1d83){const _0x53b104=_0x7e1d83[_0x2562b5(0x34c)](/[.+^${}()|[\]\\]/g,_0x2562b5(0x236))[_0x2562b5(0x34c)](/\*/g,'.*')[_0x2562b5(0x34c)](/\?/g,'.'),_0x11b216=new RegExp('^'+_0x53b104+'$','i');_0x4e088e=_0x4e088e[_0x2562b5(0x368)](_0x28ac11=>_0x11b216[_0x2562b5(0x289)](_0x28ac11['name']));}_0x4e088e[_0x2562b5(0x331)]((_0x1700e0,_0x2c9555)=>_0x1700e0[_0x2562b5(0x2c3)][_0x2562b5(0x29f)](_0x2c9555[_0x2562b5(0x2c3)])),console['error'](_0x2562b5(0x2e3)+_0x4e088e[_0x2562b5(0x234)]+_0x2562b5(0x240)+(_0x4e088e['length']!==0x1?'s':''));const _0x4b5f16=_0x268db4=>{const _0x222b40=_0x2562b5;return getConsoleNextUrl(_0x4b646f[_0x222b40(0x372)],_0x222b40(0x27e)+_0x268db4);};if(_0x4b646f[_0x2562b5(0x223)]==='json'||_0x4b646f[_0x2562b5(0x223)]===_0x2562b5(0x35c)){const _0x11ebc4=_0x4e088e[_0x2562b5(0x284)](_0x2c5f5b=>({..._0x2c5f5b,'url':_0x4b5f16(_0x2c5f5b['id'])}));await handleSDKOutput(_0x11ebc4,_0x4b646f);}else{if(_0x4e088e[_0x2562b5(0x234)]===0x0)console['log']('No\x20RT-enabled\x20parent\x20segments\x20found');else for(const _0x5dffbe of _0x4e088e){const _0x3daa7e=_0x5dffbe[_0x2562b5(0x376)]?a22_0x4b8b1a['dim']('\x20('+formatRows(_0x5dffbe[_0x2562b5(0x376)])+')'):'',_0x559d33=hyperlink(_0x5dffbe[_0x2562b5(0x2c3)],_0x4b5f16(_0x5dffbe['id']));console[_0x2562b5(0x26a)]('⚡\x20'+_0x559d33+_0x3daa7e);}}return 0x0;}}export class PSRtValidateCommand extends BaseParentSegmentCommand{[a22_0x39e7e0(0x2c3)]=a22_0x39e7e0(0x2b4);[a22_0x39e7e0(0x220)]=a22_0x39e7e0(0x35e);async[a22_0x39e7e0(0x2eb)](_0x3af984){const _0x5e92b0=a22_0x39e7e0,{options:_0x5e086d,args:_0x1298a1,tdx:_0x15b62d}=_0x3af984,_0x3f184d=_0x1298a1[0x0]||_0x5e086d[_0x5e92b0(0x231)];if(!_0x3f184d)return showParentSegmentNotSetError(_0x5e92b0(0x261)+_0x5e92b0(0x2c6)),0x1;const _0x3a70e4=resolveYamlFile(_0x3f184d);if(!existsSync(_0x3a70e4))return showFileNotFoundError(_0x3a70e4,_0x3f184d),0x1;let _0x2155ec;try{_0x2155ec=readFileSync(_0x3a70e4,_0x5e92b0(0x27d));}catch(_0x378a84){const _0x22c7cb=_0x378a84 instanceof Error?_0x378a84[_0x5e92b0(0x2aa)]:String(_0x378a84);return console[_0x5e92b0(0x276)](_0x5e92b0(0x279)+_0x22c7cb),0x1;}const _0x3fb25d=createCommandSpinner(a22_0x4b8b1a[_0x5e92b0(0x2b5)](_0x5e92b0(0x363)),{'verbose':_0x5e086d['verbose']});_0x3fb25d['start']();const _0x35bb5f={'realtime':!![],'onProgress':_0x57687a=>{_0x3fb25d['text']=formatProgressMessage(_0x57687a);}};let _0x5ece6f;try{_0x5ece6f=await _0x15b62d['segment']['validateParentYaml'](_0x2155ec,_0x35bb5f),_0x3fb25d[_0x5e92b0(0x352)]();}catch(_0x1cce46){_0x3fb25d[_0x5e92b0(0x352)]();throw _0x1cce46;}console[_0x5e92b0(0x276)]('\x0a'+a22_0x4b8b1a[_0x5e92b0(0x29e)](_0x5e92b0(0x364))+'\x20'+_0x5ece6f[_0x5e92b0(0x2c3)]),console[_0x5e92b0(0x276)]('═'[_0x5e92b0(0x306)](0x3c)),displayRealtimeValidation(_0x5ece6f),console[_0x5e92b0(0x276)]('─'['repeat'](0x3c));if(_0x5ece6f[_0x5e92b0(0x21a)]['length']>0x0){console[_0x5e92b0(0x276)]('\x0a'+a22_0x4b8b1a[_0x5e92b0(0x267)](_0x5e92b0(0x2e1)));for(const _0x433e5b of _0x5ece6f[_0x5e92b0(0x21a)]){console[_0x5e92b0(0x276)]('\x20\x20'+a22_0x4b8b1a[_0x5e92b0(0x267)]('•')+'\x20'+_0x433e5b);}}return _0x5ece6f['allValid']&&console[_0x5e92b0(0x276)]('\x0a'+a22_0x4b8b1a[_0x5e92b0(0x207)]('✔')+_0x5e92b0(0x28f)),_0x5ece6f[_0x5e92b0(0x242)]?0x0:0x1;}}export class PSPzListCommand extends BaseCommand{[a22_0x39e7e0(0x2c3)]=a22_0x39e7e0(0x2de);[a22_0x39e7e0(0x220)]=a22_0x39e7e0(0x250);async[a22_0x39e7e0(0x2eb)](_0x2d2bfb){const _0x45e461=a22_0x39e7e0,{options:_0x3d6976,args:_0x5b5658,tdx:_0x182bdd}=_0x2d2bfb,_0x7bbd91=_0x5b5658[0x0]||_0x3d6976[_0x45e461(0x231)];if(!_0x7bbd91)return showParentSegmentNotSetError(_0x45e461(0x362)+_0x45e461(0x35f)),0x1;const _0xf28426=await withSpinner(_0x45e461(0x24f)+_0x7bbd91+_0x45e461(0x1f8),()=>_0x182bdd[_0x45e461(0x374)][_0x45e461(0x2f3)](_0x7bbd91),{'verbose':_0x3d6976['verbose']}),_0x466415=_0xf28426[_0x45e461(0x256)],_0x4e10f0=await withSpinner(_0x45e461(0x264)+_0x7bbd91+_0x45e461(0x1f8),()=>_0x182bdd['personalization'][_0x45e461(0x377)](_0x466415),{'verbose':_0x3d6976['verbose']}),_0x3eb35e=_0x4e10f0['data'];console[_0x45e461(0x276)]('✔\x20Found\x20'+_0x3eb35e[_0x45e461(0x234)]+_0x45e461(0x2d0)+(_0x3eb35e['length']!==0x1?'s':''));if(_0x3d6976[_0x45e461(0x223)]===_0x45e461(0x27a)||_0x3d6976['format']==='jsonl')await handleSDKOutput(_0x3eb35e,_0x3d6976);else{if(_0x3eb35e[_0x45e461(0x234)]===0x0)console[_0x45e461(0x26a)]('No\x20personalization\x20services\x20configured'),console['error'](a22_0x4b8b1a[_0x45e461(0x2f9)](_0x45e461(0x23f)));else for(const _0x3ca986 of _0x3eb35e){const _0x3dd487=_0x3ca986['sections']?.['length']||0x0,_0x33796b=_0x3ca986[_0x45e461(0x2ea)]?a22_0x4b8b1a[_0x45e461(0x2b5)](_0x45e461(0x36a)+_0x3ca986[_0x45e461(0x2ea)]):'',_0x2f059c=a22_0x4b8b1a[_0x45e461(0x2b5)]('\x20('+_0x3dd487+_0x45e461(0x23e)+(_0x3dd487!==0x1?'s':'')+')');console[_0x45e461(0x26a)]('\x20\x20'+_0x3ca986[_0x45e461(0x2c3)]+_0x33796b+_0x2f059c),_0x3ca986[_0x45e461(0x220)]&&console[_0x45e461(0x26a)](_0x45e461(0x288)+a22_0x4b8b1a['dim'](_0x3ca986[_0x45e461(0x220)]));}}return 0x0;}}export class PSPzInitCommand extends BaseParentSegmentCommand{[a22_0x39e7e0(0x2c3)]='ps:pz:init';[a22_0x39e7e0(0x220)]='Add\x20template\x20personalization\x20section\x20to\x20parent\x20segment\x20YAML';async['execute'](_0x5586b9){const _0x1ef9a7=a22_0x39e7e0,{options:_0x5b50a3,args:_0x559371}=_0x5586b9,_0x31fe56=_0x559371[0x0]||_0x5b50a3[_0x1ef9a7(0x231)];if(!_0x31fe56)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20init\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Add\x20PZ\x20template\x20(requires\x20context)\x0a'+'\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 _0x122fbf=resolveYamlFile(_0x31fe56);if(!existsSync(_0x122fbf))return showFileNotFoundError(_0x122fbf,_0x31fe56),0x1;let _0x28a867;try{_0x28a867=readFileSync(_0x122fbf,'utf-8');}catch(_0x1606cb){const _0x5c0aac=_0x1606cb instanceof Error?_0x1606cb[_0x1ef9a7(0x2aa)]:String(_0x1606cb);return console[_0x1ef9a7(0x276)](_0x1ef9a7(0x279)+_0x5c0aac),0x1;}let _0x4210dd;try{_0x4210dd=parseDef(_0x28a867);}catch(_0x59637b){const _0x50082a=_0x59637b instanceof Error?_0x59637b[_0x1ef9a7(0x2aa)]:String(_0x59637b);return console[_0x1ef9a7(0x276)](a22_0x4b8b1a[_0x1ef9a7(0x267)]('Error\x20parsing\x20YAML:\x20'+_0x50082a)),0x1;}if(_0x4210dd[_0x1ef9a7(0x2f0)]&&_0x4210dd[_0x1ef9a7(0x2f0)][_0x1ef9a7(0x234)]>0x0)return console[_0x1ef9a7(0x276)](a22_0x4b8b1a[_0x1ef9a7(0x32e)](_0x1ef9a7(0x273)+_0x122fbf)),console[_0x1ef9a7(0x276)](a22_0x4b8b1a[_0x1ef9a7(0x2b5)](_0x1ef9a7(0x217)+_0x4210dd[_0x1ef9a7(0x2f0)][_0x1ef9a7(0x234)]+_0x1ef9a7(0x37f))),0x1;!_0x4210dd['realtime']&&(_0x4210dd[_0x1ef9a7(0x2b2)]={'events':[{'name':_0x1ef9a7(0x257),'source_table':_0x1ef9a7(0x251)}],'attributes':[{'name':'last_page_viewed','type':'single'}],'id_stitching':{'primary_key':_0x4210dd[_0x1ef9a7(0x32f)][_0x1ef9a7(0x2b0)]==='customers'?_0x1ef9a7(0x21e):_0x1ef9a7(0x272)}});_0x4210dd['personalization_services']=[{'name':'My\x20Service','description':_0x1ef9a7(0x309),'trigger_event':_0x1ef9a7(0x257),'sections':[{'name':_0x1ef9a7(0x2fc),'criteria':_0x1ef9a7(0x25c),'attributes':[_0x1ef9a7(0x2ef)]}]}];const _0x44dfc6=serializeDef(_0x4210dd);return writeFileSync(_0x122fbf,_0x44dfc6,'utf-8'),console['error'](a22_0x4b8b1a[_0x1ef9a7(0x207)]('✔')+'\x20Added\x20personalization\x20template\x20to\x20'+a22_0x4b8b1a['cyan'](_0x122fbf)),(!_0x4210dd[_0x1ef9a7(0x2b2)]||_0x28a867[_0x1ef9a7(0x34e)]('realtime:')===-0x1)&&console[_0x1ef9a7(0x276)](a22_0x4b8b1a[_0x1ef9a7(0x207)]('✔')+_0x1ef9a7(0x2b3)),console[_0x1ef9a7(0x276)]('\x0a'+a22_0x4b8b1a['dim'](_0x1ef9a7(0x25b))),console['error'](_0x1ef9a7(0x28a)+_0x122fbf+_0x1ef9a7(0x225)),console[_0x1ef9a7(0x276)](_0x1ef9a7(0x319)+a22_0x4b8b1a[_0x1ef9a7(0x2b5)]('tdx\x20ps\x20push\x20'+_0x31fe56)+_0x1ef9a7(0x2d8)),0x0;}}
|
|
1
|
+
const a22_0x1e960b=a22_0x5bb3;function a22_0x4725(){const _0x2bfafd=['Usage:\x20tdx\x20ps\x20pz\x20init\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Add\x20PZ\x20template\x20(requires\x20context)\x0a','\x20+\x20[','segment:parent:create','Pattern:\x20','personalization','Table:\x20','ignore','database','\x20\x202.\x20Run\x20','using\x20the\x20default\x20path:\x20','Fetching\x20current\x20configuration\x20for\x20\x27','foreignKey','message','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','matchedCount','\x20\x20Database:\x20','scheduleOption','\x20tdx\x20wf\x20attempt\x20','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','green','\x20\x20\x20','utf-8','\x20--attribute\x20\x22<name>\x22','xdg-open','Available\x20behaviors:','\x20--enriched','updateParent','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','Get\x20SQL\x20query\x20for\x20parent\x20segment','yes','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','toLocaleString','ID\x20Stitching:','validateParentYaml','parentSegment','events','elapsedTimeMillis','label','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','workflowAttemptId','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','run','list','Show\x20parent\x20segment\x20details','\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a','apply','Errors:','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','\x27\x20with\x20ID:\x20','30mwDMvx','-1d','\x20=\x20','Create\x20parent\x20segment\x20\x27','stitchingKeys','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','in\x20','trigger_event','3502933XfsASo','Database:\x20','columns','Output\x20Database:','SELECT\x20*\x20FROM\x20(\x0a','1116035nzBCTZ','Found\x20YAML\x20file:\x20','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','segment:parent:list','segment:parent:desc','workflowSessionId','<database>.<table>','Aborted.','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','Fetching\x20SQL\x20for\x20\x27','all','displayMasterInfo','listFields','enriched','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','\x20--interval\x20','enabled','`\x20to\x20download\x20the\x20configuration\x20first','SELECT\x20*\x20FROM\x20','resolveParentId','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','To\x20cancel:','description','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','Behavior:','Error\x20parsing\x20YAML:\x20','\x0aNo\x20sample\x20data\x20available','parent_segment','stop','Options\x20(one\x20required):\x0a','jsonl','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','customersWithEvents','\x20\x20\x20\x20','Creating\x20parent\x20segment\x20\x27','To\x20view\x20sample\x20data:','Parent\x20segment:\x20','ps:rt:validate','Validating\x20configuration...','RT\x202.0\x20Validate:','Listing\x20RT-enabled\x20parent\x20segments\x20matching\x20\x27','behaviorsFile','\x0a\x20\x20]\x0a}\x0a','Error:\x20--attribute\x20requires\x20a\x20name\x0a','last_page_viewed','use','td_client_id','Executing\x20parent\x20segment\x20query...','rowCount','scheduleType','customerPercent','segment:parent:push','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','RT\x202.0:','Listing\x20parent\x20segments\x20matching\x20\x27','varchar','displayRealtimeInfo','filter','getBehaviorNames','segment:parent:run','\x20is\x20already\x20up\x20to\x20date','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','\x20\x20Columns:\x20','audienceId','Validate:','sourceTableValid','yellow','Columns:','getParentFull','double','bold','Creating','indexOf','sort','table','Site:\x20','column','/sessions/','behavior_','segment:parent:show','/\x20and\x20','interval','\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','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','Error:','⚠️\x20\x20personalization_services\x20section\x20already\x20exists\x20in\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','/\x20directory.\x0a','coveragePercent','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','Updating\x20parent\x20segment\x20\x27','/\x20directories\x20exist.','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','Validating\x20RT\x20configuration...','column_type','preview','\x20section','createParent','getOutputDatabaseName','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','Resolving\x20parent\x20segment\x20\x27','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','Updating','YAML\x20file:\x20','Options:\x0a','Fetching\x20customers\x20schema...','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','Listing\x20personalization\x20services\x20for\x20\x27','red','Error\x20reading\x20file:\x20','behavior','\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22','primaryKey','Session:','format','Fetching\x20behavior\x20list...','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','text','Next\x20steps:','\x20\x20Note:\x20','customerGroup','Default','segment:parent:validate','✔\x20Created\x20parent\x20segment\x20\x27','Events:','\x0aNew\x20parent\x20segment\x20\x27','/app/dw/parentSegments/','json','information_schema','dim','tdx\x20ps\x20push\x20','\x20kill','Customers:','repeat','Usage:\x20tdx\x20ps\x20pz\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20PZ\x20services\x20(requires\x20context)\x0a','👥\x20','platform','\x20personalization\x20service','sections','\x0aChanges\x20to\x20apply\x20to\x20\x27','ps:rt:list','Analyzing\x20changes...','timezone','segment:parent:view','verbose','joinKey','map','displayBehaviorsStats','List\x20available\x20fields\x20for\x20segmentation','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','execute','test','realtime:','stats','List\x20personalization\x20services\x20for\x20a\x20parent\x20segment','true','\x27...','displaySampleData','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','string','attributes','displayPreviewHints','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','start','\x22,\x20\x22type\x22:\x20\x22','addAttributesFile','Schema\x20saved\x20to\x20','\x20to\x20push\x20the\x20configuration','.customers)','pushParentYaml','Show\x20parent\x20segment\x20schema\x20(column\x20types)','formatSchemaJson','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','Output\x20file:\x20','\x20Opening\x20','\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','\x20field','.yaml','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','displaySummary','\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22','2159768rFRenB','user_id','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','✔\x20Renamed\x20directory\x20to\x20','page_view','\x20\x201.\x20Edit\x20','personalization_services','runParent','Personalization:','\x27\x20and\x20run\x20workflow?','totalEvents','toLowerCase','\x20\x20No\x20sample\x20data\x20available','Master:','Overwrite\x20\x27','14609268HUDXgV','previewParentYaml','length','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','Updated','\x20\x20\x20\x20\x20\x20','column_name','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','reduce','\x20Context\x20set:\x20','realtime_enabled','\x20parent\x20segment\x20\x27','Attempt:','\x0a\x20\x20\x20\x20}','⚡\x20Enabled','customerGroupFile','attribute','behaviors','open','errors','replace','\x20rows\x20','tdx\x20ps\x20preview\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','✔\x20Found\x20','darwin','allValid','\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','Error:\x20Parent\x20segment\x20name\x20is\x20required','log','/\x20→\x20','segment:parent:preview','8622BHtIKX','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','Fetching\x20parent\x20segment\x20\x27','Enriched:','data','\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20','limit','sampleData','customers','\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','setJobId','Name:\x20','\x0aTip:\x20Run\x20`tdx\x20ps\x20pz\x20init`\x20to\x20add\x20a\x20template\x20personalization\x20section\x20to\x20your\x20YAML','⚡\x20Not\x20enabled','\x22\x20}','Options:','pullParentYaml','\x0aChanges\x20to\x20\x27','\x20parent\x20segment','Created','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','status','addBehaviors','Listing\x20fields\x20for\x20\x27','Rows:','\x20to\x20configure\x20your\x20personalization\x20service','population','personalizationServices','Source:','site','\x20Configuration\x20is\x20valid','segment','1481896LahAJs','No\x20parent\x20segments\x20match\x20pattern:\x20','\x0a\x20\x20\x20\x20]','cyan','%)\x20','toFixed','localeCompare','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','query','\x0aError:','\x5c$&','parent_segments','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','output','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','ps:pz:init','\x20\x20\x20\x20-\x20','1404663MGBXGG','Join\x20on:','session','\x20--behavior\x20\x22','Status:','error','\x20trigger=','Error:\x20--behavior\x20requires\x20a\x20name\x0a','\x20--attribute\x20\x22','listParents','\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)','displayColumns','{\x0a\x20\x20\x22database\x22:\x20\x22','Join:','realtime','idStitching','workflowId','name','master','.yml','Apply\x20changes\x20to\x20\x27','displayValidateResults','\x20[Job\x20ID:\x20','\x27\x20is\x20up\x20to\x20date','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','addBehaviorsFile','schemaValid','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','\x0aUsage:\x20tdx\x20ps\x20preview\x20','sourceTableError','endsWith','keys','179zkVOOY','join','\x0a⚠️\x20\x20Both\x20','\x20configured','getParentSQL','\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)','\x20total','displayAttributesStats'];a22_0x4725=function(){return _0x2bfafd;};return a22_0x4725();}(function(_0x27de84,_0x19e83e){const _0x3b97fe=a22_0x5bb3,_0x11cbc8=_0x27de84();while(!![]){try{const _0x29fcb0=-parseInt(_0x3b97fe(0xa9))/0x1*(-parseInt(_0x3b97fe(0x1d6))/0x2)+-parseInt(_0x3b97fe(0x209))/0x3+-parseInt(_0x3b97fe(0x1a7))/0x4+parseInt(_0x3b97fe(0xef))/0x5*(-parseInt(_0x3b97fe(0xe2))/0x6)+parseInt(_0x3b97fe(0xea))/0x7+-parseInt(_0x3b97fe(0x1f8))/0x8+parseInt(_0x3b97fe(0x1b6))/0x9;if(_0x29fcb0===_0x19e83e)break;else _0x11cbc8['push'](_0x11cbc8['shift']());}catch(_0x30589b){_0x11cbc8['push'](_0x11cbc8['shift']());}}}(a22_0x4725,0x8f0b1));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a22_0x45f45f 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}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 a22_0x45efeb 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=a22_0x1e960b(0x203),LEGACY_PARENT_SEGMENT_DIR=a22_0x1e960b(0x10b);function a22_0x5bb3(_0x7a74c9,_0x157c4b){_0x7a74c9=_0x7a74c9-0x99;const _0x4725fc=a22_0x4725();let _0x5bb339=_0x4725fc[_0x7a74c9];return _0x5bb339;}function openBrowser(_0x210e9f){const _0x3a4d39=a22_0x1e960b,_0x34039b=process[_0x3a4d39(0x178)],_0x1dc9b1=_0x34039b===_0x3a4d39(0x1cf)?_0x3a4d39(0x1c8):_0x34039b==='win32'?'start':_0x3a4d39(0xc8);spawn(_0x1dc9b1,[_0x210e9f],{'detached':!![],'stdio':_0x3a4d39(0xb7)})['unref']();}function migrateLegacyDirectory(){const _0x3689a0=a22_0x1e960b;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x3fb5a7=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x3fb5a7['isDirectory']())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x3689a0(0x20e)](a22_0x45efeb[_0x3689a0(0x132)](_0x3689a0(0xab)+LEGACY_PARENT_SEGMENT_DIR+_0x3689a0(0x140)+PARENT_SEGMENT_DIR+_0x3689a0(0x14b))),console[_0x3689a0(0x20e)](a22_0x45efeb[_0x3689a0(0x171)](_0x3689a0(0xa4)+LEGACY_PARENT_SEGMENT_DIR+_0x3689a0(0x147))),![];console[_0x3689a0(0x20e)](a22_0x45efeb['yellow']('\x0a⚠️\x20\x20Migrating:\x20'+LEGACY_PARENT_SEGMENT_DIR+_0x3689a0(0x1d4)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x3689a0(0x20e)](a22_0x45efeb['green'](_0x3689a0(0x1aa)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x420a24){const _0x1a784a=_0x420a24 instanceof Error?_0x420a24[_0x3689a0(0xbd)]:String(_0x420a24);return console['error'](a22_0x45efeb['red']('✘\x20Failed\x20to\x20rename\x20directory:\x20'+_0x1a784a+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a22_0x1e960b(0xda)](_0x14a78f){return migrateLegacyDirectory(),super['run'](_0x14a78f);}}function resolveYamlFile(_0x2a77a1){const _0x58c6b3=a22_0x1e960b;if(_0x2a77a1[_0x58c6b3(0xa7)](_0x58c6b3(0x9c))||_0x2a77a1[_0x58c6b3(0xa7)](_0x58c6b3(0x1a3)))return _0x2a77a1;return a22_0x45f45f[_0x58c6b3(0xaa)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x2a77a1)+_0x58c6b3(0x9c));}function formatProgressMessage(_0x260da6){const _0x555701=a22_0x1e960b,_0x113495=_0x260da6['match'](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x113495){const [,_0xeabf0c,_0x284b62,_0xf7e941='']=_0x113495;return a22_0x45efeb[_0x555701(0x171)](_0xeabf0c+':')+'\x20'+_0x284b62+a22_0x45efeb['dim'](_0xf7e941);}return a22_0x45efeb[_0x555701(0x171)](_0x260da6);}function showFileNotFoundError(_0x5eb1b1,_0x1cc3dc){const _0x166c33=a22_0x1e960b;console[_0x166c33(0x20e)](a22_0x45efeb[_0x166c33(0x15c)]('Error:\x20File\x20not\x20found:\x20'+_0x5eb1b1+'\x0a')),console[_0x166c33(0x20e)](a22_0x45efeb[_0x166c33(0x1fb)](_0x166c33(0x15a)+_0x1cc3dc+_0x166c33(0x101)));}function displayRealtimeValidation(_0x36db4a){const _0x12a6b4=a22_0x1e960b;if(!_0x36db4a[_0x12a6b4(0x217)])return;const _0x3c9d34=_0x36db4a[_0x12a6b4(0x217)],_0x5147a0=_0x3c9d34[_0x12a6b4(0x100)]?a22_0x45efeb[_0x12a6b4(0xc4)](_0x12a6b4(0x1c4)):a22_0x45efeb[_0x12a6b4(0x132)](_0x12a6b4(0x1e5));console['error']('\x0a'+a22_0x45efeb['dim'](_0x12a6b4(0x125))+'\x20'+_0x5147a0);if(_0x3c9d34['events']&&_0x3c9d34[_0x12a6b4(0xd4)][_0x12a6b4(0x1b8)]>0x0){console['error']('\x20\x20'+a22_0x45efeb['dim'](_0x12a6b4(0x16c))+'\x20'+_0x3c9d34[_0x12a6b4(0xd4)]['length']+_0x12a6b4(0xac));for(const _0x10cc61 of _0x3c9d34[_0x12a6b4(0xd4)]){const _0x3162b8=_0x10cc61[_0x12a6b4(0x131)]===![]?a22_0x45efeb['red']('✘'):a22_0x45efeb[_0x12a6b4(0xc4)]('✔');console[_0x12a6b4(0x20e)]('\x20\x20\x20\x20'+_0x3162b8+'\x20'+_0x10cc61[_0x12a6b4(0x9a)]),_0x10cc61[_0x12a6b4(0xa6)]&&console[_0x12a6b4(0x20e)](_0x12a6b4(0x1bb)+a22_0x45efeb[_0x12a6b4(0x15c)](_0x10cc61[_0x12a6b4(0xa6)]));}}if(_0x3c9d34[_0x12a6b4(0x191)]&&_0x3c9d34[_0x12a6b4(0x191)]['length']>0x0){console['error']('\x20\x20'+a22_0x45efeb[_0x12a6b4(0x171)]('Attributes:')+'\x20'+_0x3c9d34[_0x12a6b4(0x191)][_0x12a6b4(0x1b8)]+_0x12a6b4(0xac));for(const _0x3fff91 of _0x3c9d34[_0x12a6b4(0x191)]){const _0x2209cb=_0x3fff91['valid']?a22_0x45efeb['green']('✔'):a22_0x45efeb[_0x12a6b4(0x15c)]('✘');console[_0x12a6b4(0x20e)](_0x12a6b4(0x111)+_0x2209cb+'\x20'+_0x3fff91[_0x12a6b4(0x9a)]+'\x20'+a22_0x45efeb[_0x12a6b4(0x171)]('('+_0x3fff91['type']+')'));}}if(_0x3c9d34[_0x12a6b4(0x218)]){const _0x29a2b0=_0x3c9d34[_0x12a6b4(0x218)][_0x12a6b4(0xe6)]?.[_0x12a6b4(0x1b8)]?_0x12a6b4(0xb2)+_0x3c9d34['idStitching'][_0x12a6b4(0xe6)][_0x12a6b4(0xaa)](',\x20')+']':'';console['error']('\x20\x20'+a22_0x45efeb[_0x12a6b4(0x171)](_0x12a6b4(0xd1))+'\x20'+_0x3c9d34[_0x12a6b4(0x218)][_0x12a6b4(0x160)]+_0x29a2b0);}if(_0x3c9d34[_0x12a6b4(0x1f3)]&&_0x3c9d34['personalizationServices']['length']>0x0){console['error']('\x20\x20'+a22_0x45efeb['dim'](_0x12a6b4(0x1af))+'\x20'+_0x3c9d34[_0x12a6b4(0x1f3)][_0x12a6b4(0x1b8)]+'\x20service'+(_0x3c9d34[_0x12a6b4(0x1f3)][_0x12a6b4(0x1b8)]!==0x1?'s':''));for(const _0x49e476 of _0x3c9d34['personalizationServices']){console['error'](_0x12a6b4(0x208)+_0x49e476[_0x12a6b4(0x9a)]);}}}function showParentSegmentNotSetError(_0x160a8a){const _0x78fde9=a22_0x1e960b;console[_0x78fde9(0x20e)](a22_0x45efeb[_0x78fde9(0x132)](_0x78fde9(0x1cd))),console[_0x78fde9(0x20e)](_0x160a8a);}export class ParentSegmentListCommand extends BaseCommand{[a22_0x1e960b(0x9a)]=a22_0x1e960b(0xf2);[a22_0x1e960b(0x106)]='List\x20parent\x20segments';async[a22_0x1e960b(0x186)](_0x56b659){const _0x366cc1=a22_0x1e960b,{options:_0x14be68,args:_0x9dbb0b,tdx:_0xd4c20b}=_0x56b659,_0x1e9714=_0x9dbb0b[0x0];_0x14be68[_0x366cc1(0x180)]&&(console[_0x366cc1(0x20e)](_0x366cc1(0x13b)+_0x14be68['site']),_0x1e9714&&console[_0x366cc1(0x20e)](_0x366cc1(0xb4)+_0x1e9714));const _0x371dee=await withSpinner(_0x1e9714?_0x366cc1(0x126)+_0x1e9714+'\x27...':'Listing\x20parent\x20segments...',()=>_0xd4c20b[_0x366cc1(0x1f7)][_0x366cc1(0x212)](),{'verbose':_0x14be68['verbose']});let _0x359353=_0x371dee['data'];if(_0x1e9714){const _0x52cb2d=_0x1e9714[_0x366cc1(0x1ca)](/[.+^${}()|[\]\\]/g,_0x366cc1(0x202))['replace'](/\*/g,'.*')[_0x366cc1(0x1ca)](/\?/g,'.'),_0x2fff42=new RegExp('^'+_0x52cb2d+'$','i');_0x359353=_0x359353[_0x366cc1(0x129)](_0x5f3f02=>_0x2fff42[_0x366cc1(0x187)](_0x5f3f02[_0x366cc1(0x191)][_0x366cc1(0x9a)]));}_0x359353[_0x366cc1(0x139)]((_0x2e8cc1,_0x511755)=>_0x2e8cc1[_0x366cc1(0x191)][_0x366cc1(0x9a)][_0x366cc1(0x1fe)](_0x511755[_0x366cc1(0x191)][_0x366cc1(0x9a)])),console[_0x366cc1(0x20e)]('✔\x20Found\x20'+_0x359353[_0x366cc1(0x1b8)]+_0x366cc1(0x1ea)+(_0x359353[_0x366cc1(0x1b8)]!==0x1?'s':''));const _0x2cbe33=_0x119920=>{const _0x87a804=_0x366cc1;return getConsoleNextUrl(_0x14be68[_0x87a804(0x1f5)],_0x87a804(0x16e)+_0x119920);};if(_0x14be68['format']===_0x366cc1(0x16f)||_0x14be68[_0x366cc1(0x162)]===_0x366cc1(0x10e)){const _0x2a3286=_0x359353[_0x366cc1(0x182)](_0x5c5938=>({..._0x5c5938,'url':_0x2cbe33(_0x5c5938['id'])}));await handleSDKOutput(_0x2a3286,_0x14be68);}else{if(_0x359353[_0x366cc1(0x1b8)]===0x0)_0x1e9714?console[_0x366cc1(0x1d3)](_0x366cc1(0x1f9)+_0x1e9714):console[_0x366cc1(0x1d3)]('No\x20parent\x20segments\x20found');else for(const _0x1917d0 of _0x359353){const _0x103b4e=_0x1917d0[_0x366cc1(0x191)][_0x366cc1(0x1f2)]?a22_0x45efeb[_0x366cc1(0x171)]('\x20('+formatRows(_0x1917d0[_0x366cc1(0x191)][_0x366cc1(0x1f2)])+')'):'',_0xe0dbc7=hyperlink(_0x1917d0['attributes']['name'],_0x2cbe33(_0x1917d0['id']));console['log'](_0x366cc1(0x177)+_0xe0dbc7+_0x103b4e);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a22_0x1e960b(0x9a)]=a22_0x1e960b(0xb3);[a22_0x1e960b(0x106)]=a22_0x1e960b(0xcf);async[a22_0x1e960b(0x186)](_0x785d0c){const _0x18a66e=a22_0x1e960b,{options:_0x483476,args:_0x1c9a0f,tdx:_0x2c831c}=_0x785d0c;console[_0x18a66e(0x20e)](_0x18a66e(0xd7)+_0x18a66e(0x155)+'\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a');const _0x587c34=_0x483476;if(_0x1c9a0f['length']===0x0)return console[_0x18a66e(0x20e)](a22_0x45efeb['red'](_0x18a66e(0x1d2))),console['error'](_0x18a66e(0xcc)),0x1;const _0x4ef560=_0x1c9a0f[0x0];if(!_0x587c34[_0x18a66e(0xb8)]||!_0x587c34[_0x18a66e(0x13a)])return console[_0x18a66e(0x20e)]('Error:\x20--database\x20and\x20--table\x20are\x20required'),console[_0x18a66e(0x20e)]('Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>'),0x1;_0x587c34[_0x18a66e(0x180)]&&(console['error'](_0x18a66e(0x13b)+_0x587c34[_0x18a66e(0x1f5)]),console['error'](_0x18a66e(0x1e3)+_0x4ef560),console[_0x18a66e(0x20e)](_0x18a66e(0xeb)+_0x587c34[_0x18a66e(0xb8)]),console[_0x18a66e(0x20e)](_0x18a66e(0xb6)+_0x587c34['table']));const _0x1b0622=await loadJSONFromOptions(_0x587c34[_0x18a66e(0x191)],_0x587c34['attributesFile']),_0x59e86e=await loadJSONFromOptions(_0x587c34[_0x18a66e(0x1c7)],_0x587c34[_0x18a66e(0x119)]),_0x3e9dcc=await loadJSONFromOptions(_0x587c34[_0x18a66e(0x168)],_0x587c34[_0x18a66e(0x1c5)]),_0x152e9f={'name':_0x4ef560,'description':_0x587c34[_0x18a66e(0x106)],'scheduleType':_0x587c34[_0x18a66e(0x121)],'scheduleOption':_0x587c34[_0x18a66e(0xc1)],'timezone':_0x587c34[_0x18a66e(0x17e)],'master':{'parentDatabaseName':_0x587c34[_0x18a66e(0xb8)],'parentTableName':_0x587c34['table']},'attributes':_0x1b0622,'behaviors':_0x59e86e,'customerGroup':_0x3e9dcc},_0x2b2b82=await withSpinner(_0x18a66e(0x112)+_0x4ef560+_0x18a66e(0x18c),()=>_0x2c831c[_0x18a66e(0x1f7)][_0x18a66e(0x151)](_0x152e9f),{'verbose':_0x483476['verbose']}),_0x536ebb=_0x2b2b82[_0x18a66e(0x1db)];return console[_0x18a66e(0x20e)](_0x18a66e(0x16b)+_0x536ebb['name']+_0x18a66e(0xe1)+_0x536ebb['id']),await handleSDKOutput([_0x536ebb],_0x483476),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{['name']='segment:parent:update';[a22_0x1e960b(0x106)]=a22_0x1e960b(0xf8);async[a22_0x1e960b(0x186)](_0x4dec7b){const _0x5563d9=a22_0x1e960b,{options:_0x374f98,args:_0x31ce1f,tdx:_0x4ae844}=_0x4dec7b;console[_0x5563d9(0x20e)]('\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a'+_0x5563d9(0x155)+_0x5563d9(0x1d7));const _0xe4b69=_0x374f98;if(_0x31ce1f[_0x5563d9(0x1b8)]===0x0)return console[_0x5563d9(0x20e)](a22_0x45efeb[_0x5563d9(0x15c)](_0x5563d9(0x1d2))),console[_0x5563d9(0x20e)](_0x5563d9(0xd9)),0x1;const _0x2356b7=_0x31ce1f[0x0];_0xe4b69[_0x5563d9(0x180)]&&(console[_0x5563d9(0x20e)]('Site:\x20'+_0xe4b69[_0x5563d9(0x1f5)]),console[_0x5563d9(0x20e)](_0x5563d9(0x114)+_0x2356b7));const _0x59767c=await withSpinner(_0x5563d9(0xbb)+_0x2356b7+_0x5563d9(0x18c),()=>_0x4ae844[_0x5563d9(0x1f7)]['getParentFull'](_0x2356b7),{'verbose':_0xe4b69[_0x5563d9(0x180)]}),_0x1225f1=_0x59767c[_0x5563d9(0x1db)],_0x46ba38=await loadJSONFromOptions(_0xe4b69['addAttributes'],_0xe4b69[_0x5563d9(0x196)]),_0x2220de=await loadJSONFromOptions(_0xe4b69[_0x5563d9(0x1ee)],_0xe4b69[_0x5563d9(0xa2)]),_0x49960a={'name':_0x1225f1[_0x5563d9(0x9a)],'description':_0xe4b69['description']!==undefined?_0xe4b69[_0x5563d9(0x106)]:_0x1225f1[_0x5563d9(0x106)],'scheduleType':_0xe4b69[_0x5563d9(0x121)]!==undefined?_0xe4b69[_0x5563d9(0x121)]:_0x1225f1[_0x5563d9(0x121)],'scheduleOption':_0xe4b69['scheduleOption']!==undefined?_0xe4b69[_0x5563d9(0xc1)]:_0x1225f1['scheduleOption'],'timezone':_0xe4b69[_0x5563d9(0x17e)]!==undefined?_0xe4b69[_0x5563d9(0x17e)]:_0x1225f1[_0x5563d9(0x17e)],'master':_0x1225f1['master'],'attributes':_0x46ba38?[..._0x1225f1[_0x5563d9(0x191)]||[],..._0x46ba38]:_0x1225f1['attributes'],'behaviors':_0x2220de?[..._0x1225f1[_0x5563d9(0x1c7)]||[],..._0x2220de]:_0x1225f1[_0x5563d9(0x1c7)],'customerGroup':_0x1225f1[_0x5563d9(0x168)]},_0x313c86=await withSpinner(_0x5563d9(0x14a)+_0x2356b7+_0x5563d9(0x18c),()=>_0x4ae844[_0x5563d9(0x1f7)][_0x5563d9(0xcb)](_0x2356b7,_0x49960a),{'verbose':_0xe4b69[_0x5563d9(0x180)]}),_0x4654dd=_0x313c86[_0x5563d9(0x1db)];return console[_0x5563d9(0x20e)]('✔\x20Updated\x20parent\x20segment\x20\x27'+_0x4654dd['name']+'\x27'),await handleSDKOutput([_0x4654dd],_0xe4b69),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a22_0x1e960b(0x9a)]='segment:parent:pull';['description']=a22_0x1e960b(0x10f);async['execute'](_0x39cbb4){const _0x378bee=a22_0x1e960b,{options:_0x1197fa,args:_0x1df647,tdx:_0x5ef57f}=_0x39cbb4,_0x2dc06a=_0x1197fa,_0x287a65=_0x1df647[0x0]||_0x1197fa[_0x378bee(0xd3)];if(!_0x287a65)return showParentSegmentNotSetError(_0x378bee(0x124)+_0x378bee(0x1bd)),0x1;if(_0x2dc06a[_0x378bee(0x11d)]&&_0x2dc06a[_0x378bee(0x205)])return console[_0x378bee(0x20e)](a22_0x45efeb['red'](_0x378bee(0x1a9))),console[_0x378bee(0x20e)](a22_0x45efeb['dim'](_0x378bee(0xc3))),console['error'](a22_0x45efeb['dim'](_0x378bee(0xba)+PARENT_SEGMENT_DIR+'/{name}.yml\x0a')),console[_0x378bee(0x20e)](a22_0x45efeb[_0x378bee(0x1fb)](_0x378bee(0x14c))),0x1;const _0x3ca07a=_0x2dc06a[_0x378bee(0x205)]||a22_0x45f45f['join'](PARENT_SEGMENT_DIR,sanitizeFileName(_0x287a65)+_0x378bee(0x9c));_0x2dc06a[_0x378bee(0x180)]&&(console['error'](_0x378bee(0x13b)+_0x2dc06a[_0x378bee(0x1f5)]),console[_0x378bee(0x20e)]('Parent\x20segment:\x20'+_0x287a65),console['error'](_0x378bee(0x19e)+_0x3ca07a));const _0x5f2d47=await withSpinner(_0x378bee(0x1d9)+_0x287a65+'\x27...',()=>_0x5ef57f[_0x378bee(0x1f7)][_0x378bee(0x1e8)](_0x287a65),{'verbose':_0x2dc06a[_0x378bee(0x180)]}),_0x3d536e=_0x5f2d47[_0x378bee(0x1db)];if(existsSync(_0x3ca07a)){const _0x371703=readFileSync(_0x3ca07a,_0x378bee(0xc6)),_0x23af38=generateDiff(_0x371703,_0x3d536e);if(!hasChanges(_0x23af38))console[_0x378bee(0x20e)](a22_0x45efeb[_0x378bee(0xc4)]('✔')+'\x20No\x20changes\x20-\x20'+a22_0x45efeb[_0x378bee(0x1fb)](_0x3ca07a)+_0x378bee(0x12c));else{console[_0x378bee(0x20e)](_0x378bee(0x1e9)+_0x3ca07a+'\x27:'),console[_0x378bee(0x20e)]('─'[_0x378bee(0x175)](0x3c)),console[_0x378bee(0x20e)](formatDiffWithColors(_0x23af38)),console['error']('─'[_0x378bee(0x175)](0x3c));if(!_0x2dc06a['yes']){if(!isInteractive())return console['error'](a22_0x45efeb[_0x378bee(0x15c)](_0x378bee(0x201)),_0x378bee(0x18e)),console[_0x378bee(0x20e)](a22_0x45efeb['dim'](_0x378bee(0x146))),0x1;const _0x3a5612=await confirmKey(_0x378bee(0x1b5)+_0x3ca07a+'\x27?');if(!_0x3a5612)return console[_0x378bee(0x20e)](a22_0x45efeb['yellow'](_0x378bee(0xf6))),0x1;}writeFileSync(_0x3ca07a,_0x3d536e,_0x378bee(0xc6)),console[_0x378bee(0x20e)](a22_0x45efeb[_0x378bee(0xc4)]('✔')+_0x378bee(0x193)+a22_0x45efeb[_0x378bee(0x1fb)](_0x3ca07a));}}else{const _0x5c3f34=a22_0x45f45f['dirname'](_0x3ca07a);!existsSync(_0x5c3f34)&&mkdirSync(_0x5c3f34,{'recursive':!![]}),writeFileSync(_0x3ca07a,_0x3d536e,_0x378bee(0xc6)),console[_0x378bee(0x20e)](a22_0x45efeb['green']('✔')+_0x378bee(0x193)+a22_0x45efeb[_0x378bee(0x1fb)](_0x3ca07a));}return saveSessionContext({'parent_segment':_0x287a65},_0x2dc06a[_0x378bee(0x20b)]),console['error'](a22_0x45efeb[_0x378bee(0xc4)]('✔')+_0x378bee(0x1bf)+a22_0x45efeb[_0x378bee(0x171)]('parent_segment')+'\x20=\x20'+a22_0x45efeb[_0x378bee(0x1fb)](_0x287a65)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a22_0x1e960b(0x9a)]=a22_0x1e960b(0x123);[a22_0x1e960b(0x106)]='Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file';async['execute'](_0x315d7e){const _0x5af533=a22_0x1e960b,{options:_0x124bd3,args:_0x49a137,tdx:_0x323d0d}=_0x315d7e,_0x43054f=_0x124bd3,_0x357b43=_0x49a137[0x0]||_0x124bd3[_0x5af533(0xd3)];if(!_0x357b43)return showParentSegmentNotSetError(_0x5af533(0x1ec)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment'),0x1;const _0x2f520b=resolveYamlFile(_0x357b43);if(!existsSync(_0x2f520b))return showFileNotFoundError(_0x2f520b,_0x357b43),0x1;_0x43054f[_0x5af533(0x180)]&&(console[_0x5af533(0x20e)]('Site:\x20'+_0x43054f[_0x5af533(0x1f5)]),console['error'](_0x5af533(0x157)+_0x2f520b));let _0x538bf2;try{_0x538bf2=readFileSync(_0x2f520b,_0x5af533(0xc6));}catch(_0x1c3986){const _0x52f9b5=_0x1c3986 instanceof Error?_0x1c3986[_0x5af533(0xbd)]:String(_0x1c3986);return console[_0x5af533(0x20e)]('Error\x20reading\x20file:\x20'+_0x52f9b5),0x1;}const _0x51049e=await withSpinner(_0x5af533(0x17d),()=>_0x323d0d['segment']['pushParentYaml'](_0x538bf2),{'verbose':_0x43054f[_0x5af533(0x180)]}),_0x2e681a=_0x51049e[_0x5af533(0x1db)],{isNew:_0x43bde9,name:_0x5de70f,hasChanges:_0x8306f9,diffFormatted:_0x353840}=_0x2e681a;if(!_0x8306f9)return console[_0x5af533(0x20e)]('✔\x20No\x20changes\x20-\x20\x27'+_0x5de70f+'\x27\x20is\x20already\x20up\x20to\x20date'),0x0;_0x43bde9?console['error']('\x0aNew\x20parent\x20segment\x20\x27'+_0x5de70f+'\x27:'):console[_0x5af533(0x20e)](_0x5af533(0x17b)+_0x5de70f+'\x27:');console[_0x5af533(0x20e)]('─'[_0x5af533(0x175)](0x3c)),console[_0x5af533(0x20e)](_0x353840),console[_0x5af533(0x20e)]('─'['repeat'](0x3c));const _0x1b58ae=_0x43bde9?_0x5af533(0xe5)+_0x5de70f+'\x27?':_0x5af533(0x9d)+_0x5de70f+'\x27?';if(!_0x43054f[_0x5af533(0xce)]){if(!isInteractive())return console['error'](a22_0x45efeb[_0x5af533(0x15c)](_0x5af533(0x201)),_0x5af533(0x18e)),console[_0x5af533(0x20e)](a22_0x45efeb[_0x5af533(0x171)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x46346d=await confirmKey(_0x1b58ae);if(!_0x46346d)return console['error'](a22_0x45efeb[_0x5af533(0x132)](_0x5af533(0xf6))),0x1;}const _0x44598a=_0x43bde9?_0x5af533(0x137):_0x5af533(0x156),_0x5382d2=await withSpinner(_0x44598a+_0x5af533(0x1c1)+_0x5de70f+_0x5af533(0x18c),()=>_0x2e681a[_0x5af533(0xde)](),{'verbose':_0x43054f[_0x5af533(0x180)]}),_0x4ec36e=_0x5382d2[_0x5af533(0x1db)],_0x2fe28e=getConsoleNextUrl(_0x43054f['site'],_0x5af533(0x16e)+_0x4ec36e['id']),_0x5e0a5c=_0x43bde9?'Created':_0x5af533(0x1ba);return console['error']('✔\x20'+_0x5e0a5c+'\x20parent\x20segment\x20\x27'+_0x4ec36e[_0x5af533(0x9a)]+'\x27'),console[_0x5af533(0x20e)]('\x20\x20'+_0x2fe28e),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a22_0x1e960b(0x9a)]=a22_0x1e960b(0x16a);[a22_0x1e960b(0x106)]=a22_0x1e960b(0xe7);async[a22_0x1e960b(0x186)](_0x472f01){const _0x1809fb=a22_0x1e960b,{options:_0x55de6f,args:_0x2cee8e,tdx:_0x496a87}=_0x472f01,_0x3a9999=_0x55de6f,_0x1da0b2=_0x2cee8e[0x0]||_0x55de6f['parentSegment'];if(!_0x1da0b2)return showParentSegmentNotSetError(_0x1809fb(0x1e1)+_0x1809fb(0x1d8)+'Options:\x0a'+_0x1809fb(0x1a4)+_0x1809fb(0xe0)+'\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)'),0x1;const _0x52189b=resolveYamlFile(_0x1da0b2);if(!existsSync(_0x52189b))return showFileNotFoundError(_0x52189b,_0x1da0b2),0x1;_0x3a9999['verbose']&&(console[_0x1809fb(0x20e)](_0x1809fb(0x13b)+_0x3a9999['site']),console[_0x1809fb(0x20e)](_0x1809fb(0x157)+_0x52189b));let _0xe5c4bb;try{_0xe5c4bb=readFileSync(_0x52189b,_0x1809fb(0xc6));}catch(_0x186b98){const _0x4a014d=_0x186b98 instanceof Error?_0x186b98[_0x1809fb(0xbd)]:String(_0x186b98);return console[_0x1809fb(0x20e)](_0x1809fb(0x15d)+_0x4a014d),0x1;}const _0x29f457=createCommandSpinner(a22_0x45efeb[_0x1809fb(0x171)](_0x1809fb(0x116)),{'verbose':_0x3a9999[_0x1809fb(0x180)]});_0x29f457[_0x1809fb(0x194)]();const _0x4f4ddd={'onProgress':_0x22e55f=>{_0x29f457['text']=formatProgressMessage(_0x22e55f);}};if(_0x3a9999['master'])_0x4f4ddd['master']=!![];if(_0x3a9999['enriched'])_0x4f4ddd[_0x1809fb(0xfd)]=!![];_0x3a9999['attribute']&&(_0x4f4ddd[_0x1809fb(0x1c6)]=_0x3a9999[_0x1809fb(0x1c6)]);_0x3a9999[_0x1809fb(0x15e)]&&(_0x4f4ddd[_0x1809fb(0x15e)]=_0x3a9999[_0x1809fb(0x15e)]);if(_0x3a9999[_0x1809fb(0x141)])_0x4f4ddd[_0x1809fb(0x141)]=_0x3a9999[_0x1809fb(0x141)];let _0x62b659;try{_0x62b659=await _0x496a87[_0x1809fb(0x1f7)][_0x1809fb(0xd2)](_0xe5c4bb,_0x4f4ddd),_0x29f457[_0x1809fb(0x10c)]();}catch(_0x530dc6){_0x29f457[_0x1809fb(0x10c)]();throw _0x530dc6;}const _0x1c0e16=_0x3a9999['interval']||'-1d';return this[_0x1809fb(0x9e)](_0x62b659,_0x4f4ddd,_0x52189b,_0x1c0e16),_0x62b659[_0x1809fb(0x1d0)]?0x0:0x1;}['displayValidateResults'](_0x142d5c,_0x1a7d8f,_0x2aa56c,_0x35d781){const _0x44d6f8=a22_0x1e960b;console[_0x44d6f8(0x20e)]('\x0a'+a22_0x45efeb['bold'](_0x44d6f8(0x130))+'\x20'+_0x142d5c[_0x44d6f8(0x9a)]),console[_0x44d6f8(0x20e)]('═'[_0x44d6f8(0x175)](0x3c)),this[_0x44d6f8(0xfb)](_0x142d5c);if(typeof _0x1a7d8f[_0x44d6f8(0x1c6)]===_0x44d6f8(0x190)){this[_0x44d6f8(0xb0)](_0x142d5c),this[_0x44d6f8(0x1a5)](_0x142d5c),this[_0x44d6f8(0x192)](_0x2aa56c,_0x35d781,_0x44d6f8(0x1c6),_0x1a7d8f[_0x44d6f8(0x1c6)]);return;}if(_0x1a7d8f[_0x44d6f8(0x1c6)]===!![]){this[_0x44d6f8(0xb0)](_0x142d5c),this[_0x44d6f8(0x1a5)](_0x142d5c),this[_0x44d6f8(0x192)](_0x2aa56c,_0x35d781,_0x44d6f8(0x191));return;}if(typeof _0x1a7d8f[_0x44d6f8(0x15e)]==='string'){this[_0x44d6f8(0x183)](_0x142d5c,_0x35d781),this[_0x44d6f8(0x1a5)](_0x142d5c),this[_0x44d6f8(0x192)](_0x2aa56c,_0x35d781,_0x44d6f8(0x15e),_0x1a7d8f[_0x44d6f8(0x15e)]);return;}if(_0x1a7d8f[_0x44d6f8(0x15e)]===!![]){this[_0x44d6f8(0x183)](_0x142d5c,_0x35d781),this[_0x44d6f8(0x1a5)](_0x142d5c),this[_0x44d6f8(0x192)](_0x2aa56c,_0x35d781,_0x44d6f8(0x1c7));return;}this[_0x44d6f8(0xb0)](_0x142d5c),this[_0x44d6f8(0x183)](_0x142d5c,_0x35d781),this[_0x44d6f8(0x128)](_0x142d5c),this[_0x44d6f8(0x1a5)](_0x142d5c),this[_0x44d6f8(0x192)](_0x2aa56c,_0x35d781,_0x44d6f8(0xfa));}[a22_0x1e960b(0x128)](_0x1497ed){displayRealtimeValidation(_0x1497ed);}[a22_0x1e960b(0x192)](_0xb30b9,_0x468b56,_0x198916,_0x1c85fd){const _0x4b6654=a22_0x1e960b;console[_0x4b6654(0x20e)]('\x0a'+a22_0x45efeb['dim'](_0x4b6654(0x113)));const _0x6d4b29=_0x468b56!==_0x4b6654(0xe3)?_0x4b6654(0xff)+_0x468b56:'';if(_0x198916==='attribute'&&_0x1c85fd)console[_0x4b6654(0x20e)]('\x20\x20'+a22_0x45efeb[_0x4b6654(0x171)](_0x4b6654(0x1cc)+_0xb30b9+'\x20--attribute\x20\x22'+_0x1c85fd+'\x22'+_0x6d4b29));else{if(_0x198916==='behavior'&&_0x1c85fd)console['error']('\x20\x20'+a22_0x45efeb[_0x4b6654(0x171)](_0x4b6654(0x1cc)+_0xb30b9+'\x20--behavior\x20\x22'+_0x1c85fd+'\x22'+_0x6d4b29));else(_0x198916===_0x4b6654(0x191)||_0x198916===_0x4b6654(0xfa))&&console[_0x4b6654(0x20e)]('\x20\x20'+a22_0x45efeb[_0x4b6654(0x171)](_0x4b6654(0x1cc)+_0xb30b9+_0x4b6654(0xc7)+_0x6d4b29));}(_0x198916===_0x4b6654(0x1c7)||_0x198916===_0x4b6654(0xfa))&&console[_0x4b6654(0x20e)]('\x20\x20'+a22_0x45efeb['dim'](_0x4b6654(0x1cc)+_0xb30b9+'\x20--behavior\x20\x22<name>\x22'+_0x6d4b29)),_0x198916===_0x4b6654(0xfa)&&console['error']('\x20\x20'+a22_0x45efeb[_0x4b6654(0x171)](_0x4b6654(0x1cc)+_0xb30b9+_0x4b6654(0xca)+_0x6d4b29));}[a22_0x1e960b(0xfb)](_0x3c973d){const _0x26e239=a22_0x1e960b,{master:_0x5a1889}=_0x3c973d,_0x3d206e=_0x5a1889[_0x26e239(0xa3)]?a22_0x45efeb[_0x26e239(0xc4)]('✔'):a22_0x45efeb[_0x26e239(0x15c)]('✘');console['error']('\x0a'+a22_0x45efeb[_0x26e239(0x171)]('Master\x20Table')),console[_0x26e239(0x20e)](_0x3d206e+'\x20'+a22_0x45efeb['bold'](_0x5a1889[_0x26e239(0xb8)]+'.'+_0x5a1889[_0x26e239(0x13a)])),_0x5a1889[_0x26e239(0xa3)]?_0x5a1889[_0x26e239(0x120)]!==undefined&&console[_0x26e239(0x20e)]('\x20\x20'+a22_0x45efeb[_0x26e239(0x171)](_0x26e239(0x1f0))+'\x20'+a22_0x45efeb[_0x26e239(0x1fb)](formatRows(_0x5a1889[_0x26e239(0x120)]))):console[_0x26e239(0x20e)]('\x20\x20'+a22_0x45efeb['red']('Error:')+'\x20'+_0x5a1889['schemaError']);}[a22_0x1e960b(0xb0)](_0x5553fa){const _0xfa197b=a22_0x1e960b;if(_0x5553fa[_0xfa197b(0x191)][_0xfa197b(0x1b8)]===0x0)return;console[_0xfa197b(0x20e)]('\x0a'+a22_0x45efeb['dim']('Attributes'));for(const _0xe1a8ab of _0x5553fa[_0xfa197b(0x191)]){const _0x17ff0c=_0xe1a8ab[_0xfa197b(0xa3)]?a22_0x45efeb[_0xfa197b(0xc4)]('✔'):a22_0x45efeb['red']('✘');let _0x2249a9='';if(_0xe1a8ab[_0xfa197b(0xa3)]&&_0xe1a8ab[_0xfa197b(0xbf)]!==undefined&&_0xe1a8ab['coveragePercent']!==undefined){const _0x32e98e=_0xe1a8ab['coveragePercent'][_0xfa197b(0x1fd)](0x1),_0x3bc2bc=_0xe1a8ab[_0xfa197b(0x148)]>=0x50?a22_0x45efeb[_0xfa197b(0xc4)]:_0xe1a8ab[_0xfa197b(0x148)]>=0x32?a22_0x45efeb[_0xfa197b(0x132)]:a22_0x45efeb[_0xfa197b(0x15c)];_0x2249a9='\x20'+a22_0x45efeb['dim']('Coverage:')+'\x20'+_0x3bc2bc(_0x32e98e+'%')+'\x20('+formatRows(_0xe1a8ab['matchedCount'])+'\x20rows)';}console[_0xfa197b(0x20e)](_0x17ff0c+'\x20'+a22_0x45efeb[_0xfa197b(0x136)](_0xe1a8ab[_0xfa197b(0x9a)])+_0x2249a9),console['error']('\x20\x20'+a22_0x45efeb[_0xfa197b(0x171)](_0xfa197b(0x1f4))+'\x20'+a22_0x45efeb[_0xfa197b(0x136)](_0xe1a8ab['database']+'.'+_0xe1a8ab['table']));const _0x41b077=_0xe1a8ab[_0xfa197b(0x181)]===_0xe1a8ab[_0xfa197b(0xbc)]?a22_0x45efeb[_0xfa197b(0x171)](_0xfa197b(0x20a))+'\x20'+_0xe1a8ab[_0xfa197b(0x181)]:a22_0x45efeb['dim']('Join:')+'\x20'+_0xe1a8ab[_0xfa197b(0x181)]+_0xfa197b(0xe4)+_0xe1a8ab[_0xfa197b(0xbc)];console[_0xfa197b(0x20e)]('\x20\x20'+_0x41b077),console[_0xfa197b(0x20e)]('\x20\x20'+a22_0x45efeb[_0xfa197b(0x171)](_0xfa197b(0x133))),this['displayColumns'](_0xe1a8ab[_0xfa197b(0xec)]),!_0xe1a8ab['schemaValid']&&console[_0xfa197b(0x20e)]('\x20\x20'+a22_0x45efeb[_0xfa197b(0x15c)](_0xfa197b(0x144))+'\x20'+_0xe1a8ab['schemaError']);}}['displayBehaviorsStats'](_0xa1443,_0x124ddc){const _0x76e4a8=a22_0x1e960b;if(_0xa1443['behaviors'][_0x76e4a8(0x1b8)]===0x0)return;console[_0x76e4a8(0x20e)]('\x0a'+a22_0x45efeb[_0x76e4a8(0x171)]('Behaviors')+'\x20'+a22_0x45efeb['dim']('('+_0x124ddc+')'));for(const _0x495cfd of _0xa1443['behaviors']){const _0x17a7bd=_0x495cfd['schemaValid']?a22_0x45efeb[_0x76e4a8(0xc4)]('✔'):a22_0x45efeb['red']('✘');let _0x4f1eee='';if(_0x495cfd[_0x76e4a8(0xa3)]&&_0x495cfd[_0x76e4a8(0x110)]!==undefined&&_0x495cfd[_0x76e4a8(0x1b1)]!==undefined){const _0xce95=_0x495cfd[_0x76e4a8(0x122)]?.[_0x76e4a8(0x1fd)](0x1)||'?',_0x367009=(_0x495cfd[_0x76e4a8(0x122)]??0x0)>=0x32?a22_0x45efeb[_0x76e4a8(0xc4)]:(_0x495cfd['customerPercent']??0x0)>=0x14?a22_0x45efeb[_0x76e4a8(0x132)]:a22_0x45efeb[_0x76e4a8(0x15c)];_0x4f1eee='\x20'+a22_0x45efeb[_0x76e4a8(0x171)](_0x76e4a8(0x174))+'\x20'+_0x367009(formatRows(_0x495cfd[_0x76e4a8(0x110)]))+'\x20('+_0xce95+_0x76e4a8(0x1fc)+a22_0x45efeb[_0x76e4a8(0x171)]('Events:')+'\x20'+a22_0x45efeb[_0x76e4a8(0x1fb)](formatRows(_0x495cfd[_0x76e4a8(0x1b1)]));}console['error'](_0x17a7bd+'\x20'+a22_0x45efeb[_0x76e4a8(0x136)](_0x495cfd[_0x76e4a8(0x9a)])+_0x4f1eee),console[_0x76e4a8(0x20e)]('\x20\x20'+a22_0x45efeb[_0x76e4a8(0x171)](_0x76e4a8(0x1f4))+'\x20'+a22_0x45efeb['bold'](_0x495cfd[_0x76e4a8(0xb8)]+'.'+_0x495cfd['table']));const _0x1d3aaf=_0x495cfd['joinKey']===_0x495cfd[_0x76e4a8(0xbc)]?a22_0x45efeb[_0x76e4a8(0x171)](_0x76e4a8(0x20a))+'\x20'+_0x495cfd[_0x76e4a8(0x181)]:a22_0x45efeb[_0x76e4a8(0x171)](_0x76e4a8(0x216))+'\x20'+_0x495cfd[_0x76e4a8(0x181)]+_0x76e4a8(0xe4)+_0x495cfd[_0x76e4a8(0xbc)];console[_0x76e4a8(0x20e)]('\x20\x20'+_0x1d3aaf),console['error']('\x20\x20'+a22_0x45efeb[_0x76e4a8(0x171)](_0x76e4a8(0x133))),this['displayColumns'](_0x495cfd[_0x76e4a8(0xec)]),!_0x495cfd[_0x76e4a8(0xa3)]&&console[_0x76e4a8(0x20e)]('\x20\x20'+a22_0x45efeb[_0x76e4a8(0x15c)](_0x76e4a8(0x144))+'\x20'+_0x495cfd['schemaError']);}}[a22_0x1e960b(0x214)](_0x2fbd64){const _0x450670=a22_0x1e960b;for(const _0x3b0a3c of _0x2fbd64){_0x3b0a3c['label']===_0x3b0a3c[_0x450670(0x13c)]||_0x3b0a3c[_0x450670(0x13c)]==='*'?console[_0x450670(0x20e)](_0x450670(0x208)+_0x3b0a3c['label']):console['error'](_0x450670(0x208)+_0x3b0a3c[_0x450670(0xd6)]+'\x20'+a22_0x45efeb[_0x450670(0x171)]('('+_0x3b0a3c['column']+')'));}}[a22_0x1e960b(0x1a5)](_0x2a35dc){const _0x5ecabf=a22_0x1e960b;console[_0x5ecabf(0x20e)]('─'[_0x5ecabf(0x175)](0x3c));if(_0x2a35dc[_0x5ecabf(0x1c9)]['length']>0x0){console[_0x5ecabf(0x20e)]('\x0a'+a22_0x45efeb[_0x5ecabf(0x15c)](_0x5ecabf(0xdf)));for(const _0x9b2c2f of _0x2a35dc['errors']){console[_0x5ecabf(0x20e)]('\x20\x20'+a22_0x45efeb['red']('•')+'\x20'+_0x9b2c2f);}}_0x2a35dc['allValid']&&console['error']('\x0a'+a22_0x45efeb[_0x5ecabf(0xc4)]('✔')+_0x5ecabf(0x1f6));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{['name']=a22_0x1e960b(0x1d5);['description']=a22_0x1e960b(0x143);async[a22_0x1e960b(0x186)](_0x190043){const _0xbc137d=a22_0x1e960b,{options:_0x8c1099,args:_0x4f247a,tdx:_0x171153}=_0x190043,_0x3e9ada=_0x8c1099,_0x1984d8=_0x4f247a[0x0]||_0x8c1099[_0xbc137d(0xd3)];if(!_0x1984d8)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'+_0xbc137d(0x204)+_0xbc137d(0x10d)+_0xbc137d(0x153)+_0xbc137d(0x19d)+_0xbc137d(0xf1)+'\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a'+_0xbc137d(0x12d)),0x1;if(!_0x3e9ada[_0xbc137d(0x9b)]&&!_0x3e9ada[_0xbc137d(0x1c6)]&&!_0x3e9ada[_0xbc137d(0x15e)]&&!_0x3e9ada[_0xbc137d(0xfd)])return console[_0xbc137d(0x20e)](a22_0x45efeb[_0xbc137d(0x15c)]('Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a')),console[_0xbc137d(0x20e)](_0xbc137d(0x149)),console[_0xbc137d(0x20e)](_0xbc137d(0x1e7)),console[_0xbc137d(0x20e)]('\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data'),console[_0xbc137d(0x20e)](_0xbc137d(0x107)),console['error']('\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior'),console[_0xbc137d(0x20e)]('\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data'),0x1;const _0x5bba73=resolveYamlFile(_0x1984d8);if(!existsSync(_0x5bba73))return showFileNotFoundError(_0x5bba73,_0x1984d8),0x1;_0x3e9ada['verbose']&&(console['error']('Site:\x20'+_0x3e9ada[_0xbc137d(0x1f5)]),console['error']('YAML\x20file:\x20'+_0x5bba73));let _0x2bfa8b;try{_0x2bfa8b=readFileSync(_0x5bba73,'utf-8');}catch(_0x385d4d){const _0x309ddd=_0x385d4d instanceof Error?_0x385d4d['message']:String(_0x385d4d);return console['error']('Error\x20reading\x20file:\x20'+_0x309ddd),0x1;}let _0x4c4c9b;try{_0x4c4c9b=parseDef(_0x2bfa8b);}catch(_0x48518d){const _0x3fec41=_0x48518d instanceof Error?_0x48518d[_0xbc137d(0xbd)]:String(_0x48518d);return console[_0xbc137d(0x20e)](a22_0x45efeb[_0xbc137d(0x15c)](_0xbc137d(0x109)+_0x3fec41)),0x1;}if(_0x3e9ada[_0xbc137d(0x1c6)]===!![]||_0x3e9ada['attribute']===''){const _0x5eca47=_0x4c4c9b[_0xbc137d(0x191)]?.[_0xbc137d(0x182)](_0x2b928d=>_0x2b928d[_0xbc137d(0x9a)])||[];if(_0x5eca47[_0xbc137d(0x1b8)]===0x0)console['error'](a22_0x45efeb[_0xbc137d(0x15c)](_0xbc137d(0x1ff)));else{console[_0xbc137d(0x20e)](a22_0x45efeb[_0xbc137d(0x15c)](_0xbc137d(0x11b))),console['error']('Available\x20attributes:');for(const _0x47d96e of _0x5eca47){console[_0xbc137d(0x20e)]('\x20\x20'+a22_0x45efeb[_0xbc137d(0x1fb)](_0x47d96e));}console[_0xbc137d(0x20e)](_0xbc137d(0xa5)+_0x1984d8+_0xbc137d(0x211)+_0x5eca47[0x0]+'\x22');}return 0x1;}if(_0x3e9ada[_0xbc137d(0x15e)]===!![]||_0x3e9ada[_0xbc137d(0x15e)]===''){const _0x37b924=_0x4c4c9b['behaviors']?.[_0xbc137d(0x182)](_0x4b412a=>_0x4b412a[_0xbc137d(0x9a)])||[];if(_0x37b924[_0xbc137d(0x1b8)]===0x0)console[_0xbc137d(0x20e)](a22_0x45efeb[_0xbc137d(0x15c)]('Error:\x20No\x20behaviors\x20defined\x20in\x20configuration'));else{console[_0xbc137d(0x20e)](a22_0x45efeb[_0xbc137d(0x15c)](_0xbc137d(0x210))),console['error'](_0xbc137d(0xc9));for(const _0x582d91 of _0x37b924){console[_0xbc137d(0x20e)]('\x20\x20'+a22_0x45efeb[_0xbc137d(0x1fb)](_0x582d91));}console[_0xbc137d(0x20e)](_0xbc137d(0xa5)+_0x1984d8+_0xbc137d(0x20c)+_0x37b924[0x0]+'\x22');}return 0x1;}const _0x5a9a39=createCommandSpinner(a22_0x45efeb[_0xbc137d(0x171)]('Fetching\x20sample\x20data...'),{'verbose':_0x3e9ada[_0xbc137d(0x180)]});_0x5a9a39['start']();const _0x48feed={'onProgress':_0x5806a8=>{const _0x4a43f8=_0xbc137d;_0x5a9a39[_0x4a43f8(0x165)]=formatProgressMessage(_0x5806a8);}};if(_0x3e9ada[_0xbc137d(0x9b)])_0x48feed[_0xbc137d(0x9b)]=!![];if(_0x3e9ada[_0xbc137d(0x1c6)]&&typeof _0x3e9ada[_0xbc137d(0x1c6)]===_0xbc137d(0x190))_0x48feed['attribute']=_0x3e9ada[_0xbc137d(0x1c6)];if(_0x3e9ada['behavior']&&typeof _0x3e9ada[_0xbc137d(0x15e)]==='string')_0x48feed[_0xbc137d(0x15e)]=_0x3e9ada['behavior'];if(_0x3e9ada[_0xbc137d(0xfd)])_0x48feed['enriched']=!![];if(_0x3e9ada['interval'])_0x48feed['interval']=_0x3e9ada['interval'];let _0x3fb441;try{_0x3fb441=await _0x171153[_0xbc137d(0x1f7)][_0xbc137d(0x1b7)](_0x2bfa8b,_0x48feed),_0x5a9a39[_0xbc137d(0x10c)]();}catch(_0x2fea77){_0x5a9a39[_0xbc137d(0x10c)]();throw _0x2fea77;}return await this['displayPreviewResults'](_0x3fb441,{'master':_0x3e9ada['master'],'attribute':typeof _0x3e9ada['attribute']===_0xbc137d(0x190)?_0x3e9ada[_0xbc137d(0x1c6)]:undefined,'behavior':typeof _0x3e9ada['behavior']===_0xbc137d(0x190)?_0x3e9ada[_0xbc137d(0x15e)]:undefined,'enriched':_0x3e9ada[_0xbc137d(0xfd)]}),_0x3fb441[_0xbc137d(0x1d0)]?0x0:0x1;}async['displayPreviewResults'](_0x185839,_0x3b297c){const _0x533298=a22_0x1e960b;console['error']('\x0a'+a22_0x45efeb[_0x533298(0x136)]('Preview:')+'\x20'+_0x185839['name']),console[_0x533298(0x20e)]('═'['repeat'](0x3c));if(_0x3b297c[_0x533298(0x9b)]&&_0x185839[_0x533298(0x1de)]){const _0x2fb233=a22_0x45efeb[_0x533298(0x171)](_0x533298(0x1b4))+'\x20'+a22_0x45efeb[_0x533298(0x136)](_0x185839['master'][_0x533298(0xb8)]+'.'+_0x185839['master'][_0x533298(0x13a)]);await this[_0x533298(0x18d)](_0x2fb233,_0x185839[_0x533298(0x1de)]);}else{if(_0x3b297c[_0x533298(0x1c6)]&&_0x185839[_0x533298(0x1de)]){const _0x15b5fe=a22_0x45efeb[_0x533298(0x171)]('Attribute:')+'\x20'+a22_0x45efeb[_0x533298(0x136)](_0x3b297c[_0x533298(0x1c6)]);await this[_0x533298(0x18d)](_0x15b5fe,_0x185839[_0x533298(0x1de)]);}else{if(_0x3b297c[_0x533298(0x15e)]&&_0x185839[_0x533298(0x1de)]){const _0x16762e=a22_0x45efeb[_0x533298(0x171)](_0x533298(0x108))+'\x20'+a22_0x45efeb[_0x533298(0x136)](_0x3b297c['behavior']);await this[_0x533298(0x18d)](_0x16762e,_0x185839[_0x533298(0x1de)]);}else{if(_0x3b297c[_0x533298(0xfd)]&&_0x185839[_0x533298(0x1de)]){const _0x57a676=a22_0x45efeb[_0x533298(0x171)](_0x533298(0x1da))+'\x20'+a22_0x45efeb[_0x533298(0x136)]('Master\x20+\x20Attributes');await this[_0x533298(0x18d)](_0x57a676,_0x185839['sampleData']);}else!_0x185839[_0x533298(0x1de)]&&console[_0x533298(0x20e)](_0x533298(0x10a));}}}if(_0x185839[_0x533298(0x1c9)][_0x533298(0x1b8)]>0x0){console[_0x533298(0x20e)]('─'[_0x533298(0x175)](0x3c)),console[_0x533298(0x20e)]('\x0a'+a22_0x45efeb[_0x533298(0x15c)](_0x533298(0xdf)));for(const _0x58b49c of _0x185839[_0x533298(0x1c9)]){console['error']('\x20\x20'+a22_0x45efeb[_0x533298(0x15c)]('•')+'\x20'+_0x58b49c);}}}async['displaySampleData'](_0xdf1459,_0x558dc6){const _0x4bd30b=a22_0x1e960b;if(_0x558dc6[_0x4bd30b(0x1b8)]===0x0){console['error']('\x0a'+_0xdf1459),console[_0x4bd30b(0x20e)](_0x4bd30b(0x1b3));return;}console[_0x4bd30b(0x20e)]('\x0a'+_0xdf1459);const _0x531168=Object[_0x4bd30b(0xa8)](_0x558dc6[0x0])[_0x4bd30b(0x182)](_0x319620=>({'name':_0x319620,'type':typeof _0x558dc6[0x0][_0x319620]==='number'?_0x4bd30b(0x135):_0x4bd30b(0x127)})),_0x482b53={'queryId':_0x4bd30b(0x14f),'columns':_0x531168,'data':_0x558dc6,'stats':{'state':'FINISHED','queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x558dc6[_0x4bd30b(0x1b8)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x18f300=formatAsTable(_0x482b53,_0x558dc6['length'],!![]);await writeOutput(_0x18f300,undefined,'table');}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{['name']=a22_0x1e960b(0x12b);[a22_0x1e960b(0x106)]=a22_0x1e960b(0x206);async[a22_0x1e960b(0x186)](_0x36bb2e){const _0xe179e7=a22_0x1e960b,{options:_0x64faae,args:_0x39e5e8,tdx:_0x550269}=_0x36bb2e,_0x3cfad7=_0x64faae,_0x45c54f=_0x39e5e8[0x0]||_0x64faae[_0xe179e7(0xd3)];if(!_0x45c54f)return showParentSegmentNotSetError(_0xe179e7(0xbe)+_0xe179e7(0xa1)),0x1;const _0x278c23=resolveYamlFile(_0x45c54f);if(existsSync(_0x278c23)){_0x3cfad7['verbose']&&console[_0xe179e7(0x20e)](_0xe179e7(0xf0)+_0x278c23);let _0x4faacb;try{_0x4faacb=readFileSync(_0x278c23,_0xe179e7(0xc6));}catch(_0x298346){const _0x3e1784=_0x298346 instanceof Error?_0x298346[_0xe179e7(0xbd)]:String(_0x298346);return console['error'](_0xe179e7(0x15d)+_0x3e1784),0x1;}const _0x2264c9=await withSpinner(_0xe179e7(0x17d),()=>_0x550269[_0xe179e7(0x1f7)][_0xe179e7(0x19a)](_0x4faacb),{'verbose':_0x3cfad7[_0xe179e7(0x180)]}),_0x3c9827=_0x2264c9[_0xe179e7(0x1db)],{isNew:_0x328297,name:_0x5f4635,hasChanges:_0x179362,diffFormatted:_0x564c2a}=_0x3c9827;if(_0x179362){_0x328297?console['error'](_0xe179e7(0x16d)+_0x5f4635+'\x27:'):console['error'](_0xe179e7(0x17b)+_0x5f4635+'\x27:');console[_0xe179e7(0x20e)]('─'[_0xe179e7(0x175)](0x3c)),console[_0xe179e7(0x20e)](_0x564c2a),console[_0xe179e7(0x20e)]('─'['repeat'](0x3c));const _0x2ff7b2=_0x328297?_0xe179e7(0xe5)+_0x5f4635+'\x27\x20and\x20run\x20workflow?':_0xe179e7(0x9d)+_0x5f4635+_0xe179e7(0x1b0);if(!_0x3cfad7[_0xe179e7(0xce)]){if(!isInteractive())return console[_0xe179e7(0x20e)](a22_0x45efeb[_0xe179e7(0x15c)](_0xe179e7(0x201)),_0xe179e7(0x18e)),console[_0xe179e7(0x20e)](a22_0x45efeb[_0xe179e7(0x171)](_0xe179e7(0x146))),0x1;const _0x1d63da=await confirmKey(_0x2ff7b2);if(!_0x1d63da)return console['error'](a22_0x45efeb[_0xe179e7(0x132)](_0xe179e7(0xf6))),0x1;}const _0x35ccbf=_0x328297?_0xe179e7(0x137):_0xe179e7(0x156);await withSpinner(_0x35ccbf+_0xe179e7(0x1c1)+_0x5f4635+_0xe179e7(0x18c),()=>_0x3c9827['apply'](),{'verbose':_0x3cfad7[_0xe179e7(0x180)]});const _0x1263c1=_0x328297?_0xe179e7(0x1eb):_0xe179e7(0x1ba);console[_0xe179e7(0x20e)]('✔\x20'+_0x1263c1+'\x20parent\x20segment\x20\x27'+_0x5f4635+'\x27');}else console[_0xe179e7(0x20e)]('✔\x20No\x20changes\x20-\x20\x27'+_0x5f4635+_0xe179e7(0xa0));}const _0x5662ba=await withSpinner(_0xe179e7(0xfe)+_0x45c54f+_0xe179e7(0x18c),()=>_0x550269['segment'][_0xe179e7(0x1ae)](_0x45c54f),{'verbose':_0x3cfad7['verbose']}),_0xbc28ac=_0x5662ba[_0xe179e7(0x1db)],_0x42c177=getConsoleUrl(_0x3cfad7[_0xe179e7(0x1f5)],'/app/workflows/'+_0xbc28ac[_0xe179e7(0x99)]+_0xe179e7(0x13d)+_0xbc28ac[_0xe179e7(0xf4)]+'/attempt/'+_0xbc28ac[_0xe179e7(0xd8)]);return console[_0xe179e7(0x20e)]('\x0a✔\x20Workflow\x20started'),console[_0xe179e7(0x20e)]('\x20\x20'+a22_0x45efeb[_0xe179e7(0x171)]('Audience\x20ID:')+'\x20'+_0xbc28ac[_0xe179e7(0x12f)]),console[_0xe179e7(0x20e)]('\x20\x20'+a22_0x45efeb['dim'](_0xe179e7(0x20d))+'\x20'+_0xbc28ac[_0xe179e7(0x1ed)]),console[_0xe179e7(0x20e)]('\x20\x20'+a22_0x45efeb[_0xe179e7(0x171)](_0xe179e7(0x161))+'\x20'+_0xbc28ac[_0xe179e7(0xf4)]),console[_0xe179e7(0x20e)]('\x20\x20'+a22_0x45efeb[_0xe179e7(0x171)](_0xe179e7(0x1c2))+'\x20'+_0xbc28ac[_0xe179e7(0xd8)]),console[_0xe179e7(0x20e)]('\x20\x20'+_0x42c177),console[_0xe179e7(0x20e)]('\x0a'+a22_0x45efeb[_0xe179e7(0x171)](_0xe179e7(0x105))+_0xe179e7(0xc2)+_0xbc28ac[_0xe179e7(0xd8)]+_0xe179e7(0x173)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a22_0x1e960b(0x9a)]='segment:parent:fields';[a22_0x1e960b(0x106)]=a22_0x1e960b(0x184);async['execute'](_0x5814e8){const _0x558ded=a22_0x1e960b,{options:_0xe22568,args:_0x4268a8,tdx:_0xf4763f}=_0x5814e8,_0x500fc5=_0x4268a8[0x0]||_0xe22568[_0x558ded(0xd3)];if(!_0x500fc5)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'+_0x558ded(0x185)),0x1;_0xe22568[_0x558ded(0x180)]&&(console[_0x558ded(0x20e)](_0x558ded(0x13b)+_0xe22568[_0x558ded(0x1f5)]),console['error'](_0x558ded(0x114)+_0x500fc5));const _0x2fd5e5=await withSpinner(_0x558ded(0x1ef)+_0x500fc5+'\x27...',()=>_0xf4763f[_0x558ded(0x1f7)][_0x558ded(0xfc)](_0x500fc5),{'verbose':_0xe22568[_0x558ded(0x180)]}),_0x2d2038=_0x2fd5e5['data'];console[_0x558ded(0x20e)](_0x558ded(0x1ce)+_0x2d2038[_0x558ded(0x1b8)]+_0x558ded(0x1a2)+(_0x2d2038[_0x558ded(0x1b8)]!==0x1?'s':''));if(_0xe22568[_0x558ded(0x16f)]||_0xe22568[_0x558ded(0x10e)])return await handleSDKOutput(_0x2d2038,_0xe22568),0x0;return displayFieldsHumanReadable(_0x2d2038,_0x500fc5),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{['name']=a22_0x1e960b(0x17f);[a22_0x1e960b(0x106)]=a22_0x1e960b(0xdc);async[a22_0x1e960b(0x186)](_0xffe981){const _0x3becb0=a22_0x1e960b,{options:_0x332335,args:_0x517203,tdx:_0x18ee22}=_0xffe981,_0x1de3ef=_0x332335,_0x25cdc=_0x517203[0x0]||_0x332335[_0x3becb0(0xd3)];if(!_0x25cdc)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a'+_0x3becb0(0x158)+_0x3becb0(0x164)),0x1;_0x332335[_0x3becb0(0x180)]&&(console[_0x3becb0(0x20e)](_0x3becb0(0x13b)+_0x332335[_0x3becb0(0x1f5)]),console[_0x3becb0(0x20e)](_0x3becb0(0x114)+_0x25cdc));const _0x2d3c31=await withSpinner(_0x3becb0(0x1d9)+_0x25cdc+_0x3becb0(0x18c),()=>_0x18ee22[_0x3becb0(0x1f7)][_0x3becb0(0x134)](_0x25cdc),{'verbose':_0x332335[_0x3becb0(0x180)]}),_0x21166a=_0x2d3c31[_0x3becb0(0x1db)];if(_0x1de3ef['web']){const _0x19a441=getConsoleNextUrl(_0x1de3ef[_0x3becb0(0x1f5)],_0x3becb0(0x16e)+_0x21166a['id']);return console[_0x3becb0(0x20e)](a22_0x45efeb[_0x3becb0(0xc4)]('✔')+_0x3becb0(0x19f)+a22_0x45efeb[_0x3becb0(0x1fb)](_0x19a441)),openBrowser(_0x19a441),0x0;}return await handleSingleObjectOutput(_0x21166a,_0x332335),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a22_0x1e960b(0x9a)]=a22_0x1e960b(0xf3);[a22_0x1e960b(0x106)]=a22_0x1e960b(0x19b);async[a22_0x1e960b(0x186)](_0x5a4cf5){const _0x40647c=a22_0x1e960b,{options:_0x53e6ec,args:_0x11862d,tdx:_0xb8e140}=_0x5a4cf5,_0x16c62b=_0x53e6ec,_0x2ff867=_0x11862d[0x0]||_0x53e6ec['parentSegment'];if(!_0x2ff867)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20all\x20tables\x20(requires\x20context)\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20all\x20tables\x20for\x20parent\x20segment\x0a\x0a'+'Options:\x0a'+'\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path'),0x1;_0x53e6ec[_0x40647c(0x180)]&&(console[_0x40647c(0x20e)]('Site:\x20'+_0x53e6ec[_0x40647c(0x1f5)]),console[_0x40647c(0x20e)](_0x40647c(0x114)+_0x2ff867));const _0x4c3ea6=await withSpinner(_0x40647c(0x154)+_0x2ff867+_0x40647c(0x18c),()=>_0xb8e140['segment']['resolveParentId'](_0x2ff867),{'verbose':_0x53e6ec[_0x40647c(0x180)]}),_0x29739f=_0x4c3ea6[_0x40647c(0x1db)],_0x4468f6=_0xb8e140[_0x40647c(0x1f7)][_0x40647c(0x152)](_0x29739f);if(_0x16c62b[_0x40647c(0x205)]){const _0x1d5f47=await this['collectSchema'](_0x5a4cf5,_0x2ff867,_0x29739f,_0x4468f6),_0x5c2a24=this[_0x40647c(0x19c)](_0x1d5f47);writeFileSync(_0x16c62b[_0x40647c(0x205)],_0x5c2a24);const _0x205612=_0x1d5f47['customers']['columns'][_0x40647c(0x1b8)]+_0x1d5f47['behaviors'][_0x40647c(0x1be)]((_0x24f116,_0x4d2dde)=>_0x24f116+_0x4d2dde[_0x40647c(0xec)][_0x40647c(0x1b8)],0x0),_0x5d612f=_0x1d5f47[_0x40647c(0x1c7)][_0x40647c(0x129)](_0x4e611e=>_0x4e611e[_0x40647c(0xec)][_0x40647c(0x1b8)]===0x0)[_0x40647c(0x1b8)];return console[_0x40647c(0x1d3)](_0x40647c(0x197)+_0x16c62b[_0x40647c(0x205)]),console[_0x40647c(0x1d3)](_0x40647c(0xc0)+_0x4468f6),console[_0x40647c(0x1d3)]('\x20\x20Tables:\x201\x20customers\x20+\x20'+_0x1d5f47[_0x40647c(0x1c7)][_0x40647c(0x1b8)]+'\x20behaviors'),console[_0x40647c(0x1d3)](_0x40647c(0x12e)+_0x205612+_0x40647c(0xaf)),_0x5d612f>0x0&&console[_0x40647c(0x1d3)](_0x40647c(0x167)+_0x5d612f+_0x40647c(0x213)),0x0;}console['error']('\x0a'+a22_0x45efeb[_0x40647c(0x136)](_0x40647c(0xed))+'\x20'+a22_0x45efeb[_0x40647c(0x1fb)](_0x4468f6));const _0xebcf41=await withSpinner(_0x40647c(0x159),()=>_0xb8e140['segment'][_0x40647c(0xad)](_0x29739f),{'verbose':_0x53e6ec['verbose']});console[_0x40647c(0x20e)]('\x0a'+a22_0x45efeb[_0x40647c(0x136)](_0x40647c(0x1df))+'\x20'+a22_0x45efeb['dim']('('+_0x4468f6+_0x40647c(0x199)));const _0x5a87b9=await executeSchemaQuery(_0xebcf41[_0x40647c(0x1db)],_0xb8e140,_0x53e6ec);await handleQueryOutput(_0x5a87b9,_0x53e6ec);const _0x9d9b8d=await withSpinner(_0x40647c(0x163),()=>_0xb8e140['segment'][_0x40647c(0x12a)](_0x29739f),{'verbose':_0x53e6ec['verbose']});for(const _0x38e558 of _0x9d9b8d[_0x40647c(0x1db)]){const _0x3c4e2b=_0x40647c(0x13e)+_0x38e558[_0x40647c(0x1b2)]()['replace'](/\s+/g,'_'),_0x213575=_0x40647c(0x102)+_0x4468f6+'.'+_0x3c4e2b;console['error']('\x0a'+a22_0x45efeb['bold'](_0x38e558)+'\x20'+a22_0x45efeb['dim']('('+_0x4468f6+'.'+_0x3c4e2b+')'));try{const _0x41875b=await executeSchemaQuery(_0x213575,_0xb8e140,_0x53e6ec);await handleQueryOutput(_0x41875b,_0x53e6ec);}catch{console[_0x40647c(0x20e)](a22_0x45efeb['yellow'](_0x40647c(0xae)));}}return 0x0;}async['collectSchema'](_0xe2fac2,_0xf7c0aa,_0x38f0bb,_0x351545){const _0x282844=a22_0x1e960b,{options:_0x8c1a77,tdx:_0x242766}=_0xe2fac2,_0x8c0a54=await withSpinner(_0x282844(0x159),()=>_0x242766[_0x282844(0x1f7)][_0x282844(0xad)](_0x38f0bb),{'verbose':_0x8c1a77[_0x282844(0x180)]}),_0x14c02c=await executeSchemaQuery(_0x8c0a54[_0x282844(0x1db)],_0x242766,_0x8c1a77),_0x47d1d8=_0x14c02c['data'][_0x282844(0x182)](_0x1dbcd2=>({'name':_0x1dbcd2[_0x282844(0x1bc)],'type':_0x1dbcd2[_0x282844(0x14e)]})),_0x59e79d=await withSpinner(_0x282844(0x163),()=>_0x242766[_0x282844(0x1f7)][_0x282844(0x12a)](_0x38f0bb),{'verbose':_0x8c1a77[_0x282844(0x180)]}),_0x5e6b61=[];for(const _0x17a751 of _0x59e79d[_0x282844(0x1db)]){const _0x2a3fb8=_0x282844(0x13e)+_0x17a751['toLowerCase']()['replace'](/\s+/g,'_'),_0x12b4af=_0x282844(0x102)+_0x351545+'.'+_0x2a3fb8;let _0xe92474=[];try{const _0xf34bed=await executeSchemaQuery(_0x12b4af,_0x242766,_0x8c1a77);_0xe92474=_0xf34bed[_0x282844(0x1db)][_0x282844(0x182)](_0xb86504=>({'name':_0xb86504[_0x282844(0x1bc)],'type':_0xb86504[_0x282844(0x14e)]}));}catch{}_0x5e6b61['push']({'table':_0x2a3fb8,'columns':_0xe92474});}return{'database':_0x351545,'parent_segment':_0xf7c0aa,'parent_id':_0x38f0bb,'customers':{'table':_0x282844(0x1df),'columns':_0x47d1d8},'behaviors':_0x5e6b61};}[a22_0x1e960b(0x19c)](_0x26ebed){const _0x5d19ad=a22_0x1e960b,_0x5a3c42=_0x3474d9=>{const _0x189df2=a22_0x5bb3;if(_0x3474d9[_0x189df2(0x1b8)]===0x0)return'[]';const _0x430bb8=_0x3474d9[_0x189df2(0x182)](_0x23cdb6=>_0x189df2(0x15f)+_0x23cdb6[_0x189df2(0x9a)]+_0x189df2(0x195)+_0x23cdb6['type']+_0x189df2(0x1e6));return'[\x0a'+_0x430bb8[_0x189df2(0xaa)](',\x0a')+_0x189df2(0x1fa);},_0xd6cabc=_0x26ebed[_0x5d19ad(0x1c7)]['map'](_0x24857d=>{const _0x237284=_0x5d19ad;return'\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22'+_0x24857d[_0x237284(0x13a)]+'\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20'+_0x5a3c42(_0x24857d[_0x237284(0xec)])['replace'](/^/gm,'\x20\x20')['trim']()+_0x237284(0x1c3);})[_0x5d19ad(0xaa)](',\x0a');return _0x5d19ad(0x215)+_0x26ebed['database']+_0x5d19ad(0x1a6)+_0x26ebed[_0x5d19ad(0x10b)]+_0x5d19ad(0x1a0)+_0x26ebed['parent_id']+_0x5d19ad(0x1e0)+_0x26ebed[_0x5d19ad(0x1df)][_0x5d19ad(0x13a)]+_0x5d19ad(0x1dc)+_0x5a3c42(_0x26ebed[_0x5d19ad(0x1df)][_0x5d19ad(0xec)])[_0x5d19ad(0x1ca)](/^/gm,'\x20\x20')['trim']()+_0x5d19ad(0xdd)+_0xd6cabc+_0x5d19ad(0x11a);}}export class ParentSegmentSQLCommand extends BaseCommand{['name']='segment:parent:sql';[a22_0x1e960b(0x106)]=a22_0x1e960b(0xcd);async[a22_0x1e960b(0x186)](_0x1bd167){const _0x5f02db=a22_0x1e960b,{options:_0x27c45e,args:_0x2b7f46,tdx:_0x5d6163}=_0x1bd167,_0x40d966=_0x2b7f46[0x0]||_0x27c45e[_0x5f02db(0xd3)];if(!_0x40d966)return showParentSegmentNotSetError(_0x5f02db(0x104)+_0x5f02db(0x1a1)),0x1;_0x27c45e[_0x5f02db(0x180)]&&(console[_0x5f02db(0x20e)](_0x5f02db(0x13b)+_0x27c45e[_0x5f02db(0x1f5)]),console[_0x5f02db(0x20e)](_0x5f02db(0x114)+_0x40d966));const _0x55183d=await withSpinner(_0x5f02db(0x154)+_0x40d966+_0x5f02db(0x18c),()=>_0x5d6163['segment'][_0x5f02db(0x103)](_0x40d966),{'verbose':_0x27c45e[_0x5f02db(0x180)]}),_0x41e9ca=_0x55183d[_0x5f02db(0x1db)],_0x548fdd=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x40d966+_0x5f02db(0x18c),()=>_0x5d6163[_0x5f02db(0x1f7)]['getParentSQL'](_0x41e9ca),{'verbose':_0x27c45e[_0x5f02db(0x180)]}),_0xda946e=_0x548fdd['data'];return _0x27c45e[_0x5f02db(0x162)]===_0x5f02db(0x16f)||_0x27c45e[_0x5f02db(0x162)]===_0x5f02db(0x10e)?await handleSDKOutput([{'sql':_0xda946e}],_0x27c45e):console[_0x5f02db(0x1d3)](_0xda946e),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a22_0x1e960b(0x9a)]=a22_0x1e960b(0x13f);[a22_0x1e960b(0x106)]=a22_0x1e960b(0x18f);async[a22_0x1e960b(0x186)](_0x55eeef){const _0x68bf14=a22_0x1e960b,{options:_0x280162,args:_0x377348,tdx:_0x389af2}=_0x55eeef,_0x3abaef=_0x377348[0x0]||_0x280162['parentSegment'];if(!_0x3abaef)return showParentSegmentNotSetError(_0x68bf14(0x1b9)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment'),0x1;_0x280162[_0x68bf14(0x180)]&&(console[_0x68bf14(0x20e)](_0x68bf14(0x13b)+_0x280162[_0x68bf14(0x1f5)]),console[_0x68bf14(0x20e)](_0x68bf14(0x114)+_0x3abaef));const _0x57fbfe=await withSpinner(_0x68bf14(0x154)+_0x3abaef+'\x27...',()=>_0x389af2['segment'][_0x68bf14(0x103)](_0x3abaef),{'verbose':_0x280162['verbose']}),_0x3b2a35=_0x57fbfe[_0x68bf14(0x1db)],_0x1e3946=await withSpinner(_0x68bf14(0xf9)+_0x3abaef+_0x68bf14(0x18c),()=>_0x389af2[_0x68bf14(0x1f7)][_0x68bf14(0xad)](_0x3b2a35),{'verbose':_0x280162['verbose']});let _0x1db0fd=_0x1e3946[_0x68bf14(0x1db)];const _0x25e227=resolveLimit(_0x280162[_0x68bf14(0x1dd)],DEFAULT_DISPLAY_LIMIT),_0x374ca7=/\bLIMIT\s+\d+/i['test'](_0x1db0fd);!_0x374ca7&&(_0x1db0fd=_0x1db0fd['trim']()['replace'](/;+$/,''),_0x1db0fd=_0x68bf14(0xee)+_0x1db0fd+_0x68bf14(0xf7)+_0x25e227);_0x280162[_0x68bf14(0x180)]&&console[_0x68bf14(0x20e)]('SQL\x20query:\x0a'+_0x1db0fd);const _0xd7e721=await withProgressSpinner(_0x68bf14(0x11f),async _0xf9c41f=>{const _0x57e40f=_0x68bf14,_0x42718f=await _0x389af2[_0x57e40f(0x200)]['execute'](_0x1db0fd,{'catalog':'td','schema':_0x57e40f(0x170),'onJobId':_0x5252c9=>{const _0x3610c2=_0x57e40f;_0xf9c41f[_0x3610c2(0x1e2)](_0x5252c9);}});return _0x42718f;},{'verbose':_0x280162[_0x68bf14(0x180)]}),_0x268db0=_0xd7e721[_0x68bf14(0x1db)],_0x3317c3=_0x268db0['jobId']?_0x68bf14(0x9f)+_0x268db0['jobId']+']':'';return console[_0x68bf14(0x20e)]('✔\x20Query\x20completed:\x20Processed\x20'+_0x268db0['stats']['processedRows'][_0x68bf14(0xd0)]()+_0x68bf14(0x1cb)+(_0x68bf14(0xe8)+formatElapsed(_0x268db0[_0x68bf14(0x189)][_0x68bf14(0xd5)])+_0x3317c3)),await handleQueryOutput(_0x268db0,_0x280162),0x0;}}export class PSRtListCommand extends BaseCommand{['name']=a22_0x1e960b(0x17c);[a22_0x1e960b(0x106)]='List\x20parent\x20segments\x20with\x20RT\x202.0\x20status';async['execute'](_0x4ef2d9){const _0x1893fb=a22_0x1e960b,{options:_0x5203ad,args:_0x3e6a83,tdx:_0xf9aaba}=_0x4ef2d9,_0x3839dd=_0x3e6a83[0x0],_0x4a3115=await withSpinner(_0x3839dd?_0x1893fb(0x118)+_0x3839dd+_0x1893fb(0x18c):'Listing\x20RT-enabled\x20parent\x20segments...',()=>_0xf9aaba[_0x1893fb(0x217)][_0x1893fb(0xdb)](),{'verbose':_0x5203ad['verbose']});let _0x199a2f=_0x4a3115[_0x1893fb(0x1db)][_0x1893fb(0x129)](_0xb00da2=>_0xb00da2[_0x1893fb(0x1c0)]);if(_0x3839dd){const _0x23f7fb=_0x3839dd[_0x1893fb(0x1ca)](/[.+^${}()|[\]\\]/g,_0x1893fb(0x202))[_0x1893fb(0x1ca)](/\*/g,'.*')[_0x1893fb(0x1ca)](/\?/g,'.'),_0x735c0f=new RegExp('^'+_0x23f7fb+'$','i');_0x199a2f=_0x199a2f[_0x1893fb(0x129)](_0x60695f=>_0x735c0f[_0x1893fb(0x187)](_0x60695f[_0x1893fb(0x9a)]));}_0x199a2f['sort']((_0x4c1a82,_0x252f29)=>_0x4c1a82[_0x1893fb(0x9a)][_0x1893fb(0x1fe)](_0x252f29[_0x1893fb(0x9a)])),console['error'](_0x1893fb(0x1ce)+_0x199a2f[_0x1893fb(0x1b8)]+'\x20RT-enabled\x20parent\x20segment'+(_0x199a2f[_0x1893fb(0x1b8)]!==0x1?'s':''));const _0x57d72e=_0x13a6e6=>{const _0xf678b9=_0x1893fb;return getConsoleNextUrl(_0x5203ad[_0xf678b9(0x1f5)],_0xf678b9(0x16e)+_0x13a6e6);};if(_0x5203ad[_0x1893fb(0x162)]===_0x1893fb(0x16f)||_0x5203ad['format']==='jsonl'){const _0x5b88c5=_0x199a2f['map'](_0x58f9b7=>({..._0x58f9b7,'url':_0x57d72e(_0x58f9b7['id'])}));await handleSDKOutput(_0x5b88c5,_0x5203ad);}else{if(_0x199a2f[_0x1893fb(0x1b8)]===0x0)console['log']('No\x20RT-enabled\x20parent\x20segments\x20found');else for(const _0x23432a of _0x199a2f){const _0x3406da=_0x23432a[_0x1893fb(0x1f2)]?a22_0x45efeb[_0x1893fb(0x171)]('\x20('+formatRows(_0x23432a['population'])+')'):'',_0x475fce=hyperlink(_0x23432a[_0x1893fb(0x9a)],_0x57d72e(_0x23432a['id']));console[_0x1893fb(0x1d3)]('⚡\x20'+_0x475fce+_0x3406da);}}return 0x0;}}export class PSRtValidateCommand extends BaseParentSegmentCommand{[a22_0x1e960b(0x9a)]=a22_0x1e960b(0x115);['description']='Validate\x20RT\x202.0\x20configuration\x20from\x20parent\x20segment\x20YAML';async[a22_0x1e960b(0x186)](_0x59c699){const _0x35ac60=a22_0x1e960b,{options:_0x17f40f,args:_0x4ade0c,tdx:_0x585d50}=_0x59c699,_0x16485a=_0x4ade0c[0x0]||_0x17f40f[_0x35ac60(0xd3)];if(!_0x16485a)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20rt\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20RT\x20config\x20(requires\x20context)\x0a'+_0x35ac60(0x1d1)),0x1;const _0x425173=resolveYamlFile(_0x16485a);if(!existsSync(_0x425173))return showFileNotFoundError(_0x425173,_0x16485a),0x1;let _0x1018d3;try{_0x1018d3=readFileSync(_0x425173,_0x35ac60(0xc6));}catch(_0x56ee82){const _0x29b985=_0x56ee82 instanceof Error?_0x56ee82[_0x35ac60(0xbd)]:String(_0x56ee82);return console[_0x35ac60(0x20e)]('Error\x20reading\x20file:\x20'+_0x29b985),0x1;}const _0x1965d1=createCommandSpinner(a22_0x45efeb[_0x35ac60(0x171)](_0x35ac60(0x14d)),{'verbose':_0x17f40f[_0x35ac60(0x180)]});_0x1965d1[_0x35ac60(0x194)]();const _0x328620={'realtime':!![],'onProgress':_0x255906=>{const _0x1b66d9=_0x35ac60;_0x1965d1[_0x1b66d9(0x165)]=formatProgressMessage(_0x255906);}};let _0x29c933;try{_0x29c933=await _0x585d50[_0x35ac60(0x1f7)][_0x35ac60(0xd2)](_0x1018d3,_0x328620),_0x1965d1[_0x35ac60(0x10c)]();}catch(_0x19774b){_0x1965d1[_0x35ac60(0x10c)]();throw _0x19774b;}console[_0x35ac60(0x20e)]('\x0a'+a22_0x45efeb[_0x35ac60(0x136)](_0x35ac60(0x117))+'\x20'+_0x29c933[_0x35ac60(0x9a)]),console[_0x35ac60(0x20e)]('═'['repeat'](0x3c)),displayRealtimeValidation(_0x29c933),console[_0x35ac60(0x20e)]('─'['repeat'](0x3c));if(_0x29c933[_0x35ac60(0x1c9)][_0x35ac60(0x1b8)]>0x0){console[_0x35ac60(0x20e)]('\x0a'+a22_0x45efeb['red']('Errors:'));for(const _0x13eb68 of _0x29c933[_0x35ac60(0x1c9)]){console[_0x35ac60(0x20e)]('\x20\x20'+a22_0x45efeb[_0x35ac60(0x15c)]('•')+'\x20'+_0x13eb68);}}return _0x29c933['allValid']&&console['error']('\x0a'+a22_0x45efeb[_0x35ac60(0xc4)]('✔')+'\x20RT\x20configuration\x20is\x20valid'),_0x29c933[_0x35ac60(0x1d0)]?0x0:0x1;}}export class PSPzListCommand extends BaseCommand{[a22_0x1e960b(0x9a)]='ps:pz:list';['description']=a22_0x1e960b(0x18a);async[a22_0x1e960b(0x186)](_0x53210b){const _0x415e56=a22_0x1e960b,{options:_0x410136,args:_0x1449aa,tdx:_0x2f15e3}=_0x53210b,_0x84f7dc=_0x1449aa[0x0]||_0x410136['parentSegment'];if(!_0x84f7dc)return showParentSegmentNotSetError(_0x415e56(0x176)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20PZ\x20services\x20for\x20specific\x20parent\x20segment'),0x1;const _0x44cf27=await withSpinner(_0x415e56(0x154)+_0x84f7dc+'\x27...',()=>_0x2f15e3[_0x415e56(0x1f7)][_0x415e56(0x103)](_0x84f7dc),{'verbose':_0x410136['verbose']}),_0x4db137=_0x44cf27['data'],_0x5be0ec=await withSpinner(_0x415e56(0x15b)+_0x84f7dc+_0x415e56(0x18c),()=>_0x2f15e3[_0x415e56(0xb5)][_0x415e56(0xdb)](_0x4db137),{'verbose':_0x410136[_0x415e56(0x180)]}),_0x3be1ac=_0x5be0ec[_0x415e56(0x1db)];console[_0x415e56(0x20e)](_0x415e56(0x1ce)+_0x3be1ac[_0x415e56(0x1b8)]+_0x415e56(0x179)+(_0x3be1ac['length']!==0x1?'s':''));if(_0x410136[_0x415e56(0x162)]===_0x415e56(0x16f)||_0x410136[_0x415e56(0x162)]===_0x415e56(0x10e))await handleSDKOutput(_0x3be1ac,_0x410136);else{if(_0x3be1ac['length']===0x0)console[_0x415e56(0x1d3)]('No\x20personalization\x20services\x20configured'),console[_0x415e56(0x20e)](a22_0x45efeb[_0x415e56(0x1fb)](_0x415e56(0x1e4)));else for(const _0x178a0c of _0x3be1ac){const _0x2dc00b=_0x178a0c[_0x415e56(0x17a)]?.[_0x415e56(0x1b8)]||0x0,_0x19af15=_0x178a0c[_0x415e56(0xe9)]?a22_0x45efeb[_0x415e56(0x171)](_0x415e56(0x20f)+_0x178a0c[_0x415e56(0xe9)]):'',_0xd3b37a=a22_0x45efeb[_0x415e56(0x171)]('\x20('+_0x2dc00b+_0x415e56(0x150)+(_0x2dc00b!==0x1?'s':'')+')');console['log']('\x20\x20'+_0x178a0c[_0x415e56(0x9a)]+_0x19af15+_0xd3b37a),_0x178a0c[_0x415e56(0x106)]&&console[_0x415e56(0x1d3)](_0x415e56(0x111)+a22_0x45efeb['dim'](_0x178a0c['description']));}}return 0x0;}}export class PSPzInitCommand extends BaseParentSegmentCommand{[a22_0x1e960b(0x9a)]=a22_0x1e960b(0x207);[a22_0x1e960b(0x106)]='Add\x20template\x20personalization\x20section\x20to\x20parent\x20segment\x20YAML';async[a22_0x1e960b(0x186)](_0x33f4ac){const _0x34e9a6=a22_0x1e960b,{options:_0x49fc00,args:_0x5e3019}=_0x33f4ac,_0x303110=_0x5e3019[0x0]||_0x49fc00[_0x34e9a6(0xd3)];if(!_0x303110)return showParentSegmentNotSetError(_0x34e9a6(0xb1)+_0x34e9a6(0x142)),0x1;const _0x191fd5=resolveYamlFile(_0x303110);if(!existsSync(_0x191fd5))return showFileNotFoundError(_0x191fd5,_0x303110),0x1;let _0x59d44d;try{_0x59d44d=readFileSync(_0x191fd5,_0x34e9a6(0xc6));}catch(_0x30484d){const _0x208ff0=_0x30484d instanceof Error?_0x30484d[_0x34e9a6(0xbd)]:String(_0x30484d);return console[_0x34e9a6(0x20e)](_0x34e9a6(0x15d)+_0x208ff0),0x1;}let _0x368211;try{_0x368211=parseDef(_0x59d44d);}catch(_0x485689){const _0x44dc5c=_0x485689 instanceof Error?_0x485689[_0x34e9a6(0xbd)]:String(_0x485689);return console[_0x34e9a6(0x20e)](a22_0x45efeb['red'](_0x34e9a6(0x109)+_0x44dc5c)),0x1;}if(_0x368211['personalization_services']&&_0x368211[_0x34e9a6(0x1ad)][_0x34e9a6(0x1b8)]>0x0)return console['error'](a22_0x45efeb[_0x34e9a6(0x132)](_0x34e9a6(0x145)+_0x191fd5)),console[_0x34e9a6(0x20e)](a22_0x45efeb['dim'](_0x34e9a6(0xc5)+_0x368211[_0x34e9a6(0x1ad)][_0x34e9a6(0x1b8)]+'\x20service(s)\x20configured')),0x1;!_0x368211[_0x34e9a6(0x217)]&&(_0x368211[_0x34e9a6(0x217)]={'events':[{'name':_0x34e9a6(0x1ab),'source_table':_0x34e9a6(0xf5)}],'attributes':[{'name':_0x34e9a6(0x11c),'type':'single'}],'id_stitching':{'primary_key':_0x368211[_0x34e9a6(0x9b)][_0x34e9a6(0x13a)]===_0x34e9a6(0x1df)?_0x34e9a6(0x11e):_0x34e9a6(0x1a8)}});_0x368211[_0x34e9a6(0x1ad)]=[{'name':'My\x20Service','description':'Personalization\x20service\x20description','trigger_event':_0x34e9a6(0x1ab),'sections':[{'name':_0x34e9a6(0x169),'criteria':_0x34e9a6(0x18b),'attributes':['last_page_viewed']}]}];const _0x4dee83=serializeDef(_0x368211);return writeFileSync(_0x191fd5,_0x4dee83,_0x34e9a6(0xc6)),console[_0x34e9a6(0x20e)](a22_0x45efeb[_0x34e9a6(0xc4)]('✔')+'\x20Added\x20personalization\x20template\x20to\x20'+a22_0x45efeb[_0x34e9a6(0x1fb)](_0x191fd5)),(!_0x368211[_0x34e9a6(0x217)]||_0x59d44d[_0x34e9a6(0x138)](_0x34e9a6(0x188))===-0x1)&&console['error'](a22_0x45efeb[_0x34e9a6(0xc4)]('✔')+'\x20Added\x20RT\x202.0\x20template\x20section'),console['error']('\x0a'+a22_0x45efeb[_0x34e9a6(0x171)](_0x34e9a6(0x166))),console[_0x34e9a6(0x20e)](_0x34e9a6(0x1ac)+_0x191fd5+_0x34e9a6(0x1f1)),console['error'](_0x34e9a6(0xb9)+a22_0x45efeb[_0x34e9a6(0x171)](_0x34e9a6(0x172)+_0x303110)+_0x34e9a6(0x198)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a23_0x18bdec=a23_0x5d32;(function(_0x3fbb9e,_0x3e51ac){const _0x5567c0=a23_0x5d32,_0x2f0aef=_0x3fbb9e();while(!![]){try{const _0x34c474=parseInt(_0x5567c0(0xef))/0x1*(parseInt(_0x5567c0(0xdb))/0x2)+-parseInt(_0x5567c0(0xd7))/0x3+parseInt(_0x5567c0(0x136))/0x4+-parseInt(_0x5567c0(0x130))/0x5+parseInt(_0x5567c0(0x137))/0x6*(parseInt(_0x5567c0(0x115))/0x7)+parseInt(_0x5567c0(0x135))/0x8+-parseInt(_0x5567c0(0xf2))/0x9*(-parseInt(_0x5567c0(0x112))/0xa);if(_0x34c474===_0x3e51ac)break;else _0x2f0aef['push'](_0x2f0aef['shift']());}catch(_0x1e68ce){_0x2f0aef['push'](_0x2f0aef['shift']());}}}(a23_0x4ed3,0x83168));import{BaseCommand,printAuthError}from'./command.js';function a23_0x5d32(_0x31ec68,_0x1ab60d){_0x31ec68=_0x31ec68-0xd2;const _0x4ed3b7=a23_0x4ed3();let _0x5d32ef=_0x4ed3b7[_0x31ec68];return _0x5d32ef;}import{listProfiles,profileExists,saveProfileToUserConfig,removeProfileFromUserConfig,loadProfile,getActiveProfile,saveActiveProfileToUserConfig}from'../core/profile.js';import{getConfigDir}from'../core/config.js';function a23_0x4ed3(){const _0x5d43db=['Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','name','Enter\x20your\x20TD\x20API\x20key:','Removal\x20cancelled','You\x20can\x20now\x20use\x20tdx\x20commands\x20with\x20this\x20profile.\x20Try:','profile:use','\x20\x20tdx\x20--profile\x20','log','profileName','\x27\x20already\x20exists.\x20Use\x20\x27tdx\x20profile\x20set\x27\x20to\x20modify\x20it.','execute','\x27\x20does\x20not\x20exist.\x20Create\x20it?','\x20API\x20key\x20saved\x20to\x20system\x20keychain\x20(profile:\x20','profile:remove','green','\x0aAvailable\x20profiles:','\x27\x20created','logLevel','length','us01','Select\x20Treasure\x20Data\x20site\x20for\x20profile\x20\x27','✗\x20Validation\x20failed:\x20','dim','trim','select','Create\x20a\x20new\x20profile','session','Site\x20was\x20not\x20changed.','validate','error','190660MSPEUM','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','Enter\x20your\x20TD\x20API\x20key\x20for\x20the\x20new\x20site:','413KxghpJ','getUserInfo','confirm','other','llm_agent','status','Enter\x20profile\x20name:','Default\x20profile\x20set\x20to:\x20','Profile\x20name\x20cannot\x20be\x20empty','Session\x20profile\x20set\x20to:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20remove\x20profile\x20\x27','includes','tdx:\x20profile\x20set','profile:create','customSite','Unknown\x20key\x20\x27','site','join','VALID_KEYS','text','warn','\x27.\x0a\x0aValid\x20keys:\x20','\x27\x20does\x20not\x20exist.','\x27\x20updated:\x20','\x20API\x20key\x20saved\x20to\x20system\x20keychain','\x20API\x20key\x20is\x20valid\x20(User:\x20','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','1813745OhYCRS','password','\x0aTip:\x20Use\x20\x27tdx\x20profile\x20use\x20','(session:\x20','split','828192qvRKIR','926636vAVxSG','51708JOEOea','Profile\x20\x27','ERROR','API\x20key\x20cannot\x20be\x20empty','jobs','\x0aSetup\x20cancelled','Changing\x20site\x20to\x20\x27','apiKey','Enter\x20site\x20name:','2967222QAAWQQ','message','\x20API\x20key\x20removed\x20from\x20system\x20keychain','Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20remove\x20<name>','759124tIUvKC','Remove\x20a\x20profile','tdx:\x20profile\x20create','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','email','profile:set','test','yellow','red','\x0aSaved\x20to:\x20','create','bold','Profile\x20name\x20must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20and\x20underscore','description','/app/mp/ak','profile','\x20\x20-\x20','Profile\x20was\x20not\x20created.\x20Please\x20try\x20again.','default','\x0aSetting\x20up\x20authentication\x20for\x20site:\x20','2ExXNWJ','Validating\x20API\x20key...','\x20Profile\x20\x27','135Zexzke','\x20\x20(no\x20profiles\x20found)'];a23_0x4ed3=function(){return _0x5d43db;};return a23_0x4ed3();}import*as a23_0x5735d6 from'node:path';import{saveSessionContext,getSessionID,cleanExpiredSessions}from'../core/session.js';import{saveAPIKeyAsync,resolveSite}from'../core/config.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{buildSiteChoices}from'../core/constants.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a23_0x8d36c0 from'prompts';import a23_0x2b02ed from'chalk';function validateProfileName(_0x39b5b5){const _0x178ccc=a23_0x5d32;if(!_0x39b5b5||!_0x39b5b5[_0x178ccc(0x10b)]())return _0x178ccc(0x11d);const _0x267d6e=_0x39b5b5['trim']();if(!/^[a-zA-Z0-9_-]+$/['test'](_0x267d6e))return _0x178ccc(0xe7);if(profileExists(_0x267d6e))return _0x178ccc(0x138)+_0x267d6e+_0x178ccc(0xfd);return!![];}export class ProfileCreateCommand extends BaseCommand{[a23_0x18bdec(0xf5)]=a23_0x18bdec(0x122);[a23_0x18bdec(0xe8)]=a23_0x18bdec(0x10d);async[a23_0x18bdec(0xfe)](_0x500896){const _0xd204cb=a23_0x18bdec,{options:_0x338f0d,args:_0x1bb820}=_0x500896;console['log'](a23_0x2b02ed[_0xd204cb(0xe6)](_0xd204cb(0xdd)));let _0x308391;if(_0x1bb820[_0xd204cb(0x106)]>0x0&&_0x1bb820[0x0]){const _0x295284=_0x1bb820[0x0][_0xd204cb(0x10b)](),_0x185c6f=validateProfileName(_0x295284);if(_0x185c6f!==!![])return console[_0xd204cb(0x111)](a23_0x2b02ed[_0xd204cb(0xe3)](_0x185c6f)),0x1;_0x308391=_0x295284;}else{const _0x202ec5=await a23_0x8d36c0({'type':'text','name':'profileName','message':_0xd204cb(0x11b),'validate':validateProfileName});if(!_0x202ec5[_0xd204cb(0xfc)])return console[_0xd204cb(0xfb)](_0xd204cb(0xd3)),0x1;_0x308391=_0x202ec5[_0xd204cb(0xfc)][_0xd204cb(0x10b)]();}const _0x594d78=await a23_0x8d36c0({'type':_0xd204cb(0x128),'name':_0xd204cb(0xe8),'message':'Enter\x20description\x20(optional):'}),_0x38ee65=_0x594d78['description']?.[_0xd204cb(0x10b)]()||undefined,_0x4469d3=_0x338f0d['site']||_0xd204cb(0x107),{choices:_0x435a25,initialIndex:_0x337ef6}=buildSiteChoices(_0x4469d3),_0x1816f4=await a23_0x8d36c0({'type':_0xd204cb(0x10c),'name':'site','message':_0xd204cb(0x108)+_0x308391+'\x27:','choices':_0x435a25,'initial':_0x337ef6});if(!_0x1816f4['site'])return console[_0xd204cb(0xfb)]('\x0aSetup\x20cancelled'),0x1;let _0x25a8f7;if(_0x1816f4[_0xd204cb(0x125)]===_0xd204cb(0x118)){const _0x149ec5=await a23_0x8d36c0({'type':'text','name':_0xd204cb(0x123),'message':_0xd204cb(0xd6),'initial':_0xd204cb(0x107),'validate':_0x52423a=>{const _0x53e5af=_0xd204cb;if(!_0x52423a||!_0x52423a[_0x53e5af(0x10b)]())return'Site\x20name\x20cannot\x20be\x20empty';if(!/^[a-z0-9-]+$/[_0x53e5af(0xe1)](_0x52423a['trim']()))return _0x53e5af(0xf4);return!![];}});if(!_0x149ec5['customSite'])return console['log'](_0xd204cb(0xd3)),0x1;_0x25a8f7=_0x149ec5['customSite'];}else _0x25a8f7=_0x1816f4[_0xd204cb(0x125)];const _0x5d1062=resolveSite(_0x25a8f7);console[_0xd204cb(0xfb)](_0xd204cb(0xee)+_0x5d1062),console[_0xd204cb(0xfb)]('You\x20can\x20find\x20your\x20API\x20key\x20at:'),console[_0xd204cb(0xfb)]('\x20\x20'+getConsoleUrl(_0x5d1062,_0xd204cb(0xe9)));const _0x492042=await a23_0x8d36c0({'type':_0xd204cb(0x131),'name':_0xd204cb(0xd5),'message':_0xd204cb(0xf6),'validate':_0x2be926=>{if(!_0x2be926||!_0x2be926['trim']())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0x492042[_0xd204cb(0xd5)])return console['log'](_0xd204cb(0xd3)),0x1;const _0x380467=_0x492042[_0xd204cb(0xd5)];console['log'](_0xd204cb(0xf0));try{const _0x581407=TDX[_0xd204cb(0xe5)]({'site':_0x5d1062,'apiKey':_0x380467[_0xd204cb(0x10b)](),'logLevel':_0x338f0d[_0xd204cb(0x105)]??LogLevel[_0xd204cb(0x139)]}),_0x5c6bd9=await _0x581407[_0xd204cb(0xd2)][_0xd204cb(0x116)]();console['log'](a23_0x2b02ed[_0xd204cb(0x102)]('✓')+'\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0x5c6bd9[_0xd204cb(0xdf)]+')');const _0x54b84a=await isKeychainAvailable();_0x54b84a?(await saveAPIKeyAsync(_0x380467[_0xd204cb(0x10b)](),_0x5d1062,_0x308391),console[_0xd204cb(0xfb)](a23_0x2b02ed[_0xd204cb(0x102)]('✓')+_0xd204cb(0x100)+_0x308391+')')):(console[_0xd204cb(0x129)](a23_0x2b02ed[_0xd204cb(0xe2)](_0xd204cb(0x12f))),console[_0xd204cb(0x129)](a23_0x2b02ed[_0xd204cb(0xe2)](_0xd204cb(0x113))));const _0x4a0e6c={'site':_0x5d1062,..._0x38ee65&&{'description':_0x38ee65}};return saveProfileToUserConfig(_0x308391,_0x4a0e6c),console[_0xd204cb(0xfb)](a23_0x2b02ed[_0xd204cb(0x102)]('✓')+_0xd204cb(0xf1)+_0x308391+_0xd204cb(0x104)),console[_0xd204cb(0xfb)](),console[_0xd204cb(0xfb)](_0xd204cb(0xf8)),console[_0xd204cb(0xfb)](_0xd204cb(0xfa)+_0x308391+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0xd204cb(0xfb)](_0xd204cb(0xfa)+_0x308391+_0xd204cb(0xde)),0x0;}catch(_0x4b76ec){if(_0x4b76ec instanceof HTTPClientError&&_0x4b76ec['status']===0x191)return printAuthError(_0x4b76ec),0x1;return console[_0xd204cb(0x111)](a23_0x2b02ed[_0xd204cb(0xe3)](_0xd204cb(0x109)+(_0x4b76ec instanceof Error?_0x4b76ec[_0xd204cb(0xd8)]:String(_0x4b76ec)))),console[_0xd204cb(0x111)](_0xd204cb(0xec)),0x1;}}}export class ProfileRemoveCommand extends BaseCommand{[a23_0x18bdec(0xf5)]=a23_0x18bdec(0x101);[a23_0x18bdec(0xe8)]=a23_0x18bdec(0xdc);[a23_0x18bdec(0x110)](_0x2c7a07){const _0x54474d=a23_0x18bdec,{args:_0x4f55b2}=_0x2c7a07;if(_0x4f55b2[_0x54474d(0x106)]===0x0)return _0x54474d(0xda);return undefined;}async['execute'](_0x529df6){const _0xc0dff3=a23_0x18bdec,{args:_0x2e88ed}=_0x529df6,_0x56949b=_0x2e88ed[0x0];console[_0xc0dff3(0xfb)](a23_0x2b02ed[_0xc0dff3(0xe6)]('tdx:\x20profile\x20remove'));if(!profileExists(_0x56949b)){console[_0xc0dff3(0x111)](a23_0x2b02ed[_0xc0dff3(0xe3)](_0xc0dff3(0x138)+_0x56949b+_0xc0dff3(0x12b))),console[_0xc0dff3(0xfb)](_0xc0dff3(0x103));const _0x18121=listProfiles();if(_0x18121['length']===0x0)console[_0xc0dff3(0xfb)](_0xc0dff3(0xf3));else for(const _0x19bfb5 of _0x18121){console[_0xc0dff3(0xfb)](_0xc0dff3(0xeb)+_0x19bfb5[_0xc0dff3(0xf5)]);}return 0x1;}const _0x4db608=await a23_0x8d36c0({'type':_0xc0dff3(0x117),'name':_0xc0dff3(0x117),'message':_0xc0dff3(0x11f)+_0x56949b+'\x27?','initial':![]});if(!_0x4db608['confirm'])return console[_0xc0dff3(0xfb)](_0xc0dff3(0xf7)),0x0;try{removeProfileFromUserConfig(_0x56949b),console[_0xc0dff3(0xfb)](a23_0x2b02ed['green']('✓')+_0xc0dff3(0xf1)+_0x56949b+'\x27\x20removed\x20from\x20configuration');}catch(_0x9e743a){return console['error'](a23_0x2b02ed['red']('Failed\x20to\x20remove\x20profile:\x20'+(_0x9e743a instanceof Error?_0x9e743a[_0xc0dff3(0xd8)]:String(_0x9e743a)))),0x1;}const _0xeabc03=await isKeychainAvailable();if(_0xeabc03){const _0x4a3cd1=await deleteKeychainAPIKey(_0x56949b);_0x4a3cd1&&console['log'](a23_0x2b02ed[_0xc0dff3(0x102)]('✓')+_0xc0dff3(0xd9));}return 0x0;}}export class ProfileSetCommand extends BaseCommand{[a23_0x18bdec(0xf5)]=a23_0x18bdec(0xe0);[a23_0x18bdec(0xe8)]='Set\x20a\x20profile\x20configuration\x20value';static [a23_0x18bdec(0x127)]=['site','database','parent_segment','llm_project',a23_0x18bdec(0x119),a23_0x18bdec(0xe8)];[a23_0x18bdec(0x110)](_0x5831dd){const _0x79f36e=a23_0x18bdec,{args:_0x2b0190,options:_0xcbb2c1}=_0x5831dd,_0x16a06e=_0xcbb2c1['profile']||getActiveProfile();if(!_0x16a06e)return'No\x20active\x20profile.\x20Use\x20--profile\x20flag\x20or\x20set\x20session\x20profile\x20with:\x20tdx\x20profile\x20use\x20<name>\x0a\x0aUsage:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>';if(_0x2b0190[_0x79f36e(0x106)]===0x0)return'Key=value\x20pair\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20'+ProfileSetCommand[_0x79f36e(0x127)][_0x79f36e(0x126)](',\x20');const _0x429a21=_0x2b0190[0x0];if(!_0x429a21[_0x79f36e(0x120)]('='))return'Invalid\x20format.\x20Use:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20'+ProfileSetCommand[_0x79f36e(0x127)][_0x79f36e(0x126)](',\x20');const [_0x35245c]=_0x429a21[_0x79f36e(0x134)]('=',0x2);if(!ProfileSetCommand[_0x79f36e(0x127)][_0x79f36e(0x120)](_0x35245c))return _0x79f36e(0x124)+_0x35245c+_0x79f36e(0x12a)+ProfileSetCommand['VALID_KEYS'][_0x79f36e(0x126)](',\x20');return undefined;}async[a23_0x18bdec(0xfe)](_0x5207db){const _0x1ff845=a23_0x18bdec,{args:_0x565595,options:_0x3549e3}=_0x5207db,_0x497ec7=_0x3549e3[_0x1ff845(0xea)]||getActiveProfile(),[_0x358527,..._0x56c7a5]=_0x565595[0x0][_0x1ff845(0x134)]('='),_0x3cf4d1=_0x56c7a5[_0x1ff845(0x126)]('=');console[_0x1ff845(0xfb)](a23_0x2b02ed[_0x1ff845(0xe6)](_0x1ff845(0x121)));if(!profileExists(_0x497ec7)){const _0x502aa0=await a23_0x8d36c0({'type':_0x1ff845(0x117),'name':_0x1ff845(0xe5),'message':_0x1ff845(0x138)+_0x497ec7+_0x1ff845(0xff),'initial':!![]});if(!_0x502aa0[_0x1ff845(0xe5)])return console['log']('Operation\x20cancelled'),0x1;}const _0x522e9d=loadProfile(_0x497ec7),_0x56a393=_0x522e9d?.['config']||{};if(_0x358527===_0x1ff845(0x125)){const _0x2700b2=resolveSite(_0x3cf4d1);console[_0x1ff845(0xfb)](_0x1ff845(0xd4)+_0x2700b2+'\x27\x20requires\x20API\x20key\x20validation.'),console['log']('\x0aYou\x20can\x20find\x20your\x20API\x20key\x20at:'),console[_0x1ff845(0xfb)]('\x20\x20'+getConsoleUrl(_0x2700b2,_0x1ff845(0xe9)));const _0x970506=await a23_0x8d36c0({'type':_0x1ff845(0x131),'name':'apiKey','message':_0x1ff845(0x114),'validate':_0x2f35a1=>{const _0x230c7c=_0x1ff845;if(!_0x2f35a1||!_0x2f35a1['trim']())return _0x230c7c(0x13a);return!![];}});if(!_0x970506['apiKey'])return console[_0x1ff845(0xfb)]('\x0aOperation\x20cancelled'),0x1;console[_0x1ff845(0xfb)](_0x1ff845(0xf0));try{const _0x1a0416=TDX[_0x1ff845(0xe5)]({'site':_0x2700b2,'apiKey':_0x970506['apiKey'][_0x1ff845(0x10b)](),'logLevel':_0x3549e3[_0x1ff845(0x105)]??LogLevel[_0x1ff845(0x139)]}),_0x30adad=await _0x1a0416['jobs'][_0x1ff845(0x116)]();console[_0x1ff845(0xfb)](a23_0x2b02ed['green']('✓')+_0x1ff845(0x12e)+_0x30adad[_0x1ff845(0xdf)]+')');const _0x3c9f64=await isKeychainAvailable();_0x3c9f64?(await saveAPIKeyAsync(_0x970506[_0x1ff845(0xd5)]['trim'](),_0x2700b2,_0x497ec7),console[_0x1ff845(0xfb)](a23_0x2b02ed[_0x1ff845(0x102)]('✓')+_0x1ff845(0x12d))):console[_0x1ff845(0x129)](a23_0x2b02ed['yellow']('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),_0x56a393[_0x1ff845(0x125)]=_0x2700b2;}catch(_0x4f097c){if(_0x4f097c instanceof HTTPClientError&&_0x4f097c[_0x1ff845(0x11a)]===0x191)return printAuthError(_0x4f097c),0x1;return console[_0x1ff845(0x111)](a23_0x2b02ed['red'](_0x1ff845(0x109)+(_0x4f097c instanceof Error?_0x4f097c[_0x1ff845(0xd8)]:String(_0x4f097c)))),console[_0x1ff845(0x111)](_0x1ff845(0x10f)),0x1;}}else _0x56a393[_0x358527]=_0x3cf4d1||undefined;return saveProfileToUserConfig(_0x497ec7,_0x56a393),console[_0x1ff845(0xfb)](a23_0x2b02ed[_0x1ff845(0x102)]('✓')+_0x1ff845(0xf1)+_0x497ec7+_0x1ff845(0x12c)+_0x358527+'='+(_0x3cf4d1||'(cleared)')),0x0;}}export class ProfileUseCommand extends BaseCommand{[a23_0x18bdec(0xf5)]=a23_0x18bdec(0xf9);[a23_0x18bdec(0xe8)]='Set\x20session\x20profile';[a23_0x18bdec(0x110)](_0x464ed1){const _0x1e6339=a23_0x18bdec,{args:_0x3b040c}=_0x464ed1;if(_0x3b040c[_0x1e6339(0x106)]===0x0)return'Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20use\x20<name>\x20[--default]';return undefined;}async[a23_0x18bdec(0xfe)](_0x1c2201){const _0x372c1a=a23_0x18bdec,{args:_0x388616,options:_0x43ce3a}=_0x1c2201,_0x36baa9=_0x388616[0x0],_0x518273=_0x43ce3a[_0x372c1a(0xed)];cleanExpiredSessions();if(!profileExists(_0x36baa9)){console[_0x372c1a(0x111)](a23_0x2b02ed[_0x372c1a(0xe3)](_0x372c1a(0x138)+_0x36baa9+_0x372c1a(0x12b))),console[_0x372c1a(0xfb)]('\x0aAvailable\x20profiles:');const _0x5a633f=listProfiles();if(_0x5a633f[_0x372c1a(0x106)]===0x0)console['log'](_0x372c1a(0xf3));else for(const _0x45595a of _0x5a633f){console[_0x372c1a(0xfb)](_0x372c1a(0xeb)+_0x45595a[_0x372c1a(0xf5)]);}return 0x1;}if(_0x518273){const _0x9c92f4=a23_0x5735d6[_0x372c1a(0x126)](getConfigDir(),'tdx.json');return saveActiveProfileToUserConfig(_0x36baa9),console['log'](_0x372c1a(0x11c)+a23_0x2b02ed[_0x372c1a(0x102)](_0x36baa9)),console[_0x372c1a(0xfb)](a23_0x2b02ed[_0x372c1a(0x10a)](_0x372c1a(0xe4)+_0x9c92f4)),0x0;}const _0x4e4978=getSessionID(_0x43ce3a['session']);return saveSessionContext({'profile':_0x36baa9},_0x43ce3a[_0x372c1a(0x10e)]),console[_0x372c1a(0xfb)](_0x372c1a(0x11e)+a23_0x2b02ed[_0x372c1a(0x102)](_0x36baa9)+'\x20'+a23_0x2b02ed['dim'](_0x372c1a(0x133)+_0x4e4978+')')),console['log'](a23_0x2b02ed[_0x372c1a(0x10a)](_0x372c1a(0x132)+_0x36baa9+'\x20--default\x27\x20to\x20save\x20permanently')),0x0;}}
|
|
1
|
+
const a23_0x57f547=a23_0x2924;(function(_0x49fec4,_0xd483c0){const _0x474db2=a23_0x2924,_0x4835b2=_0x49fec4();while(!![]){try{const _0x5e9f42=-parseInt(_0x474db2(0x197))/0x1+parseInt(_0x474db2(0x1bf))/0x2+parseInt(_0x474db2(0x1a3))/0x3*(-parseInt(_0x474db2(0x1ba))/0x4)+-parseInt(_0x474db2(0x19a))/0x5*(parseInt(_0x474db2(0x1d7))/0x6)+-parseInt(_0x474db2(0x1a8))/0x7+parseInt(_0x474db2(0x1cc))/0x8+-parseInt(_0x474db2(0x18c))/0x9*(-parseInt(_0x474db2(0x19e))/0xa);if(_0x5e9f42===_0xd483c0)break;else _0x4835b2['push'](_0x4835b2['shift']());}catch(_0x2c4196){_0x4835b2['push'](_0x4835b2['shift']());}}}(a23_0x5035,0x541fe));import{BaseCommand,printAuthError}from'./command.js';import{listProfiles,profileExists,saveProfileToUserConfig,removeProfileFromUserConfig,loadProfile,getActiveProfile,saveActiveProfileToUserConfig}from'../core/profile.js';function a23_0x2924(_0x25f135,_0xb6ef20){_0x25f135=_0x25f135-0x170;const _0x5035b5=a23_0x5035();let _0x292477=_0x5035b5[_0x25f135];return _0x292477;}import{getConfigDir}from'../core/config.js';import*as a23_0x12b1e0 from'node:path';import{saveSessionContext,getSessionID,cleanExpiredSessions}from'../core/session.js';import{saveAPIKeyAsync,resolveSite}from'../core/config.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{buildSiteChoices}from'../core/constants.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a23_0x511cca from'prompts';import a23_0x5776e0 from'chalk';function validateProfileName(_0x14ff39){const _0x15f95a=a23_0x2924;if(!_0x14ff39||!_0x14ff39[_0x15f95a(0x17f)]())return _0x15f95a(0x1c9);const _0xa24914=_0x14ff39[_0x15f95a(0x17f)]();if(!/^[a-zA-Z0-9_-]+$/['test'](_0xa24914))return _0x15f95a(0x1ae);if(profileExists(_0xa24914))return'Profile\x20\x27'+_0xa24914+_0x15f95a(0x17c);return!![];}export class ProfileCreateCommand extends BaseCommand{['name']=a23_0x57f547(0x18a);['description']=a23_0x57f547(0x18b);async[a23_0x57f547(0x176)](_0x14bdf7){const _0x26d122=a23_0x57f547,{options:_0x12cbca,args:_0xd7b54e}=_0x14bdf7;console[_0x26d122(0x184)](a23_0x5776e0['bold']('tdx:\x20profile\x20create'));let _0x1faa02;if(_0xd7b54e[_0x26d122(0x1d9)]>0x0&&_0xd7b54e[0x0]){const _0x5c8591=_0xd7b54e[0x0][_0x26d122(0x17f)](),_0x184a0c=validateProfileName(_0x5c8591);if(_0x184a0c!==!![])return console['error'](a23_0x5776e0[_0x26d122(0x1b7)](_0x184a0c)),0x1;_0x1faa02=_0x5c8591;}else{const _0xbe59da=await a23_0x511cca({'type':_0x26d122(0x195),'name':_0x26d122(0x1da),'message':_0x26d122(0x189),'validate':validateProfileName});if(!_0xbe59da['profileName'])return console[_0x26d122(0x184)](_0x26d122(0x1ce)),0x1;_0x1faa02=_0xbe59da['profileName'][_0x26d122(0x17f)]();}const _0x115783=await a23_0x511cca({'type':'text','name':_0x26d122(0x1b1),'message':_0x26d122(0x19f)}),_0x47b065=_0x115783[_0x26d122(0x1b1)]?.[_0x26d122(0x17f)]()||undefined,_0x437d07=_0x12cbca[_0x26d122(0x177)]||_0x26d122(0x1b8),{choices:_0x4b8069,initialIndex:_0x335675}=buildSiteChoices(_0x437d07),_0x47a68b=await a23_0x511cca({'type':_0x26d122(0x1bc),'name':'site','message':_0x26d122(0x178)+_0x1faa02+'\x27:','choices':_0x4b8069,'initial':_0x335675});if(!_0x47a68b[_0x26d122(0x177)])return console['log']('\x0aSetup\x20cancelled'),0x1;let _0x404993;if(_0x47a68b[_0x26d122(0x177)]==='other'){const _0x5ec79f=await a23_0x511cca({'type':_0x26d122(0x195),'name':_0x26d122(0x1a0),'message':'Enter\x20site\x20name:','initial':_0x26d122(0x1b8),'validate':_0x373bb4=>{const _0x3d4856=_0x26d122;if(!_0x373bb4||!_0x373bb4[_0x3d4856(0x17f)]())return _0x3d4856(0x19d);if(!/^[a-z0-9-]+$/[_0x3d4856(0x1c6)](_0x373bb4['trim']()))return'Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens';return!![];}});if(!_0x5ec79f[_0x26d122(0x1a0)])return console['log'](_0x26d122(0x1ce)),0x1;_0x404993=_0x5ec79f[_0x26d122(0x1a0)];}else _0x404993=_0x47a68b[_0x26d122(0x177)];const _0x34e131=resolveSite(_0x404993);console[_0x26d122(0x184)](_0x26d122(0x1ac)+_0x34e131),console[_0x26d122(0x184)]('You\x20can\x20find\x20your\x20API\x20key\x20at:'),console[_0x26d122(0x184)]('\x20\x20'+getConsoleUrl(_0x34e131,_0x26d122(0x190)));const _0x43da4b=await a23_0x511cca({'type':_0x26d122(0x196),'name':'apiKey','message':_0x26d122(0x18e),'validate':_0x2f0c65=>{const _0x448852=_0x26d122;if(!_0x2f0c65||!_0x2f0c65[_0x448852(0x17f)]())return _0x448852(0x1c8);return!![];}});if(!_0x43da4b['apiKey'])return console[_0x26d122(0x184)](_0x26d122(0x1ce)),0x1;const _0x2abfb2=_0x43da4b['apiKey'];console[_0x26d122(0x184)](_0x26d122(0x192));try{const _0x25f001=TDX[_0x26d122(0x194)]({'site':_0x34e131,'apiKey':_0x2abfb2[_0x26d122(0x17f)](),'logLevel':_0x12cbca[_0x26d122(0x174)]??LogLevel[_0x26d122(0x1aa)]}),_0x2c876d=await _0x25f001[_0x26d122(0x1c3)][_0x26d122(0x183)]();console['log'](a23_0x5776e0[_0x26d122(0x1b5)]('✓')+_0x26d122(0x187)+_0x2c876d[_0x26d122(0x173)]+')');const _0x1a01fd=await isKeychainAvailable();_0x1a01fd?(await saveAPIKeyAsync(_0x2abfb2[_0x26d122(0x17f)](),_0x34e131,_0x1faa02),console[_0x26d122(0x184)](a23_0x5776e0['green']('✓')+_0x26d122(0x1af)+_0x1faa02+')')):(console['warn'](a23_0x5776e0[_0x26d122(0x188)](_0x26d122(0x1a5))),console[_0x26d122(0x198)](a23_0x5776e0[_0x26d122(0x188)](_0x26d122(0x1ad))));const _0x28f3e3={'site':_0x34e131,..._0x47b065&&{'description':_0x47b065}};return saveProfileToUserConfig(_0x1faa02,_0x28f3e3),console[_0x26d122(0x184)](a23_0x5776e0[_0x26d122(0x1b5)]('✓')+'\x20Profile\x20\x27'+_0x1faa02+_0x26d122(0x1c0)),console[_0x26d122(0x184)](),console[_0x26d122(0x184)]('You\x20can\x20now\x20use\x20tdx\x20commands\x20with\x20this\x20profile.\x20Try:'),console[_0x26d122(0x184)](_0x26d122(0x185)+_0x1faa02+_0x26d122(0x172)),console[_0x26d122(0x184)]('\x20\x20tdx\x20--profile\x20'+_0x1faa02+_0x26d122(0x19b)),0x0;}catch(_0x19530b){if(_0x19530b instanceof HTTPClientError&&_0x19530b[_0x26d122(0x1be)]===0x191)return printAuthError(_0x19530b),0x1;return console['error'](a23_0x5776e0[_0x26d122(0x1b7)](_0x26d122(0x171)+(_0x19530b instanceof Error?_0x19530b[_0x26d122(0x1ab)]:String(_0x19530b)))),console[_0x26d122(0x186)](_0x26d122(0x182)),0x1;}}}export class ProfileRemoveCommand extends BaseCommand{[a23_0x57f547(0x1a6)]='profile:remove';['description']=a23_0x57f547(0x1a4);[a23_0x57f547(0x1d6)](_0x2ec9c1){const _0x522cef=a23_0x57f547,{args:_0x426cf1}=_0x2ec9c1;if(_0x426cf1[_0x522cef(0x1d9)]===0x0)return'Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20remove\x20<name>';return undefined;}async['execute'](_0x4a44d1){const _0x1fa6c3=a23_0x57f547,{args:_0x4fc443}=_0x4a44d1,_0x21f96a=_0x4fc443[0x0];console[_0x1fa6c3(0x184)](a23_0x5776e0[_0x1fa6c3(0x1a9)](_0x1fa6c3(0x1cb)));if(!profileExists(_0x21f96a)){console['error'](a23_0x5776e0[_0x1fa6c3(0x1b7)](_0x1fa6c3(0x17d)+_0x21f96a+'\x27\x20does\x20not\x20exist.')),console[_0x1fa6c3(0x184)](_0x1fa6c3(0x18d));const _0x20341f=listProfiles();if(_0x20341f['length']===0x0)console[_0x1fa6c3(0x184)](_0x1fa6c3(0x1d4));else for(const _0x38ffbb of _0x20341f){console['log'](_0x1fa6c3(0x1c7)+_0x38ffbb[_0x1fa6c3(0x1a6)]);}return 0x1;}const _0x11e6d3=await a23_0x511cca({'type':_0x1fa6c3(0x17b),'name':_0x1fa6c3(0x17b),'message':'Are\x20you\x20sure\x20you\x20want\x20to\x20remove\x20profile\x20\x27'+_0x21f96a+'\x27?','initial':![]});if(!_0x11e6d3['confirm'])return console[_0x1fa6c3(0x184)](_0x1fa6c3(0x1b4)),0x0;try{removeProfileFromUserConfig(_0x21f96a),console['log'](a23_0x5776e0[_0x1fa6c3(0x1b5)]('✓')+_0x1fa6c3(0x19c)+_0x21f96a+'\x27\x20removed\x20from\x20configuration');}catch(_0x350114){return console[_0x1fa6c3(0x186)](a23_0x5776e0[_0x1fa6c3(0x1b7)](_0x1fa6c3(0x191)+(_0x350114 instanceof Error?_0x350114[_0x1fa6c3(0x1ab)]:String(_0x350114)))),0x1;}const _0x1ce350=await isKeychainAvailable();if(_0x1ce350){const _0xefba1d=await deleteKeychainAPIKey(_0x21f96a);_0xefba1d&&console[_0x1fa6c3(0x184)](a23_0x5776e0[_0x1fa6c3(0x1b5)]('✓')+_0x1fa6c3(0x1d1));}return 0x0;}}export class ProfileSetCommand extends BaseCommand{[a23_0x57f547(0x1a6)]='profile:set';['description']='Set\x20a\x20profile\x20configuration\x20value';static [a23_0x57f547(0x1d2)]=['site',a23_0x57f547(0x1cf),'parent_segment','llm_project',a23_0x57f547(0x1cd),'description'];[a23_0x57f547(0x1d6)](_0xea1d1){const _0x16d6cf=a23_0x57f547,{args:_0x29b624,options:_0x264b0f}=_0xea1d1,_0x222286=_0x264b0f[_0x16d6cf(0x18f)]||getActiveProfile();if(!_0x222286)return _0x16d6cf(0x199);if(_0x29b624[_0x16d6cf(0x1d9)]===0x0)return'Key=value\x20pair\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20'+ProfileSetCommand[_0x16d6cf(0x1d2)][_0x16d6cf(0x1b0)](',\x20');const _0xbc401d=_0x29b624[0x0];if(!_0xbc401d[_0x16d6cf(0x1d3)]('='))return _0x16d6cf(0x1c5)+ProfileSetCommand[_0x16d6cf(0x1d2)][_0x16d6cf(0x1b0)](',\x20');const [_0x5a6c6a]=_0xbc401d[_0x16d6cf(0x179)]('=',0x2);if(!ProfileSetCommand[_0x16d6cf(0x1d2)]['includes'](_0x5a6c6a))return _0x16d6cf(0x1db)+_0x5a6c6a+_0x16d6cf(0x1b3)+ProfileSetCommand[_0x16d6cf(0x1d2)][_0x16d6cf(0x1b0)](',\x20');return undefined;}async['execute'](_0x4a4d37){const _0x49950e=a23_0x57f547,{args:_0x195858,options:_0x27b34d}=_0x4a4d37,_0x2ef499=_0x27b34d['profile']||getActiveProfile(),[_0x41a133,..._0x3bdf4c]=_0x195858[0x0][_0x49950e(0x179)]('='),_0x105fa7=_0x3bdf4c['join']('=');console[_0x49950e(0x184)](a23_0x5776e0['bold'](_0x49950e(0x1a7)));if(!profileExists(_0x2ef499)){const _0x4a441e=await a23_0x511cca({'type':_0x49950e(0x17b),'name':_0x49950e(0x194),'message':'Profile\x20\x27'+_0x2ef499+'\x27\x20does\x20not\x20exist.\x20Create\x20it?','initial':!![]});if(!_0x4a441e[_0x49950e(0x194)])return console['log'](_0x49950e(0x1b2)),0x1;}const _0x5ead2f=loadProfile(_0x2ef499),_0x20d6c8=_0x5ead2f?.[_0x49950e(0x1d0)]||{};if(_0x41a133===_0x49950e(0x177)){const _0x1bda6f=resolveSite(_0x105fa7);console[_0x49950e(0x184)](_0x49950e(0x1d8)+_0x1bda6f+'\x27\x20requires\x20API\x20key\x20validation.'),console[_0x49950e(0x184)](_0x49950e(0x1ca)),console['log']('\x20\x20'+getConsoleUrl(_0x1bda6f,_0x49950e(0x190)));const _0x1904c9=await a23_0x511cca({'type':_0x49950e(0x196),'name':_0x49950e(0x1bd),'message':_0x49950e(0x193),'validate':_0xeeb9c2=>{const _0x3455f4=_0x49950e;if(!_0xeeb9c2||!_0xeeb9c2[_0x3455f4(0x17f)]())return _0x3455f4(0x1c8);return!![];}});if(!_0x1904c9[_0x49950e(0x1bd)])return console[_0x49950e(0x184)](_0x49950e(0x1c4)),0x1;console[_0x49950e(0x184)](_0x49950e(0x192));try{const _0x8a103d=TDX[_0x49950e(0x194)]({'site':_0x1bda6f,'apiKey':_0x1904c9['apiKey']['trim'](),'logLevel':_0x27b34d[_0x49950e(0x174)]??LogLevel['ERROR']}),_0x2e6a98=await _0x8a103d[_0x49950e(0x1c3)]['getUserInfo']();console['log'](a23_0x5776e0['green']('✓')+_0x49950e(0x187)+_0x2e6a98[_0x49950e(0x173)]+')');const _0x10a1ee=await isKeychainAvailable();_0x10a1ee?(await saveAPIKeyAsync(_0x1904c9['apiKey'][_0x49950e(0x17f)](),_0x1bda6f,_0x2ef499),console[_0x49950e(0x184)](a23_0x5776e0[_0x49950e(0x1b5)]('✓')+'\x20API\x20key\x20saved\x20to\x20system\x20keychain')):console['warn'](a23_0x5776e0[_0x49950e(0x188)](_0x49950e(0x1a5))),_0x20d6c8['site']=_0x1bda6f;}catch(_0x48059c){if(_0x48059c instanceof HTTPClientError&&_0x48059c[_0x49950e(0x1be)]===0x191)return printAuthError(_0x48059c),0x1;return console[_0x49950e(0x186)](a23_0x5776e0['red'](_0x49950e(0x171)+(_0x48059c instanceof Error?_0x48059c['message']:String(_0x48059c)))),console[_0x49950e(0x186)](_0x49950e(0x17a)),0x1;}}else _0x20d6c8[_0x41a133]=_0x105fa7||undefined;return saveProfileToUserConfig(_0x2ef499,_0x20d6c8),console[_0x49950e(0x184)](a23_0x5776e0[_0x49950e(0x1b5)]('✓')+'\x20Profile\x20\x27'+_0x2ef499+_0x49950e(0x175)+_0x41a133+'='+(_0x105fa7||_0x49950e(0x17e))),0x0;}}function a23_0x5035(){const _0x81ba73=['⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','name','tdx:\x20profile\x20set','447489sEqvXc','bold','ERROR','message','\x0aSetting\x20up\x20authentication\x20for\x20site:\x20','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','Profile\x20name\x20must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20and\x20underscore','\x20API\x20key\x20saved\x20to\x20system\x20keychain\x20(profile:\x20','join','description','Operation\x20cancelled','\x27.\x0a\x0aValid\x20keys:\x20','Removal\x20cancelled','green','\x0aSaved\x20to:\x20','red','us01','Default\x20profile\x20set\x20to:\x20','12VaheIu','tdx.json','select','apiKey','status','945278zoNAUr','\x27\x20created','(session:\x20','\x0aTip:\x20Use\x20\x27tdx\x20profile\x20use\x20','jobs','\x0aOperation\x20cancelled','Invalid\x20format.\x20Use:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20','test','\x20\x20-\x20','API\x20key\x20cannot\x20be\x20empty','Profile\x20name\x20cannot\x20be\x20empty','\x0aYou\x20can\x20find\x20your\x20API\x20key\x20at:','tdx:\x20profile\x20remove','4564672JbPpQp','llm_agent','\x0aSetup\x20cancelled','database','config','\x20API\x20key\x20removed\x20from\x20system\x20keychain','VALID_KEYS','includes','\x20\x20(no\x20profiles\x20found)','profile:use','validate','1762854lhzgsH','Changing\x20site\x20to\x20\x27','length','profileName','Unknown\x20key\x20\x27','session','✗\x20Validation\x20failed:\x20','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','email','logLevel','\x27\x20updated:\x20','execute','site','Select\x20Treasure\x20Data\x20site\x20for\x20profile\x20\x27','split','Site\x20was\x20not\x20changed.','confirm','\x27\x20already\x20exists.\x20Use\x20\x27tdx\x20profile\x20set\x27\x20to\x20modify\x20it.','Profile\x20\x27','(cleared)','trim','Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20use\x20<name>\x20[--default]','default','Profile\x20was\x20not\x20created.\x20Please\x20try\x20again.','getUserInfo','log','\x20\x20tdx\x20--profile\x20','error','\x20API\x20key\x20is\x20valid\x20(User:\x20','yellow','Enter\x20profile\x20name:','profile:create','Create\x20a\x20new\x20profile','751194cQjoFg','\x0aAvailable\x20profiles:','Enter\x20your\x20TD\x20API\x20key:','profile','/app/mp/ak','Failed\x20to\x20remove\x20profile:\x20','Validating\x20API\x20key...','Enter\x20your\x20TD\x20API\x20key\x20for\x20the\x20new\x20site:','create','text','password','398797MSMkhN','warn','No\x20active\x20profile.\x20Use\x20--profile\x20flag\x20or\x20set\x20session\x20profile\x20with:\x20tdx\x20profile\x20use\x20<name>\x0a\x0aUsage:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>','10Luajct','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','\x20Profile\x20\x27','Site\x20name\x20cannot\x20be\x20empty','90wzsITz','Enter\x20description\x20(optional):','customSite','dim','Session\x20profile\x20set\x20to:\x20','399501RJJtrD','Remove\x20a\x20profile'];a23_0x5035=function(){return _0x81ba73;};return a23_0x5035();}export class ProfileUseCommand extends BaseCommand{['name']=a23_0x57f547(0x1d5);[a23_0x57f547(0x1b1)]='Set\x20session\x20profile';[a23_0x57f547(0x1d6)](_0x2078af){const _0xd97adc=a23_0x57f547,{args:_0x33b51c}=_0x2078af;if(_0x33b51c[_0xd97adc(0x1d9)]===0x0)return _0xd97adc(0x180);return undefined;}async[a23_0x57f547(0x176)](_0x5b8082){const _0x19feba=a23_0x57f547,{args:_0x270f73,options:_0x153546}=_0x5b8082,_0x34dfcc=_0x270f73[0x0],_0x46fbb7=_0x153546[_0x19feba(0x181)];cleanExpiredSessions();if(!profileExists(_0x34dfcc)){console[_0x19feba(0x186)](a23_0x5776e0['red'](_0x19feba(0x17d)+_0x34dfcc+'\x27\x20does\x20not\x20exist.')),console[_0x19feba(0x184)](_0x19feba(0x18d));const _0x4519aa=listProfiles();if(_0x4519aa[_0x19feba(0x1d9)]===0x0)console[_0x19feba(0x184)](_0x19feba(0x1d4));else for(const _0x26b88a of _0x4519aa){console[_0x19feba(0x184)](_0x19feba(0x1c7)+_0x26b88a[_0x19feba(0x1a6)]);}return 0x1;}if(_0x46fbb7){const _0x2c280c=a23_0x12b1e0[_0x19feba(0x1b0)](getConfigDir(),_0x19feba(0x1bb));return saveActiveProfileToUserConfig(_0x34dfcc),console[_0x19feba(0x184)](_0x19feba(0x1b9)+a23_0x5776e0[_0x19feba(0x1b5)](_0x34dfcc)),console['log'](a23_0x5776e0[_0x19feba(0x1a1)](_0x19feba(0x1b6)+_0x2c280c)),0x0;}const _0x3ea022=getSessionID(_0x153546[_0x19feba(0x170)]);return saveSessionContext({'profile':_0x34dfcc},_0x153546['session']),console[_0x19feba(0x184)](_0x19feba(0x1a2)+a23_0x5776e0[_0x19feba(0x1b5)](_0x34dfcc)+'\x20'+a23_0x5776e0[_0x19feba(0x1a1)](_0x19feba(0x1c1)+_0x3ea022+')')),console[_0x19feba(0x184)](a23_0x5776e0['dim'](_0x19feba(0x1c2)+_0x34dfcc+'\x20--default\x27\x20to\x20save\x20permanently')),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a24_0x43041d=a24_0x6b68;(function(_0xf8528d,_0x3601eb){const _0x3f18f3=a24_0x6b68,_0x36009f=_0xf8528d();while(!![]){try{const _0x41686c=-parseInt(_0x3f18f3(0x1a5))/0x1+parseInt(_0x3f18f3(0x19d))/0x2+-parseInt(_0x3f18f3(0x1b3))/0x3*(-parseInt(_0x3f18f3(0x19f))/0x4)+-parseInt(_0x3f18f3(0x1a6))/0x5*(parseInt(_0x3f18f3(0x1a4))/0x6)+-parseInt(_0x3f18f3(0x19e))/0x7*(-parseInt(_0x3f18f3(0x1a9))/0x8)+-parseInt(_0x3f18f3(0x1ad))/0x9*(-parseInt(_0x3f18f3(0x1b0))/0xa)+-parseInt(_0x3f18f3(0x1af))/0xb;if(_0x41686c===_0x3601eb)break;else _0x36009f['push'](_0x36009f['shift']());}catch(_0x6b5a64){_0x36009f['push'](_0x36009f['shift']());}}}(a24_0xcf4d,0x93eea));function a24_0xcf4d(){const _0x437044=['config','14003869VqIpvW','742950XevUNd','error','description','3FmumZq','execute','\x20\x20Global:\x20~/.config/tdx/tdx.json','2414036Kfculo','7168497zWPTbP','2662468hoFOiB','name','profiles','List\x20all\x20available\x20profiles','length','3786VrGeOi','1200461IMMTLk','6205wsPYgC','scope','log','8NivxpL','map','Error:\x20','message','117qzXYJE'];a24_0xcf4d=function(){return _0x437044;};return a24_0xcf4d();}import{BaseCommand}from'./command.js';function a24_0x6b68(_0xb86b00,_0x1a44bf){_0xb86b00=_0xb86b00-0x19b;const _0xcf4d1d=a24_0xcf4d();let _0x6b6814=_0xcf4d1d[_0xb86b00];return _0x6b6814;}import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';import{handleSDKOutput}from'../core/command-output.js';export class ProfilesCommand extends BaseCommand{[a24_0x43041d(0x1a0)]=a24_0x43041d(0x1a1);[a24_0x43041d(0x1b2)]=a24_0x43041d(0x1a2);async[a24_0x43041d(0x19b)](_0x509e02){const _0x5e8835=a24_0x43041d,{options:_0x1b401d}=_0x509e02;try{const _0x51ea50=listProfiles(),_0x326100=getActiveProfile();if(_0x51ea50[_0x5e8835(0x1a3)]===0x0)return console[_0x5e8835(0x1a8)]('No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a'),console['log']('\x20\x20Local:\x20\x20(project\x20folder)/tdx.json'),console['log'](_0x5e8835(0x19c)),0x0;const _0x177477=_0x51ea50[_0x5e8835(0x1aa)](_0x5e81db=>{const _0x1810e9=_0x5e8835,_0x46d633=_0x5e81db[_0x1810e9(0x1a0)]===_0x326100,_0x4a9472=getProfileParams(_0x5e81db[_0x1810e9(0x1ae)]);return{'name':_0x5e81db[_0x1810e9(0x1a0)],'active':_0x46d633,'scope':_0x5e81db[_0x1810e9(0x1a7)],'description':_0x5e81db[_0x1810e9(0x1ae)][_0x1810e9(0x1b2)]||'','params':_0x4a9472};});return await handleSDKOutput(_0x177477,_0x1b401d),0x0;}catch(_0x1fd7a0){return _0x1fd7a0 instanceof Error&&console[_0x5e8835(0x1b1)](_0x5e8835(0x1ab)+_0x1fd7a0[_0x5e8835(0x1ac)]),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a25_0x2238df=a25_0x2256;function a25_0x2594(){const _0x40961a=['Query\x20completed:\x20Processed\x20','\x0aAll\x20results\x20saved\x20to\x20','description','Run\x20Trino\x20queries\x20(streaming)','\x20rows\x20','150024vrLfFY','message','length','verbose','name','push','setPhase','16cAQVRe','Statement\x20','Executing\x20statement\x20','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','Usage:\x20tdx\x20query\x20\x22SELECT\x20*\x20FROM\x20table\x22\x0a\x20\x20\x20or:\x20tdx\x20query\x20query.sql\x0a\x20\x20\x20or:\x20echo\x20\x22SELECT\x201\x22\x20|\x20tdx\x20query\x20-\x0a\x0aRun\x20\x27tdx\x20query\x20--help\x27\x20for\x20more\x20options','output','elapsedTimeMillis','18444217KwYQaW','Error:\x20','stats','error','query','Catalog:\x20','catalog','215755nYJKqH','file','totalSplits','Schema:\x20','processedRows','9CZvlyo','Executing\x20query\x20[','state','join','execute','Site:\x20','information_schema','jobId','5583030tjRklK','originalMessage','args','options','516938VOkVYL','4891656qMURxz','12rQWWdS','setJobId','No\x20SQL\x20provided','2yUEOOA','...','\x20splits','in\x20','validate','56MpfIGJ','1637400QaRTbE','Executing\x20query...','setExtra','completedSplits','data'];a25_0x2594=function(){return _0x40961a;};return a25_0x2594();}(function(_0xcdef3f,_0x254ed4){const _0x3079ec=a25_0x2256,_0x2a095c=_0xcdef3f();while(!![]){try{const _0x4c4a10=parseInt(_0x3079ec(0x105))/0x1+parseInt(_0x3079ec(0x10a))/0x2*(-parseInt(_0x3079ec(0x110))/0x3)+parseInt(_0x3079ec(0x121))/0x4*(parseInt(_0x3079ec(0x12f))/0x5)+-parseInt(_0x3079ec(0x11a))/0x6*(parseInt(_0x3079ec(0x10f))/0x7)+-parseInt(_0x3079ec(0x106))/0x8+-parseInt(_0x3079ec(0x134))/0x9*(parseInt(_0x3079ec(0x13c))/0xa)+parseInt(_0x3079ec(0x128))/0xb*(parseInt(_0x3079ec(0x107))/0xc);if(_0x4c4a10===_0x254ed4)break;else _0x2a095c['push'](_0x2a095c['shift']());}catch(_0x467f3d){_0x2a095c['push'](_0x2a095c['shift']());}}}(a25_0x2594,0x6e089));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../core/command-output.js';import{readSqlStatementsFromFile,readSqlStatementsFromStdin,splitSqlStatements,isSqlFilePath}from'../sdk/query/sql-parser.js';import{writeFileSync}from'fs';function a25_0x2256(_0x17202c,_0x3763c8){_0x17202c=_0x17202c-0x104;const _0x2594f4=a25_0x2594();let _0x2256e2=_0x2594f4[_0x17202c];return _0x2256e2;}import{withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{formatRows}from'../sdk/util/formatters.js';export class QueryCommand extends BaseCommand{[a25_0x2238df(0x11e)]=a25_0x2238df(0x12c);[a25_0x2238df(0x117)]=a25_0x2238df(0x118);async[a25_0x2238df(0x138)](_0x451ac3){const _0x1421ac=a25_0x2238df,{options:_0x5a5ade,args:_0x3a82a8,tdx:_0x3f1e26}=_0x451ac3,_0x278821=_0x3a82a8[0x0],_0x27a2bf=_0x5a5ade[_0x1421ac(0x130)];let _0x3d3816;try{if(_0x27a2bf)_0x3d3816=readSqlStatementsFromFile(_0x27a2bf);else{if(_0x278821==='-')_0x3d3816=await readSqlStatementsFromStdin();else{if(_0x278821&&isSqlFilePath(_0x278821))_0x3d3816=readSqlStatementsFromFile(_0x278821);else{if(_0x278821)_0x3d3816=splitSqlStatements(_0x278821);else throw new Error(_0x1421ac(0x109));}}}}catch(_0x573608){return console[_0x1421ac(0x12b)](_0x1421ac(0x129)+_0x573608[_0x1421ac(0x11b)]),0x1;}const _0x5c3dce=_0x5a5ade['database']||_0x1421ac(0x13a),_0x3ed02d=_0x5a5ade[_0x1421ac(0x12e)];try{const _0x978a44=[],_0x25635e=!!_0x5a5ade[_0x1421ac(0x126)];for(let _0x2a3fb5=0x0;_0x2a3fb5<_0x3d3816[_0x1421ac(0x11c)];_0x2a3fb5++){const _0x2918fe=_0x3d3816[_0x2a3fb5],_0x4e8343=_0x2a3fb5+0x1,_0x3a86da=_0x3d3816[_0x1421ac(0x11c)],_0xdb4c88=_0x3a86da>0x1;_0x5a5ade[_0x1421ac(0x11d)]&&(console['error']('\x0a'+(_0xdb4c88?_0x1421ac(0x122)+_0x4e8343+'/'+_0x3a86da+':':'')),console[_0x1421ac(0x12b)](_0x1421ac(0x139)+_0x5a5ade['site']),console[_0x1421ac(0x12b)](_0x1421ac(0x12d)+(_0x3ed02d||'td')),console['error'](_0x1421ac(0x132)+_0x5c3dce),console[_0x1421ac(0x12b)]('SQL:\x20'+_0x2918fe));const _0x39d75e=_0xdb4c88?_0x1421ac(0x123)+_0x4e8343+'/'+_0x3a86da+_0x1421ac(0x10b):_0x1421ac(0x111);try{const _0x5cb8da=await withProgressSpinner(_0x39d75e,async _0x35a220=>{const _0x19a336=_0x1421ac,_0x19dd49=await _0x3f1e26['query'][_0x19a336(0x138)](_0x2918fe,{'catalog':_0x3ed02d,'schema':_0x5c3dce,'onJobId':_0x801fdd=>{const _0x5b0d77=_0x19a336;_0x35a220[_0x5b0d77(0x108)](_0x801fdd);},'onProgress':_0xb8980b=>{const _0x24cf1a=_0x19a336;_0x35a220[_0x24cf1a(0x120)](_0x24cf1a(0x135)+_0xb8980b[_0x24cf1a(0x136)]+']'),_0x35a220[_0x24cf1a(0x112)](formatRows(_0xb8980b[_0x24cf1a(0x133)])+_0x24cf1a(0x119)+_0xb8980b[_0x24cf1a(0x113)]+'/'+_0xb8980b[_0x24cf1a(0x131)]+_0x24cf1a(0x10c));}});return _0x19dd49;},{'verbose':_0x5a5ade[_0x1421ac(0x11d)]}),_0x5f5435=_0x5cb8da[_0x1421ac(0x114)],_0x3f06b4=_0x5f5435[_0x1421ac(0x13b)]?'\x20[Job\x20ID:\x20'+_0x5f5435[_0x1421ac(0x13b)]+']':'',_0x120040=_0xdb4c88?_0x1421ac(0x122)+_0x4e8343+'/'+_0x3a86da+'\x20-\x20':'';console['error']('✔\x20'+_0x120040+_0x1421ac(0x115)+formatRows(_0x5f5435[_0x1421ac(0x12a)][_0x1421ac(0x133)])+_0x1421ac(0x119)+(_0x1421ac(0x10d)+formatElapsed(_0x5f5435[_0x1421ac(0x12a)][_0x1421ac(0x127)])+_0x3f06b4));if(_0xdb4c88&&_0x25635e){const _0x41a3bd=resolveOutputOptions(_0x5a5ade),_0x8d1dad=await formatQueryOutput(_0x5f5435,_0x41a3bd);_0x978a44[_0x1421ac(0x11f)](_0x8d1dad);}else await handleQueryOutput(_0x5f5435,_0x5a5ade);}catch(_0x33f563){const _0x5783f1=_0xdb4c88?_0x1421ac(0x122)+_0x4e8343+'/'+_0x3a86da+':\x0a':'',_0x345b28=_0x33f563 instanceof SDKError?_0x33f563[_0x1421ac(0x13d)]:_0x33f563[_0x1421ac(0x11b)];return console[_0x1421ac(0x12b)](''+_0x5783f1+_0x345b28),0x1;}}if(_0x3d3816[_0x1421ac(0x11c)]>0x1&&_0x25635e&&_0x978a44[_0x1421ac(0x11c)]>0x0){const _0x574732=_0x978a44[_0x1421ac(0x137)]('\x0a');writeFileSync(_0x5a5ade[_0x1421ac(0x126)],_0x574732),console['error'](_0x1421ac(0x116)+_0x5a5ade[_0x1421ac(0x126)]);}return 0x0;}catch(_0x55157c){throw _0x55157c;}}[a25_0x2238df(0x10e)](_0x55aa2c){const _0x69dbef=a25_0x2238df,_0xf465e9=_0x55aa2c[_0x69dbef(0x13e)][0x0],_0x84d0a7=_0x55aa2c[_0x69dbef(0x104)][_0x69dbef(0x130)];if(!_0xf465e9&&!_0x84d0a7)return _0x69dbef(0x125);if(_0xf465e9&&_0x84d0a7)return _0x69dbef(0x124);return undefined;}}
|