@treasuredata/tdx 0.8.6 → 0.8.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +2 -2
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/client/cdp-api-client.js +1 -1
  6. package/dist/client/engage-api-client.js +1 -1
  7. package/dist/client/http-client.js +1 -1
  8. package/dist/client/llm-api-client.js +1 -1
  9. package/dist/client/rate-limiter.js +1 -1
  10. package/dist/client/td-api-client.js +1 -1
  11. package/dist/client/trino-api-client.js +1 -1
  12. package/dist/client/workflow-client.js +1 -1
  13. package/dist/commands/activations.js +1 -1
  14. package/dist/commands/api-command.js +1 -1
  15. package/dist/commands/auth-command.js +1 -1
  16. package/dist/commands/chat-command.js +1 -1
  17. package/dist/commands/claude-command.js +1 -1
  18. package/dist/commands/claude-statusline-command.js +1 -1
  19. package/dist/commands/claude-usage-command.js +1 -1
  20. package/dist/commands/command.js +1 -1
  21. package/dist/commands/connection-command.js +1 -1
  22. package/dist/commands/context-command.js +1 -1
  23. package/dist/commands/databases.js +1 -1
  24. package/dist/commands/describe.js +1 -1
  25. package/dist/commands/engage-command.js +1 -1
  26. package/dist/commands/job-command.js +1 -1
  27. package/dist/commands/journey-command.js +1 -1
  28. package/dist/commands/llm-command.js +1 -1
  29. package/dist/commands/llm-proxy.js +1 -1
  30. package/dist/commands/parent-segment-command.js +1 -1
  31. package/dist/commands/profiles-command.js +1 -1
  32. package/dist/commands/query-command.js +1 -1
  33. package/dist/commands/segment-command.js +1 -1
  34. package/dist/commands/segment-create-command.js +1 -1
  35. package/dist/commands/segment-fields-command.js +1 -1
  36. package/dist/commands/segment-pull-command.js +1 -1
  37. package/dist/commands/segment-push-command.js +1 -1
  38. package/dist/commands/segment-update-command.js +1 -1
  39. package/dist/commands/segment-use-command.js +1 -1
  40. package/dist/commands/segments.js +1 -1
  41. package/dist/commands/show.js +1 -1
  42. package/dist/commands/tables.js +1 -1
  43. package/dist/commands/use-command.js +1 -1
  44. package/dist/commands/user-command.js +1 -1
  45. package/dist/commands/workflow-command.js +1 -1
  46. package/dist/core/auth.js +1 -1
  47. package/dist/core/config.js +1 -1
  48. package/dist/core/connection-cache.js +1 -1
  49. package/dist/core/credential-cache.js +1 -1
  50. package/dist/core/global-context.js +1 -1
  51. package/dist/core/keychain.js +1 -1
  52. package/dist/core/profile.js +1 -1
  53. package/dist/core/project-config.js +1 -1
  54. package/dist/core/session.js +1 -1
  55. package/dist/core/user-cache.js +1 -1
  56. package/dist/index.js +1 -1
  57. package/dist/proxy/anthropic-adapter.js +1 -1
  58. package/dist/proxy/claude-usage-tracker.js +1 -1
  59. package/dist/proxy/context-signature.js +1 -1
  60. package/dist/proxy/conversation-utils.js +1 -1
  61. package/dist/proxy/server.js +1 -1
  62. package/dist/proxy/session-cache.js +1 -1
  63. package/dist/sdk/api.js +1 -1
  64. package/dist/sdk/connection.js +1 -1
  65. package/dist/sdk/engage.js +1 -1
  66. package/dist/sdk/errors.js +1 -1
  67. package/dist/sdk/index.js +1 -1
  68. package/dist/sdk/job.js +1 -1
  69. package/dist/sdk/journey.js +1 -1
  70. package/dist/sdk/llm.js +1 -1
  71. package/dist/sdk/query.js +1 -1
  72. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  73. package/dist/sdk/segment/journey-yaml.js +1 -1
  74. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  75. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  76. package/dist/sdk/segment.js +1 -1
  77. package/dist/sdk/user.js +1 -1
  78. package/dist/sdk/workflow.js +1 -1
  79. package/dist/types/endpoints.js +1 -1
  80. package/dist/types/index.js +1 -1
  81. package/dist/utils/agent-ref-parser.js +1 -1
  82. package/dist/utils/async.js +1 -1
  83. package/dist/utils/chat-cache.js +1 -1
  84. package/dist/utils/colors.js +1 -1
  85. package/dist/utils/command-output.js +1 -1
  86. package/dist/utils/constants.js +1 -1
  87. package/dist/utils/diff.js +1 -1
  88. package/dist/utils/fields-display.js +1 -1
  89. package/dist/utils/file-permissions.js +1 -1
  90. package/dist/utils/format-detector.js +1 -1
  91. package/dist/utils/formatters.js +1 -1
  92. package/dist/utils/json-loader.js +1 -1
  93. package/dist/utils/llm-backup-utils.js +1 -1
  94. package/dist/utils/model-aliases.js +1 -1
  95. package/dist/utils/model-factors.js +1 -1
  96. package/dist/utils/option-validation.js +1 -1
  97. package/dist/utils/port.js +1 -1
  98. package/dist/utils/process.d.ts.map +1 -1
  99. package/dist/utils/process.js +1 -1
  100. package/dist/utils/process.js.map +1 -1
  101. package/dist/utils/prompt.js +1 -1
  102. package/dist/utils/segment-path-parser.js +1 -1
  103. package/dist/utils/segment-ref-parser.js +1 -1
  104. package/dist/utils/spinner.js +1 -1
  105. package/dist/utils/sql-parser.js +1 -1
  106. package/dist/utils/sse-parser.js +1 -1
  107. package/dist/utils/string-utils.js +1 -1
  108. package/dist/utils/table-ref-parser.js +1 -1
  109. package/dist/utils/tdx-config.js +1 -1
  110. package/dist/utils/tdx-logger.js +1 -1
  111. package/dist/utils/tree-formatter.js +1 -1
  112. package/dist/utils/version-check.js +1 -1
  113. package/dist/utils/workflow-utils.js +1 -1
  114. package/package.json +1 -1
