@treasuredata/tdx 0.25.0 → 0.25.2

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 (163) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/chat-command.js +1 -1
  11. package/dist/commands/claude-command.js +1 -1
  12. package/dist/commands/claude-statusline-command.js +1 -1
  13. package/dist/commands/claude-usage-command.js +1 -1
  14. package/dist/commands/command.js +1 -1
  15. package/dist/commands/connection-command.js +1 -1
  16. package/dist/commands/databases.js +1 -1
  17. package/dist/commands/describe.js +1 -1
  18. package/dist/commands/engage-command.js +1 -1
  19. package/dist/commands/job-command.js +1 -1
  20. package/dist/commands/journey-command.js +1 -1
  21. package/dist/commands/journey-validate-command.js +1 -1
  22. package/dist/commands/llm-command.js +1 -1
  23. package/dist/commands/mcp-command.js +1 -1
  24. package/dist/commands/parent-segment-command.js +1 -1
  25. package/dist/commands/profile-command.js +1 -1
  26. package/dist/commands/profiles-command.js +1 -1
  27. package/dist/commands/query-command.js +1 -1
  28. package/dist/commands/schedule-command.js +1 -1
  29. package/dist/commands/segment-command.js +1 -1
  30. package/dist/commands/segment-create-command.js +1 -1
  31. package/dist/commands/segment-fields-command.js +1 -1
  32. package/dist/commands/segment-pull-command.js +1 -1
  33. package/dist/commands/segment-push-command.js +1 -1
  34. package/dist/commands/segment-update-command.js +1 -1
  35. package/dist/commands/segment-use-command.js +1 -1
  36. package/dist/commands/segment-validate-command.js +1 -1
  37. package/dist/commands/segments.js +1 -1
  38. package/dist/commands/show.js +1 -1
  39. package/dist/commands/status-command.js +1 -1
  40. package/dist/commands/tables.js +1 -1
  41. package/dist/commands/unset-command.js +1 -1
  42. package/dist/commands/use-command.js +1 -1
  43. package/dist/commands/user-command.js +1 -1
  44. package/dist/commands/workflow-command.js +1 -1
  45. package/dist/core/auth.js +1 -1
  46. package/dist/core/command-output.js +1 -1
  47. package/dist/core/config.js +1 -1
  48. package/dist/core/connection-cache.js +1 -1
  49. package/dist/core/constants.js +1 -1
  50. package/dist/core/credential-cache.js +1 -1
  51. package/dist/core/global-context.js +1 -1
  52. package/dist/core/keychain.js +1 -1
  53. package/dist/core/profile.js +1 -1
  54. package/dist/core/project-config.js +1 -1
  55. package/dist/core/session.js +1 -1
  56. package/dist/core/user-cache.js +1 -1
  57. package/dist/core/version.js +1 -1
  58. package/dist/index.js +1 -1
  59. package/dist/mcp/server.js +1 -1
  60. package/dist/mcp/tools/index.js +1 -1
  61. package/dist/mcp/tools/tdx-run.js +1 -1
  62. package/dist/mcp/tools/tdx-search.js +1 -1
  63. package/dist/mcp/utils.js +1 -1
  64. package/dist/proxy/claude-usage-tracker.js +1 -1
  65. package/dist/proxy/passthrough-server.js +1 -1
  66. package/dist/proxy/sse-usage-parser.js +1 -1
  67. package/dist/sdk/agent/agent-config.js +1 -1
  68. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  69. package/dist/sdk/agent/agent-yaml.js +1 -1
  70. package/dist/sdk/agent/test/evaluator.js +1 -1
  71. package/dist/sdk/agent/test/executor.js +1 -1
  72. package/dist/sdk/agent/test/index.js +1 -1
  73. package/dist/sdk/agent/test/output.js +1 -1
  74. package/dist/sdk/agent/test/parser.js +1 -1
  75. package/dist/sdk/api.js +1 -1
  76. package/dist/sdk/client/cdp-api-client.js +1 -1
  77. package/dist/sdk/client/endpoints.js +1 -1
  78. package/dist/sdk/client/engage-api-client.js +1 -1
  79. package/dist/sdk/client/http-client.js +1 -1
  80. package/dist/sdk/client/llm-api-client.js +1 -1
  81. package/dist/sdk/client/rate-limiter.js +1 -1
  82. package/dist/sdk/client/td-api-client.js +1 -1
  83. package/dist/sdk/client/trino-api-client.js +1 -1
  84. package/dist/sdk/client/workflow-client.js +1 -1
  85. package/dist/sdk/connection-validator.js +1 -1
  86. package/dist/sdk/connection.js +1 -1
  87. package/dist/sdk/engage.js +1 -1
  88. package/dist/sdk/errors.js +1 -1
  89. package/dist/sdk/index.js +1 -1
  90. package/dist/sdk/io/index.js +1 -1
  91. package/dist/sdk/io/node-filesystem.js +1 -1
  92. package/dist/sdk/job.js +1 -1
  93. package/dist/sdk/journey.js +1 -1
  94. package/dist/sdk/llm/chat-cache.js +1 -1
  95. package/dist/sdk/llm/index.js +1 -1
  96. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  97. package/dist/sdk/llm/model-factors.js +1 -1
  98. package/dist/sdk/query/index.js +1 -1
  99. package/dist/sdk/query/sql-parser.js +1 -1
  100. package/dist/sdk/schedule.js +1 -1
  101. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  102. package/dist/sdk/segment/fields-display.js +1 -1
  103. package/dist/sdk/segment/file-discovery.js +1 -1
  104. package/dist/sdk/segment/journey-utils.js +1 -1
  105. package/dist/sdk/segment/journey-yaml.js +1 -1
  106. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  107. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  108. package/dist/sdk/segment/pull-workflow.js +1 -1
  109. package/dist/sdk/segment/push-workflow.js +1 -1
  110. package/dist/sdk/segment/resolution-context.js +1 -1
  111. package/dist/sdk/segment/segment-path-parser.js +1 -1
  112. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  113. package/dist/sdk/segment/target-resolution.js +1 -1
  114. package/dist/sdk/segment/tdx-config.js +1 -1
  115. package/dist/sdk/segment/validate-files.js +1 -1
  116. package/dist/sdk/segment/yaml-validator.js +1 -1
  117. package/dist/sdk/segment.js +1 -1
  118. package/dist/sdk/types/index.js +1 -1
  119. package/dist/sdk/types/progress.js +1 -1
  120. package/dist/sdk/user.js +1 -1
  121. package/dist/sdk/util/format-detector.js +1 -1
  122. package/dist/sdk/util/formatters.js +1 -1
  123. package/dist/sdk/util/index.js +1 -1
  124. package/dist/sdk/util/tree-formatter.js +1 -1
  125. package/dist/sdk/workflow/archive-validation.js +1 -1
  126. package/dist/sdk/workflow/clone-workflow.js +1 -1
  127. package/dist/sdk/workflow/index.js +1 -1
  128. package/dist/sdk/workflow/pull-workflow.js +1 -1
  129. package/dist/sdk/workflow/push-workflow.js +1 -1
  130. package/dist/sdk/workflow/tdx-config.js +1 -1
  131. package/dist/sdk/workflow/workflow-utils.js +1 -1
  132. package/dist/test-utils/command-runner.js +1 -1
  133. package/dist/test-utils/factories.js +1 -1
  134. package/dist/test-utils/fixtures.js +1 -1
  135. package/dist/test-utils/http-mock.js +1 -1
  136. package/dist/test-utils/index.js +1 -1
  137. package/dist/utils/async.js +1 -1
  138. package/dist/utils/colors.js +1 -1
  139. package/dist/utils/diff.js +1 -1
  140. package/dist/utils/file-permissions.js +1 -1
  141. package/dist/utils/global-cache.js +1 -1
  142. package/dist/utils/json-loader.js +1 -1
  143. package/dist/utils/local-cache.js +1 -1
  144. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  145. package/dist/utils/logger/formatters/index.js +1 -1
  146. package/dist/utils/logger/handlers/console-handler.js +1 -1
  147. package/dist/utils/logger/handlers/file-handler.js +1 -1
  148. package/dist/utils/logger/handlers/index.js +1 -1
  149. package/dist/utils/logger/handlers/null-handler.js +1 -1
  150. package/dist/utils/logger/index.js +1 -1
  151. package/dist/utils/logger/logger.js +1 -1
  152. package/dist/utils/logger/types.js +1 -1
  153. package/dist/utils/option-validation.js +1 -1
  154. package/dist/utils/port.js +1 -1
  155. package/dist/utils/process.js +1 -1
  156. package/dist/utils/prompt.js +1 -1
  157. package/dist/utils/spinner.js +1 -1
  158. package/dist/utils/sse-parser.js +1 -1
  159. package/dist/utils/string-utils.js +1 -1
  160. package/dist/utils/table-ref-parser.js +1 -1
  161. package/dist/utils/tdx-logger.js +1 -1
  162. package/dist/utils/version-check.js +1 -1
  163. package/package.json +1 -1