@@ -1 +1 @@
1
- const a28_0x1408f6=a28_0x29f8;(function(_0x4de90d,_0x2d2309){const _0x2627d8=a28_0x29f8,_0x2e8086=_0x4de90d();while(!![]){try{const _0x4d2b5e=parseInt(_0x2627d8(0x161))/0x1*(-parseInt(_0x2627d8(0xd9))/0x2)+-parseInt(_0x2627d8(0x119))/0x3*(-parseInt(_0x2627d8(0xce))/0x4)+parseInt(_0x2627d8(0x142))/0x5*(-parseInt(_0x2627d8(0xfa))/0x6)+parseInt(_0x2627d8(0x110))/0x7*(-parseInt(_0x2627d8(0x12d))/0x8)+parseInt(_0x2627d8(0xc9))/0x9+-parseInt(_0x2627d8(0xe4))/0xa+-parseInt(_0x2627d8(0x19c))/0xb*(-parseInt(_0x2627d8(0xcd))/0xc);if(_0x4d2b5e===_0x2d2309)break;else _0x2e8086['push'](_0x2e8086['shift']());}catch(_0x1fa031){_0x2e8086['push'](_0x2e8086['shift']());}}}(a28_0xe956,0x61118));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a28_0x45c961 from'path';import{BaseCommand}from'./command.js';function a28_0xe956(){const _0x251e4b=['Running\x20parent\x20segment\x20workflow\x20for\x20\x27','Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20(requires\x20context)\x0a','Status:','List\x20available\x20fields\x20for\x20segmentation','data','segment:parent:run','test','yes','xdg-open','Parent\x20segment:\x20','replace','Updated','\x20Opening\x20','column','addBehaviors','Attempt:','isDirectory','1725QslROc','pushParentYaml','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','\x0aChanges\x20to\x20\x27','matchedCount','workflowAttemptId','jsonl','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','open','segment:parent:create','\x20--interval\x20','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','Executing\x20parent\x20segment\x20query...','\x20[Job\x20ID:\x20','runParent','Creating','stop','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','map','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','\x0aChanges\x20to\x20apply\x20to\x20\x27','/\x20directory.\x0a','\x20--attribute\x20\x22<name>\x22','\x20--behavior\x20\x22<name>\x22','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','\x27\x20is\x20already\x20up\x20to\x20date','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','Error:\x20Parent\x20segment\x20name\x20is\x20required','/sessions/','name','filter','588253xdSzDj','Show\x20parent\x20segment\x20schema\x20(column\x20types)','varchar','\x20kill','customerGroupFile','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','✘\x20Failed\x20to\x20rename\x20directory:\x20','database','Fetching\x20SQL\x20for\x20\x27','Rows:','sort','FINISHED','json','Error\x20parsing\x20YAML:\x20','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','message','/attempt/','segment:parent:sql','\x20Context\x20set:\x20','Listing\x20fields\x20for\x20\x27','displaySummary','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','coveragePercent','-1d','Updating','jobId','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','dirname','\x0aNew\x20parent\x20segment\x20\x27','previewParentYaml','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','log','Available\x20behaviors:','platform','unref','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','/\x20→\x20','createParent','getParentFull','Join:','attributes','\x20field','/app/dw/parentSegments/','keys','join','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','Source:','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','Listing\x20parent\x20segments\x20matching\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','cyan','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','apply','\x27\x20with\x20ID:\x20','\x20--behavior\x20\x22','Validate:','\x20tdx\x20wf\x20attempt\x20','Behaviors','1892385AWrZMu','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20specific\x20parent\x20segment','displayValidateResults','in\x20','No\x20parent\x20segments\x20match\x20pattern:\x20','Apply\x20changes\x20to\x20\x27','\x20--attribute\x20\x22','\x0aNo\x20sample\x20data\x20available','execute','segment:parent:desc','yellow','length','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','.yml','displayAttributesStats','Error:\x20--attribute\x20requires\x20a\x20name\x0a','verbose','master','Resolving\x20parent\x20segment\x20\x27','audienceId','bold','schemaError','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','interval','Error:\x20--behavior\x20requires\x20a\x20name\x0a','attributesFile','Error:\x20File\x20not\x20found:\x20','utf-8','Creating\x20parent\x20segment\x20\x27','\x20is\x20already\x20up\x20to\x20date','parent_segment','YAML\x20file:\x20','segment:parent:fields','displayPreviewHints','preview','resolveParentId','Aborted.','label','\x20Configuration\x20is\x20valid','parent_segments','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','customerGroup','Columns:','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','all','Site:\x20','Error:','/{name}.yml\x0a','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','✔\x20Updated\x20parent\x20segment\x20\x27','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','displaySampleData','tdx\x20segment\x20parent\x20preview\x20','Audience\x20ID:','customerPercent','stats','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','population','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','allValid','description','double','totalEvents','\x20parent\x20segment\x20\x27','status','endsWith','using\x20the\x20default\x20path:\x20','getParentSQL','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','\x20\x20\x20\x20-\x20','segment:parent:pull','workflowSessionId','Events:','segment','text','updateParent','\x20=\x20','\x20rows)','Validating\x20configuration...','1357677XMVZzm','Error\x20reading\x20file:\x20','.yaml','web','108eAgwVw','1952036rQvvKs','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','rowCount','joinKey','Options:\x0a','schemaValid','win32','setJobId','\x0a⚠️\x20\x20Both\x20','errors','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','2dHeCYD','displayMasterInfo','Found\x20YAML\x20file:\x20','darwin','start','List\x20parent\x20segments','✔\x20No\x20changes\x20-\x20\x27','attribute','behavior','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','segment:parent:preview','2415560qyCrNm','limit','✔\x20Renamed\x20directory\x20to\x20','👥\x20','match','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','Enriched:','Join\x20on:','displayBehaviorsStats','✔\x20Found\x20','\x20No\x20changes\x20-\x20','repeat','SQL\x20query:\x0a','sampleData','enriched','scheduleOption','segment:parent:view','string','\x5c$&','\x20parent\x20segment','/\x20and\x20','timezone','3048uTrrMF','displayColumns','Name:\x20','workflowId','Customers:','green','Master\x20Table','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','Master\x20+\x20Attributes','Get\x20SQL\x20query\x20for\x20parent\x20segment','/app/workflows/','number','behaviors','foreignKey','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','To\x20cancel:','error','Session:','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Fetching\x20parent\x20segment\x20\x27','table','To\x20view\x20sample\x20data:','14aGQHhf','\x27...','addBehaviorsFile','site','Show\x20parent\x20segment\x20details','dim','\x20\x20No\x20sample\x20data\x20available','displayPreviewResults','scheduleType','3rxnSAj','session','\x0aUsage:\x20tdx\x20ps\x20preview\x20','Database:\x20','red','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','Fetching\x20sample\x20data...','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','parentSegment','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','Available\x20attributes:','\x27\x20and\x20run\x20workflow?','Preview:','toFixed','Create\x20parent\x20segment\x20\x27','columns','Created','`\x20to\x20download\x20the\x20configuration\x20first','format','\x27\x20is\x20up\x20to\x20date','3138064tJKWVG','output','addAttributes','Error:\x20--database\x20and\x20--table\x20are\x20required'];a28_0xe956=function(){return _0x251e4b;};return a28_0xe956();}import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,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'../types/endpoints.js';import{formatRows,formatAsTable}from'../utils/formatters.js';import{parseYamlString}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';import a28_0xf2d79 from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../utils/fields-display.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';const PARENT_SEGMENT_DIR=a28_0x1408f6(0x9e),LEGACY_PARENT_SEGMENT_DIR=a28_0x1408f6(0x1bb);function openBrowser(_0x561216){const _0x19c178=a28_0x1408f6,_0x346802=process[_0x19c178(0x182)],_0x580996=_0x346802===_0x19c178(0xdc)?_0x19c178(0x14a):_0x346802===_0x19c178(0xd4)?_0x19c178(0xdd):_0x19c178(0x139);spawn(_0x580996,[_0x561216],{'detached':!![],'stdio':'ignore'})[_0x19c178(0x183)]();}function migrateLegacyDirectory(){const _0x5825aa=a28_0x1408f6;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x16da0e=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x16da0e[_0x5825aa(0x141)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console['error'](a28_0xf2d79[_0x5825aa(0x1a6)](_0x5825aa(0xd6)+LEGACY_PARENT_SEGMENT_DIR+_0x5825aa(0xf8)+PARENT_SEGMENT_DIR+'/\x20directories\x20exist.')),console[_0x5825aa(0x10a)](a28_0xf2d79[_0x5825aa(0x115)](_0x5825aa(0xb1)+LEGACY_PARENT_SEGMENT_DIR+_0x5825aa(0x157))),![];console['error'](a28_0xf2d79[_0x5825aa(0x1a6)]('\x0a⚠️\x20\x20Migrating:\x20'+LEGACY_PARENT_SEGMENT_DIR+_0x5825aa(0x185)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x5825aa(0x10a)](a28_0xf2d79[_0x5825aa(0xff)](_0x5825aa(0xe6)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x2f9634){const _0x1d3b9c=_0x2f9634 instanceof Error?_0x2f9634[_0x5825aa(0x170)]:String(_0x2f9634);return console['error'](a28_0xf2d79[_0x5825aa(0x11d)](_0x5825aa(0x167)+_0x1d3b9c+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async['run'](_0x18671a){return migrateLegacyDirectory(),super['run'](_0x18671a);}}function resolveYamlFile(_0x3e578c){const _0x363c13=a28_0x1408f6;if(_0x3e578c[_0x363c13(0xbb)](_0x363c13(0x1aa))||_0x3e578c[_0x363c13(0xbb)](_0x363c13(0xcb)))return _0x3e578c;return a28_0x45c961[_0x363c13(0x18d)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x3e578c)+_0x363c13(0x1aa));}function formatProgressMessage(_0x573571){const _0x1ad7b8=a28_0x1408f6,_0x25c622=_0x573571[_0x1ad7b8(0xe8)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x25c622){const [,_0x4bc6fe,_0x2a7d12,_0x4b65c0='']=_0x25c622;return a28_0xf2d79[_0x1ad7b8(0x115)](_0x4bc6fe+':')+'\x20'+_0x2a7d12+a28_0xf2d79[_0x1ad7b8(0x115)](_0x4b65c0);}return a28_0xf2d79[_0x1ad7b8(0x115)](_0x573571);}function showFileNotFoundError(_0x3fb837,_0x4ea1e3){const _0x5c4461=a28_0x1408f6;console['error'](a28_0xf2d79[_0x5c4461(0x11d)](_0x5c4461(0x1b7)+_0x3fb837+'\x0a')),console[_0x5c4461(0x10a)](a28_0xf2d79['cyan'](_0x5c4461(0x184)+_0x4ea1e3+_0x5c4461(0x12a)));}function showParentSegmentNotSetError(_0x204b91){const _0x96fec5=a28_0x1408f6;console[_0x96fec5(0x10a)](a28_0xf2d79[_0x96fec5(0x1a6)](_0x96fec5(0xbe))),console[_0x96fec5(0x10a)](_0x204b91);}export class ParentSegmentListCommand extends BaseCommand{[a28_0x1408f6(0x15f)]='segment:parent:list';[a28_0x1408f6(0xb6)]=a28_0x1408f6(0xde);async[a28_0x1408f6(0x1a4)](_0x352bed){const _0x5cff75=a28_0x1408f6,{options:_0x5977d4,args:_0x136d49,tdx:_0x22eec8}=_0x352bed,_0x3455aa=_0x136d49[0x0];_0x5977d4[_0x5cff75(0x1ad)]&&(console['error'](_0x5cff75(0xa5)+_0x5977d4[_0x5cff75(0x113)]),_0x3455aa&&console[_0x5cff75(0x10a)]('Pattern:\x20'+_0x3455aa));const _0x524c49=await withSpinner(_0x3455aa?_0x5cff75(0x192)+_0x3455aa+'\x27...':'Listing\x20parent\x20segments...',()=>_0x22eec8[_0x5cff75(0xc3)]['listParents'](),{'verbose':_0x5977d4[_0x5cff75(0x1ad)]});let _0x56e1af=_0x524c49[_0x5cff75(0x135)];if(_0x3455aa){const _0x1a0434=_0x3455aa[_0x5cff75(0x13b)](/[.+^${}()|[\]\\]/g,_0x5cff75(0xf6))['replace'](/\*/g,'.*')[_0x5cff75(0x13b)](/\?/g,'.'),_0x118595=new RegExp('^'+_0x1a0434+'$','i');_0x56e1af=_0x56e1af[_0x5cff75(0x160)](_0x558c2f=>_0x118595[_0x5cff75(0x137)](_0x558c2f[_0x5cff75(0x189)]['name']));}_0x56e1af[_0x5cff75(0x16b)]((_0x5549be,_0x4517d0)=>_0x5549be[_0x5cff75(0x189)][_0x5cff75(0x15f)]['localeCompare'](_0x4517d0[_0x5cff75(0x189)][_0x5cff75(0x15f)])),console['error'](_0x5cff75(0xed)+_0x56e1af[_0x5cff75(0x1a7)]+_0x5cff75(0xf7)+(_0x56e1af['length']!==0x1?'s':''));if(_0x5977d4[_0x5cff75(0x12b)]==='json'||_0x5977d4[_0x5cff75(0x12b)]==='jsonl')await handleSDKOutput(_0x56e1af,_0x5977d4);else{if(_0x56e1af[_0x5cff75(0x1a7)]===0x0)_0x3455aa?console['log'](_0x5cff75(0x1a0)+_0x3455aa):console['log']('No\x20parent\x20segments\x20found');else for(const _0x3f09ab of _0x56e1af){const _0x31aa5f=_0x3f09ab[_0x5cff75(0x189)][_0x5cff75(0xb2)]?a28_0xf2d79[_0x5cff75(0x115)]('\x20('+formatRows(_0x3f09ab[_0x5cff75(0x189)][_0x5cff75(0xb2)])+')'):'';console[_0x5cff75(0x180)](_0x5cff75(0xe7)+_0x3f09ab['attributes'][_0x5cff75(0x15f)]+_0x31aa5f);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a28_0x1408f6(0x15f)]=a28_0x1408f6(0x14b);['description']=a28_0x1408f6(0xa0);async['execute'](_0x4a9ca2){const _0x4b0e28=a28_0x1408f6,{options:_0x23b571,args:_0x3c7246,tdx:_0xdace11}=_0x4a9ca2;console[_0x4b0e28(0x10a)](_0x4b0e28(0x18f)+'\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a'+_0x4b0e28(0x16f));const _0x4105ae=_0x23b571;if(_0x3c7246[_0x4b0e28(0x1a7)]===0x0)return console[_0x4b0e28(0x10a)](a28_0xf2d79[_0x4b0e28(0x11d)](_0x4b0e28(0x15d))),console[_0x4b0e28(0x10a)](_0x4b0e28(0xa3)),0x1;const _0x489a2c=_0x3c7246[0x0];if(!_0x4105ae[_0x4b0e28(0x168)]||!_0x4105ae['table'])return console['error'](_0x4b0e28(0x130)),console['error'](_0x4b0e28(0xa3)),0x1;_0x4105ae[_0x4b0e28(0x1ad)]&&(console[_0x4b0e28(0x10a)](_0x4b0e28(0xa5)+_0x4105ae[_0x4b0e28(0x113)]),console['error'](_0x4b0e28(0xfc)+_0x489a2c),console[_0x4b0e28(0x10a)](_0x4b0e28(0x11c)+_0x4105ae[_0x4b0e28(0x168)]),console[_0x4b0e28(0x10a)]('Table:\x20'+_0x4105ae[_0x4b0e28(0x10e)]));const _0x1d930f=await loadJSONFromOptions(_0x4105ae[_0x4b0e28(0x189)],_0x4105ae[_0x4b0e28(0x1b6)]),_0x49faac=await loadJSONFromOptions(_0x4105ae['behaviors'],_0x4105ae['behaviorsFile']),_0x5a26e1=await loadJSONFromOptions(_0x4105ae['customerGroup'],_0x4105ae[_0x4b0e28(0x165)]),_0x40ed4f={'name':_0x489a2c,'description':_0x4105ae['description'],'scheduleType':_0x4105ae[_0x4b0e28(0x118)],'scheduleOption':_0x4105ae[_0x4b0e28(0xf3)],'timezone':_0x4105ae[_0x4b0e28(0xf9)],'master':{'parentDatabaseName':_0x4105ae['database'],'parentTableName':_0x4105ae[_0x4b0e28(0x10e)]},'attributes':_0x1d930f,'behaviors':_0x49faac,'customerGroup':_0x5a26e1},_0x1f1704=await withSpinner(_0x4b0e28(0x1b9)+_0x489a2c+'\x27...',()=>_0xdace11['segment'][_0x4b0e28(0x186)](_0x40ed4f),{'verbose':_0x23b571['verbose']}),_0x2ea012=_0x1f1704['data'];return console[_0x4b0e28(0x10a)]('✔\x20Created\x20parent\x20segment\x20\x27'+_0x2ea012[_0x4b0e28(0x15f)]+_0x4b0e28(0x197)+_0x2ea012['id']),await handleSDKOutput([_0x2ea012],_0x23b571),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a28_0x1408f6(0x15f)]='segment:parent:update';['description']='Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]';async['execute'](_0x4c10e7){const _0x26e5bf=a28_0x1408f6,{options:_0x979421,args:_0x5d624e,tdx:_0x3b89cc}=_0x4c10e7;console[_0x26e5bf(0x10a)](_0x26e5bf(0x191)+'\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a'+_0x26e5bf(0x16f));const _0x272f57=_0x979421;if(_0x5d624e[_0x26e5bf(0x1a7)]===0x0)return console[_0x26e5bf(0x10a)](a28_0xf2d79[_0x26e5bf(0x11d)]('Error:\x20Parent\x20segment\x20name\x20is\x20required')),console[_0x26e5bf(0x10a)](_0x26e5bf(0x101)),0x1;const _0x59ce35=_0x5d624e[0x0];_0x272f57[_0x26e5bf(0x1ad)]&&(console[_0x26e5bf(0x10a)](_0x26e5bf(0xa5)+_0x272f57[_0x26e5bf(0x113)]),console[_0x26e5bf(0x10a)](_0x26e5bf(0x13a)+_0x59ce35));const _0x305b46=await withSpinner('Fetching\x20current\x20configuration\x20for\x20\x27'+_0x59ce35+_0x26e5bf(0x111),()=>_0x3b89cc[_0x26e5bf(0xc3)]['getParentFull'](_0x59ce35),{'verbose':_0x272f57[_0x26e5bf(0x1ad)]}),_0x2a394f=_0x305b46['data'],_0x3af899=await loadJSONFromOptions(_0x272f57[_0x26e5bf(0x12f)],_0x272f57['addAttributesFile']),_0x56e929=await loadJSONFromOptions(_0x272f57[_0x26e5bf(0x13f)],_0x272f57[_0x26e5bf(0x112)]),_0x5aba0e={'name':_0x2a394f[_0x26e5bf(0x15f)],'description':_0x272f57[_0x26e5bf(0xb6)]!==undefined?_0x272f57[_0x26e5bf(0xb6)]:_0x2a394f[_0x26e5bf(0xb6)],'scheduleType':_0x272f57[_0x26e5bf(0x118)]!==undefined?_0x272f57[_0x26e5bf(0x118)]:_0x2a394f['scheduleType'],'scheduleOption':_0x272f57[_0x26e5bf(0xf3)]!==undefined?_0x272f57[_0x26e5bf(0xf3)]:_0x2a394f[_0x26e5bf(0xf3)],'timezone':_0x272f57[_0x26e5bf(0xf9)]!==undefined?_0x272f57[_0x26e5bf(0xf9)]:_0x2a394f['timezone'],'master':_0x2a394f[_0x26e5bf(0x1ae)],'attributes':_0x3af899?[..._0x2a394f['attributes']||[],..._0x3af899]:_0x2a394f['attributes'],'behaviors':_0x56e929?[..._0x2a394f[_0x26e5bf(0x106)]||[],..._0x56e929]:_0x2a394f['behaviors'],'customerGroup':_0x2a394f[_0x26e5bf(0xa1)]},_0x51c49b=await withSpinner('Updating\x20parent\x20segment\x20\x27'+_0x59ce35+_0x26e5bf(0x111),()=>_0x3b89cc['segment'][_0x26e5bf(0xc5)](_0x59ce35,_0x5aba0e),{'verbose':_0x272f57[_0x26e5bf(0x1ad)]}),_0x1cd26e=_0x51c49b[_0x26e5bf(0x135)];return console[_0x26e5bf(0x10a)](_0x26e5bf(0xa9)+_0x1cd26e[_0x26e5bf(0x15f)]+'\x27'),await handleSDKOutput([_0x1cd26e],_0x272f57),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a28_0x1408f6(0x15f)]=a28_0x1408f6(0xc0);['description']=a28_0x1408f6(0x149);async[a28_0x1408f6(0x1a4)](_0x335634){const _0x45eae3=a28_0x1408f6,{options:_0x1e77ee,args:_0x404058,tdx:_0xba1252}=_0x335634,_0x724ff9=_0x1e77ee,_0x3f6540=_0x404058[0x0]||_0x1e77ee[_0x45eae3(0x121)];if(!_0x3f6540)return showParentSegmentNotSetError(_0x45eae3(0xb3)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment'),0x1;if(_0x724ff9['use']&&_0x724ff9['output'])return console[_0x45eae3(0x10a)](a28_0xf2d79[_0x45eae3(0x11d)]('Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a')),console[_0x45eae3(0x10a)](a28_0xf2d79[_0x45eae3(0x115)](_0x45eae3(0x1b3))),console['error'](a28_0xf2d79[_0x45eae3(0x115)](_0x45eae3(0xbc)+PARENT_SEGMENT_DIR+_0x45eae3(0xa7))),console[_0x45eae3(0x10a)](a28_0xf2d79['cyan'](_0x45eae3(0xaa))),0x1;const _0x586668=_0x724ff9[_0x45eae3(0x12e)]||a28_0x45c961[_0x45eae3(0x18d)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x3f6540)+_0x45eae3(0x1aa));_0x724ff9[_0x45eae3(0x1ad)]&&(console[_0x45eae3(0x10a)](_0x45eae3(0xa5)+_0x724ff9[_0x45eae3(0x113)]),console[_0x45eae3(0x10a)]('Parent\x20segment:\x20'+_0x3f6540),console[_0x45eae3(0x10a)]('Output\x20file:\x20'+_0x586668));const _0x353160=await withSpinner(_0x45eae3(0x10d)+_0x3f6540+_0x45eae3(0x111),()=>_0xba1252[_0x45eae3(0xc3)]['pullParentYaml'](_0x3f6540),{'verbose':_0x724ff9[_0x45eae3(0x1ad)]}),_0x505ae9=_0x353160[_0x45eae3(0x135)];if(existsSync(_0x586668)){const _0x4dfbd2=readFileSync(_0x586668,_0x45eae3(0x1b8)),_0x3f8973=generateDiff(_0x4dfbd2,_0x505ae9);if(!hasChanges(_0x3f8973))console[_0x45eae3(0x10a)](a28_0xf2d79[_0x45eae3(0xff)]('✔')+_0x45eae3(0xee)+a28_0xf2d79['cyan'](_0x586668)+_0x45eae3(0x1ba));else{console[_0x45eae3(0x10a)](_0x45eae3(0x145)+_0x586668+'\x27:'),console[_0x45eae3(0x10a)]('─'[_0x45eae3(0xef)](0x3c)),console[_0x45eae3(0x10a)](formatDiffWithColors(_0x3f8973)),console[_0x45eae3(0x10a)]('─'[_0x45eae3(0xef)](0x3c));if(!_0x724ff9[_0x45eae3(0x138)]){const _0x13ab87=await confirmKey('Overwrite\x20\x27'+_0x586668+'\x27?');if(!_0x13ab87)return console[_0x45eae3(0x10a)](_0x45eae3(0x9b)),0x1;}writeFileSync(_0x586668,_0x505ae9,_0x45eae3(0x1b8)),console[_0x45eae3(0x10a)](a28_0xf2d79[_0x45eae3(0xff)]('✔')+_0x45eae3(0x1a9)+a28_0xf2d79[_0x45eae3(0x194)](_0x586668));}}else{const _0x393db8=a28_0x45c961[_0x45eae3(0x17c)](_0x586668);!existsSync(_0x393db8)&&mkdirSync(_0x393db8,{'recursive':!![]}),writeFileSync(_0x586668,_0x505ae9,'utf-8'),console[_0x45eae3(0x10a)](a28_0xf2d79['green']('✔')+_0x45eae3(0x1a9)+a28_0xf2d79[_0x45eae3(0x194)](_0x586668));}return saveSessionContext({'parent_segment':_0x3f6540},_0x724ff9[_0x45eae3(0x11a)]),console[_0x45eae3(0x10a)](a28_0xf2d79[_0x45eae3(0xff)]('✔')+_0x45eae3(0x173)+a28_0xf2d79[_0x45eae3(0x115)](_0x45eae3(0x1bb))+_0x45eae3(0xc6)+a28_0xf2d79[_0x45eae3(0x194)](_0x3f6540)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{['name']='segment:parent:push';[a28_0x1408f6(0xb6)]=a28_0x1408f6(0x15a);async[a28_0x1408f6(0x1a4)](_0x187bd4){const _0x5ac9b0=a28_0x1408f6,{options:_0x27173c,args:_0x42ed4d,tdx:_0x144298}=_0x187bd4,_0x16f667=_0x27173c,_0x1cab1d=_0x42ed4d[0x0]||_0x27173c[_0x5ac9b0(0x121)];if(!_0x1cab1d)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a'+_0x5ac9b0(0x9f)),0x1;const _0x55c8ff=resolveYamlFile(_0x1cab1d);if(!existsSync(_0x55c8ff))return showFileNotFoundError(_0x55c8ff,_0x1cab1d),0x1;_0x16f667[_0x5ac9b0(0x1ad)]&&(console['error']('Site:\x20'+_0x16f667[_0x5ac9b0(0x113)]),console[_0x5ac9b0(0x10a)]('YAML\x20file:\x20'+_0x55c8ff));let _0x335035;try{_0x335035=readFileSync(_0x55c8ff,_0x5ac9b0(0x1b8));}catch(_0xd34907){const _0x4ba161=_0xd34907 instanceof Error?_0xd34907[_0x5ac9b0(0x170)]:String(_0xd34907);return console[_0x5ac9b0(0x10a)]('Error\x20reading\x20file:\x20'+_0x4ba161),0x1;}const _0x338944=await withSpinner('Analyzing\x20changes...',()=>_0x144298[_0x5ac9b0(0xc3)][_0x5ac9b0(0x143)](_0x335035),{'verbose':_0x16f667[_0x5ac9b0(0x1ad)]}),_0x44b240=_0x338944['data'],{isNew:_0x33d9a8,name:_0x47fedc,hasChanges:_0xb2dc20,diffFormatted:_0x16d6db}=_0x44b240;if(!_0xb2dc20)return console['error']('✔\x20No\x20changes\x20-\x20\x27'+_0x47fedc+_0x5ac9b0(0x15b)),0x0;_0x33d9a8?console[_0x5ac9b0(0x10a)](_0x5ac9b0(0x17d)+_0x47fedc+'\x27:'):console[_0x5ac9b0(0x10a)](_0x5ac9b0(0x156)+_0x47fedc+'\x27:');console[_0x5ac9b0(0x10a)]('─'[_0x5ac9b0(0xef)](0x3c)),console[_0x5ac9b0(0x10a)](_0x16d6db),console[_0x5ac9b0(0x10a)]('─'[_0x5ac9b0(0xef)](0x3c));const _0x527705=_0x33d9a8?_0x5ac9b0(0x127)+_0x47fedc+'\x27?':_0x5ac9b0(0x1a1)+_0x47fedc+'\x27?';if(!_0x16f667[_0x5ac9b0(0x138)]){const _0x45a818=await confirmKey(_0x527705);if(!_0x45a818)return console[_0x5ac9b0(0x10a)]('Aborted.'),0x1;}const _0x42bc0e=_0x33d9a8?_0x5ac9b0(0x151):_0x5ac9b0(0x179),_0x4d1714=await withSpinner(_0x42bc0e+_0x5ac9b0(0xb9)+_0x47fedc+_0x5ac9b0(0x111),()=>_0x44b240[_0x5ac9b0(0x196)](),{'verbose':_0x16f667[_0x5ac9b0(0x1ad)]}),_0x1b65c0=_0x4d1714[_0x5ac9b0(0x135)],_0x4eef8a=getConsoleNextUrl(_0x16f667[_0x5ac9b0(0x113)],_0x5ac9b0(0x18b)+_0x1b65c0['id']),_0x21634f=_0x33d9a8?_0x5ac9b0(0x129):_0x5ac9b0(0x13c);return console[_0x5ac9b0(0x10a)]('✔\x20'+_0x21634f+'\x20parent\x20segment\x20\x27'+_0x1b65c0[_0x5ac9b0(0x15f)]+'\x27'),console[_0x5ac9b0(0x10a)]('\x20\x20'+_0x4eef8a),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a28_0x1408f6(0x15f)]='segment:parent:validate';[a28_0x1408f6(0xb6)]=a28_0x1408f6(0x18e);async['execute'](_0x3d2f80){const _0x58bbb6=a28_0x1408f6,{options:_0x1c6536,args:_0x15e843,tdx:_0x38cca3}=_0x3d2f80,_0x191c9c=_0x1c6536,_0x9691ca=_0x15e843[0x0]||_0x1c6536['parentSegment'];if(!_0x9691ca)return showParentSegmentNotSetError(_0x58bbb6(0x176)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a'+_0x58bbb6(0xd2)+_0x58bbb6(0x1a8)+_0x58bbb6(0xcf)+_0x58bbb6(0x120)),0x1;const _0x3b810d=resolveYamlFile(_0x9691ca);if(!existsSync(_0x3b810d))return showFileNotFoundError(_0x3b810d,_0x9691ca),0x1;_0x191c9c[_0x58bbb6(0x1ad)]&&(console[_0x58bbb6(0x10a)](_0x58bbb6(0xa5)+_0x191c9c['site']),console[_0x58bbb6(0x10a)]('YAML\x20file:\x20'+_0x3b810d));let _0x2d54c7;try{_0x2d54c7=readFileSync(_0x3b810d,_0x58bbb6(0x1b8));}catch(_0x44cc3f){const _0x3bf2c8=_0x44cc3f instanceof Error?_0x44cc3f['message']:String(_0x44cc3f);return console[_0x58bbb6(0x10a)]('Error\x20reading\x20file:\x20'+_0x3bf2c8),0x1;}const _0x4e6502=createCommandSpinner(a28_0xf2d79['dim'](_0x58bbb6(0xc8)),{'verbose':_0x191c9c[_0x58bbb6(0x1ad)]});_0x4e6502['start']();const _0x3dc620={'onProgress':_0x321ce4=>{const _0x2d5bd6=_0x58bbb6;_0x4e6502[_0x2d5bd6(0xc4)]=formatProgressMessage(_0x321ce4);}};if(_0x191c9c[_0x58bbb6(0x1ae)])_0x3dc620[_0x58bbb6(0x1ae)]=!![];if(_0x191c9c[_0x58bbb6(0xf2)])_0x3dc620['enriched']=!![];_0x191c9c[_0x58bbb6(0xe0)]&&(_0x3dc620[_0x58bbb6(0xe0)]=_0x191c9c['attribute']);_0x191c9c[_0x58bbb6(0xe1)]&&(_0x3dc620['behavior']=_0x191c9c[_0x58bbb6(0xe1)]);if(_0x191c9c[_0x58bbb6(0x1b4)])_0x3dc620[_0x58bbb6(0x1b4)]=_0x191c9c[_0x58bbb6(0x1b4)];let _0x13bd74;try{_0x13bd74=await _0x38cca3[_0x58bbb6(0xc3)]['validateParentYaml'](_0x2d54c7,_0x3dc620),_0x4e6502['stop']();}catch(_0x497d77){_0x4e6502['stop']();throw _0x497d77;}const _0x498555=_0x191c9c[_0x58bbb6(0x1b4)]||_0x58bbb6(0x178);return this[_0x58bbb6(0x19e)](_0x13bd74,_0x3dc620,_0x3b810d,_0x498555),_0x13bd74[_0x58bbb6(0xb5)]?0x0:0x1;}['displayValidateResults'](_0x3b93ee,_0x1600b8,_0x39878b,_0x1884f1){const _0x3a7cc8=a28_0x1408f6;console[_0x3a7cc8(0x10a)]('\x0a'+a28_0xf2d79[_0x3a7cc8(0x1b1)](_0x3a7cc8(0x199))+'\x20'+_0x3b93ee[_0x3a7cc8(0x15f)]),console[_0x3a7cc8(0x10a)]('═'[_0x3a7cc8(0xef)](0x3c)),this[_0x3a7cc8(0xda)](_0x3b93ee);if(typeof _0x1600b8[_0x3a7cc8(0xe0)]===_0x3a7cc8(0xf5)){this['displayAttributesStats'](_0x3b93ee),this[_0x3a7cc8(0x175)](_0x3b93ee),this[_0x3a7cc8(0x98)](_0x39878b,_0x1884f1,_0x3a7cc8(0xe0),_0x1600b8[_0x3a7cc8(0xe0)]);return;}if(_0x1600b8[_0x3a7cc8(0xe0)]===!![]){this[_0x3a7cc8(0x1ab)](_0x3b93ee),this['displaySummary'](_0x3b93ee),this['displayPreviewHints'](_0x39878b,_0x1884f1,_0x3a7cc8(0x189));return;}if(typeof _0x1600b8['behavior']===_0x3a7cc8(0xf5)){this[_0x3a7cc8(0xec)](_0x3b93ee,_0x1884f1),this[_0x3a7cc8(0x175)](_0x3b93ee),this[_0x3a7cc8(0x98)](_0x39878b,_0x1884f1,_0x3a7cc8(0xe1),_0x1600b8[_0x3a7cc8(0xe1)]);return;}if(_0x1600b8[_0x3a7cc8(0xe1)]===!![]){this[_0x3a7cc8(0xec)](_0x3b93ee,_0x1884f1),this[_0x3a7cc8(0x175)](_0x3b93ee),this[_0x3a7cc8(0x98)](_0x39878b,_0x1884f1,_0x3a7cc8(0x106));return;}this[_0x3a7cc8(0x1ab)](_0x3b93ee),this[_0x3a7cc8(0xec)](_0x3b93ee,_0x1884f1),this[_0x3a7cc8(0x175)](_0x3b93ee),this[_0x3a7cc8(0x98)](_0x39878b,_0x1884f1,'all');}[a28_0x1408f6(0x98)](_0x2cf747,_0x97b87d,_0x5bd046,_0x12602b){const _0x4c3a9a=a28_0x1408f6;console[_0x4c3a9a(0x10a)]('\x0a'+a28_0xf2d79[_0x4c3a9a(0x115)](_0x4c3a9a(0x10f)));const _0x3e7cab=_0x97b87d!==_0x4c3a9a(0x178)?_0x4c3a9a(0x14c)+_0x97b87d:'';if(_0x5bd046===_0x4c3a9a(0xe0)&&_0x12602b)console[_0x4c3a9a(0x10a)]('\x20\x20'+a28_0xf2d79[_0x4c3a9a(0x115)]('tdx\x20segment\x20parent\x20preview\x20'+_0x2cf747+'\x20--attribute\x20\x22'+_0x12602b+'\x22'+_0x3e7cab));else{if(_0x5bd046===_0x4c3a9a(0xe1)&&_0x12602b)console[_0x4c3a9a(0x10a)]('\x20\x20'+a28_0xf2d79[_0x4c3a9a(0x115)](_0x4c3a9a(0xac)+_0x2cf747+_0x4c3a9a(0x198)+_0x12602b+'\x22'+_0x3e7cab));else(_0x5bd046===_0x4c3a9a(0x189)||_0x5bd046==='all')&&console[_0x4c3a9a(0x10a)]('\x20\x20'+a28_0xf2d79[_0x4c3a9a(0x115)](_0x4c3a9a(0xac)+_0x2cf747+_0x4c3a9a(0x158)+_0x3e7cab));}(_0x5bd046===_0x4c3a9a(0x106)||_0x5bd046===_0x4c3a9a(0xa4))&&console[_0x4c3a9a(0x10a)]('\x20\x20'+a28_0xf2d79[_0x4c3a9a(0x115)]('tdx\x20segment\x20parent\x20preview\x20'+_0x2cf747+_0x4c3a9a(0x159)+_0x3e7cab)),_0x5bd046===_0x4c3a9a(0xa4)&&console[_0x4c3a9a(0x10a)]('\x20\x20'+a28_0xf2d79['dim'](_0x4c3a9a(0xac)+_0x2cf747+'\x20--enriched'+_0x3e7cab));}[a28_0x1408f6(0xda)](_0xc361c1){const _0x5e2481=a28_0x1408f6,{master:_0x34d47d}=_0xc361c1,_0x3ea46b=_0x34d47d['schemaValid']?a28_0xf2d79[_0x5e2481(0xff)]('✔'):a28_0xf2d79[_0x5e2481(0x11d)]('✘');console[_0x5e2481(0x10a)]('\x0a'+a28_0xf2d79[_0x5e2481(0x115)](_0x5e2481(0x100))),console[_0x5e2481(0x10a)](_0x3ea46b+'\x20'+a28_0xf2d79['bold'](_0x34d47d[_0x5e2481(0x168)]+'.'+_0x34d47d[_0x5e2481(0x10e)])),_0x34d47d[_0x5e2481(0xd3)]?_0x34d47d[_0x5e2481(0xd0)]!==undefined&&console[_0x5e2481(0x10a)]('\x20\x20'+a28_0xf2d79[_0x5e2481(0x115)](_0x5e2481(0x16a))+'\x20'+a28_0xf2d79[_0x5e2481(0x194)](formatRows(_0x34d47d[_0x5e2481(0xd0)]))):console[_0x5e2481(0x10a)]('\x20\x20'+a28_0xf2d79[_0x5e2481(0x11d)](_0x5e2481(0xa6))+'\x20'+_0x34d47d[_0x5e2481(0x1b2)]);}['displayAttributesStats'](_0x20827d){const _0x1f0195=a28_0x1408f6;if(_0x20827d['attributes']['length']===0x0)return;console['error']('\x0a'+a28_0xf2d79[_0x1f0195(0x115)]('Attributes'));for(const _0x1b7f88 of _0x20827d[_0x1f0195(0x189)]){const _0x268956=_0x1b7f88[_0x1f0195(0xd3)]?a28_0xf2d79[_0x1f0195(0xff)]('✔'):a28_0xf2d79[_0x1f0195(0x11d)]('✘');let _0x4580cc='';if(_0x1b7f88[_0x1f0195(0xd3)]&&_0x1b7f88['matchedCount']!==undefined&&_0x1b7f88[_0x1f0195(0x177)]!==undefined){const _0x330e37=_0x1b7f88[_0x1f0195(0x177)][_0x1f0195(0x126)](0x1),_0xddbd3c=_0x1b7f88['coveragePercent']>=0x50?a28_0xf2d79[_0x1f0195(0xff)]:_0x1b7f88[_0x1f0195(0x177)]>=0x32?a28_0xf2d79[_0x1f0195(0x1a6)]:a28_0xf2d79[_0x1f0195(0x11d)];_0x4580cc='\x20'+a28_0xf2d79[_0x1f0195(0x115)]('Coverage:')+'\x20'+_0xddbd3c(_0x330e37+'%')+'\x20('+formatRows(_0x1b7f88[_0x1f0195(0x146)])+_0x1f0195(0xc7);}console[_0x1f0195(0x10a)](_0x268956+'\x20'+a28_0xf2d79['bold'](_0x1b7f88[_0x1f0195(0x15f)])+_0x4580cc),console[_0x1f0195(0x10a)]('\x20\x20'+a28_0xf2d79[_0x1f0195(0x115)](_0x1f0195(0x190))+'\x20'+a28_0xf2d79['bold'](_0x1b7f88[_0x1f0195(0x168)]+'.'+_0x1b7f88[_0x1f0195(0x10e)]));const _0x4bba39=_0x1b7f88[_0x1f0195(0xd1)]===_0x1b7f88['foreignKey']?a28_0xf2d79[_0x1f0195(0x115)](_0x1f0195(0xeb))+'\x20'+_0x1b7f88[_0x1f0195(0xd1)]:a28_0xf2d79[_0x1f0195(0x115)](_0x1f0195(0x188))+'\x20'+_0x1b7f88['joinKey']+_0x1f0195(0xc6)+_0x1b7f88[_0x1f0195(0x107)];console[_0x1f0195(0x10a)]('\x20\x20'+_0x4bba39),console[_0x1f0195(0x10a)]('\x20\x20'+a28_0xf2d79[_0x1f0195(0x115)](_0x1f0195(0xa2))),this[_0x1f0195(0xfb)](_0x1b7f88['columns']),!_0x1b7f88[_0x1f0195(0xd3)]&&console[_0x1f0195(0x10a)]('\x20\x20'+a28_0xf2d79[_0x1f0195(0x11d)](_0x1f0195(0xa6))+'\x20'+_0x1b7f88['schemaError']);}}[a28_0x1408f6(0xec)](_0x36cbd7,_0x498754){const _0x1c1e26=a28_0x1408f6;if(_0x36cbd7[_0x1c1e26(0x106)][_0x1c1e26(0x1a7)]===0x0)return;console[_0x1c1e26(0x10a)]('\x0a'+a28_0xf2d79[_0x1c1e26(0x115)](_0x1c1e26(0x19b))+'\x20'+a28_0xf2d79[_0x1c1e26(0x115)]('('+_0x498754+')'));for(const _0x407f22 of _0x36cbd7[_0x1c1e26(0x106)]){const _0x4bf3b4=_0x407f22[_0x1c1e26(0xd3)]?a28_0xf2d79[_0x1c1e26(0xff)]('✔'):a28_0xf2d79['red']('✘');let _0x149395='';if(_0x407f22['schemaValid']&&_0x407f22['customersWithEvents']!==undefined&&_0x407f22[_0x1c1e26(0xb8)]!==undefined){const _0x18156f=_0x407f22[_0x1c1e26(0xae)]?.[_0x1c1e26(0x126)](0x1)||'?',_0x5284a8=(_0x407f22[_0x1c1e26(0xae)]??0x0)>=0x32?a28_0xf2d79[_0x1c1e26(0xff)]:(_0x407f22[_0x1c1e26(0xae)]??0x0)>=0x14?a28_0xf2d79[_0x1c1e26(0x1a6)]:a28_0xf2d79[_0x1c1e26(0x11d)];_0x149395='\x20'+a28_0xf2d79[_0x1c1e26(0x115)](_0x1c1e26(0xfe))+'\x20'+_0x5284a8(formatRows(_0x407f22['customersWithEvents']))+'\x20('+_0x18156f+'%)\x20'+a28_0xf2d79['dim'](_0x1c1e26(0xc2))+'\x20'+a28_0xf2d79['cyan'](formatRows(_0x407f22[_0x1c1e26(0xb8)]));}console['error'](_0x4bf3b4+'\x20'+a28_0xf2d79[_0x1c1e26(0x1b1)](_0x407f22[_0x1c1e26(0x15f)])+_0x149395),console[_0x1c1e26(0x10a)]('\x20\x20'+a28_0xf2d79[_0x1c1e26(0x115)](_0x1c1e26(0x190))+'\x20'+a28_0xf2d79[_0x1c1e26(0x1b1)](_0x407f22[_0x1c1e26(0x168)]+'.'+_0x407f22[_0x1c1e26(0x10e)]));const _0x5056fa=_0x407f22['joinKey']===_0x407f22[_0x1c1e26(0x107)]?a28_0xf2d79[_0x1c1e26(0x115)](_0x1c1e26(0xeb))+'\x20'+_0x407f22[_0x1c1e26(0xd1)]:a28_0xf2d79['dim'](_0x1c1e26(0x188))+'\x20'+_0x407f22['joinKey']+'\x20=\x20'+_0x407f22[_0x1c1e26(0x107)];console['error']('\x20\x20'+_0x5056fa),console['error']('\x20\x20'+a28_0xf2d79[_0x1c1e26(0x115)](_0x1c1e26(0xa2))),this[_0x1c1e26(0xfb)](_0x407f22[_0x1c1e26(0x128)]),!_0x407f22[_0x1c1e26(0xd3)]&&console[_0x1c1e26(0x10a)]('\x20\x20'+a28_0xf2d79[_0x1c1e26(0x11d)](_0x1c1e26(0xa6))+'\x20'+_0x407f22[_0x1c1e26(0x1b2)]);}}[a28_0x1408f6(0xfb)](_0xc7966c){const _0x111aef=a28_0x1408f6;for(const _0x43e9dd of _0xc7966c){_0x43e9dd[_0x111aef(0x9c)]===_0x43e9dd[_0x111aef(0x13e)]||_0x43e9dd['column']==='*'?console[_0x111aef(0x10a)](_0x111aef(0xbf)+_0x43e9dd[_0x111aef(0x9c)]):console[_0x111aef(0x10a)](_0x111aef(0xbf)+_0x43e9dd[_0x111aef(0x9c)]+'\x20'+a28_0xf2d79[_0x111aef(0x115)]('('+_0x43e9dd[_0x111aef(0x13e)]+')'));}}['displaySummary'](_0x2f2c38){const _0x4419df=a28_0x1408f6;console[_0x4419df(0x10a)]('─'['repeat'](0x3c));if(_0x2f2c38[_0x4419df(0xd7)][_0x4419df(0x1a7)]>0x0){console[_0x4419df(0x10a)]('\x0a'+a28_0xf2d79[_0x4419df(0x11d)]('Errors:'));for(const _0x407a6d of _0x2f2c38[_0x4419df(0xd7)]){console[_0x4419df(0x10a)]('\x20\x20'+a28_0xf2d79[_0x4419df(0x11d)]('•')+'\x20'+_0x407a6d);}}_0x2f2c38[_0x4419df(0xb5)]&&console[_0x4419df(0x10a)]('\x0a'+a28_0xf2d79[_0x4419df(0xff)]('✔')+_0x4419df(0x9d));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{['name']=a28_0x1408f6(0xe3);[a28_0x1408f6(0xb6)]=a28_0x1408f6(0xb4);async[a28_0x1408f6(0x1a4)](_0x1c8cf6){const _0x1eba8f=a28_0x1408f6,{options:_0xa7f3b7,args:_0x71d67a,tdx:_0x52d5af}=_0x1c8cf6,_0x4c5627=_0xa7f3b7,_0x1e09d7=_0x71d67a[0x0]||_0xa7f3b7[_0x1eba8f(0x121)];if(!_0x1e09d7)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'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a'+'Options\x20(one\x20required):\x0a'+_0x1eba8f(0x144)+'\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a'+_0x1eba8f(0xe9)+_0x1eba8f(0x17f)+'\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)'),0x1;if(!_0x4c5627[_0x1eba8f(0x1ae)]&&!_0x4c5627[_0x1eba8f(0xe0)]&&!_0x4c5627['behavior']&&!_0x4c5627[_0x1eba8f(0xf2)])return console[_0x1eba8f(0x10a)](a28_0xf2d79[_0x1eba8f(0x11d)](_0x1eba8f(0x166))),console[_0x1eba8f(0x10a)]('Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a'),console['error']('Options:'),console['error'](_0x1eba8f(0xd8)),console['error'](_0x1eba8f(0x14d)),console[_0x1eba8f(0x10a)]('\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior'),console[_0x1eba8f(0x10a)](_0x1eba8f(0x17b)),0x1;const _0x2c8dea=resolveYamlFile(_0x1e09d7);if(!existsSync(_0x2c8dea))return showFileNotFoundError(_0x2c8dea,_0x1e09d7),0x1;_0x4c5627[_0x1eba8f(0x1ad)]&&(console[_0x1eba8f(0x10a)](_0x1eba8f(0xa5)+_0x4c5627[_0x1eba8f(0x113)]),console['error'](_0x1eba8f(0x96)+_0x2c8dea));let _0x3301d4;try{_0x3301d4=readFileSync(_0x2c8dea,'utf-8');}catch(_0x423e65){const _0xd0170a=_0x423e65 instanceof Error?_0x423e65[_0x1eba8f(0x170)]:String(_0x423e65);return console[_0x1eba8f(0x10a)](_0x1eba8f(0xca)+_0xd0170a),0x1;}let _0x39bf0c;try{_0x39bf0c=parseYamlString(_0x3301d4);}catch(_0x36ab12){const _0x4e5810=_0x36ab12 instanceof Error?_0x36ab12[_0x1eba8f(0x170)]:String(_0x36ab12);return console['error'](a28_0xf2d79[_0x1eba8f(0x11d)](_0x1eba8f(0x16e)+_0x4e5810)),0x1;}if(_0x4c5627[_0x1eba8f(0xe0)]===!![]||_0x4c5627['attribute']===''){const _0x19a8cd=_0x39bf0c[_0x1eba8f(0x189)]?.[_0x1eba8f(0x154)](_0x3abfc3=>_0x3abfc3['name'])||[];if(_0x19a8cd[_0x1eba8f(0x1a7)]===0x0)console[_0x1eba8f(0x10a)](a28_0xf2d79[_0x1eba8f(0x11d)](_0x1eba8f(0x15c)));else{console[_0x1eba8f(0x10a)](a28_0xf2d79['red'](_0x1eba8f(0x1ac))),console[_0x1eba8f(0x10a)](_0x1eba8f(0x123));for(const _0x446935 of _0x19a8cd){console[_0x1eba8f(0x10a)]('\x20\x20'+a28_0xf2d79['cyan'](_0x446935));}console[_0x1eba8f(0x10a)](_0x1eba8f(0x11b)+_0x1e09d7+_0x1eba8f(0x1a2)+_0x19a8cd[0x0]+'\x22');}return 0x1;}if(_0x4c5627[_0x1eba8f(0xe1)]===!![]||_0x4c5627[_0x1eba8f(0xe1)]===''){const _0x4d1221=_0x39bf0c['behaviors']?.[_0x1eba8f(0x154)](_0x598820=>_0x598820[_0x1eba8f(0x15f)])||[];if(_0x4d1221[_0x1eba8f(0x1a7)]===0x0)console[_0x1eba8f(0x10a)](a28_0xf2d79[_0x1eba8f(0x11d)](_0x1eba8f(0xe2)));else{console['error'](a28_0xf2d79['red'](_0x1eba8f(0x1b5))),console[_0x1eba8f(0x10a)](_0x1eba8f(0x181));for(const _0x42e2fc of _0x4d1221){console[_0x1eba8f(0x10a)]('\x20\x20'+a28_0xf2d79['cyan'](_0x42e2fc));}console[_0x1eba8f(0x10a)](_0x1eba8f(0x11b)+_0x1e09d7+_0x1eba8f(0x198)+_0x4d1221[0x0]+'\x22');}return 0x1;}const _0x33ae09=createCommandSpinner(a28_0xf2d79[_0x1eba8f(0x115)](_0x1eba8f(0x11f)),{'verbose':_0x4c5627['verbose']});_0x33ae09[_0x1eba8f(0xdd)]();const _0x2909c4={'onProgress':_0x2471b1=>{const _0x89028f=_0x1eba8f;_0x33ae09[_0x89028f(0xc4)]=formatProgressMessage(_0x2471b1);}};if(_0x4c5627[_0x1eba8f(0x1ae)])_0x2909c4['master']=!![];if(_0x4c5627[_0x1eba8f(0xe0)]&&typeof _0x4c5627[_0x1eba8f(0xe0)]===_0x1eba8f(0xf5))_0x2909c4[_0x1eba8f(0xe0)]=_0x4c5627['attribute'];if(_0x4c5627[_0x1eba8f(0xe1)]&&typeof _0x4c5627[_0x1eba8f(0xe1)]===_0x1eba8f(0xf5))_0x2909c4[_0x1eba8f(0xe1)]=_0x4c5627['behavior'];if(_0x4c5627[_0x1eba8f(0xf2)])_0x2909c4[_0x1eba8f(0xf2)]=!![];if(_0x4c5627[_0x1eba8f(0x1b4)])_0x2909c4[_0x1eba8f(0x1b4)]=_0x4c5627[_0x1eba8f(0x1b4)];let _0x19d651;try{_0x19d651=await _0x52d5af[_0x1eba8f(0xc3)][_0x1eba8f(0x17e)](_0x3301d4,_0x2909c4),_0x33ae09['stop']();}catch(_0x232d2e){_0x33ae09[_0x1eba8f(0x152)]();throw _0x232d2e;}return await this[_0x1eba8f(0x117)](_0x19d651,{'master':_0x4c5627[_0x1eba8f(0x1ae)],'attribute':typeof _0x4c5627[_0x1eba8f(0xe0)]==='string'?_0x4c5627[_0x1eba8f(0xe0)]:undefined,'behavior':typeof _0x4c5627['behavior']==='string'?_0x4c5627[_0x1eba8f(0xe1)]:undefined,'enriched':_0x4c5627[_0x1eba8f(0xf2)]}),_0x19d651['allValid']?0x0:0x1;}async[a28_0x1408f6(0x117)](_0x42d7c1,_0x338296){const _0x213893=a28_0x1408f6;console[_0x213893(0x10a)]('\x0a'+a28_0xf2d79['bold'](_0x213893(0x125))+'\x20'+_0x42d7c1['name']),console['error']('═'[_0x213893(0xef)](0x3c));if(_0x338296[_0x213893(0x1ae)]&&_0x42d7c1[_0x213893(0xf1)]){const _0x123f40=a28_0xf2d79['dim']('Master:')+'\x20'+a28_0xf2d79[_0x213893(0x1b1)](_0x42d7c1['master'][_0x213893(0x168)]+'.'+_0x42d7c1[_0x213893(0x1ae)]['table']);await this[_0x213893(0xab)](_0x123f40,_0x42d7c1[_0x213893(0xf1)]);}else{if(_0x338296['attribute']&&_0x42d7c1['sampleData']){const _0x10835a=a28_0xf2d79[_0x213893(0x115)]('Attribute:')+'\x20'+a28_0xf2d79['bold'](_0x338296['attribute']);await this[_0x213893(0xab)](_0x10835a,_0x42d7c1[_0x213893(0xf1)]);}else{if(_0x338296[_0x213893(0xe1)]&&_0x42d7c1[_0x213893(0xf1)]){const _0x38e546=a28_0xf2d79[_0x213893(0x115)]('Behavior:')+'\x20'+a28_0xf2d79[_0x213893(0x1b1)](_0x338296[_0x213893(0xe1)]);await this[_0x213893(0xab)](_0x38e546,_0x42d7c1[_0x213893(0xf1)]);}else{if(_0x338296['enriched']&&_0x42d7c1[_0x213893(0xf1)]){const _0x13a66b=a28_0xf2d79[_0x213893(0x115)](_0x213893(0xea))+'\x20'+a28_0xf2d79[_0x213893(0x1b1)](_0x213893(0x102));await this[_0x213893(0xab)](_0x13a66b,_0x42d7c1[_0x213893(0xf1)]);}else!_0x42d7c1[_0x213893(0xf1)]&&console[_0x213893(0x10a)](_0x213893(0x1a3));}}}if(_0x42d7c1['errors'][_0x213893(0x1a7)]>0x0){console[_0x213893(0x10a)]('─'[_0x213893(0xef)](0x3c)),console['error']('\x0a'+a28_0xf2d79['red']('Errors:'));for(const _0x4da168 of _0x42d7c1['errors']){console['error']('\x20\x20'+a28_0xf2d79[_0x213893(0x11d)]('•')+'\x20'+_0x4da168);}}}async[a28_0x1408f6(0xab)](_0x533965,_0x2fd798){const _0x306aad=a28_0x1408f6;if(_0x2fd798['length']===0x0){console[_0x306aad(0x10a)]('\x0a'+_0x533965),console[_0x306aad(0x10a)](_0x306aad(0x116));return;}console[_0x306aad(0x10a)]('\x0a'+_0x533965);const _0xc74697=Object[_0x306aad(0x18c)](_0x2fd798[0x0])[_0x306aad(0x154)](_0x2df637=>({'name':_0x2df637,'type':typeof _0x2fd798[0x0][_0x2df637]===_0x306aad(0x105)?_0x306aad(0xb7):_0x306aad(0x163)})),_0x3cdf98={'queryId':_0x306aad(0x99),'columns':_0xc74697,'data':_0x2fd798,'stats':{'state':_0x306aad(0x16c),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x2fd798[_0x306aad(0x1a7)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x115331=formatAsTable(_0x3cdf98,_0x2fd798[_0x306aad(0x1a7)],!![]);await writeOutput(_0x115331,undefined,'table');}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a28_0x1408f6(0x15f)]=a28_0x1408f6(0x136);[a28_0x1408f6(0xb6)]=a28_0x1408f6(0x155);async[a28_0x1408f6(0x1a4)](_0x51cc4b){const _0x281e59=a28_0x1408f6,{options:_0x180483,args:_0x10f547,tdx:_0x1afb35}=_0x51cc4b,_0x17e3be=_0x180483,_0x58bcb1=_0x10f547[0x0]||_0x180483[_0x281e59(0x121)];if(!_0x58bcb1)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 _0x5653fd=resolveYamlFile(_0x58bcb1);if(existsSync(_0x5653fd)){_0x17e3be[_0x281e59(0x1ad)]&&console[_0x281e59(0x10a)](_0x281e59(0xdb)+_0x5653fd);let _0x5b54fb;try{_0x5b54fb=readFileSync(_0x5653fd,'utf-8');}catch(_0x1a9121){const _0x5dacf9=_0x1a9121 instanceof Error?_0x1a9121[_0x281e59(0x170)]:String(_0x1a9121);return console[_0x281e59(0x10a)](_0x281e59(0xca)+_0x5dacf9),0x1;}const _0x22edd4=await withSpinner('Analyzing\x20changes...',()=>_0x1afb35[_0x281e59(0xc3)][_0x281e59(0x143)](_0x5b54fb),{'verbose':_0x17e3be[_0x281e59(0x1ad)]}),_0x195018=_0x22edd4[_0x281e59(0x135)],{isNew:_0x37cee6,name:_0x40590c,hasChanges:_0x5b2f9a,diffFormatted:_0x5774af}=_0x195018;if(_0x5b2f9a){_0x37cee6?console['error'](_0x281e59(0x17d)+_0x40590c+'\x27:'):console[_0x281e59(0x10a)](_0x281e59(0x156)+_0x40590c+'\x27:');console[_0x281e59(0x10a)]('─'['repeat'](0x3c)),console['error'](_0x5774af),console['error']('─'[_0x281e59(0xef)](0x3c));const _0x1e9b55=_0x37cee6?_0x281e59(0x127)+_0x40590c+_0x281e59(0x124):_0x281e59(0x1a1)+_0x40590c+_0x281e59(0x124);if(!_0x17e3be[_0x281e59(0x138)]){const _0x91d026=await confirmKey(_0x1e9b55);if(!_0x91d026)return console[_0x281e59(0x10a)](_0x281e59(0x9b)),0x1;}const _0x3836ab=_0x37cee6?_0x281e59(0x151):_0x281e59(0x179);await withSpinner(_0x3836ab+_0x281e59(0xb9)+_0x40590c+_0x281e59(0x111),()=>_0x195018['apply'](),{'verbose':_0x17e3be['verbose']});const _0xeb1c8c=_0x37cee6?_0x281e59(0x129):_0x281e59(0x13c);console[_0x281e59(0x10a)]('✔\x20'+_0xeb1c8c+'\x20parent\x20segment\x20\x27'+_0x40590c+'\x27');}else console['error'](_0x281e59(0xdf)+_0x40590c+_0x281e59(0x12c));}const _0x48a44f=await withSpinner(_0x281e59(0x131)+_0x58bcb1+'\x27...',()=>_0x1afb35[_0x281e59(0xc3)][_0x281e59(0x150)](_0x58bcb1),{'verbose':_0x17e3be[_0x281e59(0x1ad)]}),_0x58c7f2=_0x48a44f[_0x281e59(0x135)],_0x5ddca3=getConsoleUrl(_0x17e3be['site'],_0x281e59(0x104)+_0x58c7f2[_0x281e59(0xfd)]+_0x281e59(0x15e)+_0x58c7f2[_0x281e59(0xc1)]+_0x281e59(0x171)+_0x58c7f2[_0x281e59(0x147)]);return console[_0x281e59(0x10a)]('\x0a✔\x20Workflow\x20started'),console[_0x281e59(0x10a)]('\x20\x20'+a28_0xf2d79[_0x281e59(0x115)](_0x281e59(0xad))+'\x20'+_0x58c7f2[_0x281e59(0x1b0)]),console['error']('\x20\x20'+a28_0xf2d79[_0x281e59(0x115)](_0x281e59(0x133))+'\x20'+_0x58c7f2[_0x281e59(0xba)]),console[_0x281e59(0x10a)]('\x20\x20'+a28_0xf2d79[_0x281e59(0x115)](_0x281e59(0x10b))+'\x20'+_0x58c7f2['workflowSessionId']),console[_0x281e59(0x10a)]('\x20\x20'+a28_0xf2d79[_0x281e59(0x115)](_0x281e59(0x140))+'\x20'+_0x58c7f2[_0x281e59(0x147)]),console[_0x281e59(0x10a)]('\x20\x20'+_0x5ddca3),console['error']('\x0a'+a28_0xf2d79[_0x281e59(0x115)](_0x281e59(0x109))+_0x281e59(0x19a)+_0x58c7f2[_0x281e59(0x147)]+_0x281e59(0x164)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{['name']=a28_0x1408f6(0x97);[a28_0x1408f6(0xb6)]=a28_0x1408f6(0x134);async[a28_0x1408f6(0x1a4)](_0x255d80){const _0x116678=a28_0x1408f6,{options:_0x576dfb,args:_0x5946d5,tdx:_0x595fad}=_0x255d80,_0x240a36=_0x5946d5[0x0]||_0x576dfb[_0x116678(0x121)];if(!_0x240a36)return showParentSegmentNotSetError(_0x116678(0x11e)+_0x116678(0xb0)),0x1;_0x576dfb[_0x116678(0x1ad)]&&(console[_0x116678(0x10a)]('Site:\x20'+_0x576dfb[_0x116678(0x113)]),console['error']('Parent\x20segment:\x20'+_0x240a36));const _0x2408c3=await withSpinner(_0x116678(0x174)+_0x240a36+_0x116678(0x111),()=>_0x595fad[_0x116678(0xc3)]['listFields'](_0x240a36),{'verbose':_0x576dfb['verbose']}),_0x748429=_0x2408c3['data'];console[_0x116678(0x10a)](_0x116678(0xed)+_0x748429[_0x116678(0x1a7)]+_0x116678(0x18a)+(_0x748429[_0x116678(0x1a7)]!==0x1?'s':''));if(_0x576dfb['json']||_0x576dfb[_0x116678(0x148)])return await handleSDKOutput(_0x748429,_0x576dfb),0x0;return displayFieldsHumanReadable(_0x748429,_0x240a36),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a28_0x1408f6(0x15f)]=a28_0x1408f6(0xf4);['description']=a28_0x1408f6(0x114);async[a28_0x1408f6(0x1a4)](_0x2ea849){const _0x812197=a28_0x1408f6,{options:_0x1f5cde,args:_0x511f47,tdx:_0xd9804}=_0x2ea849,_0x5710d6=_0x1f5cde,_0x580705=_0x511f47[0x0]||_0x1f5cde[_0x812197(0x121)];if(!_0x580705)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'+_0x812197(0x193)+'Options:\x0a'+_0x812197(0x108)),0x1;_0x1f5cde[_0x812197(0x1ad)]&&(console[_0x812197(0x10a)](_0x812197(0xa5)+_0x1f5cde[_0x812197(0x113)]),console['error'](_0x812197(0x13a)+_0x580705));const _0x5d1947=await withSpinner('Fetching\x20parent\x20segment\x20\x27'+_0x580705+_0x812197(0x111),()=>_0xd9804[_0x812197(0xc3)][_0x812197(0x187)](_0x580705),{'verbose':_0x1f5cde['verbose']}),_0x442d97=_0x5d1947['data'];if(_0x5710d6[_0x812197(0xcc)]){const _0x3b40f4=getConsoleNextUrl(_0x5710d6[_0x812197(0x113)],_0x812197(0x18b)+_0x442d97['id']);return console[_0x812197(0x10a)](a28_0xf2d79['green']('✔')+_0x812197(0x13d)+a28_0xf2d79[_0x812197(0x194)](_0x3b40f4)),openBrowser(_0x3b40f4),0x0;}return await handleSingleObjectOutput(_0x442d97,_0x1f5cde),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a28_0x1408f6(0x15f)]=a28_0x1408f6(0x1a5);['description']=a28_0x1408f6(0x162);async[a28_0x1408f6(0x1a4)](_0x248858){const _0x23573c=a28_0x1408f6,{options:_0x40ff6b,args:_0x523b9a,tdx:_0x33c63b}=_0x248858,_0x343488=_0x523b9a[0x0]||_0x40ff6b[_0x23573c(0x121)];if(!_0x343488)return showParentSegmentNotSetError(_0x23573c(0x132)+_0x23573c(0x19d)),0x1;_0x40ff6b['verbose']&&(console['error'](_0x23573c(0xa5)+_0x40ff6b[_0x23573c(0x113)]),console[_0x23573c(0x10a)](_0x23573c(0x13a)+_0x343488));const _0x288078=await withSpinner(_0x23573c(0x1af)+_0x343488+_0x23573c(0x111),()=>_0x33c63b['segment']['resolveParentId'](_0x343488),{'verbose':_0x40ff6b[_0x23573c(0x1ad)]}),_0x451941=_0x288078[_0x23573c(0x135)],_0x432c17=await withSpinner(_0x23573c(0x169)+_0x343488+_0x23573c(0x111),()=>_0x33c63b[_0x23573c(0xc3)]['getParentSQL'](_0x451941),{'verbose':_0x40ff6b[_0x23573c(0x1ad)]}),_0x40ee7c=await executeSchemaQuery(_0x432c17[_0x23573c(0x135)],_0x33c63b,_0x40ff6b);return await handleQueryOutput(_0x40ee7c,_0x40ff6b),0x0;}}function a28_0x29f8(_0xb6e945,_0xa88528){_0xb6e945=_0xb6e945-0x96;const _0xe9560e=a28_0xe956();let _0x29f830=_0xe9560e[_0xb6e945];return _0x29f830;}export class ParentSegmentSQLCommand extends BaseCommand{[a28_0x1408f6(0x15f)]=a28_0x1408f6(0x172);['description']=a28_0x1408f6(0x103);async[a28_0x1408f6(0x1a4)](_0x1a9cc1){const _0x307413=a28_0x1408f6,{options:_0x205358,args:_0x1df992,tdx:_0x284762}=_0x1a9cc1,_0x4d1b21=_0x1df992[0x0]||_0x205358[_0x307413(0x121)];if(!_0x4d1b21)return showParentSegmentNotSetError(_0x307413(0xa8)+_0x307413(0x153)),0x1;_0x205358[_0x307413(0x1ad)]&&(console['error'](_0x307413(0xa5)+_0x205358['site']),console[_0x307413(0x10a)](_0x307413(0x13a)+_0x4d1b21));const _0xbb5b3c=await withSpinner(_0x307413(0x1af)+_0x4d1b21+_0x307413(0x111),()=>_0x284762['segment'][_0x307413(0x9a)](_0x4d1b21),{'verbose':_0x205358[_0x307413(0x1ad)]}),_0x3cb4a3=_0xbb5b3c['data'],_0x443bba=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x4d1b21+_0x307413(0x111),()=>_0x284762[_0x307413(0xc3)]['getParentSQL'](_0x3cb4a3),{'verbose':_0x205358['verbose']}),_0x50dd0f=_0x443bba[_0x307413(0x135)];return _0x205358[_0x307413(0x12b)]===_0x307413(0x16d)||_0x205358[_0x307413(0x12b)]===_0x307413(0x148)?await handleSDKOutput([{'sql':_0x50dd0f}],_0x205358):console[_0x307413(0x180)](_0x50dd0f),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a28_0x1408f6(0x15f)]='segment:parent:show';[a28_0x1408f6(0xb6)]='Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results';async[a28_0x1408f6(0x1a4)](_0xbe7c21){const _0x182057=a28_0x1408f6,{options:_0x31fa59,args:_0x108e0d,tdx:_0xaa7ccf}=_0xbe7c21,_0x5b2b0f=_0x108e0d[0x0]||_0x31fa59[_0x182057(0x121)];if(!_0x5b2b0f)return showParentSegmentNotSetError(_0x182057(0x195)+_0x182057(0x122)),0x1;_0x31fa59[_0x182057(0x1ad)]&&(console[_0x182057(0x10a)](_0x182057(0xa5)+_0x31fa59[_0x182057(0x113)]),console['error'](_0x182057(0x13a)+_0x5b2b0f));const _0x138d7a=await withSpinner(_0x182057(0x1af)+_0x5b2b0f+_0x182057(0x111),()=>_0xaa7ccf['segment'][_0x182057(0x9a)](_0x5b2b0f),{'verbose':_0x31fa59['verbose']}),_0x1c747c=_0x138d7a[_0x182057(0x135)],_0x319597=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x5b2b0f+'\x27...',()=>_0xaa7ccf[_0x182057(0xc3)][_0x182057(0xbd)](_0x1c747c),{'verbose':_0x31fa59[_0x182057(0x1ad)]});let _0x22b9c5=_0x319597['data'];const _0xf288d6=resolveLimit(_0x31fa59[_0x182057(0xe5)],DEFAULT_DISPLAY_LIMIT),_0x12c904=/\bLIMIT\s+\d+/i['test'](_0x22b9c5);!_0x12c904&&(_0x22b9c5=_0x22b9c5['trim']()[_0x182057(0x13b)](/;+$/,''),_0x22b9c5='SELECT\x20*\x20FROM\x20(\x0a'+_0x22b9c5+_0x182057(0x10c)+_0xf288d6);_0x31fa59['verbose']&&console[_0x182057(0x10a)](_0x182057(0xf0)+_0x22b9c5);const _0x276780=await withQuerySpinner(_0x182057(0x14e),async _0x531238=>{const _0x2e85e1=_0x182057,_0x57d68b=await _0xaa7ccf['query'][_0x2e85e1(0x1a4)](_0x22b9c5,{'catalog':'td','schema':'information_schema','onJobId':_0x323257=>{const _0x9e0030=_0x2e85e1;_0x531238[_0x9e0030(0xd5)](_0x323257);}});return _0x57d68b;},{'verbose':_0x31fa59[_0x182057(0x1ad)]}),_0x588aed=_0x276780[_0x182057(0x135)],_0x46f238=_0x588aed[_0x182057(0x17a)]?_0x182057(0x14f)+_0x588aed[_0x182057(0x17a)]+']':'';return console[_0x182057(0x10a)]('✔\x20Query\x20completed:\x20Processed\x20'+_0x588aed[_0x182057(0xaf)]['processedRows']['toLocaleString']()+'\x20rows\x20'+(_0x182057(0x19f)+formatElapsed(_0x588aed[_0x182057(0xaf)]['elapsedTimeMillis'])+_0x46f238)),await handleQueryOutput(_0x588aed,_0x31fa59),0x0;}}
1
+ const a28_0x169315=a28_0x4084;function a28_0xe269(){const _0x189ffb=['elapsedTimeMillis','Error:\x20Parent\x20segment\x20name\x20is\x20required','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','segment:parent:push','\x20parent\x20segment\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','behavior','Show\x20parent\x20segment\x20details','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','24IsgMVv','\x0aChanges\x20to\x20apply\x20to\x20\x27','No\x20parent\x20segments\x20match\x20pattern:\x20','Get\x20SQL\x20query\x20for\x20parent\x20segment','Errors:','parentSegment','enriched','Resolving\x20parent\x20segment\x20\x27','Pattern:\x20','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','Creating\x20parent\x20segment\x20\x27','table','Session:','using\x20the\x20default\x20path:\x20','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','\x20--attribute\x20\x22','joinKey','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','328gEAmsL','apply','/\x20directories\x20exist.','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','database','/app/dw/parentSegments/','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','✘\x20Failed\x20to\x20rename\x20directory:\x20','jobId','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','updateParent','displaySummary','previewParentYaml','length','Error:','displayValidateResults','%)\x20','Listing\x20fields\x20for\x20\x27','✔\x20Renamed\x20directory\x20to\x20','\x20Configuration\x20is\x20valid','limit','master','runParent','format','scheduleOption','/sessions/','Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20(requires\x20context)\x0a','number','Preview:','site','filter','Join:','yes','sampleData','map','354669GzYTNb','Name:\x20','rowCount','error','\x20=\x20','Error\x20reading\x20file:\x20','Updating','open','segment:parent:fields','workflowAttemptId','localeCompare','timezone','displayColumns','pushParentYaml','segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','message','.yml','status','platform','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','Enriched:','\x20tdx\x20wf\x20attempt\x20','segment:parent:desc','pullParentYaml','Create\x20parent\x20segment\x20\x27','customerPercent','\x20Opening\x20','endsWith','start','Apply\x20changes\x20to\x20\x27','segment:parent:pull','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','\x0a✔\x20Workflow\x20started','bold','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','sort','✔\x20Created\x20parent\x20segment\x20\x27','string','\x20--behavior\x20\x22','dim','displayBehaviorsStats','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','Options:\x0a','segment:parent:sql','test','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','\x20rows)','\x0a⚠️\x20\x20Both\x20','No\x20parent\x20segments\x20found','SELECT\x20*\x20FROM\x20(\x0a','segment:parent:create','information_schema','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','979236mSTwxk','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','column','YAML\x20file:\x20','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','Source:','segment:parent:run','green','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','keys','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','List\x20available\x20fields\x20for\x20segmentation','session','parent_segment','\x20--behavior\x20\x22<name>\x22','Options:','Behavior:','/\x20directory.\x0a','Columns:','isDirectory','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','addAttributes','scheduleType','dirname','\x20[Job\x20ID:\x20','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','errors','Error:\x20--attribute\x20requires\x20a\x20name\x0a','Error:\x20File\x20not\x20found:\x20','stop','Updating\x20parent\x20segment\x20\x27','\x20\x20No\x20sample\x20data\x20available','✔\x20No\x20changes\x20-\x20\x27','displayAttributesStats','in\x20','Validate:','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','execute','89028EavVRg','displayPreviewResults','Attempt:','toLocaleString','resolveParentId','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','Options\x20(one\x20required):\x0a','Status:','segment:parent:view','5420630HsnefL','Events:','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','behaviors','darwin','output','totalEvents','/app/workflows/','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','\x20--enriched','\x20--interval\x20','\x20rows\x20','tdx\x20segment\x20parent\x20preview\x20','getParentFull','\x0aNo\x20sample\x20data\x20available','description','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','displayMasterInfo','Aborted.','parent_segments','\x0aNew\x20parent\x20segment\x20\x27','/{name}.yml\x0a','use','Fetching\x20sample\x20data...','addBehaviorsFile','displayPreviewHints','foreignKey','Error:\x20--behavior\x20requires\x20a\x20name\x0a','2579286vsKMRt','log','setJobId','👥\x20','/\x20→\x20','customersWithEvents','behaviorsFile','Output\x20file:\x20','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','segment:parent:show','getParentSQL','\x20\x20\x20\x20-\x20','run','double','Behaviors','audienceId','all','preview','610309KiDZQl','Error\x20parsing\x20YAML:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\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','\x20is\x20already\x20up\x20to\x20date','name','replace','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','segment:parent:validate','Analyzing\x20changes...','SQL\x20query:\x0a','2KMoSDV','join','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','\x20kill','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','coveragePercent','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','data','columns','schemaError','\x27...','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','yellow','segment:parent:list','Found\x20YAML\x20file:\x20','schemaValid','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','`\x20to\x20download\x20the\x20configuration\x20first','647185MHEpCZ','\x27\x20and\x20run\x20workflow?','Available\x20behaviors:','\x0aUsage:\x20tdx\x20ps\x20preview\x20','workflowSessionId','verbose','\x20Context\x20set:\x20','label','web','population','red','jsonl','Creating','json','attributes','interval','Overwrite\x20\x27','\x20No\x20changes\x20-\x20','Master:','utf-8','displaySampleData','✔\x20Found\x20','cyan','Fetching\x20SQL\x20for\x20\x27','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','Rows:','text','toFixed','Site:\x20','ignore','validateParentYaml','Parent\x20segment:\x20','Created','matchedCount','\x20--attribute\x20\x22<name>\x22','Coverage:','segment:parent:preview','xdg-open','listParents','-1d','varchar','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','Updated','allValid','attribute','repeat','Table:\x20','addBehaviors','\x27\x20is\x20up\x20to\x20date','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','\x5c$&','Fetching\x20parent\x20segment\x20\x27','Attribute:','/\x20and\x20'];a28_0xe269=function(){return _0x189ffb;};return a28_0xe269();}(function(_0x4ef002,_0x4ef4fa){const _0x2df15f=a28_0x4084,_0x23ecc5=_0x4ef002();while(!![]){try{const _0x4cbc65=parseInt(_0x2df15f(0x1e3))/0x1*(-parseInt(_0x2df15f(0xc3))/0x2)+parseInt(_0x2df15f(0x1d0))/0x3+parseInt(_0x2df15f(0x183))/0x4+-parseInt(_0x2df15f(0xd8))/0x5+-parseInt(_0x2df15f(0x118))/0x6*(-parseInt(_0x2df15f(0x14d))/0x7)+-parseInt(_0x2df15f(0x12a))/0x8*(-parseInt(_0x2df15f(0x1ab))/0x9)+-parseInt(_0x2df15f(0x1b4))/0xa;if(_0x4cbc65===_0x4ef4fa)break;else _0x23ecc5['push'](_0x23ecc5['shift']());}catch(_0x6c5ba3){_0x23ecc5['push'](_0x23ecc5['shift']());}}}(a28_0xe269,0x6939a));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a28_0x221ccd from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,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'../types/endpoints.js';import{formatRows,formatAsTable}from'../utils/formatters.js';import{parseYamlString}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';import a28_0x478b4a from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../utils/fields-display.js';function a28_0x4084(_0x42e6e3,_0x250092){_0x42e6e3=_0x42e6e3-0xc1;const _0xe2693=a28_0xe269();let _0x4084c8=_0xe2693[_0x42e6e3];return _0x4084c8;}import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';const PARENT_SEGMENT_DIR=a28_0x169315(0x1c7),LEGACY_PARENT_SEGMENT_DIR=a28_0x169315(0x190);function openBrowser(_0x18d3a3){const _0x557262=a28_0x169315,_0x1ffb01=process[_0x557262(0x160)],_0x216e1b=_0x1ffb01===_0x557262(0x1b8)?_0x557262(0x154):_0x1ffb01==='win32'?'start':_0x557262(0xfd);spawn(_0x216e1b,[_0x18d3a3],{'detached':!![],'stdio':_0x557262(0xf5)})['unref']();}function migrateLegacyDirectory(){const _0x4a611e=a28_0x169315;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x58b81b=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x58b81b[_0x4a611e(0x196)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x4a611e(0x150)](a28_0x478b4a[_0x4a611e(0xd2)](_0x4a611e(0x17d)+LEGACY_PARENT_SEGMENT_DIR+_0x4a611e(0x10d)+PARENT_SEGMENT_DIR+_0x4a611e(0x12c))),console[_0x4a611e(0x150)](a28_0x478b4a['dim'](_0x4a611e(0x1d9)+LEGACY_PARENT_SEGMENT_DIR+_0x4a611e(0x194))),![];console['error'](a28_0x478b4a[_0x4a611e(0xd2)]('\x0a⚠️\x20\x20Migrating:\x20'+LEGACY_PARENT_SEGMENT_DIR+_0x4a611e(0x1d4)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x4a611e(0x150)](a28_0x478b4a[_0x4a611e(0x18a)](_0x4a611e(0x13c)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x59468b){const _0x36a616=_0x59468b instanceof Error?_0x59468b[_0x4a611e(0x15d)]:String(_0x59468b);return console[_0x4a611e(0x150)](a28_0x478b4a[_0x4a611e(0xe2)](_0x4a611e(0x131)+_0x36a616+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a28_0x169315(0x1dd)](_0x5f11ac){return migrateLegacyDirectory(),super['run'](_0x5f11ac);}}function resolveYamlFile(_0x45228){const _0x405e1e=a28_0x169315;if(_0x45228[_0x405e1e(0x169)](_0x405e1e(0x15e))||_0x45228['endsWith']('.yaml'))return _0x45228;return a28_0x221ccd[_0x405e1e(0xc4)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x45228)+_0x405e1e(0x15e));}function formatProgressMessage(_0x4ed14c){const _0x1e7d6d=a28_0x169315,_0x5b665a=_0x4ed14c['match'](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x5b665a){const [,_0x4a1b61,_0x2e5c87,_0x1771c0='']=_0x5b665a;return a28_0x478b4a[_0x1e7d6d(0x175)](_0x4a1b61+':')+'\x20'+_0x2e5c87+a28_0x478b4a[_0x1e7d6d(0x175)](_0x1771c0);}return a28_0x478b4a['dim'](_0x4ed14c);}function showFileNotFoundError(_0x4e61b3,_0x939ac7){const _0x4349da=a28_0x169315;console[_0x4349da(0x150)](a28_0x478b4a[_0x4349da(0xe2)](_0x4349da(0x1a1)+_0x4e61b3+'\x0a')),console['error'](a28_0x478b4a['cyan'](_0x4349da(0x1c4)+_0x939ac7+_0x4349da(0xd7)));}function showParentSegmentNotSetError(_0x315996){const _0x2a7f0c=a28_0x169315;console[_0x2a7f0c(0x150)](a28_0x478b4a['yellow'](_0x2a7f0c(0x170))),console[_0x2a7f0c(0x150)](_0x315996);}export class ParentSegmentListCommand extends BaseCommand{[a28_0x169315(0x1e8)]=a28_0x169315(0xd3);[a28_0x169315(0x1c3)]='List\x20parent\x20segments';async['execute'](_0x21acaa){const _0x3aa2b8=a28_0x169315,{options:_0x3073eb,args:_0x1df368,tdx:_0x968fb8}=_0x21acaa,_0x43378f=_0x1df368[0x0];_0x3073eb[_0x3aa2b8(0xdd)]&&(console[_0x3aa2b8(0x150)](_0x3aa2b8(0xf4)+_0x3073eb['site']),_0x43378f&&console[_0x3aa2b8(0x150)](_0x3aa2b8(0x120)+_0x43378f));const _0x32953f=await withSpinner(_0x43378f?'Listing\x20parent\x20segments\x20matching\x20\x27'+_0x43378f+_0x3aa2b8(0xd0):'Listing\x20parent\x20segments...',()=>_0x968fb8[_0x3aa2b8(0x15b)][_0x3aa2b8(0xfe)](),{'verbose':_0x3073eb[_0x3aa2b8(0xdd)]});let _0x4fa632=_0x32953f[_0x3aa2b8(0xcd)];if(_0x43378f){const _0x11c00b=_0x43378f[_0x3aa2b8(0x1e9)](/[.+^${}()|[\]\\]/g,_0x3aa2b8(0x10a))[_0x3aa2b8(0x1e9)](/\*/g,'.*')[_0x3aa2b8(0x1e9)](/\?/g,'.'),_0x2d105f=new RegExp('^'+_0x11c00b+'$','i');_0x4fa632=_0x4fa632[_0x3aa2b8(0x148)](_0x2cc8d2=>_0x2d105f['test'](_0x2cc8d2[_0x3aa2b8(0xe6)]['name']));}_0x4fa632[_0x3aa2b8(0x171)]((_0x30fd67,_0x36d2cd)=>_0x30fd67['attributes'][_0x3aa2b8(0x1e8)][_0x3aa2b8(0x157)](_0x36d2cd[_0x3aa2b8(0xe6)][_0x3aa2b8(0x1e8)])),console[_0x3aa2b8(0x150)](_0x3aa2b8(0xed)+_0x4fa632['length']+'\x20parent\x20segment'+(_0x4fa632['length']!==0x1?'s':''));if(_0x3073eb[_0x3aa2b8(0x141)]===_0x3aa2b8(0xe5)||_0x3073eb[_0x3aa2b8(0x141)]==='jsonl')await handleSDKOutput(_0x4fa632,_0x3073eb);else{if(_0x4fa632[_0x3aa2b8(0x137)]===0x0)_0x43378f?console[_0x3aa2b8(0x1d1)](_0x3aa2b8(0x11a)+_0x43378f):console['log'](_0x3aa2b8(0x17e));else for(const _0x8ef5d0 of _0x4fa632){const _0x2dc9ed=_0x8ef5d0[_0x3aa2b8(0xe6)][_0x3aa2b8(0xe1)]?a28_0x478b4a[_0x3aa2b8(0x175)]('\x20('+formatRows(_0x8ef5d0[_0x3aa2b8(0xe6)][_0x3aa2b8(0xe1)])+')'):'';console[_0x3aa2b8(0x1d1)](_0x3aa2b8(0x1d3)+_0x8ef5d0[_0x3aa2b8(0xe6)]['name']+_0x2dc9ed);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{['name']=a28_0x169315(0x180);[a28_0x169315(0x1c3)]=a28_0x169315(0x1b6);async['execute'](_0x10942a){const _0x2960e4=a28_0x169315,{options:_0x43002e,args:_0x13e649,tdx:_0x4af694}=_0x10942a;console['error']('\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a'+_0x2960e4(0x18b)+_0x2960e4(0x198));const _0x2a30e8=_0x43002e;if(_0x13e649[_0x2960e4(0x137)]===0x0)return console['error'](a28_0x478b4a[_0x2960e4(0xe2)](_0x2960e4(0x10f))),console[_0x2960e4(0x150)](_0x2960e4(0x121)),0x1;const _0x2cbaac=_0x13e649[0x0];if(!_0x2a30e8[_0x2960e4(0x12e)]||!_0x2a30e8[_0x2960e4(0x123)])return console[_0x2960e4(0x150)]('Error:\x20--database\x20and\x20--table\x20are\x20required'),console[_0x2960e4(0x150)]('Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>'),0x1;_0x2a30e8[_0x2960e4(0xdd)]&&(console['error'](_0x2960e4(0xf4)+_0x2a30e8['site']),console[_0x2960e4(0x150)](_0x2960e4(0x14e)+_0x2cbaac),console[_0x2960e4(0x150)]('Database:\x20'+_0x2a30e8[_0x2960e4(0x12e)]),console[_0x2960e4(0x150)](_0x2960e4(0x106)+_0x2a30e8[_0x2960e4(0x123)]));const _0x499f7e=await loadJSONFromOptions(_0x2a30e8['attributes'],_0x2a30e8['attributesFile']),_0x30558d=await loadJSONFromOptions(_0x2a30e8[_0x2960e4(0x1b7)],_0x2a30e8[_0x2960e4(0x1d6)]),_0x2753a6=await loadJSONFromOptions(_0x2a30e8['customerGroup'],_0x2a30e8['customerGroupFile']),_0x4a06b8={'name':_0x2cbaac,'description':_0x2a30e8[_0x2960e4(0x1c3)],'scheduleType':_0x2a30e8[_0x2960e4(0x19a)],'scheduleOption':_0x2a30e8[_0x2960e4(0x142)],'timezone':_0x2a30e8[_0x2960e4(0x158)],'master':{'parentDatabaseName':_0x2a30e8[_0x2960e4(0x12e)],'parentTableName':_0x2a30e8[_0x2960e4(0x123)]},'attributes':_0x499f7e,'behaviors':_0x30558d,'customerGroup':_0x2753a6},_0xa35fe=await withSpinner(_0x2960e4(0x122)+_0x2cbaac+_0x2960e4(0xd0),()=>_0x4af694[_0x2960e4(0x15b)]['createParent'](_0x4a06b8),{'verbose':_0x43002e[_0x2960e4(0xdd)]}),_0x4ef8d1=_0xa35fe[_0x2960e4(0xcd)];return console['error'](_0x2960e4(0x172)+_0x4ef8d1['name']+'\x27\x20with\x20ID:\x20'+_0x4ef8d1['id']),await handleSDKOutput([_0x4ef8d1],_0x43002e),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a28_0x169315(0x1e8)]='segment:parent:update';[a28_0x169315(0x1c3)]=a28_0x169315(0x133);async[a28_0x169315(0x1aa)](_0x4636f1){const _0x2f4ce3=a28_0x169315,{options:_0x14dae4,args:_0x39dfc3,tdx:_0x3dba79}=_0x4636f1;console[_0x2f4ce3(0x150)](_0x2f4ce3(0x130)+_0x2f4ce3(0x18b)+_0x2f4ce3(0x198));const _0x98801c=_0x14dae4;if(_0x39dfc3['length']===0x0)return console[_0x2f4ce3(0x150)](a28_0x478b4a[_0x2f4ce3(0xe2)](_0x2f4ce3(0x10f))),console[_0x2f4ce3(0x150)](_0x2f4ce3(0xc7)),0x1;const _0x3d8c2a=_0x39dfc3[0x0];_0x98801c[_0x2f4ce3(0xdd)]&&(console['error'](_0x2f4ce3(0xf4)+_0x98801c[_0x2f4ce3(0x147)]),console[_0x2f4ce3(0x150)]('Parent\x20segment:\x20'+_0x3d8c2a));const _0xf4c38c=await withSpinner('Fetching\x20current\x20configuration\x20for\x20\x27'+_0x3d8c2a+_0x2f4ce3(0xd0),()=>_0x3dba79[_0x2f4ce3(0x15b)][_0x2f4ce3(0x1c1)](_0x3d8c2a),{'verbose':_0x98801c[_0x2f4ce3(0xdd)]}),_0xe93ab5=_0xf4c38c['data'],_0x5ee48e=await loadJSONFromOptions(_0x98801c[_0x2f4ce3(0x199)],_0x98801c['addAttributesFile']),_0x523855=await loadJSONFromOptions(_0x98801c[_0x2f4ce3(0x107)],_0x98801c[_0x2f4ce3(0x1cc)]),_0x4809b0={'name':_0xe93ab5[_0x2f4ce3(0x1e8)],'description':_0x98801c[_0x2f4ce3(0x1c3)]!==undefined?_0x98801c[_0x2f4ce3(0x1c3)]:_0xe93ab5['description'],'scheduleType':_0x98801c[_0x2f4ce3(0x19a)]!==undefined?_0x98801c[_0x2f4ce3(0x19a)]:_0xe93ab5['scheduleType'],'scheduleOption':_0x98801c[_0x2f4ce3(0x142)]!==undefined?_0x98801c[_0x2f4ce3(0x142)]:_0xe93ab5[_0x2f4ce3(0x142)],'timezone':_0x98801c[_0x2f4ce3(0x158)]!==undefined?_0x98801c[_0x2f4ce3(0x158)]:_0xe93ab5[_0x2f4ce3(0x158)],'master':_0xe93ab5['master'],'attributes':_0x5ee48e?[..._0xe93ab5['attributes']||[],..._0x5ee48e]:_0xe93ab5[_0x2f4ce3(0xe6)],'behaviors':_0x523855?[..._0xe93ab5[_0x2f4ce3(0x1b7)]||[],..._0x523855]:_0xe93ab5['behaviors'],'customerGroup':_0xe93ab5['customerGroup']},_0x1f279f=await withSpinner(_0x2f4ce3(0x1a3)+_0x3d8c2a+_0x2f4ce3(0xd0),()=>_0x3dba79[_0x2f4ce3(0x15b)][_0x2f4ce3(0x134)](_0x3d8c2a,_0x4809b0),{'verbose':_0x98801c[_0x2f4ce3(0xdd)]}),_0xf5fc48=_0x1f279f[_0x2f4ce3(0xcd)];return console[_0x2f4ce3(0x150)]('✔\x20Updated\x20parent\x20segment\x20\x27'+_0xf5fc48[_0x2f4ce3(0x1e8)]+'\x27'),await handleSDKOutput([_0xf5fc48],_0x98801c),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{['name']=a28_0x169315(0x16c);[a28_0x169315(0x1c3)]=a28_0x169315(0x17b);async[a28_0x169315(0x1aa)](_0x29f68f){const _0x22432a=a28_0x169315,{options:_0x5baedc,args:_0xb48c3d,tdx:_0x898e5f}=_0x29f68f,_0x50f382=_0x5baedc,_0x2e6272=_0xb48c3d[0x0]||_0x5baedc[_0x22432a(0x11d)];if(!_0x2e6272)return showParentSegmentNotSetError(_0x22432a(0xc9)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment'),0x1;if(_0x50f382[_0x22432a(0x1ca)]&&_0x50f382[_0x22432a(0x1b9)])return console[_0x22432a(0x150)](a28_0x478b4a[_0x22432a(0xe2)](_0x22432a(0x1bc))),console[_0x22432a(0x150)](a28_0x478b4a[_0x22432a(0x175)](_0x22432a(0xcc))),console[_0x22432a(0x150)](a28_0x478b4a[_0x22432a(0x175)](_0x22432a(0x125)+PARENT_SEGMENT_DIR+_0x22432a(0x1c9))),console['error'](a28_0x478b4a[_0x22432a(0xee)](_0x22432a(0x182))),0x1;const _0x2f562f=_0x50f382['output']||a28_0x221ccd[_0x22432a(0xc4)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x2e6272)+'.yml');_0x50f382[_0x22432a(0xdd)]&&(console[_0x22432a(0x150)](_0x22432a(0xf4)+_0x50f382['site']),console[_0x22432a(0x150)]('Parent\x20segment:\x20'+_0x2e6272),console[_0x22432a(0x150)](_0x22432a(0x1d7)+_0x2f562f));const _0x4e8a38=await withSpinner(_0x22432a(0x10b)+_0x2e6272+_0x22432a(0xd0),()=>_0x898e5f['segment'][_0x22432a(0x165)](_0x2e6272),{'verbose':_0x50f382[_0x22432a(0xdd)]}),_0x4e7933=_0x4e8a38['data'];if(existsSync(_0x2f562f)){const _0x43d689=readFileSync(_0x2f562f,'utf-8'),_0x516d68=generateDiff(_0x43d689,_0x4e7933);if(!hasChanges(_0x516d68))console[_0x22432a(0x150)](a28_0x478b4a['green']('✔')+_0x22432a(0xe9)+a28_0x478b4a[_0x22432a(0xee)](_0x2f562f)+_0x22432a(0x1e7));else{console['error']('\x0aChanges\x20to\x20\x27'+_0x2f562f+'\x27:'),console[_0x22432a(0x150)]('─'[_0x22432a(0x105)](0x3c)),console['error'](formatDiffWithColors(_0x516d68)),console[_0x22432a(0x150)]('─'[_0x22432a(0x105)](0x3c));if(!_0x50f382[_0x22432a(0x14a)]){const _0x520be5=await confirmKey(_0x22432a(0xe8)+_0x2f562f+'\x27?');if(!_0x520be5)return console['error']('Aborted.'),0x1;}writeFileSync(_0x2f562f,_0x4e7933,_0x22432a(0xeb)),console[_0x22432a(0x150)](a28_0x478b4a[_0x22432a(0x18a)]('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a28_0x478b4a[_0x22432a(0xee)](_0x2f562f));}}else{const _0x5e186b=a28_0x221ccd[_0x22432a(0x19b)](_0x2f562f);!existsSync(_0x5e186b)&&mkdirSync(_0x5e186b,{'recursive':!![]}),writeFileSync(_0x2f562f,_0x4e7933,_0x22432a(0xeb)),console[_0x22432a(0x150)](a28_0x478b4a[_0x22432a(0x18a)]('✔')+_0x22432a(0x19d)+a28_0x478b4a['cyan'](_0x2f562f));}return saveSessionContext({'parent_segment':_0x2e6272},_0x50f382[_0x22432a(0x18f)]),console['error'](a28_0x478b4a[_0x22432a(0x18a)]('✔')+_0x22432a(0xde)+a28_0x478b4a[_0x22432a(0x175)]('parent_segment')+_0x22432a(0x151)+a28_0x478b4a[_0x22432a(0xee)](_0x2e6272)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a28_0x169315(0x1e8)]=a28_0x169315(0x111);[a28_0x169315(0x1c3)]=a28_0x169315(0x1a9);async[a28_0x169315(0x1aa)](_0x8bb9ed){const _0x1bb743=a28_0x169315,{options:_0x4d17cb,args:_0x40e113,tdx:_0xc9597d}=_0x8bb9ed,_0x3e6f22=_0x4d17cb,_0x2f480f=_0x40e113[0x0]||_0x4d17cb[_0x1bb743(0x11d)];if(!_0x2f480f)return showParentSegmentNotSetError(_0x1bb743(0x19e)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment'),0x1;const _0x4f9426=resolveYamlFile(_0x2f480f);if(!existsSync(_0x4f9426))return showFileNotFoundError(_0x4f9426,_0x2f480f),0x1;_0x3e6f22[_0x1bb743(0xdd)]&&(console[_0x1bb743(0x150)]('Site:\x20'+_0x3e6f22['site']),console[_0x1bb743(0x150)]('YAML\x20file:\x20'+_0x4f9426));let _0x3ecc93;try{_0x3ecc93=readFileSync(_0x4f9426,_0x1bb743(0xeb));}catch(_0x49b207){const _0x223638=_0x49b207 instanceof Error?_0x49b207[_0x1bb743(0x15d)]:String(_0x49b207);return console['error'](_0x1bb743(0x152)+_0x223638),0x1;}const _0x2bf3e4=await withSpinner(_0x1bb743(0xc1),()=>_0xc9597d[_0x1bb743(0x15b)][_0x1bb743(0x15a)](_0x3ecc93),{'verbose':_0x3e6f22['verbose']}),_0x48e467=_0x2bf3e4[_0x1bb743(0xcd)],{isNew:_0xa2455d,name:_0x2a4437,hasChanges:_0x3ae7e5,diffFormatted:_0x22fbd3}=_0x48e467;if(!_0x3ae7e5)return console[_0x1bb743(0x150)]('✔\x20No\x20changes\x20-\x20\x27'+_0x2a4437+'\x27\x20is\x20already\x20up\x20to\x20date'),0x0;_0xa2455d?console[_0x1bb743(0x150)](_0x1bb743(0x1c8)+_0x2a4437+'\x27:'):console['error'](_0x1bb743(0x119)+_0x2a4437+'\x27:');console[_0x1bb743(0x150)]('─'['repeat'](0x3c)),console[_0x1bb743(0x150)](_0x22fbd3),console[_0x1bb743(0x150)]('─'[_0x1bb743(0x105)](0x3c));const _0x3183a9=_0xa2455d?_0x1bb743(0x166)+_0x2a4437+'\x27?':_0x1bb743(0x16b)+_0x2a4437+'\x27?';if(!_0x3e6f22[_0x1bb743(0x14a)]){const _0x5e393f=await confirmKey(_0x3183a9);if(!_0x5e393f)return console[_0x1bb743(0x150)](_0x1bb743(0x1c6)),0x1;}const _0x3dbd12=_0xa2455d?_0x1bb743(0xe4):_0x1bb743(0x153),_0x584a32=await withSpinner(_0x3dbd12+_0x1bb743(0x112)+_0x2a4437+'\x27...',()=>_0x48e467['apply'](),{'verbose':_0x3e6f22[_0x1bb743(0xdd)]}),_0x1d642d=_0x584a32[_0x1bb743(0xcd)],_0x2b51b6=getConsoleNextUrl(_0x3e6f22[_0x1bb743(0x147)],_0x1bb743(0x12f)+_0x1d642d['id']),_0x4f691a=_0xa2455d?_0x1bb743(0xf8):'Updated';return console[_0x1bb743(0x150)]('✔\x20'+_0x4f691a+_0x1bb743(0x112)+_0x1d642d[_0x1bb743(0x1e8)]+'\x27'),console[_0x1bb743(0x150)]('\x20\x20'+_0x2b51b6),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{['name']=a28_0x169315(0x1ec);[a28_0x169315(0x1c3)]=a28_0x169315(0x161);async[a28_0x169315(0x1aa)](_0x278edf){const _0x194832=a28_0x169315,{options:_0x355c5c,args:_0x52af83,tdx:_0x2ead45}=_0x278edf,_0x3a3e52=_0x355c5c,_0x770705=_0x52af83[0x0]||_0x355c5c[_0x194832(0x11d)];if(!_0x770705)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'+_0x194832(0x16d)+_0x194832(0x178)+_0x194832(0x129)+_0x194832(0x101)+_0x194832(0x1b0)),0x1;const _0x4320f5=resolveYamlFile(_0x770705);if(!existsSync(_0x4320f5))return showFileNotFoundError(_0x4320f5,_0x770705),0x1;_0x3a3e52[_0x194832(0xdd)]&&(console[_0x194832(0x150)](_0x194832(0xf4)+_0x3a3e52[_0x194832(0x147)]),console[_0x194832(0x150)](_0x194832(0x186)+_0x4320f5));let _0x114560;try{_0x114560=readFileSync(_0x4320f5,_0x194832(0xeb));}catch(_0x506041){const _0x42ac6a=_0x506041 instanceof Error?_0x506041[_0x194832(0x15d)]:String(_0x506041);return console['error'](_0x194832(0x152)+_0x42ac6a),0x1;}const _0x56aeb0=createCommandSpinner(a28_0x478b4a[_0x194832(0x175)]('Validating\x20configuration...'),{'verbose':_0x3a3e52[_0x194832(0xdd)]});_0x56aeb0[_0x194832(0x16a)]();const _0xc668db={'onProgress':_0x494a8a=>{const _0x9a5076=_0x194832;_0x56aeb0[_0x9a5076(0xf2)]=formatProgressMessage(_0x494a8a);}};if(_0x3a3e52[_0x194832(0x13f)])_0xc668db[_0x194832(0x13f)]=!![];if(_0x3a3e52[_0x194832(0x11e)])_0xc668db[_0x194832(0x11e)]=!![];_0x3a3e52[_0x194832(0x104)]&&(_0xc668db[_0x194832(0x104)]=_0x3a3e52['attribute']);_0x3a3e52[_0x194832(0x115)]&&(_0xc668db[_0x194832(0x115)]=_0x3a3e52[_0x194832(0x115)]);if(_0x3a3e52[_0x194832(0xe7)])_0xc668db[_0x194832(0xe7)]=_0x3a3e52[_0x194832(0xe7)];let _0xc93af0;try{_0xc93af0=await _0x2ead45[_0x194832(0x15b)][_0x194832(0xf6)](_0x114560,_0xc668db),_0x56aeb0[_0x194832(0x1a2)]();}catch(_0x414175){_0x56aeb0[_0x194832(0x1a2)]();throw _0x414175;}const _0x3113f5=_0x3a3e52[_0x194832(0xe7)]||'-1d';return this[_0x194832(0x139)](_0xc93af0,_0xc668db,_0x4320f5,_0x3113f5),_0xc93af0[_0x194832(0x103)]?0x0:0x1;}[a28_0x169315(0x139)](_0x16c276,_0xa27e04,_0x27a7c7,_0x51931f){const _0x597224=a28_0x169315;console[_0x597224(0x150)]('\x0a'+a28_0x478b4a[_0x597224(0x16f)](_0x597224(0x1a8))+'\x20'+_0x16c276[_0x597224(0x1e8)]),console[_0x597224(0x150)]('═'[_0x597224(0x105)](0x3c)),this[_0x597224(0x1c5)](_0x16c276);if(typeof _0xa27e04[_0x597224(0x104)]===_0x597224(0x173)){this[_0x597224(0x1a6)](_0x16c276),this[_0x597224(0x135)](_0x16c276),this[_0x597224(0x1cd)](_0x27a7c7,_0x51931f,_0x597224(0x104),_0xa27e04[_0x597224(0x104)]);return;}if(_0xa27e04[_0x597224(0x104)]===!![]){this[_0x597224(0x1a6)](_0x16c276),this[_0x597224(0x135)](_0x16c276),this[_0x597224(0x1cd)](_0x27a7c7,_0x51931f,_0x597224(0xe6));return;}if(typeof _0xa27e04[_0x597224(0x115)]===_0x597224(0x173)){this[_0x597224(0x176)](_0x16c276,_0x51931f),this['displaySummary'](_0x16c276),this[_0x597224(0x1cd)](_0x27a7c7,_0x51931f,_0x597224(0x115),_0xa27e04[_0x597224(0x115)]);return;}if(_0xa27e04[_0x597224(0x115)]===!![]){this[_0x597224(0x176)](_0x16c276,_0x51931f),this[_0x597224(0x135)](_0x16c276),this[_0x597224(0x1cd)](_0x27a7c7,_0x51931f,_0x597224(0x1b7));return;}this[_0x597224(0x1a6)](_0x16c276),this['displayBehaviorsStats'](_0x16c276,_0x51931f),this[_0x597224(0x135)](_0x16c276),this[_0x597224(0x1cd)](_0x27a7c7,_0x51931f,_0x597224(0x1e1));}[a28_0x169315(0x1cd)](_0x147a0b,_0x1f24fb,_0x424d7e,_0x197eb7){const _0x4ee98f=a28_0x169315;console['error']('\x0a'+a28_0x478b4a[_0x4ee98f(0x175)]('To\x20view\x20sample\x20data:'));const _0x2f8fa4=_0x1f24fb!==_0x4ee98f(0xff)?_0x4ee98f(0x1be)+_0x1f24fb:'';if(_0x424d7e===_0x4ee98f(0x104)&&_0x197eb7)console[_0x4ee98f(0x150)]('\x20\x20'+a28_0x478b4a[_0x4ee98f(0x175)]('tdx\x20segment\x20parent\x20preview\x20'+_0x147a0b+_0x4ee98f(0x127)+_0x197eb7+'\x22'+_0x2f8fa4));else{if(_0x424d7e===_0x4ee98f(0x115)&&_0x197eb7)console[_0x4ee98f(0x150)]('\x20\x20'+a28_0x478b4a['dim'](_0x4ee98f(0x1c0)+_0x147a0b+_0x4ee98f(0x174)+_0x197eb7+'\x22'+_0x2f8fa4));else(_0x424d7e==='attributes'||_0x424d7e===_0x4ee98f(0x1e1))&&console[_0x4ee98f(0x150)]('\x20\x20'+a28_0x478b4a['dim'](_0x4ee98f(0x1c0)+_0x147a0b+_0x4ee98f(0xfa)+_0x2f8fa4));}(_0x424d7e===_0x4ee98f(0x1b7)||_0x424d7e==='all')&&console[_0x4ee98f(0x150)]('\x20\x20'+a28_0x478b4a[_0x4ee98f(0x175)](_0x4ee98f(0x1c0)+_0x147a0b+_0x4ee98f(0x191)+_0x2f8fa4)),_0x424d7e===_0x4ee98f(0x1e1)&&console[_0x4ee98f(0x150)]('\x20\x20'+a28_0x478b4a[_0x4ee98f(0x175)]('tdx\x20segment\x20parent\x20preview\x20'+_0x147a0b+_0x4ee98f(0x1bd)+_0x2f8fa4));}[a28_0x169315(0x1c5)](_0x2a0739){const _0x2abec9=a28_0x169315,{master:_0x54cce6}=_0x2a0739,_0x19f648=_0x54cce6['schemaValid']?a28_0x478b4a['green']('✔'):a28_0x478b4a[_0x2abec9(0xe2)]('✘');console[_0x2abec9(0x150)]('\x0a'+a28_0x478b4a['dim']('Master\x20Table')),console[_0x2abec9(0x150)](_0x19f648+'\x20'+a28_0x478b4a[_0x2abec9(0x16f)](_0x54cce6[_0x2abec9(0x12e)]+'.'+_0x54cce6['table'])),_0x54cce6['schemaValid']?_0x54cce6[_0x2abec9(0x14f)]!==undefined&&console[_0x2abec9(0x150)]('\x20\x20'+a28_0x478b4a[_0x2abec9(0x175)](_0x2abec9(0xf1))+'\x20'+a28_0x478b4a[_0x2abec9(0xee)](formatRows(_0x54cce6['rowCount']))):console[_0x2abec9(0x150)]('\x20\x20'+a28_0x478b4a['red']('Error:')+'\x20'+_0x54cce6[_0x2abec9(0xcf)]);}[a28_0x169315(0x1a6)](_0x2255d0){const _0x4b44ce=a28_0x169315;if(_0x2255d0[_0x4b44ce(0xe6)]['length']===0x0)return;console['error']('\x0a'+a28_0x478b4a[_0x4b44ce(0x175)]('Attributes'));for(const _0x71cbe1 of _0x2255d0[_0x4b44ce(0xe6)]){const _0x1d4a7c=_0x71cbe1['schemaValid']?a28_0x478b4a[_0x4b44ce(0x18a)]('✔'):a28_0x478b4a['red']('✘');let _0x1c4b99='';if(_0x71cbe1[_0x4b44ce(0xd5)]&&_0x71cbe1[_0x4b44ce(0xf9)]!==undefined&&_0x71cbe1[_0x4b44ce(0xca)]!==undefined){const _0x187caa=_0x71cbe1[_0x4b44ce(0xca)][_0x4b44ce(0xf3)](0x1),_0x498eda=_0x71cbe1[_0x4b44ce(0xca)]>=0x50?a28_0x478b4a['green']:_0x71cbe1[_0x4b44ce(0xca)]>=0x32?a28_0x478b4a[_0x4b44ce(0xd2)]:a28_0x478b4a[_0x4b44ce(0xe2)];_0x1c4b99='\x20'+a28_0x478b4a['dim'](_0x4b44ce(0xfb))+'\x20'+_0x498eda(_0x187caa+'%')+'\x20('+formatRows(_0x71cbe1[_0x4b44ce(0xf9)])+_0x4b44ce(0x17c);}console['error'](_0x1d4a7c+'\x20'+a28_0x478b4a[_0x4b44ce(0x16f)](_0x71cbe1['name'])+_0x1c4b99),console[_0x4b44ce(0x150)]('\x20\x20'+a28_0x478b4a['dim'](_0x4b44ce(0x188))+'\x20'+a28_0x478b4a[_0x4b44ce(0x16f)](_0x71cbe1['database']+'.'+_0x71cbe1[_0x4b44ce(0x123)]));const _0x5e2616=_0x71cbe1[_0x4b44ce(0x128)]===_0x71cbe1['foreignKey']?a28_0x478b4a[_0x4b44ce(0x175)]('Join\x20on:')+'\x20'+_0x71cbe1[_0x4b44ce(0x128)]:a28_0x478b4a['dim'](_0x4b44ce(0x149))+'\x20'+_0x71cbe1[_0x4b44ce(0x128)]+_0x4b44ce(0x151)+_0x71cbe1[_0x4b44ce(0x1ce)];console[_0x4b44ce(0x150)]('\x20\x20'+_0x5e2616),console[_0x4b44ce(0x150)]('\x20\x20'+a28_0x478b4a[_0x4b44ce(0x175)](_0x4b44ce(0x195))),this[_0x4b44ce(0x159)](_0x71cbe1[_0x4b44ce(0xce)]),!_0x71cbe1[_0x4b44ce(0xd5)]&&console[_0x4b44ce(0x150)]('\x20\x20'+a28_0x478b4a[_0x4b44ce(0xe2)](_0x4b44ce(0x138))+'\x20'+_0x71cbe1[_0x4b44ce(0xcf)]);}}[a28_0x169315(0x176)](_0x30f88f,_0xf25f4c){const _0x155efc=a28_0x169315;if(_0x30f88f[_0x155efc(0x1b7)][_0x155efc(0x137)]===0x0)return;console['error']('\x0a'+a28_0x478b4a[_0x155efc(0x175)](_0x155efc(0x1df))+'\x20'+a28_0x478b4a[_0x155efc(0x175)]('('+_0xf25f4c+')'));for(const _0x29a554 of _0x30f88f['behaviors']){const _0xf868d0=_0x29a554[_0x155efc(0xd5)]?a28_0x478b4a[_0x155efc(0x18a)]('✔'):a28_0x478b4a[_0x155efc(0xe2)]('✘');let _0x520c2b='';if(_0x29a554[_0x155efc(0xd5)]&&_0x29a554[_0x155efc(0x1d5)]!==undefined&&_0x29a554[_0x155efc(0x1ba)]!==undefined){const _0x28ed10=_0x29a554['customerPercent']?.[_0x155efc(0xf3)](0x1)||'?',_0x362fd3=(_0x29a554['customerPercent']??0x0)>=0x32?a28_0x478b4a[_0x155efc(0x18a)]:(_0x29a554[_0x155efc(0x167)]??0x0)>=0x14?a28_0x478b4a[_0x155efc(0xd2)]:a28_0x478b4a[_0x155efc(0xe2)];_0x520c2b='\x20'+a28_0x478b4a[_0x155efc(0x175)]('Customers:')+'\x20'+_0x362fd3(formatRows(_0x29a554[_0x155efc(0x1d5)]))+'\x20('+_0x28ed10+_0x155efc(0x13a)+a28_0x478b4a[_0x155efc(0x175)](_0x155efc(0x1b5))+'\x20'+a28_0x478b4a['cyan'](formatRows(_0x29a554[_0x155efc(0x1ba)]));}console[_0x155efc(0x150)](_0xf868d0+'\x20'+a28_0x478b4a['bold'](_0x29a554[_0x155efc(0x1e8)])+_0x520c2b),console[_0x155efc(0x150)]('\x20\x20'+a28_0x478b4a[_0x155efc(0x175)]('Source:')+'\x20'+a28_0x478b4a[_0x155efc(0x16f)](_0x29a554[_0x155efc(0x12e)]+'.'+_0x29a554[_0x155efc(0x123)]));const _0x35cec7=_0x29a554[_0x155efc(0x128)]===_0x29a554[_0x155efc(0x1ce)]?a28_0x478b4a['dim']('Join\x20on:')+'\x20'+_0x29a554[_0x155efc(0x128)]:a28_0x478b4a['dim'](_0x155efc(0x149))+'\x20'+_0x29a554[_0x155efc(0x128)]+'\x20=\x20'+_0x29a554[_0x155efc(0x1ce)];console[_0x155efc(0x150)]('\x20\x20'+_0x35cec7),console[_0x155efc(0x150)]('\x20\x20'+a28_0x478b4a[_0x155efc(0x175)](_0x155efc(0x195))),this[_0x155efc(0x159)](_0x29a554[_0x155efc(0xce)]),!_0x29a554['schemaValid']&&console['error']('\x20\x20'+a28_0x478b4a[_0x155efc(0xe2)](_0x155efc(0x138))+'\x20'+_0x29a554[_0x155efc(0xcf)]);}}['displayColumns'](_0x1c2865){const _0xdafbf4=a28_0x169315;for(const _0x338079 of _0x1c2865){_0x338079[_0xdafbf4(0xdf)]===_0x338079[_0xdafbf4(0x185)]||_0x338079[_0xdafbf4(0x185)]==='*'?console[_0xdafbf4(0x150)](_0xdafbf4(0x1dc)+_0x338079['label']):console[_0xdafbf4(0x150)](_0xdafbf4(0x1dc)+_0x338079['label']+'\x20'+a28_0x478b4a[_0xdafbf4(0x175)]('('+_0x338079[_0xdafbf4(0x185)]+')'));}}[a28_0x169315(0x135)](_0x35d795){const _0x1df9fb=a28_0x169315;console[_0x1df9fb(0x150)]('─'[_0x1df9fb(0x105)](0x3c));if(_0x35d795[_0x1df9fb(0x19f)][_0x1df9fb(0x137)]>0x0){console[_0x1df9fb(0x150)]('\x0a'+a28_0x478b4a[_0x1df9fb(0xe2)](_0x1df9fb(0x11c)));for(const _0x3ec6f1 of _0x35d795[_0x1df9fb(0x19f)]){console[_0x1df9fb(0x150)]('\x20\x20'+a28_0x478b4a['red']('•')+'\x20'+_0x3ec6f1);}}_0x35d795[_0x1df9fb(0x103)]&&console[_0x1df9fb(0x150)]('\x0a'+a28_0x478b4a[_0x1df9fb(0x18a)]('✔')+_0x1df9fb(0x13d));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a28_0x169315(0x1e8)]=a28_0x169315(0xfc);[a28_0x169315(0x1c3)]=a28_0x169315(0x1d8);async[a28_0x169315(0x1aa)](_0x3acdf0){const _0x2b4eb5=a28_0x169315,{options:_0x1a6644,args:_0x5b4de0,tdx:_0xc13dea}=_0x3acdf0,_0x591357=_0x1a6644,_0x1eff99=_0x5b4de0[0x0]||_0x1a6644[_0x2b4eb5(0x11d)];if(!_0x1eff99)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'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a'+_0x2b4eb5(0x1b1)+_0x2b4eb5(0x12d)+_0x2b4eb5(0x184)+_0x2b4eb5(0x1eb)+'\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a'+_0x2b4eb5(0x1b0)),0x1;if(!_0x591357[_0x2b4eb5(0x13f)]&&!_0x591357[_0x2b4eb5(0x104)]&&!_0x591357[_0x2b4eb5(0x115)]&&!_0x591357['enriched'])return console[_0x2b4eb5(0x150)](a28_0x478b4a[_0x2b4eb5(0xe2)](_0x2b4eb5(0xcb))),console[_0x2b4eb5(0x150)](_0x2b4eb5(0x110)),console['error'](_0x2b4eb5(0x192)),console[_0x2b4eb5(0x150)](_0x2b4eb5(0x109)),console['error'](_0x2b4eb5(0x177)),console[_0x2b4eb5(0x150)]('\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior'),console['error'](_0x2b4eb5(0xc8)),0x1;const _0xd6dd21=resolveYamlFile(_0x1eff99);if(!existsSync(_0xd6dd21))return showFileNotFoundError(_0xd6dd21,_0x1eff99),0x1;_0x591357[_0x2b4eb5(0xdd)]&&(console['error']('Site:\x20'+_0x591357[_0x2b4eb5(0x147)]),console['error']('YAML\x20file:\x20'+_0xd6dd21));let _0x1641f7;try{_0x1641f7=readFileSync(_0xd6dd21,'utf-8');}catch(_0x54e5f2){const _0x9e8e23=_0x54e5f2 instanceof Error?_0x54e5f2[_0x2b4eb5(0x15d)]:String(_0x54e5f2);return console['error']('Error\x20reading\x20file:\x20'+_0x9e8e23),0x1;}let _0x4ca3d5;try{_0x4ca3d5=parseYamlString(_0x1641f7);}catch(_0x4985fe){const _0x5324f4=_0x4985fe instanceof Error?_0x4985fe[_0x2b4eb5(0x15d)]:String(_0x4985fe);return console[_0x2b4eb5(0x150)](a28_0x478b4a['red'](_0x2b4eb5(0x1e4)+_0x5324f4)),0x1;}if(_0x591357['attribute']===!![]||_0x591357[_0x2b4eb5(0x104)]===''){const _0x1bbbd3=_0x4ca3d5['attributes']?.[_0x2b4eb5(0x14c)](_0x22b8cb=>_0x22b8cb[_0x2b4eb5(0x1e8)])||[];if(_0x1bbbd3[_0x2b4eb5(0x137)]===0x0)console[_0x2b4eb5(0x150)](a28_0x478b4a[_0x2b4eb5(0xe2)]('Error:\x20No\x20attributes\x20defined\x20in\x20configuration'));else{console[_0x2b4eb5(0x150)](a28_0x478b4a['red'](_0x2b4eb5(0x1a0))),console[_0x2b4eb5(0x150)]('Available\x20attributes:');for(const _0x3e20ee of _0x1bbbd3){console[_0x2b4eb5(0x150)]('\x20\x20'+a28_0x478b4a[_0x2b4eb5(0xee)](_0x3e20ee));}console['error'](_0x2b4eb5(0xdb)+_0x1eff99+_0x2b4eb5(0x127)+_0x1bbbd3[0x0]+'\x22');}return 0x1;}if(_0x591357[_0x2b4eb5(0x115)]===!![]||_0x591357[_0x2b4eb5(0x115)]===''){const _0x4ebf18=_0x4ca3d5[_0x2b4eb5(0x1b7)]?.['map'](_0x3d43ef=>_0x3d43ef[_0x2b4eb5(0x1e8)])||[];if(_0x4ebf18[_0x2b4eb5(0x137)]===0x0)console[_0x2b4eb5(0x150)](a28_0x478b4a[_0x2b4eb5(0xe2)](_0x2b4eb5(0x126)));else{console[_0x2b4eb5(0x150)](a28_0x478b4a[_0x2b4eb5(0xe2)](_0x2b4eb5(0x1cf))),console[_0x2b4eb5(0x150)](_0x2b4eb5(0xda));for(const _0x5ea230 of _0x4ebf18){console[_0x2b4eb5(0x150)]('\x20\x20'+a28_0x478b4a[_0x2b4eb5(0xee)](_0x5ea230));}console[_0x2b4eb5(0x150)](_0x2b4eb5(0xdb)+_0x1eff99+_0x2b4eb5(0x174)+_0x4ebf18[0x0]+'\x22');}return 0x1;}const _0x29724b=createCommandSpinner(a28_0x478b4a[_0x2b4eb5(0x175)](_0x2b4eb5(0x1cb)),{'verbose':_0x591357[_0x2b4eb5(0xdd)]});_0x29724b[_0x2b4eb5(0x16a)]();const _0x3be1e5={'onProgress':_0x1a9597=>{const _0x3015c9=_0x2b4eb5;_0x29724b[_0x3015c9(0xf2)]=formatProgressMessage(_0x1a9597);}};if(_0x591357[_0x2b4eb5(0x13f)])_0x3be1e5[_0x2b4eb5(0x13f)]=!![];if(_0x591357[_0x2b4eb5(0x104)]&&typeof _0x591357[_0x2b4eb5(0x104)]==='string')_0x3be1e5[_0x2b4eb5(0x104)]=_0x591357[_0x2b4eb5(0x104)];if(_0x591357['behavior']&&typeof _0x591357['behavior']===_0x2b4eb5(0x173))_0x3be1e5[_0x2b4eb5(0x115)]=_0x591357[_0x2b4eb5(0x115)];if(_0x591357[_0x2b4eb5(0x11e)])_0x3be1e5[_0x2b4eb5(0x11e)]=!![];if(_0x591357[_0x2b4eb5(0xe7)])_0x3be1e5[_0x2b4eb5(0xe7)]=_0x591357[_0x2b4eb5(0xe7)];let _0x2e6e72;try{_0x2e6e72=await _0xc13dea['segment'][_0x2b4eb5(0x136)](_0x1641f7,_0x3be1e5),_0x29724b['stop']();}catch(_0x574ee3){_0x29724b[_0x2b4eb5(0x1a2)]();throw _0x574ee3;}return await this[_0x2b4eb5(0x1ac)](_0x2e6e72,{'master':_0x591357[_0x2b4eb5(0x13f)],'attribute':typeof _0x591357['attribute']===_0x2b4eb5(0x173)?_0x591357[_0x2b4eb5(0x104)]:undefined,'behavior':typeof _0x591357[_0x2b4eb5(0x115)]===_0x2b4eb5(0x173)?_0x591357['behavior']:undefined,'enriched':_0x591357[_0x2b4eb5(0x11e)]}),_0x2e6e72[_0x2b4eb5(0x103)]?0x0:0x1;}async['displayPreviewResults'](_0x503223,_0x1fb455){const _0x496f74=a28_0x169315;console[_0x496f74(0x150)]('\x0a'+a28_0x478b4a['bold'](_0x496f74(0x146))+'\x20'+_0x503223['name']),console['error']('═'[_0x496f74(0x105)](0x3c));if(_0x1fb455[_0x496f74(0x13f)]&&_0x503223[_0x496f74(0x14b)]){const _0x137c1e=a28_0x478b4a[_0x496f74(0x175)](_0x496f74(0xea))+'\x20'+a28_0x478b4a[_0x496f74(0x16f)](_0x503223[_0x496f74(0x13f)][_0x496f74(0x12e)]+'.'+_0x503223[_0x496f74(0x13f)]['table']);await this[_0x496f74(0xec)](_0x137c1e,_0x503223[_0x496f74(0x14b)]);}else{if(_0x1fb455[_0x496f74(0x104)]&&_0x503223[_0x496f74(0x14b)]){const _0x4a86c9=a28_0x478b4a[_0x496f74(0x175)](_0x496f74(0x10c))+'\x20'+a28_0x478b4a[_0x496f74(0x16f)](_0x1fb455[_0x496f74(0x104)]);await this['displaySampleData'](_0x4a86c9,_0x503223[_0x496f74(0x14b)]);}else{if(_0x1fb455[_0x496f74(0x115)]&&_0x503223[_0x496f74(0x14b)]){const _0x3f583a=a28_0x478b4a[_0x496f74(0x175)](_0x496f74(0x193))+'\x20'+a28_0x478b4a[_0x496f74(0x16f)](_0x1fb455['behavior']);await this[_0x496f74(0xec)](_0x3f583a,_0x503223['sampleData']);}else{if(_0x1fb455['enriched']&&_0x503223[_0x496f74(0x14b)]){const _0x1ab8e1=a28_0x478b4a[_0x496f74(0x175)](_0x496f74(0x162))+'\x20'+a28_0x478b4a[_0x496f74(0x16f)]('Master\x20+\x20Attributes');await this[_0x496f74(0xec)](_0x1ab8e1,_0x503223[_0x496f74(0x14b)]);}else!_0x503223[_0x496f74(0x14b)]&&console[_0x496f74(0x150)](_0x496f74(0x1c2));}}}if(_0x503223['errors'][_0x496f74(0x137)]>0x0){console[_0x496f74(0x150)]('─'[_0x496f74(0x105)](0x3c)),console['error']('\x0a'+a28_0x478b4a['red'](_0x496f74(0x11c)));for(const _0x3b6e3d of _0x503223[_0x496f74(0x19f)]){console['error']('\x20\x20'+a28_0x478b4a[_0x496f74(0xe2)]('•')+'\x20'+_0x3b6e3d);}}}async[a28_0x169315(0xec)](_0x3a0eaf,_0x2baed2){const _0x2c555d=a28_0x169315;if(_0x2baed2[_0x2c555d(0x137)]===0x0){console[_0x2c555d(0x150)]('\x0a'+_0x3a0eaf),console[_0x2c555d(0x150)](_0x2c555d(0x1a4));return;}console[_0x2c555d(0x150)]('\x0a'+_0x3a0eaf);const _0x30514e=Object[_0x2c555d(0x18c)](_0x2baed2[0x0])[_0x2c555d(0x14c)](_0x11c0f2=>({'name':_0x11c0f2,'type':typeof _0x2baed2[0x0][_0x11c0f2]===_0x2c555d(0x145)?_0x2c555d(0x1de):_0x2c555d(0x100)})),_0x5648a1={'queryId':_0x2c555d(0x1e2),'columns':_0x30514e,'data':_0x2baed2,'stats':{'state':'FINISHED','queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x2baed2[_0x2c555d(0x137)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x527c1c=formatAsTable(_0x5648a1,_0x2baed2[_0x2c555d(0x137)],!![]);await writeOutput(_0x527c1c,undefined,'table');}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a28_0x169315(0x1e8)]=a28_0x169315(0x189);[a28_0x169315(0x1c3)]=a28_0x169315(0x1ea);async['execute'](_0x30f477){const _0x261017=a28_0x169315,{options:_0x422f93,args:_0x2eba45,tdx:_0xc26d9c}=_0x30f477,_0x224051=_0x422f93,_0x389171=_0x2eba45[0x0]||_0x422f93[_0x261017(0x11d)];if(!_0x389171)return showParentSegmentNotSetError(_0x261017(0xd1)+_0x261017(0x113)),0x1;const _0x341e09=resolveYamlFile(_0x389171);if(existsSync(_0x341e09)){_0x224051[_0x261017(0xdd)]&&console[_0x261017(0x150)](_0x261017(0xd4)+_0x341e09);let _0x8af603;try{_0x8af603=readFileSync(_0x341e09,_0x261017(0xeb));}catch(_0x422401){const _0x3f82d5=_0x422401 instanceof Error?_0x422401['message']:String(_0x422401);return console[_0x261017(0x150)](_0x261017(0x152)+_0x3f82d5),0x1;}const _0x471872=await withSpinner('Analyzing\x20changes...',()=>_0xc26d9c[_0x261017(0x15b)][_0x261017(0x15a)](_0x8af603),{'verbose':_0x224051[_0x261017(0xdd)]}),_0xbfc3c2=_0x471872[_0x261017(0xcd)],{isNew:_0x4ef05c,name:_0x5eb0d7,hasChanges:_0x126f01,diffFormatted:_0x2db943}=_0xbfc3c2;if(_0x126f01){_0x4ef05c?console['error'](_0x261017(0x1c8)+_0x5eb0d7+'\x27:'):console[_0x261017(0x150)](_0x261017(0x119)+_0x5eb0d7+'\x27:');console[_0x261017(0x150)]('─'[_0x261017(0x105)](0x3c)),console['error'](_0x2db943),console['error']('─'[_0x261017(0x105)](0x3c));const _0x3fec20=_0x4ef05c?'Create\x20parent\x20segment\x20\x27'+_0x5eb0d7+_0x261017(0xd9):_0x261017(0x16b)+_0x5eb0d7+_0x261017(0xd9);if(!_0x224051[_0x261017(0x14a)]){const _0x3afcc8=await confirmKey(_0x3fec20);if(!_0x3afcc8)return console['error'](_0x261017(0x1c6)),0x1;}const _0x5ac4ea=_0x4ef05c?_0x261017(0xe4):_0x261017(0x153);await withSpinner(_0x5ac4ea+_0x261017(0x112)+_0x5eb0d7+_0x261017(0xd0),()=>_0xbfc3c2[_0x261017(0x12b)](),{'verbose':_0x224051['verbose']});const _0x15417d=_0x4ef05c?'Created':_0x261017(0x102);console[_0x261017(0x150)]('✔\x20'+_0x15417d+'\x20parent\x20segment\x20\x27'+_0x5eb0d7+'\x27');}else console[_0x261017(0x150)](_0x261017(0x1a5)+_0x5eb0d7+_0x261017(0x108));}const _0x7d48b8=await withSpinner(_0x261017(0x197)+_0x389171+_0x261017(0xd0),()=>_0xc26d9c[_0x261017(0x15b)][_0x261017(0x140)](_0x389171),{'verbose':_0x224051[_0x261017(0xdd)]}),_0xa6bd8c=_0x7d48b8[_0x261017(0xcd)],_0x121d7a=getConsoleUrl(_0x224051[_0x261017(0x147)],_0x261017(0x1bb)+_0xa6bd8c['workflowId']+_0x261017(0x143)+_0xa6bd8c['workflowSessionId']+'/attempt/'+_0xa6bd8c['workflowAttemptId']);return console[_0x261017(0x150)](_0x261017(0x16e)),console[_0x261017(0x150)]('\x20\x20'+a28_0x478b4a['dim']('Audience\x20ID:')+'\x20'+_0xa6bd8c[_0x261017(0x1e0)]),console[_0x261017(0x150)]('\x20\x20'+a28_0x478b4a['dim'](_0x261017(0x1b2))+'\x20'+_0xa6bd8c[_0x261017(0x15f)]),console['error']('\x20\x20'+a28_0x478b4a[_0x261017(0x175)](_0x261017(0x124))+'\x20'+_0xa6bd8c[_0x261017(0xdc)]),console[_0x261017(0x150)]('\x20\x20'+a28_0x478b4a['dim'](_0x261017(0x1ad))+'\x20'+_0xa6bd8c[_0x261017(0x156)]),console['error']('\x20\x20'+_0x121d7a),console[_0x261017(0x150)]('\x0a'+a28_0x478b4a[_0x261017(0x175)]('To\x20cancel:')+_0x261017(0x163)+_0xa6bd8c[_0x261017(0x156)]+_0x261017(0xc6)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a28_0x169315(0x1e8)]=a28_0x169315(0x155);['description']=a28_0x169315(0x18e);async[a28_0x169315(0x1aa)](_0x36dd1c){const _0x3a4754=a28_0x169315,{options:_0x288ec3,args:_0x2da82c,tdx:_0xe70573}=_0x36dd1c,_0x26a1ca=_0x2da82c[0x0]||_0x288ec3[_0x3a4754(0x11d)];if(!_0x26a1ca)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'+_0x3a4754(0x1e6)),0x1;_0x288ec3[_0x3a4754(0xdd)]&&(console['error'](_0x3a4754(0xf4)+_0x288ec3[_0x3a4754(0x147)]),console['error'](_0x3a4754(0xf7)+_0x26a1ca));const _0x45e0e3=await withSpinner(_0x3a4754(0x13b)+_0x26a1ca+'\x27...',()=>_0xe70573[_0x3a4754(0x15b)]['listFields'](_0x26a1ca),{'verbose':_0x288ec3[_0x3a4754(0xdd)]}),_0x5643e1=_0x45e0e3['data'];console[_0x3a4754(0x150)]('✔\x20Found\x20'+_0x5643e1[_0x3a4754(0x137)]+'\x20field'+(_0x5643e1[_0x3a4754(0x137)]!==0x1?'s':''));if(_0x288ec3['json']||_0x288ec3[_0x3a4754(0xe3)])return await handleSDKOutput(_0x5643e1,_0x288ec3),0x0;return displayFieldsHumanReadable(_0x5643e1,_0x26a1ca),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a28_0x169315(0x1e8)]=a28_0x169315(0x1b3);[a28_0x169315(0x1c3)]=a28_0x169315(0x116);async[a28_0x169315(0x1aa)](_0x4e47ab){const _0x4986bf=a28_0x169315,{options:_0x5cfab0,args:_0x173329,tdx:_0x186210}=_0x4e47ab,_0x544103=_0x5cfab0,_0x322d44=_0x173329[0x0]||_0x5cfab0['parentSegment'];if(!_0x322d44)return showParentSegmentNotSetError(_0x4986bf(0x187)+_0x4986bf(0xd6)+_0x4986bf(0x178)+_0x4986bf(0x18d)),0x1;_0x5cfab0[_0x4986bf(0xdd)]&&(console[_0x4986bf(0x150)](_0x4986bf(0xf4)+_0x5cfab0['site']),console[_0x4986bf(0x150)](_0x4986bf(0xf7)+_0x322d44));const _0x3a22d3=await withSpinner(_0x4986bf(0x10b)+_0x322d44+_0x4986bf(0xd0),()=>_0x186210[_0x4986bf(0x15b)][_0x4986bf(0x1c1)](_0x322d44),{'verbose':_0x5cfab0[_0x4986bf(0xdd)]}),_0x57c139=_0x3a22d3[_0x4986bf(0xcd)];if(_0x544103[_0x4986bf(0xe0)]){const _0x41e999=getConsoleNextUrl(_0x544103[_0x4986bf(0x147)],_0x4986bf(0x12f)+_0x57c139['id']);return console[_0x4986bf(0x150)](a28_0x478b4a['green']('✔')+_0x4986bf(0x168)+a28_0x478b4a[_0x4986bf(0xee)](_0x41e999)),openBrowser(_0x41e999),0x0;}return await handleSingleObjectOutput(_0x57c139,_0x5cfab0),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a28_0x169315(0x1e8)]=a28_0x169315(0x164);[a28_0x169315(0x1c3)]='Show\x20parent\x20segment\x20schema\x20(column\x20types)';async[a28_0x169315(0x1aa)](_0x51cca3){const _0x31db03=a28_0x169315,{options:_0x414edd,args:_0x2a29fd,tdx:_0x25b08e}=_0x51cca3,_0x40edfc=_0x2a29fd[0x0]||_0x414edd[_0x31db03(0x11d)];if(!_0x40edfc)return showParentSegmentNotSetError(_0x31db03(0x144)+_0x31db03(0x1e5)),0x1;_0x414edd[_0x31db03(0xdd)]&&(console[_0x31db03(0x150)](_0x31db03(0xf4)+_0x414edd['site']),console[_0x31db03(0x150)]('Parent\x20segment:\x20'+_0x40edfc));const _0x3a8fe0=await withSpinner(_0x31db03(0x11f)+_0x40edfc+'\x27...',()=>_0x25b08e['segment']['resolveParentId'](_0x40edfc),{'verbose':_0x414edd[_0x31db03(0xdd)]}),_0x1aca50=_0x3a8fe0[_0x31db03(0xcd)],_0x156f18=await withSpinner(_0x31db03(0xef)+_0x40edfc+'\x27...',()=>_0x25b08e[_0x31db03(0x15b)][_0x31db03(0x1db)](_0x1aca50),{'verbose':_0x414edd[_0x31db03(0xdd)]}),_0x24eb49=await executeSchemaQuery(_0x156f18[_0x31db03(0xcd)],_0x25b08e,_0x414edd);return await handleQueryOutput(_0x24eb49,_0x414edd),0x0;}}export class ParentSegmentSQLCommand extends BaseCommand{[a28_0x169315(0x1e8)]=a28_0x169315(0x179);[a28_0x169315(0x1c3)]=a28_0x169315(0x11b);async[a28_0x169315(0x1aa)](_0x39bceb){const _0x26435d=a28_0x169315,{options:_0x2b0bb1,args:_0xbd1dfe,tdx:_0x5180b7}=_0x39bceb,_0x34bfd7=_0xbd1dfe[0x0]||_0x2b0bb1[_0x26435d(0x11d)];if(!_0x34bfd7)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a'+_0x26435d(0x15c)),0x1;_0x2b0bb1['verbose']&&(console[_0x26435d(0x150)](_0x26435d(0xf4)+_0x2b0bb1[_0x26435d(0x147)]),console[_0x26435d(0x150)]('Parent\x20segment:\x20'+_0x34bfd7));const _0x573909=await withSpinner(_0x26435d(0x11f)+_0x34bfd7+_0x26435d(0xd0),()=>_0x5180b7[_0x26435d(0x15b)][_0x26435d(0x1af)](_0x34bfd7),{'verbose':_0x2b0bb1[_0x26435d(0xdd)]}),_0x31bc6c=_0x573909[_0x26435d(0xcd)],_0x1a7a30=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x34bfd7+'\x27...',()=>_0x5180b7['segment'][_0x26435d(0x1db)](_0x31bc6c),{'verbose':_0x2b0bb1[_0x26435d(0xdd)]}),_0x46898b=_0x1a7a30[_0x26435d(0xcd)];return _0x2b0bb1[_0x26435d(0x141)]===_0x26435d(0xe5)||_0x2b0bb1[_0x26435d(0x141)]===_0x26435d(0xe3)?await handleSDKOutput([{'sql':_0x46898b}],_0x2b0bb1):console[_0x26435d(0x1d1)](_0x46898b),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a28_0x169315(0x1e8)]=a28_0x169315(0x1da);['description']=a28_0x169315(0xf0);async[a28_0x169315(0x1aa)](_0x548c1f){const _0x26167f=a28_0x169315,{options:_0xd798a,args:_0x10629d,tdx:_0x3147ae}=_0x548c1f,_0x21c1bd=_0x10629d[0x0]||_0xd798a[_0x26167f(0x11d)];if(!_0x21c1bd)return showParentSegmentNotSetError(_0x26167f(0x114)+_0x26167f(0xc5)),0x1;_0xd798a[_0x26167f(0xdd)]&&(console[_0x26167f(0x150)](_0x26167f(0xf4)+_0xd798a['site']),console['error']('Parent\x20segment:\x20'+_0x21c1bd));const _0xb284bd=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x21c1bd+'\x27...',()=>_0x3147ae[_0x26167f(0x15b)]['resolveParentId'](_0x21c1bd),{'verbose':_0xd798a[_0x26167f(0xdd)]}),_0x4c8abd=_0xb284bd[_0x26167f(0xcd)],_0x4e55df=await withSpinner(_0x26167f(0xef)+_0x21c1bd+'\x27...',()=>_0x3147ae[_0x26167f(0x15b)][_0x26167f(0x1db)](_0x4c8abd),{'verbose':_0xd798a[_0x26167f(0xdd)]});let _0x5341dd=_0x4e55df[_0x26167f(0xcd)];const _0x4511b7=resolveLimit(_0xd798a[_0x26167f(0x13e)],DEFAULT_DISPLAY_LIMIT),_0xe58f1b=/\bLIMIT\s+\d+/i[_0x26167f(0x17a)](_0x5341dd);!_0xe58f1b&&(_0x5341dd=_0x5341dd['trim']()['replace'](/;+$/,''),_0x5341dd=_0x26167f(0x17f)+_0x5341dd+_0x26167f(0x117)+_0x4511b7);_0xd798a[_0x26167f(0xdd)]&&console[_0x26167f(0x150)](_0x26167f(0xc2)+_0x5341dd);const _0x18dd01=await withQuerySpinner('Executing\x20parent\x20segment\x20query...',async _0x1c113b=>{const _0x85fb81=_0x26167f,_0x3b5c69=await _0x3147ae['query'][_0x85fb81(0x1aa)](_0x5341dd,{'catalog':'td','schema':_0x85fb81(0x181),'onJobId':_0x2a802f=>{const _0x2b7237=_0x85fb81;_0x1c113b[_0x2b7237(0x1d2)](_0x2a802f);}});return _0x3b5c69;},{'verbose':_0xd798a['verbose']}),_0x4d5af4=_0x18dd01[_0x26167f(0xcd)],_0x1cdae1=_0x4d5af4[_0x26167f(0x132)]?_0x26167f(0x19c)+_0x4d5af4[_0x26167f(0x132)]+']':'';return console[_0x26167f(0x150)]('✔\x20Query\x20completed:\x20Processed\x20'+_0x4d5af4['stats']['processedRows'][_0x26167f(0x1ae)]()+_0x26167f(0x1bf)+(_0x26167f(0x1a7)+formatElapsed(_0x4d5af4['stats'][_0x26167f(0x10e)])+_0x1cdae1)),await handleQueryOutput(_0x4d5af4,_0xd798a),0x0;}}
@@ -1 +1 @@
1
- const a29_0x3a2f31=a29_0x37de;(function(_0x643671,_0x533841){const _0x550e77=a29_0x37de,_0x114a28=_0x643671();while(!![]){try{const _0x422c70=parseInt(_0x550e77(0x1c1))/0x1+parseInt(_0x550e77(0x1cb))/0x2+parseInt(_0x550e77(0x1bf))/0x3*(-parseInt(_0x550e77(0x1c3))/0x4)+parseInt(_0x550e77(0x1d4))/0x5*(parseInt(_0x550e77(0x1c8))/0x6)+-parseInt(_0x550e77(0x1ce))/0x7*(parseInt(_0x550e77(0x1cd))/0x8)+-parseInt(_0x550e77(0x1bc))/0x9*(parseInt(_0x550e77(0x1c7))/0xa)+parseInt(_0x550e77(0x1be))/0xb;if(_0x422c70===_0x533841)break;else _0x114a28['push'](_0x114a28['shift']());}catch(_0x515e27){_0x114a28['push'](_0x114a28['shift']());}}}(a29_0x26a8,0xf10f5));import{BaseCommand}from'./command.js';function a29_0x37de(_0x328a83,_0x46c480){_0x328a83=_0x328a83-0x1bc;const _0x26a894=a29_0x26a8();let _0x37debc=_0x26a894[_0x328a83];return _0x37debc;}import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';import{handleSDKOutput}from'../utils/command-output.js';export class ProfilesCommand extends BaseCommand{[a29_0x3a2f31(0x1bd)]=a29_0x3a2f31(0x1d3);[a29_0x3a2f31(0x1c6)]=a29_0x3a2f31(0x1d0);async[a29_0x3a2f31(0x1c5)](_0x4f39ee){const _0x5cf4fc=a29_0x3a2f31,{options:_0xa4278f}=_0x4f39ee;try{const _0x5b741e=listProfiles(),_0x5be5d8=getActiveProfile();if(_0x5b741e[_0x5cf4fc(0x1ca)]===0x0)return console[_0x5cf4fc(0x1c0)]('No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a'),console[_0x5cf4fc(0x1c0)](_0x5cf4fc(0x1d1)),console[_0x5cf4fc(0x1c0)]('\x20\x20Global:\x20~/.config/tdx/tdx.json'),0x0;const _0x348ac7=_0x5b741e[_0x5cf4fc(0x1c9)](_0x157d2d=>{const _0x5e1921=_0x5cf4fc,_0x4498fa=_0x157d2d[_0x5e1921(0x1bd)]===_0x5be5d8,_0x32a910=getProfileParams(_0x157d2d['config']);return{'name':_0x157d2d[_0x5e1921(0x1bd)],'active':_0x4498fa,'scope':_0x157d2d[_0x5e1921(0x1c4)],'description':_0x157d2d[_0x5e1921(0x1d2)]['description']||'','params':_0x32a910};});return await handleSDKOutput(_0x348ac7,_0xa4278f),0x0;}catch(_0x5583ea){return _0x5583ea instanceof Error&&console[_0x5cf4fc(0x1cc)](_0x5cf4fc(0x1c2)+_0x5583ea[_0x5cf4fc(0x1cf)]),0x1;}}}function a29_0x26a8(){const _0x4d610e=['651971mBGuYj','Error:\x20','56pvYOJy','scope','execute','description','2890HcdZgR','6CDUCmh','map','length','606774YOxOXf','error','40HAmauT','1597757rOZpxf','message','List\x20all\x20available\x20profiles','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','config','profiles','4145565yaLKVx','21582iZprVR','name','29318333doCPVf','348882LOuqgu','log'];a29_0x26a8=function(){return _0x4d610e;};return a29_0x26a8();}
1
+ const a29_0x47310a=a29_0x310b;(function(_0x53ac54,_0x5d308a){const _0x8a6c7d=a29_0x310b,_0x2f07f7=_0x53ac54();while(!![]){try{const _0x3254dc=-parseInt(_0x8a6c7d(0x1fb))/0x1*(-parseInt(_0x8a6c7d(0x1ed))/0x2)+parseInt(_0x8a6c7d(0x1f0))/0x3*(-parseInt(_0x8a6c7d(0x1fd))/0x4)+parseInt(_0x8a6c7d(0x1e9))/0x5+-parseInt(_0x8a6c7d(0x1e7))/0x6*(parseInt(_0x8a6c7d(0x1e5))/0x7)+parseInt(_0x8a6c7d(0x1ee))/0x8+-parseInt(_0x8a6c7d(0x1e4))/0x9*(parseInt(_0x8a6c7d(0x1f5))/0xa)+-parseInt(_0x8a6c7d(0x1f2))/0xb*(parseInt(_0x8a6c7d(0x1f8))/0xc);if(_0x3254dc===_0x5d308a)break;else _0x2f07f7['push'](_0x2f07f7['shift']());}catch(_0x404027){_0x2f07f7['push'](_0x2f07f7['shift']());}}}(a29_0x282c,0x7d420));function a29_0x282c(){const _0x4a57ac=['1kIJXUP','error','2906156ejvGLz','profiles','755127XzURdk','14YbBdCr','config','694104QACBuz','log','2096335OlMztr','length','\x20\x20Global:\x20~/.config/tdx/tdx.json','description','2030998WfCyZw','5083712GTPiaY','No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a','3JzgyuZ','execute','11gDKnvj','map','name','30skeaGh','message','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','4170696murYXM','scope','Error:\x20'];a29_0x282c=function(){return _0x4a57ac;};return a29_0x282c();}function a29_0x310b(_0x5d7d13,_0x3bcbc5){_0x5d7d13=_0x5d7d13-0x1e3;const _0x282cfc=a29_0x282c();let _0x310b92=_0x282cfc[_0x5d7d13];return _0x310b92;}import{BaseCommand}from'./command.js';import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';import{handleSDKOutput}from'../utils/command-output.js';export class ProfilesCommand extends BaseCommand{['name']=a29_0x47310a(0x1e3);['description']='List\x20all\x20available\x20profiles';async[a29_0x47310a(0x1f1)](_0x403674){const _0x3e8adf=a29_0x47310a,{options:_0x33038b}=_0x403674;try{const _0x4f0102=listProfiles(),_0x24deaf=getActiveProfile();if(_0x4f0102[_0x3e8adf(0x1ea)]===0x0)return console[_0x3e8adf(0x1e8)](_0x3e8adf(0x1ef)),console['log'](_0x3e8adf(0x1f7)),console['log'](_0x3e8adf(0x1eb)),0x0;const _0x2990bd=_0x4f0102[_0x3e8adf(0x1f3)](_0x13ce1e=>{const _0x4b91b9=_0x3e8adf,_0x3d8f97=_0x13ce1e[_0x4b91b9(0x1f4)]===_0x24deaf,_0x3f351d=getProfileParams(_0x13ce1e[_0x4b91b9(0x1e6)]);return{'name':_0x13ce1e[_0x4b91b9(0x1f4)],'active':_0x3d8f97,'scope':_0x13ce1e[_0x4b91b9(0x1f9)],'description':_0x13ce1e[_0x4b91b9(0x1e6)][_0x4b91b9(0x1ec)]||'','params':_0x3f351d};});return await handleSDKOutput(_0x2990bd,_0x33038b),0x0;}catch(_0x309fbc){return _0x309fbc instanceof Error&&console[_0x3e8adf(0x1fc)](_0x3e8adf(0x1fa)+_0x309fbc[_0x3e8adf(0x1f6)]),0x1;}}}
@@ -1 +1 @@
1
- const a30_0x945c91=a30_0x3f0d;function a30_0x2c06(){const _0xddbee=['site','file','1ePGvbR','stats','1980350LKDVia','...','Executing\x20query...','Statement\x20','setPhase','1642497bnhAYb','19689527tXUryT','207OUHoPU','verbose','processedRows','push','SQL:\x20','\x20splits','message','jobId','\x20[Job\x20ID:\x20','1779040HklLuf','database','information_schema','3923500EQMmkl','Executing\x20statement\x20','catalog','No\x20SQL\x20provided','length','elapsedTimeMillis','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','query','Site:\x20','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','name','Schema:\x20','161144XTKPpB','\x20rows\x20','173828JbWAhP','state','error','originalMessage','data','output','Error:\x20','totalSplits','6FRugXk','Run\x20Trino\x20queries\x20(streaming)','in\x20','\x0aAll\x20results\x20saved\x20to\x20','setJobId','4ZgtIsS','execute','completedSplits','\x20-\x20','Executing\x20query\x20['];a30_0x2c06=function(){return _0xddbee;};return a30_0x2c06();}(function(_0x182e8f,_0x4aae01){const _0x12c15a=a30_0x3f0d,_0x465e22=_0x182e8f();while(!![]){try{const _0x44b7a0=-parseInt(_0x12c15a(0x122))/0x1*(parseInt(_0x12c15a(0x10e))/0x2)+-parseInt(_0x12c15a(0x129))/0x3*(parseInt(_0x12c15a(0x11b))/0x4)+-parseInt(_0x12c15a(0x134))/0x5*(-parseInt(_0x12c15a(0x116))/0x6)+-parseInt(_0x12c15a(0x137))/0x7+-parseInt(_0x12c15a(0x10c))/0x8*(parseInt(_0x12c15a(0x12b))/0x9)+-parseInt(_0x12c15a(0x124))/0xa+parseInt(_0x12c15a(0x12a))/0xb;if(_0x44b7a0===_0x4aae01)break;else _0x465e22['push'](_0x465e22['shift']());}catch(_0x33d7d0){_0x465e22['push'](_0x465e22['shift']());}}}(a30_0x2c06,0x46af8));import{BaseCommand}from'./command.js';function a30_0x3f0d(_0x9fa451,_0x58f778){_0x9fa451=_0x9fa451-0x109;const _0x2c06f2=a30_0x2c06();let _0x3f0d7c=_0x2c06f2[_0x9fa451];return _0x3f0d7c;}import{SDKError}from'../sdk/index.js';import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../utils/command-output.js';import{readSqlStatementsFromFile,readSqlStatementsFromStdin,splitSqlStatements,isSqlFilePath}from'../utils/sql-parser.js';import{writeFileSync}from'fs';import{withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{formatRows}from'../utils/formatters.js';export class QueryCommand extends BaseCommand{[a30_0x945c91(0x10a)]=a30_0x945c91(0x13e);['description']=a30_0x945c91(0x117);async[a30_0x945c91(0x11c)](_0x4bc8fd){const _0x4d1714=a30_0x945c91,{options:_0x6ecbda,args:_0x4e1b46,tdx:_0x584ee8}=_0x4bc8fd,_0x53121b=_0x4e1b46[0x0],_0x4560bb=_0x6ecbda[_0x4d1714(0x121)];let _0x2743db;try{if(_0x4560bb)_0x2743db=readSqlStatementsFromFile(_0x4560bb);else{if(_0x53121b==='-')_0x2743db=await readSqlStatementsFromStdin();else{if(_0x53121b&&isSqlFilePath(_0x53121b))_0x2743db=readSqlStatementsFromFile(_0x53121b);else{if(_0x53121b)_0x2743db=splitSqlStatements(_0x53121b);else throw new Error(_0x4d1714(0x13a));}}}}catch(_0xebf7d0){return console['error'](_0x4d1714(0x114)+_0xebf7d0['message']),0x1;}const _0x7d2a55=_0x6ecbda[_0x4d1714(0x135)]||_0x4d1714(0x136),_0x96353a=_0x6ecbda[_0x4d1714(0x139)];try{const _0x2e9a29=[],_0x1fe82a=!!_0x6ecbda[_0x4d1714(0x113)];for(let _0x1d0777=0x0;_0x1d0777<_0x2743db['length'];_0x1d0777++){const _0x17b3eb=_0x2743db[_0x1d0777],_0x1d2f09=_0x1d0777+0x1,_0xb3bdf1=_0x2743db['length'],_0x81076c=_0xb3bdf1>0x1;_0x6ecbda[_0x4d1714(0x12c)]&&(console[_0x4d1714(0x110)]('\x0a'+(_0x81076c?_0x4d1714(0x127)+_0x1d2f09+'/'+_0xb3bdf1+':':'')),console[_0x4d1714(0x110)](_0x4d1714(0x13f)+_0x6ecbda[_0x4d1714(0x120)]),console[_0x4d1714(0x110)]('Catalog:\x20'+(_0x96353a||'td')),console[_0x4d1714(0x110)](_0x4d1714(0x10b)+_0x7d2a55),console[_0x4d1714(0x110)](_0x4d1714(0x12f)+_0x17b3eb));const _0x132ff8=_0x81076c?_0x4d1714(0x138)+_0x1d2f09+'/'+_0xb3bdf1+_0x4d1714(0x125):_0x4d1714(0x126);try{const _0x12af3e=await withQuerySpinner(_0x132ff8,async _0x136f2c=>{const _0x5e8cf4=_0x4d1714,_0x15595f=await _0x584ee8[_0x5e8cf4(0x13e)][_0x5e8cf4(0x11c)](_0x17b3eb,{'catalog':_0x96353a,'schema':_0x7d2a55,'onJobId':_0x1fef2c=>{const _0x78c683=_0x5e8cf4;_0x136f2c[_0x78c683(0x11a)](_0x1fef2c);},'onProgress':_0x58b495=>{const _0x18aa79=_0x5e8cf4;_0x136f2c[_0x18aa79(0x128)](_0x18aa79(0x11f)+_0x58b495[_0x18aa79(0x10f)]+']'),_0x136f2c['setExtra'](formatRows(_0x58b495[_0x18aa79(0x12d)])+'\x20rows\x20'+_0x58b495[_0x18aa79(0x11d)]+'/'+_0x58b495[_0x18aa79(0x115)]+_0x18aa79(0x130));}});return _0x15595f;},{'verbose':_0x6ecbda['verbose']}),_0x14ae86=_0x12af3e[_0x4d1714(0x112)],_0x1eb4f8=_0x14ae86[_0x4d1714(0x132)]?_0x4d1714(0x133)+_0x14ae86[_0x4d1714(0x132)]+']':'',_0x5eff8c=_0x81076c?_0x4d1714(0x127)+_0x1d2f09+'/'+_0xb3bdf1+_0x4d1714(0x11e):'';console[_0x4d1714(0x110)]('✔\x20'+_0x5eff8c+'Query\x20completed:\x20Processed\x20'+formatRows(_0x14ae86[_0x4d1714(0x123)][_0x4d1714(0x12d)])+_0x4d1714(0x10d)+(_0x4d1714(0x118)+formatElapsed(_0x14ae86[_0x4d1714(0x123)][_0x4d1714(0x13c)])+_0x1eb4f8));if(_0x81076c&&_0x1fe82a){const _0x40fb08=resolveOutputOptions(_0x6ecbda),_0x59c809=await formatQueryOutput(_0x14ae86,_0x40fb08);_0x2e9a29[_0x4d1714(0x12e)](_0x59c809);}else await handleQueryOutput(_0x14ae86,_0x6ecbda);}catch(_0x382f8d){const _0x290ddd=_0x81076c?_0x4d1714(0x127)+_0x1d2f09+'/'+_0xb3bdf1+':\x0a':'',_0x39668d=_0x382f8d instanceof SDKError?_0x382f8d[_0x4d1714(0x111)]:_0x382f8d[_0x4d1714(0x131)];return console[_0x4d1714(0x110)](''+_0x290ddd+_0x39668d),0x1;}}if(_0x2743db[_0x4d1714(0x13b)]>0x1&&_0x1fe82a&&_0x2e9a29[_0x4d1714(0x13b)]>0x0){const _0x1e5db3=_0x2e9a29['join']('\x0a');writeFileSync(_0x6ecbda[_0x4d1714(0x113)],_0x1e5db3),console[_0x4d1714(0x110)](_0x4d1714(0x119)+_0x6ecbda[_0x4d1714(0x113)]);}return 0x0;}catch(_0x1d2106){throw _0x1d2106;}}['validate'](_0x3d295a){const _0x25b45e=a30_0x945c91,_0x969c9f=_0x3d295a['args'][0x0],_0x4e3cd8=_0x3d295a['options'][_0x25b45e(0x121)];if(!_0x969c9f&&!_0x4e3cd8)return _0x25b45e(0x13d);if(_0x969c9f&&_0x4e3cd8)return _0x25b45e(0x109);return undefined;}}
1
+ function a30_0x2734(_0xf5f708,_0x6d3255){_0xf5f708=_0xf5f708-0x1bc;const _0x5bf942=a30_0x5bf9();let _0x2734fa=_0x5bf942[_0xf5f708];return _0x2734fa;}const a30_0xf57f76=a30_0x2734;(function(_0x340a83,_0x11a569){const _0x2bb98d=a30_0x2734,_0x4a7485=_0x340a83();while(!![]){try{const _0x2d60be=-parseInt(_0x2bb98d(0x1e4))/0x1*(-parseInt(_0x2bb98d(0x1c2))/0x2)+parseInt(_0x2bb98d(0x1dc))/0x3*(-parseInt(_0x2bb98d(0x1d8))/0x4)+parseInt(_0x2bb98d(0x1be))/0x5*(-parseInt(_0x2bb98d(0x1bc))/0x6)+-parseInt(_0x2bb98d(0x1e1))/0x7*(parseInt(_0x2bb98d(0x1f1))/0x8)+-parseInt(_0x2bb98d(0x1d1))/0x9*(parseInt(_0x2bb98d(0x1e7))/0xa)+-parseInt(_0x2bb98d(0x1ed))/0xb+parseInt(_0x2bb98d(0x1c8))/0xc;if(_0x2d60be===_0x11a569)break;else _0x4a7485['push'](_0x4a7485['shift']());}catch(_0x4155d1){_0x4a7485['push'](_0x4a7485['shift']());}}}(a30_0x5bf9,0x2b4b9));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a30_0x5bf9(){const _0x2ed428=['execute','verbose','99lSydSN','Schema:\x20','\x20[Job\x20ID:\x20','push','\x20rows\x20','error','No\x20SQL\x20provided','4HQwxXW','validate','site','completedSplits','469401ZikfCP','stats','\x0aAll\x20results\x20saved\x20to\x20','processedRows','originalMessage','91XPByIT','SQL:\x20','join','11pziArL','database','Run\x20Trino\x20queries\x20(streaming)','128560IdRkHD','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','in\x20','elapsedTimeMillis','state','Executing\x20query\x20[','1726857zAZjHl','data','setJobId','query','16120UxcYul','Executing\x20query...','length','26496NqjRIP','\x20-\x20','255xddLxK','catalog','Statement\x20','message','62216dHxHzC','setPhase','totalSplits','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','jobId','options','6497160wvPNVT','file','information_schema','output','Executing\x20statement\x20','Site:\x20','Query\x20completed:\x20Processed\x20'];a30_0x5bf9=function(){return _0x2ed428;};return a30_0x5bf9();}import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../utils/command-output.js';import{readSqlStatementsFromFile,readSqlStatementsFromStdin,splitSqlStatements,isSqlFilePath}from'../utils/sql-parser.js';import{writeFileSync}from'fs';import{withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{formatRows}from'../utils/formatters.js';export class QueryCommand extends BaseCommand{['name']=a30_0xf57f76(0x1f0);['description']=a30_0xf57f76(0x1e6);async[a30_0xf57f76(0x1cf)](_0x442bf8){const _0x469190=a30_0xf57f76,{options:_0x5944e0,args:_0x1a5afe,tdx:_0x50b8f7}=_0x442bf8,_0x2426c5=_0x1a5afe[0x0],_0x4a1155=_0x5944e0['file'];let _0x246b05;try{if(_0x4a1155)_0x246b05=readSqlStatementsFromFile(_0x4a1155);else{if(_0x2426c5==='-')_0x246b05=await readSqlStatementsFromStdin();else{if(_0x2426c5&&isSqlFilePath(_0x2426c5))_0x246b05=readSqlStatementsFromFile(_0x2426c5);else{if(_0x2426c5)_0x246b05=splitSqlStatements(_0x2426c5);else throw new Error(_0x469190(0x1d7));}}}}catch(_0x4af56b){return console[_0x469190(0x1d6)]('Error:\x20'+_0x4af56b[_0x469190(0x1c1)]),0x1;}const _0x58188a=_0x5944e0[_0x469190(0x1e5)]||_0x469190(0x1ca),_0x5e6d17=_0x5944e0[_0x469190(0x1bf)];try{const _0x241354=[],_0x4b3b7a=!!_0x5944e0[_0x469190(0x1cb)];for(let _0x52a967=0x0;_0x52a967<_0x246b05[_0x469190(0x1f3)];_0x52a967++){const _0x472264=_0x246b05[_0x52a967],_0x20c41f=_0x52a967+0x1,_0x413602=_0x246b05[_0x469190(0x1f3)],_0x2ff95a=_0x413602>0x1;_0x5944e0[_0x469190(0x1d0)]&&(console[_0x469190(0x1d6)]('\x0a'+(_0x2ff95a?_0x469190(0x1c0)+_0x20c41f+'/'+_0x413602+':':'')),console[_0x469190(0x1d6)](_0x469190(0x1cd)+_0x5944e0[_0x469190(0x1da)]),console[_0x469190(0x1d6)]('Catalog:\x20'+(_0x5e6d17||'td')),console['error'](_0x469190(0x1d2)+_0x58188a),console['error'](_0x469190(0x1e2)+_0x472264));const _0x558d65=_0x2ff95a?_0x469190(0x1cc)+_0x20c41f+'/'+_0x413602+'...':_0x469190(0x1f2);try{const _0x1af471=await withQuerySpinner(_0x558d65,async _0x13d96e=>{const _0xed5656=_0x469190,_0x4e064c=await _0x50b8f7[_0xed5656(0x1f0)]['execute'](_0x472264,{'catalog':_0x5e6d17,'schema':_0x58188a,'onJobId':_0xf0e8d2=>{const _0x50969c=_0xed5656;_0x13d96e[_0x50969c(0x1ef)](_0xf0e8d2);},'onProgress':_0x14f113=>{const _0x483df1=_0xed5656;_0x13d96e[_0x483df1(0x1c3)](_0x483df1(0x1ec)+_0x14f113[_0x483df1(0x1eb)]+']'),_0x13d96e['setExtra'](formatRows(_0x14f113['processedRows'])+_0x483df1(0x1d5)+_0x14f113[_0x483df1(0x1db)]+'/'+_0x14f113[_0x483df1(0x1c4)]+'\x20splits');}});return _0x4e064c;},{'verbose':_0x5944e0[_0x469190(0x1d0)]}),_0x44f180=_0x1af471[_0x469190(0x1ee)],_0x58bdcf=_0x44f180[_0x469190(0x1c6)]?_0x469190(0x1d3)+_0x44f180[_0x469190(0x1c6)]+']':'',_0x34d5e9=_0x2ff95a?_0x469190(0x1c0)+_0x20c41f+'/'+_0x413602+_0x469190(0x1bd):'';console[_0x469190(0x1d6)]('✔\x20'+_0x34d5e9+_0x469190(0x1ce)+formatRows(_0x44f180[_0x469190(0x1dd)][_0x469190(0x1df)])+_0x469190(0x1d5)+(_0x469190(0x1e9)+formatElapsed(_0x44f180[_0x469190(0x1dd)][_0x469190(0x1ea)])+_0x58bdcf));if(_0x2ff95a&&_0x4b3b7a){const _0x214036=resolveOutputOptions(_0x5944e0),_0x40907d=await formatQueryOutput(_0x44f180,_0x214036);_0x241354[_0x469190(0x1d4)](_0x40907d);}else await handleQueryOutput(_0x44f180,_0x5944e0);}catch(_0x54edc8){const _0x2d18ca=_0x2ff95a?'Statement\x20'+_0x20c41f+'/'+_0x413602+':\x0a':'',_0x220637=_0x54edc8 instanceof SDKError?_0x54edc8[_0x469190(0x1e0)]:_0x54edc8['message'];return console['error'](''+_0x2d18ca+_0x220637),0x1;}}if(_0x246b05[_0x469190(0x1f3)]>0x1&&_0x4b3b7a&&_0x241354[_0x469190(0x1f3)]>0x0){const _0xd2df7=_0x241354[_0x469190(0x1e3)]('\x0a');writeFileSync(_0x5944e0['output'],_0xd2df7),console[_0x469190(0x1d6)](_0x469190(0x1de)+_0x5944e0[_0x469190(0x1cb)]);}return 0x0;}catch(_0x2bed7b){throw _0x2bed7b;}}[a30_0xf57f76(0x1d9)](_0x1b044f){const _0x286d3b=a30_0xf57f76,_0x5a755e=_0x1b044f['args'][0x0],_0x357454=_0x1b044f[_0x286d3b(0x1c7)][_0x286d3b(0x1c9)];if(!_0x5a755e&&!_0x357454)return _0x286d3b(0x1c5);if(_0x5a755e&&_0x357454)return _0x286d3b(0x1e8);return undefined;}}
@@ -1 +1 @@
1
- const a31_0x11eeb9=a31_0x526b;(function(_0x554071,_0x40f94d){const _0x372216=a31_0x526b,_0x1084ab=_0x554071();while(!![]){try{const _0x20e8bf=-parseInt(_0x372216(0x1bd))/0x1+-parseInt(_0x372216(0x1fa))/0x2+-parseInt(_0x372216(0x1eb))/0x3+-parseInt(_0x372216(0x1d9))/0x4*(parseInt(_0x372216(0x1ad))/0x5)+parseInt(_0x372216(0x1c8))/0x6+-parseInt(_0x372216(0x1c1))/0x7*(-parseInt(_0x372216(0x1cb))/0x8)+-parseInt(_0x372216(0x1f4))/0x9*(-parseInt(_0x372216(0x1cf))/0xa);if(_0x20e8bf===_0x40f94d)break;else _0x1084ab['push'](_0x1084ab['shift']());}catch(_0x555562){_0x1084ab['push'](_0x1084ab['shift']());}}}(a31_0x7f3f,0x1f347));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../utils/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';function a31_0x7f3f(){const _0x117e22=['getFolder','Fetching\x20folder\x20details...','/app/ps/','data','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','trim','parentSegment','Target\x20path:\x20','Error:\x20Folder\x20reference\x20is\x20required','folderId','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','Executing\x20segment\x20query...','28840VTLWek','/e/','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','Resolved\x20parent\x20folder\x20ID:\x20','folderPath','resolveFolderId','Use:\x20tdx\x20ps\x20desc','type','createFolder','SELECT\x20*\x20FROM\x20(\x0a','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','Error:\x20Parent\x20segment\x20name\x20is\x20required','SEGMENT_FOLDER_NOT_FOUND','254774CFwnQC','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','Site:\x20','getSegment','41594WHGOGK','Folder\x20ID:\x20','Show\x20segment\x20or\x20folder\x20details','Show\x20segment\x20folder\x20details','(root)','Error:\x20Path\x20or\x20name\x20is\x20required','Resolved\x20relative\x20path\x20to:\x20','756096zqFzWx','Segment\x20ID:\x20','error','8IFOZTL','setJobId','cyan','Folder\x20ID\x20missing\x20from\x20resolved\x20path','203730jcbxni','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','Use:\x20tdx\x20ps\x20view\x20-w','Use:\x20tdx\x20ps\x20sql','Parent\x20ID:\x20','Resolved\x20parent\x20ID:\x20','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','description','jsonl','172xzbVyk','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','getParent','elapsedTimeMillis','limit','verbose','execute','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','✖\x20Query\x20failed\x20[','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Resolving\x20parent\x20segment\x20\x27','Fetching\x20SQL\x20for\x20segment...','Examples:','cause','json','folder','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','167355ZMRnlV','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','Fetching\x20parent\x20segment\x20details...','\x27...','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Resolved\x20YAML\x20file:\x20','\x20\x20Full\x20path:\x20','segment:folder:list','279JPxZwz','site','\x20rows\x20','name','segment:sql','stats','154246EQxerc','SEGMENT_NOT_FOUND','INVALID_ARGUMENT','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Parent\x20segment:\x20','Resolved\x20folder\x20ID:\x20','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Usage:\x20tdx\x20sg\x20desc\x20<name>','fullPath','Show\x20child\x20segment\x20schema\x20(column\x20types)','resolveParentId','Resolving\x20parent\x20folder\x20\x27','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','Usage:\x20tdx\x20segment\x20describe\x20<path>','\x20\x20Folder\x20path:\x20','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','Resolving\x20\x27','url','Usage:\x20tdx\x20sg\x20show\x20<name>','segment:folder:create','toLocaleString','test','length','\x20[Job\x20ID:\x20','getSegmentSQL','message','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','in\x20','segmentName','format','parentId','Fetching\x20segment\x20details...','segment:view','segmentId','\x20Opening\x20','code','✔\x20Found\x20','SQL\x20query:\x0a','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','\x20\x20Segment\x20name:\x20','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','Resolved\x20type:\x20','web','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','query','\x20\x20Cause:\x20','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','replace','processedRows','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','resolvePathToResource','jobId','Use:\x20tdx\x20ps\x20show','parent','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Use:\x20tdx\x20ps\x20view','segment:describe','segment','Resolving\x20folder\x20\x27','Error:\x20','Folder\x20name:\x20'];a31_0x7f3f=function(){return _0x117e22;};return a31_0x7f3f();}import{executeSchemaQuery}from'../utils/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../utils/segment-path-parser.js';import{getConsoleNextUrl}from'../types/endpoints.js';import{openBrowser}from'../utils/process.js';import a31_0xf75273 from'chalk';function resolveSegmentTarget(_0x3b7b43,_0x4aa6b7,_0x7565b2){const _0x29db67=a31_0x526b;if(isYamlFilePath(_0x3b7b43))try{const _0x13c8ef=resolveYamlFilePath(_0x3b7b43);return _0x7565b2&&(console[_0x29db67(0x1ca)](_0x29db67(0x1f1)+_0x3b7b43),console[_0x29db67(0x1ca)]('\x20\x20Parent\x20segment:\x20'+_0x13c8ef[_0x29db67(0x1a7)]),console[_0x29db67(0x1ca)](_0x29db67(0x189)+_0x13c8ef[_0x29db67(0x217)]),console['error'](_0x29db67(0x209)+(_0x13c8ef[_0x29db67(0x1b1)]||_0x29db67(0x1c5))),console[_0x29db67(0x1ca)](_0x29db67(0x1f2)+_0x13c8ef[_0x29db67(0x202)])),_0x13c8ef[_0x29db67(0x202)];}catch(_0x4c8065){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x29db67(0x18d)+_0x4c8065[_0x29db67(0x214)]);}if(!_0x4aa6b7)throw new SDKError(ErrorCode[_0x29db67(0x1fc)],_0x29db67(0x1a5));return _0x4aa6b7+'/'+_0x3b7b43;}export class SegmentDescribeCommand extends BaseCommand{[a31_0x11eeb9(0x1f7)]=a31_0x11eeb9(0x19c);[a31_0x11eeb9(0x1d7)]=a31_0x11eeb9(0x1c3);async[a31_0x11eeb9(0x1e0)](_0x7cf382){const _0x43022f=a31_0x11eeb9,{options:_0x13842d,args:_0x371132,tdx:_0x34d961}=_0x7cf382,_0x4e8b33=_0x371132[0x0],_0x9a0190=!_0x4e8b33&&!!_0x13842d[_0x43022f(0x1a7)],_0x14f64c=_0x4e8b33||_0x13842d['parentSegment'];if(!_0x14f64c)return console[_0x43022f(0x1ca)](_0x43022f(0x1c6)),console[_0x43022f(0x1ca)](_0x43022f(0x208)),console[_0x43022f(0x1ca)](_0x43022f(0x1e6)),console[_0x43022f(0x1ca)](_0x43022f(0x20a)),console['error'](_0x43022f(0x1fd)),console[_0x43022f(0x1ca)]('\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),console['error'](_0x43022f(0x19a)),0x1;try{const _0x247458=_0x13842d['segmentPath'];let _0x489604=_0x14f64c;!_0x9a0190&&_0x247458&&!_0x14f64c['includes']('/')&&(_0x489604=_0x247458+'/'+_0x14f64c,_0x13842d['verbose']&&console[_0x43022f(0x1ca)](_0x43022f(0x1c7)+_0x489604));const _0x462328=await withSpinner('Resolving\x20path\x20\x27'+_0x489604+_0x43022f(0x1ee),()=>_0x34d961[_0x43022f(0x19d)][_0x43022f(0x196)](_0x489604),{'verbose':_0x13842d[_0x43022f(0x1df)]}),_0x3bf7a2=_0x462328[_0x43022f(0x1a4)];_0x13842d[_0x43022f(0x1df)]&&(console[_0x43022f(0x1ca)]('Resolved\x20type:\x20'+_0x3bf7a2[_0x43022f(0x1b4)]),console[_0x43022f(0x1ca)]('Parent\x20ID:\x20'+_0x3bf7a2['parentId']),_0x3bf7a2[_0x43022f(0x1aa)]&&console[_0x43022f(0x1ca)](_0x43022f(0x1c2)+_0x3bf7a2[_0x43022f(0x1aa)]),_0x3bf7a2[_0x43022f(0x21c)]&&console[_0x43022f(0x1ca)](_0x43022f(0x1c9)+_0x3bf7a2['segmentId']));if(_0x3bf7a2['type']===_0x43022f(0x199)){const _0x543896=await withSpinner(_0x43022f(0x1ed),()=>_0x34d961[_0x43022f(0x19d)][_0x43022f(0x1dc)](_0x3bf7a2[_0x43022f(0x219)]),{'verbose':_0x13842d['verbose']});await handleSingleObjectOutput(_0x543896[_0x43022f(0x1a4)],_0x13842d);}else{if(_0x3bf7a2[_0x43022f(0x1b4)]===_0x43022f(0x1e9)){if(!_0x3bf7a2[_0x43022f(0x1aa)])throw new SDKError(ErrorCode[_0x43022f(0x1bc)],_0x43022f(0x1ce));const _0x26b938=await withSpinner(_0x43022f(0x1a2),()=>_0x34d961[_0x43022f(0x19d)][_0x43022f(0x1a1)](_0x3bf7a2[_0x43022f(0x1aa)]),{'verbose':_0x13842d['verbose']});await handleSingleObjectOutput(_0x26b938[_0x43022f(0x1a4)],_0x13842d);}else{if(_0x3bf7a2['type']==='segment'){if(!_0x3bf7a2['segmentId'])throw new SDKError(ErrorCode[_0x43022f(0x1fb)],_0x43022f(0x200));const _0x59c602=await withSpinner(_0x43022f(0x21a),()=>_0x34d961['segment'][_0x43022f(0x1c0)](_0x3bf7a2[_0x43022f(0x219)],_0x3bf7a2[_0x43022f(0x21c)]),{'verbose':_0x13842d['verbose']});await handleSingleObjectOutput(_0x59c602[_0x43022f(0x1a4)],_0x13842d);}}}return 0x0;}catch(_0x4dd982){if(_0x4dd982 instanceof SDKError)return console[_0x43022f(0x1ca)](_0x43022f(0x19f)+_0x4dd982[_0x43022f(0x214)]),_0x4dd982[_0x43022f(0x1e7)]&&console['error'](_0x43022f(0x18f)+_0x4dd982[_0x43022f(0x1e7)]),0x1;throw _0x4dd982;}}}export class SegmentShowCommand extends BaseCommand{[a31_0x11eeb9(0x1f7)]='segment:show';[a31_0x11eeb9(0x1d7)]=a31_0x11eeb9(0x1d1);async[a31_0x11eeb9(0x1e0)](_0x575df1){const _0x285189=a31_0x11eeb9,{options:_0x135df7,args:_0x3a0313,tdx:_0x5d90b2}=_0x575df1,_0x250589=_0x3a0313[0x0];if(!_0x250589)return console[_0x285189(0x1ca)](_0x285189(0x188)),console[_0x285189(0x1ca)](_0x285189(0x20d)),console[_0x285189(0x1ca)](_0x285189(0x1b9)),console['error'](_0x285189(0x1e6)),console[_0x285189(0x1ca)](_0x285189(0x18a)),console[_0x285189(0x1ca)]('\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x5cb95c=_0x135df7['parentSegment'],_0x5cc26c=resolveSegmentTarget(_0x250589,_0x5cb95c,_0x135df7[_0x285189(0x1df)]);_0x135df7['verbose']&&console[_0x285189(0x1ca)](_0x285189(0x1a8)+_0x5cc26c);const _0x49ae0c=await withSpinner(_0x285189(0x20b)+_0x250589+_0x285189(0x1ee),()=>_0x5d90b2[_0x285189(0x19d)][_0x285189(0x196)](_0x5cc26c),{'verbose':_0x135df7['verbose']}),_0x3cce14=_0x49ae0c[_0x285189(0x1a4)];_0x135df7['verbose']&&(console['error'](_0x285189(0x18b)+_0x3cce14[_0x285189(0x1b4)]),console[_0x285189(0x1ca)](_0x285189(0x1d4)+_0x3cce14[_0x285189(0x219)]));if(_0x3cce14['type']===_0x285189(0x1e9))return console[_0x285189(0x1ca)](_0x285189(0x1b7)),console[_0x285189(0x1ca)]('Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details'),0x1;if(_0x3cce14['type']===_0x285189(0x199))return console['error'](_0x285189(0x1b8)),console[_0x285189(0x1ca)](_0x285189(0x198)),0x1;if(!_0x3cce14[_0x285189(0x21c)])throw new SDKError(ErrorCode[_0x285189(0x1fb)],_0x285189(0x200));const _0x347cd0=await withSpinner(_0x285189(0x1e5),()=>_0x5d90b2[_0x285189(0x19d)]['getSegmentSQL'](_0x3cce14[_0x285189(0x219)],_0x3cce14['segmentId']),{'verbose':_0x135df7[_0x285189(0x1df)]});let _0x2b1509=_0x347cd0[_0x285189(0x1a4)];const _0x463a58=resolveLimit(_0x135df7[_0x285189(0x1de)],DEFAULT_DISPLAY_LIMIT),_0x9f7efb=/\bLIMIT\s+\d+/i[_0x285189(0x210)](_0x2b1509);!_0x9f7efb&&(_0x2b1509=_0x2b1509[_0x285189(0x1a6)]()[_0x285189(0x192)](/;+$/,''),_0x2b1509=_0x285189(0x1b6)+_0x2b1509+_0x285189(0x1e3)+_0x463a58);_0x135df7[_0x285189(0x1df)]&&console[_0x285189(0x1ca)](_0x285189(0x220)+_0x2b1509);const _0x3776d2=await withQuerySpinner(_0x285189(0x1ac),async _0x5ab7fe=>{const _0x5e2394=_0x285189,_0x13022a=await _0x5d90b2[_0x5e2394(0x18e)][_0x5e2394(0x1e0)](_0x2b1509,{'catalog':'td','schema':'information_schema','onJobId':_0x2ce8c3=>{const _0x214983=_0x5e2394;_0x5ab7fe[_0x214983(0x1cc)](_0x2ce8c3);}});return _0x13022a;},{'verbose':_0x135df7['verbose']}),_0x332865=_0x3776d2[_0x285189(0x1a4)],_0x441566=_0x332865[_0x285189(0x197)]?_0x285189(0x212)+_0x332865[_0x285189(0x197)]+']':'';return console[_0x285189(0x1ca)]('✔\x20Query\x20completed:\x20Processed\x20'+_0x332865[_0x285189(0x1f9)][_0x285189(0x193)][_0x285189(0x20f)]()+_0x285189(0x1f6)+(_0x285189(0x216)+formatElapsed(_0x332865['stats'][_0x285189(0x1dd)])+_0x441566)),await handleQueryOutput(_0x332865,_0x135df7),0x0;}catch(_0x41c3bf){if(_0x41c3bf instanceof SDKError)return console[_0x285189(0x1ca)](_0x285189(0x1e2)+_0x41c3bf[_0x285189(0x21e)]+']'),console[_0x285189(0x1ca)]('\x0a'+_0x41c3bf[_0x285189(0x214)]),0x1;throw _0x41c3bf;}}}export class SegmentFolderListCommand extends BaseCommand{['name']=a31_0x11eeb9(0x1f3);[a31_0x11eeb9(0x1d7)]=a31_0x11eeb9(0x1f0);async[a31_0x11eeb9(0x1e0)](_0x5772ed){const _0x183d82=a31_0x11eeb9,{options:_0x12980d,args:_0x5a75ca,tdx:_0x3a422c}=_0x5772ed;if(_0x5a75ca[_0x183d82(0x211)]===0x0)return console[_0x183d82(0x1ca)](_0x183d82(0x1bb)),console[_0x183d82(0x1ca)](_0x183d82(0x207)),0x1;const _0x530540=_0x5a75ca[0x0];try{_0x12980d[_0x183d82(0x1df)]&&(console['error'](_0x183d82(0x1bf)+_0x12980d[_0x183d82(0x1f5)]),console[_0x183d82(0x1ca)]('Parent\x20name:\x20'+_0x530540));const _0x15cd59=await withSpinner(_0x183d82(0x1e4)+_0x530540+_0x183d82(0x1ee),()=>_0x3a422c[_0x183d82(0x19d)]['resolveParentId'](_0x530540),{'verbose':_0x12980d[_0x183d82(0x1df)]}),_0x485c24=_0x15cd59['data'];_0x12980d[_0x183d82(0x1df)]&&console[_0x183d82(0x1ca)](_0x183d82(0x1d5)+_0x485c24);const _0x111a8b=await withSpinner('Listing\x20folders\x20for\x20parent\x20\x27'+_0x530540+_0x183d82(0x1ee),()=>_0x3a422c[_0x183d82(0x19d)]['listFolders'](_0x485c24),{'verbose':_0x12980d[_0x183d82(0x1df)]}),_0x15afcf=_0x111a8b[_0x183d82(0x1a4)];return console[_0x183d82(0x1ca)](_0x183d82(0x21f)+_0x15afcf[_0x183d82(0x211)]+'\x20folder'+(_0x15afcf[_0x183d82(0x211)]!==0x1?'s':'')),await handleSDKOutput(_0x15afcf,_0x12980d),0x0;}catch(_0x3baaaa){if(_0x3baaaa instanceof SDKError)return console['error'](_0x183d82(0x19f)+_0x3baaaa[_0x183d82(0x214)]),_0x3baaaa[_0x183d82(0x1e7)]&&console[_0x183d82(0x1ca)](_0x183d82(0x18f)+_0x3baaaa[_0x183d82(0x1e7)]),0x1;throw _0x3baaaa;}}}export class SegmentFolderShowCommand extends BaseCommand{[a31_0x11eeb9(0x1f7)]='segment:folder:show';[a31_0x11eeb9(0x1d7)]=a31_0x11eeb9(0x1c4);async[a31_0x11eeb9(0x1e0)](_0x237145){const _0x89304e=a31_0x11eeb9,{options:_0x272f68,args:_0x5c4cbb,tdx:_0x46843a}=_0x237145;if(_0x5c4cbb[_0x89304e(0x211)]===0x0)return console[_0x89304e(0x1ca)](_0x89304e(0x1a9)),console[_0x89304e(0x1ca)]('Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>'),0x1;try{const {parentId:_0x14ea00,childId:_0x401f10}=parseSegmentRef(_0x5c4cbb[0x0]);_0x272f68[_0x89304e(0x1df)]&&(console['error'](_0x89304e(0x1bf)+_0x272f68['site']),console[_0x89304e(0x1ca)]('Parent\x20name:\x20'+_0x14ea00),_0x401f10&&console['error'](_0x89304e(0x1a0)+_0x401f10));if(!_0x401f10)return console[_0x89304e(0x1ca)]('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0xe608aa=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x14ea00+_0x89304e(0x1ee),()=>_0x46843a[_0x89304e(0x19d)]['resolveParentId'](_0x14ea00),{'verbose':_0x272f68[_0x89304e(0x1df)]}),_0x222136=_0xe608aa[_0x89304e(0x1a4)];_0x272f68[_0x89304e(0x1df)]&&console['error']('Resolved\x20parent\x20ID:\x20'+_0x222136);const _0x32d7b7=await withSpinner(_0x89304e(0x19e)+_0x401f10+_0x89304e(0x1ee),()=>_0x46843a[_0x89304e(0x19d)][_0x89304e(0x1b2)](_0x222136,_0x401f10),{'verbose':_0x272f68[_0x89304e(0x1df)]}),_0x30350e=_0x32d7b7[_0x89304e(0x1a4)];_0x272f68['verbose']&&console[_0x89304e(0x1ca)](_0x89304e(0x1ff)+_0x30350e);const _0x13f7be=await withSpinner('Fetching\x20folder\x20\x27'+_0x401f10+_0x89304e(0x1ee),()=>_0x46843a[_0x89304e(0x19d)]['getFolder'](_0x30350e),{'verbose':_0x272f68[_0x89304e(0x1df)]});return await handleSDKOutput([_0x13f7be[_0x89304e(0x1a4)]],_0x272f68),0x0;}catch(_0x4ed4f3){if(_0x4ed4f3 instanceof SDKError)return console[_0x89304e(0x1ca)]('Error:\x20'+_0x4ed4f3[_0x89304e(0x214)]),_0x4ed4f3[_0x89304e(0x1e7)]&&console[_0x89304e(0x1ca)](_0x89304e(0x18f)+_0x4ed4f3['cause']),0x1;throw _0x4ed4f3;}}}function a31_0x526b(_0x72c48a,_0xdfe484){_0x72c48a=_0x72c48a-0x188;const _0x7f3f3f=a31_0x7f3f();let _0x526bb3=_0x7f3f3f[_0x72c48a];return _0x526bb3;}export class SegmentSQLCommand extends BaseCommand{[a31_0x11eeb9(0x1f7)]=a31_0x11eeb9(0x1f8);[a31_0x11eeb9(0x1d7)]='Get\x20SQL\x20query\x20for\x20child\x20segment';async[a31_0x11eeb9(0x1e0)](_0x482d93){const _0x1deffd=a31_0x11eeb9,{options:_0x50ab9c,args:_0x3d1e6b,tdx:_0x4f4a36}=_0x482d93,_0x154856=_0x3d1e6b[0x0];if(!_0x154856)return console['error'](_0x1deffd(0x188)),console[_0x1deffd(0x1ca)]('Usage:\x20tdx\x20sg\x20sql\x20<name>'),console[_0x1deffd(0x1ca)](_0x1deffd(0x1be)),console[_0x1deffd(0x1ca)](_0x1deffd(0x1e6)),console['error'](_0x1deffd(0x190)),console[_0x1deffd(0x1ca)]('\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x4eb35c=_0x50ab9c[_0x1deffd(0x1a7)],_0x5e87b2=resolveSegmentTarget(_0x154856,_0x4eb35c,_0x50ab9c[_0x1deffd(0x1df)]);_0x50ab9c[_0x1deffd(0x1df)]&&console[_0x1deffd(0x1ca)](_0x1deffd(0x1a8)+_0x5e87b2);const _0x3fd6aa=await withSpinner(_0x1deffd(0x20b)+_0x154856+_0x1deffd(0x1ee),()=>_0x4f4a36[_0x1deffd(0x19d)]['resolvePathToResource'](_0x5e87b2),{'verbose':_0x50ab9c['verbose']}),_0x11dd16=_0x3fd6aa[_0x1deffd(0x1a4)];_0x50ab9c['verbose']&&(console['error']('Resolved\x20type:\x20'+_0x11dd16[_0x1deffd(0x1b4)]),console[_0x1deffd(0x1ca)](_0x1deffd(0x1d4)+_0x11dd16[_0x1deffd(0x219)]));if(_0x11dd16[_0x1deffd(0x1b4)]===_0x1deffd(0x1e9))return console['error']('Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.'),console[_0x1deffd(0x1ca)](_0x1deffd(0x191)),0x1;if(_0x11dd16[_0x1deffd(0x1b4)]==='parent')return console[_0x1deffd(0x1ca)](_0x1deffd(0x1ea)),console[_0x1deffd(0x1ca)](_0x1deffd(0x1d3)),0x1;if(!_0x11dd16['segmentId'])throw new SDKError(ErrorCode[_0x1deffd(0x1fb)],_0x1deffd(0x200));const _0x383258=await withSpinner(_0x1deffd(0x1e5),()=>_0x4f4a36[_0x1deffd(0x19d)]['getSegmentSQL'](_0x11dd16[_0x1deffd(0x219)],_0x11dd16[_0x1deffd(0x21c)]),{'verbose':_0x50ab9c[_0x1deffd(0x1df)]}),_0x1ffce8=_0x383258[_0x1deffd(0x1a4)];return _0x50ab9c[_0x1deffd(0x218)]===_0x1deffd(0x1e8)||_0x50ab9c[_0x1deffd(0x218)]===_0x1deffd(0x1d8)?await handleSDKOutput([{'sql':_0x1ffce8}],_0x50ab9c):console['log'](_0x1ffce8),0x0;}catch(_0x1c3904){if(_0x1c3904 instanceof SDKError)return console[_0x1deffd(0x1ca)](_0x1deffd(0x19f)+_0x1c3904[_0x1deffd(0x214)]),_0x1c3904[_0x1deffd(0x1e7)]&&console[_0x1deffd(0x1ca)](_0x1deffd(0x18f)+_0x1c3904[_0x1deffd(0x1e7)]),0x1;throw _0x1c3904;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a31_0x11eeb9(0x1f7)]=a31_0x11eeb9(0x20e);[a31_0x11eeb9(0x1d7)]='Create\x20segment\x20folder\x20for\x20organization';async[a31_0x11eeb9(0x1e0)](_0x37ac44){const _0x38b96b=a31_0x11eeb9,{options:_0x1c062f,args:_0x33b725,tdx:_0x5d0833}=_0x37ac44,_0x404002=_0x1c062f;if(_0x33b725[_0x38b96b(0x211)]<0x2)return console[_0x38b96b(0x1ca)](_0x38b96b(0x1da)),console[_0x38b96b(0x1ca)](_0x38b96b(0x206)),0x1;const _0x45abe6=_0x33b725[0x0],_0x2c6b32=_0x33b725[0x1];_0x404002['verbose']&&(console[_0x38b96b(0x1ca)](_0x38b96b(0x1bf)+_0x404002['site']),console[_0x38b96b(0x1ca)](_0x38b96b(0x1fe)+_0x45abe6),console[_0x38b96b(0x1ca)](_0x38b96b(0x1a0)+_0x2c6b32));let _0x50ccae;if(_0x404002['parentFolder']){const _0x3c29b5=_0x404002['parentFolder'],_0x2bef82=await withSpinner(_0x38b96b(0x1e4)+_0x45abe6+'\x27...',()=>_0x5d0833[_0x38b96b(0x19d)][_0x38b96b(0x204)](_0x45abe6),{'verbose':_0x404002[_0x38b96b(0x1df)]}),_0x186e97=_0x2bef82[_0x38b96b(0x1a4)],_0x58213a=await withSpinner(_0x38b96b(0x205)+_0x3c29b5+_0x38b96b(0x1ee),()=>_0x5d0833[_0x38b96b(0x19d)][_0x38b96b(0x1b2)](_0x186e97,_0x3c29b5),{'verbose':_0x404002[_0x38b96b(0x1df)]});_0x50ccae=_0x58213a['data'],_0x404002[_0x38b96b(0x1df)]&&console[_0x38b96b(0x1ca)](_0x38b96b(0x1b0)+_0x50ccae);}const _0x29427f={'name':_0x2c6b32,'description':_0x404002['description'],'parentFolderId':_0x50ccae},_0x5ad629=await withSpinner('Creating\x20folder\x20\x27'+_0x2c6b32+_0x38b96b(0x1ee),()=>_0x5d0833['segment'][_0x38b96b(0x1b5)](_0x45abe6,_0x29427f),{'verbose':_0x404002[_0x38b96b(0x1df)]}),_0x1f1ac2=_0x5ad629[_0x38b96b(0x1a4)];return console[_0x38b96b(0x1ca)]('✔\x20Created\x20folder\x20\x27'+_0x1f1ac2[_0x38b96b(0x1f7)]+'\x27\x20with\x20ID:\x20'+_0x1f1ac2['id']),await handleSDKOutput([_0x1f1ac2],_0x404002),0x0;}}export class SegmentViewCommand extends BaseCommand{[a31_0x11eeb9(0x1f7)]=a31_0x11eeb9(0x21b);[a31_0x11eeb9(0x1d7)]='Show\x20folder\x20or\x20child\x20segment\x20details';async[a31_0x11eeb9(0x1e0)](_0x3df757){const _0x5536c3=a31_0x11eeb9,{options:_0x7b4bf8,args:_0xddb4ca,tdx:_0x1796bf}=_0x3df757,_0x9e6e8c=_0xddb4ca[0x0];if(!_0x9e6e8c)return console[_0x5536c3(0x1ca)](_0x5536c3(0x1d6)),console['error'](_0x5536c3(0x1af)),console[_0x5536c3(0x1ca)](_0x5536c3(0x194)),console[_0x5536c3(0x1ca)]('Options:'),console[_0x5536c3(0x1ca)]('\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x5536c3(0x1ca)](_0x5536c3(0x1e6)),console[_0x5536c3(0x1ca)](_0x5536c3(0x1d0)),console['error'](_0x5536c3(0x215)),console[_0x5536c3(0x1ca)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser'),console['error'](_0x5536c3(0x1db)),0x1;try{const _0x42a789=_0x7b4bf8[_0x5536c3(0x1a7)],_0x1c820e=resolveSegmentTarget(_0x9e6e8c,_0x42a789,_0x7b4bf8['verbose']);_0x7b4bf8[_0x5536c3(0x1df)]&&console[_0x5536c3(0x1ca)](_0x5536c3(0x1a8)+_0x1c820e);const _0x144ae8=await withSpinner(_0x5536c3(0x20b)+_0x9e6e8c+'\x27...',()=>_0x1796bf['segment'][_0x5536c3(0x196)](_0x1c820e),{'verbose':_0x7b4bf8[_0x5536c3(0x1df)]}),_0x58e622=_0x144ae8[_0x5536c3(0x1a4)];_0x7b4bf8[_0x5536c3(0x1df)]&&(console[_0x5536c3(0x1ca)](_0x5536c3(0x18b)+_0x58e622[_0x5536c3(0x1b4)]),console[_0x5536c3(0x1ca)](_0x5536c3(0x1d4)+_0x58e622['parentId']),_0x58e622['folderId']&&console[_0x5536c3(0x1ca)](_0x5536c3(0x1c2)+_0x58e622[_0x5536c3(0x1aa)]),_0x58e622['segmentId']&&console[_0x5536c3(0x1ca)]('Segment\x20ID:\x20'+_0x58e622[_0x5536c3(0x21c)]));if(_0x7b4bf8[_0x5536c3(0x18c)]){if(_0x58e622[_0x5536c3(0x1b4)]==='folder')return console[_0x5536c3(0x1ca)](_0x5536c3(0x1ba)),0x1;if(_0x58e622['type']===_0x5536c3(0x199))return console[_0x5536c3(0x1ca)](_0x5536c3(0x1e1)),console[_0x5536c3(0x1ca)](_0x5536c3(0x1d2)),0x1;if(!_0x58e622[_0x5536c3(0x21c)])throw new SDKError(ErrorCode[_0x5536c3(0x1fb)],_0x5536c3(0x200));const _0x124624=getConsoleNextUrl(_0x7b4bf8[_0x5536c3(0x1f5)],_0x5536c3(0x1a3)+_0x58e622[_0x5536c3(0x219)]+'/e/'+_0x58e622[_0x5536c3(0x21c)]);return console[_0x5536c3(0x1ca)](a31_0xf75273['green']('✔')+_0x5536c3(0x21d)+a31_0xf75273[_0x5536c3(0x1cd)](_0x124624)),openBrowser(_0x124624),0x0;}if(_0x58e622[_0x5536c3(0x1b4)]===_0x5536c3(0x1e9)){if(!_0x58e622[_0x5536c3(0x1aa)])throw new SDKError(ErrorCode[_0x5536c3(0x1bc)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x476834=await withSpinner(_0x5536c3(0x1a2),()=>_0x1796bf['segment'][_0x5536c3(0x1a1)](_0x58e622[_0x5536c3(0x1aa)]),{'verbose':_0x7b4bf8[_0x5536c3(0x1df)]});await handleSingleObjectOutput(_0x476834[_0x5536c3(0x1a4)],_0x7b4bf8);}else{if(_0x58e622['type']==='segment'){if(!_0x58e622[_0x5536c3(0x21c)])throw new SDKError(ErrorCode[_0x5536c3(0x1fb)],_0x5536c3(0x200));const _0x37c9d4=await withSpinner(_0x5536c3(0x21a),()=>_0x1796bf[_0x5536c3(0x19d)][_0x5536c3(0x1c0)](_0x58e622[_0x5536c3(0x219)],_0x58e622[_0x5536c3(0x21c)]),{'verbose':_0x7b4bf8[_0x5536c3(0x1df)]}),_0x467143=getConsoleNextUrl(_0x7b4bf8['site'],_0x5536c3(0x1a3)+_0x58e622['parentId']+_0x5536c3(0x1ae)+_0x58e622[_0x5536c3(0x21c)]),_0x2effe6=_0x37c9d4[_0x5536c3(0x1a4)];_0x2effe6[_0x5536c3(0x20c)]=_0x467143,await handleSingleObjectOutput(_0x2effe6,_0x7b4bf8);}else return console[_0x5536c3(0x1ca)](_0x5536c3(0x1ab)),console[_0x5536c3(0x1ca)](_0x5536c3(0x19b)),0x1;}return 0x0;}catch(_0x432645){if(_0x432645 instanceof SDKError)return console[_0x5536c3(0x1ca)](_0x5536c3(0x19f)+_0x432645[_0x5536c3(0x214)]),_0x432645[_0x5536c3(0x1e7)]&&console['error'](_0x5536c3(0x18f)+_0x432645[_0x5536c3(0x1e7)]),0x1;throw _0x432645;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a31_0x11eeb9(0x1f7)]='segment:desc';[a31_0x11eeb9(0x1d7)]=a31_0x11eeb9(0x203);async[a31_0x11eeb9(0x1e0)](_0x1da93d){const _0x22352d=a31_0x11eeb9,{options:_0x4eadba,args:_0x1954a1,tdx:_0x3d1bd6}=_0x1da93d,_0x1c7589=_0x1954a1[0x0];if(!_0x1c7589)return console[_0x22352d(0x1ca)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x22352d(0x1ca)](_0x22352d(0x201)),console[_0x22352d(0x1ca)](_0x22352d(0x195)),console[_0x22352d(0x1ca)](_0x22352d(0x1e6)),console[_0x22352d(0x1ca)](_0x22352d(0x1ec)),console['error'](_0x22352d(0x1ef)),0x1;try{const _0x53766f=_0x4eadba[_0x22352d(0x1a7)],_0x1e5dc6=resolveSegmentTarget(_0x1c7589,_0x53766f,_0x4eadba[_0x22352d(0x1df)]);_0x4eadba[_0x22352d(0x1df)]&&console[_0x22352d(0x1ca)](_0x22352d(0x1a8)+_0x1e5dc6);const _0x519998=await withSpinner(_0x22352d(0x20b)+_0x1c7589+'\x27...',()=>_0x3d1bd6[_0x22352d(0x19d)]['resolvePathToResource'](_0x1e5dc6),{'verbose':_0x4eadba[_0x22352d(0x1df)]}),_0x45964e=_0x519998['data'];_0x4eadba[_0x22352d(0x1df)]&&(console[_0x22352d(0x1ca)](_0x22352d(0x18b)+_0x45964e[_0x22352d(0x1b4)]),console[_0x22352d(0x1ca)](_0x22352d(0x1d4)+_0x45964e['parentId']));if(_0x45964e[_0x22352d(0x1b4)]==='folder')return console[_0x22352d(0x1ca)]('Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.'),console[_0x22352d(0x1ca)]('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0x45964e[_0x22352d(0x1b4)]==='parent')return console[_0x22352d(0x1ca)]('Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x22352d(0x1ca)](_0x22352d(0x1b3)),0x1;if(!_0x45964e[_0x22352d(0x21c)])throw new SDKError(ErrorCode[_0x22352d(0x1fb)],_0x22352d(0x200));const _0x1447b7=await withSpinner(_0x22352d(0x1e5),()=>_0x3d1bd6['segment'][_0x22352d(0x213)](_0x45964e[_0x22352d(0x219)],_0x45964e[_0x22352d(0x21c)]),{'verbose':_0x4eadba[_0x22352d(0x1df)]}),_0x2b1384=_0x1447b7['data'],_0x264f4d=await executeSchemaQuery(_0x2b1384,_0x3d1bd6,_0x4eadba);return await handleQueryOutput(_0x264f4d,_0x4eadba),0x0;}catch(_0x4e172f){if(_0x4e172f instanceof SDKError)return console[_0x22352d(0x1ca)](_0x22352d(0x19f)+_0x4e172f[_0x22352d(0x214)]),_0x4e172f[_0x22352d(0x1e7)]&&console[_0x22352d(0x1ca)](_0x22352d(0x18f)+_0x4e172f['cause']),0x1;throw _0x4e172f;}}}
1
+ const a31_0x5cf2c2=a31_0x3fec;(function(_0x590e82,_0x30134d){const _0x19673e=a31_0x3fec,_0x2f6b8d=_0x590e82();while(!![]){try{const _0x4e7c0c=parseInt(_0x19673e(0xf3))/0x1*(-parseInt(_0x19673e(0x136))/0x2)+-parseInt(_0x19673e(0x102))/0x3+-parseInt(_0x19673e(0xf4))/0x4+parseInt(_0x19673e(0x140))/0x5*(-parseInt(_0x19673e(0xed))/0x6)+-parseInt(_0x19673e(0x129))/0x7+parseInt(_0x19673e(0x15d))/0x8+parseInt(_0x19673e(0x115))/0x9;if(_0x4e7c0c===_0x30134d)break;else _0x2f6b8d['push'](_0x2f6b8d['shift']());}catch(_0x3eef79){_0x2f6b8d['push'](_0x2f6b8d['shift']());}}}(a31_0x46b2,0xb702c));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../utils/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';import{executeSchemaQuery}from'../utils/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../utils/segment-path-parser.js';import{getConsoleNextUrl}from'../types/endpoints.js';import{openBrowser}from'../utils/process.js';import a31_0xb205ff from'chalk';function resolveSegmentTarget(_0x4b32d9,_0x4dbda7,_0x476ea1){const _0x3c6dbc=a31_0x3fec;if(isYamlFilePath(_0x4b32d9))try{const _0x2b0b61=resolveYamlFilePath(_0x4b32d9);return _0x476ea1&&(console[_0x3c6dbc(0x168)](_0x3c6dbc(0x104)+_0x4b32d9),console[_0x3c6dbc(0x168)](_0x3c6dbc(0x142)+_0x2b0b61['parentSegment']),console['error'](_0x3c6dbc(0x164)+_0x2b0b61[_0x3c6dbc(0x13b)]),console[_0x3c6dbc(0x168)]('\x20\x20Folder\x20path:\x20'+(_0x2b0b61[_0x3c6dbc(0x160)]||_0x3c6dbc(0x152))),console['error'](_0x3c6dbc(0x135)+_0x2b0b61[_0x3c6dbc(0x112)])),_0x2b0b61[_0x3c6dbc(0x112)];}catch(_0x4484e1){throw new SDKError(ErrorCode[_0x3c6dbc(0x17a)],_0x3c6dbc(0xee)+_0x4484e1['message']);}if(!_0x4dbda7)throw new SDKError(ErrorCode[_0x3c6dbc(0x17a)],_0x3c6dbc(0x131));return _0x4dbda7+'/'+_0x4b32d9;}function a31_0x3fec(_0x4503f7,_0x3e3215){_0x4503f7=_0x4503f7-0xe1;const _0x46b2cf=a31_0x46b2();let _0x3fecef=_0x46b2cf[_0x4503f7];return _0x3fecef;}export class SegmentDescribeCommand extends BaseCommand{[a31_0x5cf2c2(0xf5)]=a31_0x5cf2c2(0x101);[a31_0x5cf2c2(0x170)]=a31_0x5cf2c2(0x16c);async[a31_0x5cf2c2(0x174)](_0xb2630){const _0x6cefae=a31_0x5cf2c2,{options:_0x37957a,args:_0x4dcbb5,tdx:_0x36640d}=_0xb2630,_0x14b15b=_0x4dcbb5[0x0],_0x5e5936=!_0x14b15b&&!!_0x37957a[_0x6cefae(0x128)],_0x1bff6d=_0x14b15b||_0x37957a[_0x6cefae(0x128)];if(!_0x1bff6d)return console[_0x6cefae(0x168)](_0x6cefae(0xe5)),console['error'](_0x6cefae(0x127)),console[_0x6cefae(0x168)](_0x6cefae(0x132)),console[_0x6cefae(0x168)](_0x6cefae(0x100)),console['error'](_0x6cefae(0x11f)),console[_0x6cefae(0x168)](_0x6cefae(0x124)),console[_0x6cefae(0x168)](_0x6cefae(0x137)),0x1;try{const _0x9afd4f=_0x37957a[_0x6cefae(0xf9)];let _0x498947=_0x1bff6d;!_0x5e5936&&_0x9afd4f&&!_0x1bff6d['includes']('/')&&(_0x498947=_0x9afd4f+'/'+_0x1bff6d,_0x37957a['verbose']&&console[_0x6cefae(0x168)]('Resolved\x20relative\x20path\x20to:\x20'+_0x498947));const _0x2488ef=await withSpinner(_0x6cefae(0x10d)+_0x498947+_0x6cefae(0x14c),()=>_0x36640d[_0x6cefae(0xf2)][_0x6cefae(0xeb)](_0x498947),{'verbose':_0x37957a[_0x6cefae(0x153)]}),_0x103d00=_0x2488ef[_0x6cefae(0x10e)];_0x37957a[_0x6cefae(0x153)]&&(console[_0x6cefae(0x168)]('Resolved\x20type:\x20'+_0x103d00['type']),console[_0x6cefae(0x168)]('Parent\x20ID:\x20'+_0x103d00[_0x6cefae(0x15e)]),_0x103d00[_0x6cefae(0xe8)]&&console[_0x6cefae(0x168)](_0x6cefae(0x16a)+_0x103d00[_0x6cefae(0xe8)]),_0x103d00[_0x6cefae(0x114)]&&console[_0x6cefae(0x168)]('Segment\x20ID:\x20'+_0x103d00[_0x6cefae(0x114)]));if(_0x103d00[_0x6cefae(0x12e)]==='parent'){const _0x5d2e54=await withSpinner(_0x6cefae(0x10f),()=>_0x36640d[_0x6cefae(0xf2)][_0x6cefae(0x133)](_0x103d00[_0x6cefae(0x15e)]),{'verbose':_0x37957a['verbose']});await handleSingleObjectOutput(_0x5d2e54[_0x6cefae(0x10e)],_0x37957a);}else{if(_0x103d00[_0x6cefae(0x12e)]==='folder'){if(!_0x103d00['folderId'])throw new SDKError(ErrorCode[_0x6cefae(0xf8)],_0x6cefae(0x109));const _0x434221=await withSpinner(_0x6cefae(0xe3),()=>_0x36640d[_0x6cefae(0xf2)][_0x6cefae(0xe2)](_0x103d00['folderId']),{'verbose':_0x37957a[_0x6cefae(0x153)]});await handleSingleObjectOutput(_0x434221[_0x6cefae(0x10e)],_0x37957a);}else{if(_0x103d00['type']==='segment'){if(!_0x103d00[_0x6cefae(0x114)])throw new SDKError(ErrorCode[_0x6cefae(0x14d)],_0x6cefae(0x167));const _0x10e3d6=await withSpinner(_0x6cefae(0xec),()=>_0x36640d[_0x6cefae(0xf2)][_0x6cefae(0xea)](_0x103d00['parentId'],_0x103d00['segmentId']),{'verbose':_0x37957a['verbose']});await handleSingleObjectOutput(_0x10e3d6[_0x6cefae(0x10e)],_0x37957a);}}}return 0x0;}catch(_0x5f5287){if(_0x5f5287 instanceof SDKError)return console[_0x6cefae(0x168)](_0x6cefae(0x113)+_0x5f5287[_0x6cefae(0x158)]),_0x5f5287[_0x6cefae(0x139)]&&console[_0x6cefae(0x168)](_0x6cefae(0x141)+_0x5f5287[_0x6cefae(0x139)]),0x1;throw _0x5f5287;}}}export class SegmentShowCommand extends BaseCommand{[a31_0x5cf2c2(0xf5)]='segment:show';[a31_0x5cf2c2(0x170)]=a31_0x5cf2c2(0x175);async[a31_0x5cf2c2(0x174)](_0x377d82){const _0x3851b1=a31_0x5cf2c2,{options:_0xb01003,args:_0x25bbdf,tdx:_0x17671c}=_0x377d82,_0x2169c1=_0x25bbdf[0x0];if(!_0x2169c1)return console[_0x3851b1(0x168)](_0x3851b1(0x161)),console['error']('Usage:\x20tdx\x20sg\x20show\x20<name>'),console[_0x3851b1(0x168)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>'),console[_0x3851b1(0x168)]('Examples:'),console[_0x3851b1(0x168)](_0x3851b1(0x11b)),console[_0x3851b1(0x168)](_0x3851b1(0x105)),0x1;try{const _0x1e5c27=_0xb01003[_0x3851b1(0x128)],_0x3c1068=resolveSegmentTarget(_0x2169c1,_0x1e5c27,_0xb01003[_0x3851b1(0x153)]);_0xb01003[_0x3851b1(0x153)]&&console[_0x3851b1(0x168)](_0x3851b1(0x17d)+_0x3c1068);const _0x38170e=await withSpinner(_0x3851b1(0x17b)+_0x2169c1+_0x3851b1(0x14c),()=>_0x17671c['segment'][_0x3851b1(0xeb)](_0x3c1068),{'verbose':_0xb01003[_0x3851b1(0x153)]}),_0x58ea48=_0x38170e[_0x3851b1(0x10e)];_0xb01003[_0x3851b1(0x153)]&&(console[_0x3851b1(0x168)](_0x3851b1(0x130)+_0x58ea48[_0x3851b1(0x12e)]),console[_0x3851b1(0x168)]('Parent\x20ID:\x20'+_0x58ea48[_0x3851b1(0x15e)]));if(_0x58ea48[_0x3851b1(0x12e)]===_0x3851b1(0x150))return console[_0x3851b1(0x168)](_0x3851b1(0x15b)),console[_0x3851b1(0x168)](_0x3851b1(0x126)),0x1;if(_0x58ea48['type']===_0x3851b1(0x120))return console[_0x3851b1(0x168)](_0x3851b1(0xe6)),console['error']('Use:\x20tdx\x20ps\x20show'),0x1;if(!_0x58ea48['segmentId'])throw new SDKError(ErrorCode[_0x3851b1(0x14d)],_0x3851b1(0x167));const _0x5e6d51=await withSpinner(_0x3851b1(0x14a),()=>_0x17671c[_0x3851b1(0xf2)][_0x3851b1(0x17c)](_0x58ea48[_0x3851b1(0x15e)],_0x58ea48['segmentId']),{'verbose':_0xb01003[_0x3851b1(0x153)]});let _0x22bd87=_0x5e6d51[_0x3851b1(0x10e)];const _0x5306f9=resolveLimit(_0xb01003[_0x3851b1(0x145)],DEFAULT_DISPLAY_LIMIT),_0x1bdfc5=/\bLIMIT\s+\d+/i[_0x3851b1(0x147)](_0x22bd87);!_0x1bdfc5&&(_0x22bd87=_0x22bd87[_0x3851b1(0x14e)]()[_0x3851b1(0x156)](/;+$/,''),_0x22bd87=_0x3851b1(0x151)+_0x22bd87+_0x3851b1(0xe4)+_0x5306f9);_0xb01003['verbose']&&console[_0x3851b1(0x168)](_0x3851b1(0x157)+_0x22bd87);const _0x36d4bb=await withQuerySpinner(_0x3851b1(0x12a),async _0x415196=>{const _0x5c2123=_0x3851b1,_0x5572fa=await _0x17671c[_0x5c2123(0x107)][_0x5c2123(0x174)](_0x22bd87,{'catalog':'td','schema':_0x5c2123(0x179),'onJobId':_0x27f409=>{const _0x1ffacb=_0x5c2123;_0x415196[_0x1ffacb(0xe9)](_0x27f409);}});return _0x5572fa;},{'verbose':_0xb01003[_0x3851b1(0x153)]}),_0x4b82a0=_0x36d4bb[_0x3851b1(0x10e)],_0xb519d2=_0x4b82a0[_0x3851b1(0xef)]?_0x3851b1(0x15c)+_0x4b82a0[_0x3851b1(0xef)]+']':'';return console['error']('✔\x20Query\x20completed:\x20Processed\x20'+_0x4b82a0[_0x3851b1(0x176)][_0x3851b1(0x111)][_0x3851b1(0x117)]()+_0x3851b1(0xff)+(_0x3851b1(0x149)+formatElapsed(_0x4b82a0[_0x3851b1(0x176)]['elapsedTimeMillis'])+_0xb519d2)),await handleQueryOutput(_0x4b82a0,_0xb01003),0x0;}catch(_0x30ee09){if(_0x30ee09 instanceof SDKError)return console[_0x3851b1(0x168)](_0x3851b1(0x166)+_0x30ee09[_0x3851b1(0x14b)]+']'),console['error']('\x0a'+_0x30ee09[_0x3851b1(0x158)]),0x1;throw _0x30ee09;}}}export class SegmentFolderListCommand extends BaseCommand{[a31_0x5cf2c2(0xf5)]=a31_0x5cf2c2(0xe1);[a31_0x5cf2c2(0x170)]='List\x20segment\x20folders\x20under\x20a\x20parent\x20segment';async[a31_0x5cf2c2(0x174)](_0x1555cd){const _0x2c18a7=a31_0x5cf2c2,{options:_0x1a35d1,args:_0xef71b2,tdx:_0x11bdd5}=_0x1555cd;if(_0xef71b2['length']===0x0)return console[_0x2c18a7(0x168)](_0x2c18a7(0x11c)),console['error'](_0x2c18a7(0x16d)),0x1;const _0x72aca3=_0xef71b2[0x0];try{_0x1a35d1[_0x2c18a7(0x153)]&&(console[_0x2c18a7(0x168)]('Site:\x20'+_0x1a35d1['site']),console[_0x2c18a7(0x168)]('Parent\x20name:\x20'+_0x72aca3));const _0x5b4b47=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x72aca3+_0x2c18a7(0x14c),()=>_0x11bdd5[_0x2c18a7(0xf2)][_0x2c18a7(0x154)](_0x72aca3),{'verbose':_0x1a35d1[_0x2c18a7(0x153)]}),_0x13edac=_0x5b4b47[_0x2c18a7(0x10e)];_0x1a35d1[_0x2c18a7(0x153)]&&console[_0x2c18a7(0x168)]('Resolved\x20parent\x20ID:\x20'+_0x13edac);const _0x5e770a=await withSpinner('Listing\x20folders\x20for\x20parent\x20\x27'+_0x72aca3+_0x2c18a7(0x14c),()=>_0x11bdd5[_0x2c18a7(0xf2)][_0x2c18a7(0xf0)](_0x13edac),{'verbose':_0x1a35d1[_0x2c18a7(0x153)]}),_0x512e19=_0x5e770a[_0x2c18a7(0x10e)];return console[_0x2c18a7(0x168)](_0x2c18a7(0xfe)+_0x512e19[_0x2c18a7(0x121)]+_0x2c18a7(0x13c)+(_0x512e19[_0x2c18a7(0x121)]!==0x1?'s':'')),await handleSDKOutput(_0x512e19,_0x1a35d1),0x0;}catch(_0x300278){if(_0x300278 instanceof SDKError)return console[_0x2c18a7(0x168)](_0x2c18a7(0x113)+_0x300278[_0x2c18a7(0x158)]),_0x300278[_0x2c18a7(0x139)]&&console['error'](_0x2c18a7(0x141)+_0x300278[_0x2c18a7(0x139)]),0x1;throw _0x300278;}}}export class SegmentFolderShowCommand extends BaseCommand{[a31_0x5cf2c2(0xf5)]=a31_0x5cf2c2(0x11e);[a31_0x5cf2c2(0x170)]='Show\x20segment\x20folder\x20details';async[a31_0x5cf2c2(0x174)](_0x589dff){const _0x3b4821=a31_0x5cf2c2,{options:_0x3cd23f,args:_0x14dd1a,tdx:_0x3eac3a}=_0x589dff;if(_0x14dd1a['length']===0x0)return console['error']('Error:\x20Folder\x20reference\x20is\x20required'),console[_0x3b4821(0x168)](_0x3b4821(0x177)),0x1;try{const {parentId:_0x1b4d6b,childId:_0x417c75}=parseSegmentRef(_0x14dd1a[0x0]);_0x3cd23f[_0x3b4821(0x153)]&&(console['error'](_0x3b4821(0x172)+_0x3cd23f[_0x3b4821(0x12d)]),console[_0x3b4821(0x168)](_0x3b4821(0x15f)+_0x1b4d6b),_0x417c75&&console[_0x3b4821(0x168)](_0x3b4821(0x138)+_0x417c75));if(!_0x417c75)return console['error'](_0x3b4821(0xe7)),0x1;const _0x112009=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x1b4d6b+_0x3b4821(0x14c),()=>_0x3eac3a[_0x3b4821(0xf2)][_0x3b4821(0x154)](_0x1b4d6b),{'verbose':_0x3cd23f['verbose']}),_0x5852f7=_0x112009[_0x3b4821(0x10e)];_0x3cd23f[_0x3b4821(0x153)]&&console[_0x3b4821(0x168)](_0x3b4821(0x106)+_0x5852f7);const _0xc5ba99=await withSpinner(_0x3b4821(0x13a)+_0x417c75+_0x3b4821(0x14c),()=>_0x3eac3a[_0x3b4821(0xf2)]['resolveFolderId'](_0x5852f7,_0x417c75),{'verbose':_0x3cd23f['verbose']}),_0x528eb7=_0xc5ba99['data'];_0x3cd23f[_0x3b4821(0x153)]&&console[_0x3b4821(0x168)](_0x3b4821(0x119)+_0x528eb7);const _0x5d3a92=await withSpinner('Fetching\x20folder\x20\x27'+_0x417c75+_0x3b4821(0x14c),()=>_0x3eac3a['segment'][_0x3b4821(0xe2)](_0x528eb7),{'verbose':_0x3cd23f['verbose']});return await handleSDKOutput([_0x5d3a92[_0x3b4821(0x10e)]],_0x3cd23f),0x0;}catch(_0x5dc7eb){if(_0x5dc7eb instanceof SDKError)return console[_0x3b4821(0x168)](_0x3b4821(0x113)+_0x5dc7eb['message']),_0x5dc7eb[_0x3b4821(0x139)]&&console[_0x3b4821(0x168)](_0x3b4821(0x141)+_0x5dc7eb[_0x3b4821(0x139)]),0x1;throw _0x5dc7eb;}}}export class SegmentSQLCommand extends BaseCommand{[a31_0x5cf2c2(0xf5)]=a31_0x5cf2c2(0x10b);[a31_0x5cf2c2(0x170)]='Get\x20SQL\x20query\x20for\x20child\x20segment';async[a31_0x5cf2c2(0x174)](_0x15d996){const _0x5a2fec=a31_0x5cf2c2,{options:_0x3992a0,args:_0x1b2d7a,tdx:_0x59bf4f}=_0x15d996,_0x195fa9=_0x1b2d7a[0x0];if(!_0x195fa9)return console[_0x5a2fec(0x168)](_0x5a2fec(0x161)),console[_0x5a2fec(0x168)](_0x5a2fec(0x103)),console['error'](_0x5a2fec(0x143)),console[_0x5a2fec(0x168)](_0x5a2fec(0x132)),console['error']('\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22'),console['error']('\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x52e813=_0x3992a0[_0x5a2fec(0x128)],_0xd1728e=resolveSegmentTarget(_0x195fa9,_0x52e813,_0x3992a0[_0x5a2fec(0x153)]);_0x3992a0[_0x5a2fec(0x153)]&&console['error'](_0x5a2fec(0x17d)+_0xd1728e);const _0x12d09c=await withSpinner(_0x5a2fec(0x17b)+_0x195fa9+'\x27...',()=>_0x59bf4f[_0x5a2fec(0xf2)][_0x5a2fec(0xeb)](_0xd1728e),{'verbose':_0x3992a0['verbose']}),_0x3d9fbe=_0x12d09c['data'];_0x3992a0[_0x5a2fec(0x153)]&&(console[_0x5a2fec(0x168)]('Resolved\x20type:\x20'+_0x3d9fbe[_0x5a2fec(0x12e)]),console['error'](_0x5a2fec(0x12b)+_0x3d9fbe[_0x5a2fec(0x15e)]));if(_0x3d9fbe[_0x5a2fec(0x12e)]==='folder')return console[_0x5a2fec(0x168)](_0x5a2fec(0xf7)),console[_0x5a2fec(0x168)](_0x5a2fec(0x159)),0x1;if(_0x3d9fbe[_0x5a2fec(0x12e)]===_0x5a2fec(0x120))return console[_0x5a2fec(0x168)]('Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x5a2fec(0x168)](_0x5a2fec(0x125)),0x1;if(!_0x3d9fbe[_0x5a2fec(0x114)])throw new SDKError(ErrorCode[_0x5a2fec(0x14d)],_0x5a2fec(0x167));const _0x46de48=await withSpinner(_0x5a2fec(0x14a),()=>_0x59bf4f[_0x5a2fec(0xf2)][_0x5a2fec(0x17c)](_0x3d9fbe[_0x5a2fec(0x15e)],_0x3d9fbe[_0x5a2fec(0x114)]),{'verbose':_0x3992a0['verbose']}),_0x4faf42=_0x46de48['data'];return _0x3992a0[_0x5a2fec(0x146)]===_0x5a2fec(0x11a)||_0x3992a0[_0x5a2fec(0x146)]===_0x5a2fec(0x15a)?await handleSDKOutput([{'sql':_0x4faf42}],_0x3992a0):console[_0x5a2fec(0xfb)](_0x4faf42),0x0;}catch(_0x51b928){if(_0x51b928 instanceof SDKError)return console[_0x5a2fec(0x168)](_0x5a2fec(0x113)+_0x51b928['message']),_0x51b928[_0x5a2fec(0x139)]&&console[_0x5a2fec(0x168)](_0x5a2fec(0x141)+_0x51b928[_0x5a2fec(0x139)]),0x1;throw _0x51b928;}}}function a31_0x46b2(){const _0x55e1a0=['36880461TLXGhu','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','toLocaleString','Use:\x20tdx\x20ps\x20view\x20-w','Resolved\x20folder\x20ID:\x20','json','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','Error:\x20Parent\x20segment\x20name\x20is\x20required','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','segment:folder:show','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','parent','length','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Use:\x20tdx\x20ps\x20sql','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','Usage:\x20tdx\x20segment\x20describe\x20<path>','parentSegment','5258400rtIWDv','Executing\x20segment\x20query...','Parent\x20ID:\x20','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','site','type','resolveFolderId','Resolved\x20type:\x20','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Examples:','getParent','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','\x20\x20Full\x20path:\x20','877136MTUWCG','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Folder\x20name:\x20','cause','Resolving\x20folder\x20\x27','segmentName','\x20folder','parentFolder','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','Resolving\x20parent\x20segment\x20\x27','3565GXRrWH','\x20\x20Cause:\x20','\x20\x20Parent\x20segment:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','Options:','limit','format','test','cyan','in\x20','Fetching\x20SQL\x20for\x20segment...','code','\x27...','SEGMENT_NOT_FOUND','trim','/app/ps/','folder','SELECT\x20*\x20FROM\x20(\x0a','(root)','verbose','resolveParentId','Parent\x20segment:\x20','replace','SQL\x20query:\x0a','message','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','jsonl','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','\x20[Job\x20ID:\x20','5167008uESukm','parentId','Parent\x20name:\x20','folderPath','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','\x20\x20Segment\x20name:\x20','web','✖\x20Query\x20failed\x20[','Segment\x20ID\x20missing\x20from\x20resolved\x20path','error','segment:view','Folder\x20ID:\x20','Use:\x20tdx\x20ps\x20desc','Show\x20segment\x20or\x20folder\x20details','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','✔\x20Created\x20folder\x20\x27','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','description','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','Site:\x20','Resolving\x20parent\x20folder\x20\x27','execute','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','stats','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','information_schema','INVALID_ARGUMENT','Resolving\x20\x27','getSegmentSQL','Target\x20path:\x20','Show\x20folder\x20or\x20child\x20segment\x20details','segment:folder:list','getFolder','Fetching\x20folder\x20details...','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Error:\x20Path\x20or\x20name\x20is\x20required','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','folderId','setJobId','getSegment','resolvePathToResource','Fetching\x20segment\x20details...','4458ASvzkO','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','jobId','listFolders','green','segment','1jIXWTb','3892036QiinjL','name','/e/','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','SEGMENT_FOLDER_NOT_FOUND','segmentPath','Resolved\x20parent\x20folder\x20ID:\x20','log','Use:\x20tdx\x20ps\x20view','\x27\x20with\x20ID:\x20','✔\x20Found\x20','\x20rows\x20','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','segment:describe','3904671uNFjuc','Usage:\x20tdx\x20sg\x20sql\x20<name>','Resolved\x20YAML\x20file:\x20','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','Resolved\x20parent\x20ID:\x20','query','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','Folder\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','segment:sql','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','Resolving\x20path\x20\x27','data','Fetching\x20parent\x20segment\x20details...','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','processedRows','fullPath','Error:\x20','segmentId'];a31_0x46b2=function(){return _0x55e1a0;};return a31_0x46b2();}export class SegmentFolderCreateCommand extends BaseCommand{['name']='segment:folder:create';[a31_0x5cf2c2(0x170)]='Create\x20segment\x20folder\x20for\x20organization';async[a31_0x5cf2c2(0x174)](_0x2b09e5){const _0x1090ec=a31_0x5cf2c2,{options:_0x23c89b,args:_0x5a7a5e,tdx:_0xbc85da}=_0x2b09e5,_0x51faf4=_0x23c89b;if(_0x5a7a5e['length']<0x2)return console['error'](_0x1090ec(0x162)),console['error'](_0x1090ec(0x13e)),0x1;const _0x121ac=_0x5a7a5e[0x0],_0x50492a=_0x5a7a5e[0x1];_0x51faf4['verbose']&&(console[_0x1090ec(0x168)](_0x1090ec(0x172)+_0x51faf4[_0x1090ec(0x12d)]),console[_0x1090ec(0x168)](_0x1090ec(0x155)+_0x121ac),console[_0x1090ec(0x168)](_0x1090ec(0x138)+_0x50492a));let _0x453867;if(_0x51faf4[_0x1090ec(0x13d)]){const _0x3c47aa=_0x51faf4[_0x1090ec(0x13d)],_0x4f2ca0=await withSpinner(_0x1090ec(0x13f)+_0x121ac+_0x1090ec(0x14c),()=>_0xbc85da[_0x1090ec(0xf2)]['resolveParentId'](_0x121ac),{'verbose':_0x51faf4[_0x1090ec(0x153)]}),_0x470e28=_0x4f2ca0[_0x1090ec(0x10e)],_0x3e7fea=await withSpinner(_0x1090ec(0x173)+_0x3c47aa+'\x27...',()=>_0xbc85da[_0x1090ec(0xf2)][_0x1090ec(0x12f)](_0x470e28,_0x3c47aa),{'verbose':_0x51faf4[_0x1090ec(0x153)]});_0x453867=_0x3e7fea[_0x1090ec(0x10e)],_0x51faf4['verbose']&&console[_0x1090ec(0x168)](_0x1090ec(0xfa)+_0x453867);}const _0x1f6d3e={'name':_0x50492a,'description':_0x51faf4[_0x1090ec(0x170)],'parentFolderId':_0x453867},_0x4f91aa=await withSpinner('Creating\x20folder\x20\x27'+_0x50492a+'\x27...',()=>_0xbc85da['segment']['createFolder'](_0x121ac,_0x1f6d3e),{'verbose':_0x51faf4[_0x1090ec(0x153)]}),_0x468ee6=_0x4f91aa[_0x1090ec(0x10e)];return console[_0x1090ec(0x168)](_0x1090ec(0x16e)+_0x468ee6[_0x1090ec(0xf5)]+_0x1090ec(0xfd)+_0x468ee6['id']),await handleSDKOutput([_0x468ee6],_0x51faf4),0x0;}}export class SegmentViewCommand extends BaseCommand{[a31_0x5cf2c2(0xf5)]=a31_0x5cf2c2(0x169);[a31_0x5cf2c2(0x170)]=a31_0x5cf2c2(0x17e);async[a31_0x5cf2c2(0x174)](_0x45f8a9){const _0x4b6435=a31_0x5cf2c2,{options:_0x2d1f0e,args:_0x2d25bc,tdx:_0x80bf4c}=_0x45f8a9,_0x33c37b=_0x2d25bc[0x0];if(!_0x33c37b)return console[_0x4b6435(0x168)](_0x4b6435(0x171)),console['error'](_0x4b6435(0x11d)),console[_0x4b6435(0x168)](_0x4b6435(0x123)),console[_0x4b6435(0x168)](_0x4b6435(0x144)),console[_0x4b6435(0x168)](_0x4b6435(0x12c)),console[_0x4b6435(0x168)](_0x4b6435(0x132)),console[_0x4b6435(0x168)](_0x4b6435(0x110)),console[_0x4b6435(0x168)](_0x4b6435(0x108)),console[_0x4b6435(0x168)](_0x4b6435(0x10a)),console[_0x4b6435(0x168)](_0x4b6435(0x10c)),0x1;try{const _0x1c23bd=_0x2d1f0e[_0x4b6435(0x128)],_0x22c23e=resolveSegmentTarget(_0x33c37b,_0x1c23bd,_0x2d1f0e['verbose']);_0x2d1f0e[_0x4b6435(0x153)]&&console[_0x4b6435(0x168)](_0x4b6435(0x17d)+_0x22c23e);const _0x4d87b5=await withSpinner('Resolving\x20\x27'+_0x33c37b+_0x4b6435(0x14c),()=>_0x80bf4c[_0x4b6435(0xf2)][_0x4b6435(0xeb)](_0x22c23e),{'verbose':_0x2d1f0e['verbose']}),_0x20d62b=_0x4d87b5['data'];_0x2d1f0e[_0x4b6435(0x153)]&&(console[_0x4b6435(0x168)]('Resolved\x20type:\x20'+_0x20d62b[_0x4b6435(0x12e)]),console['error']('Parent\x20ID:\x20'+_0x20d62b[_0x4b6435(0x15e)]),_0x20d62b['folderId']&&console[_0x4b6435(0x168)](_0x4b6435(0x16a)+_0x20d62b['folderId']),_0x20d62b[_0x4b6435(0x114)]&&console[_0x4b6435(0x168)]('Segment\x20ID:\x20'+_0x20d62b[_0x4b6435(0x114)]));if(_0x2d1f0e[_0x4b6435(0x165)]){if(_0x20d62b['type']===_0x4b6435(0x150))return console['error'](_0x4b6435(0x134)),0x1;if(_0x20d62b[_0x4b6435(0x12e)]===_0x4b6435(0x120))return console[_0x4b6435(0x168)](_0x4b6435(0x122)),console[_0x4b6435(0x168)](_0x4b6435(0x118)),0x1;if(!_0x20d62b[_0x4b6435(0x114)])throw new SDKError(ErrorCode[_0x4b6435(0x14d)],_0x4b6435(0x167));const _0x55adc7=getConsoleNextUrl(_0x2d1f0e[_0x4b6435(0x12d)],_0x4b6435(0x14f)+_0x20d62b['parentId']+'/e/'+_0x20d62b['segmentId']);return console['error'](a31_0xb205ff[_0x4b6435(0xf1)]('✔')+'\x20Opening\x20'+a31_0xb205ff[_0x4b6435(0x148)](_0x55adc7)),openBrowser(_0x55adc7),0x0;}if(_0x20d62b[_0x4b6435(0x12e)]==='folder'){if(!_0x20d62b[_0x4b6435(0xe8)])throw new SDKError(ErrorCode[_0x4b6435(0xf8)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x147aad=await withSpinner(_0x4b6435(0xe3),()=>_0x80bf4c[_0x4b6435(0xf2)][_0x4b6435(0xe2)](_0x20d62b['folderId']),{'verbose':_0x2d1f0e['verbose']});await handleSingleObjectOutput(_0x147aad[_0x4b6435(0x10e)],_0x2d1f0e);}else{if(_0x20d62b[_0x4b6435(0x12e)]===_0x4b6435(0xf2)){if(!_0x20d62b[_0x4b6435(0x114)])throw new SDKError(ErrorCode[_0x4b6435(0x14d)],_0x4b6435(0x167));const _0x1dd2f4=await withSpinner(_0x4b6435(0xec),()=>_0x80bf4c['segment'][_0x4b6435(0xea)](_0x20d62b['parentId'],_0x20d62b[_0x4b6435(0x114)]),{'verbose':_0x2d1f0e[_0x4b6435(0x153)]}),_0x2911e8=getConsoleNextUrl(_0x2d1f0e[_0x4b6435(0x12d)],_0x4b6435(0x14f)+_0x20d62b[_0x4b6435(0x15e)]+_0x4b6435(0xf6)+_0x20d62b[_0x4b6435(0x114)]),_0x31f936=_0x1dd2f4['data'];_0x31f936['url']=_0x2911e8,await handleSingleObjectOutput(_0x31f936,_0x2d1f0e);}else return console[_0x4b6435(0x168)](_0x4b6435(0x178)),console[_0x4b6435(0x168)](_0x4b6435(0xfc)),0x1;}return 0x0;}catch(_0x12897b){if(_0x12897b instanceof SDKError)return console['error'](_0x4b6435(0x113)+_0x12897b[_0x4b6435(0x158)]),_0x12897b[_0x4b6435(0x139)]&&console[_0x4b6435(0x168)](_0x4b6435(0x141)+_0x12897b['cause']),0x1;throw _0x12897b;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a31_0x5cf2c2(0xf5)]='segment:desc';['description']='Show\x20child\x20segment\x20schema\x20(column\x20types)';async[a31_0x5cf2c2(0x174)](_0x3fd599){const _0x2e65f0=a31_0x5cf2c2,{options:_0x55e9ea,args:_0x28f363,tdx:_0x514c64}=_0x3fd599,_0xdd700d=_0x28f363[0x0];if(!_0xdd700d)return console['error'](_0x2e65f0(0x161)),console[_0x2e65f0(0x168)]('Usage:\x20tdx\x20sg\x20desc\x20<name>'),console[_0x2e65f0(0x168)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>'),console[_0x2e65f0(0x168)](_0x2e65f0(0x132)),console[_0x2e65f0(0x168)]('\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22'),console[_0x2e65f0(0x168)](_0x2e65f0(0x163)),0x1;try{const _0x4f6097=_0x55e9ea[_0x2e65f0(0x128)],_0x7994d4=resolveSegmentTarget(_0xdd700d,_0x4f6097,_0x55e9ea['verbose']);_0x55e9ea['verbose']&&console['error'](_0x2e65f0(0x17d)+_0x7994d4);const _0x565406=await withSpinner(_0x2e65f0(0x17b)+_0xdd700d+'\x27...',()=>_0x514c64['segment'][_0x2e65f0(0xeb)](_0x7994d4),{'verbose':_0x55e9ea['verbose']}),_0x505c5e=_0x565406[_0x2e65f0(0x10e)];_0x55e9ea[_0x2e65f0(0x153)]&&(console[_0x2e65f0(0x168)](_0x2e65f0(0x130)+_0x505c5e[_0x2e65f0(0x12e)]),console[_0x2e65f0(0x168)](_0x2e65f0(0x12b)+_0x505c5e['parentId']));if(_0x505c5e[_0x2e65f0(0x12e)]==='folder')return console[_0x2e65f0(0x168)](_0x2e65f0(0x16f)),console[_0x2e65f0(0x168)](_0x2e65f0(0x159)),0x1;if(_0x505c5e[_0x2e65f0(0x12e)]===_0x2e65f0(0x120))return console[_0x2e65f0(0x168)](_0x2e65f0(0x116)),console[_0x2e65f0(0x168)](_0x2e65f0(0x16b)),0x1;if(!_0x505c5e[_0x2e65f0(0x114)])throw new SDKError(ErrorCode[_0x2e65f0(0x14d)],_0x2e65f0(0x167));const _0x1c435a=await withSpinner(_0x2e65f0(0x14a),()=>_0x514c64['segment'][_0x2e65f0(0x17c)](_0x505c5e['parentId'],_0x505c5e[_0x2e65f0(0x114)]),{'verbose':_0x55e9ea[_0x2e65f0(0x153)]}),_0x3570e0=_0x1c435a[_0x2e65f0(0x10e)],_0x50c679=await executeSchemaQuery(_0x3570e0,_0x514c64,_0x55e9ea);return await handleQueryOutput(_0x50c679,_0x55e9ea),0x0;}catch(_0x5459aa){if(_0x5459aa instanceof SDKError)return console[_0x2e65f0(0x168)](_0x2e65f0(0x113)+_0x5459aa[_0x2e65f0(0x158)]),_0x5459aa[_0x2e65f0(0x139)]&&console[_0x2e65f0(0x168)](_0x2e65f0(0x141)+_0x5459aa[_0x2e65f0(0x139)]),0x1;throw _0x5459aa;}}}
@@ -1 +1 @@
1
- const a32_0x57785c=a32_0x1b34;(function(_0x4b8ad6,_0x438369){const _0x1fcf87=a32_0x1b34,_0x24df40=_0x4b8ad6();while(!![]){try{const _0x55a55e=parseInt(_0x1fcf87(0x135))/0x1*(-parseInt(_0x1fcf87(0x141))/0x2)+parseInt(_0x1fcf87(0x13e))/0x3*(parseInt(_0x1fcf87(0x136))/0x4)+parseInt(_0x1fcf87(0x137))/0x5+parseInt(_0x1fcf87(0x149))/0x6*(parseInt(_0x1fcf87(0x140))/0x7)+parseInt(_0x1fcf87(0x11e))/0x8+parseInt(_0x1fcf87(0x13d))/0x9+parseInt(_0x1fcf87(0x118))/0xa*(-parseInt(_0x1fcf87(0x147))/0xb);if(_0x55a55e===_0x438369)break;else _0x24df40['push'](_0x24df40['shift']());}catch(_0x5ea9dc){_0x24df40['push'](_0x24df40['shift']());}}}(a32_0x41a9,0xd3e34));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../utils/segment-path-parser.js';function a32_0x1b34(_0x2ad2ba,_0x509a7f){_0x2ad2ba=_0x2ad2ba-0x117;const _0x41a974=a32_0x41a9();let _0x1b3452=_0x41a974[_0x2ad2ba];return _0x1b3452;}import a32_0x2f3d3d from'chalk';export class SegmentCreateCommand extends BaseCommand{[a32_0x57785c(0x145)]=a32_0x57785c(0x12e);['description']=a32_0x57785c(0x12c);async[a32_0x57785c(0x128)](_0x5d0e5a){const _0x5492d4=a32_0x57785c;console[_0x5492d4(0x14d)](a32_0x2f3d3d['yellow'](_0x5492d4(0x13b))),console[_0x5492d4(0x14d)](a32_0x2f3d3d[_0x5492d4(0x123)](_0x5492d4(0x134)));const {options:_0x25328b,args:_0xdc7455,tdx:_0x5e9db1}=_0x5d0e5a,_0x995773=_0x25328b;if(_0xdc7455[_0x5492d4(0x148)]===0x0)return console['error'](_0x5492d4(0x127)),console['error']('Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]'),console[_0x5492d4(0x14d)](_0x5492d4(0x14a)),console[_0x5492d4(0x14d)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27'),console[_0x5492d4(0x14d)](_0x5492d4(0x11a)),console[_0x5492d4(0x14d)](_0x5492d4(0x12b)),0x1;const _0x5c8de4=_0xdc7455[0x0],_0x3bc4ae=_0x25328b['segmentPath'];let _0x5330a1=_0x5c8de4;_0x3bc4ae&&!_0x5c8de4[_0x5492d4(0x12f)]('/')&&(_0x5330a1=_0x3bc4ae+'/'+_0x5c8de4,_0x995773['verbose']&&console[_0x5492d4(0x14d)](_0x5492d4(0x142)+_0x5330a1));const _0x5756ac=parsePath(_0x5330a1);if(_0x5756ac[_0x5492d4(0x133)][_0x5492d4(0x148)]<0x2)return console['error'](_0x5492d4(0x11d)),console[_0x5492d4(0x14d)]('Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]'),0x1;const _0x47189a=_0x5756ac[_0x5492d4(0x133)][0x0],_0x3d2b53=getBaseName(_0x5330a1),_0x31b10a=getParentPath(_0x5330a1);_0x995773[_0x5492d4(0x12a)]&&(console[_0x5492d4(0x14d)](_0x5492d4(0x146)+_0x995773[_0x5492d4(0x124)]),console[_0x5492d4(0x14d)](_0x5492d4(0x126)+_0x5330a1),console[_0x5492d4(0x14d)](_0x5492d4(0x11c)+_0x47189a),console[_0x5492d4(0x14d)]('Segment\x20name:\x20'+_0x3d2b53),console['error'](_0x5492d4(0x11f)+_0x31b10a));const _0x26ec37=await withSpinner(_0x5492d4(0x11b)+_0x47189a+'\x27...',()=>_0x5e9db1[_0x5492d4(0x117)][_0x5492d4(0x13a)](_0x47189a),{'verbose':_0x995773[_0x5492d4(0x12a)]}),_0x1ae165=_0x26ec37['data'];let _0x178192;if(_0x5756ac[_0x5492d4(0x133)][_0x5492d4(0x148)]>0x2){const _0x230672=await withSpinner(_0x5492d4(0x129)+_0x31b10a+_0x5492d4(0x138),()=>_0x5e9db1['segment'][_0x5492d4(0x12d)](_0x31b10a),{'verbose':_0x995773[_0x5492d4(0x12a)]}),_0x2efa13=_0x230672[_0x5492d4(0x120)];if(_0x2efa13[_0x5492d4(0x130)]!==_0x5492d4(0x122)&&_0x2efa13[_0x5492d4(0x130)]!=='parent')return console[_0x5492d4(0x14d)](_0x5492d4(0x125)),0x1;_0x178192=_0x2efa13[_0x5492d4(0x132)];}else{if(_0x995773[_0x5492d4(0x122)]){const _0x428d70=await withSpinner(_0x5492d4(0x139)+_0x995773[_0x5492d4(0x122)]+'\x27...',()=>_0x5e9db1[_0x5492d4(0x117)][_0x5492d4(0x13c)](_0x1ae165,_0x995773[_0x5492d4(0x122)]),{'verbose':_0x995773['verbose']});_0x178192=_0x428d70['data'];}}_0x995773[_0x5492d4(0x12a)]&&_0x178192&&console[_0x5492d4(0x14d)](_0x5492d4(0x121)+_0x178192);const _0x46136f=await loadJSONFromOptions(_0x995773[_0x5492d4(0x143)],_0x995773[_0x5492d4(0x14b)]),_0x1b0712={'name':_0x3d2b53,'description':_0x995773[_0x5492d4(0x13f)],'rule':_0x46136f,'kind':_0x995773[_0x5492d4(0x119)]!==undefined?parseInt(_0x995773['kind'],0xa):undefined,'isVisible':_0x995773['invisible']?![]:undefined,'segmentFolderId':_0x178192,'countPopulation':_0x995773['noCountPopulation']?![]:undefined},_0x1e2d7b=await withSpinner('Creating\x20segment\x20\x27'+_0x3d2b53+_0x5492d4(0x138),()=>_0x5e9db1[_0x5492d4(0x117)][_0x5492d4(0x14c)](_0x1ae165,_0x1b0712),{'verbose':_0x995773[_0x5492d4(0x12a)]}),_0xf4730f=_0x1e2d7b[_0x5492d4(0x120)];return console['error'](_0x5492d4(0x131)+_0xf4730f[_0x5492d4(0x145)]+_0x5492d4(0x144)+_0xf4730f['id']),_0x5330a1!==_0x5c8de4&&console[_0x5492d4(0x14d)]('\x20\x20\x20Path:\x20'+_0x5330a1),await handleSDKOutput([_0xf4730f],_0x995773),0x0;}}function a32_0x41a9(){const _0xdd0ca1=['Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','Target\x20path:\x20','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','execute','Resolving\x20folder\x20path\x20\x27','verbose','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Create\x20child\x20segment\x20with\x20filtering\x20rules','resolvePathToResource','segment:create','includes','type','✔\x20Created\x20segment\x20\x27','folderId','segments','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','2ZVPFwQ','685804qNKVTr','7297490BxHRFH','\x27...','Resolving\x20folder\x20\x27','resolveParentId','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','resolveFolderId','13896459OnwICW','15emveKJ','description','7DnXZcB','603832zJRCbH','Resolved\x20relative\x20path\x20to:\x20','rule','\x27\x20with\x20ID:\x20','name','Site:\x20','519805XRiEiY','length','9581610OKOwxW','Examples:','ruleFile','createSegment','error','segment','890juhAOj','kind','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','Resolving\x20parent\x20segment\x20\x27','Parent:\x20','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','1757440NWrBuR','Parent\x20path:\x20','data','Resolved\x20folder\x20ID:\x20','folder','yellow','site'];a32_0x41a9=function(){return _0xdd0ca1;};return a32_0x41a9();}
1
+ const a32_0x3b9f40=a32_0x391d;(function(_0x2c6f29,_0x274ac8){const _0x155214=a32_0x391d,_0x547b7b=_0x2c6f29();while(!![]){try{const _0x311f4f=parseInt(_0x155214(0x1bd))/0x1*(parseInt(_0x155214(0x1c8))/0x2)+-parseInt(_0x155214(0x1d9))/0x3+parseInt(_0x155214(0x1db))/0x4+parseInt(_0x155214(0x1be))/0x5+-parseInt(_0x155214(0x1c4))/0x6*(-parseInt(_0x155214(0x1d1))/0x7)+-parseInt(_0x155214(0x1da))/0x8+-parseInt(_0x155214(0x1bc))/0x9*(-parseInt(_0x155214(0x1ab))/0xa);if(_0x311f4f===_0x274ac8)break;else _0x547b7b['push'](_0x547b7b['shift']());}catch(_0x5b97e5){_0x547b7b['push'](_0x547b7b['shift']());}}}(a32_0x4cc2,0x87540));import{BaseCommand}from'./command.js';function a32_0x391d(_0x5b3a52,_0x46c9f2){_0x5b3a52=_0x5b3a52-0x1a8;const _0x4cc2a7=a32_0x4cc2();let _0x391d11=_0x4cc2a7[_0x5b3a52];return _0x391d11;}import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../utils/segment-path-parser.js';import a32_0x13c691 from'chalk';export class SegmentCreateCommand extends BaseCommand{['name']=a32_0x3b9f40(0x1d5);[a32_0x3b9f40(0x1dc)]='Create\x20child\x20segment\x20with\x20filtering\x20rules';async[a32_0x3b9f40(0x1c3)](_0x2fa631){const _0x534626=a32_0x3b9f40;console[_0x534626(0x1c6)](a32_0x13c691['yellow']('⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.')),console[_0x534626(0x1c6)](a32_0x13c691[_0x534626(0x1cb)](_0x534626(0x1b9)));const {options:_0x993faa,args:_0x9bc9a0,tdx:_0x341180}=_0x2fa631,_0x2ca7c6=_0x993faa;if(_0x9bc9a0[_0x534626(0x1b3)]===0x0)return console[_0x534626(0x1c6)](_0x534626(0x1cf)),console[_0x534626(0x1c6)]('Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]'),console[_0x534626(0x1c6)](_0x534626(0x1cc)),console[_0x534626(0x1c6)](_0x534626(0x1af)),console['error'](_0x534626(0x1ce)),console[_0x534626(0x1c6)](_0x534626(0x1b5)),0x1;const _0x4cc4ef=_0x9bc9a0[0x0],_0x49d5e2=_0x993faa['segmentPath'];let _0x2aeaab=_0x4cc4ef;_0x49d5e2&&!_0x4cc4ef[_0x534626(0x1d3)]('/')&&(_0x2aeaab=_0x49d5e2+'/'+_0x4cc4ef,_0x2ca7c6['verbose']&&console[_0x534626(0x1c6)]('Resolved\x20relative\x20path\x20to:\x20'+_0x2aeaab));const _0x2bcd66=parsePath(_0x2aeaab);if(_0x2bcd66[_0x534626(0x1c7)][_0x534626(0x1b3)]<0x2)return console[_0x534626(0x1c6)]('Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)'),console[_0x534626(0x1c6)]('Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]'),0x1;const _0x541ff0=_0x2bcd66['segments'][0x0],_0xbee0a7=getBaseName(_0x2aeaab),_0x510d03=getParentPath(_0x2aeaab);_0x2ca7c6['verbose']&&(console[_0x534626(0x1c6)](_0x534626(0x1c0)+_0x2ca7c6['site']),console[_0x534626(0x1c6)](_0x534626(0x1b8)+_0x2aeaab),console[_0x534626(0x1c6)](_0x534626(0x1a9)+_0x541ff0),console['error'](_0x534626(0x1bf)+_0xbee0a7),console['error'](_0x534626(0x1ad)+_0x510d03));const _0x480f2d=await withSpinner(_0x534626(0x1ae)+_0x541ff0+_0x534626(0x1ba),()=>_0x341180[_0x534626(0x1c1)][_0x534626(0x1b7)](_0x541ff0),{'verbose':_0x2ca7c6[_0x534626(0x1d6)]}),_0x2c2f5d=_0x480f2d[_0x534626(0x1d7)];let _0x2e4211;if(_0x2bcd66[_0x534626(0x1c7)][_0x534626(0x1b3)]>0x2){const _0x19b922=await withSpinner(_0x534626(0x1b2)+_0x510d03+_0x534626(0x1ba),()=>_0x341180['segment'][_0x534626(0x1bb)](_0x510d03),{'verbose':_0x2ca7c6['verbose']}),_0x947ef9=_0x19b922['data'];if(_0x947ef9['type']!==_0x534626(0x1aa)&&_0x947ef9[_0x534626(0x1d4)]!==_0x534626(0x1b1))return console['error'](_0x534626(0x1b0)),0x1;_0x2e4211=_0x947ef9[_0x534626(0x1ca)];}else{if(_0x2ca7c6[_0x534626(0x1aa)]){const _0x199d2f=await withSpinner(_0x534626(0x1cd)+_0x2ca7c6[_0x534626(0x1aa)]+_0x534626(0x1ba),()=>_0x341180['segment'][_0x534626(0x1b6)](_0x2c2f5d,_0x2ca7c6[_0x534626(0x1aa)]),{'verbose':_0x2ca7c6['verbose']});_0x2e4211=_0x199d2f[_0x534626(0x1d7)];}}_0x2ca7c6[_0x534626(0x1d6)]&&_0x2e4211&&console[_0x534626(0x1c6)]('Resolved\x20folder\x20ID:\x20'+_0x2e4211);const _0x49679a=await loadJSONFromOptions(_0x2ca7c6[_0x534626(0x1ac)],_0x2ca7c6[_0x534626(0x1c9)]),_0x28fc4c={'name':_0xbee0a7,'description':_0x2ca7c6[_0x534626(0x1dc)],'rule':_0x49679a,'kind':_0x2ca7c6[_0x534626(0x1c2)]!==undefined?parseInt(_0x2ca7c6[_0x534626(0x1c2)],0xa):undefined,'isVisible':_0x2ca7c6[_0x534626(0x1c5)]?![]:undefined,'segmentFolderId':_0x2e4211,'countPopulation':_0x2ca7c6[_0x534626(0x1d2)]?![]:undefined},_0x115143=await withSpinner('Creating\x20segment\x20\x27'+_0xbee0a7+_0x534626(0x1ba),()=>_0x341180[_0x534626(0x1c1)][_0x534626(0x1d0)](_0x2c2f5d,_0x28fc4c),{'verbose':_0x2ca7c6[_0x534626(0x1d6)]}),_0x4b2238=_0x115143[_0x534626(0x1d7)];return console[_0x534626(0x1c6)](_0x534626(0x1a8)+_0x4b2238[_0x534626(0x1b4)]+'\x27\x20with\x20ID:\x20'+_0x4b2238['id']),_0x2aeaab!==_0x4cc4ef&&console['error'](_0x534626(0x1d8)+_0x2aeaab),await handleSDKOutput([_0x4b2238],_0x2ca7c6),0x0;}}function a32_0x4cc2(){const _0x1e7e17=['Segment\x20name:\x20','Site:\x20','segment','kind','execute','5442VXRPkn','invisible','error','segments','2aLAHmL','ruleFile','folderId','yellow','Examples:','Resolving\x20folder\x20\x27','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','createSegment','1547YlFvDK','noCountPopulation','includes','type','segment:create','verbose','data','\x20\x20\x20Path:\x20','3191307NRHtGt','6551128omqBtg','3477088jQYUhR','description','✔\x20Created\x20segment\x20\x27','Parent:\x20','folder','80eokbLF','rule','Parent\x20path:\x20','Resolving\x20parent\x20segment\x20\x27','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','parent','Resolving\x20folder\x20path\x20\x27','length','name','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','resolveFolderId','resolveParentId','Target\x20path:\x20','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','\x27...','resolvePathToResource','396009TRnmKr','123078OIqXCe','4460795yXihPJ'];a32_0x4cc2=function(){return _0x1e7e17;};return a32_0x4cc2();}