@@ -1 +1 @@
1
- const a22_0x46829f=a22_0x33a2;(function(_0xc4aa2c,_0x447b85){const _0x929727=a22_0x33a2,_0xbd4d5f=_0xc4aa2c();while(!![]){try{const _0x5926ae=parseInt(_0x929727(0x1bc))/0x1+parseInt(_0x929727(0x1dd))/0x2+parseInt(_0x929727(0x234))/0x3+parseInt(_0x929727(0x182))/0x4+-parseInt(_0x929727(0x1cf))/0x5*(-parseInt(_0x929727(0x238))/0x6)+parseInt(_0x929727(0x167))/0x7*(parseInt(_0x929727(0x1ec))/0x8)+-parseInt(_0x929727(0x1b2))/0x9*(parseInt(_0x929727(0x1d4))/0xa);if(_0x5926ae===_0x447b85)break;else _0xbd4d5f['push'](_0xbd4d5f['shift']());}catch(_0x5c6873){_0xbd4d5f['push'](_0xbd4d5f['shift']());}}}(a22_0x1d94,0x3382b));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';function a22_0x33a2(_0x46d407,_0x29a936){_0x46d407=_0x46d407-0x145;const _0x1d94ba=a22_0x1d94();let _0x33a2d4=_0x1d94ba[_0x46d407];return _0x33a2d4;}import a22_0x188799 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,createCommandSpinner,formatElapsed}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{getConsoleUrl,getConsoleNextUrl}from'../sdk/client/endpoints.js';import{formatRows,formatAsTable,hyperlink}from'../sdk/util/formatters.js';import{parseDef}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import a22_0x225566 from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../sdk/segment/fields-display.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';const PARENT_SEGMENT_DIR=a22_0x46829f(0x259),LEGACY_PARENT_SEGMENT_DIR=a22_0x46829f(0x240);function openBrowser(_0x407895){const _0x416344=a22_0x46829f,_0x4fb800=process[_0x416344(0x285)],_0x4e65cf=_0x4fb800===_0x416344(0x171)?_0x416344(0x14c):_0x4fb800===_0x416344(0x19d)?_0x416344(0x19c):_0x416344(0x149);spawn(_0x4e65cf,[_0x407895],{'detached':!![],'stdio':_0x416344(0x20b)})['unref']();}function migrateLegacyDirectory(){const _0x3f7545=a22_0x46829f;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x37d454=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x37d454[_0x3f7545(0x152)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x3f7545(0x248)](a22_0x225566[_0x3f7545(0x19b)](_0x3f7545(0x211)+LEGACY_PARENT_SEGMENT_DIR+'/\x20and\x20'+PARENT_SEGMENT_DIR+_0x3f7545(0x1e6))),console[_0x3f7545(0x248)](a22_0x225566[_0x3f7545(0x1f0)](_0x3f7545(0x26d)+LEGACY_PARENT_SEGMENT_DIR+'/\x20directory.\x0a')),![];console[_0x3f7545(0x248)](a22_0x225566[_0x3f7545(0x19b)](_0x3f7545(0x1d7)+LEGACY_PARENT_SEGMENT_DIR+_0x3f7545(0x27c)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x3f7545(0x248)](a22_0x225566[_0x3f7545(0x1d3)](_0x3f7545(0x188)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x108503){const _0x4b9d71=_0x108503 instanceof Error?_0x108503[_0x3f7545(0x18f)]:String(_0x108503);return console[_0x3f7545(0x248)](a22_0x225566[_0x3f7545(0x1b4)](_0x3f7545(0x1d8)+_0x4b9d71+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async['run'](_0x2077ae){const _0x303760=a22_0x46829f;return migrateLegacyDirectory(),super[_0x303760(0x1c4)](_0x2077ae);}}function resolveYamlFile(_0x5e3ed4){const _0x489b52=a22_0x46829f;if(_0x5e3ed4['endsWith']('.yml')||_0x5e3ed4['endsWith'](_0x489b52(0x269)))return _0x5e3ed4;return a22_0x188799[_0x489b52(0x1a1)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x5e3ed4)+_0x489b52(0x185));}function formatProgressMessage(_0x582c4a){const _0x3e5df7=a22_0x46829f,_0x1799fc=_0x582c4a['match'](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x1799fc){const [,_0xf85cf6,_0x39634b,_0x436638='']=_0x1799fc;return a22_0x225566[_0x3e5df7(0x1f0)](_0xf85cf6+':')+'\x20'+_0x39634b+a22_0x225566[_0x3e5df7(0x1f0)](_0x436638);}return a22_0x225566['dim'](_0x582c4a);}function showFileNotFoundError(_0x23b35e,_0x596d6b){const _0x5bb309=a22_0x46829f;console[_0x5bb309(0x248)](a22_0x225566['red']('Error:\x20File\x20not\x20found:\x20'+_0x23b35e+'\x0a')),console[_0x5bb309(0x248)](a22_0x225566[_0x5bb309(0x159)]('Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20'+_0x596d6b+_0x5bb309(0x26c)));}function showParentSegmentNotSetError(_0x32e614){const _0x3096ee=a22_0x46829f;console[_0x3096ee(0x248)](a22_0x225566['yellow']('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x3096ee(0x248)](_0x32e614);}export class ParentSegmentListCommand extends BaseCommand{[a22_0x46829f(0x151)]=a22_0x46829f(0x247);[a22_0x46829f(0x1e9)]='List\x20parent\x20segments';async['execute'](_0x578159){const _0x33f4ea=a22_0x46829f,{options:_0xff0696,args:_0xda7a57,tdx:_0x37b977}=_0x578159,_0x42d45c=_0xda7a57[0x0];_0xff0696['verbose']&&(console['error'](_0x33f4ea(0x215)+_0xff0696[_0x33f4ea(0x27d)]),_0x42d45c&&console[_0x33f4ea(0x248)](_0x33f4ea(0x16f)+_0x42d45c));const _0x32d83c=await withSpinner(_0x42d45c?_0x33f4ea(0x21e)+_0x42d45c+_0x33f4ea(0x178):'Listing\x20parent\x20segments...',()=>_0x37b977['segment'][_0x33f4ea(0x25a)](),{'verbose':_0xff0696[_0x33f4ea(0x24c)]});let _0xe67f09=_0x32d83c[_0x33f4ea(0x241)];if(_0x42d45c){const _0x3b30d6=_0x42d45c[_0x33f4ea(0x1ca)](/[.+^${}()|[\]\\]/g,_0x33f4ea(0x192))[_0x33f4ea(0x1ca)](/\*/g,'.*')[_0x33f4ea(0x1ca)](/\?/g,'.'),_0x448ca5=new RegExp('^'+_0x3b30d6+'$','i');_0xe67f09=_0xe67f09['filter'](_0x104ea5=>_0x448ca5[_0x33f4ea(0x283)](_0x104ea5[_0x33f4ea(0x250)]['name']));}_0xe67f09['sort']((_0x5d943,_0x824c30)=>_0x5d943[_0x33f4ea(0x250)][_0x33f4ea(0x151)][_0x33f4ea(0x1da)](_0x824c30[_0x33f4ea(0x250)][_0x33f4ea(0x151)])),console['error'](_0x33f4ea(0x24b)+_0xe67f09['length']+'\x20parent\x20segment'+(_0xe67f09['length']!==0x1?'s':''));const _0xeb1121=_0x1f970e=>{const _0x193ebe=_0x33f4ea;return getConsoleNextUrl(_0xff0696[_0x193ebe(0x27d)],'/app/dw/parentSegments/'+_0x1f970e);};if(_0xff0696[_0x33f4ea(0x19e)]===_0x33f4ea(0x1fc)||_0xff0696[_0x33f4ea(0x19e)]===_0x33f4ea(0x267)){const _0x8eff46=_0xe67f09[_0x33f4ea(0x1a3)](_0x1ccd03=>({..._0x1ccd03,'url':_0xeb1121(_0x1ccd03['id'])}));await handleSDKOutput(_0x8eff46,_0xff0696);}else{if(_0xe67f09[_0x33f4ea(0x1a9)]===0x0)_0x42d45c?console[_0x33f4ea(0x23a)](_0x33f4ea(0x251)+_0x42d45c):console[_0x33f4ea(0x23a)]('No\x20parent\x20segments\x20found');else for(const _0x5eb027 of _0xe67f09){const _0x91a295=_0x5eb027[_0x33f4ea(0x250)][_0x33f4ea(0x15e)]?a22_0x225566[_0x33f4ea(0x1f0)]('\x20('+formatRows(_0x5eb027[_0x33f4ea(0x250)][_0x33f4ea(0x15e)])+')'):'',_0x428858=hyperlink(_0x5eb027['attributes']['name'],_0xeb1121(_0x5eb027['id']));console[_0x33f4ea(0x23a)](_0x33f4ea(0x1a7)+_0x428858+_0x91a295);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a22_0x46829f(0x151)]=a22_0x46829f(0x243);['description']=a22_0x46829f(0x1fb);async[a22_0x46829f(0x274)](_0x5d69a1){const _0x1f825c=a22_0x46829f,{options:_0x8a9ae4,args:_0x1b0e6b,tdx:_0x1edb5b}=_0x5d69a1;console[_0x1f825c(0x248)](_0x1f825c(0x206)+_0x1f825c(0x169)+'\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a');const _0x4125eb=_0x8a9ae4;if(_0x1b0e6b['length']===0x0)return console[_0x1f825c(0x248)](a22_0x225566[_0x1f825c(0x1b4)]('Error:\x20Parent\x20segment\x20name\x20is\x20required')),console[_0x1f825c(0x248)](_0x1f825c(0x161)),0x1;const _0x5956aa=_0x1b0e6b[0x0];if(!_0x4125eb[_0x1f825c(0x275)]||!_0x4125eb[_0x1f825c(0x1fa)])return console[_0x1f825c(0x248)](_0x1f825c(0x186)),console[_0x1f825c(0x248)](_0x1f825c(0x161)),0x1;_0x4125eb['verbose']&&(console[_0x1f825c(0x248)]('Site:\x20'+_0x4125eb[_0x1f825c(0x27d)]),console[_0x1f825c(0x248)](_0x1f825c(0x1c1)+_0x5956aa),console[_0x1f825c(0x248)]('Database:\x20'+_0x4125eb[_0x1f825c(0x275)]),console[_0x1f825c(0x248)](_0x1f825c(0x237)+_0x4125eb['table']));const _0x31960a=await loadJSONFromOptions(_0x4125eb[_0x1f825c(0x250)],_0x4125eb[_0x1f825c(0x279)]),_0x5b8299=await loadJSONFromOptions(_0x4125eb[_0x1f825c(0x255)],_0x4125eb['behaviorsFile']),_0x358873=await loadJSONFromOptions(_0x4125eb[_0x1f825c(0x213)],_0x4125eb[_0x1f825c(0x256)]),_0x17d035={'name':_0x5956aa,'description':_0x4125eb[_0x1f825c(0x1e9)],'scheduleType':_0x4125eb[_0x1f825c(0x261)],'scheduleOption':_0x4125eb[_0x1f825c(0x157)],'timezone':_0x4125eb[_0x1f825c(0x1a6)],'master':{'parentDatabaseName':_0x4125eb['database'],'parentTableName':_0x4125eb[_0x1f825c(0x1fa)]},'attributes':_0x31960a,'behaviors':_0x5b8299,'customerGroup':_0x358873},_0x4f5754=await withSpinner(_0x1f825c(0x18c)+_0x5956aa+_0x1f825c(0x178),()=>_0x1edb5b[_0x1f825c(0x1ee)][_0x1f825c(0x266)](_0x17d035),{'verbose':_0x8a9ae4[_0x1f825c(0x24c)]}),_0x2c7e53=_0x4f5754['data'];return console['error'](_0x1f825c(0x246)+_0x2c7e53[_0x1f825c(0x151)]+_0x1f825c(0x258)+_0x2c7e53['id']),await handleSDKOutput([_0x2c7e53],_0x8a9ae4),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a22_0x46829f(0x151)]='segment:parent:update';[a22_0x46829f(0x1e9)]=a22_0x46829f(0x1c5);async[a22_0x46829f(0x274)](_0x5c0552){const _0x477781=a22_0x46829f,{options:_0x5bcbb8,args:_0x21d500,tdx:_0x98f45}=_0x5c0552;console[_0x477781(0x248)](_0x477781(0x271)+_0x477781(0x169)+'\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a');const _0x3848e4=_0x5bcbb8;if(_0x21d500[_0x477781(0x1a9)]===0x0)return console['error'](a22_0x225566[_0x477781(0x1b4)](_0x477781(0x229))),console[_0x477781(0x248)](_0x477781(0x286)),0x1;const _0x5a7f71=_0x21d500[0x0];_0x3848e4[_0x477781(0x24c)]&&(console[_0x477781(0x248)](_0x477781(0x215)+_0x3848e4[_0x477781(0x27d)]),console[_0x477781(0x248)](_0x477781(0x254)+_0x5a7f71));const _0xacd99b=await withSpinner('Fetching\x20current\x20configuration\x20for\x20\x27'+_0x5a7f71+_0x477781(0x178),()=>_0x98f45[_0x477781(0x1ee)][_0x477781(0x14d)](_0x5a7f71),{'verbose':_0x3848e4[_0x477781(0x24c)]}),_0x3e9ca5=_0xacd99b[_0x477781(0x241)],_0x1e6a6c=await loadJSONFromOptions(_0x3848e4['addAttributes'],_0x3848e4['addAttributesFile']),_0x25a0f2=await loadJSONFromOptions(_0x3848e4[_0x477781(0x1de)],_0x3848e4[_0x477781(0x25e)]),_0x18d920={'name':_0x3e9ca5['name'],'description':_0x3848e4[_0x477781(0x1e9)]!==undefined?_0x3848e4[_0x477781(0x1e9)]:_0x3e9ca5[_0x477781(0x1e9)],'scheduleType':_0x3848e4['scheduleType']!==undefined?_0x3848e4[_0x477781(0x261)]:_0x3e9ca5[_0x477781(0x261)],'scheduleOption':_0x3848e4[_0x477781(0x157)]!==undefined?_0x3848e4[_0x477781(0x157)]:_0x3e9ca5[_0x477781(0x157)],'timezone':_0x3848e4[_0x477781(0x1a6)]!==undefined?_0x3848e4[_0x477781(0x1a6)]:_0x3e9ca5[_0x477781(0x1a6)],'master':_0x3e9ca5[_0x477781(0x1bf)],'attributes':_0x1e6a6c?[..._0x3e9ca5[_0x477781(0x250)]||[],..._0x1e6a6c]:_0x3e9ca5[_0x477781(0x250)],'behaviors':_0x25a0f2?[..._0x3e9ca5[_0x477781(0x255)]||[],..._0x25a0f2]:_0x3e9ca5[_0x477781(0x255)],'customerGroup':_0x3e9ca5[_0x477781(0x213)]},_0x48f100=await withSpinner(_0x477781(0x145)+_0x5a7f71+_0x477781(0x178),()=>_0x98f45[_0x477781(0x1ee)][_0x477781(0x1a5)](_0x5a7f71,_0x18d920),{'verbose':_0x3848e4[_0x477781(0x24c)]}),_0x2a5fc8=_0x48f100[_0x477781(0x241)];return console[_0x477781(0x248)](_0x477781(0x199)+_0x2a5fc8['name']+'\x27'),await handleSDKOutput([_0x2a5fc8],_0x3848e4),0x0;}}function a22_0x1d94(){const _0xe56702=['\x20rows)','\x20rows\x20','2616AGydEY','segment:parent:validate','segment','\x22,\x20\x22type\x22:\x20\x22','dim','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','Options:\x0a','displayMasterInfo','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','\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path','Aborted.','\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20','\x20kill','table','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','json','toFixed','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','To\x20view\x20sample\x20data:','dirname','displayBehaviorsStats','\x0aChanges\x20to\x20apply\x20to\x20\x27','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','\x0aUsage:\x20tdx\x20ps\x20preview\x20','toLocaleString','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','processedRows','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','/attempt/','setJobId','ignore','segment:parent:sql','Updating','collectSchema','To\x20cancel:','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','\x0a⚠️\x20\x20Both\x20','workflowId','customerGroup','SELECT\x20*\x20FROM\x20(\x0a','Site:\x20','Show\x20parent\x20segment\x20schema\x20(column\x20types)','\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a','displayPreviewResults','\x20field','\x0aError:','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','column_type','segment:parent:run','Listing\x20parent\x20segments\x20matching\x20\x27','interval','displayColumns','Error\x20reading\x20file:\x20','SQL\x20query:\x0a','using\x20the\x20default\x20path:\x20','\x20--interval\x20','/app/workflows/','displaySummary','runParent','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','Error:\x20Parent\x20segment\x20name\x20is\x20required','\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)','apply','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','Schema\x20saved\x20to\x20','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','tdx\x20segment\x20parent\x20preview\x20','Enriched:','type','label','Get\x20SQL\x20query\x20for\x20parent\x20segment','151749RcRjKB','Attempt:','Errors:','Table:\x20','6WYCyJa','SELECT\x20*\x20FROM\x20','log','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','schemaValid','\x20tdx\x20wf\x20attempt\x20','Fetching\x20SQL\x20for\x20\x27','Error\x20parsing\x20YAML:\x20','parent_segment','data','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','segment:parent:create','Preview:','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','✔\x20Created\x20parent\x20segment\x20\x27','segment:parent:list','error','-1d','enriched','✔\x20Found\x20','verbose','use','Found\x20YAML\x20file:\x20','preview','attributes','No\x20parent\x20segments\x20match\x20pattern:\x20','getBehaviorNames','Master\x20+\x20Attributes','Parent\x20segment:\x20','behaviors','customerGroupFile','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','\x27\x20with\x20ID:\x20','parent_segments','listParents','✔\x20No\x20changes\x20-\x20\x27','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','Behavior:','addBehaviorsFile','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','\x20Opening\x20','scheduleType','\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','Options:','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','createParent','jsonl','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','.yaml','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','customerPercent','`\x20to\x20download\x20the\x20configuration\x20first','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','formatSchemaJson','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','string','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','Fetching\x20parent\x20segment\x20\x27','execute','database','behavior_','limit','YAML\x20file:\x20','attributesFile','Created','push','/\x20→\x20','site','Join\x20on:','keys','customersWithEvents','customers','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','test','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','platform','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','foreignKey','\x20--enriched','Overwrite\x20\x27','/{name}.yml\x0a','query','audienceId','pullParentYaml','\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22','Updating\x20parent\x20segment\x20\x27','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','getParentSQL','Show\x20parent\x20segment\x20details','xdg-open','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','open','getParentFull','allValid','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','yes','name','isDirectory','joinKey','\x0aChanges\x20to\x20\x27','displayValidateResults','\x27\x20is\x20already\x20up\x20to\x20date','scheduleOption','\x20--attribute\x20\x22','cyan','/app/dw/parentSegments/','in\x20','schemaError','toLowerCase','population','all','Fetching\x20customers\x20schema...','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','✔\x20Query\x20completed:\x20Processed\x20','Coverage:','rowCount','Creating','Attribute:','973iHWoVA','Updated','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','\x27\x20is\x20up\x20to\x20date','getOutputDatabaseName','Resolving\x20parent\x20segment\x20\x27','bold','validateParentYaml','Pattern:\x20','Output\x20file:\x20','darwin','totalEvents','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','Apply\x20changes\x20to\x20\x27','column_name','workflowAttemptId','\x0a\x20\x20\x20\x20]','\x27...','Columns:','\x20--behavior\x20\x22','{\x0a\x20\x20\x22database\x22:\x20\x22','/sessions/','displayAttributesStats','Session:','elapsedTimeMillis','\x20--behavior\x20\x22<name>\x22','List\x20available\x20fields\x20for\x20segmentation','494124wIBsev','\x20parent\x20segment\x20\x27','\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)','.yml','Error:\x20--database\x20and\x20--table\x20are\x20required','stop','✔\x20Renamed\x20directory\x20to\x20','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','coveragePercent','Creating\x20parent\x20segment\x20\x27','sampleData','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','message','stats','repeat','\x5c$&','displaySampleData','listFields','segment:parent:view','segment:parent:pull','\x0a✔\x20Workflow\x20started','resolveParentId','✔\x20Updated\x20parent\x20segment\x20\x27','errors','yellow','start','win32','format','Master\x20Table','information_schema','join','number','map','Error:\x20--behavior\x20requires\x20a\x20name\x0a','updateParent','timezone','👥\x20','status','length','web','\x0aNo\x20sample\x20data\x20available','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','Analyzing\x20changes...','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','parent_id','Source:','utf-8','2088EOKAtQ','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','red','pushParentYaml','segment:parent:push','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','behavior','\x20\x20\x20\x20-\x20','\x20\x20Tables:\x201\x20customers\x20+\x20','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','14315poutAY','column','segment:parent:show','master','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','Name:\x20','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','run','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','Join:','Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20all\x20tables\x20(requires\x20context)\x0a','Error:\x20--attribute\x20requires\x20a\x20name\x0a','filter','replace','\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','.customers)','session','1624195DgqEKD','columns','%)\x20','Create\x20parent\x20segment\x20\x27','green','31900mfUFgU','jobId','\x20Configuration\x20is\x20valid','\x0a⚠️\x20\x20Migrating:\x20','✘\x20Failed\x20to\x20rename\x20directory:\x20','trim','localeCompare','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','784692pLoLxv','addBehaviors','\x22\x20}','Validate:','Error:','output','\x20\x20Note:\x20','displayPreviewHints','\x27\x20and\x20run\x20workflow?','/\x20directories\x20exist.','matchedCount','attribute','description'];a22_0x1d94=function(){return _0xe56702;};return a22_0x1d94();}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a22_0x46829f(0x151)]=a22_0x46829f(0x196);[a22_0x46829f(0x1e9)]=a22_0x46829f(0x189);async[a22_0x46829f(0x274)](_0x3cccd3){const _0x425650=a22_0x46829f,{options:_0xa478fc,args:_0x3421e3,tdx:_0xf4b6c1}=_0x3cccd3,_0x22f033=_0xa478fc,_0x5245e7=_0x3421e3[0x0]||_0xa478fc[_0x425650(0x1f4)];if(!_0x5245e7)return showParentSegmentNotSetError(_0x425650(0x263)+_0x425650(0x26f)),0x1;if(_0x22f033[_0x425650(0x24d)]&&_0x22f033[_0x425650(0x1e2)])return console['error'](a22_0x225566[_0x425650(0x1b4)](_0x425650(0x1f1))),console[_0x425650(0x248)](a22_0x225566[_0x425650(0x1f0)](_0x425650(0x1fe))),console[_0x425650(0x248)](a22_0x225566[_0x425650(0x1f0)](_0x425650(0x223)+PARENT_SEGMENT_DIR+_0x425650(0x28a))),console[_0x425650(0x248)](a22_0x225566['cyan'](_0x425650(0x22e))),0x1;const _0x511737=_0x22f033[_0x425650(0x1e2)]||a22_0x188799[_0x425650(0x1a1)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x5245e7)+_0x425650(0x185));_0x22f033[_0x425650(0x24c)]&&(console[_0x425650(0x248)]('Site:\x20'+_0x22f033['site']),console[_0x425650(0x248)](_0x425650(0x254)+_0x5245e7),console[_0x425650(0x248)](_0x425650(0x170)+_0x511737));const _0x5b06fd=await withSpinner(_0x425650(0x273)+_0x5245e7+_0x425650(0x178),()=>_0xf4b6c1[_0x425650(0x1ee)][_0x425650(0x28d)](_0x5245e7),{'verbose':_0x22f033[_0x425650(0x24c)]}),_0xf65208=_0x5b06fd[_0x425650(0x241)];if(existsSync(_0x511737)){const _0x47e4de=readFileSync(_0x511737,_0x425650(0x1b1)),_0x1776a0=generateDiff(_0x47e4de,_0xf65208);if(!hasChanges(_0x1776a0))console[_0x425650(0x248)](a22_0x225566['green']('✔')+'\x20No\x20changes\x20-\x20'+a22_0x225566[_0x425650(0x159)](_0x511737)+'\x20is\x20already\x20up\x20to\x20date');else{console[_0x425650(0x248)](_0x425650(0x154)+_0x511737+'\x27:'),console['error']('─'[_0x425650(0x191)](0x3c)),console[_0x425650(0x248)](formatDiffWithColors(_0x1776a0)),console[_0x425650(0x248)]('─'[_0x425650(0x191)](0x3c));if(!_0x22f033[_0x425650(0x150)]){if(!isInteractive())return console['error'](a22_0x225566[_0x425650(0x1b4)](_0x425650(0x21a)),_0x425650(0x14a)),console[_0x425650(0x248)](a22_0x225566['dim'](_0x425650(0x23b))),0x1;const _0x442bdb=await confirmKey(_0x425650(0x289)+_0x511737+'\x27?');if(!_0x442bdb)return console[_0x425650(0x248)](a22_0x225566[_0x425650(0x19b)](_0x425650(0x1f7))),0x1;}writeFileSync(_0x511737,_0xf65208,_0x425650(0x1b1)),console[_0x425650(0x248)](a22_0x225566[_0x425650(0x1d3)]('✔')+_0x425650(0x146)+a22_0x225566[_0x425650(0x159)](_0x511737));}}else{const _0x261bf9=a22_0x188799[_0x425650(0x200)](_0x511737);!existsSync(_0x261bf9)&&mkdirSync(_0x261bf9,{'recursive':!![]}),writeFileSync(_0x511737,_0xf65208,_0x425650(0x1b1)),console[_0x425650(0x248)](a22_0x225566['green']('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a22_0x225566[_0x425650(0x159)](_0x511737));}return saveSessionContext({'parent_segment':_0x5245e7},_0x22f033[_0x425650(0x1ce)]),console[_0x425650(0x248)](a22_0x225566[_0x425650(0x1d3)]('✔')+'\x20Context\x20set:\x20'+a22_0x225566[_0x425650(0x1f0)](_0x425650(0x240))+'\x20=\x20'+a22_0x225566[_0x425650(0x159)](_0x5245e7)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a22_0x46829f(0x151)]=a22_0x46829f(0x1b6);['description']=a22_0x46829f(0x1b3);async[a22_0x46829f(0x274)](_0x145740){const _0x3ae61f=a22_0x46829f,{options:_0xe3cdec,args:_0x274c66,tdx:_0x33fbed}=_0x145740,_0x460966=_0xe3cdec,_0x1fce41=_0x274c66[0x0]||_0xe3cdec[_0x3ae61f(0x1f4)];if(!_0x1fce41)return showParentSegmentNotSetError(_0x3ae61f(0x14f)+_0x3ae61f(0x18e)),0x1;const _0x175c71=resolveYamlFile(_0x1fce41);if(!existsSync(_0x175c71))return showFileNotFoundError(_0x175c71,_0x1fce41),0x1;_0x460966['verbose']&&(console[_0x3ae61f(0x248)](_0x3ae61f(0x215)+_0x460966[_0x3ae61f(0x27d)]),console[_0x3ae61f(0x248)](_0x3ae61f(0x278)+_0x175c71));let _0x3f5bd2;try{_0x3f5bd2=readFileSync(_0x175c71,_0x3ae61f(0x1b1));}catch(_0x24f74c){const _0x3c8483=_0x24f74c instanceof Error?_0x24f74c[_0x3ae61f(0x18f)]:String(_0x24f74c);return console[_0x3ae61f(0x248)]('Error\x20reading\x20file:\x20'+_0x3c8483),0x1;}const _0xed4b69=await withSpinner(_0x3ae61f(0x1ad),()=>_0x33fbed['segment'][_0x3ae61f(0x1b5)](_0x3f5bd2),{'verbose':_0x460966[_0x3ae61f(0x24c)]}),_0x1b9650=_0xed4b69[_0x3ae61f(0x241)],{isNew:_0xe0daa7,name:_0x4eb601,hasChanges:_0x595d0b,diffFormatted:_0x399e7b}=_0x1b9650;if(!_0x595d0b)return console[_0x3ae61f(0x248)](_0x3ae61f(0x25b)+_0x4eb601+_0x3ae61f(0x156)),0x0;_0xe0daa7?console[_0x3ae61f(0x248)]('\x0aNew\x20parent\x20segment\x20\x27'+_0x4eb601+'\x27:'):console['error']('\x0aChanges\x20to\x20apply\x20to\x20\x27'+_0x4eb601+'\x27:');console[_0x3ae61f(0x248)]('─'['repeat'](0x3c)),console[_0x3ae61f(0x248)](_0x399e7b),console['error']('─'['repeat'](0x3c));const _0x56c86f=_0xe0daa7?'Create\x20parent\x20segment\x20\x27'+_0x4eb601+'\x27?':_0x3ae61f(0x174)+_0x4eb601+'\x27?';if(!_0x460966[_0x3ae61f(0x150)]){if(!isInteractive())return console[_0x3ae61f(0x248)](a22_0x225566[_0x3ae61f(0x1b4)](_0x3ae61f(0x21a)),_0x3ae61f(0x14a)),console['error'](a22_0x225566['dim'](_0x3ae61f(0x23b))),0x1;const _0x4b0717=await confirmKey(_0x56c86f);if(!_0x4b0717)return console['error'](a22_0x225566[_0x3ae61f(0x19b)](_0x3ae61f(0x1f7))),0x1;}const _0x50bcde=_0xe0daa7?'Creating':_0x3ae61f(0x20d),_0x13171b=await withSpinner(_0x50bcde+_0x3ae61f(0x183)+_0x4eb601+_0x3ae61f(0x178),()=>_0x1b9650[_0x3ae61f(0x22b)](),{'verbose':_0x460966['verbose']}),_0xb1626=_0x13171b[_0x3ae61f(0x241)],_0xe4e8b6=getConsoleNextUrl(_0x460966[_0x3ae61f(0x27d)],_0x3ae61f(0x15a)+_0xb1626['id']),_0x116252=_0xe0daa7?_0x3ae61f(0x27a):'Updated';return console[_0x3ae61f(0x248)]('✔\x20'+_0x116252+_0x3ae61f(0x183)+_0xb1626[_0x3ae61f(0x151)]+'\x27'),console[_0x3ae61f(0x248)]('\x20\x20'+_0xe4e8b6),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a22_0x46829f(0x151)]=a22_0x46829f(0x1ed);[a22_0x46829f(0x1e9)]=a22_0x46829f(0x228);async['execute'](_0x3b038f){const _0x3e8dda=a22_0x46829f,{options:_0x134885,args:_0x488e5c,tdx:_0x2978f2}=_0x3b038f,_0x4a981b=_0x134885,_0x475a97=_0x488e5c[0x0]||_0x134885[_0x3e8dda(0x1f4)];if(!_0x475a97)return showParentSegmentNotSetError(_0x3e8dda(0x1bb)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a'+_0x3e8dda(0x1f2)+_0x3e8dda(0x173)+'\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a'+_0x3e8dda(0x268)),0x1;const _0x52d190=resolveYamlFile(_0x475a97);if(!existsSync(_0x52d190))return showFileNotFoundError(_0x52d190,_0x475a97),0x1;_0x4a981b[_0x3e8dda(0x24c)]&&(console['error']('Site:\x20'+_0x4a981b[_0x3e8dda(0x27d)]),console['error']('YAML\x20file:\x20'+_0x52d190));let _0x5a35a6;try{_0x5a35a6=readFileSync(_0x52d190,_0x3e8dda(0x1b1));}catch(_0xbbc414){const _0x155909=_0xbbc414 instanceof Error?_0xbbc414[_0x3e8dda(0x18f)]:String(_0xbbc414);return console[_0x3e8dda(0x248)](_0x3e8dda(0x221)+_0x155909),0x1;}const _0x13e5f6=createCommandSpinner(a22_0x225566[_0x3e8dda(0x1f0)]('Validating\x20configuration...'),{'verbose':_0x4a981b['verbose']});_0x13e5f6[_0x3e8dda(0x19c)]();const _0x5ed472={'onProgress':_0x1507eb=>{_0x13e5f6['text']=formatProgressMessage(_0x1507eb);}};if(_0x4a981b['master'])_0x5ed472['master']=!![];if(_0x4a981b[_0x3e8dda(0x24a)])_0x5ed472[_0x3e8dda(0x24a)]=!![];_0x4a981b[_0x3e8dda(0x1e8)]&&(_0x5ed472[_0x3e8dda(0x1e8)]=_0x4a981b['attribute']);_0x4a981b[_0x3e8dda(0x1b8)]&&(_0x5ed472[_0x3e8dda(0x1b8)]=_0x4a981b[_0x3e8dda(0x1b8)]);if(_0x4a981b['interval'])_0x5ed472[_0x3e8dda(0x21f)]=_0x4a981b['interval'];let _0x544382;try{_0x544382=await _0x2978f2[_0x3e8dda(0x1ee)][_0x3e8dda(0x16e)](_0x5a35a6,_0x5ed472),_0x13e5f6[_0x3e8dda(0x187)]();}catch(_0x477a6e){_0x13e5f6[_0x3e8dda(0x187)]();throw _0x477a6e;}const _0x35a15d=_0x4a981b[_0x3e8dda(0x21f)]||_0x3e8dda(0x249);return this[_0x3e8dda(0x155)](_0x544382,_0x5ed472,_0x52d190,_0x35a15d),_0x544382[_0x3e8dda(0x14e)]?0x0:0x1;}[a22_0x46829f(0x155)](_0x233c0a,_0x30762a,_0x3c4d55,_0x501386){const _0x36b611=a22_0x46829f;console[_0x36b611(0x248)]('\x0a'+a22_0x225566[_0x36b611(0x16d)](_0x36b611(0x1e0))+'\x20'+_0x233c0a[_0x36b611(0x151)]),console[_0x36b611(0x248)]('═'[_0x36b611(0x191)](0x3c)),this[_0x36b611(0x1f3)](_0x233c0a);if(typeof _0x30762a[_0x36b611(0x1e8)]===_0x36b611(0x270)){this['displayAttributesStats'](_0x233c0a),this['displaySummary'](_0x233c0a),this['displayPreviewHints'](_0x3c4d55,_0x501386,'attribute',_0x30762a['attribute']);return;}if(_0x30762a[_0x36b611(0x1e8)]===!![]){this[_0x36b611(0x17d)](_0x233c0a),this[_0x36b611(0x226)](_0x233c0a),this[_0x36b611(0x1e4)](_0x3c4d55,_0x501386,_0x36b611(0x250));return;}if(typeof _0x30762a[_0x36b611(0x1b8)]===_0x36b611(0x270)){this[_0x36b611(0x201)](_0x233c0a,_0x501386),this[_0x36b611(0x226)](_0x233c0a),this['displayPreviewHints'](_0x3c4d55,_0x501386,_0x36b611(0x1b8),_0x30762a[_0x36b611(0x1b8)]);return;}if(_0x30762a[_0x36b611(0x1b8)]===!![]){this[_0x36b611(0x201)](_0x233c0a,_0x501386),this['displaySummary'](_0x233c0a),this[_0x36b611(0x1e4)](_0x3c4d55,_0x501386,_0x36b611(0x255));return;}this[_0x36b611(0x17d)](_0x233c0a),this[_0x36b611(0x201)](_0x233c0a,_0x501386),this['displaySummary'](_0x233c0a),this[_0x36b611(0x1e4)](_0x3c4d55,_0x501386,_0x36b611(0x15f));}[a22_0x46829f(0x1e4)](_0x1705a9,_0x2993da,_0x229c1c,_0x5b9a7f){const _0x6608e6=a22_0x46829f;console['error']('\x0a'+a22_0x225566[_0x6608e6(0x1f0)](_0x6608e6(0x1ff)));const _0x1b9c9a=_0x2993da!==_0x6608e6(0x249)?_0x6608e6(0x224)+_0x2993da:'';if(_0x229c1c===_0x6608e6(0x1e8)&&_0x5b9a7f)console['error']('\x20\x20'+a22_0x225566[_0x6608e6(0x1f0)](_0x6608e6(0x22f)+_0x1705a9+'\x20--attribute\x20\x22'+_0x5b9a7f+'\x22'+_0x1b9c9a));else{if(_0x229c1c===_0x6608e6(0x1b8)&&_0x5b9a7f)console[_0x6608e6(0x248)]('\x20\x20'+a22_0x225566['dim'](_0x6608e6(0x22f)+_0x1705a9+_0x6608e6(0x17a)+_0x5b9a7f+'\x22'+_0x1b9c9a));else(_0x229c1c===_0x6608e6(0x250)||_0x229c1c===_0x6608e6(0x15f))&&console[_0x6608e6(0x248)]('\x20\x20'+a22_0x225566[_0x6608e6(0x1f0)](_0x6608e6(0x22f)+_0x1705a9+'\x20--attribute\x20\x22<name>\x22'+_0x1b9c9a));}(_0x229c1c===_0x6608e6(0x255)||_0x229c1c===_0x6608e6(0x15f))&&console[_0x6608e6(0x248)]('\x20\x20'+a22_0x225566['dim']('tdx\x20segment\x20parent\x20preview\x20'+_0x1705a9+_0x6608e6(0x180)+_0x1b9c9a)),_0x229c1c===_0x6608e6(0x15f)&&console[_0x6608e6(0x248)]('\x20\x20'+a22_0x225566[_0x6608e6(0x1f0)](_0x6608e6(0x22f)+_0x1705a9+_0x6608e6(0x288)+_0x1b9c9a));}['displayMasterInfo'](_0x11c28f){const _0xa5aa10=a22_0x46829f,{master:_0x525837}=_0x11c28f,_0x17c892=_0x525837['schemaValid']?a22_0x225566[_0xa5aa10(0x1d3)]('✔'):a22_0x225566['red']('✘');console[_0xa5aa10(0x248)]('\x0a'+a22_0x225566[_0xa5aa10(0x1f0)](_0xa5aa10(0x19f))),console[_0xa5aa10(0x248)](_0x17c892+'\x20'+a22_0x225566[_0xa5aa10(0x16d)](_0x525837[_0xa5aa10(0x275)]+'.'+_0x525837[_0xa5aa10(0x1fa)])),_0x525837[_0xa5aa10(0x23c)]?_0x525837[_0xa5aa10(0x164)]!==undefined&&console[_0xa5aa10(0x248)]('\x20\x20'+a22_0x225566[_0xa5aa10(0x1f0)]('Rows:')+'\x20'+a22_0x225566[_0xa5aa10(0x159)](formatRows(_0x525837[_0xa5aa10(0x164)]))):console['error']('\x20\x20'+a22_0x225566[_0xa5aa10(0x1b4)]('Error:')+'\x20'+_0x525837[_0xa5aa10(0x15c)]);}[a22_0x46829f(0x17d)](_0x1b8b9f){const _0xddaab4=a22_0x46829f;if(_0x1b8b9f['attributes']['length']===0x0)return;console[_0xddaab4(0x248)]('\x0a'+a22_0x225566[_0xddaab4(0x1f0)]('Attributes'));for(const _0x3b8215 of _0x1b8b9f['attributes']){const _0x45000e=_0x3b8215[_0xddaab4(0x23c)]?a22_0x225566['green']('✔'):a22_0x225566[_0xddaab4(0x1b4)]('✘');let _0x3606fa='';if(_0x3b8215[_0xddaab4(0x23c)]&&_0x3b8215[_0xddaab4(0x1e7)]!==undefined&&_0x3b8215['coveragePercent']!==undefined){const _0x3bedc4=_0x3b8215[_0xddaab4(0x18b)][_0xddaab4(0x1fd)](0x1),_0x49f868=_0x3b8215[_0xddaab4(0x18b)]>=0x50?a22_0x225566['green']:_0x3b8215[_0xddaab4(0x18b)]>=0x32?a22_0x225566['yellow']:a22_0x225566[_0xddaab4(0x1b4)];_0x3606fa='\x20'+a22_0x225566['dim'](_0xddaab4(0x163))+'\x20'+_0x49f868(_0x3bedc4+'%')+'\x20('+formatRows(_0x3b8215[_0xddaab4(0x1e7)])+_0xddaab4(0x1ea);}console[_0xddaab4(0x248)](_0x45000e+'\x20'+a22_0x225566[_0xddaab4(0x16d)](_0x3b8215['name'])+_0x3606fa),console[_0xddaab4(0x248)]('\x20\x20'+a22_0x225566[_0xddaab4(0x1f0)](_0xddaab4(0x1b0))+'\x20'+a22_0x225566[_0xddaab4(0x16d)](_0x3b8215['database']+'.'+_0x3b8215[_0xddaab4(0x1fa)]));const _0x23b2c7=_0x3b8215['joinKey']===_0x3b8215[_0xddaab4(0x287)]?a22_0x225566[_0xddaab4(0x1f0)](_0xddaab4(0x27e))+'\x20'+_0x3b8215[_0xddaab4(0x153)]:a22_0x225566[_0xddaab4(0x1f0)]('Join:')+'\x20'+_0x3b8215['joinKey']+_0xddaab4(0x1c3)+_0x3b8215[_0xddaab4(0x287)];console[_0xddaab4(0x248)]('\x20\x20'+_0x23b2c7),console[_0xddaab4(0x248)]('\x20\x20'+a22_0x225566[_0xddaab4(0x1f0)]('Columns:')),this[_0xddaab4(0x220)](_0x3b8215[_0xddaab4(0x1d0)]),!_0x3b8215['schemaValid']&&console['error']('\x20\x20'+a22_0x225566[_0xddaab4(0x1b4)](_0xddaab4(0x1e1))+'\x20'+_0x3b8215[_0xddaab4(0x15c)]);}}[a22_0x46829f(0x201)](_0x46709b,_0x4f8b58){const _0x522946=a22_0x46829f;if(_0x46709b['behaviors'][_0x522946(0x1a9)]===0x0)return;console[_0x522946(0x248)]('\x0a'+a22_0x225566[_0x522946(0x1f0)]('Behaviors')+'\x20'+a22_0x225566[_0x522946(0x1f0)]('('+_0x4f8b58+')'));for(const _0x54f917 of _0x46709b[_0x522946(0x255)]){const _0xfece88=_0x54f917[_0x522946(0x23c)]?a22_0x225566[_0x522946(0x1d3)]('✔'):a22_0x225566[_0x522946(0x1b4)]('✘');let _0xea0c2a='';if(_0x54f917[_0x522946(0x23c)]&&_0x54f917[_0x522946(0x280)]!==undefined&&_0x54f917[_0x522946(0x172)]!==undefined){const _0x1919fe=_0x54f917['customerPercent']?.[_0x522946(0x1fd)](0x1)||'?',_0x480091=(_0x54f917[_0x522946(0x26b)]??0x0)>=0x32?a22_0x225566['green']:(_0x54f917[_0x522946(0x26b)]??0x0)>=0x14?a22_0x225566[_0x522946(0x19b)]:a22_0x225566[_0x522946(0x1b4)];_0xea0c2a='\x20'+a22_0x225566[_0x522946(0x1f0)]('Customers:')+'\x20'+_0x480091(formatRows(_0x54f917[_0x522946(0x280)]))+'\x20('+_0x1919fe+_0x522946(0x1d1)+a22_0x225566[_0x522946(0x1f0)]('Events:')+'\x20'+a22_0x225566[_0x522946(0x159)](formatRows(_0x54f917[_0x522946(0x172)]));}console[_0x522946(0x248)](_0xfece88+'\x20'+a22_0x225566[_0x522946(0x16d)](_0x54f917[_0x522946(0x151)])+_0xea0c2a),console[_0x522946(0x248)]('\x20\x20'+a22_0x225566[_0x522946(0x1f0)](_0x522946(0x1b0))+'\x20'+a22_0x225566[_0x522946(0x16d)](_0x54f917['database']+'.'+_0x54f917[_0x522946(0x1fa)]));const _0x4b9542=_0x54f917[_0x522946(0x153)]===_0x54f917[_0x522946(0x287)]?a22_0x225566[_0x522946(0x1f0)]('Join\x20on:')+'\x20'+_0x54f917[_0x522946(0x153)]:a22_0x225566[_0x522946(0x1f0)](_0x522946(0x1c6))+'\x20'+_0x54f917['joinKey']+_0x522946(0x1c3)+_0x54f917[_0x522946(0x287)];console[_0x522946(0x248)]('\x20\x20'+_0x4b9542),console['error']('\x20\x20'+a22_0x225566['dim'](_0x522946(0x179))),this[_0x522946(0x220)](_0x54f917['columns']),!_0x54f917[_0x522946(0x23c)]&&console[_0x522946(0x248)]('\x20\x20'+a22_0x225566[_0x522946(0x1b4)](_0x522946(0x1e1))+'\x20'+_0x54f917[_0x522946(0x15c)]);}}[a22_0x46829f(0x220)](_0x42a3cf){const _0x597663=a22_0x46829f;for(const _0x359ffc of _0x42a3cf){_0x359ffc[_0x597663(0x232)]===_0x359ffc['column']||_0x359ffc[_0x597663(0x1bd)]==='*'?console['error']('\x20\x20\x20\x20-\x20'+_0x359ffc[_0x597663(0x232)]):console[_0x597663(0x248)](_0x597663(0x1b9)+_0x359ffc[_0x597663(0x232)]+'\x20'+a22_0x225566[_0x597663(0x1f0)]('('+_0x359ffc['column']+')'));}}[a22_0x46829f(0x226)](_0x345f64){const _0x1ecb69=a22_0x46829f;console[_0x1ecb69(0x248)]('─'[_0x1ecb69(0x191)](0x3c));if(_0x345f64['errors'][_0x1ecb69(0x1a9)]>0x0){console[_0x1ecb69(0x248)]('\x0a'+a22_0x225566[_0x1ecb69(0x1b4)]('Errors:'));for(const _0x497065 of _0x345f64[_0x1ecb69(0x19a)]){console['error']('\x20\x20'+a22_0x225566[_0x1ecb69(0x1b4)]('•')+'\x20'+_0x497065);}}_0x345f64['allValid']&&console['error']('\x0a'+a22_0x225566[_0x1ecb69(0x1d3)]('✔')+_0x1ecb69(0x1d6));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a22_0x46829f(0x151)]='segment:parent:preview';[a22_0x46829f(0x1e9)]=a22_0x46829f(0x282);async['execute'](_0x5f2517){const _0x1856d8=a22_0x46829f,{options:_0x15f9c7,args:_0x50e243,tdx:_0x522aa6}=_0x5f2517,_0x833752=_0x15f9c7,_0x52a1b1=_0x50e243[0x0]||_0x15f9c7[_0x1856d8(0x1f4)];if(!_0x52a1b1)return showParentSegmentNotSetError(_0x1856d8(0x1c2)+_0x1856d8(0x1ac)+'Options\x20(one\x20required):\x0a'+_0x1856d8(0x14b)+_0x1856d8(0x272)+_0x1856d8(0x1c0)+_0x1856d8(0x1cc)+_0x1856d8(0x268)),0x1;if(!_0x833752[_0x1856d8(0x1bf)]&&!_0x833752[_0x1856d8(0x1e8)]&&!_0x833752[_0x1856d8(0x1b8)]&&!_0x833752[_0x1856d8(0x24a)])return console[_0x1856d8(0x248)](a22_0x225566[_0x1856d8(0x1b4)](_0x1856d8(0x1b7))),console[_0x1856d8(0x248)](_0x1856d8(0x1ae)),console[_0x1856d8(0x248)](_0x1856d8(0x264)),console[_0x1856d8(0x248)]('\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data'),console['error'](_0x1856d8(0x210)),console[_0x1856d8(0x248)](_0x1856d8(0x25c)),console['error'](_0x1856d8(0x208)),0x1;const _0x1bb815=resolveYamlFile(_0x52a1b1);if(!existsSync(_0x1bb815))return showFileNotFoundError(_0x1bb815,_0x52a1b1),0x1;_0x833752[_0x1856d8(0x24c)]&&(console[_0x1856d8(0x248)](_0x1856d8(0x215)+_0x833752[_0x1856d8(0x27d)]),console[_0x1856d8(0x248)]('YAML\x20file:\x20'+_0x1bb815));let _0x44c26d;try{_0x44c26d=readFileSync(_0x1bb815,'utf-8');}catch(_0x214f54){const _0x49e0b7=_0x214f54 instanceof Error?_0x214f54['message']:String(_0x214f54);return console['error']('Error\x20reading\x20file:\x20'+_0x49e0b7),0x1;}let _0x56bec0;try{_0x56bec0=parseDef(_0x44c26d);}catch(_0x34ba86){const _0x5e0359=_0x34ba86 instanceof Error?_0x34ba86[_0x1856d8(0x18f)]:String(_0x34ba86);return console[_0x1856d8(0x248)](a22_0x225566[_0x1856d8(0x1b4)](_0x1856d8(0x23f)+_0x5e0359)),0x1;}if(_0x833752[_0x1856d8(0x1e8)]===!![]||_0x833752[_0x1856d8(0x1e8)]===''){const _0x5f3287=_0x56bec0[_0x1856d8(0x250)]?.[_0x1856d8(0x1a3)](_0x184ca3=>_0x184ca3[_0x1856d8(0x151)])||[];if(_0x5f3287['length']===0x0)console[_0x1856d8(0x248)](a22_0x225566[_0x1856d8(0x1b4)](_0x1856d8(0x1db)));else{console[_0x1856d8(0x248)](a22_0x225566[_0x1856d8(0x1b4)](_0x1856d8(0x1c8))),console[_0x1856d8(0x248)]('Available\x20attributes:');for(const _0x403f45 of _0x5f3287){console[_0x1856d8(0x248)]('\x20\x20'+a22_0x225566['cyan'](_0x403f45));}console[_0x1856d8(0x248)](_0x1856d8(0x204)+_0x52a1b1+_0x1856d8(0x158)+_0x5f3287[0x0]+'\x22');}return 0x1;}if(_0x833752[_0x1856d8(0x1b8)]===!![]||_0x833752[_0x1856d8(0x1b8)]===''){const _0x470ed7=_0x56bec0[_0x1856d8(0x255)]?.['map'](_0x3ff4c3=>_0x3ff4c3['name'])||[];if(_0x470ed7[_0x1856d8(0x1a9)]===0x0)console['error'](a22_0x225566[_0x1856d8(0x1b4)]('Error:\x20No\x20behaviors\x20defined\x20in\x20configuration'));else{console['error'](a22_0x225566[_0x1856d8(0x1b4)](_0x1856d8(0x1a4))),console[_0x1856d8(0x248)]('Available\x20behaviors:');for(const _0x5e55f5 of _0x470ed7){console[_0x1856d8(0x248)]('\x20\x20'+a22_0x225566[_0x1856d8(0x159)](_0x5e55f5));}console[_0x1856d8(0x248)](_0x1856d8(0x204)+_0x52a1b1+_0x1856d8(0x17a)+_0x470ed7[0x0]+'\x22');}return 0x1;}const _0x419814=createCommandSpinner(a22_0x225566[_0x1856d8(0x1f0)]('Fetching\x20sample\x20data...'),{'verbose':_0x833752[_0x1856d8(0x24c)]});_0x419814['start']();const _0x2c040f={'onProgress':_0x58cb61=>{_0x419814['text']=formatProgressMessage(_0x58cb61);}};if(_0x833752[_0x1856d8(0x1bf)])_0x2c040f[_0x1856d8(0x1bf)]=!![];if(_0x833752[_0x1856d8(0x1e8)]&&typeof _0x833752[_0x1856d8(0x1e8)]===_0x1856d8(0x270))_0x2c040f[_0x1856d8(0x1e8)]=_0x833752['attribute'];if(_0x833752['behavior']&&typeof _0x833752[_0x1856d8(0x1b8)]==='string')_0x2c040f[_0x1856d8(0x1b8)]=_0x833752['behavior'];if(_0x833752[_0x1856d8(0x24a)])_0x2c040f[_0x1856d8(0x24a)]=!![];if(_0x833752['interval'])_0x2c040f[_0x1856d8(0x21f)]=_0x833752[_0x1856d8(0x21f)];let _0x4dfeb2;try{_0x4dfeb2=await _0x522aa6['segment']['previewParentYaml'](_0x44c26d,_0x2c040f),_0x419814[_0x1856d8(0x187)]();}catch(_0x25b332){_0x419814[_0x1856d8(0x187)]();throw _0x25b332;}return await this[_0x1856d8(0x218)](_0x4dfeb2,{'master':_0x833752[_0x1856d8(0x1bf)],'attribute':typeof _0x833752[_0x1856d8(0x1e8)]===_0x1856d8(0x270)?_0x833752[_0x1856d8(0x1e8)]:undefined,'behavior':typeof _0x833752[_0x1856d8(0x1b8)]===_0x1856d8(0x270)?_0x833752[_0x1856d8(0x1b8)]:undefined,'enriched':_0x833752[_0x1856d8(0x24a)]}),_0x4dfeb2[_0x1856d8(0x14e)]?0x0:0x1;}async[a22_0x46829f(0x218)](_0x15005f,_0x12944d){const _0xf41f26=a22_0x46829f;console[_0xf41f26(0x248)]('\x0a'+a22_0x225566[_0xf41f26(0x16d)](_0xf41f26(0x244))+'\x20'+_0x15005f['name']),console['error']('═'[_0xf41f26(0x191)](0x3c));if(_0x12944d['master']&&_0x15005f[_0xf41f26(0x18d)]){const _0x1c410a=a22_0x225566['dim']('Master:')+'\x20'+a22_0x225566[_0xf41f26(0x16d)](_0x15005f[_0xf41f26(0x1bf)][_0xf41f26(0x275)]+'.'+_0x15005f[_0xf41f26(0x1bf)]['table']);await this['displaySampleData'](_0x1c410a,_0x15005f[_0xf41f26(0x18d)]);}else{if(_0x12944d['attribute']&&_0x15005f[_0xf41f26(0x18d)]){const _0x344af7=a22_0x225566['dim'](_0xf41f26(0x166))+'\x20'+a22_0x225566['bold'](_0x12944d[_0xf41f26(0x1e8)]);await this[_0xf41f26(0x193)](_0x344af7,_0x15005f['sampleData']);}else{if(_0x12944d['behavior']&&_0x15005f[_0xf41f26(0x18d)]){const _0x2327af=a22_0x225566[_0xf41f26(0x1f0)](_0xf41f26(0x25d))+'\x20'+a22_0x225566[_0xf41f26(0x16d)](_0x12944d[_0xf41f26(0x1b8)]);await this[_0xf41f26(0x193)](_0x2327af,_0x15005f['sampleData']);}else{if(_0x12944d['enriched']&&_0x15005f['sampleData']){const _0x318e28=a22_0x225566[_0xf41f26(0x1f0)](_0xf41f26(0x230))+'\x20'+a22_0x225566['bold'](_0xf41f26(0x253));await this[_0xf41f26(0x193)](_0x318e28,_0x15005f[_0xf41f26(0x18d)]);}else!_0x15005f[_0xf41f26(0x18d)]&&console[_0xf41f26(0x248)](_0xf41f26(0x1ab));}}}if(_0x15005f[_0xf41f26(0x19a)]['length']>0x0){console['error']('─'[_0xf41f26(0x191)](0x3c)),console[_0xf41f26(0x248)]('\x0a'+a22_0x225566['red'](_0xf41f26(0x236)));for(const _0x6fcc0 of _0x15005f[_0xf41f26(0x19a)]){console[_0xf41f26(0x248)]('\x20\x20'+a22_0x225566[_0xf41f26(0x1b4)]('•')+'\x20'+_0x6fcc0);}}}async[a22_0x46829f(0x193)](_0x1b114f,_0x3b7445){const _0x249e0a=a22_0x46829f;if(_0x3b7445[_0x249e0a(0x1a9)]===0x0){console['error']('\x0a'+_0x1b114f),console[_0x249e0a(0x248)]('\x20\x20No\x20sample\x20data\x20available');return;}console[_0x249e0a(0x248)]('\x0a'+_0x1b114f);const _0x2ea5f9=Object[_0x249e0a(0x27f)](_0x3b7445[0x0])[_0x249e0a(0x1a3)](_0x299a80=>({'name':_0x299a80,'type':typeof _0x3b7445[0x0][_0x299a80]===_0x249e0a(0x1a2)?'double':'varchar'})),_0x407ed1={'queryId':_0x249e0a(0x24f),'columns':_0x2ea5f9,'data':_0x3b7445,'stats':{'state':'FINISHED','queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x3b7445['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x260bbe=formatAsTable(_0x407ed1,_0x3b7445[_0x249e0a(0x1a9)],!![]);await writeOutput(_0x260bbe,undefined,_0x249e0a(0x1fa));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a22_0x46829f(0x151)]=a22_0x46829f(0x21d);[a22_0x46829f(0x1e9)]=a22_0x46829f(0x26a);async[a22_0x46829f(0x274)](_0x4b7384){const _0x5a627f=a22_0x46829f,{options:_0x502603,args:_0xf1a033,tdx:_0x4069ba}=_0x4b7384,_0x583dc5=_0x502603,_0x4b95e4=_0xf1a033[0x0]||_0x502603['parentSegment'];if(!_0x4b95e4)return showParentSegmentNotSetError(_0x5a627f(0x284)+_0x5a627f(0x18a)),0x1;const _0x3af112=resolveYamlFile(_0x4b95e4);if(existsSync(_0x3af112)){_0x583dc5[_0x5a627f(0x24c)]&&console['error'](_0x5a627f(0x24e)+_0x3af112);let _0x18d342;try{_0x18d342=readFileSync(_0x3af112,'utf-8');}catch(_0x4d25b9){const _0x32d254=_0x4d25b9 instanceof Error?_0x4d25b9[_0x5a627f(0x18f)]:String(_0x4d25b9);return console[_0x5a627f(0x248)](_0x5a627f(0x221)+_0x32d254),0x1;}const _0x3ba3c4=await withSpinner('Analyzing\x20changes...',()=>_0x4069ba[_0x5a627f(0x1ee)][_0x5a627f(0x1b5)](_0x18d342),{'verbose':_0x583dc5[_0x5a627f(0x24c)]}),_0x547f63=_0x3ba3c4[_0x5a627f(0x241)],{isNew:_0x22d2e6,name:_0x3ce3c7,hasChanges:_0x5991e6,diffFormatted:_0x468794}=_0x547f63;if(_0x5991e6){_0x22d2e6?console[_0x5a627f(0x248)]('\x0aNew\x20parent\x20segment\x20\x27'+_0x3ce3c7+'\x27:'):console[_0x5a627f(0x248)](_0x5a627f(0x202)+_0x3ce3c7+'\x27:');console[_0x5a627f(0x248)]('─'[_0x5a627f(0x191)](0x3c)),console[_0x5a627f(0x248)](_0x468794),console[_0x5a627f(0x248)]('─'['repeat'](0x3c));const _0x3610ca=_0x22d2e6?_0x5a627f(0x1d2)+_0x3ce3c7+_0x5a627f(0x1e5):_0x5a627f(0x174)+_0x3ce3c7+'\x27\x20and\x20run\x20workflow?';if(!_0x583dc5[_0x5a627f(0x150)]){if(!isInteractive())return console[_0x5a627f(0x248)](a22_0x225566[_0x5a627f(0x1b4)](_0x5a627f(0x21a)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x5a627f(0x248)](a22_0x225566['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x774112=await confirmKey(_0x3610ca);if(!_0x774112)return console[_0x5a627f(0x248)](a22_0x225566[_0x5a627f(0x19b)](_0x5a627f(0x1f7))),0x1;}const _0x7793d3=_0x22d2e6?_0x5a627f(0x165):'Updating';await withSpinner(_0x7793d3+'\x20parent\x20segment\x20\x27'+_0x3ce3c7+_0x5a627f(0x178),()=>_0x547f63['apply'](),{'verbose':_0x583dc5[_0x5a627f(0x24c)]});const _0x2a1dc3=_0x22d2e6?_0x5a627f(0x27a):_0x5a627f(0x168);console[_0x5a627f(0x248)]('✔\x20'+_0x2a1dc3+_0x5a627f(0x183)+_0x3ce3c7+'\x27');}else console[_0x5a627f(0x248)](_0x5a627f(0x25b)+_0x3ce3c7+_0x5a627f(0x16a));}const _0x1ba57c=await withSpinner(_0x5a627f(0x245)+_0x4b95e4+'\x27...',()=>_0x4069ba[_0x5a627f(0x1ee)][_0x5a627f(0x227)](_0x4b95e4),{'verbose':_0x583dc5[_0x5a627f(0x24c)]}),_0x18aeff=_0x1ba57c[_0x5a627f(0x241)],_0x7fa5e=getConsoleUrl(_0x583dc5['site'],_0x5a627f(0x225)+_0x18aeff[_0x5a627f(0x212)]+_0x5a627f(0x17c)+_0x18aeff['workflowSessionId']+_0x5a627f(0x209)+_0x18aeff[_0x5a627f(0x176)]);return console[_0x5a627f(0x248)](_0x5a627f(0x197)),console['error']('\x20\x20'+a22_0x225566[_0x5a627f(0x1f0)]('Audience\x20ID:')+'\x20'+_0x18aeff[_0x5a627f(0x28c)]),console[_0x5a627f(0x248)]('\x20\x20'+a22_0x225566[_0x5a627f(0x1f0)]('Status:')+'\x20'+_0x18aeff[_0x5a627f(0x1a8)]),console[_0x5a627f(0x248)]('\x20\x20'+a22_0x225566[_0x5a627f(0x1f0)](_0x5a627f(0x17e))+'\x20'+_0x18aeff['workflowSessionId']),console[_0x5a627f(0x248)]('\x20\x20'+a22_0x225566[_0x5a627f(0x1f0)](_0x5a627f(0x235))+'\x20'+_0x18aeff[_0x5a627f(0x176)]),console[_0x5a627f(0x248)]('\x20\x20'+_0x7fa5e),console[_0x5a627f(0x248)]('\x0a'+a22_0x225566[_0x5a627f(0x1f0)](_0x5a627f(0x20f))+_0x5a627f(0x23d)+_0x18aeff[_0x5a627f(0x176)]+_0x5a627f(0x1f9)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a22_0x46829f(0x151)]='segment:parent:fields';[a22_0x46829f(0x1e9)]=a22_0x46829f(0x181);async[a22_0x46829f(0x274)](_0x9a3cf6){const _0x539fdc=a22_0x46829f,{options:_0x203431,args:_0xacef99,tdx:_0x16d22f}=_0x9a3cf6,_0x4ba876=_0xacef99[0x0]||_0x203431[_0x539fdc(0x1f4)];if(!_0x4ba876)return showParentSegmentNotSetError(_0x539fdc(0x265)+_0x539fdc(0x242)),0x1;_0x203431[_0x539fdc(0x24c)]&&(console[_0x539fdc(0x248)](_0x539fdc(0x215)+_0x203431[_0x539fdc(0x27d)]),console[_0x539fdc(0x248)]('Parent\x20segment:\x20'+_0x4ba876));const _0x526321=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x4ba876+_0x539fdc(0x178),()=>_0x16d22f['segment'][_0x539fdc(0x194)](_0x4ba876),{'verbose':_0x203431[_0x539fdc(0x24c)]}),_0x5e8ea4=_0x526321[_0x539fdc(0x241)];console[_0x539fdc(0x248)](_0x539fdc(0x24b)+_0x5e8ea4['length']+_0x539fdc(0x219)+(_0x5e8ea4['length']!==0x1?'s':''));if(_0x203431['json']||_0x203431['jsonl'])return await handleSDKOutput(_0x5e8ea4,_0x203431),0x0;return displayFieldsHumanReadable(_0x5e8ea4,_0x4ba876),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a22_0x46829f(0x151)]=a22_0x46829f(0x195);[a22_0x46829f(0x1e9)]=a22_0x46829f(0x148);async['execute'](_0x2c1836){const _0x54c14f=a22_0x46829f,{options:_0x2dc649,args:_0x2ebe1e,tdx:_0xfbeca6}=_0x2c1836,_0x3f06fe=_0x2dc649,_0x21d272=_0x2ebe1e[0x0]||_0x2dc649['parentSegment'];if(!_0x21d272)return showParentSegmentNotSetError(_0x54c14f(0x21b)+_0x54c14f(0x1dc)+_0x54c14f(0x1f2)+'\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser'),0x1;_0x2dc649[_0x54c14f(0x24c)]&&(console[_0x54c14f(0x248)]('Site:\x20'+_0x2dc649[_0x54c14f(0x27d)]),console[_0x54c14f(0x248)]('Parent\x20segment:\x20'+_0x21d272));const _0x30c70d=await withSpinner(_0x54c14f(0x273)+_0x21d272+_0x54c14f(0x178),()=>_0xfbeca6[_0x54c14f(0x1ee)][_0x54c14f(0x14d)](_0x21d272),{'verbose':_0x2dc649['verbose']}),_0x2c667c=_0x30c70d['data'];if(_0x3f06fe[_0x54c14f(0x1aa)]){const _0x4c2ead=getConsoleNextUrl(_0x3f06fe['site'],'/app/dw/parentSegments/'+_0x2c667c['id']);return console[_0x54c14f(0x248)](a22_0x225566[_0x54c14f(0x1d3)]('✔')+_0x54c14f(0x260)+a22_0x225566[_0x54c14f(0x159)](_0x4c2ead)),openBrowser(_0x4c2ead),0x0;}return await handleSingleObjectOutput(_0x2c667c,_0x2dc649),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a22_0x46829f(0x151)]='segment:parent:desc';['description']=a22_0x46829f(0x216);async[a22_0x46829f(0x274)](_0xe4a47a){const _0x58d268=a22_0x46829f,{options:_0x4c4074,args:_0x270848,tdx:_0x211df9}=_0xe4a47a,_0x3a3355=_0x4c4074,_0x40050f=_0x270848[0x0]||_0x4c4074['parentSegment'];if(!_0x40050f)return showParentSegmentNotSetError(_0x58d268(0x1c7)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20all\x20tables\x20for\x20parent\x20segment\x0a\x0a'+_0x58d268(0x1f2)+_0x58d268(0x1f6)),0x1;_0x4c4074[_0x58d268(0x24c)]&&(console['error'](_0x58d268(0x215)+_0x4c4074[_0x58d268(0x27d)]),console[_0x58d268(0x248)]('Parent\x20segment:\x20'+_0x40050f));const _0xf9776c=await withSpinner(_0x58d268(0x16c)+_0x40050f+_0x58d268(0x178),()=>_0x211df9[_0x58d268(0x1ee)][_0x58d268(0x198)](_0x40050f),{'verbose':_0x4c4074[_0x58d268(0x24c)]}),_0xc3fa64=_0xf9776c[_0x58d268(0x241)],_0x3d4854=_0x211df9['segment'][_0x58d268(0x16b)](_0xc3fa64);if(_0x3a3355[_0x58d268(0x1e2)]){const _0x2a9f1d=await this[_0x58d268(0x20e)](_0xe4a47a,_0x40050f,_0xc3fa64,_0x3d4854),_0x1b992a=this[_0x58d268(0x26e)](_0x2a9f1d);writeFileSync(_0x3a3355[_0x58d268(0x1e2)],_0x1b992a);const _0x699a65=_0x2a9f1d[_0x58d268(0x281)][_0x58d268(0x1d0)][_0x58d268(0x1a9)]+_0x2a9f1d[_0x58d268(0x255)]['reduce']((_0x5a01c6,_0x1b1420)=>_0x5a01c6+_0x1b1420[_0x58d268(0x1d0)][_0x58d268(0x1a9)],0x0),_0xcd91ba=_0x2a9f1d['behaviors'][_0x58d268(0x1c9)](_0x5ab7e4=>_0x5ab7e4['columns'][_0x58d268(0x1a9)]===0x0)[_0x58d268(0x1a9)];return console[_0x58d268(0x23a)](_0x58d268(0x22d)+_0x3a3355['output']),console[_0x58d268(0x23a)]('\x20\x20Database:\x20'+_0x3d4854),console[_0x58d268(0x23a)](_0x58d268(0x1ba)+_0x2a9f1d[_0x58d268(0x255)][_0x58d268(0x1a9)]+'\x20behaviors'),console['log']('\x20\x20Columns:\x20'+_0x699a65+'\x20total'),_0xcd91ba>0x0&&console[_0x58d268(0x23a)](_0x58d268(0x1e3)+_0xcd91ba+_0x58d268(0x22a)),0x0;}console[_0x58d268(0x248)]('\x0a'+a22_0x225566[_0x58d268(0x16d)]('Output\x20Database:')+'\x20'+a22_0x225566['cyan'](_0x3d4854));const _0x54324f=await withSpinner(_0x58d268(0x160),()=>_0x211df9['segment']['getParentSQL'](_0xc3fa64),{'verbose':_0x4c4074[_0x58d268(0x24c)]});console['error']('\x0a'+a22_0x225566[_0x58d268(0x16d)](_0x58d268(0x281))+'\x20'+a22_0x225566[_0x58d268(0x1f0)]('('+_0x3d4854+_0x58d268(0x1cd)));const _0x3a1d74=await executeSchemaQuery(_0x54324f['data'],_0x211df9,_0x4c4074);await handleQueryOutput(_0x3a1d74,_0x4c4074);const _0x4265a1=await withSpinner('Fetching\x20behavior\x20list...',()=>_0x211df9[_0x58d268(0x1ee)][_0x58d268(0x252)](_0xc3fa64),{'verbose':_0x4c4074[_0x58d268(0x24c)]});for(const _0x33976d of _0x4265a1[_0x58d268(0x241)]){const _0x161920=_0x58d268(0x276)+_0x33976d['toLowerCase']()[_0x58d268(0x1ca)](/\s+/g,'_'),_0x40a55a=_0x58d268(0x239)+_0x3d4854+'.'+_0x161920;console[_0x58d268(0x248)]('\x0a'+a22_0x225566[_0x58d268(0x16d)](_0x33976d)+'\x20'+a22_0x225566[_0x58d268(0x1f0)]('('+_0x3d4854+'.'+_0x161920+')'));try{const _0x87495=await executeSchemaQuery(_0x40a55a,_0x211df9,_0x4c4074);await handleQueryOutput(_0x87495,_0x4c4074);}catch{console[_0x58d268(0x248)](a22_0x225566[_0x58d268(0x19b)](_0x58d268(0x184)));}}return 0x0;}async[a22_0x46829f(0x20e)](_0x230e5d,_0x3a3e8c,_0x1a9b06,_0x3ae62c){const _0x38bc87=a22_0x46829f,{options:_0x28c695,tdx:_0x28c9fb}=_0x230e5d,_0x4a027d=await withSpinner('Fetching\x20customers\x20schema...',()=>_0x28c9fb[_0x38bc87(0x1ee)]['getParentSQL'](_0x1a9b06),{'verbose':_0x28c695[_0x38bc87(0x24c)]}),_0x21d066=await executeSchemaQuery(_0x4a027d[_0x38bc87(0x241)],_0x28c9fb,_0x28c695),_0xcda396=_0x21d066[_0x38bc87(0x241)][_0x38bc87(0x1a3)](_0x2b81ea=>({'name':_0x2b81ea[_0x38bc87(0x175)],'type':_0x2b81ea[_0x38bc87(0x21c)]})),_0x274ddb=await withSpinner('Fetching\x20behavior\x20list...',()=>_0x28c9fb[_0x38bc87(0x1ee)][_0x38bc87(0x252)](_0x1a9b06),{'verbose':_0x28c695[_0x38bc87(0x24c)]}),_0x448ac8=[];for(const _0x2f6c93 of _0x274ddb['data']){const _0x4ea40e=_0x38bc87(0x276)+_0x2f6c93[_0x38bc87(0x15d)]()[_0x38bc87(0x1ca)](/\s+/g,'_'),_0x36c693=_0x38bc87(0x239)+_0x3ae62c+'.'+_0x4ea40e;let _0x23d041=[];try{const _0x37d98a=await executeSchemaQuery(_0x36c693,_0x28c9fb,_0x28c695);_0x23d041=_0x37d98a[_0x38bc87(0x241)][_0x38bc87(0x1a3)](_0xd2d44=>({'name':_0xd2d44[_0x38bc87(0x175)],'type':_0xd2d44[_0x38bc87(0x21c)]}));}catch{}_0x448ac8[_0x38bc87(0x27b)]({'table':_0x4ea40e,'columns':_0x23d041});}return{'database':_0x3ae62c,'parent_segment':_0x3a3e8c,'parent_id':_0x1a9b06,'customers':{'table':'customers','columns':_0xcda396},'behaviors':_0x448ac8};}[a22_0x46829f(0x26e)](_0x37f0c2){const _0x2c4b2f=a22_0x46829f,_0x3265df=_0x5a59c6=>{const _0x5c2e47=a22_0x33a2;if(_0x5a59c6[_0x5c2e47(0x1a9)]===0x0)return'[]';const _0x2a582c=_0x5a59c6[_0x5c2e47(0x1a3)](_0x52c522=>_0x5c2e47(0x262)+_0x52c522[_0x5c2e47(0x151)]+_0x5c2e47(0x1ef)+_0x52c522[_0x5c2e47(0x231)]+_0x5c2e47(0x1df));return'[\x0a'+_0x2a582c['join'](',\x0a')+_0x5c2e47(0x177);},_0x42cd96=_0x37f0c2[_0x2c4b2f(0x255)][_0x2c4b2f(0x1a3)](_0x1b348e=>{const _0x57c8ab=_0x2c4b2f;return'\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22'+_0x1b348e[_0x57c8ab(0x1fa)]+'\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20'+_0x3265df(_0x1b348e[_0x57c8ab(0x1d0)])[_0x57c8ab(0x1ca)](/^/gm,'\x20\x20')[_0x57c8ab(0x1d9)]()+'\x0a\x20\x20\x20\x20}';})[_0x2c4b2f(0x1a1)](',\x0a');return _0x2c4b2f(0x17b)+_0x37f0c2[_0x2c4b2f(0x275)]+_0x2c4b2f(0x28e)+_0x37f0c2[_0x2c4b2f(0x240)]+'\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22'+_0x37f0c2[_0x2c4b2f(0x1af)]+_0x2c4b2f(0x1cb)+_0x37f0c2['customers'][_0x2c4b2f(0x1fa)]+_0x2c4b2f(0x1f8)+_0x3265df(_0x37f0c2[_0x2c4b2f(0x281)][_0x2c4b2f(0x1d0)])['replace'](/^/gm,'\x20\x20')[_0x2c4b2f(0x1d9)]()+_0x2c4b2f(0x217)+_0x42cd96+'\x0a\x20\x20]\x0a}\x0a';}}export class ParentSegmentSQLCommand extends BaseCommand{[a22_0x46829f(0x151)]=a22_0x46829f(0x20c);[a22_0x46829f(0x1e9)]=a22_0x46829f(0x233);async['execute'](_0x8aead0){const _0x3c71e6=a22_0x46829f,{options:_0x5ce9b3,args:_0x34f681,tdx:_0x1dbd1c}=_0x8aead0,_0x3eb3f8=_0x34f681[0x0]||_0x5ce9b3['parentSegment'];if(!_0x3eb3f8)return showParentSegmentNotSetError(_0x3c71e6(0x22c)+_0x3c71e6(0x25f)),0x1;_0x5ce9b3[_0x3c71e6(0x24c)]&&(console[_0x3c71e6(0x248)]('Site:\x20'+_0x5ce9b3[_0x3c71e6(0x27d)]),console[_0x3c71e6(0x248)]('Parent\x20segment:\x20'+_0x3eb3f8));const _0x591193=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x3eb3f8+'\x27...',()=>_0x1dbd1c['segment'][_0x3c71e6(0x198)](_0x3eb3f8),{'verbose':_0x5ce9b3[_0x3c71e6(0x24c)]}),_0x397056=_0x591193[_0x3c71e6(0x241)],_0x34c71b=await withSpinner(_0x3c71e6(0x23e)+_0x3eb3f8+'\x27...',()=>_0x1dbd1c['segment'][_0x3c71e6(0x147)](_0x397056),{'verbose':_0x5ce9b3[_0x3c71e6(0x24c)]}),_0xcb9019=_0x34c71b[_0x3c71e6(0x241)];return _0x5ce9b3[_0x3c71e6(0x19e)]==='json'||_0x5ce9b3[_0x3c71e6(0x19e)]==='jsonl'?await handleSDKOutput([{'sql':_0xcb9019}],_0x5ce9b3):console[_0x3c71e6(0x23a)](_0xcb9019),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{['name']=a22_0x46829f(0x1be);[a22_0x46829f(0x1e9)]='Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results';async['execute'](_0x266c7a){const _0x37565a=a22_0x46829f,{options:_0x22a03a,args:_0x3eab2e,tdx:_0x4213c9}=_0x266c7a,_0x5e1837=_0x3eab2e[0x0]||_0x22a03a[_0x37565a(0x1f4)];if(!_0x5e1837)return showParentSegmentNotSetError(_0x37565a(0x257)+_0x37565a(0x1f5)),0x1;_0x22a03a[_0x37565a(0x24c)]&&(console[_0x37565a(0x248)](_0x37565a(0x215)+_0x22a03a[_0x37565a(0x27d)]),console[_0x37565a(0x248)](_0x37565a(0x254)+_0x5e1837));const _0x1ec6f1=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x5e1837+_0x37565a(0x178),()=>_0x4213c9[_0x37565a(0x1ee)][_0x37565a(0x198)](_0x5e1837),{'verbose':_0x22a03a[_0x37565a(0x24c)]}),_0x431dfc=_0x1ec6f1['data'],_0x3aa3fe=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x5e1837+_0x37565a(0x178),()=>_0x4213c9['segment'][_0x37565a(0x147)](_0x431dfc),{'verbose':_0x22a03a[_0x37565a(0x24c)]});let _0xa0bdc=_0x3aa3fe[_0x37565a(0x241)];const _0x15ea14=resolveLimit(_0x22a03a[_0x37565a(0x277)],DEFAULT_DISPLAY_LIMIT),_0x1b2383=/\bLIMIT\s+\d+/i[_0x37565a(0x283)](_0xa0bdc);!_0x1b2383&&(_0xa0bdc=_0xa0bdc[_0x37565a(0x1d9)]()['replace'](/;+$/,''),_0xa0bdc=_0x37565a(0x214)+_0xa0bdc+_0x37565a(0x203)+_0x15ea14);_0x22a03a[_0x37565a(0x24c)]&&console['error'](_0x37565a(0x222)+_0xa0bdc);const _0x1a1382=await withProgressSpinner('Executing\x20parent\x20segment\x20query...',async _0x220ea2=>{const _0x4595e5=_0x37565a,_0xc30b98=await _0x4213c9[_0x4595e5(0x28b)][_0x4595e5(0x274)](_0xa0bdc,{'catalog':'td','schema':_0x4595e5(0x1a0),'onJobId':_0x502ee0=>{const _0x6ec487=_0x4595e5;_0x220ea2[_0x6ec487(0x20a)](_0x502ee0);}});return _0xc30b98;},{'verbose':_0x22a03a[_0x37565a(0x24c)]}),_0x1fc720=_0x1a1382[_0x37565a(0x241)],_0x28e918=_0x1fc720[_0x37565a(0x1d5)]?'\x20[Job\x20ID:\x20'+_0x1fc720[_0x37565a(0x1d5)]+']':'';return console[_0x37565a(0x248)](_0x37565a(0x162)+_0x1fc720[_0x37565a(0x190)][_0x37565a(0x207)][_0x37565a(0x205)]()+_0x37565a(0x1eb)+(_0x37565a(0x15b)+formatElapsed(_0x1fc720[_0x37565a(0x190)][_0x37565a(0x17f)])+_0x28e918)),await handleQueryOutput(_0x1fc720,_0x22a03a),0x0;}}
1
+ const a22_0x14fbc1=a22_0x4d49;(function(_0x5db621,_0xe2bce9){const _0x307904=a22_0x4d49,_0x63a476=_0x5db621();while(!![]){try{const _0x446659=parseInt(_0x307904(0xe5))/0x1*(-parseInt(_0x307904(0xbc))/0x2)+parseInt(_0x307904(0x1da))/0x3*(parseInt(_0x307904(0xe0))/0x4)+parseInt(_0x307904(0x15d))/0x5*(parseInt(_0x307904(0xa4))/0x6)+parseInt(_0x307904(0x101))/0x7+parseInt(_0x307904(0xfa))/0x8+parseInt(_0x307904(0xa3))/0x9+parseInt(_0x307904(0x15f))/0xa*(-parseInt(_0x307904(0x1c3))/0xb);if(_0x446659===_0xe2bce9)break;else _0x63a476['push'](_0x63a476['shift']());}catch(_0x5befc0){_0x63a476['push'](_0x63a476['shift']());}}}(a22_0xca5d,0xa1fc6));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a22_0x316a68 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,createCommandSpinner,formatElapsed}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';function a22_0x4d49(_0xc1d108,_0x43ad8e){_0xc1d108=_0xc1d108-0x85;const _0xca5d82=a22_0xca5d();let _0x4d49ea=_0xca5d82[_0xc1d108];return _0x4d49ea;}import{getConsoleUrl,getConsoleNextUrl}from'../sdk/client/endpoints.js';import{formatRows,formatAsTable,hyperlink}from'../sdk/util/formatters.js';import{parseDef}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import a22_0x36914f from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../sdk/segment/fields-display.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';const PARENT_SEGMENT_DIR=a22_0x14fbc1(0x1b5),LEGACY_PARENT_SEGMENT_DIR=a22_0x14fbc1(0xe7);function openBrowser(_0x43a943){const _0x4220ff=a22_0x14fbc1,_0x106a0b=process['platform'],_0x53113e=_0x106a0b===_0x4220ff(0x125)?'open':_0x106a0b===_0x4220ff(0x1b1)?_0x4220ff(0x1bd):'xdg-open';spawn(_0x53113e,[_0x43a943],{'detached':!![],'stdio':_0x4220ff(0xde)})[_0x4220ff(0x1b4)]();}function migrateLegacyDirectory(){const _0x3fa273=a22_0x14fbc1;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x4ffe79=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x4ffe79[_0x3fa273(0x15c)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x3fa273(0x11d)](a22_0x36914f['yellow'](_0x3fa273(0xa8)+LEGACY_PARENT_SEGMENT_DIR+_0x3fa273(0xd0)+PARENT_SEGMENT_DIR+_0x3fa273(0x17c))),console[_0x3fa273(0x11d)](a22_0x36914f[_0x3fa273(0x198)](_0x3fa273(0x1b7)+LEGACY_PARENT_SEGMENT_DIR+'/\x20directory.\x0a')),![];console['error'](a22_0x36914f[_0x3fa273(0xdf)](_0x3fa273(0x1cf)+LEGACY_PARENT_SEGMENT_DIR+_0x3fa273(0x1a7)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x3fa273(0x11d)](a22_0x36914f[_0x3fa273(0x1d2)](_0x3fa273(0xce)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x5ad24a){const _0x554603=_0x5ad24a instanceof Error?_0x5ad24a[_0x3fa273(0x149)]:String(_0x5ad24a);return console[_0x3fa273(0x11d)](a22_0x36914f[_0x3fa273(0xb9)](_0x3fa273(0x1d0)+_0x554603+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a22_0x14fbc1(0x96)](_0xcd6b7){const _0x56868f=a22_0x14fbc1;return migrateLegacyDirectory(),super[_0x56868f(0x96)](_0xcd6b7);}}function resolveYamlFile(_0x1a6ee5){const _0x4f2c31=a22_0x14fbc1;if(_0x1a6ee5[_0x4f2c31(0x97)](_0x4f2c31(0x13a))||_0x1a6ee5[_0x4f2c31(0x97)](_0x4f2c31(0x188)))return _0x1a6ee5;return a22_0x316a68['join'](PARENT_SEGMENT_DIR,sanitizeFileName(_0x1a6ee5)+_0x4f2c31(0x13a));}function formatProgressMessage(_0x18b0a1){const _0x366bc0=a22_0x14fbc1,_0x2a908d=_0x18b0a1['match'](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x2a908d){const [,_0x1bce59,_0x3b6ee6,_0x2680aa='']=_0x2a908d;return a22_0x36914f[_0x366bc0(0x198)](_0x1bce59+':')+'\x20'+_0x3b6ee6+a22_0x36914f['dim'](_0x2680aa);}return a22_0x36914f['dim'](_0x18b0a1);}function showFileNotFoundError(_0x3fa922,_0x44cfc6){const _0x10e84a=a22_0x14fbc1;console['error'](a22_0x36914f[_0x10e84a(0xb9)](_0x10e84a(0x90)+_0x3fa922+'\x0a')),console[_0x10e84a(0x11d)](a22_0x36914f['cyan'](_0x10e84a(0xa9)+_0x44cfc6+_0x10e84a(0x10a)));}function showParentSegmentNotSetError(_0x22f8b9){const _0x520041=a22_0x14fbc1;console['error'](a22_0x36914f[_0x520041(0xdf)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x520041(0x11d)](_0x22f8b9);}export class ParentSegmentListCommand extends BaseCommand{['name']=a22_0x14fbc1(0x15e);[a22_0x14fbc1(0xe1)]=a22_0x14fbc1(0xa7);async['execute'](_0x473637){const _0x2f0805=a22_0x14fbc1,{options:_0xe315eb,args:_0x125e09,tdx:_0x32b959}=_0x473637,_0x25dd30=_0x125e09[0x0];_0xe315eb[_0x2f0805(0xed)]&&(console[_0x2f0805(0x11d)](_0x2f0805(0xb1)+_0xe315eb[_0x2f0805(0x18f)]),_0x25dd30&&console[_0x2f0805(0x11d)]('Pattern:\x20'+_0x25dd30));const _0x5682e4=await withSpinner(_0x25dd30?_0x2f0805(0x123)+_0x25dd30+_0x2f0805(0x13b):_0x2f0805(0x190),()=>_0x32b959[_0x2f0805(0x8e)]['listParents'](),{'verbose':_0xe315eb[_0x2f0805(0xed)]});let _0x181d8c=_0x5682e4['data'];if(_0x25dd30){const _0x16af92=_0x25dd30[_0x2f0805(0x189)](/[.+^${}()|[\]\\]/g,_0x2f0805(0x108))[_0x2f0805(0x189)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x4b70fc=new RegExp('^'+_0x16af92+'$','i');_0x181d8c=_0x181d8c[_0x2f0805(0xfe)](_0x259645=>_0x4b70fc[_0x2f0805(0x170)](_0x259645[_0x2f0805(0x187)][_0x2f0805(0xb6)]));}_0x181d8c[_0x2f0805(0x8a)]((_0x2b60dd,_0x1bd3fc)=>_0x2b60dd[_0x2f0805(0x187)][_0x2f0805(0xb6)][_0x2f0805(0xc6)](_0x1bd3fc[_0x2f0805(0x187)][_0x2f0805(0xb6)])),console['error'](_0x2f0805(0x1c5)+_0x181d8c[_0x2f0805(0x155)]+_0x2f0805(0x17e)+(_0x181d8c[_0x2f0805(0x155)]!==0x1?'s':''));const _0x1f6669=_0x1fd332=>{const _0x55f329=_0x2f0805;return getConsoleNextUrl(_0xe315eb[_0x55f329(0x18f)],_0x55f329(0x199)+_0x1fd332);};if(_0xe315eb[_0x2f0805(0x147)]==='json'||_0xe315eb[_0x2f0805(0x147)]==='jsonl'){const _0x126e85=_0x181d8c[_0x2f0805(0x106)](_0x1e0d41=>({..._0x1e0d41,'url':_0x1f6669(_0x1e0d41['id'])}));await handleSDKOutput(_0x126e85,_0xe315eb);}else{if(_0x181d8c[_0x2f0805(0x155)]===0x0)_0x25dd30?console['log'](_0x2f0805(0x138)+_0x25dd30):console[_0x2f0805(0xc3)](_0x2f0805(0x169));else for(const _0x4b4e6a of _0x181d8c){const _0x1b3cf5=_0x4b4e6a[_0x2f0805(0x187)][_0x2f0805(0x1e3)]?a22_0x36914f['dim']('\x20('+formatRows(_0x4b4e6a[_0x2f0805(0x187)]['population'])+')'):'',_0x516506=hyperlink(_0x4b4e6a['attributes'][_0x2f0805(0xb6)],_0x1f6669(_0x4b4e6a['id']));console['log'](_0x2f0805(0x111)+_0x516506+_0x1b3cf5);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a22_0x14fbc1(0xb6)]=a22_0x14fbc1(0x11b);[a22_0x14fbc1(0xe1)]=a22_0x14fbc1(0x182);async[a22_0x14fbc1(0x142)](_0x367c66){const _0x202517=a22_0x14fbc1,{options:_0x5b0fbf,args:_0x347698,tdx:_0x4f3bab}=_0x367c66;console[_0x202517(0x11d)](_0x202517(0x129)+_0x202517(0x1d6)+_0x202517(0xb3));const _0x5ed480=_0x5b0fbf;if(_0x347698[_0x202517(0x155)]===0x0)return console['error'](a22_0x36914f[_0x202517(0xb9)](_0x202517(0xac))),console[_0x202517(0x11d)]('Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>'),0x1;const _0x2f94a3=_0x347698[0x0];if(!_0x5ed480[_0x202517(0xb8)]||!_0x5ed480[_0x202517(0xc1)])return console[_0x202517(0x11d)](_0x202517(0x10b)),console[_0x202517(0x11d)]('Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>'),0x1;_0x5ed480[_0x202517(0xed)]&&(console[_0x202517(0x11d)](_0x202517(0xb1)+_0x5ed480[_0x202517(0x18f)]),console[_0x202517(0x11d)](_0x202517(0x1be)+_0x2f94a3),console[_0x202517(0x11d)](_0x202517(0x116)+_0x5ed480['database']),console[_0x202517(0x11d)](_0x202517(0xee)+_0x5ed480[_0x202517(0xc1)]));const _0xabe5ad=await loadJSONFromOptions(_0x5ed480[_0x202517(0x187)],_0x5ed480[_0x202517(0xf8)]),_0x52b251=await loadJSONFromOptions(_0x5ed480[_0x202517(0x1cd)],_0x5ed480[_0x202517(0x112)]),_0x1eb9e6=await loadJSONFromOptions(_0x5ed480[_0x202517(0x19f)],_0x5ed480[_0x202517(0x17b)]),_0x10a8a3={'name':_0x2f94a3,'description':_0x5ed480[_0x202517(0xe1)],'scheduleType':_0x5ed480[_0x202517(0xef)],'scheduleOption':_0x5ed480[_0x202517(0x191)],'timezone':_0x5ed480[_0x202517(0xdb)],'master':{'parentDatabaseName':_0x5ed480['database'],'parentTableName':_0x5ed480[_0x202517(0xc1)]},'attributes':_0xabe5ad,'behaviors':_0x52b251,'customerGroup':_0x1eb9e6},_0xb6f58e=await withSpinner('Creating\x20parent\x20segment\x20\x27'+_0x2f94a3+_0x202517(0x13b),()=>_0x4f3bab[_0x202517(0x8e)][_0x202517(0xd9)](_0x10a8a3),{'verbose':_0x5b0fbf['verbose']}),_0x4f51f9=_0xb6f58e['data'];return console[_0x202517(0x11d)](_0x202517(0x1ad)+_0x4f51f9[_0x202517(0xb6)]+_0x202517(0x1a5)+_0x4f51f9['id']),await handleSDKOutput([_0x4f51f9],_0x5b0fbf),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a22_0x14fbc1(0xb6)]=a22_0x14fbc1(0xd6);[a22_0x14fbc1(0xe1)]=a22_0x14fbc1(0x1dc);async[a22_0x14fbc1(0x142)](_0x1e51f7){const _0x7048ae=a22_0x14fbc1,{options:_0x4812af,args:_0x47d8df,tdx:_0x5238a0}=_0x1e51f7;console[_0x7048ae(0x11d)](_0x7048ae(0xa5)+'\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a'+_0x7048ae(0xb3));const _0x4b8d25=_0x4812af;if(_0x47d8df['length']===0x0)return console['error'](a22_0x36914f[_0x7048ae(0xb9)](_0x7048ae(0xac))),console['error'](_0x7048ae(0x107)),0x1;const _0x53fb16=_0x47d8df[0x0];_0x4b8d25[_0x7048ae(0xed)]&&(console['error'](_0x7048ae(0xb1)+_0x4b8d25[_0x7048ae(0x18f)]),console[_0x7048ae(0x11d)]('Parent\x20segment:\x20'+_0x53fb16));const _0x564eaf=await withSpinner(_0x7048ae(0x1aa)+_0x53fb16+_0x7048ae(0x13b),()=>_0x5238a0['segment'][_0x7048ae(0xaf)](_0x53fb16),{'verbose':_0x4b8d25[_0x7048ae(0xed)]}),_0x5f3402=_0x564eaf[_0x7048ae(0x194)],_0x29cb12=await loadJSONFromOptions(_0x4b8d25['addAttributes'],_0x4b8d25[_0x7048ae(0xdd)]),_0x4eaf24=await loadJSONFromOptions(_0x4b8d25[_0x7048ae(0x1de)],_0x4b8d25[_0x7048ae(0x1d3)]),_0x27901e={'name':_0x5f3402[_0x7048ae(0xb6)],'description':_0x4b8d25['description']!==undefined?_0x4b8d25[_0x7048ae(0xe1)]:_0x5f3402[_0x7048ae(0xe1)],'scheduleType':_0x4b8d25[_0x7048ae(0xef)]!==undefined?_0x4b8d25['scheduleType']:_0x5f3402[_0x7048ae(0xef)],'scheduleOption':_0x4b8d25['scheduleOption']!==undefined?_0x4b8d25[_0x7048ae(0x191)]:_0x5f3402['scheduleOption'],'timezone':_0x4b8d25['timezone']!==undefined?_0x4b8d25['timezone']:_0x5f3402['timezone'],'master':_0x5f3402['master'],'attributes':_0x29cb12?[..._0x5f3402[_0x7048ae(0x187)]||[],..._0x29cb12]:_0x5f3402[_0x7048ae(0x187)],'behaviors':_0x4eaf24?[..._0x5f3402[_0x7048ae(0x1cd)]||[],..._0x4eaf24]:_0x5f3402[_0x7048ae(0x1cd)],'customerGroup':_0x5f3402[_0x7048ae(0x19f)]},_0x329ae8=await withSpinner(_0x7048ae(0x1e0)+_0x53fb16+'\x27...',()=>_0x5238a0[_0x7048ae(0x8e)][_0x7048ae(0xba)](_0x53fb16,_0x27901e),{'verbose':_0x4b8d25[_0x7048ae(0xed)]}),_0x472044=_0x329ae8[_0x7048ae(0x194)];return console[_0x7048ae(0x11d)](_0x7048ae(0xda)+_0x472044[_0x7048ae(0xb6)]+'\x27'),await handleSDKOutput([_0x472044],_0x4b8d25),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a22_0x14fbc1(0xb6)]=a22_0x14fbc1(0x16f);['description']='Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file';async[a22_0x14fbc1(0x142)](_0x149ced){const _0x3017e9=a22_0x14fbc1,{options:_0x5addd8,args:_0x25191c,tdx:_0x3e0912}=_0x149ced,_0x4bfd82=_0x5addd8,_0x175801=_0x25191c[0x0]||_0x5addd8[_0x3017e9(0xcc)];if(!_0x175801)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a'+_0x3017e9(0x176)),0x1;if(_0x4bfd82[_0x3017e9(0x1bc)]&&_0x4bfd82['output'])return console[_0x3017e9(0x11d)](a22_0x36914f['red'](_0x3017e9(0xbe))),console[_0x3017e9(0x11d)](a22_0x36914f[_0x3017e9(0x198)]('The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires')),console[_0x3017e9(0x11d)](a22_0x36914f[_0x3017e9(0x198)](_0x3017e9(0x19c)+PARENT_SEGMENT_DIR+_0x3017e9(0xc8))),console[_0x3017e9(0x11d)](a22_0x36914f[_0x3017e9(0xa2)]('Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u')),0x1;const _0x3bd229=_0x4bfd82[_0x3017e9(0xcf)]||a22_0x316a68[_0x3017e9(0xc5)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x175801)+_0x3017e9(0x13a));_0x4bfd82[_0x3017e9(0xed)]&&(console['error'](_0x3017e9(0xb1)+_0x4bfd82['site']),console[_0x3017e9(0x11d)]('Parent\x20segment:\x20'+_0x175801),console[_0x3017e9(0x11d)](_0x3017e9(0x18b)+_0x3bd229));const _0x1bea03=await withSpinner('Fetching\x20parent\x20segment\x20\x27'+_0x175801+_0x3017e9(0x13b),()=>_0x3e0912['segment'][_0x3017e9(0x150)](_0x175801),{'verbose':_0x4bfd82[_0x3017e9(0xed)]}),_0x260705=_0x1bea03[_0x3017e9(0x194)];if(existsSync(_0x3bd229)){const _0x3cc543=readFileSync(_0x3bd229,_0x3017e9(0x104)),_0x3f5ccf=generateDiff(_0x3cc543,_0x260705);if(!hasChanges(_0x3f5ccf))console[_0x3017e9(0x11d)](a22_0x36914f[_0x3017e9(0x1d2)]('✔')+'\x20No\x20changes\x20-\x20'+a22_0x36914f['cyan'](_0x3bd229)+_0x3017e9(0x109));else{console[_0x3017e9(0x11d)](_0x3017e9(0x115)+_0x3bd229+'\x27:'),console[_0x3017e9(0x11d)]('─'[_0x3017e9(0x86)](0x3c)),console[_0x3017e9(0x11d)](formatDiffWithColors(_0x3f5ccf)),console[_0x3017e9(0x11d)]('─'[_0x3017e9(0x86)](0x3c));if(!_0x4bfd82[_0x3017e9(0x12b)]){if(!isInteractive())return console[_0x3017e9(0x11d)](a22_0x36914f[_0x3017e9(0xb9)](_0x3017e9(0x173)),_0x3017e9(0xf6)),console[_0x3017e9(0x11d)](a22_0x36914f['dim'](_0x3017e9(0x93))),0x1;const _0x224b42=await confirmKey('Overwrite\x20\x27'+_0x3bd229+'\x27?');if(!_0x224b42)return console['error'](a22_0x36914f[_0x3017e9(0xdf)](_0x3017e9(0xea))),0x1;}writeFileSync(_0x3bd229,_0x260705,_0x3017e9(0x104)),console['error'](a22_0x36914f[_0x3017e9(0x1d2)]('✔')+_0x3017e9(0x160)+a22_0x36914f['cyan'](_0x3bd229));}}else{const _0x3c018f=a22_0x316a68[_0x3017e9(0x113)](_0x3bd229);!existsSync(_0x3c018f)&&mkdirSync(_0x3c018f,{'recursive':!![]}),writeFileSync(_0x3bd229,_0x260705,_0x3017e9(0x104)),console[_0x3017e9(0x11d)](a22_0x36914f['green']('✔')+_0x3017e9(0x160)+a22_0x36914f[_0x3017e9(0xa2)](_0x3bd229));}return saveSessionContext({'parent_segment':_0x175801},_0x4bfd82[_0x3017e9(0x134)]),console[_0x3017e9(0x11d)](a22_0x36914f[_0x3017e9(0x1d2)]('✔')+_0x3017e9(0xff)+a22_0x36914f[_0x3017e9(0x198)](_0x3017e9(0xe7))+_0x3017e9(0x177)+a22_0x36914f[_0x3017e9(0xa2)](_0x175801)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a22_0x14fbc1(0xb6)]=a22_0x14fbc1(0xf3);[a22_0x14fbc1(0xe1)]='Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file';async[a22_0x14fbc1(0x142)](_0x264399){const _0x2802f4=a22_0x14fbc1,{options:_0x27125e,args:_0x58c436,tdx:_0x5d7945}=_0x264399,_0x1048ac=_0x27125e,_0x40fb8f=_0x58c436[0x0]||_0x27125e['parentSegment'];if(!_0x40fb8f)return showParentSegmentNotSetError(_0x2802f4(0xf2)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment'),0x1;const _0x58265d=resolveYamlFile(_0x40fb8f);if(!existsSync(_0x58265d))return showFileNotFoundError(_0x58265d,_0x40fb8f),0x1;_0x1048ac[_0x2802f4(0xed)]&&(console['error'](_0x2802f4(0xb1)+_0x1048ac['site']),console[_0x2802f4(0x11d)](_0x2802f4(0x9a)+_0x58265d));let _0x28987b;try{_0x28987b=readFileSync(_0x58265d,_0x2802f4(0x104));}catch(_0xf10d2){const _0x1adfda=_0xf10d2 instanceof Error?_0xf10d2['message']:String(_0xf10d2);return console['error'](_0x2802f4(0x94)+_0x1adfda),0x1;}const _0x458d76=await withSpinner('Analyzing\x20changes...',()=>_0x5d7945[_0x2802f4(0x8e)][_0x2802f4(0x171)](_0x28987b),{'verbose':_0x1048ac[_0x2802f4(0xed)]}),_0x2ccf51=_0x458d76[_0x2802f4(0x194)],{isNew:_0x5246e0,name:_0x531f35,hasChanges:_0x3698ba,diffFormatted:_0x3cf46f}=_0x2ccf51;if(!_0x3698ba)return console[_0x2802f4(0x11d)](_0x2802f4(0xb7)+_0x531f35+_0x2802f4(0x121)),0x0;_0x5246e0?console[_0x2802f4(0x11d)](_0x2802f4(0xe8)+_0x531f35+'\x27:'):console[_0x2802f4(0x11d)](_0x2802f4(0x1a8)+_0x531f35+'\x27:');console[_0x2802f4(0x11d)]('─'[_0x2802f4(0x86)](0x3c)),console['error'](_0x3cf46f),console['error']('─'['repeat'](0x3c));const _0x5c01c9=_0x5246e0?'Create\x20parent\x20segment\x20\x27'+_0x531f35+'\x27?':_0x2802f4(0xa1)+_0x531f35+'\x27?';if(!_0x1048ac[_0x2802f4(0x12b)]){if(!isInteractive())return console[_0x2802f4(0x11d)](a22_0x36914f[_0x2802f4(0xb9)](_0x2802f4(0x173)),_0x2802f4(0xf6)),console[_0x2802f4(0x11d)](a22_0x36914f[_0x2802f4(0x198)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x65199=await confirmKey(_0x5c01c9);if(!_0x65199)return console[_0x2802f4(0x11d)](a22_0x36914f[_0x2802f4(0xdf)](_0x2802f4(0xea))),0x1;}const _0x3687b6=_0x5246e0?_0x2802f4(0x139):'Updating',_0x1a33c2=await withSpinner(_0x3687b6+_0x2802f4(0x1af)+_0x531f35+_0x2802f4(0x13b),()=>_0x2ccf51[_0x2802f4(0x17d)](),{'verbose':_0x1048ac[_0x2802f4(0xed)]}),_0x5df2a7=_0x1a33c2['data'],_0x2d028e=getConsoleNextUrl(_0x1048ac['site'],_0x2802f4(0x199)+_0x5df2a7['id']),_0x4f6a29=_0x5246e0?_0x2802f4(0x1b0):'Updated';return console[_0x2802f4(0x11d)]('✔\x20'+_0x4f6a29+_0x2802f4(0x1af)+_0x5df2a7[_0x2802f4(0xb6)]+'\x27'),console[_0x2802f4(0x11d)]('\x20\x20'+_0x2d028e),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{['name']=a22_0x14fbc1(0x1a2);[a22_0x14fbc1(0xe1)]=a22_0x14fbc1(0x16b);async[a22_0x14fbc1(0x142)](_0x4f66b2){const _0x21e5bc=a22_0x14fbc1,{options:_0x5b4617,args:_0x1a1ca3,tdx:_0x450845}=_0x4f66b2,_0x238d65=_0x5b4617,_0x6d4f48=_0x1a1ca3[0x0]||_0x5b4617[_0x21e5bc(0xcc)];if(!_0x6d4f48)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'+_0x21e5bc(0x9b)+_0x21e5bc(0xca)+'\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a'+'\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a'+_0x21e5bc(0x128)),0x1;const _0x1a7d60=resolveYamlFile(_0x6d4f48);if(!existsSync(_0x1a7d60))return showFileNotFoundError(_0x1a7d60,_0x6d4f48),0x1;_0x238d65[_0x21e5bc(0xed)]&&(console[_0x21e5bc(0x11d)](_0x21e5bc(0xb1)+_0x238d65['site']),console['error'](_0x21e5bc(0x9a)+_0x1a7d60));let _0x5eee3b;try{_0x5eee3b=readFileSync(_0x1a7d60,_0x21e5bc(0x104));}catch(_0x561c75){const _0x4958e9=_0x561c75 instanceof Error?_0x561c75[_0x21e5bc(0x149)]:String(_0x561c75);return console[_0x21e5bc(0x11d)](_0x21e5bc(0x94)+_0x4958e9),0x1;}const _0x1d946d=createCommandSpinner(a22_0x36914f[_0x21e5bc(0x198)](_0x21e5bc(0x16a)),{'verbose':_0x238d65[_0x21e5bc(0xed)]});_0x1d946d[_0x21e5bc(0x1bd)]();const _0x580b17={'onProgress':_0xf995b0=>{const _0x3cd4e4=_0x21e5bc;_0x1d946d[_0x3cd4e4(0x17a)]=formatProgressMessage(_0xf995b0);}};if(_0x238d65[_0x21e5bc(0xd1)])_0x580b17[_0x21e5bc(0xd1)]=!![];if(_0x238d65[_0x21e5bc(0x1bf)])_0x580b17['enriched']=!![];_0x238d65[_0x21e5bc(0x1ca)]&&(_0x580b17[_0x21e5bc(0x1ca)]=_0x238d65['attribute']);_0x238d65['behavior']&&(_0x580b17[_0x21e5bc(0x157)]=_0x238d65[_0x21e5bc(0x157)]);if(_0x238d65[_0x21e5bc(0x1a3)])_0x580b17['interval']=_0x238d65[_0x21e5bc(0x1a3)];let _0x423584;try{_0x423584=await _0x450845[_0x21e5bc(0x8e)][_0x21e5bc(0x137)](_0x5eee3b,_0x580b17),_0x1d946d[_0x21e5bc(0x13f)]();}catch(_0x5e59af){_0x1d946d['stop']();throw _0x5e59af;}const _0x3dc36e=_0x238d65[_0x21e5bc(0x1a3)]||_0x21e5bc(0x178);return this[_0x21e5bc(0x146)](_0x423584,_0x580b17,_0x1a7d60,_0x3dc36e),_0x423584[_0x21e5bc(0x159)]?0x0:0x1;}['displayValidateResults'](_0x4c06bc,_0x25070f,_0x39d362,_0x46a2ae){const _0x591db1=a22_0x14fbc1;console['error']('\x0a'+a22_0x36914f[_0x591db1(0x1c2)](_0x591db1(0xe2))+'\x20'+_0x4c06bc[_0x591db1(0xb6)]),console[_0x591db1(0x11d)]('═'[_0x591db1(0x86)](0x3c)),this[_0x591db1(0x148)](_0x4c06bc);if(typeof _0x25070f['attribute']===_0x591db1(0x120)){this[_0x591db1(0xa6)](_0x4c06bc),this[_0x591db1(0x9d)](_0x4c06bc),this['displayPreviewHints'](_0x39d362,_0x46a2ae,'attribute',_0x25070f[_0x591db1(0x1ca)]);return;}if(_0x25070f[_0x591db1(0x1ca)]===!![]){this[_0x591db1(0xa6)](_0x4c06bc),this[_0x591db1(0x9d)](_0x4c06bc),this[_0x591db1(0x195)](_0x39d362,_0x46a2ae,'attributes');return;}if(typeof _0x25070f['behavior']===_0x591db1(0x120)){this[_0x591db1(0xfc)](_0x4c06bc,_0x46a2ae),this[_0x591db1(0x9d)](_0x4c06bc),this[_0x591db1(0x195)](_0x39d362,_0x46a2ae,'behavior',_0x25070f[_0x591db1(0x157)]);return;}if(_0x25070f[_0x591db1(0x157)]===!![]){this['displayBehaviorsStats'](_0x4c06bc,_0x46a2ae),this['displaySummary'](_0x4c06bc),this[_0x591db1(0x195)](_0x39d362,_0x46a2ae,_0x591db1(0x1cd));return;}this[_0x591db1(0xa6)](_0x4c06bc),this[_0x591db1(0xfc)](_0x4c06bc,_0x46a2ae),this[_0x591db1(0x9d)](_0x4c06bc),this[_0x591db1(0x195)](_0x39d362,_0x46a2ae,'all');}[a22_0x14fbc1(0x195)](_0x200bdd,_0x54669d,_0x51a32c,_0x21f682){const _0x463072=a22_0x14fbc1;console[_0x463072(0x11d)]('\x0a'+a22_0x36914f[_0x463072(0x198)](_0x463072(0x87)));const _0xa81ebe=_0x54669d!==_0x463072(0x178)?'\x20--interval\x20'+_0x54669d:'';if(_0x51a32c===_0x463072(0x1ca)&&_0x21f682)console[_0x463072(0x11d)]('\x20\x20'+a22_0x36914f[_0x463072(0x198)](_0x463072(0x16d)+_0x200bdd+_0x463072(0x9f)+_0x21f682+'\x22'+_0xa81ebe));else{if(_0x51a32c==='behavior'&&_0x21f682)console[_0x463072(0x11d)]('\x20\x20'+a22_0x36914f[_0x463072(0x198)](_0x463072(0x16d)+_0x200bdd+_0x463072(0x8d)+_0x21f682+'\x22'+_0xa81ebe));else(_0x51a32c===_0x463072(0x187)||_0x51a32c===_0x463072(0x131))&&console[_0x463072(0x11d)]('\x20\x20'+a22_0x36914f[_0x463072(0x198)](_0x463072(0x16d)+_0x200bdd+_0x463072(0x1e4)+_0xa81ebe));}(_0x51a32c==='behaviors'||_0x51a32c==='all')&&console[_0x463072(0x11d)]('\x20\x20'+a22_0x36914f['dim'](_0x463072(0x16d)+_0x200bdd+_0x463072(0xe9)+_0xa81ebe)),_0x51a32c===_0x463072(0x131)&&console[_0x463072(0x11d)]('\x20\x20'+a22_0x36914f[_0x463072(0x198)](_0x463072(0x16d)+_0x200bdd+_0x463072(0x141)+_0xa81ebe));}['displayMasterInfo'](_0x10f18f){const _0xa9134f=a22_0x14fbc1,{master:_0x278b40}=_0x10f18f,_0x2e46dc=_0x278b40['schemaValid']?a22_0x36914f['green']('✔'):a22_0x36914f['red']('✘');console[_0xa9134f(0x11d)]('\x0a'+a22_0x36914f[_0xa9134f(0x198)](_0xa9134f(0xa0))),console[_0xa9134f(0x11d)](_0x2e46dc+'\x20'+a22_0x36914f[_0xa9134f(0x1c2)](_0x278b40[_0xa9134f(0xb8)]+'.'+_0x278b40[_0xa9134f(0xc1)])),_0x278b40[_0xa9134f(0x88)]?_0x278b40[_0xa9134f(0x103)]!==undefined&&console['error']('\x20\x20'+a22_0x36914f[_0xa9134f(0x198)](_0xa9134f(0x144))+'\x20'+a22_0x36914f[_0xa9134f(0xa2)](formatRows(_0x278b40[_0xa9134f(0x103)]))):console[_0xa9134f(0x11d)]('\x20\x20'+a22_0x36914f[_0xa9134f(0xb9)](_0xa9134f(0xc7))+'\x20'+_0x278b40[_0xa9134f(0x9c)]);}['displayAttributesStats'](_0x52d413){const _0x532c3b=a22_0x14fbc1;if(_0x52d413[_0x532c3b(0x187)][_0x532c3b(0x155)]===0x0)return;console[_0x532c3b(0x11d)]('\x0a'+a22_0x36914f[_0x532c3b(0x198)](_0x532c3b(0x85)));for(const _0x5c3534 of _0x52d413[_0x532c3b(0x187)]){const _0x3fbda1=_0x5c3534['schemaValid']?a22_0x36914f[_0x532c3b(0x1d2)]('✔'):a22_0x36914f[_0x532c3b(0xb9)]('✘');let _0x1357b9='';if(_0x5c3534['schemaValid']&&_0x5c3534[_0x532c3b(0x18a)]!==undefined&&_0x5c3534[_0x532c3b(0x95)]!==undefined){const _0x2d052b=_0x5c3534[_0x532c3b(0x95)]['toFixed'](0x1),_0x3d90ad=_0x5c3534[_0x532c3b(0x95)]>=0x50?a22_0x36914f['green']:_0x5c3534[_0x532c3b(0x95)]>=0x32?a22_0x36914f['yellow']:a22_0x36914f[_0x532c3b(0xb9)];_0x1357b9='\x20'+a22_0x36914f[_0x532c3b(0x198)]('Coverage:')+'\x20'+_0x3d90ad(_0x2d052b+'%')+'\x20('+formatRows(_0x5c3534[_0x532c3b(0x18a)])+_0x532c3b(0x166);}console[_0x532c3b(0x11d)](_0x3fbda1+'\x20'+a22_0x36914f['bold'](_0x5c3534[_0x532c3b(0xb6)])+_0x1357b9),console[_0x532c3b(0x11d)]('\x20\x20'+a22_0x36914f['dim'](_0x532c3b(0x11f))+'\x20'+a22_0x36914f['bold'](_0x5c3534['database']+'.'+_0x5c3534['table']));const _0x3df20c=_0x5c3534[_0x532c3b(0xf1)]===_0x5c3534[_0x532c3b(0x1d7)]?a22_0x36914f[_0x532c3b(0x198)]('Join\x20on:')+'\x20'+_0x5c3534[_0x532c3b(0xf1)]:a22_0x36914f[_0x532c3b(0x198)](_0x532c3b(0xbd))+'\x20'+_0x5c3534[_0x532c3b(0xf1)]+_0x532c3b(0x177)+_0x5c3534['foreignKey'];console[_0x532c3b(0x11d)]('\x20\x20'+_0x3df20c),console[_0x532c3b(0x11d)]('\x20\x20'+a22_0x36914f['dim'](_0x532c3b(0x126))),this['displayColumns'](_0x5c3534[_0x532c3b(0x175)]),!_0x5c3534[_0x532c3b(0x88)]&&console[_0x532c3b(0x11d)]('\x20\x20'+a22_0x36914f[_0x532c3b(0xb9)]('Error:')+'\x20'+_0x5c3534[_0x532c3b(0x9c)]);}}[a22_0x14fbc1(0xfc)](_0x358ac0,_0x5716d8){const _0x5a4ebd=a22_0x14fbc1;if(_0x358ac0[_0x5a4ebd(0x1cd)][_0x5a4ebd(0x155)]===0x0)return;console['error']('\x0a'+a22_0x36914f[_0x5a4ebd(0x198)](_0x5a4ebd(0x1d9))+'\x20'+a22_0x36914f[_0x5a4ebd(0x198)]('('+_0x5716d8+')'));for(const _0x2496fe of _0x358ac0[_0x5a4ebd(0x1cd)]){const _0x2ec9d5=_0x2496fe['schemaValid']?a22_0x36914f[_0x5a4ebd(0x1d2)]('✔'):a22_0x36914f[_0x5a4ebd(0xb9)]('✘');let _0x5e81b2='';if(_0x2496fe['schemaValid']&&_0x2496fe['customersWithEvents']!==undefined&&_0x2496fe[_0x5a4ebd(0x151)]!==undefined){const _0x2a5303=_0x2496fe['customerPercent']?.[_0x5a4ebd(0x122)](0x1)||'?',_0x13c77a=(_0x2496fe['customerPercent']??0x0)>=0x32?a22_0x36914f[_0x5a4ebd(0x1d2)]:(_0x2496fe[_0x5a4ebd(0xdc)]??0x0)>=0x14?a22_0x36914f[_0x5a4ebd(0xdf)]:a22_0x36914f[_0x5a4ebd(0xb9)];_0x5e81b2='\x20'+a22_0x36914f['dim'](_0x5a4ebd(0xb5))+'\x20'+_0x13c77a(formatRows(_0x2496fe[_0x5a4ebd(0x1c7)]))+'\x20('+_0x2a5303+'%)\x20'+a22_0x36914f[_0x5a4ebd(0x198)]('Events:')+'\x20'+a22_0x36914f[_0x5a4ebd(0xa2)](formatRows(_0x2496fe['totalEvents']));}console['error'](_0x2ec9d5+'\x20'+a22_0x36914f[_0x5a4ebd(0x1c2)](_0x2496fe[_0x5a4ebd(0xb6)])+_0x5e81b2),console[_0x5a4ebd(0x11d)]('\x20\x20'+a22_0x36914f[_0x5a4ebd(0x198)](_0x5a4ebd(0x11f))+'\x20'+a22_0x36914f[_0x5a4ebd(0x1c2)](_0x2496fe[_0x5a4ebd(0xb8)]+'.'+_0x2496fe[_0x5a4ebd(0xc1)]));const _0x29aa00=_0x2496fe['joinKey']===_0x2496fe['foreignKey']?a22_0x36914f[_0x5a4ebd(0x198)](_0x5a4ebd(0x154))+'\x20'+_0x2496fe[_0x5a4ebd(0xf1)]:a22_0x36914f['dim']('Join:')+'\x20'+_0x2496fe[_0x5a4ebd(0xf1)]+_0x5a4ebd(0x177)+_0x2496fe['foreignKey'];console[_0x5a4ebd(0x11d)]('\x20\x20'+_0x29aa00),console[_0x5a4ebd(0x11d)]('\x20\x20'+a22_0x36914f['dim'](_0x5a4ebd(0x126))),this[_0x5a4ebd(0x165)](_0x2496fe[_0x5a4ebd(0x175)]),!_0x2496fe[_0x5a4ebd(0x88)]&&console['error']('\x20\x20'+a22_0x36914f[_0x5a4ebd(0xb9)](_0x5a4ebd(0xc7))+'\x20'+_0x2496fe['schemaError']);}}[a22_0x14fbc1(0x165)](_0x4f352c){const _0x5d57af=a22_0x14fbc1;for(const _0x401654 of _0x4f352c){_0x401654['label']===_0x401654[_0x5d57af(0x102)]||_0x401654['column']==='*'?console[_0x5d57af(0x11d)](_0x5d57af(0x183)+_0x401654['label']):console['error'](_0x5d57af(0x183)+_0x401654[_0x5d57af(0x1ac)]+'\x20'+a22_0x36914f[_0x5d57af(0x198)]('('+_0x401654[_0x5d57af(0x102)]+')'));}}['displaySummary'](_0x55e4cd){const _0x49e168=a22_0x14fbc1;console['error']('─'[_0x49e168(0x86)](0x3c));if(_0x55e4cd['errors'][_0x49e168(0x155)]>0x0){console[_0x49e168(0x11d)]('\x0a'+a22_0x36914f['red']('Errors:'));for(const _0x1817a6 of _0x55e4cd[_0x49e168(0x13e)]){console[_0x49e168(0x11d)]('\x20\x20'+a22_0x36914f[_0x49e168(0xb9)]('•')+'\x20'+_0x1817a6);}}_0x55e4cd[_0x49e168(0x159)]&&console['error']('\x0a'+a22_0x36914f[_0x49e168(0x1d2)]('✔')+_0x49e168(0xd4));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a22_0x14fbc1(0xb6)]=a22_0x14fbc1(0x168);['description']=a22_0x14fbc1(0x180);async[a22_0x14fbc1(0x142)](_0xec639c){const _0x543011=a22_0x14fbc1,{options:_0x2041f0,args:_0x4e26b6,tdx:_0x1062b3}=_0xec639c,_0x406de7=_0x2041f0,_0x4fb472=_0x4e26b6[0x0]||_0x2041f0['parentSegment'];if(!_0x4fb472)return showParentSegmentNotSetError(_0x543011(0x161)+_0x543011(0x1ab)+_0x543011(0xeb)+_0x543011(0x124)+_0x543011(0x15b)+_0x543011(0x1a9)+'\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a'+_0x543011(0x128)),0x1;if(!_0x406de7[_0x543011(0xd1)]&&!_0x406de7[_0x543011(0x1ca)]&&!_0x406de7['behavior']&&!_0x406de7[_0x543011(0x1bf)])return console[_0x543011(0x11d)](a22_0x36914f['red'](_0x543011(0x11a))),console[_0x543011(0x11d)](_0x543011(0x16e)),console[_0x543011(0x11d)](_0x543011(0xe3)),console[_0x543011(0x11d)]('\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data'),console['error'](_0x543011(0x1ae)),console['error'](_0x543011(0xd7)),console[_0x543011(0x11d)]('\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data'),0x1;const _0xd9d266=resolveYamlFile(_0x4fb472);if(!existsSync(_0xd9d266))return showFileNotFoundError(_0xd9d266,_0x4fb472),0x1;_0x406de7['verbose']&&(console[_0x543011(0x11d)](_0x543011(0xb1)+_0x406de7[_0x543011(0x18f)]),console[_0x543011(0x11d)](_0x543011(0x9a)+_0xd9d266));let _0x8ba420;try{_0x8ba420=readFileSync(_0xd9d266,_0x543011(0x104));}catch(_0x39b507){const _0x203426=_0x39b507 instanceof Error?_0x39b507[_0x543011(0x149)]:String(_0x39b507);return console[_0x543011(0x11d)](_0x543011(0x94)+_0x203426),0x1;}let _0x34cd5e;try{_0x34cd5e=parseDef(_0x8ba420);}catch(_0x239bcd){const _0x29002e=_0x239bcd instanceof Error?_0x239bcd[_0x543011(0x149)]:String(_0x239bcd);return console[_0x543011(0x11d)](a22_0x36914f[_0x543011(0xb9)](_0x543011(0xcb)+_0x29002e)),0x1;}if(_0x406de7[_0x543011(0x1ca)]===!![]||_0x406de7[_0x543011(0x1ca)]===''){const _0x4905da=_0x34cd5e[_0x543011(0x187)]?.['map'](_0x4037e2=>_0x4037e2['name'])||[];if(_0x4905da['length']===0x0)console['error'](a22_0x36914f[_0x543011(0xb9)](_0x543011(0x1df)));else{console[_0x543011(0x11d)](a22_0x36914f[_0x543011(0xb9)](_0x543011(0x1b3))),console[_0x543011(0x11d)]('Available\x20attributes:');for(const _0x2e3361 of _0x4905da){console[_0x543011(0x11d)]('\x20\x20'+a22_0x36914f[_0x543011(0xa2)](_0x2e3361));}console['error'](_0x543011(0x1bb)+_0x4fb472+'\x20--attribute\x20\x22'+_0x4905da[0x0]+'\x22');}return 0x1;}if(_0x406de7[_0x543011(0x157)]===!![]||_0x406de7[_0x543011(0x157)]===''){const _0x2ed189=_0x34cd5e[_0x543011(0x1cd)]?.['map'](_0x56f5ef=>_0x56f5ef[_0x543011(0xb6)])||[];if(_0x2ed189['length']===0x0)console[_0x543011(0x11d)](a22_0x36914f[_0x543011(0xb9)](_0x543011(0xd5)));else{console[_0x543011(0x11d)](a22_0x36914f[_0x543011(0xb9)](_0x543011(0xb2))),console[_0x543011(0x11d)](_0x543011(0xf9));for(const _0x5545c6 of _0x2ed189){console[_0x543011(0x11d)]('\x20\x20'+a22_0x36914f['cyan'](_0x5545c6));}console[_0x543011(0x11d)](_0x543011(0x1bb)+_0x4fb472+_0x543011(0x8d)+_0x2ed189[0x0]+'\x22');}return 0x1;}const _0x2ea74f=createCommandSpinner(a22_0x36914f[_0x543011(0x198)](_0x543011(0x179)),{'verbose':_0x406de7[_0x543011(0xed)]});_0x2ea74f[_0x543011(0x1bd)]();const _0x3cf098={'onProgress':_0x1bfff6=>{const _0x561bbe=_0x543011;_0x2ea74f[_0x561bbe(0x17a)]=formatProgressMessage(_0x1bfff6);}};if(_0x406de7[_0x543011(0xd1)])_0x3cf098[_0x543011(0xd1)]=!![];if(_0x406de7[_0x543011(0x1ca)]&&typeof _0x406de7[_0x543011(0x1ca)]==='string')_0x3cf098[_0x543011(0x1ca)]=_0x406de7['attribute'];if(_0x406de7[_0x543011(0x157)]&&typeof _0x406de7[_0x543011(0x157)]==='string')_0x3cf098['behavior']=_0x406de7[_0x543011(0x157)];if(_0x406de7[_0x543011(0x1bf)])_0x3cf098[_0x543011(0x1bf)]=!![];if(_0x406de7['interval'])_0x3cf098[_0x543011(0x1a3)]=_0x406de7[_0x543011(0x1a3)];let _0x742b04;try{_0x742b04=await _0x1062b3[_0x543011(0x8e)][_0x543011(0x127)](_0x8ba420,_0x3cf098),_0x2ea74f[_0x543011(0x13f)]();}catch(_0x1798f6){_0x2ea74f['stop']();throw _0x1798f6;}return await this['displayPreviewResults'](_0x742b04,{'master':_0x406de7[_0x543011(0xd1)],'attribute':typeof _0x406de7[_0x543011(0x1ca)]===_0x543011(0x120)?_0x406de7[_0x543011(0x1ca)]:undefined,'behavior':typeof _0x406de7[_0x543011(0x157)]===_0x543011(0x120)?_0x406de7['behavior']:undefined,'enriched':_0x406de7['enriched']}),_0x742b04[_0x543011(0x159)]?0x0:0x1;}async[a22_0x14fbc1(0x186)](_0x19d3f3,_0x46d0eb){const _0x18d1c9=a22_0x14fbc1;console['error']('\x0a'+a22_0x36914f['bold'](_0x18d1c9(0x15a))+'\x20'+_0x19d3f3[_0x18d1c9(0xb6)]),console[_0x18d1c9(0x11d)]('═'[_0x18d1c9(0x86)](0x3c));if(_0x46d0eb[_0x18d1c9(0xd1)]&&_0x19d3f3[_0x18d1c9(0x16c)]){const _0x26e307=a22_0x36914f[_0x18d1c9(0x198)](_0x18d1c9(0x145))+'\x20'+a22_0x36914f[_0x18d1c9(0x1c2)](_0x19d3f3['master'][_0x18d1c9(0xb8)]+'.'+_0x19d3f3[_0x18d1c9(0xd1)][_0x18d1c9(0xc1)]);await this[_0x18d1c9(0x1e2)](_0x26e307,_0x19d3f3[_0x18d1c9(0x16c)]);}else{if(_0x46d0eb[_0x18d1c9(0x1ca)]&&_0x19d3f3[_0x18d1c9(0x16c)]){const _0xad0cd3=a22_0x36914f[_0x18d1c9(0x198)](_0x18d1c9(0x10d))+'\x20'+a22_0x36914f[_0x18d1c9(0x1c2)](_0x46d0eb[_0x18d1c9(0x1ca)]);await this['displaySampleData'](_0xad0cd3,_0x19d3f3[_0x18d1c9(0x16c)]);}else{if(_0x46d0eb[_0x18d1c9(0x157)]&&_0x19d3f3['sampleData']){const _0x54cfc8=a22_0x36914f[_0x18d1c9(0x198)](_0x18d1c9(0x14d))+'\x20'+a22_0x36914f[_0x18d1c9(0x1c2)](_0x46d0eb[_0x18d1c9(0x157)]);await this[_0x18d1c9(0x1e2)](_0x54cfc8,_0x19d3f3[_0x18d1c9(0x16c)]);}else{if(_0x46d0eb['enriched']&&_0x19d3f3['sampleData']){const _0x7ed79c=a22_0x36914f[_0x18d1c9(0x198)](_0x18d1c9(0x1b9))+'\x20'+a22_0x36914f[_0x18d1c9(0x1c2)]('Master\x20+\x20Attributes');await this[_0x18d1c9(0x1e2)](_0x7ed79c,_0x19d3f3[_0x18d1c9(0x16c)]);}else!_0x19d3f3[_0x18d1c9(0x16c)]&&console[_0x18d1c9(0x11d)](_0x18d1c9(0x193));}}}if(_0x19d3f3['errors'][_0x18d1c9(0x155)]>0x0){console[_0x18d1c9(0x11d)]('─'[_0x18d1c9(0x86)](0x3c)),console[_0x18d1c9(0x11d)]('\x0a'+a22_0x36914f[_0x18d1c9(0xb9)](_0x18d1c9(0x174)));for(const _0x17eba6 of _0x19d3f3[_0x18d1c9(0x13e)]){console['error']('\x20\x20'+a22_0x36914f['red']('•')+'\x20'+_0x17eba6);}}}async[a22_0x14fbc1(0x1e2)](_0x3dbe85,_0x3d5234){const _0x3a3f1c=a22_0x14fbc1;if(_0x3d5234[_0x3a3f1c(0x155)]===0x0){console[_0x3a3f1c(0x11d)]('\x0a'+_0x3dbe85),console[_0x3a3f1c(0x11d)](_0x3a3f1c(0x14e));return;}console[_0x3a3f1c(0x11d)]('\x0a'+_0x3dbe85);const _0x3a8628=Object[_0x3a3f1c(0xd3)](_0x3d5234[0x0])[_0x3a3f1c(0x106)](_0x509842=>({'name':_0x509842,'type':typeof _0x3d5234[0x0][_0x509842]===_0x3a3f1c(0x1c4)?_0x3a3f1c(0xd8):_0x3a3f1c(0x12f)})),_0x4cf0dc={'queryId':_0x3a3f1c(0x1d1),'columns':_0x3a8628,'data':_0x3d5234,'stats':{'state':_0x3a3f1c(0x1d8),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x3d5234[_0x3a3f1c(0x155)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x53bfc2=formatAsTable(_0x4cf0dc,_0x3d5234[_0x3a3f1c(0x155)],!![]);await writeOutput(_0x53bfc2,undefined,_0x3a3f1c(0xc1));}}function a22_0xca5d(){const _0x4d37a2=['allValid','Preview:','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','isDirectory','5sqVNfU','segment:parent:list','10CeBRAU','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','\x20field','\x20\x20Tables:\x201\x20customers\x20+\x20','/app/workflows/','displayColumns','\x20rows)','collectSchema','segment:parent:preview','No\x20parent\x20segments\x20found','Validating\x20configuration...','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','sampleData','tdx\x20segment\x20parent\x20preview\x20','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','segment:parent:pull','test','pushParentYaml','\x20behaviors','\x0aError:','Errors:','columns','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','\x20=\x20','-1d','Fetching\x20sample\x20data...','text','customerGroupFile','/\x20directories\x20exist.','apply','\x20parent\x20segment','Show\x20parent\x20segment\x20details','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','\x22\x20}','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','\x20\x20\x20\x20-\x20','/sessions/','processedRows','displayPreviewResults','attributes','.yaml','replace','matchedCount','Output\x20file:\x20','\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','runParent','site','Listing\x20parent\x20segments...','scheduleOption','Fetching\x20parent\x20segment\x20\x27','\x0aNo\x20sample\x20data\x20available','data','displayPreviewHints','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','Parent\x20segment:\x20','dim','/app/dw/parentSegments/','push','segment:parent:fields','using\x20the\x20default\x20path:\x20','Session:','\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20','customerGroup','Fetching\x20behavior\x20list...','segment:parent:desc','segment:parent:validate','interval','audienceId','\x27\x20with\x20ID:\x20','\x27\x20is\x20up\x20to\x20date','/\x20→\x20','\x0aChanges\x20to\x20apply\x20to\x20\x27','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','Fetching\x20current\x20configuration\x20for\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','label','✔\x20Created\x20parent\x20segment\x20\x27','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','\x20parent\x20segment\x20\x27','Created','win32','\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)','Error:\x20--attribute\x20requires\x20a\x20name\x0a','unref','parent_segments','\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','✔\x20Query\x20completed:\x20Processed\x20','Enriched:','Show\x20parent\x20segment\x20schema\x20(column\x20types)','\x0aUsage:\x20tdx\x20ps\x20preview\x20','use','start','Name:\x20','enriched','\x0a\x20\x20\x20\x20}','getBehaviorNames','bold','28967521jXOmtD','number','✔\x20Found\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','customersWithEvents','workflowAttemptId','Schema\x20saved\x20to\x20','attribute','elapsedTimeMillis','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','behaviors','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','\x0a⚠️\x20\x20Migrating:\x20','✘\x20Failed\x20to\x20rename\x20directory:\x20','preview','green','addBehaviorsFile','\x0a✔\x20Workflow\x20started','getParentSQL','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','foreignKey','FINISHED','Behaviors','676047YmavRQ','segment:parent:sql','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22','addBehaviors','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','Updating\x20parent\x20segment\x20\x27','Status:','displaySampleData','population','\x20--attribute\x20\x22<name>\x22','Attributes','repeat','To\x20view\x20sample\x20data:','schemaValid','SELECT\x20*\x20FROM\x20','sort','query','getOutputDatabaseName','\x20--behavior\x20\x22','segment','Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20all\x20tables\x20(requires\x20context)\x0a','Error:\x20File\x20not\x20found:\x20','Listing\x20fields\x20for\x20\x27','\x20[Job\x20ID:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Error\x20reading\x20file:\x20','coveragePercent','run','endsWith','Analyzing\x20changes...','\x27\x20and\x20run\x20workflow?','YAML\x20file:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','schemaError','displaySummary','Resolving\x20parent\x20segment\x20\x27','\x20--attribute\x20\x22','Master\x20Table','Apply\x20changes\x20to\x20\x27','cyan','11833371oDbWOj','5306118ZajFzD','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','displayAttributesStats','List\x20parent\x20segments','\x0a⚠️\x20\x20Both\x20','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','\x20Opening\x20','Updating','Error:\x20Parent\x20segment\x20name\x20is\x20required','in\x20','formatSchemaJson','getParentFull','jsonl','Site:\x20','Error:\x20--behavior\x20requires\x20a\x20name\x0a','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','limit','Customers:','name','✔\x20No\x20changes\x20-\x20\x27','database','red','updateParent','\x20\x20Columns:\x20','82yzlYHS','Join:','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','Updated','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','table','information_schema','log','segment:parent:view','join','localeCompare','Error:','/{name}.yml\x0a','type','Options:\x0a','Error\x20parsing\x20YAML:\x20','parentSegment','workflowSessionId','✔\x20Renamed\x20directory\x20to\x20','output','/\x20and\x20','master','Attempt:','keys','\x20Configuration\x20is\x20valid','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','segment:parent:update','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','double','createParent','✔\x20Updated\x20parent\x20segment\x20\x27','timezone','customerPercent','addAttributesFile','ignore','yellow','8PzmEzQ','description','Validate:','Options:','Found\x20YAML\x20file:\x20','20819QLjkUJ','\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a','parent_segment','\x0aNew\x20parent\x20segment\x20\x27','\x20--behavior\x20\x22<name>\x22','Aborted.','Options\x20(one\x20required):\x0a','resolveParentId','verbose','Table:\x20','scheduleType','Executing\x20parent\x20segment\x20query...','joinKey','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','segment:parent:push','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','toLocaleString','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)','attributesFile','Available\x20behaviors:','6179800rMfRkT','customers','displayBehaviorsStats','\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22','filter','\x20Context\x20set:\x20','jobId','5096973xshbCy','column','rowCount','utf-8','Fetching\x20SQL\x20for\x20\x27','map','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','\x5c$&','\x20is\x20already\x20up\x20to\x20date','`\x20to\x20download\x20the\x20configuration\x20first','Error:\x20--database\x20and\x20--table\x20are\x20required','listFields','Attribute:','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','Output\x20Database:','.customers)','👥\x20','behaviorsFile','dirname','parent_id','\x0aChanges\x20to\x20\x27','Database:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','\x20kill','column_type','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','segment:parent:create','column_name','error','{\x0a\x20\x20\x22database\x22:\x20\x22','Source:','string','\x27\x20is\x20already\x20up\x20to\x20date','toFixed','Listing\x20parent\x20segments\x20matching\x20\x27','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','darwin','Columns:','previewParentYaml','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','yes','setJobId','\x20\x20Database:\x20','Fetching\x20customers\x20schema...','varchar','\x20total','all','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','To\x20cancel:','session','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','toLowerCase','validateParentYaml','No\x20parent\x20segments\x20match\x20pattern:\x20','Creating','.yml','\x27...','trim','status','errors','stop','\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22','\x20--enriched','execute','reduce','Rows:','Master:','displayValidateResults','format','displayMasterInfo','message','behavior_','workflowId','stats','Behavior:','\x20\x20No\x20sample\x20data\x20available','json','pullParentYaml','totalEvents','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','List\x20available\x20fields\x20for\x20segmentation','Join\x20on:','length','\x0a\x20\x20]\x0a}\x0a','behavior','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20all\x20tables\x20for\x20parent\x20segment\x0a\x0a'];a22_0xca5d=function(){return _0x4d37a2;};return a22_0xca5d();}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a22_0x14fbc1(0xb6)]='segment:parent:run';[a22_0x14fbc1(0xe1)]=a22_0x14fbc1(0x152);async[a22_0x14fbc1(0x142)](_0xe3fc1b){const _0x9bb9b6=a22_0x14fbc1,{options:_0x3670f2,args:_0x2f2fe9,tdx:_0x14ae0f}=_0xe3fc1b,_0x11162c=_0x3670f2,_0x37e6da=_0x2f2fe9[0x0]||_0x3670f2[_0x9bb9b6(0xcc)];if(!_0x37e6da)return showParentSegmentNotSetError(_0x9bb9b6(0x10e)+_0x9bb9b6(0x1c6)),0x1;const _0x46f3d8=resolveYamlFile(_0x37e6da);if(existsSync(_0x46f3d8)){_0x11162c[_0x9bb9b6(0xed)]&&console[_0x9bb9b6(0x11d)](_0x9bb9b6(0xe4)+_0x46f3d8);let _0x2110e4;try{_0x2110e4=readFileSync(_0x46f3d8,_0x9bb9b6(0x104));}catch(_0x627ebf){const _0x17547f=_0x627ebf instanceof Error?_0x627ebf[_0x9bb9b6(0x149)]:String(_0x627ebf);return console[_0x9bb9b6(0x11d)](_0x9bb9b6(0x94)+_0x17547f),0x1;}const _0x307d59=await withSpinner(_0x9bb9b6(0x98),()=>_0x14ae0f['segment'][_0x9bb9b6(0x171)](_0x2110e4),{'verbose':_0x11162c[_0x9bb9b6(0xed)]}),_0x31fd5b=_0x307d59[_0x9bb9b6(0x194)],{isNew:_0x2b4131,name:_0x2dcf48,hasChanges:_0x2ccbea,diffFormatted:_0x3fbec5}=_0x31fd5b;if(_0x2ccbea){_0x2b4131?console[_0x9bb9b6(0x11d)](_0x9bb9b6(0xe8)+_0x2dcf48+'\x27:'):console[_0x9bb9b6(0x11d)](_0x9bb9b6(0x1a8)+_0x2dcf48+'\x27:');console['error']('─'[_0x9bb9b6(0x86)](0x3c)),console['error'](_0x3fbec5),console[_0x9bb9b6(0x11d)]('─'[_0x9bb9b6(0x86)](0x3c));const _0x21f35e=_0x2b4131?'Create\x20parent\x20segment\x20\x27'+_0x2dcf48+_0x9bb9b6(0x99):_0x9bb9b6(0xa1)+_0x2dcf48+_0x9bb9b6(0x99);if(!_0x11162c[_0x9bb9b6(0x12b)]){if(!isInteractive())return console[_0x9bb9b6(0x11d)](a22_0x36914f['red'](_0x9bb9b6(0x173)),_0x9bb9b6(0xf6)),console[_0x9bb9b6(0x11d)](a22_0x36914f[_0x9bb9b6(0x198)](_0x9bb9b6(0x93))),0x1;const _0x51a63b=await confirmKey(_0x21f35e);if(!_0x51a63b)return console['error'](a22_0x36914f['yellow'](_0x9bb9b6(0xea))),0x1;}const _0x382a71=_0x2b4131?_0x9bb9b6(0x139):_0x9bb9b6(0xab);await withSpinner(_0x382a71+_0x9bb9b6(0x1af)+_0x2dcf48+'\x27...',()=>_0x31fd5b[_0x9bb9b6(0x17d)](),{'verbose':_0x11162c[_0x9bb9b6(0xed)]});const _0x1f3da5=_0x2b4131?_0x9bb9b6(0x1b0):_0x9bb9b6(0xbf);console[_0x9bb9b6(0x11d)]('✔\x20'+_0x1f3da5+_0x9bb9b6(0x1af)+_0x2dcf48+'\x27');}else console[_0x9bb9b6(0x11d)](_0x9bb9b6(0xb7)+_0x2dcf48+_0x9bb9b6(0x1a6));}const _0x11edff=await withSpinner(_0x9bb9b6(0x132)+_0x37e6da+_0x9bb9b6(0x13b),()=>_0x14ae0f[_0x9bb9b6(0x8e)][_0x9bb9b6(0x18e)](_0x37e6da),{'verbose':_0x11162c['verbose']}),_0x50e3a4=_0x11edff['data'],_0x42e4d3=getConsoleUrl(_0x11162c[_0x9bb9b6(0x18f)],_0x9bb9b6(0x164)+_0x50e3a4[_0x9bb9b6(0x14b)]+_0x9bb9b6(0x184)+_0x50e3a4[_0x9bb9b6(0xcd)]+'/attempt/'+_0x50e3a4['workflowAttemptId']);return console[_0x9bb9b6(0x11d)](_0x9bb9b6(0x1d4)),console[_0x9bb9b6(0x11d)]('\x20\x20'+a22_0x36914f[_0x9bb9b6(0x198)]('Audience\x20ID:')+'\x20'+_0x50e3a4[_0x9bb9b6(0x1a4)]),console[_0x9bb9b6(0x11d)]('\x20\x20'+a22_0x36914f[_0x9bb9b6(0x198)](_0x9bb9b6(0x1e1))+'\x20'+_0x50e3a4[_0x9bb9b6(0x13d)]),console[_0x9bb9b6(0x11d)]('\x20\x20'+a22_0x36914f[_0x9bb9b6(0x198)](_0x9bb9b6(0x19d))+'\x20'+_0x50e3a4[_0x9bb9b6(0xcd)]),console['error']('\x20\x20'+a22_0x36914f[_0x9bb9b6(0x198)](_0x9bb9b6(0xd2))+'\x20'+_0x50e3a4[_0x9bb9b6(0x1c8)]),console[_0x9bb9b6(0x11d)]('\x20\x20'+_0x42e4d3),console[_0x9bb9b6(0x11d)]('\x0a'+a22_0x36914f[_0x9bb9b6(0x198)](_0x9bb9b6(0x133))+'\x20tdx\x20wf\x20attempt\x20'+_0x50e3a4[_0x9bb9b6(0x1c8)]+_0x9bb9b6(0x118)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a22_0x14fbc1(0xb6)]=a22_0x14fbc1(0x19b);[a22_0x14fbc1(0xe1)]=a22_0x14fbc1(0x153);async[a22_0x14fbc1(0x142)](_0x13d8fc){const _0x1a05f5=a22_0x14fbc1,{options:_0x14bc1e,args:_0x414510,tdx:_0xc08519}=_0x13d8fc,_0x42de89=_0x414510[0x0]||_0x14bc1e[_0x1a05f5(0xcc)];if(!_0x42de89)return showParentSegmentNotSetError(_0x1a05f5(0x1cc)+_0x1a05f5(0x135)),0x1;_0x14bc1e[_0x1a05f5(0xed)]&&(console[_0x1a05f5(0x11d)]('Site:\x20'+_0x14bc1e[_0x1a05f5(0x18f)]),console[_0x1a05f5(0x11d)](_0x1a05f5(0x197)+_0x42de89));const _0x1315ef=await withSpinner(_0x1a05f5(0x91)+_0x42de89+_0x1a05f5(0x13b),()=>_0xc08519[_0x1a05f5(0x8e)][_0x1a05f5(0x10c)](_0x42de89),{'verbose':_0x14bc1e[_0x1a05f5(0xed)]}),_0x845970=_0x1315ef[_0x1a05f5(0x194)];console[_0x1a05f5(0x11d)]('✔\x20Found\x20'+_0x845970[_0x1a05f5(0x155)]+_0x1a05f5(0x162)+(_0x845970[_0x1a05f5(0x155)]!==0x1?'s':''));if(_0x14bc1e['json']||_0x14bc1e[_0x1a05f5(0xb0)])return await handleSDKOutput(_0x845970,_0x14bc1e),0x0;return displayFieldsHumanReadable(_0x845970,_0x42de89),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{['name']=a22_0x14fbc1(0xc4);[a22_0x14fbc1(0xe1)]=a22_0x14fbc1(0x17f);async[a22_0x14fbc1(0x142)](_0x10a431){const _0x544678=a22_0x14fbc1,{options:_0x585313,args:_0x13c28a,tdx:_0x30bf29}=_0x10a431,_0x55666e=_0x585313,_0x15d44c=_0x13c28a[0x0]||_0x585313[_0x544678(0xcc)];if(!_0x15d44c)return showParentSegmentNotSetError(_0x544678(0x196)+_0x544678(0x117)+_0x544678(0xca)+_0x544678(0x12a)),0x1;_0x585313['verbose']&&(console[_0x544678(0x11d)](_0x544678(0xb1)+_0x585313[_0x544678(0x18f)]),console[_0x544678(0x11d)](_0x544678(0x197)+_0x15d44c));const _0x44f295=await withSpinner(_0x544678(0x192)+_0x15d44c+_0x544678(0x13b),()=>_0x30bf29['segment'][_0x544678(0xaf)](_0x15d44c),{'verbose':_0x585313[_0x544678(0xed)]}),_0x5866ce=_0x44f295['data'];if(_0x55666e['web']){const _0x47737f=getConsoleNextUrl(_0x55666e[_0x544678(0x18f)],_0x544678(0x199)+_0x5866ce['id']);return console[_0x544678(0x11d)](a22_0x36914f[_0x544678(0x1d2)]('✔')+_0x544678(0xaa)+a22_0x36914f[_0x544678(0xa2)](_0x47737f)),openBrowser(_0x47737f),0x0;}return await handleSingleObjectOutput(_0x5866ce,_0x585313),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a22_0x14fbc1(0xb6)]=a22_0x14fbc1(0x1a1);[a22_0x14fbc1(0xe1)]=a22_0x14fbc1(0x1ba);async[a22_0x14fbc1(0x142)](_0x359355){const _0x4dab03=a22_0x14fbc1,{options:_0x9530ee,args:_0x3b860,tdx:_0x159bca}=_0x359355,_0x87a66a=_0x9530ee,_0x2ee8b1=_0x3b860[0x0]||_0x9530ee[_0x4dab03(0xcc)];if(!_0x2ee8b1)return showParentSegmentNotSetError(_0x4dab03(0x8f)+_0x4dab03(0x158)+_0x4dab03(0xca)+'\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path'),0x1;_0x9530ee[_0x4dab03(0xed)]&&(console[_0x4dab03(0x11d)](_0x4dab03(0xb1)+_0x9530ee[_0x4dab03(0x18f)]),console[_0x4dab03(0x11d)](_0x4dab03(0x197)+_0x2ee8b1));const _0x2ad716=await withSpinner(_0x4dab03(0x9e)+_0x2ee8b1+_0x4dab03(0x13b),()=>_0x159bca[_0x4dab03(0x8e)][_0x4dab03(0xec)](_0x2ee8b1),{'verbose':_0x9530ee[_0x4dab03(0xed)]}),_0x53e1ab=_0x2ad716[_0x4dab03(0x194)],_0x52a96c=_0x159bca['segment'][_0x4dab03(0x8c)](_0x53e1ab);if(_0x87a66a[_0x4dab03(0xcf)]){const _0x20639b=await this[_0x4dab03(0x167)](_0x359355,_0x2ee8b1,_0x53e1ab,_0x52a96c),_0x4d0b6c=this[_0x4dab03(0xae)](_0x20639b);writeFileSync(_0x87a66a['output'],_0x4d0b6c);const _0x162e5c=_0x20639b[_0x4dab03(0xfb)][_0x4dab03(0x175)][_0x4dab03(0x155)]+_0x20639b[_0x4dab03(0x1cd)][_0x4dab03(0x143)]((_0x6666ab,_0x2d7bda)=>_0x6666ab+_0x2d7bda['columns'][_0x4dab03(0x155)],0x0),_0xf01a0e=_0x20639b[_0x4dab03(0x1cd)][_0x4dab03(0xfe)](_0x46b0fb=>_0x46b0fb['columns']['length']===0x0)[_0x4dab03(0x155)];return console[_0x4dab03(0xc3)](_0x4dab03(0x1c9)+_0x87a66a['output']),console[_0x4dab03(0xc3)](_0x4dab03(0x12d)+_0x52a96c),console[_0x4dab03(0xc3)](_0x4dab03(0x163)+_0x20639b[_0x4dab03(0x1cd)][_0x4dab03(0x155)]+_0x4dab03(0x172)),console[_0x4dab03(0xc3)](_0x4dab03(0xbb)+_0x162e5c+_0x4dab03(0x130)),_0xf01a0e>0x0&&console[_0x4dab03(0xc3)]('\x20\x20Note:\x20'+_0xf01a0e+_0x4dab03(0x1b2)),0x0;}console['error']('\x0a'+a22_0x36914f[_0x4dab03(0x1c2)](_0x4dab03(0x10f))+'\x20'+a22_0x36914f[_0x4dab03(0xa2)](_0x52a96c));const _0x1468bc=await withSpinner(_0x4dab03(0x12e),()=>_0x159bca[_0x4dab03(0x8e)][_0x4dab03(0x1d5)](_0x53e1ab),{'verbose':_0x9530ee[_0x4dab03(0xed)]});console['error']('\x0a'+a22_0x36914f[_0x4dab03(0x1c2)](_0x4dab03(0xfb))+'\x20'+a22_0x36914f['dim']('('+_0x52a96c+_0x4dab03(0x110)));const _0x287d1d=await executeSchemaQuery(_0x1468bc['data'],_0x159bca,_0x9530ee);await handleQueryOutput(_0x287d1d,_0x9530ee);const _0x1222d9=await withSpinner('Fetching\x20behavior\x20list...',()=>_0x159bca[_0x4dab03(0x8e)]['getBehaviorNames'](_0x53e1ab),{'verbose':_0x9530ee['verbose']});for(const _0x25d1d0 of _0x1222d9[_0x4dab03(0x194)]){const _0x50c5a9='behavior_'+_0x25d1d0[_0x4dab03(0x136)]()[_0x4dab03(0x189)](/\s+/g,'_'),_0x180f11=_0x4dab03(0x89)+_0x52a96c+'.'+_0x50c5a9;console[_0x4dab03(0x11d)]('\x0a'+a22_0x36914f[_0x4dab03(0x1c2)](_0x25d1d0)+'\x20'+a22_0x36914f[_0x4dab03(0x198)]('('+_0x52a96c+'.'+_0x50c5a9+')'));try{const _0x4ce595=await executeSchemaQuery(_0x180f11,_0x159bca,_0x9530ee);await handleQueryOutput(_0x4ce595,_0x9530ee);}catch{console[_0x4dab03(0x11d)](a22_0x36914f[_0x4dab03(0xdf)](_0x4dab03(0xf7)));}}return 0x0;}async[a22_0x14fbc1(0x167)](_0x2fa086,_0x3d1fd3,_0x4caaf6,_0x46062d){const _0x2e3243=a22_0x14fbc1,{options:_0x2038f7,tdx:_0xb253e7}=_0x2fa086,_0x5564bc=await withSpinner(_0x2e3243(0x12e),()=>_0xb253e7[_0x2e3243(0x8e)][_0x2e3243(0x1d5)](_0x4caaf6),{'verbose':_0x2038f7['verbose']}),_0x3b5806=await executeSchemaQuery(_0x5564bc[_0x2e3243(0x194)],_0xb253e7,_0x2038f7),_0x417a0c=_0x3b5806[_0x2e3243(0x194)][_0x2e3243(0x106)](_0x46e9ea=>({'name':_0x46e9ea[_0x2e3243(0x11c)],'type':_0x46e9ea[_0x2e3243(0x119)]})),_0x3b5bc8=await withSpinner(_0x2e3243(0x1a0),()=>_0xb253e7[_0x2e3243(0x8e)][_0x2e3243(0x1c1)](_0x4caaf6),{'verbose':_0x2038f7[_0x2e3243(0xed)]}),_0x57e32b=[];for(const _0x576792 of _0x3b5bc8[_0x2e3243(0x194)]){const _0x2a7d73=_0x2e3243(0x14a)+_0x576792[_0x2e3243(0x136)]()[_0x2e3243(0x189)](/\s+/g,'_'),_0x4f9df3='SELECT\x20*\x20FROM\x20'+_0x46062d+'.'+_0x2a7d73;let _0x1c8117=[];try{const _0x1be2d5=await executeSchemaQuery(_0x4f9df3,_0xb253e7,_0x2038f7);_0x1c8117=_0x1be2d5[_0x2e3243(0x194)]['map'](_0x8c28ea=>({'name':_0x8c28ea['column_name'],'type':_0x8c28ea[_0x2e3243(0x119)]}));}catch{}_0x57e32b[_0x2e3243(0x19a)]({'table':_0x2a7d73,'columns':_0x1c8117});}return{'database':_0x46062d,'parent_segment':_0x3d1fd3,'parent_id':_0x4caaf6,'customers':{'table':_0x2e3243(0xfb),'columns':_0x417a0c},'behaviors':_0x57e32b};}['formatSchemaJson'](_0x2baaf0){const _0x396db7=a22_0x14fbc1,_0x1fb82b=_0x486496=>{const _0x44229b=a22_0x4d49;if(_0x486496[_0x44229b(0x155)]===0x0)return'[]';const _0x3f5b0b=_0x486496[_0x44229b(0x106)](_0x38d3db=>_0x44229b(0x140)+_0x38d3db[_0x44229b(0xb6)]+'\x22,\x20\x22type\x22:\x20\x22'+_0x38d3db[_0x44229b(0xc9)]+_0x44229b(0x181));return'[\x0a'+_0x3f5b0b['join'](',\x0a')+'\x0a\x20\x20\x20\x20]';},_0x1de53a=_0x2baaf0[_0x396db7(0x1cd)][_0x396db7(0x106)](_0x411ecc=>{const _0x142f4d=_0x396db7;return _0x142f4d(0x1dd)+_0x411ecc[_0x142f4d(0xc1)]+_0x142f4d(0x18c)+_0x1fb82b(_0x411ecc['columns'])[_0x142f4d(0x189)](/^/gm,'\x20\x20')[_0x142f4d(0x13c)]()+_0x142f4d(0x1c0);})[_0x396db7(0xc5)](',\x0a');return _0x396db7(0x11e)+_0x2baaf0['database']+_0x396db7(0x1b6)+_0x2baaf0[_0x396db7(0xe7)]+'\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22'+_0x2baaf0[_0x396db7(0x114)]+_0x396db7(0xfd)+_0x2baaf0[_0x396db7(0xfb)][_0x396db7(0xc1)]+_0x396db7(0x19e)+_0x1fb82b(_0x2baaf0[_0x396db7(0xfb)][_0x396db7(0x175)])[_0x396db7(0x189)](/^/gm,'\x20\x20')[_0x396db7(0x13c)]()+_0x396db7(0xe6)+_0x1de53a+_0x396db7(0x156);}}export class ParentSegmentSQLCommand extends BaseCommand{[a22_0x14fbc1(0xb6)]=a22_0x14fbc1(0x1db);['description']='Get\x20SQL\x20query\x20for\x20parent\x20segment';async['execute'](_0x2f43ff){const _0x42494b=a22_0x14fbc1,{options:_0x37aac6,args:_0x384c2c,tdx:_0x428791}=_0x2f43ff,_0x2e2fee=_0x384c2c[0x0]||_0x37aac6[_0x42494b(0xcc)];if(!_0x2e2fee)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'+_0x42494b(0x1ce)),0x1;_0x37aac6[_0x42494b(0xed)]&&(console['error'](_0x42494b(0xb1)+_0x37aac6[_0x42494b(0x18f)]),console['error']('Parent\x20segment:\x20'+_0x2e2fee));const _0x50ead3=await withSpinner(_0x42494b(0x9e)+_0x2e2fee+'\x27...',()=>_0x428791[_0x42494b(0x8e)][_0x42494b(0xec)](_0x2e2fee),{'verbose':_0x37aac6[_0x42494b(0xed)]}),_0x2f2a6c=_0x50ead3[_0x42494b(0x194)],_0xce9c23=await withSpinner(_0x42494b(0x105)+_0x2e2fee+'\x27...',()=>_0x428791[_0x42494b(0x8e)]['getParentSQL'](_0x2f2a6c),{'verbose':_0x37aac6['verbose']}),_0x86c849=_0xce9c23[_0x42494b(0x194)];return _0x37aac6[_0x42494b(0x147)]===_0x42494b(0x14f)||_0x37aac6[_0x42494b(0x147)]==='jsonl'?await handleSDKOutput([{'sql':_0x86c849}],_0x37aac6):console[_0x42494b(0xc3)](_0x86c849),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a22_0x14fbc1(0xb6)]='segment:parent:show';['description']='Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results';async[a22_0x14fbc1(0x142)](_0x3fa83e){const _0x4de150=a22_0x14fbc1,{options:_0x584f32,args:_0x33301a,tdx:_0x45f7a9}=_0x3fa83e,_0x5e5547=_0x33301a[0x0]||_0x584f32[_0x4de150(0xcc)];if(!_0x5e5547)return showParentSegmentNotSetError(_0x4de150(0xc0)+_0x4de150(0xf4)),0x1;_0x584f32[_0x4de150(0xed)]&&(console[_0x4de150(0x11d)](_0x4de150(0xb1)+_0x584f32['site']),console[_0x4de150(0x11d)]('Parent\x20segment:\x20'+_0x5e5547));const _0x4d25ab=await withSpinner(_0x4de150(0x9e)+_0x5e5547+_0x4de150(0x13b),()=>_0x45f7a9['segment'][_0x4de150(0xec)](_0x5e5547),{'verbose':_0x584f32['verbose']}),_0x5a5336=_0x4d25ab[_0x4de150(0x194)],_0x5c081b=await withSpinner(_0x4de150(0x105)+_0x5e5547+_0x4de150(0x13b),()=>_0x45f7a9[_0x4de150(0x8e)]['getParentSQL'](_0x5a5336),{'verbose':_0x584f32['verbose']});let _0x27d9b3=_0x5c081b['data'];const _0x352d93=resolveLimit(_0x584f32[_0x4de150(0xb4)],DEFAULT_DISPLAY_LIMIT),_0x1c5fb1=/\bLIMIT\s+\d+/i[_0x4de150(0x170)](_0x27d9b3);!_0x1c5fb1&&(_0x27d9b3=_0x27d9b3[_0x4de150(0x13c)]()['replace'](/;+$/,''),_0x27d9b3='SELECT\x20*\x20FROM\x20(\x0a'+_0x27d9b3+_0x4de150(0x18d)+_0x352d93);_0x584f32[_0x4de150(0xed)]&&console[_0x4de150(0x11d)]('SQL\x20query:\x0a'+_0x27d9b3);const _0x49b7f0=await withProgressSpinner(_0x4de150(0xf0),async _0x2d9f01=>{const _0x10dd38=_0x4de150,_0x56b1ad=await _0x45f7a9[_0x10dd38(0x8b)][_0x10dd38(0x142)](_0x27d9b3,{'catalog':'td','schema':_0x10dd38(0xc2),'onJobId':_0x170378=>{const _0x546012=_0x10dd38;_0x2d9f01[_0x546012(0x12c)](_0x170378);}});return _0x56b1ad;},{'verbose':_0x584f32[_0x4de150(0xed)]}),_0x18f96a=_0x49b7f0[_0x4de150(0x194)],_0x39bead=_0x18f96a[_0x4de150(0x100)]?_0x4de150(0x92)+_0x18f96a[_0x4de150(0x100)]+']':'';return console['error'](_0x4de150(0x1b8)+_0x18f96a[_0x4de150(0x14c)][_0x4de150(0x185)][_0x4de150(0xf5)]()+'\x20rows\x20'+(_0x4de150(0xad)+formatElapsed(_0x18f96a[_0x4de150(0x14c)][_0x4de150(0x1cb)])+_0x39bead)),await handleQueryOutput(_0x18f96a,_0x584f32),0x0;}}
@@ -1 +1 @@
1
- const a23_0x27a184=a23_0xddcf;(function(_0x487c88,_0x2d4073){const _0x39a084=a23_0xddcf,_0x4c103e=_0x487c88();while(!![]){try{const _0xb83966=-parseInt(_0x39a084(0x184))/0x1*(parseInt(_0x39a084(0x1c3))/0x2)+parseInt(_0x39a084(0x1ba))/0x3+-parseInt(_0x39a084(0x1cd))/0x4*(parseInt(_0x39a084(0x1b1))/0x5)+parseInt(_0x39a084(0x1c6))/0x6*(-parseInt(_0x39a084(0x1c5))/0x7)+parseInt(_0x39a084(0x18e))/0x8*(parseInt(_0x39a084(0x1c8))/0x9)+-parseInt(_0x39a084(0x1a1))/0xa*(-parseInt(_0x39a084(0x18f))/0xb)+-parseInt(_0x39a084(0x1bf))/0xc;if(_0xb83966===_0x2d4073)break;else _0x4c103e['push'](_0x4c103e['shift']());}catch(_0x116537){_0x4c103e['push'](_0x4c103e['shift']());}}}(a23_0x2e13,0x4bb85));import{BaseCommand,printAuthError}from'./command.js';import{listProfiles,profileExists,saveProfileToUserConfig,removeProfileFromUserConfig,loadProfile,getActiveProfile,saveActiveProfileToUserConfig}from'../core/profile.js';function a23_0x2e13(){const _0x344d8d=['trim','parent_segment','tdx.json','Site\x20name\x20cannot\x20be\x20empty','\x0aSaved\x20to:\x20','join','Set\x20a\x20profile\x20configuration\x20value','VALID_KEYS','Failed\x20to\x20remove\x20profile:\x20','profile:remove','Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20remove\x20<name>','site','includes','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','\x0aSetup\x20cancelled','yellow','\x20API\x20key\x20removed\x20from\x20system\x20keychain','✗\x20Validation\x20failed:\x20','\x0aSetting\x20up\x20authentication\x20for\x20site:\x20','length','profile:create','execute','Enter\x20site\x20name:','Profile\x20\x27','text','other','profile:use','Removal\x20cancelled','create','\x20\x20tdx\x20--profile\x20','\x20\x20(no\x20profiles\x20found)','getUserInfo','Changing\x20site\x20to\x20\x27','\x27\x20requires\x20API\x20key\x20validation.','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','apiKey','customSite','\x20API\x20key\x20saved\x20to\x20system\x20keychain\x20(profile:\x20','\x0aAvailable\x20profiles:','Remove\x20a\x20profile','184787goArVm','log','Profile\x20was\x20not\x20created.\x20Please\x20try\x20again.','Select\x20Treasure\x20Data\x20site\x20for\x20profile\x20\x27','ERROR','name','session','\x27\x20does\x20not\x20exist.','\x20Profile\x20\x27','logLevel','8OeJUZy','8525KdGWJm','llm_agent','dim','\x27\x20created','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','status','\x27\x20already\x20exists.\x20Use\x20\x27tdx\x20profile\x20set\x27\x20to\x20modify\x20it.','warn','test','\x0aOperation\x20cancelled','profileName','validate','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','jobs','Unknown\x20key\x20\x27','\x27.\x0a\x0aValid\x20keys:\x20','select','Are\x20you\x20sure\x20you\x20want\x20to\x20remove\x20profile\x20\x27','5760tIQeMJ','confirm','\x27\x20updated:\x20','Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20use\x20<name>\x20[--default]','Invalid\x20format.\x20Use:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20','Enter\x20your\x20TD\x20API\x20key\x20for\x20the\x20new\x20site:','\x20\x20-\x20','config','Profile\x20name\x20must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20and\x20underscore','description','error','profile','password','Session\x20profile\x20set\x20to:\x20','Enter\x20your\x20TD\x20API\x20key:','green','486030HeuoSF','(session:\x20','/app/mp/ak','llm_project','Validating\x20API\x20key...','message','\x20API\x20key\x20is\x20valid\x20(User:\x20','\x20--default\x27\x20to\x20save\x20permanently','red','1379187mZHmuB','default','\x0aYou\x20can\x20find\x20your\x20API\x20key\x20at:','Enter\x20description\x20(optional):','\x27\x20does\x20not\x20exist.\x20Create\x20it?','654228vVsHFA','database','Enter\x20profile\x20name:','(cleared)','2NztNcw','\x20API\x20key\x20saved\x20to\x20system\x20keychain','289163ebsqgz','42eNupvT','us01','3766671rVxCaU','API\x20key\x20cannot\x20be\x20empty','email','tdx:\x20profile\x20set','bold','20OqEbib','tdx:\x20profile\x20remove'];a23_0x2e13=function(){return _0x344d8d;};return a23_0x2e13();}import{getConfigDir}from'../core/config.js';import*as a23_0x5acfc9 from'node:path';import{saveSessionContext,getSessionID,cleanExpiredSessions}from'../core/session.js';import{saveAPIKeyAsync,resolveSite}from'../core/config.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{buildSiteChoices}from'../core/constants.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a23_0x10eb67 from'prompts';import a23_0x569122 from'chalk';function validateProfileName(_0x38c05a){const _0xe26718=a23_0xddcf;if(!_0x38c05a||!_0x38c05a[_0xe26718(0x1cf)]())return'Profile\x20name\x20cannot\x20be\x20empty';const _0x37d253=_0x38c05a[_0xe26718(0x1cf)]();if(!/^[a-zA-Z0-9_-]+$/['test'](_0x37d253))return _0xe26718(0x1a9);if(profileExists(_0x37d253))return _0xe26718(0x173)+_0x37d253+_0xe26718(0x195);return!![];}export class ProfileCreateCommand extends BaseCommand{[a23_0x27a184(0x189)]=a23_0x27a184(0x170);[a23_0x27a184(0x1aa)]='Create\x20a\x20new\x20profile';async[a23_0x27a184(0x171)](_0x27aa65){const _0x4d8008=a23_0x27a184,{options:_0x3d177e,args:_0x28fd24}=_0x27aa65;console['log'](a23_0x569122['bold']('tdx:\x20profile\x20create'));let _0x269e7b;if(_0x28fd24[_0x4d8008(0x16f)]>0x0&&_0x28fd24[0x0]){const _0x2eac8f=_0x28fd24[0x0][_0x4d8008(0x1cf)](),_0x20fb57=validateProfileName(_0x2eac8f);if(_0x20fb57!==!![])return console[_0x4d8008(0x1ab)](a23_0x569122[_0x4d8008(0x1b9)](_0x20fb57)),0x1;_0x269e7b=_0x2eac8f;}else{const _0x2b225a=await a23_0x10eb67({'type':_0x4d8008(0x174),'name':'profileName','message':_0x4d8008(0x1c1),'validate':validateProfileName});if(!_0x2b225a[_0x4d8008(0x199)])return console[_0x4d8008(0x185)](_0x4d8008(0x1dd)),0x1;_0x269e7b=_0x2b225a['profileName'][_0x4d8008(0x1cf)]();}const _0x38389c=await a23_0x10eb67({'type':'text','name':_0x4d8008(0x1aa),'message':_0x4d8008(0x1bd)}),_0x20a1ba=_0x38389c['description']?.[_0x4d8008(0x1cf)]()||undefined,_0x421437=_0x3d177e['site']||_0x4d8008(0x1c7),{choices:_0xa4f808,initialIndex:_0x5d2448}=buildSiteChoices(_0x421437),_0xea7b7=await a23_0x10eb67({'type':_0x4d8008(0x19f),'name':'site','message':_0x4d8008(0x187)+_0x269e7b+'\x27:','choices':_0xa4f808,'initial':_0x5d2448});if(!_0xea7b7[_0x4d8008(0x1da)])return console[_0x4d8008(0x185)](_0x4d8008(0x1dd)),0x1;let _0x681a8f;if(_0xea7b7[_0x4d8008(0x1da)]===_0x4d8008(0x175)){const _0x33ca0e=await a23_0x10eb67({'type':_0x4d8008(0x174),'name':'customSite','message':_0x4d8008(0x172),'initial':_0x4d8008(0x1c7),'validate':_0x4fd715=>{const _0x30c0d2=_0x4d8008;if(!_0x4fd715||!_0x4fd715[_0x30c0d2(0x1cf)]())return _0x30c0d2(0x1d2);if(!/^[a-z0-9-]+$/[_0x30c0d2(0x197)](_0x4fd715[_0x30c0d2(0x1cf)]()))return'Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens';return!![];}});if(!_0x33ca0e[_0x4d8008(0x180)])return console[_0x4d8008(0x185)]('\x0aSetup\x20cancelled'),0x1;_0x681a8f=_0x33ca0e[_0x4d8008(0x180)];}else _0x681a8f=_0xea7b7[_0x4d8008(0x1da)];const _0xb9b79f=resolveSite(_0x681a8f);console[_0x4d8008(0x185)](_0x4d8008(0x16e)+_0xb9b79f),console[_0x4d8008(0x185)]('You\x20can\x20find\x20your\x20API\x20key\x20at:'),console[_0x4d8008(0x185)]('\x20\x20'+getConsoleUrl(_0xb9b79f,'/app/mp/ak'));const _0x518cd5=await a23_0x10eb67({'type':_0x4d8008(0x1ad),'name':'apiKey','message':_0x4d8008(0x1af),'validate':_0x299727=>{const _0x771bf4=_0x4d8008;if(!_0x299727||!_0x299727[_0x771bf4(0x1cf)]())return _0x771bf4(0x1c9);return!![];}});if(!_0x518cd5[_0x4d8008(0x17f)])return console[_0x4d8008(0x185)](_0x4d8008(0x1dd)),0x1;const _0x1f5fcf=_0x518cd5[_0x4d8008(0x17f)];console[_0x4d8008(0x185)](_0x4d8008(0x1b5));try{const _0x46eb20=TDX[_0x4d8008(0x178)]({'site':_0xb9b79f,'apiKey':_0x1f5fcf[_0x4d8008(0x1cf)](),'logLevel':_0x3d177e[_0x4d8008(0x18d)]??LogLevel[_0x4d8008(0x188)]}),_0x2dcae2=await _0x46eb20[_0x4d8008(0x19c)][_0x4d8008(0x17b)]();console[_0x4d8008(0x185)](a23_0x569122[_0x4d8008(0x1b0)]('✓')+'\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0x2dcae2[_0x4d8008(0x1ca)]+')');const _0x13987a=await isKeychainAvailable();_0x13987a?(await saveAPIKeyAsync(_0x1f5fcf[_0x4d8008(0x1cf)](),_0xb9b79f,_0x269e7b),console[_0x4d8008(0x185)](a23_0x569122['green']('✓')+_0x4d8008(0x181)+_0x269e7b+')')):(console[_0x4d8008(0x196)](a23_0x569122[_0x4d8008(0x1de)](_0x4d8008(0x1dc))),console[_0x4d8008(0x196)](a23_0x569122[_0x4d8008(0x1de)](_0x4d8008(0x17e))));const _0x306b1b={'site':_0xb9b79f,..._0x20a1ba&&{'description':_0x20a1ba}};return saveProfileToUserConfig(_0x269e7b,_0x306b1b),console['log'](a23_0x569122[_0x4d8008(0x1b0)]('✓')+_0x4d8008(0x18c)+_0x269e7b+_0x4d8008(0x192)),console['log'](),console[_0x4d8008(0x185)]('You\x20can\x20now\x20use\x20tdx\x20commands\x20with\x20this\x20profile.\x20Try:'),console['log'](_0x4d8008(0x179)+_0x269e7b+_0x4d8008(0x193)),console[_0x4d8008(0x185)](_0x4d8008(0x179)+_0x269e7b+_0x4d8008(0x19b)),0x0;}catch(_0x3e2aca){if(_0x3e2aca instanceof HTTPClientError&&_0x3e2aca[_0x4d8008(0x194)]===0x191)return printAuthError(_0x3e2aca),0x1;return console[_0x4d8008(0x1ab)](a23_0x569122[_0x4d8008(0x1b9)]('✗\x20Validation\x20failed:\x20'+(_0x3e2aca instanceof Error?_0x3e2aca['message']:String(_0x3e2aca)))),console[_0x4d8008(0x1ab)](_0x4d8008(0x186)),0x1;}}}function a23_0xddcf(_0xad894c,_0x3e2233){_0xad894c=_0xad894c-0x16e;const _0x2e1383=a23_0x2e13();let _0xddcf1d=_0x2e1383[_0xad894c];return _0xddcf1d;}export class ProfileRemoveCommand extends BaseCommand{[a23_0x27a184(0x189)]=a23_0x27a184(0x1d8);['description']=a23_0x27a184(0x183);['validate'](_0x31ee81){const _0x20b0af=a23_0x27a184,{args:_0x3699e6}=_0x31ee81;if(_0x3699e6[_0x20b0af(0x16f)]===0x0)return _0x20b0af(0x1d9);return undefined;}async[a23_0x27a184(0x171)](_0x219116){const _0x3f33a0=a23_0x27a184,{args:_0x21a8f3}=_0x219116,_0x28e18a=_0x21a8f3[0x0];console['log'](a23_0x569122[_0x3f33a0(0x1cc)](_0x3f33a0(0x1ce)));if(!profileExists(_0x28e18a)){console[_0x3f33a0(0x1ab)](a23_0x569122[_0x3f33a0(0x1b9)](_0x3f33a0(0x173)+_0x28e18a+_0x3f33a0(0x18b))),console[_0x3f33a0(0x185)](_0x3f33a0(0x182));const _0x285f7e=listProfiles();if(_0x285f7e['length']===0x0)console[_0x3f33a0(0x185)](_0x3f33a0(0x17a));else for(const _0x22e725 of _0x285f7e){console[_0x3f33a0(0x185)](_0x3f33a0(0x1a7)+_0x22e725[_0x3f33a0(0x189)]);}return 0x1;}const _0x445f14=await a23_0x10eb67({'type':'confirm','name':_0x3f33a0(0x1a2),'message':_0x3f33a0(0x1a0)+_0x28e18a+'\x27?','initial':![]});if(!_0x445f14['confirm'])return console[_0x3f33a0(0x185)](_0x3f33a0(0x177)),0x0;try{removeProfileFromUserConfig(_0x28e18a),console['log'](a23_0x569122[_0x3f33a0(0x1b0)]('✓')+_0x3f33a0(0x18c)+_0x28e18a+'\x27\x20removed\x20from\x20configuration');}catch(_0x5dbd22){return console[_0x3f33a0(0x1ab)](a23_0x569122[_0x3f33a0(0x1b9)](_0x3f33a0(0x1d7)+(_0x5dbd22 instanceof Error?_0x5dbd22[_0x3f33a0(0x1b6)]:String(_0x5dbd22)))),0x1;}const _0x1291bf=await isKeychainAvailable();if(_0x1291bf){const _0x5133c5=await deleteKeychainAPIKey(_0x28e18a);_0x5133c5&&console[_0x3f33a0(0x185)](a23_0x569122['green']('✓')+_0x3f33a0(0x1df));}return 0x0;}}export class ProfileSetCommand extends BaseCommand{[a23_0x27a184(0x189)]='profile:set';[a23_0x27a184(0x1aa)]=a23_0x27a184(0x1d5);static ['VALID_KEYS']=['site',a23_0x27a184(0x1c0),a23_0x27a184(0x1d0),a23_0x27a184(0x1b4),a23_0x27a184(0x190),'description'];['validate'](_0x244d0d){const _0x3d96f0=a23_0x27a184,{args:_0xab2a1f,options:_0x344dc5}=_0x244d0d,_0x35e612=_0x344dc5[_0x3d96f0(0x1ac)]||getActiveProfile();if(!_0x35e612)return'No\x20active\x20profile.\x20Use\x20--profile\x20flag\x20or\x20set\x20session\x20profile\x20with:\x20tdx\x20profile\x20use\x20<name>\x0a\x0aUsage:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>';if(_0xab2a1f[_0x3d96f0(0x16f)]===0x0)return'Key=value\x20pair\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20'+ProfileSetCommand['VALID_KEYS']['join'](',\x20');const _0x50f15f=_0xab2a1f[0x0];if(!_0x50f15f['includes']('='))return _0x3d96f0(0x1a5)+ProfileSetCommand[_0x3d96f0(0x1d6)][_0x3d96f0(0x1d4)](',\x20');const [_0x57f895]=_0x50f15f['split']('=',0x2);if(!ProfileSetCommand['VALID_KEYS'][_0x3d96f0(0x1db)](_0x57f895))return _0x3d96f0(0x19d)+_0x57f895+_0x3d96f0(0x19e)+ProfileSetCommand[_0x3d96f0(0x1d6)][_0x3d96f0(0x1d4)](',\x20');return undefined;}async[a23_0x27a184(0x171)](_0x3208ac){const _0x4aba39=a23_0x27a184,{args:_0x406fd3,options:_0x4145d3}=_0x3208ac,_0x1c16fc=_0x4145d3[_0x4aba39(0x1ac)]||getActiveProfile(),[_0x1aa305,..._0x4a28ce]=_0x406fd3[0x0]['split']('='),_0x5a005b=_0x4a28ce[_0x4aba39(0x1d4)]('=');console[_0x4aba39(0x185)](a23_0x569122['bold'](_0x4aba39(0x1cb)));if(!profileExists(_0x1c16fc)){const _0x54ca7e=await a23_0x10eb67({'type':_0x4aba39(0x1a2),'name':_0x4aba39(0x178),'message':'Profile\x20\x27'+_0x1c16fc+_0x4aba39(0x1be),'initial':!![]});if(!_0x54ca7e['create'])return console[_0x4aba39(0x185)]('Operation\x20cancelled'),0x1;}const _0x4871d7=loadProfile(_0x1c16fc),_0x164223=_0x4871d7?.[_0x4aba39(0x1a8)]||{};if(_0x1aa305===_0x4aba39(0x1da)){const _0x916835=resolveSite(_0x5a005b);console[_0x4aba39(0x185)](_0x4aba39(0x17c)+_0x916835+_0x4aba39(0x17d)),console[_0x4aba39(0x185)](_0x4aba39(0x1bc)),console['log']('\x20\x20'+getConsoleUrl(_0x916835,_0x4aba39(0x1b3)));const _0xc9a456=await a23_0x10eb67({'type':_0x4aba39(0x1ad),'name':_0x4aba39(0x17f),'message':_0x4aba39(0x1a6),'validate':_0x5e1655=>{const _0x5c449f=_0x4aba39;if(!_0x5e1655||!_0x5e1655[_0x5c449f(0x1cf)]())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0xc9a456[_0x4aba39(0x17f)])return console[_0x4aba39(0x185)](_0x4aba39(0x198)),0x1;console[_0x4aba39(0x185)]('Validating\x20API\x20key...');try{const _0x1d8d2e=TDX[_0x4aba39(0x178)]({'site':_0x916835,'apiKey':_0xc9a456[_0x4aba39(0x17f)][_0x4aba39(0x1cf)](),'logLevel':_0x4145d3[_0x4aba39(0x18d)]??LogLevel[_0x4aba39(0x188)]}),_0x769d3f=await _0x1d8d2e[_0x4aba39(0x19c)][_0x4aba39(0x17b)]();console[_0x4aba39(0x185)](a23_0x569122[_0x4aba39(0x1b0)]('✓')+_0x4aba39(0x1b7)+_0x769d3f[_0x4aba39(0x1ca)]+')');const _0x1a34fc=await isKeychainAvailable();_0x1a34fc?(await saveAPIKeyAsync(_0xc9a456[_0x4aba39(0x17f)][_0x4aba39(0x1cf)](),_0x916835,_0x1c16fc),console[_0x4aba39(0x185)](a23_0x569122[_0x4aba39(0x1b0)]('✓')+_0x4aba39(0x1c4))):console[_0x4aba39(0x196)](a23_0x569122[_0x4aba39(0x1de)](_0x4aba39(0x1dc))),_0x164223[_0x4aba39(0x1da)]=_0x916835;}catch(_0x3c40da){if(_0x3c40da instanceof HTTPClientError&&_0x3c40da[_0x4aba39(0x194)]===0x191)return printAuthError(_0x3c40da),0x1;return console[_0x4aba39(0x1ab)](a23_0x569122['red'](_0x4aba39(0x1e0)+(_0x3c40da instanceof Error?_0x3c40da[_0x4aba39(0x1b6)]:String(_0x3c40da)))),console[_0x4aba39(0x1ab)]('Site\x20was\x20not\x20changed.'),0x1;}}else _0x164223[_0x1aa305]=_0x5a005b||undefined;return saveProfileToUserConfig(_0x1c16fc,_0x164223),console[_0x4aba39(0x185)](a23_0x569122[_0x4aba39(0x1b0)]('✓')+_0x4aba39(0x18c)+_0x1c16fc+_0x4aba39(0x1a3)+_0x1aa305+'='+(_0x5a005b||_0x4aba39(0x1c2))),0x0;}}export class ProfileUseCommand extends BaseCommand{[a23_0x27a184(0x189)]=a23_0x27a184(0x176);[a23_0x27a184(0x1aa)]='Set\x20session\x20profile';[a23_0x27a184(0x19a)](_0x15383b){const _0x5407d9=a23_0x27a184,{args:_0x59a63a}=_0x15383b;if(_0x59a63a[_0x5407d9(0x16f)]===0x0)return _0x5407d9(0x1a4);return undefined;}async[a23_0x27a184(0x171)](_0xf32ea6){const _0x3c022b=a23_0x27a184,{args:_0x50de27,options:_0x5be72c}=_0xf32ea6,_0x331c94=_0x50de27[0x0],_0x4ac172=_0x5be72c[_0x3c022b(0x1bb)];cleanExpiredSessions();if(!profileExists(_0x331c94)){console[_0x3c022b(0x1ab)](a23_0x569122[_0x3c022b(0x1b9)]('Profile\x20\x27'+_0x331c94+'\x27\x20does\x20not\x20exist.')),console[_0x3c022b(0x185)]('\x0aAvailable\x20profiles:');const _0x1f1005=listProfiles();if(_0x1f1005[_0x3c022b(0x16f)]===0x0)console[_0x3c022b(0x185)](_0x3c022b(0x17a));else for(const _0x3a0ed3 of _0x1f1005){console[_0x3c022b(0x185)](_0x3c022b(0x1a7)+_0x3a0ed3[_0x3c022b(0x189)]);}return 0x1;}if(_0x4ac172){const _0x26ffc6=a23_0x5acfc9[_0x3c022b(0x1d4)](getConfigDir(),_0x3c022b(0x1d1));return saveActiveProfileToUserConfig(_0x331c94),console[_0x3c022b(0x185)]('Default\x20profile\x20set\x20to:\x20'+a23_0x569122['green'](_0x331c94)),console[_0x3c022b(0x185)](a23_0x569122[_0x3c022b(0x191)](_0x3c022b(0x1d3)+_0x26ffc6)),0x0;}const _0x4ecbab=getSessionID(_0x5be72c[_0x3c022b(0x18a)]);return saveSessionContext({'profile':_0x331c94},_0x5be72c[_0x3c022b(0x18a)]),console[_0x3c022b(0x185)](_0x3c022b(0x1ae)+a23_0x569122['green'](_0x331c94)+'\x20'+a23_0x569122[_0x3c022b(0x191)](_0x3c022b(0x1b2)+_0x4ecbab+')')),console[_0x3c022b(0x185)](a23_0x569122['dim']('\x0aTip:\x20Use\x20\x27tdx\x20profile\x20use\x20'+_0x331c94+_0x3c022b(0x1b8))),0x0;}}
1
+ const a23_0x8dce31=a23_0x2943;(function(_0x34e3ec,_0x2d584f){const _0x55439e=a23_0x2943,_0x28c99d=_0x34e3ec();while(!![]){try{const _0x58c82b=parseInt(_0x55439e(0x17f))/0x1*(-parseInt(_0x55439e(0x182))/0x2)+parseInt(_0x55439e(0x19b))/0x3*(parseInt(_0x55439e(0x13e))/0x4)+parseInt(_0x55439e(0x16c))/0x5*(-parseInt(_0x55439e(0x14f))/0x6)+-parseInt(_0x55439e(0x161))/0x7*(-parseInt(_0x55439e(0x17b))/0x8)+parseInt(_0x55439e(0x189))/0x9*(-parseInt(_0x55439e(0x1a4))/0xa)+-parseInt(_0x55439e(0x171))/0xb*(-parseInt(_0x55439e(0x17a))/0xc)+parseInt(_0x55439e(0x197))/0xd;if(_0x58c82b===_0x2d584f)break;else _0x28c99d['push'](_0x28c99d['shift']());}catch(_0x344e47){_0x28c99d['push'](_0x28c99d['shift']());}}}(a23_0x2599,0x1fb98));import{BaseCommand,printAuthError}from'./command.js';import{listProfiles,profileExists,saveProfileToUserConfig,removeProfileFromUserConfig,loadProfile,getActiveProfile,saveActiveProfileToUserConfig}from'../core/profile.js';import{getConfigDir}from'../core/config.js';import*as a23_0x445a7e from'node:path';import{saveSessionContext,getSessionID,cleanExpiredSessions}from'../core/session.js';import{saveAPIKeyAsync,resolveSite}from'../core/config.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{buildSiteChoices}from'../core/constants.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a23_0x2fff0b from'prompts';import a23_0x4c3044 from'chalk';function a23_0x2599(){const _0x1b23f8=['\x20API\x20key\x20saved\x20to\x20system\x20keychain\x20(profile:\x20','Operation\x20cancelled','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','Default\x20profile\x20set\x20to:\x20','other','email','\x27\x20already\x20exists.\x20Use\x20\x27tdx\x20profile\x20set\x27\x20to\x20modify\x20it.','green','Set\x20a\x20profile\x20configuration\x20value','Profile\x20was\x20not\x20created.\x20Please\x20try\x20again.','Enter\x20your\x20TD\x20API\x20key\x20for\x20the\x20new\x20site:','Invalid\x20format.\x20Use:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20','5780CJfFtx','bold','profile:use','site','test','warn','Failed\x20to\x20remove\x20profile:\x20','Changing\x20site\x20to\x20\x27','profile:remove','tdx:\x20profile\x20remove','status','customSite','trim','tdx.json','password','Validating\x20API\x20key...','us01','35274wxXbAi','\x20API\x20key\x20saved\x20to\x20system\x20keychain','Site\x20name\x20cannot\x20be\x20empty','confirm','Enter\x20your\x20TD\x20API\x20key:','\x20Profile\x20\x27','select','dim','profile:create','\x27\x20removed\x20from\x20configuration','jobs','\x27\x20created','yellow','Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20use\x20<name>\x20[--default]','Are\x20you\x20sure\x20you\x20want\x20to\x20remove\x20profile\x20\x27','\x0aSaved\x20to:\x20','includes','Key=value\x20pair\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20','602FssuQt','execute','name','\x20\x20-\x20','\x0aSetup\x20cancelled','llm_agent','validate','\x27\x20does\x20not\x20exist.\x20Create\x20it?','\x0aYou\x20can\x20find\x20your\x20API\x20key\x20at:','\x27\x20updated:\x20','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','5ukJNSg','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','apiKey','red','2191442fHiVdE','\x0aTip:\x20Use\x20\x27tdx\x20profile\x20use\x20','text','Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20remove\x20<name>','Profile\x20\x27','config','/app/mp/ak','split','join','12BkJnTK','16472hZWwjq','Profile\x20name\x20must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20and\x20underscore','getUserInfo','Enter\x20site\x20name:','641IQXqHs','default','\x0aSetting\x20up\x20authentication\x20for\x20site:\x20','778QnKzJZ','parent_segment','Create\x20a\x20new\x20profile','\x0aOperation\x20cancelled','\x0aAvailable\x20profiles:','Removal\x20cancelled','description','20187OtVPPG','\x27\x20does\x20not\x20exist.','profile','tdx:\x20profile\x20create','log','(cleared)','Unknown\x20key\x20\x27','\x20\x20(no\x20profiles\x20found)','Set\x20session\x20profile','create','\x20API\x20key\x20is\x20valid\x20(User:\x20','profile:set','error','session','1113814KFCRrX','message','\x20--default\x27\x20to\x20save\x20permanently','✗\x20Validation\x20failed:\x20','255rupTxs','\x20\x20tdx\x20--profile\x20','Site\x20was\x20not\x20changed.','API\x20key\x20cannot\x20be\x20empty','(session:\x20','ERROR','profileName','Select\x20Treasure\x20Data\x20site\x20for\x20profile\x20\x27','VALID_KEYS','890IUnEwl','logLevel','length','Session\x20profile\x20set\x20to:\x20','Enter\x20profile\x20name:'];a23_0x2599=function(){return _0x1b23f8;};return a23_0x2599();}function validateProfileName(_0x251a1c){const _0x448d59=a23_0x2943;if(!_0x251a1c||!_0x251a1c[_0x448d59(0x14a)]())return'Profile\x20name\x20cannot\x20be\x20empty';const _0x265e90=_0x251a1c['trim']();if(!/^[a-zA-Z0-9_-]+$/['test'](_0x265e90))return _0x448d59(0x17c);if(profileExists(_0x265e90))return'Profile\x20\x27'+_0x265e90+_0x448d59(0x1af);return!![];}function a23_0x2943(_0x35ba2b,_0x273b43){_0x35ba2b=_0x35ba2b-0x13a;const _0x259944=a23_0x2599();let _0x29436c=_0x259944[_0x35ba2b];return _0x29436c;}export class ProfileCreateCommand extends BaseCommand{[a23_0x8dce31(0x163)]=a23_0x8dce31(0x157);[a23_0x8dce31(0x188)]=a23_0x8dce31(0x184);async[a23_0x8dce31(0x162)](_0x59090c){const _0x57c3b9=a23_0x8dce31,{options:_0x34e9be,args:_0x284290}=_0x59090c;console[_0x57c3b9(0x18d)](a23_0x4c3044[_0x57c3b9(0x13f)](_0x57c3b9(0x18c)));let _0x13d3f6;if(_0x284290[_0x57c3b9(0x1a6)]>0x0&&_0x284290[0x0]){const _0x4cd9ac=_0x284290[0x0][_0x57c3b9(0x14a)](),_0x31be40=validateProfileName(_0x4cd9ac);if(_0x31be40!==!![])return console[_0x57c3b9(0x195)](a23_0x4c3044[_0x57c3b9(0x170)](_0x31be40)),0x1;_0x13d3f6=_0x4cd9ac;}else{const _0x680f28=await a23_0x2fff0b({'type':_0x57c3b9(0x173),'name':_0x57c3b9(0x1a1),'message':_0x57c3b9(0x1a8),'validate':validateProfileName});if(!_0x680f28[_0x57c3b9(0x1a1)])return console['log']('\x0aSetup\x20cancelled'),0x1;_0x13d3f6=_0x680f28['profileName'][_0x57c3b9(0x14a)]();}const _0x44828d=await a23_0x2fff0b({'type':_0x57c3b9(0x173),'name':_0x57c3b9(0x188),'message':'Enter\x20description\x20(optional):'}),_0x38b8a7=_0x44828d[_0x57c3b9(0x188)]?.['trim']()||undefined,_0x4b92b6=_0x34e9be[_0x57c3b9(0x141)]||_0x57c3b9(0x14e),{choices:_0x5ef065,initialIndex:_0x4d14e0}=buildSiteChoices(_0x4b92b6),_0x389e98=await a23_0x2fff0b({'type':_0x57c3b9(0x155),'name':'site','message':_0x57c3b9(0x1a2)+_0x13d3f6+'\x27:','choices':_0x5ef065,'initial':_0x4d14e0});if(!_0x389e98[_0x57c3b9(0x141)])return console[_0x57c3b9(0x18d)]('\x0aSetup\x20cancelled'),0x1;let _0x418ceb;if(_0x389e98[_0x57c3b9(0x141)]===_0x57c3b9(0x1ad)){const _0x429524=await a23_0x2fff0b({'type':'text','name':_0x57c3b9(0x149),'message':_0x57c3b9(0x17e),'initial':_0x57c3b9(0x14e),'validate':_0x4b57d2=>{const _0x34e3d1=_0x57c3b9;if(!_0x4b57d2||!_0x4b57d2[_0x34e3d1(0x14a)]())return _0x34e3d1(0x151);if(!/^[a-z0-9-]+$/[_0x34e3d1(0x142)](_0x4b57d2[_0x34e3d1(0x14a)]()))return _0x34e3d1(0x1ab);return!![];}});if(!_0x429524[_0x57c3b9(0x149)])return console['log'](_0x57c3b9(0x165)),0x1;_0x418ceb=_0x429524[_0x57c3b9(0x149)];}else _0x418ceb=_0x389e98[_0x57c3b9(0x141)];const _0x1641ff=resolveSite(_0x418ceb);console[_0x57c3b9(0x18d)](_0x57c3b9(0x181)+_0x1641ff),console[_0x57c3b9(0x18d)]('You\x20can\x20find\x20your\x20API\x20key\x20at:'),console[_0x57c3b9(0x18d)]('\x20\x20'+getConsoleUrl(_0x1641ff,_0x57c3b9(0x177)));const _0xc24ad0=await a23_0x2fff0b({'type':_0x57c3b9(0x14c),'name':'apiKey','message':_0x57c3b9(0x153),'validate':_0x7cb96d=>{const _0x365576=_0x57c3b9;if(!_0x7cb96d||!_0x7cb96d['trim']())return _0x365576(0x19e);return!![];}});if(!_0xc24ad0[_0x57c3b9(0x16f)])return console[_0x57c3b9(0x18d)](_0x57c3b9(0x165)),0x1;const _0x152abe=_0xc24ad0['apiKey'];console[_0x57c3b9(0x18d)](_0x57c3b9(0x14d));try{const _0x3ddcc6=TDX[_0x57c3b9(0x192)]({'site':_0x1641ff,'apiKey':_0x152abe[_0x57c3b9(0x14a)](),'logLevel':_0x34e9be[_0x57c3b9(0x1a5)]??LogLevel[_0x57c3b9(0x1a0)]}),_0x52edad=await _0x3ddcc6[_0x57c3b9(0x159)][_0x57c3b9(0x17d)]();console[_0x57c3b9(0x18d)](a23_0x4c3044[_0x57c3b9(0x1b0)]('✓')+_0x57c3b9(0x193)+_0x52edad[_0x57c3b9(0x1ae)]+')');const _0x3fe967=await isKeychainAvailable();_0x3fe967?(await saveAPIKeyAsync(_0x152abe[_0x57c3b9(0x14a)](),_0x1641ff,_0x13d3f6),console[_0x57c3b9(0x18d)](a23_0x4c3044[_0x57c3b9(0x1b0)]('✓')+_0x57c3b9(0x1a9)+_0x13d3f6+')')):(console[_0x57c3b9(0x143)](a23_0x4c3044[_0x57c3b9(0x15b)](_0x57c3b9(0x16e))),console[_0x57c3b9(0x143)](a23_0x4c3044[_0x57c3b9(0x15b)]('\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.')));const _0x103885={'site':_0x1641ff,..._0x38b8a7&&{'description':_0x38b8a7}};return saveProfileToUserConfig(_0x13d3f6,_0x103885),console[_0x57c3b9(0x18d)](a23_0x4c3044[_0x57c3b9(0x1b0)]('✓')+_0x57c3b9(0x154)+_0x13d3f6+_0x57c3b9(0x15a)),console['log'](),console[_0x57c3b9(0x18d)]('You\x20can\x20now\x20use\x20tdx\x20commands\x20with\x20this\x20profile.\x20Try:'),console[_0x57c3b9(0x18d)]('\x20\x20tdx\x20--profile\x20'+_0x13d3f6+_0x57c3b9(0x16d)),console[_0x57c3b9(0x18d)](_0x57c3b9(0x19c)+_0x13d3f6+_0x57c3b9(0x16b)),0x0;}catch(_0x2dda72){if(_0x2dda72 instanceof HTTPClientError&&_0x2dda72['status']===0x191)return printAuthError(_0x2dda72),0x1;return console['error'](a23_0x4c3044[_0x57c3b9(0x170)]('✗\x20Validation\x20failed:\x20'+(_0x2dda72 instanceof Error?_0x2dda72[_0x57c3b9(0x198)]:String(_0x2dda72)))),console[_0x57c3b9(0x195)](_0x57c3b9(0x13b)),0x1;}}}export class ProfileRemoveCommand extends BaseCommand{['name']=a23_0x8dce31(0x146);[a23_0x8dce31(0x188)]='Remove\x20a\x20profile';[a23_0x8dce31(0x167)](_0x42cb33){const _0x267b2a=a23_0x8dce31,{args:_0x502f5d}=_0x42cb33;if(_0x502f5d[_0x267b2a(0x1a6)]===0x0)return _0x267b2a(0x174);return undefined;}async['execute'](_0x41f3e3){const _0xd801ce=a23_0x8dce31,{args:_0x458971}=_0x41f3e3,_0x250eb0=_0x458971[0x0];console[_0xd801ce(0x18d)](a23_0x4c3044[_0xd801ce(0x13f)](_0xd801ce(0x147)));if(!profileExists(_0x250eb0)){console[_0xd801ce(0x195)](a23_0x4c3044['red'](_0xd801ce(0x175)+_0x250eb0+'\x27\x20does\x20not\x20exist.')),console[_0xd801ce(0x18d)]('\x0aAvailable\x20profiles:');const _0x31f13b=listProfiles();if(_0x31f13b[_0xd801ce(0x1a6)]===0x0)console[_0xd801ce(0x18d)](_0xd801ce(0x190));else for(const _0x69be22 of _0x31f13b){console[_0xd801ce(0x18d)]('\x20\x20-\x20'+_0x69be22[_0xd801ce(0x163)]);}return 0x1;}const _0x19e0df=await a23_0x2fff0b({'type':'confirm','name':'confirm','message':_0xd801ce(0x15d)+_0x250eb0+'\x27?','initial':![]});if(!_0x19e0df['confirm'])return console[_0xd801ce(0x18d)](_0xd801ce(0x187)),0x0;try{removeProfileFromUserConfig(_0x250eb0),console['log'](a23_0x4c3044[_0xd801ce(0x1b0)]('✓')+'\x20Profile\x20\x27'+_0x250eb0+_0xd801ce(0x158));}catch(_0x27b65a){return console[_0xd801ce(0x195)](a23_0x4c3044['red'](_0xd801ce(0x144)+(_0x27b65a instanceof Error?_0x27b65a[_0xd801ce(0x198)]:String(_0x27b65a)))),0x1;}const _0x3b959b=await isKeychainAvailable();if(_0x3b959b){const _0x30898e=await deleteKeychainAPIKey(_0x250eb0);_0x30898e&&console['log'](a23_0x4c3044[_0xd801ce(0x1b0)]('✓')+'\x20API\x20key\x20removed\x20from\x20system\x20keychain');}return 0x0;}}export class ProfileSetCommand extends BaseCommand{[a23_0x8dce31(0x163)]=a23_0x8dce31(0x194);[a23_0x8dce31(0x188)]=a23_0x8dce31(0x13a);static [a23_0x8dce31(0x1a3)]=['site','database',a23_0x8dce31(0x183),'llm_project',a23_0x8dce31(0x166),'description'];[a23_0x8dce31(0x167)](_0x46c863){const _0x18984f=a23_0x8dce31,{args:_0x380760,options:_0x9b83e7}=_0x46c863,_0x446bbf=_0x9b83e7['profile']||getActiveProfile();if(!_0x446bbf)return'No\x20active\x20profile.\x20Use\x20--profile\x20flag\x20or\x20set\x20session\x20profile\x20with:\x20tdx\x20profile\x20use\x20<name>\x0a\x0aUsage:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>';if(_0x380760[_0x18984f(0x1a6)]===0x0)return _0x18984f(0x160)+ProfileSetCommand[_0x18984f(0x1a3)][_0x18984f(0x179)](',\x20');const _0x30db5b=_0x380760[0x0];if(!_0x30db5b[_0x18984f(0x15f)]('='))return _0x18984f(0x13d)+ProfileSetCommand[_0x18984f(0x1a3)]['join'](',\x20');const [_0x53b43a]=_0x30db5b[_0x18984f(0x178)]('=',0x2);if(!ProfileSetCommand[_0x18984f(0x1a3)][_0x18984f(0x15f)](_0x53b43a))return _0x18984f(0x18f)+_0x53b43a+'\x27.\x0a\x0aValid\x20keys:\x20'+ProfileSetCommand[_0x18984f(0x1a3)]['join'](',\x20');return undefined;}async[a23_0x8dce31(0x162)](_0x261aac){const _0x3fad35=a23_0x8dce31,{args:_0x447f0c,options:_0x5a2ac9}=_0x261aac,_0xb8093a=_0x5a2ac9[_0x3fad35(0x18b)]||getActiveProfile(),[_0x47e690,..._0x51b3a0]=_0x447f0c[0x0][_0x3fad35(0x178)]('='),_0x4196b2=_0x51b3a0[_0x3fad35(0x179)]('=');console[_0x3fad35(0x18d)](a23_0x4c3044[_0x3fad35(0x13f)]('tdx:\x20profile\x20set'));if(!profileExists(_0xb8093a)){const _0x4c900d=await a23_0x2fff0b({'type':_0x3fad35(0x152),'name':_0x3fad35(0x192),'message':_0x3fad35(0x175)+_0xb8093a+_0x3fad35(0x168),'initial':!![]});if(!_0x4c900d[_0x3fad35(0x192)])return console[_0x3fad35(0x18d)](_0x3fad35(0x1aa)),0x1;}const _0x331782=loadProfile(_0xb8093a),_0x4a9121=_0x331782?.[_0x3fad35(0x176)]||{};if(_0x47e690===_0x3fad35(0x141)){const _0x13345d=resolveSite(_0x4196b2);console['log'](_0x3fad35(0x145)+_0x13345d+'\x27\x20requires\x20API\x20key\x20validation.'),console[_0x3fad35(0x18d)](_0x3fad35(0x169)),console[_0x3fad35(0x18d)]('\x20\x20'+getConsoleUrl(_0x13345d,'/app/mp/ak'));const _0xae7892=await a23_0x2fff0b({'type':'password','name':'apiKey','message':_0x3fad35(0x13c),'validate':_0xebae47=>{if(!_0xebae47||!_0xebae47['trim']())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0xae7892[_0x3fad35(0x16f)])return console[_0x3fad35(0x18d)](_0x3fad35(0x185)),0x1;console['log'](_0x3fad35(0x14d));try{const _0x2636f2=TDX[_0x3fad35(0x192)]({'site':_0x13345d,'apiKey':_0xae7892[_0x3fad35(0x16f)][_0x3fad35(0x14a)](),'logLevel':_0x5a2ac9[_0x3fad35(0x1a5)]??LogLevel[_0x3fad35(0x1a0)]}),_0x4aad2b=await _0x2636f2[_0x3fad35(0x159)][_0x3fad35(0x17d)]();console[_0x3fad35(0x18d)](a23_0x4c3044[_0x3fad35(0x1b0)]('✓')+_0x3fad35(0x193)+_0x4aad2b['email']+')');const _0x484084=await isKeychainAvailable();_0x484084?(await saveAPIKeyAsync(_0xae7892[_0x3fad35(0x16f)][_0x3fad35(0x14a)](),_0x13345d,_0xb8093a),console[_0x3fad35(0x18d)](a23_0x4c3044[_0x3fad35(0x1b0)]('✓')+_0x3fad35(0x150))):console[_0x3fad35(0x143)](a23_0x4c3044[_0x3fad35(0x15b)](_0x3fad35(0x16e))),_0x4a9121[_0x3fad35(0x141)]=_0x13345d;}catch(_0x539106){if(_0x539106 instanceof HTTPClientError&&_0x539106[_0x3fad35(0x148)]===0x191)return printAuthError(_0x539106),0x1;return console[_0x3fad35(0x195)](a23_0x4c3044['red'](_0x3fad35(0x19a)+(_0x539106 instanceof Error?_0x539106['message']:String(_0x539106)))),console['error'](_0x3fad35(0x19d)),0x1;}}else _0x4a9121[_0x47e690]=_0x4196b2||undefined;return saveProfileToUserConfig(_0xb8093a,_0x4a9121),console['log'](a23_0x4c3044['green']('✓')+_0x3fad35(0x154)+_0xb8093a+_0x3fad35(0x16a)+_0x47e690+'='+(_0x4196b2||_0x3fad35(0x18e))),0x0;}}export class ProfileUseCommand extends BaseCommand{[a23_0x8dce31(0x163)]=a23_0x8dce31(0x140);['description']=a23_0x8dce31(0x191);[a23_0x8dce31(0x167)](_0x22cb1f){const _0x146897=a23_0x8dce31,{args:_0x254b64}=_0x22cb1f;if(_0x254b64['length']===0x0)return _0x146897(0x15c);return undefined;}async[a23_0x8dce31(0x162)](_0x18f772){const _0x350d7f=a23_0x8dce31,{args:_0x3f4eb2,options:_0x1f76cb}=_0x18f772,_0x599979=_0x3f4eb2[0x0],_0x4f4643=_0x1f76cb[_0x350d7f(0x180)];cleanExpiredSessions();if(!profileExists(_0x599979)){console[_0x350d7f(0x195)](a23_0x4c3044['red'](_0x350d7f(0x175)+_0x599979+_0x350d7f(0x18a))),console['log'](_0x350d7f(0x186));const _0x5bec1f=listProfiles();if(_0x5bec1f[_0x350d7f(0x1a6)]===0x0)console[_0x350d7f(0x18d)]('\x20\x20(no\x20profiles\x20found)');else for(const _0x5da9eb of _0x5bec1f){console[_0x350d7f(0x18d)](_0x350d7f(0x164)+_0x5da9eb[_0x350d7f(0x163)]);}return 0x1;}if(_0x4f4643){const _0xe991b2=a23_0x445a7e[_0x350d7f(0x179)](getConfigDir(),_0x350d7f(0x14b));return saveActiveProfileToUserConfig(_0x599979),console['log'](_0x350d7f(0x1ac)+a23_0x4c3044[_0x350d7f(0x1b0)](_0x599979)),console[_0x350d7f(0x18d)](a23_0x4c3044[_0x350d7f(0x156)](_0x350d7f(0x15e)+_0xe991b2)),0x0;}const _0xe286a2=getSessionID(_0x1f76cb[_0x350d7f(0x196)]);return saveSessionContext({'profile':_0x599979},_0x1f76cb[_0x350d7f(0x196)]),console[_0x350d7f(0x18d)](_0x350d7f(0x1a7)+a23_0x4c3044[_0x350d7f(0x1b0)](_0x599979)+'\x20'+a23_0x4c3044['dim'](_0x350d7f(0x19f)+_0xe286a2+')')),console[_0x350d7f(0x18d)](a23_0x4c3044['dim'](_0x350d7f(0x172)+_0x599979+_0x350d7f(0x199))),0x0;}}
@@ -1 +1 @@
1
- const a24_0xc7033c=a24_0x9a9b;(function(_0x596e96,_0xca61f9){const _0x4989af=a24_0x9a9b,_0x2b4362=_0x596e96();while(!![]){try{const _0x589f5f=-parseInt(_0x4989af(0x9a))/0x1*(parseInt(_0x4989af(0x9c))/0x2)+-parseInt(_0x4989af(0x9b))/0x3+parseInt(_0x4989af(0xa3))/0x4*(parseInt(_0x4989af(0x95))/0x5)+-parseInt(_0x4989af(0xa1))/0x6+-parseInt(_0x4989af(0x9d))/0x7*(-parseInt(_0x4989af(0x97))/0x8)+-parseInt(_0x4989af(0xa7))/0x9*(parseInt(_0x4989af(0xa2))/0xa)+parseInt(_0x4989af(0xa9))/0xb*(parseInt(_0x4989af(0x99))/0xc);if(_0x589f5f===_0xca61f9)break;else _0x2b4362['push'](_0x2b4362['shift']());}catch(_0x476138){_0x2b4362['push'](_0x2b4362['shift']());}}}(a24_0x37e8,0x4297a));import{BaseCommand}from'./command.js';function a24_0x9a9b(_0x1302a2,_0x1ec5f7){_0x1302a2=_0x1302a2-0x95;const _0x37e854=a24_0x37e8();let _0x9a9be9=_0x37e854[_0x1302a2];return _0x9a9be9;}function a24_0x37e8(){const _0x9ab533=['1055XvjoWk','No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a','272bwpBQT','map','12mORiAw','6VIyVrs','1397433chWvFj','77898vRQkQd','59157ybvQVF','description','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','execute','841974kvEvwk','80zCUcXr','9260OZZDBl','message','log','name','556830xEiwhq','config','9149327gxiPkq','\x20\x20Global:\x20~/.config/tdx/tdx.json','length'];a24_0x37e8=function(){return _0x9ab533;};return a24_0x37e8();}import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';import{handleSDKOutput}from'../core/command-output.js';export class ProfilesCommand extends BaseCommand{['name']='profiles';[a24_0xc7033c(0x9e)]='List\x20all\x20available\x20profiles';async[a24_0xc7033c(0xa0)](_0x27446d){const _0x4002fe=a24_0xc7033c,{options:_0x48a7f7}=_0x27446d;try{const _0x27d7fd=listProfiles(),_0x35907c=getActiveProfile();if(_0x27d7fd[_0x4002fe(0xab)]===0x0)return console[_0x4002fe(0xa5)](_0x4002fe(0x96)),console[_0x4002fe(0xa5)](_0x4002fe(0x9f)),console[_0x4002fe(0xa5)](_0x4002fe(0xaa)),0x0;const _0x5a5881=_0x27d7fd[_0x4002fe(0x98)](_0x54391f=>{const _0x59f542=_0x4002fe,_0x30d61e=_0x54391f[_0x59f542(0xa6)]===_0x35907c,_0x399db5=getProfileParams(_0x54391f[_0x59f542(0xa8)]);return{'name':_0x54391f['name'],'active':_0x30d61e,'scope':_0x54391f['scope'],'description':_0x54391f[_0x59f542(0xa8)][_0x59f542(0x9e)]||'','params':_0x399db5};});return await handleSDKOutput(_0x5a5881,_0x48a7f7),0x0;}catch(_0xdacee3){return _0xdacee3 instanceof Error&&console['error']('Error:\x20'+_0xdacee3[_0x4002fe(0xa4)]),0x1;}}}
1
+ const a24_0x22774e=a24_0x271d;function a24_0x4b85(){const _0x1905f2=['121112nqZADW','260OiLiAy','log','execute','11942270uvtspY','description','List\x20all\x20available\x20profiles','3mffKyy','scope','map','3318240dfLwhq','\x20\x20Global:\x20~/.config/tdx/tdx.json','config','message','779724aJKFwa','168PmVxlg','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','1643944WwoVEf','name','No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a','profiles','length','4898214WakzQL','142LkoGcI','error'];a24_0x4b85=function(){return _0x1905f2;};return a24_0x4b85();}function a24_0x271d(_0x5ee039,_0x432f13){_0x5ee039=_0x5ee039-0xec;const _0x4b85de=a24_0x4b85();let _0x271d3f=_0x4b85de[_0x5ee039];return _0x271d3f;}(function(_0x26e012,_0x5c4f61){const _0x30c917=a24_0x271d,_0x4bb2c5=_0x26e012();while(!![]){try{const _0x30f16e=parseInt(_0x30c917(0xed))/0x1*(-parseInt(_0x30c917(0x103))/0x2)+-parseInt(_0x30c917(0xf3))/0x3*(parseInt(_0x30c917(0xfd))/0x4)+-parseInt(_0x30c917(0xf6))/0x5+parseInt(_0x30c917(0xfa))/0x6+-parseInt(_0x30c917(0xfb))/0x7*(parseInt(_0x30c917(0xec))/0x8)+parseInt(_0x30c917(0x102))/0x9+parseInt(_0x30c917(0xf0))/0xa;if(_0x30f16e===_0x5c4f61)break;else _0x4bb2c5['push'](_0x4bb2c5['shift']());}catch(_0x29652d){_0x4bb2c5['push'](_0x4bb2c5['shift']());}}}(a24_0x4b85,0x6495d));import{BaseCommand}from'./command.js';import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';import{handleSDKOutput}from'../core/command-output.js';export class ProfilesCommand extends BaseCommand{[a24_0x22774e(0xfe)]=a24_0x22774e(0x100);[a24_0x22774e(0xf1)]=a24_0x22774e(0xf2);async[a24_0x22774e(0xef)](_0x5bc474){const _0x4dc7b9=a24_0x22774e,{options:_0x44a742}=_0x5bc474;try{const _0x4eda06=listProfiles(),_0x5c3aab=getActiveProfile();if(_0x4eda06[_0x4dc7b9(0x101)]===0x0)return console[_0x4dc7b9(0xee)](_0x4dc7b9(0xff)),console[_0x4dc7b9(0xee)](_0x4dc7b9(0xfc)),console[_0x4dc7b9(0xee)](_0x4dc7b9(0xf7)),0x0;const _0x337b93=_0x4eda06[_0x4dc7b9(0xf5)](_0xb091b5=>{const _0x4c87a7=_0x4dc7b9,_0x28455b=_0xb091b5[_0x4c87a7(0xfe)]===_0x5c3aab,_0x3cc3e6=getProfileParams(_0xb091b5[_0x4c87a7(0xf8)]);return{'name':_0xb091b5[_0x4c87a7(0xfe)],'active':_0x28455b,'scope':_0xb091b5[_0x4c87a7(0xf4)],'description':_0xb091b5['config'][_0x4c87a7(0xf1)]||'','params':_0x3cc3e6};});return await handleSDKOutput(_0x337b93,_0x44a742),0x0;}catch(_0x22c593){return _0x22c593 instanceof Error&&console[_0x4dc7b9(0x104)]('Error:\x20'+_0x22c593[_0x4dc7b9(0xf9)]),0x1;}}}
@@ -1 +1 @@
1
- const a25_0x323394=a25_0x2af4;function a25_0x394a(){const _0x3d2690=['Query\x20completed:\x20Processed\x20','\x20[Job\x20ID:\x20','originalMessage','processedRows','data','output','information_schema','site','error','totalSplits','validate','20VEGJnp','verbose','file','\x0aAll\x20results\x20saved\x20to\x20','jobId','name','query','length','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','description','setExtra','setPhase','execute','SQL:\x20','state','in\x20','stats','Error:\x20','331038aEIoEk','Executing\x20query...','...','18rQDcbX','catalog','Statement\x20','join','push','database','Site:\x20','14013640WkLXCS','Executing\x20statement\x20','749886HWLppX','1582248XfdFEA','7737289lGyBLj','44670RClYvf','\x20rows\x20','No\x20SQL\x20provided','\x20-\x20','Executing\x20query\x20[','setJobId','6zNAXuM','6993808VKjbey','Schema:\x20'];a25_0x394a=function(){return _0x3d2690;};return a25_0x394a();}function a25_0x2af4(_0x306f6c,_0x3fc0f6){_0x306f6c=_0x306f6c-0x1c3;const _0x394ae0=a25_0x394a();let _0x2af49f=_0x394ae0[_0x306f6c];return _0x2af49f;}(function(_0x4782c6,_0x5e7df2){const _0x265408=a25_0x2af4,_0x3c853b=_0x4782c6();while(!![]){try{const _0xd455e3=-parseInt(_0x265408(0x1ee))/0x1+parseInt(_0x265408(0x1eb))/0x2+-parseInt(_0x265408(0x1df))/0x3+parseInt(_0x265408(0x1ec))/0x4*(parseInt(_0x265408(0x1cd))/0x5)+parseInt(_0x265408(0x1f4))/0x6*(parseInt(_0x265408(0x1ed))/0x7)+parseInt(_0x265408(0x1f5))/0x8+-parseInt(_0x265408(0x1e2))/0x9*(parseInt(_0x265408(0x1e9))/0xa);if(_0xd455e3===_0x5e7df2)break;else _0x3c853b['push'](_0x3c853b['shift']());}catch(_0x551642){_0x3c853b['push'](_0x3c853b['shift']());}}}(a25_0x394a,0xef038));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../core/command-output.js';import{readSqlStatementsFromFile,readSqlStatementsFromStdin,splitSqlStatements,isSqlFilePath}from'../sdk/query/sql-parser.js';import{writeFileSync}from'fs';import{withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{formatRows}from'../sdk/util/formatters.js';export class QueryCommand extends BaseCommand{[a25_0x323394(0x1d2)]=a25_0x323394(0x1d3);[a25_0x323394(0x1d6)]='Run\x20Trino\x20queries\x20(streaming)';async['execute'](_0x25dbec){const _0x4e3971=a25_0x323394,{options:_0x836920,args:_0x5abd31,tdx:_0x392a4f}=_0x25dbec,_0x68890f=_0x5abd31[0x0],_0x250ab7=_0x836920[_0x4e3971(0x1cf)];let _0x2522bd;try{if(_0x250ab7)_0x2522bd=readSqlStatementsFromFile(_0x250ab7);else{if(_0x68890f==='-')_0x2522bd=await readSqlStatementsFromStdin();else{if(_0x68890f&&isSqlFilePath(_0x68890f))_0x2522bd=readSqlStatementsFromFile(_0x68890f);else{if(_0x68890f)_0x2522bd=splitSqlStatements(_0x68890f);else throw new Error(_0x4e3971(0x1f0));}}}}catch(_0x4ffe4f){return console[_0x4e3971(0x1ca)](_0x4e3971(0x1de)+_0x4ffe4f['message']),0x1;}const _0x1b8852=_0x836920[_0x4e3971(0x1e7)]||_0x4e3971(0x1c8),_0x35e063=_0x836920[_0x4e3971(0x1e3)];try{const _0x8d353b=[],_0x3f61b0=!!_0x836920[_0x4e3971(0x1c7)];for(let _0x3c06c8=0x0;_0x3c06c8<_0x2522bd[_0x4e3971(0x1d4)];_0x3c06c8++){const _0x1b0e75=_0x2522bd[_0x3c06c8],_0x3432c5=_0x3c06c8+0x1,_0x432ce2=_0x2522bd[_0x4e3971(0x1d4)],_0x3abad5=_0x432ce2>0x1;_0x836920[_0x4e3971(0x1ce)]&&(console[_0x4e3971(0x1ca)]('\x0a'+(_0x3abad5?_0x4e3971(0x1e4)+_0x3432c5+'/'+_0x432ce2+':':'')),console[_0x4e3971(0x1ca)](_0x4e3971(0x1e8)+_0x836920[_0x4e3971(0x1c9)]),console['error']('Catalog:\x20'+(_0x35e063||'td')),console[_0x4e3971(0x1ca)](_0x4e3971(0x1f6)+_0x1b8852),console[_0x4e3971(0x1ca)](_0x4e3971(0x1da)+_0x1b0e75));const _0xb7e764=_0x3abad5?_0x4e3971(0x1ea)+_0x3432c5+'/'+_0x432ce2+_0x4e3971(0x1e1):_0x4e3971(0x1e0);try{const _0x388c82=await withProgressSpinner(_0xb7e764,async _0x14a365=>{const _0x25c2a5=_0x4e3971,_0x4692a6=await _0x392a4f[_0x25c2a5(0x1d3)][_0x25c2a5(0x1d9)](_0x1b0e75,{'catalog':_0x35e063,'schema':_0x1b8852,'onJobId':_0x41ba1a=>{const _0x4fba17=_0x25c2a5;_0x14a365[_0x4fba17(0x1f3)](_0x41ba1a);},'onProgress':_0x2a0a52=>{const _0x1876cd=_0x25c2a5;_0x14a365[_0x1876cd(0x1d8)](_0x1876cd(0x1f2)+_0x2a0a52[_0x1876cd(0x1db)]+']'),_0x14a365[_0x1876cd(0x1d7)](formatRows(_0x2a0a52[_0x1876cd(0x1c5)])+_0x1876cd(0x1ef)+_0x2a0a52['completedSplits']+'/'+_0x2a0a52[_0x1876cd(0x1cb)]+'\x20splits');}});return _0x4692a6;},{'verbose':_0x836920[_0x4e3971(0x1ce)]}),_0x46c3c9=_0x388c82[_0x4e3971(0x1c6)],_0x2de067=_0x46c3c9[_0x4e3971(0x1d1)]?_0x4e3971(0x1c3)+_0x46c3c9[_0x4e3971(0x1d1)]+']':'',_0x26d6a9=_0x3abad5?_0x4e3971(0x1e4)+_0x3432c5+'/'+_0x432ce2+_0x4e3971(0x1f1):'';console[_0x4e3971(0x1ca)]('✔\x20'+_0x26d6a9+_0x4e3971(0x1f7)+formatRows(_0x46c3c9[_0x4e3971(0x1dd)][_0x4e3971(0x1c5)])+'\x20rows\x20'+(_0x4e3971(0x1dc)+formatElapsed(_0x46c3c9[_0x4e3971(0x1dd)]['elapsedTimeMillis'])+_0x2de067));if(_0x3abad5&&_0x3f61b0){const _0x4a29ba=resolveOutputOptions(_0x836920),_0x1c7a55=await formatQueryOutput(_0x46c3c9,_0x4a29ba);_0x8d353b[_0x4e3971(0x1e6)](_0x1c7a55);}else await handleQueryOutput(_0x46c3c9,_0x836920);}catch(_0x4f8c12){const _0x30bcb7=_0x3abad5?'Statement\x20'+_0x3432c5+'/'+_0x432ce2+':\x0a':'',_0xc46da1=_0x4f8c12 instanceof SDKError?_0x4f8c12[_0x4e3971(0x1c4)]:_0x4f8c12['message'];return console['error'](''+_0x30bcb7+_0xc46da1),0x1;}}if(_0x2522bd[_0x4e3971(0x1d4)]>0x1&&_0x3f61b0&&_0x8d353b['length']>0x0){const _0x4943d3=_0x8d353b[_0x4e3971(0x1e5)]('\x0a');writeFileSync(_0x836920[_0x4e3971(0x1c7)],_0x4943d3),console[_0x4e3971(0x1ca)](_0x4e3971(0x1d0)+_0x836920[_0x4e3971(0x1c7)]);}return 0x0;}catch(_0x59915c){throw _0x59915c;}}[a25_0x323394(0x1cc)](_0x2060d5){const _0x180975=a25_0x323394,_0x1e6263=_0x2060d5['args'][0x0],_0x16a63a=_0x2060d5['options'][_0x180975(0x1cf)];if(!_0x1e6263&&!_0x16a63a)return'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';if(_0x1e6263&&_0x16a63a)return _0x180975(0x1d5);return undefined;}}
1
+ const a25_0x4be603=a25_0x40b7;(function(_0x59595f,_0x4e158b){const _0x2e98e8=a25_0x40b7,_0x178452=_0x59595f();while(!![]){try{const _0x433bef=-parseInt(_0x2e98e8(0x1d7))/0x1*(-parseInt(_0x2e98e8(0x1e0))/0x2)+parseInt(_0x2e98e8(0x1d9))/0x3+-parseInt(_0x2e98e8(0x1c6))/0x4*(parseInt(_0x2e98e8(0x1ce))/0x5)+-parseInt(_0x2e98e8(0x1c1))/0x6*(parseInt(_0x2e98e8(0x1d3))/0x7)+-parseInt(_0x2e98e8(0x1cd))/0x8+-parseInt(_0x2e98e8(0x1d8))/0x9+-parseInt(_0x2e98e8(0x1dc))/0xa*(-parseInt(_0x2e98e8(0x1e8))/0xb);if(_0x433bef===_0x4e158b)break;else _0x178452['push'](_0x178452['shift']());}catch(_0x3a47c2){_0x178452['push'](_0x178452['shift']());}}}(a25_0x403e,0x1b92b));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a25_0x403e(){const _0xa4bf22=['site','Catalog:\x20','information_schema','message','119092PHsrhw','originalMessage','Statement\x20','No\x20SQL\x20provided','validate','\x20rows\x20','file','846416uWJgYE','5VpGeVu','length','verbose','Error:\x20','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','343WVEdEa','totalSplits','options','state','2119WMmobl','1649610ljiUBq','400971uizPjh','Executing\x20query\x20[','processedRows','1846030kbIgrt','name','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','execute','206silWmj','data','error','query','stats','description','output','Site:\x20','11lbRqus','push','in\x20','\x0aAll\x20results\x20saved\x20to\x20','database','Executing\x20statement\x20','setPhase','setJobId','completedSplits','\x20-\x20','jobId','elapsedTimeMillis','join','catalog','setExtra','\x20splits','12822eMrpTN'];a25_0x403e=function(){return _0xa4bf22;};return a25_0x403e();}import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../core/command-output.js';import{readSqlStatementsFromFile,readSqlStatementsFromStdin,splitSqlStatements,isSqlFilePath}from'../sdk/query/sql-parser.js';import{writeFileSync}from'fs';import{withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{formatRows}from'../sdk/util/formatters.js';function a25_0x40b7(_0x3ac9bd,_0x5226ca){_0x3ac9bd=_0x3ac9bd-0x1b2;const _0x403ed6=a25_0x403e();let _0x40b7d7=_0x403ed6[_0x3ac9bd];return _0x40b7d7;}export class QueryCommand extends BaseCommand{[a25_0x4be603(0x1dd)]=a25_0x4be603(0x1e3);[a25_0x4be603(0x1e5)]='Run\x20Trino\x20queries\x20(streaming)';async[a25_0x4be603(0x1df)](_0x3817c7){const _0x3d3875=a25_0x4be603,{options:_0x1c6507,args:_0x45f8f6,tdx:_0xd68fbd}=_0x3817c7,_0x2ec9d9=_0x45f8f6[0x0],_0x4c8f01=_0x1c6507[_0x3d3875(0x1cc)];let _0x1828d5;try{if(_0x4c8f01)_0x1828d5=readSqlStatementsFromFile(_0x4c8f01);else{if(_0x2ec9d9==='-')_0x1828d5=await readSqlStatementsFromStdin();else{if(_0x2ec9d9&&isSqlFilePath(_0x2ec9d9))_0x1828d5=readSqlStatementsFromFile(_0x2ec9d9);else{if(_0x2ec9d9)_0x1828d5=splitSqlStatements(_0x2ec9d9);else throw new Error(_0x3d3875(0x1c9));}}}}catch(_0x2cb0df){return console[_0x3d3875(0x1e2)](_0x3d3875(0x1d1)+_0x2cb0df[_0x3d3875(0x1c5)]),0x1;}const _0x115dfe=_0x1c6507[_0x3d3875(0x1b5)]||_0x3d3875(0x1c4),_0x5355da=_0x1c6507[_0x3d3875(0x1be)];try{const _0x1119f4=[],_0x202801=!!_0x1c6507['output'];for(let _0x363bd8=0x0;_0x363bd8<_0x1828d5[_0x3d3875(0x1cf)];_0x363bd8++){const _0x4a10ad=_0x1828d5[_0x363bd8],_0x3418cf=_0x363bd8+0x1,_0x509782=_0x1828d5[_0x3d3875(0x1cf)],_0x52afba=_0x509782>0x1;_0x1c6507[_0x3d3875(0x1d0)]&&(console['error']('\x0a'+(_0x52afba?_0x3d3875(0x1c8)+_0x3418cf+'/'+_0x509782+':':'')),console['error'](_0x3d3875(0x1e7)+_0x1c6507[_0x3d3875(0x1c2)]),console[_0x3d3875(0x1e2)](_0x3d3875(0x1c3)+(_0x5355da||'td')),console[_0x3d3875(0x1e2)]('Schema:\x20'+_0x115dfe),console[_0x3d3875(0x1e2)]('SQL:\x20'+_0x4a10ad));const _0x23c9f2=_0x52afba?_0x3d3875(0x1b6)+_0x3418cf+'/'+_0x509782+'...':'Executing\x20query...';try{const _0x9ebbb4=await withProgressSpinner(_0x23c9f2,async _0x53ab80=>{const _0x42a045=_0x3d3875,_0x11d4bc=await _0xd68fbd[_0x42a045(0x1e3)][_0x42a045(0x1df)](_0x4a10ad,{'catalog':_0x5355da,'schema':_0x115dfe,'onJobId':_0xad1888=>{const _0x1fdffe=_0x42a045;_0x53ab80[_0x1fdffe(0x1b8)](_0xad1888);},'onProgress':_0x1791bb=>{const _0x59450b=_0x42a045;_0x53ab80[_0x59450b(0x1b7)](_0x59450b(0x1da)+_0x1791bb[_0x59450b(0x1d6)]+']'),_0x53ab80[_0x59450b(0x1bf)](formatRows(_0x1791bb[_0x59450b(0x1db)])+'\x20rows\x20'+_0x1791bb[_0x59450b(0x1b9)]+'/'+_0x1791bb[_0x59450b(0x1d4)]+_0x59450b(0x1c0));}});return _0x11d4bc;},{'verbose':_0x1c6507[_0x3d3875(0x1d0)]}),_0x2ae358=_0x9ebbb4[_0x3d3875(0x1e1)],_0x99b002=_0x2ae358[_0x3d3875(0x1bb)]?'\x20[Job\x20ID:\x20'+_0x2ae358[_0x3d3875(0x1bb)]+']':'',_0x5dc3fb=_0x52afba?'Statement\x20'+_0x3418cf+'/'+_0x509782+_0x3d3875(0x1ba):'';console['error']('✔\x20'+_0x5dc3fb+'Query\x20completed:\x20Processed\x20'+formatRows(_0x2ae358['stats'][_0x3d3875(0x1db)])+_0x3d3875(0x1cb)+(_0x3d3875(0x1b3)+formatElapsed(_0x2ae358[_0x3d3875(0x1e4)][_0x3d3875(0x1bc)])+_0x99b002));if(_0x52afba&&_0x202801){const _0x842581=resolveOutputOptions(_0x1c6507),_0x33f96e=await formatQueryOutput(_0x2ae358,_0x842581);_0x1119f4[_0x3d3875(0x1b2)](_0x33f96e);}else await handleQueryOutput(_0x2ae358,_0x1c6507);}catch(_0x9210eb){const _0x1e6d7d=_0x52afba?_0x3d3875(0x1c8)+_0x3418cf+'/'+_0x509782+':\x0a':'',_0x508b7a=_0x9210eb instanceof SDKError?_0x9210eb[_0x3d3875(0x1c7)]:_0x9210eb[_0x3d3875(0x1c5)];return console[_0x3d3875(0x1e2)](''+_0x1e6d7d+_0x508b7a),0x1;}}if(_0x1828d5[_0x3d3875(0x1cf)]>0x1&&_0x202801&&_0x1119f4[_0x3d3875(0x1cf)]>0x0){const _0x184b48=_0x1119f4[_0x3d3875(0x1bd)]('\x0a');writeFileSync(_0x1c6507[_0x3d3875(0x1e6)],_0x184b48),console[_0x3d3875(0x1e2)](_0x3d3875(0x1b4)+_0x1c6507[_0x3d3875(0x1e6)]);}return 0x0;}catch(_0x59e8e2){throw _0x59e8e2;}}[a25_0x4be603(0x1ca)](_0x9e239f){const _0x1795a9=a25_0x4be603,_0x256b1a=_0x9e239f['args'][0x0],_0x4b5ff1=_0x9e239f[_0x1795a9(0x1d5)][_0x1795a9(0x1cc)];if(!_0x256b1a&&!_0x4b5ff1)return _0x1795a9(0x1d2);if(_0x256b1a&&_0x4b5ff1)return _0x1795a9(0x1de);return undefined;}}