@treasuredata/tdx 0.16.16 → 0.16.18

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 (169) 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/llm-proxy.js +1 -1
  24. package/dist/commands/mcp-command.js +1 -1
  25. package/dist/commands/parent-segment-command.js +1 -1
  26. package/dist/commands/profile-command.js +1 -1
  27. package/dist/commands/profiles-command.js +1 -1
  28. package/dist/commands/query-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.d.ts.map +1 -1
  62. package/dist/mcp/tools/tdx-run.js +1 -1
  63. package/dist/mcp/tools/tdx-run.js.map +1 -1
  64. package/dist/mcp/tools/tdx-search.js +1 -1
  65. package/dist/mcp/utils.js +1 -1
  66. package/dist/proxy/anthropic-adapter.js +1 -1
  67. package/dist/proxy/claude-usage-tracker.js +1 -1
  68. package/dist/proxy/context-signature.js +1 -1
  69. package/dist/proxy/conversation-utils.js +1 -1
  70. package/dist/proxy/passthrough-server.js +1 -1
  71. package/dist/proxy/server.js +1 -1
  72. package/dist/proxy/session-cache.js +1 -1
  73. package/dist/proxy/sse-usage-parser.js +1 -1
  74. package/dist/sdk/agent/agent-config.js +1 -1
  75. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  76. package/dist/sdk/agent/agent-yaml.js +1 -1
  77. package/dist/sdk/agent/test/evaluator.js +1 -1
  78. package/dist/sdk/agent/test/executor.js +1 -1
  79. package/dist/sdk/agent/test/index.js +1 -1
  80. package/dist/sdk/agent/test/output.js +1 -1
  81. package/dist/sdk/agent/test/parser.js +1 -1
  82. package/dist/sdk/api.js +1 -1
  83. package/dist/sdk/client/cdp-api-client.js +1 -1
  84. package/dist/sdk/client/endpoints.js +1 -1
  85. package/dist/sdk/client/engage-api-client.js +1 -1
  86. package/dist/sdk/client/http-client.js +1 -1
  87. package/dist/sdk/client/llm-api-client.js +1 -1
  88. package/dist/sdk/client/rate-limiter.js +1 -1
  89. package/dist/sdk/client/td-api-client.js +1 -1
  90. package/dist/sdk/client/trino-api-client.js +1 -1
  91. package/dist/sdk/client/workflow-client.js +1 -1
  92. package/dist/sdk/connection-validator.js +1 -1
  93. package/dist/sdk/connection.js +1 -1
  94. package/dist/sdk/engage.js +1 -1
  95. package/dist/sdk/errors.js +1 -1
  96. package/dist/sdk/index.js +1 -1
  97. package/dist/sdk/io/index.js +1 -1
  98. package/dist/sdk/io/node-filesystem.js +1 -1
  99. package/dist/sdk/job.js +1 -1
  100. package/dist/sdk/journey.js +1 -1
  101. package/dist/sdk/llm/chat-cache.js +1 -1
  102. package/dist/sdk/llm/index.js +1 -1
  103. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  104. package/dist/sdk/llm/model-aliases.js +1 -1
  105. package/dist/sdk/llm/model-factors.js +1 -1
  106. package/dist/sdk/query/index.js +1 -1
  107. package/dist/sdk/query/sql-parser.js +1 -1
  108. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  109. package/dist/sdk/segment/fields-display.js +1 -1
  110. package/dist/sdk/segment/file-discovery.js +1 -1
  111. package/dist/sdk/segment/journey-utils.js +1 -1
  112. package/dist/sdk/segment/journey-yaml.js +1 -1
  113. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  114. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  115. package/dist/sdk/segment/pull-workflow.js +1 -1
  116. package/dist/sdk/segment/push-workflow.js +1 -1
  117. package/dist/sdk/segment/resolution-context.js +1 -1
  118. package/dist/sdk/segment/segment-path-parser.js +1 -1
  119. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  120. package/dist/sdk/segment/target-resolution.js +1 -1
  121. package/dist/sdk/segment/tdx-config.js +1 -1
  122. package/dist/sdk/segment/validate-files.js +1 -1
  123. package/dist/sdk/segment/yaml-validator.js +1 -1
  124. package/dist/sdk/segment.js +1 -1
  125. package/dist/sdk/types/index.js +1 -1
  126. package/dist/sdk/types/progress.js +1 -1
  127. package/dist/sdk/user.js +1 -1
  128. package/dist/sdk/util/format-detector.js +1 -1
  129. package/dist/sdk/util/formatters.js +1 -1
  130. package/dist/sdk/util/index.js +1 -1
  131. package/dist/sdk/util/tree-formatter.js +1 -1
  132. package/dist/sdk/workflow/clone-workflow.js +1 -1
  133. package/dist/sdk/workflow/index.js +1 -1
  134. package/dist/sdk/workflow/pull-workflow.js +1 -1
  135. package/dist/sdk/workflow/push-workflow.js +1 -1
  136. package/dist/sdk/workflow/tdx-config.js +1 -1
  137. package/dist/sdk/workflow/workflow-utils.js +1 -1
  138. package/dist/test-utils/command-runner.js +1 -1
  139. package/dist/test-utils/factories.js +1 -1
  140. package/dist/test-utils/fixtures.js +1 -1
  141. package/dist/test-utils/http-mock.js +1 -1
  142. package/dist/test-utils/index.js +1 -1
  143. package/dist/utils/async.js +1 -1
  144. package/dist/utils/colors.js +1 -1
  145. package/dist/utils/diff.js +1 -1
  146. package/dist/utils/file-permissions.js +1 -1
  147. package/dist/utils/global-cache.js +1 -1
  148. package/dist/utils/json-loader.js +1 -1
  149. package/dist/utils/local-cache.js +1 -1
  150. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  151. package/dist/utils/logger/formatters/index.js +1 -1
  152. package/dist/utils/logger/handlers/console-handler.js +1 -1
  153. package/dist/utils/logger/handlers/file-handler.js +1 -1
  154. package/dist/utils/logger/handlers/index.js +1 -1
  155. package/dist/utils/logger/handlers/null-handler.js +1 -1
  156. package/dist/utils/logger/index.js +1 -1
  157. package/dist/utils/logger/logger.js +1 -1
  158. package/dist/utils/logger/types.js +1 -1
  159. package/dist/utils/option-validation.js +1 -1
  160. package/dist/utils/port.js +1 -1
  161. package/dist/utils/process.js +1 -1
  162. package/dist/utils/prompt.js +1 -1
  163. package/dist/utils/spinner.js +1 -1
  164. package/dist/utils/sse-parser.js +1 -1
  165. package/dist/utils/string-utils.js +1 -1
  166. package/dist/utils/table-ref-parser.js +1 -1
  167. package/dist/utils/tdx-logger.js +1 -1
  168. package/dist/utils/version-check.js +1 -1
  169. package/package.json +1 -1
@@ -1 +1 @@
1
- (function(_0x34e484,_0x364859){const _0x4c7991=a106_0xb35d,_0x4b3376=_0x34e484();while(!![]){try{const _0x2d05a7=parseInt(_0x4c7991(0x1d2))/0x1*(-parseInt(_0x4c7991(0x1e3))/0x2)+parseInt(_0x4c7991(0x1c6))/0x3+-parseInt(_0x4c7991(0x1e4))/0x4*(-parseInt(_0x4c7991(0x1c7))/0x5)+-parseInt(_0x4c7991(0x1c3))/0x6+-parseInt(_0x4c7991(0x1d8))/0x7+parseInt(_0x4c7991(0x1cd))/0x8+parseInt(_0x4c7991(0x1d3))/0x9*(parseInt(_0x4c7991(0x1e0))/0xa);if(_0x2d05a7===_0x364859)break;else _0x4b3376['push'](_0x4b3376['shift']());}catch(_0xd878b){_0x4b3376['push'](_0x4b3376['shift']());}}}(a106_0x2634,0x62f2b));import{readFileSync}from'fs';import{createInterface}from'readline';export function stripSqlComments(_0x24b7ce){const _0x4add25=a106_0xb35d;let _0x56b441=_0x24b7ce[_0x4add25(0x1cf)](/\/\*(?:[^*]|\*(?!\/))*\*\//g,'');return _0x56b441=_0x56b441[_0x4add25(0x1cf)](/--.*$/gm,''),_0x56b441[_0x4add25(0x1cc)]();}function isEscaped(_0x292aaf,_0x1c9d19){let _0x5c697d=0x0;for(let _0x28fc07=_0x1c9d19-0x1;_0x28fc07>=0x0&&_0x292aaf[_0x28fc07]==='\x5c';_0x28fc07--){_0x5c697d++;}return _0x5c697d%0x2===0x1;}export function splitSqlStatements(_0x8a42b5){const _0x3a84af=a106_0xb35d,_0x215f58=stripSqlComments(_0x8a42b5);if(!_0x215f58)throw new Error('Content\x20contains\x20no\x20SQL\x20statements');const _0x25ed6d=[];let _0x1ae36d='',_0x5025e0=![],_0x4aad5d=![],_0x35ee69=![];for(let _0x3b13f9=0x0;_0x3b13f9<_0x8a42b5['length'];_0x3b13f9++){const _0x43c5e4=_0x8a42b5[_0x3b13f9];if(_0x43c5e4==='\x27'&&!isEscaped(_0x8a42b5,_0x3b13f9)&&!_0x4aad5d&&!_0x35ee69)_0x5025e0=!_0x5025e0;else{if(_0x43c5e4==='\x22'&&!isEscaped(_0x8a42b5,_0x3b13f9)&&!_0x5025e0&&!_0x35ee69)_0x4aad5d=!_0x4aad5d;else _0x43c5e4==='`'&&!isEscaped(_0x8a42b5,_0x3b13f9)&&!_0x5025e0&&!_0x4aad5d&&(_0x35ee69=!_0x35ee69);}if(_0x43c5e4===';'&&!_0x5025e0&&!_0x4aad5d&&!_0x35ee69){const _0x1b2d0c=_0x1ae36d[_0x3a84af(0x1cc)]();_0x1b2d0c&&_0x25ed6d[_0x3a84af(0x1de)](_0x1b2d0c),_0x1ae36d='';}else _0x1ae36d+=_0x43c5e4;}const _0x2cc033=_0x1ae36d[_0x3a84af(0x1cc)]();_0x2cc033&&_0x25ed6d[_0x3a84af(0x1de)](_0x2cc033);const _0x24d0bb=_0x25ed6d[_0x3a84af(0x1d0)](_0x12663c=>_0x12663c[_0x3a84af(0x1cc)]())[_0x3a84af(0x1c4)](_0x45ec84=>{const _0x52f556=_0x3a84af,_0xc36724=stripSqlComments(_0x45ec84);return _0xc36724[_0x52f556(0x1dc)]>0x0;});if(_0x24d0bb[_0x3a84af(0x1dc)]===0x0)throw new Error(_0x3a84af(0x1c5));return _0x24d0bb;}function a106_0x2634(){const _0x482875=['Content\x20contains\x20no\x20SQL\x20statements','784620BzmOdR','542075SQnYEj','error','message','stdin','Error\x20reading\x20from\x20stdin:\x20','trim','71312wKHRbj','code','replace','map','close','491732Ohhcun','683163NGhrnz','toLowerCase','\x27:\x20','EACCES','No\x20input\x20provided.\x20Pipe\x20SQL\x20to\x20stdin\x20or\x20use\x20a\x20file.\x0aExample:\x20echo\x20\x22SELECT\x201\x22\x20|\x20tdx\x20query\x20-','2474080pdkbVf','Permission\x20denied\x20reading\x20file\x20\x27','isTTY','File\x20\x27','length','test','push','Error\x20reading\x20file\x20\x27','90oViQQm','line','join','2lyGryC','20EeSNTW','1471374KPGURY','filter'];a106_0x2634=function(){return _0x482875;};return a106_0x2634();}export function readFileContent(_0x13c7fa){const _0xade7e3=a106_0xb35d;try{return readFileSync(_0x13c7fa,'utf-8');}catch(_0x5be97c){const _0x36935d=_0x5be97c[_0xade7e3(0x1ce)];if(_0x36935d==='ENOENT')throw new Error(_0xade7e3(0x1db)+_0x13c7fa+'\x27\x20not\x20found');else{if(_0x36935d===_0xade7e3(0x1d6))throw new Error(_0xade7e3(0x1d9)+_0x13c7fa+'\x27');else throw new Error(_0xade7e3(0x1df)+_0x13c7fa+_0xade7e3(0x1d5)+_0x5be97c[_0xade7e3(0x1c9)]);}}}export function readSqlStatementsFromFile(_0x3add90){const _0x321ea8=a106_0xb35d,_0x56e1fb=readFileContent(_0x3add90);try{return splitSqlStatements(_0x56e1fb);}catch(_0x4a73d1){throw new Error('File\x20\x27'+_0x3add90+'\x27\x20'+_0x4a73d1[_0x321ea8(0x1c9)]['toLowerCase']());}}export async function readStdinContent(){const _0x3db313=a106_0xb35d;if(process[_0x3db313(0x1ca)][_0x3db313(0x1da)])throw new Error(_0x3db313(0x1d7));return new Promise((_0x39891e,_0x39582b)=>{const _0x4fe83d=_0x3db313,_0x4ba24b=[],_0x4f9cb9=createInterface({'input':process[_0x4fe83d(0x1ca)],'terminal':![]});_0x4f9cb9['on'](_0x4fe83d(0x1e1),_0x2a1e74=>{_0x4ba24b['push'](_0x2a1e74);}),_0x4f9cb9['on'](_0x4fe83d(0x1d1),()=>{const _0x19af49=_0x4fe83d;_0x39891e(_0x4ba24b[_0x19af49(0x1e2)]('\x0a'));}),_0x4f9cb9['on'](_0x4fe83d(0x1c8),_0x13cf35=>{const _0x52486d=_0x4fe83d;_0x4f9cb9[_0x52486d(0x1d1)](),_0x39582b(new Error(_0x52486d(0x1cb)+_0x13cf35[_0x52486d(0x1c9)]));});});}function a106_0xb35d(_0x1951fa,_0x13d5fd){_0x1951fa=_0x1951fa-0x1c3;const _0x263416=a106_0x2634();let _0xb35ddd=_0x263416[_0x1951fa];return _0xb35ddd;}export async function readSqlStatementsFromStdin(){const _0x41b7ee=a106_0xb35d,_0x30d470=await readStdinContent();try{return splitSqlStatements(_0x30d470);}catch(_0xa040f8){throw new Error('stdin\x20'+_0xa040f8['message'][_0x41b7ee(0x1d4)]());}}export function isSqlFilePath(_0x186472){const _0x45b60f=a106_0xb35d;return/\w\.sql$/[_0x45b60f(0x1dd)](_0x186472);}
1
+ function a106_0x4723(){const _0xb52462=['filter','error','close','push','27766541ZVwxBh','Error\x20reading\x20file\x20\x27','115ytUKbA','isTTY','length','stdin\x20','Content\x20contains\x20no\x20SQL\x20statements','1719302oazilE','line','8470701heDdVY','16CJPEbm','6021120VmHnwW','7378NtahXk','\x27:\x20','No\x20input\x20provided.\x20Pipe\x20SQL\x20to\x20stdin\x20or\x20use\x20a\x20file.\x0aExample:\x20echo\x20\x22SELECT\x201\x22\x20|\x20tdx\x20query\x20-','180396MEZztb','\x27\x20not\x20found','join','8OFilJW','trim','utf-8','Error\x20reading\x20from\x20stdin:\x20','stdin','File\x20\x27','9588pvEwCb','code','message','replace','171732EZySZD','ENOENT'];a106_0x4723=function(){return _0xb52462;};return a106_0x4723();}(function(_0x598d44,_0x4d74d3){const _0x38d50b=a106_0x1e53,_0x596183=_0x598d44();while(!![]){try{const _0x22ea5c=-parseInt(_0x38d50b(0x1f0))/0x1+-parseInt(_0x38d50b(0x1f3))/0x2*(-parseInt(_0x38d50b(0x1f8))/0x3)+parseInt(_0x38d50b(0x1e3))/0x4*(parseInt(_0x38d50b(0x1eb))/0x5)+parseInt(_0x38d50b(0x1df))/0x6*(-parseInt(_0x38d50b(0x1f5))/0x7)+-parseInt(_0x38d50b(0x1fb))/0x8*(-parseInt(_0x38d50b(0x1f2))/0x9)+-parseInt(_0x38d50b(0x1f4))/0xa+parseInt(_0x38d50b(0x1e9))/0xb;if(_0x22ea5c===_0x4d74d3)break;else _0x596183['push'](_0x596183['shift']());}catch(_0x1f7186){_0x596183['push'](_0x596183['shift']());}}}(a106_0x4723,0xe29e5));function a106_0x1e53(_0x1116bb,_0x261830){_0x1116bb=_0x1116bb-0x1df;const _0x47232d=a106_0x4723();let _0x1e538a=_0x47232d[_0x1116bb];return _0x1e538a;}import{readFileSync}from'fs';import{createInterface}from'readline';export function stripSqlComments(_0x160674){const _0x9dc310=a106_0x1e53;let _0x37fc02=_0x160674[_0x9dc310(0x1e2)](/\/\*(?:[^*]|\*(?!\/))*\*\//g,'');return _0x37fc02=_0x37fc02[_0x9dc310(0x1e2)](/--.*$/gm,''),_0x37fc02[_0x9dc310(0x1fc)]();}function isEscaped(_0x3dadc4,_0x5a112a){let _0x34a428=0x0;for(let _0x1b36d5=_0x5a112a-0x1;_0x1b36d5>=0x0&&_0x3dadc4[_0x1b36d5]==='\x5c';_0x1b36d5--){_0x34a428++;}return _0x34a428%0x2===0x1;}export function splitSqlStatements(_0x42ba87){const _0x5190e6=a106_0x1e53,_0x2b07c1=stripSqlComments(_0x42ba87);if(!_0x2b07c1)throw new Error(_0x5190e6(0x1ef));const _0x620b31=[];let _0x2a945f='',_0x3a8d33=![],_0x1988f5=![],_0xf80031=![];for(let _0x175eb8=0x0;_0x175eb8<_0x42ba87[_0x5190e6(0x1ed)];_0x175eb8++){const _0xce198a=_0x42ba87[_0x175eb8];if(_0xce198a==='\x27'&&!isEscaped(_0x42ba87,_0x175eb8)&&!_0x1988f5&&!_0xf80031)_0x3a8d33=!_0x3a8d33;else{if(_0xce198a==='\x22'&&!isEscaped(_0x42ba87,_0x175eb8)&&!_0x3a8d33&&!_0xf80031)_0x1988f5=!_0x1988f5;else _0xce198a==='`'&&!isEscaped(_0x42ba87,_0x175eb8)&&!_0x3a8d33&&!_0x1988f5&&(_0xf80031=!_0xf80031);}if(_0xce198a===';'&&!_0x3a8d33&&!_0x1988f5&&!_0xf80031){const _0x5b479a=_0x2a945f[_0x5190e6(0x1fc)]();_0x5b479a&&_0x620b31[_0x5190e6(0x1e8)](_0x5b479a),_0x2a945f='';}else _0x2a945f+=_0xce198a;}const _0x321b33=_0x2a945f[_0x5190e6(0x1fc)]();_0x321b33&&_0x620b31[_0x5190e6(0x1e8)](_0x321b33);const _0x1ce750=_0x620b31['map'](_0x13d7c6=>_0x13d7c6['trim']())[_0x5190e6(0x1e5)](_0x660c24=>{const _0x11346a=_0x5190e6,_0x184e61=stripSqlComments(_0x660c24);return _0x184e61[_0x11346a(0x1ed)]>0x0;});if(_0x1ce750[_0x5190e6(0x1ed)]===0x0)throw new Error(_0x5190e6(0x1ef));return _0x1ce750;}export function readFileContent(_0x38e6dc){const _0x558ab4=a106_0x1e53;try{return readFileSync(_0x38e6dc,_0x558ab4(0x1fd));}catch(_0x303690){const _0x1316ae=_0x303690[_0x558ab4(0x1e0)];if(_0x1316ae===_0x558ab4(0x1e4))throw new Error(_0x558ab4(0x200)+_0x38e6dc+_0x558ab4(0x1f9));else{if(_0x1316ae==='EACCES')throw new Error('Permission\x20denied\x20reading\x20file\x20\x27'+_0x38e6dc+'\x27');else throw new Error(_0x558ab4(0x1ea)+_0x38e6dc+_0x558ab4(0x1f6)+_0x303690[_0x558ab4(0x1e1)]);}}}export function readSqlStatementsFromFile(_0x51ba02){const _0x37123e=a106_0x1e53,_0x59aae6=readFileContent(_0x51ba02);try{return splitSqlStatements(_0x59aae6);}catch(_0x2c49f1){throw new Error(_0x37123e(0x200)+_0x51ba02+'\x27\x20'+_0x2c49f1[_0x37123e(0x1e1)]['toLowerCase']());}}export async function readStdinContent(){const _0x3c2dab=a106_0x1e53;if(process[_0x3c2dab(0x1ff)][_0x3c2dab(0x1ec)])throw new Error(_0x3c2dab(0x1f7));return new Promise((_0x2798cf,_0x3161f5)=>{const _0x51d7fc=_0x3c2dab,_0x18de72=[],_0x362031=createInterface({'input':process[_0x51d7fc(0x1ff)],'terminal':![]});_0x362031['on'](_0x51d7fc(0x1f1),_0x6b1c70=>{_0x18de72['push'](_0x6b1c70);}),_0x362031['on'](_0x51d7fc(0x1e7),()=>{const _0x2e5ea2=_0x51d7fc;_0x2798cf(_0x18de72[_0x2e5ea2(0x1fa)]('\x0a'));}),_0x362031['on'](_0x51d7fc(0x1e6),_0x48cc55=>{const _0x1e4b78=_0x51d7fc;_0x362031['close'](),_0x3161f5(new Error(_0x1e4b78(0x1fe)+_0x48cc55[_0x1e4b78(0x1e1)]));});});}export async function readSqlStatementsFromStdin(){const _0xc016ca=a106_0x1e53,_0x520405=await readStdinContent();try{return splitSqlStatements(_0x520405);}catch(_0x3150ec){throw new Error(_0xc016ca(0x1ee)+_0x3150ec[_0xc016ca(0x1e1)]['toLowerCase']());}}export function isSqlFilePath(_0x2e59b4){return/\w\.sql$/['test'](_0x2e59b4);}
@@ -1 +1 @@
1
- const a107_0x34f8a1=a107_0x1e3a;(function(_0x3101a3,_0x1f1747){const _0x5d57ff=a107_0x1e3a,_0x3c4b85=_0x3101a3();while(!![]){try{const _0x275800=parseInt(_0x5d57ff(0xdd))/0x1+parseInt(_0x5d57ff(0xc0))/0x2*(-parseInt(_0x5d57ff(0xc1))/0x3)+parseInt(_0x5d57ff(0xbe))/0x4*(parseInt(_0x5d57ff(0x105))/0x5)+-parseInt(_0x5d57ff(0xfe))/0x6+-parseInt(_0x5d57ff(0xb4))/0x7*(-parseInt(_0x5d57ff(0xfb))/0x8)+parseInt(_0x5d57ff(0xd7))/0x9*(-parseInt(_0x5d57ff(0xb0))/0xa)+-parseInt(_0x5d57ff(0xd5))/0xb*(-parseInt(_0x5d57ff(0x134))/0xc);if(_0x275800===_0x1f1747)break;else _0x3c4b85['push'](_0x3c4b85['shift']());}catch(_0x46201f){_0x3c4b85['push'](_0x3c4b85['shift']());}}}(a107_0x7574,0xd79b6));import*as a107_0x3880ff from'yaml';import{SDKError,ErrorCode}from'../errors.js';import{validateConnectorConfig,transformConfigToLegacy,normalizeConnectorConfigForYaml,formatValidationErrors,formatValidationWarnings,formatSchemaAsHelp}from'../connection-validator.js';export function segmentResponseToDefSync(_0x391965,_0x938d75){const _0x557d98=a107_0x1e3a,_0x5367ee=_0x391965[_0x557d98(0xda)]&&_0x557d98(0x124)in _0x391965['rule']&&_0x391965[_0x557d98(0xda)][_0x557d98(0x124)];return{'type':_0x557d98(0x12b),'name':_0x391965[_0x557d98(0xea)],..._0x391965[_0x557d98(0xf6)]&&{'description':_0x391965[_0x557d98(0xf6)]},..._0x938d75&&{'folder':_0x938d75},..._0x5367ee&&{'rule':apiRuleToYaml(_0x391965[_0x557d98(0xda)])},..._0x391965[_0x557d98(0xcd)]!==undefined&&{'kind':_0x391965[_0x557d98(0xcd)]===0x0?_0x557d98(0xb5):_0x391965['kind']===0x1?'realtime':_0x557d98(0xc8)},..._0x391965['isVisible']!==undefined&&{'visible':_0x391965[_0x557d98(0x130)]}};}export async function segmentResponseToDef(_0x4c18d4,_0x4ecfa6,_0x4c0193){const _0x2bad0a=a107_0x1e3a,_0x41ad8d=segmentResponseToDefSync(_0x4c18d4,_0x4c0193);if(!_0x4ecfa6||!_0x4ecfa6[_0x2bad0a(0xbd)])return _0x41ad8d;return _0x41ad8d[_0x2bad0a(0xda)]&&(_0x41ad8d['rule']=await resolveRuleSegmentRefs(_0x41ad8d[_0x2bad0a(0xda)],_0x4ecfa6[_0x2bad0a(0xbd)])),_0x41ad8d;}export function apiRuleToYaml(_0x21c0da){const _0x1d4ae1=a107_0x1e3a,_0x3c9abb=(_0x21c0da[_0x1d4ae1(0x110)]||[])[_0x1d4ae1(0xb3)](apiConditionToYaml);if(_0x3c9abb['length']===0x1&&!_0x21c0da['description']&&_0x1d4ae1(0x124)in _0x3c9abb[0x0]&&(_0x3c9abb[0x0][_0x1d4ae1(0x124)]===_0x1d4ae1(0xc2)||_0x3c9abb[0x0]['type']==='Or')){const _0x1e12cd=_0x3c9abb[0x0];if(_0x1e12cd[_0x1d4ae1(0x124)]===_0x21c0da[_0x1d4ae1(0x124)]&&_0x1e12cd[_0x1d4ae1(0x110)])return{'type':_0x21c0da[_0x1d4ae1(0x124)],'conditions':_0x1e12cd[_0x1d4ae1(0x110)],..._0x1e12cd[_0x1d4ae1(0xf6)]&&{'description':_0x1e12cd[_0x1d4ae1(0xf6)]}};}return{'type':_0x21c0da[_0x1d4ae1(0x124)],'conditions':_0x3c9abb,..._0x21c0da['description']&&{'description':_0x21c0da['description']}};}export async function resolveRuleSegmentRefs(_0x1752c3,_0x2d9513){const _0x31588c=a107_0x1e3a,_0x1da0ae=await Promise[_0x31588c(0xee)](_0x1752c3['conditions'][_0x31588c(0xb3)](_0x548742=>resolveConditionSegmentRefs(_0x548742,_0x2d9513)));return{..._0x1752c3,'conditions':_0x1da0ae};}async function resolveConditionSegmentRefs(_0x44b0a0,_0x2ef263){const _0x51622e=a107_0x1e3a;if('segment'in _0x44b0a0&&(_0x44b0a0[_0x51622e(0x124)]===_0x51622e(0x12f)||_0x44b0a0[_0x51622e(0x124)]===_0x51622e(0x133))){const _0x3736cd=_0x44b0a0;if(/^\d+$/[_0x51622e(0xd4)](_0x3736cd[_0x51622e(0x12b)])){const _0x2d0871=await _0x2ef263(_0x3736cd[_0x51622e(0x12b)]);return{..._0x3736cd,'segment':_0x2d0871};}return _0x44b0a0;}if(_0x51622e(0x110)in _0x44b0a0&&_0x44b0a0[_0x51622e(0x110)]){const _0x453abb=_0x44b0a0,_0xa7ae73=await Promise[_0x51622e(0xee)](_0x453abb[_0x51622e(0x110)][_0x51622e(0xb3)](_0x2cc8c0=>resolveConditionSegmentRefs(_0x2cc8c0,_0x2ef263)));return{..._0x453abb,'conditions':_0xa7ae73};}if(_0x51622e(0xd2)in _0x44b0a0&&_0x44b0a0['filter']){const _0x16e3cd=_0x44b0a0,_0x145d14=await resolveRuleSegmentRefs(_0x16e3cd[_0x51622e(0xd2)],_0x2ef263);return{..._0x16e3cd,'filter':_0x145d14};}return _0x44b0a0;}export async function resolveRuleSegmentIds(_0x29308f,_0x1747e3){const _0x32825a=a107_0x1e3a,_0x31e654=await Promise[_0x32825a(0xee)](_0x29308f[_0x32825a(0x110)][_0x32825a(0xb3)](_0x1d7ccf=>resolveConditionSegmentIds(_0x1d7ccf,_0x1747e3)));return{..._0x29308f,'conditions':_0x31e654};}async function resolveConditionSegmentIds(_0x4670c8,_0x776b7c){const _0x23eaa1=a107_0x1e3a;if(_0x23eaa1(0x12b)in _0x4670c8&&(_0x4670c8[_0x23eaa1(0x124)]==='include'||_0x4670c8[_0x23eaa1(0x124)]==='exclude')){const _0x1273b4=_0x4670c8;if(!/^\d+$/[_0x23eaa1(0xd4)](_0x1273b4['segment'])){const _0x4d668c=await _0x776b7c(_0x1273b4[_0x23eaa1(0x12b)]);return{..._0x1273b4,'segment':_0x4d668c};}return _0x4670c8;}if('conditions'in _0x4670c8&&_0x4670c8[_0x23eaa1(0x110)]){const _0x124821=_0x4670c8,_0x4234d8=await Promise[_0x23eaa1(0xee)](_0x124821['conditions'][_0x23eaa1(0xb3)](_0x3fb547=>resolveConditionSegmentIds(_0x3fb547,_0x776b7c)));return{..._0x124821,'conditions':_0x4234d8};}if(_0x23eaa1(0xd2)in _0x4670c8&&_0x4670c8['filter']){const _0x43132d=_0x4670c8,_0x51104b=await resolveRuleSegmentIds(_0x43132d['filter'],_0x776b7c);return{..._0x43132d,'filter':_0x51104b};}return _0x4670c8;}function apiConditionToYaml(_0x3621a8){const _0x15b88c=a107_0x1e3a;if(_0x3621a8[_0x15b88c(0x124)]===_0x15b88c(0xc2)||_0x3621a8[_0x15b88c(0x124)]==='Or'){if(_0x3621a8[_0x15b88c(0x110)]){const _0x23e096=_0x3621a8['conditions'][_0x15b88c(0xb3)](apiConditionToYaml);if(_0x23e096[_0x15b88c(0x10b)]===0x1&&!_0x3621a8['description'])return _0x23e096[0x0];return{'type':_0x3621a8[_0x15b88c(0x124)],'conditions':_0x23e096,..._0x3621a8[_0x15b88c(0xf6)]&&{'description':_0x3621a8['description']}};}}if(_0x3621a8[_0x15b88c(0x124)]===_0x15b88c(0xef)&&_0x3621a8[_0x15b88c(0xed)]&&_0x3621a8[_0x15b88c(0xe2)]){const _0x4f8530=_0x3621a8['leftValue'][_0x15b88c(0x137)]?{'type':_0x3621a8[_0x15b88c(0xed)][_0x15b88c(0x137)][_0x15b88c(0x124)],..._0x3621a8[_0x15b88c(0xed)][_0x15b88c(0x137)]['groupingColumns']&&{'groupingColumns':_0x3621a8[_0x15b88c(0xed)]['aggregation']['groupingColumns']}}:undefined;return{'type':_0x15b88c(0xef),'attribute':_0x3621a8['leftValue']['name']||'','operator':apiOperatorToYaml(_0x3621a8[_0x15b88c(0xe2)]),..._0x3621a8[_0x15b88c(0xb6)]&&_0x3621a8['arrayMatching']!==_0x15b88c(0x112)?{'arrayMatching':_0x3621a8[_0x15b88c(0xb6)]}:{},..._0x3621a8[_0x15b88c(0x133)]?{'exclude':_0x3621a8[_0x15b88c(0x133)]}:{},..._0x4f8530?{'aggregation':_0x4f8530}:{},..._0x3621a8[_0x15b88c(0xed)]['source']?{'source':_0x3621a8['leftValue']['source'][_0x15b88c(0xea)]}:{},..._0x3621a8[_0x15b88c(0xed)][_0x15b88c(0xd2)]?{'filter':apiRuleToYaml(_0x3621a8[_0x15b88c(0xed)]['filter'])}:{},..._0x3621a8[_0x15b88c(0xf4)]!==undefined&&_0x3621a8[_0x15b88c(0xf4)]!==null?{'limit':_0x3621a8[_0x15b88c(0xf4)]}:{}};}if(_0x3621a8[_0x15b88c(0x124)]===_0x15b88c(0x120)&&_0x3621a8['id'])return{'type':_0x3621a8[_0x15b88c(0x133)]?_0x15b88c(0x133):_0x15b88c(0x12f),'segment':_0x3621a8['id']};return{'type':_0x15b88c(0xc2),'conditions':[]};}function isTemporalOperator(_0x22369b){const _0x46d78c=a107_0x1e3a;return _0x22369b===_0x46d78c(0xe5)||_0x22369b===_0x46d78c(0xd1);}function getEffectiveValue(_0x1469e4){const _0x5a351e=a107_0x1e3a,_0x16b123=_0x1469e4[_0x5a351e(0x113)];return _0x1469e4['value']??_0x16b123;}function apiOperatorToYaml(_0x40ddd3){const _0x4487fc=a107_0x1e3a;let _0x3fe893;if(_0x40ddd3[_0x4487fc(0x12d)]&&_0x40ddd3['rightValues']['length']>0x0)_0x3fe893=_0x40ddd3[_0x4487fc(0x12d)];else{if(_0x40ddd3['rightValue']!==undefined)_0x3fe893=_0x40ddd3[_0x4487fc(0x100)];else isTemporalOperator(_0x40ddd3['type'])&&_0x40ddd3[_0x4487fc(0xe3)]!==undefined&&(_0x3fe893=_0x40ddd3[_0x4487fc(0xe3)]);}return{'type':mapApiOperatorType(_0x40ddd3[_0x4487fc(0x124)]),..._0x40ddd3[_0x4487fc(0x10e)]&&{'not':_0x40ddd3[_0x4487fc(0x10e)]},..._0x3fe893!==undefined&&{'value':_0x3fe893},..._0x40ddd3[_0x4487fc(0xc7)]&&{'unit':_0x40ddd3[_0x4487fc(0xc7)]}};}function mapApiOperatorType(_0x4d9870){return _0x4d9870;}export function segmentDefToCreateRequest(_0x4d5877,_0x43a842){const _0x4081fd=a107_0x1e3a,_0x5d7727={'name':_0x4d5877[_0x4081fd(0xea)]};return _0x4d5877[_0x4081fd(0xf6)]&&(_0x5d7727[_0x4081fd(0xf6)]=_0x4d5877[_0x4081fd(0xf6)]),_0x4d5877[_0x4081fd(0xda)]&&(_0x5d7727['rule']=yamlRuleToApi(_0x4d5877[_0x4081fd(0xda)])),_0x4d5877[_0x4081fd(0xcd)]&&(_0x5d7727[_0x4081fd(0xcd)]=_0x4d5877[_0x4081fd(0xcd)]==='batch'?0x0:_0x4d5877[_0x4081fd(0xcd)]==='realtime'?0x1:0x2),_0x4d5877['visible']!==undefined&&(_0x5d7727[_0x4081fd(0x130)]=_0x4d5877[_0x4081fd(0x11a)]),_0x43a842&&(_0x5d7727[_0x4081fd(0xe4)]=_0x43a842),_0x5d7727;}export function segmentDefToUpdateRequest(_0x537e40){const _0x31bd71=a107_0x1e3a,_0x8ceb4e={'name':_0x537e40[_0x31bd71(0xea)]};return _0x537e40['description']!==undefined&&(_0x8ceb4e[_0x31bd71(0xf6)]=_0x537e40['description']),_0x537e40[_0x31bd71(0xda)]&&(_0x8ceb4e['rule']=yamlRuleToApi(_0x537e40[_0x31bd71(0xda)])),_0x537e40[_0x31bd71(0xcd)]&&(_0x8ceb4e[_0x31bd71(0xcd)]=_0x537e40[_0x31bd71(0xcd)]==='batch'?0x0:_0x537e40['kind']===_0x31bd71(0xae)?0x1:0x2),_0x8ceb4e;}export function yamlRuleToApi(_0xe679bc,_0x43f34a=![]){const _0x1666ab=a107_0x1e3a,_0x59a2bb=_0xe679bc[_0x1666ab(0x110)][_0x1666ab(0xb3)](yamlConditionToApi);if(_0x43f34a){const _0x3a8735=_0x59a2bb[_0x1666ab(0xd0)](_0x5d5120=>_0x5d5120[_0x1666ab(0x124)]===_0x1666ab(0xc2)||_0x5d5120[_0x1666ab(0x124)]==='Or');if(!_0x3a8735&&_0x59a2bb['length']>0x0)return{'type':_0xe679bc[_0x1666ab(0x124)],'conditions':[{'type':_0x1666ab(0xc2),'description':_0xe679bc[_0x1666ab(0xf6)]||'','conditions':_0x59a2bb}]};}return{'type':_0xe679bc[_0x1666ab(0x124)],'conditions':_0x59a2bb,..._0xe679bc[_0x1666ab(0xf6)]&&{'description':_0xe679bc[_0x1666ab(0xf6)]}};}function yamlConditionToApi(_0x5882d9){const _0x329506=a107_0x1e3a;if('segment'in _0x5882d9&&(_0x5882d9[_0x329506(0x124)]==='include'||_0x5882d9[_0x329506(0x124)]===_0x329506(0x133))){const _0x1afe84=_0x5882d9;return{'type':_0x329506(0x120),'id':_0x1afe84[_0x329506(0x12b)],'exclude':_0x1afe84[_0x329506(0x124)]===_0x329506(0x133)};}if('type'in _0x5882d9&&(_0x5882d9[_0x329506(0x124)]===_0x329506(0xc2)||_0x5882d9[_0x329506(0x124)]==='Or')){const _0x2c0aa2=_0x5882d9;return{'type':_0x2c0aa2[_0x329506(0x124)],'conditions':_0x2c0aa2[_0x329506(0x110)][_0x329506(0xb3)](yamlConditionToApi),..._0x2c0aa2[_0x329506(0xf6)]&&{'description':_0x2c0aa2['description']}};}const _0x1e4206=_0x5882d9,_0x1370e5={'type':_0x329506(0xef),'leftValue':buildLeftValue(_0x1e4206),'operator':yamlOperatorToApi(_0x1e4206[_0x329506(0xe2)]),'exclude':_0x1e4206[_0x329506(0x133)]??![],'arrayMatching':_0x1e4206[_0x329506(0xb6)]??_0x329506(0x112)};return _0x1e4206[_0x329506(0xf4)]!==undefined&&(_0x1370e5['limit']=_0x1e4206[_0x329506(0xf4)]),_0x1370e5;}function buildLeftValue(_0x5391c7){const _0x5bf90d=a107_0x1e3a,_0x4bc8fe={'name':_0x5391c7[_0x5bf90d(0xf8)]};return _0x5391c7[_0x5bf90d(0x137)]&&(_0x4bc8fe[_0x5bf90d(0x137)]={'type':_0x5391c7[_0x5bf90d(0x137)]['type'],..._0x5391c7[_0x5bf90d(0x137)][_0x5bf90d(0xcf)]&&{'groupingColumns':_0x5391c7['aggregation'][_0x5bf90d(0xcf)]}}),_0x5391c7[_0x5bf90d(0xfc)]&&(_0x4bc8fe[_0x5bf90d(0xfc)]={'name':_0x5391c7[_0x5bf90d(0xfc)]}),_0x5391c7['filter']&&(_0x4bc8fe[_0x5bf90d(0xd2)]=yamlRuleToApi(_0x5391c7[_0x5bf90d(0xd2)])),_0x4bc8fe;}function yamlOperatorToApi(_0x522752){const _0x4ab708=a107_0x1e3a,_0x2a6470={'type':mapYamlOperatorType(_0x522752['type']),'not':_0x522752[_0x4ab708(0x10e)]??![]},_0x376d05=getEffectiveValue(_0x522752);if(_0x376d05!==undefined){if(Array[_0x4ab708(0x126)](_0x376d05))_0x2a6470[_0x4ab708(0x12d)]=_0x376d05;else isTemporalOperator(_0x522752[_0x4ab708(0x124)])?_0x2a6470[_0x4ab708(0xe3)]=_0x376d05:_0x2a6470[_0x4ab708(0x100)]=_0x376d05;}return _0x522752['unit']&&(_0x2a6470[_0x4ab708(0xc7)]=_0x522752[_0x4ab708(0xc7)]),_0x2a6470;}function mapYamlOperatorType(_0x57c680){return _0x57c680;}export function toYamlString(_0x1233d7){const _0x33e9d1=a107_0x1e3a,_0x179a0a=JSON[_0x33e9d1(0x127)](JSON[_0x33e9d1(0xe7)](_0x1233d7)),_0xf4285f=a107_0x3880ff[_0x33e9d1(0xe7)](_0x179a0a,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x33e9d1(0x118)}),_0x5655df=[_0x33e9d1(0xb7)];let _0x1b1d57=_0xf4285f;for(const _0x1dea68 of _0x5655df){_0x1b1d57=_0x1b1d57['replace'](new RegExp('^('+_0x1dea68+')','m'),(_0x4fcea2,_0x53139e,_0x38428b)=>{if(_0x38428b===0x0||_0x1b1d57[_0x38428b-0x1]==='\x0a'&&_0x1b1d57[_0x38428b-0x2]==='\x0a')return _0x53139e;return'\x0a'+_0x53139e;});}return _0x1b1d57;}export function parseYamlString(_0x161426){const _0x58ba95=a107_0x1e3a,_0x5e0e35=a107_0x3880ff[_0x58ba95(0x127)](_0x161426);if(!_0x5e0e35[_0x58ba95(0xea)])throw new Error(_0x58ba95(0xc9));if(_0x5e0e35['type']&&_0x5e0e35[_0x58ba95(0x124)]!==_0x58ba95(0x12b))throw new Error(_0x58ba95(0x106)+_0x5e0e35[_0x58ba95(0x124)]);return _0x5e0e35;}export function isSegmentYaml(_0x3e54af){const _0x2de34c=a107_0x1e3a;if(typeof _0x3e54af!==_0x2de34c(0xc4)||_0x3e54af===null)return![];const _0x3f92cb=_0x3e54af;return _0x3f92cb[_0x2de34c(0x124)]==='segment'||_0x3f92cb[_0x2de34c(0x124)]===undefined;}export function generateTemplate(_0x3cf5ed=a107_0x34f8a1(0x119)){const _0x3df1e5=a107_0x34f8a1,_0x58b5fe={'type':_0x3df1e5(0x12b),'name':_0x3cf5ed,'description':'Segment\x20description','rule':{'type':'And','conditions':[{'type':_0x3df1e5(0xef),'attribute':_0x3df1e5(0xaa),'operator':{'type':_0x3df1e5(0x12e),'value':_0x3df1e5(0xe3)}}]}};return toYamlString(_0x58b5fe);}export function segmentToYamlString(_0x40b55f){const _0x2c674c=a107_0x34f8a1,_0x1ccf23=JSON[_0x2c674c(0x127)](JSON[_0x2c674c(0xe7)](_0x40b55f)),_0xd7c9b1=a107_0x3880ff[_0x2c674c(0xe7)](_0x1ccf23,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x2c674c(0x118)}),_0x15ee1a=['rule:',_0x2c674c(0xff)];let _0x5aed93=_0xd7c9b1;for(const _0x842df4 of _0x15ee1a){_0x5aed93=_0x5aed93[_0x2c674c(0x12a)](new RegExp('^('+_0x842df4+')','m'),(_0x32bd89,_0x4b4fa7,_0x8a8ae6)=>{if(_0x8a8ae6===0x0||_0x5aed93[_0x8a8ae6-0x1]==='\x0a'&&_0x5aed93[_0x8a8ae6-0x2]==='\x0a')return _0x4b4fa7;return'\x0a'+_0x4b4fa7;});}return _0x5aed93;}export function parseSegmentYamlFile(_0xedb383){const _0x468bca=a107_0x34f8a1,_0x3ea484=a107_0x3880ff['parse'](_0xedb383);if(!_0x3ea484[_0x468bca(0xea)])throw new Error('YAML\x20config\x20missing\x20required\x20field:\x20name');return _0x3ea484;}export function normalizeChildSegmentYaml(_0x57dc05){const _0x10cc2b=a107_0x34f8a1;return{'type':'segment','name':_0x57dc05[_0x10cc2b(0xea)],..._0x57dc05['description']!==undefined&&{'description':_0x57dc05[_0x10cc2b(0xf6)]},..._0x57dc05[_0x10cc2b(0x129)]!==undefined&&{'folder':_0x57dc05[_0x10cc2b(0x129)]},..._0x57dc05[_0x10cc2b(0xda)]&&{'rule':normalizeRule(_0x57dc05[_0x10cc2b(0xda)])},..._0x57dc05[_0x10cc2b(0xcd)]!==undefined&&{'kind':_0x57dc05[_0x10cc2b(0xcd)]},..._0x57dc05['visible']!==undefined&&{'visible':_0x57dc05[_0x10cc2b(0x11a)]},..._0x57dc05[_0x10cc2b(0xa9)]&&{'activations':_0x57dc05[_0x10cc2b(0xa9)][_0x10cc2b(0xb3)](normalizeActivation)}};}export function normalizeRule(_0x4206f6){const _0xf6a359=a107_0x34f8a1;return{'type':_0x4206f6[_0xf6a359(0x124)],'conditions':_0x4206f6[_0xf6a359(0x110)][_0xf6a359(0xb3)](normalizeCondition),..._0x4206f6[_0xf6a359(0xf6)]!==undefined&&{'description':_0x4206f6[_0xf6a359(0xf6)]}};}function normalizeCondition(_0x177016){const _0x1f726b=a107_0x34f8a1;if(_0x1f726b(0x12b)in _0x177016&&(_0x177016[_0x1f726b(0x124)]==='include'||_0x177016[_0x1f726b(0x124)]===_0x1f726b(0x133))){const _0x75579e=_0x177016;return{'type':_0x75579e['type'],'segment':_0x75579e[_0x1f726b(0x12b)]};}if(_0x1f726b(0x124)in _0x177016&&(_0x177016['type']===_0x1f726b(0xc2)||_0x177016[_0x1f726b(0x124)]==='Or')){const _0x4b9df4=_0x177016;return{'type':_0x4b9df4['type'],'conditions':_0x4b9df4[_0x1f726b(0x110)][_0x1f726b(0xb3)](normalizeCondition),..._0x4b9df4[_0x1f726b(0xf6)]!==undefined&&{'description':_0x4b9df4[_0x1f726b(0xf6)]}};}const _0x4d6c74=_0x177016;return{'type':_0x1f726b(0xef),'attribute':_0x4d6c74['attribute'],'operator':normalizeOperator(_0x4d6c74[_0x1f726b(0xe2)]),..._0x4d6c74['arrayMatching']!==undefined&&{'arrayMatching':_0x4d6c74[_0x1f726b(0xb6)]},..._0x4d6c74['exclude']!==undefined&&{'exclude':_0x4d6c74[_0x1f726b(0x133)]},..._0x4d6c74[_0x1f726b(0x137)]!==undefined&&{'aggregation':_0x4d6c74[_0x1f726b(0x137)]},..._0x4d6c74['source']!==undefined&&{'source':_0x4d6c74[_0x1f726b(0xfc)]},..._0x4d6c74[_0x1f726b(0xd2)]!==undefined&&{'filter':normalizeRule(_0x4d6c74[_0x1f726b(0xd2)])},..._0x4d6c74[_0x1f726b(0xf4)]!==undefined&&{'limit':_0x4d6c74[_0x1f726b(0xf4)]}};}function normalizeOperator(_0x353ed0){const _0x43135f=a107_0x34f8a1,_0x2d3c79=getEffectiveValue(_0x353ed0);return{'type':_0x353ed0['type'],..._0x353ed0['not']!==undefined&&{'not':_0x353ed0['not']},..._0x2d3c79!==undefined&&{'value':_0x2d3c79},..._0x353ed0[_0x43135f(0x12c)]!==undefined&&{'min':_0x353ed0[_0x43135f(0x12c)]},..._0x353ed0[_0x43135f(0xb2)]!==undefined&&{'max':_0x353ed0[_0x43135f(0xb2)]},..._0x353ed0[_0x43135f(0xc7)]!==undefined&&{'unit':_0x353ed0[_0x43135f(0xc7)]},..._0x353ed0['duration']!==undefined&&{'duration':_0x353ed0[_0x43135f(0x109)]},..._0x353ed0[_0x43135f(0xe6)]!==undefined&&{'from':_0x353ed0[_0x43135f(0xe6)]}};}function a107_0x7574(){const _0x59ef93=['\x22:\x0a','realtime','scheduleType','10nkhZDb','has','max','map','14yxczrE','batch','arrayMatching','rule:','INVALID_ARGUMENT','all_columns','orderBy','allColumns','\x27:\x20','resolveSegmentName','181060JdIUMh','start_at','460RfXLBG','2553WDDVJp','And','join_row','object','emailToIdMap','behavior','unit','funnel_stage','YAML\x20config\x20missing\x20required\x20field:\x20name','warnings','connector_config\x20for\x20activation\x20\x22','repeatSubFrequency','kind','notification','groupingColumns','every','TimeWithinNext','filter','Invalid\x20connector_config\x20for\x20activation\x20\x22','test','110qcuBRY','joinRow','10824687STbPTy','activationParams','conditions[','rule','localRuleToName','add','1523996hZpYVD','activationTemplateId','join_strategy','Connector:\x20','visibility','operator','value','segmentFolderId','TimeWithinPast','from','stringify','string','connector_config','name','schedule','connectionNameToTypeMap','leftValue','all','Value','keys','CONNECTOR_SCHEMA_NOT_FOUND','end_on','repeat_sub_frequency','limit','Use\x20\x27tdx\x20connections\x27\x20to\x20list\x20available\x20connections','description','Please\x20specify\x20a\x20valid\x20attribute\x20name.','attribute','notifyOn','formatting','3919808YXJpZN','source','valid','3100344wfxRCJ','activations:','rightValue','forEach','connectionNameToIdMap','connection','CONNECTOR_INVALID_CONFIG','25NOEQXu','YAML\x20type\x20must\x20be\x20\x27segment\x27\x20or\x20omitted,\x20got:\x20','behaviorTableName','localeCompare','duration','joinStrategy','length','repeat_unit','repeatFrequency','not','connectorConfig','conditions','attributes','any','values','endOn','set','code','notify_on','null','New\x20Segment','visible','emailRecipients','repeat_frequency','email_recipients','timezone','connectionId','Reference','usedNames','sort','get','type','order_by','isArray','parse','syndicationBehavior','folder','replace','segment','min','rightValues','Equal','include','isVisible','warn','columns','exclude','81660SQSaDO','repeatUnit','startAt','aggregation','activation_template_id','CONNECTION_NOT_FOUND','activations','attribute_name','ruleHashToName','behavior_table'];a107_0x7574=function(){return _0x59ef93;};return a107_0x7574();}function normalizeActivation(_0x5877cd){const _0x32873c=a107_0x34f8a1;return{'name':_0x5877cd[_0x32873c(0xea)],'connection':_0x5877cd[_0x32873c(0x103)],..._0x5877cd[_0x32873c(0xf6)]!==undefined&&{'description':_0x5877cd[_0x32873c(0xf6)]},..._0x5877cd[_0x32873c(0xb9)]!==undefined&&{'all_columns':_0x5877cd[_0x32873c(0xb9)]},..._0x5877cd[_0x32873c(0x132)]!==undefined&&{'columns':_0x5877cd[_0x32873c(0x132)]},..._0x5877cd[_0x32873c(0xc6)]!==undefined&&{'behavior':_0x5877cd[_0x32873c(0xc6)]},..._0x5877cd[_0x32873c(0xeb)]!==undefined&&{'schedule':_0x5877cd[_0x32873c(0xeb)]},..._0x5877cd[_0x32873c(0xce)]!==undefined&&{'notification':_0x5877cd['notification']},..._0x5877cd[_0x32873c(0xe9)]!==undefined&&{'connector_config':_0x5877cd[_0x32873c(0xe9)]},..._0x5877cd[_0x32873c(0xa7)]!==undefined&&{'activation_template_id':_0x5877cd[_0x32873c(0xa7)]}};}export function activationResponseToDef(_0x3c8677,_0x2c28b7,_0x4910ad){const _0xb9d76c=a107_0x34f8a1,_0x4d62c6=_0x3c8677['connectionId']||'',_0x2d43c6=_0x4910ad?.[_0xb9d76c(0x123)](_0x4d62c6)??_0x4d62c6,_0xcf1952={'name':_0x3c8677[_0xb9d76c(0xea)],'connection':_0x2d43c6};_0x3c8677[_0xb9d76c(0xf6)]&&(_0xcf1952['description']=_0x3c8677[_0xb9d76c(0xf6)]);let _0x4cd5b7=[];_0x3c8677[_0xb9d76c(0x132)]&&_0x3c8677[_0xb9d76c(0x132)][_0xb9d76c(0x10b)]>0x0&&(_0x4cd5b7=_0x3c8677[_0xb9d76c(0x132)][_0xb9d76c(0xd2)](_0x596a24=>_0x596a24&&_0x596a24[_0xb9d76c(0xea)])[_0xb9d76c(0xb3)](_0x43f070=>{const _0x5646d1=_0xb9d76c;if(_0x43f070['type']||_0x43f070['visibility'])return{'name':_0x43f070['name'],..._0x43f070[_0x5646d1(0x124)]&&{'type':_0x43f070[_0x5646d1(0x124)]},..._0x43f070[_0x5646d1(0xe1)]&&{'visibility':_0x43f070[_0x5646d1(0xe1)]}};return _0x43f070[_0x5646d1(0xea)];}));_0x4cd5b7[_0xb9d76c(0x10b)]>0x0&&(_0xcf1952[_0xb9d76c(0x132)]=_0x4cd5b7);_0x3c8677[_0xb9d76c(0xbb)]!==undefined&&(_0x3c8677[_0xb9d76c(0xbb)]===![]&&_0x4cd5b7[_0xb9d76c(0x10b)]===0x0?_0xcf1952[_0xb9d76c(0xb9)]=!![]:_0xcf1952['all_columns']=_0x3c8677[_0xb9d76c(0xbb)]);const _0x1b1107={};let _0x1c01e9=![];_0x3c8677['scheduleType']&&(_0x1b1107['type']=_0x3c8677[_0xb9d76c(0xaf)],_0x1c01e9=!![]);_0x3c8677['repeatUnit']&&(_0x1b1107['repeat_unit']=_0x3c8677[_0xb9d76c(0x135)],_0x1c01e9=!![]);_0x3c8677[_0xb9d76c(0x10d)]!==undefined&&_0x3c8677[_0xb9d76c(0x10d)]!==null&&(_0x1b1107[_0xb9d76c(0x11c)]=_0x3c8677[_0xb9d76c(0x10d)],_0x1c01e9=!![]);_0x3c8677[_0xb9d76c(0xcc)]&&_0x3c8677[_0xb9d76c(0xcc)][_0xb9d76c(0x10b)]>0x0&&(_0x1b1107[_0xb9d76c(0xf3)]=_0x3c8677[_0xb9d76c(0xcc)],_0x1c01e9=!![]);_0x3c8677['startAt']!==undefined&&(_0x1b1107[_0xb9d76c(0xbf)]=_0x3c8677[_0xb9d76c(0x136)],_0x1c01e9=!![]);_0x3c8677[_0xb9d76c(0x114)]!==undefined&&(_0x1b1107['end_on']=_0x3c8677['endOn'],_0x1c01e9=!![]);_0x3c8677[_0xb9d76c(0x11e)]&&(_0x1b1107[_0xb9d76c(0x11e)]=_0x3c8677['timezone'],_0x1c01e9=!![]);_0x1c01e9&&(_0xcf1952['schedule']=_0x1b1107);(_0x3c8677[_0xb9d76c(0xf9)]&&_0x3c8677[_0xb9d76c(0xf9)]['length']>0x0||_0x3c8677[_0xb9d76c(0x11b)]&&_0x3c8677[_0xb9d76c(0x11b)][_0xb9d76c(0x10b)]>0x0)&&(_0xcf1952[_0xb9d76c(0xce)]={},_0x3c8677[_0xb9d76c(0xf9)]&&_0x3c8677[_0xb9d76c(0xf9)][_0xb9d76c(0x10b)]>0x0&&(_0xcf1952[_0xb9d76c(0xce)][_0xb9d76c(0x117)]=_0x3c8677[_0xb9d76c(0xf9)]),_0x3c8677[_0xb9d76c(0x11b)]&&_0x3c8677[_0xb9d76c(0x11b)][_0xb9d76c(0x10b)]>0x0&&(_0xcf1952[_0xb9d76c(0xce)][_0xb9d76c(0x11d)]=_0x3c8677[_0xb9d76c(0x11b)]['map'](_0x364381=>{const _0x1f0c8b=_0xb9d76c,_0x47e8a8=_0x2c28b7?.[_0x1f0c8b(0x123)](_0x364381);return _0x47e8a8??String(_0x364381);})));_0x3c8677[_0xb9d76c(0x10f)]&&Object[_0xb9d76c(0xf0)](_0x3c8677[_0xb9d76c(0x10f)])[_0xb9d76c(0x10b)]>0x0&&(_0xcf1952['connector_config']=normalizeConnectorConfigForYaml(_0x3c8677[_0xb9d76c(0x10f)]));_0x3c8677[_0xb9d76c(0xde)]&&(_0xcf1952[_0xb9d76c(0xa7)]=_0x3c8677[_0xb9d76c(0xde)]);if(_0x3c8677[_0xb9d76c(0x128)]){const _0x534de9={},_0x2cebcc=_0x3c8677[_0xb9d76c(0x128)];_0x2cebcc[_0xb9d76c(0x132)]&&_0x2cebcc['columns'][_0xb9d76c(0x10b)]>0x0&&(_0x534de9['columns']=_0x2cebcc['columns']['filter'](_0x321237=>_0x321237&&_0x321237[_0xb9d76c(0xea)])[_0xb9d76c(0xb3)](_0x53abaa=>({'name':_0x53abaa['name'],..._0x53abaa['type']&&{'type':_0x53abaa['type']},..._0x53abaa[_0xb9d76c(0xe1)]&&{'visibility':_0x53abaa[_0xb9d76c(0xe1)]}}))),_0x2cebcc['behaviorTableName']&&(_0x534de9[_0xb9d76c(0xac)]=_0x2cebcc[_0xb9d76c(0x107)]),_0x2cebcc[_0xb9d76c(0xd6)]!==undefined&&(_0x534de9[_0xb9d76c(0xc3)]=_0x2cebcc[_0xb9d76c(0xd6)]),_0x2cebcc[_0xb9d76c(0x10a)]&&(_0x534de9['join_strategy']=_0x2cebcc[_0xb9d76c(0x10a)]),_0x2cebcc[_0xb9d76c(0xfa)]&&(_0x534de9['formatting']=_0x2cebcc[_0xb9d76c(0xfa)]),_0x2cebcc['orderBy']&&_0x2cebcc['orderBy'][_0xb9d76c(0x10b)]>0x0&&(_0x534de9['order_by']=_0x2cebcc[_0xb9d76c(0xba)]),Object['keys'](_0x534de9)['length']>0x0&&(_0xcf1952[_0xb9d76c(0xc6)]=_0x534de9);}return _0xcf1952;}export function journeyActivationStepToYaml(_0x7e15a5,_0xd80df4,_0x2436ba){const _0x44907f=a107_0x34f8a1,_0x4c7bb9=_0x7e15a5[_0x44907f(0x111)][_0x44907f(0xd8)],_0x36c400=_0x4c7bb9[_0x44907f(0x11f)]||'',_0xa71810=_0x2436ba?.['get'](_0x36c400)??_0x36c400,_0x1db5f1={'name':_0x4c7bb9['name']||'','connection':_0xa71810};_0x4c7bb9[_0x44907f(0xf6)]&&(_0x1db5f1[_0x44907f(0xf6)]=_0x4c7bb9[_0x44907f(0xf6)]);let _0x4d430d=[];_0x4c7bb9['columns']&&_0x4c7bb9[_0x44907f(0x132)][_0x44907f(0x10b)]>0x0&&(_0x4d430d=_0x4c7bb9['columns'][_0x44907f(0xd2)](_0x5e45cb=>_0x5e45cb&&_0x5e45cb[_0x44907f(0xea)])[_0x44907f(0xb3)](_0x4ade33=>{const _0x40fddd=_0x44907f;if(_0x4ade33[_0x40fddd(0x124)]||_0x4ade33['visibility'])return{'name':_0x4ade33['name'],..._0x4ade33['type']&&{'type':_0x4ade33[_0x40fddd(0x124)]},..._0x4ade33['visibility']&&{'visibility':_0x4ade33[_0x40fddd(0xe1)]}};return _0x4ade33[_0x40fddd(0xea)];}));_0x4d430d[_0x44907f(0x10b)]>0x0&&(_0x1db5f1['columns']=_0x4d430d);_0x4c7bb9[_0x44907f(0xbb)]!==undefined&&(_0x4c7bb9[_0x44907f(0xbb)]===![]&&_0x4d430d[_0x44907f(0x10b)]===0x0?_0x1db5f1[_0x44907f(0xb9)]=!![]:_0x1db5f1['all_columns']=_0x4c7bb9[_0x44907f(0xbb)]);const _0x1ea601={};let _0x3c76e3=![];_0x4c7bb9[_0x44907f(0xaf)]&&(_0x1ea601[_0x44907f(0x124)]=_0x4c7bb9[_0x44907f(0xaf)],_0x3c76e3=!![]);_0x4c7bb9['repeatUnit']&&(_0x1ea601[_0x44907f(0x10c)]=_0x4c7bb9[_0x44907f(0x135)],_0x3c76e3=!![]);_0x4c7bb9[_0x44907f(0x10d)]!==undefined&&_0x4c7bb9[_0x44907f(0x10d)]!==null&&(_0x1ea601['repeat_frequency']=_0x4c7bb9[_0x44907f(0x10d)],_0x3c76e3=!![]);_0x4c7bb9[_0x44907f(0x136)]!==undefined&&(_0x1ea601['start_at']=_0x4c7bb9[_0x44907f(0x136)],_0x3c76e3=!![]);_0x4c7bb9['endOn']!==undefined&&(_0x1ea601['end_on']=_0x4c7bb9[_0x44907f(0x114)],_0x3c76e3=!![]);_0x4c7bb9[_0x44907f(0x11e)]&&(_0x1ea601[_0x44907f(0x11e)]=_0x4c7bb9[_0x44907f(0x11e)],_0x3c76e3=!![]);_0x3c76e3&&(_0x1db5f1[_0x44907f(0xeb)]=_0x1ea601);(_0x4c7bb9['notifyOn']&&_0x4c7bb9[_0x44907f(0xf9)][_0x44907f(0x10b)]>0x0||_0x4c7bb9['emailRecipients']&&_0x4c7bb9['emailRecipients'][_0x44907f(0x10b)]>0x0)&&(_0x1db5f1[_0x44907f(0xce)]={},_0x4c7bb9[_0x44907f(0xf9)]&&_0x4c7bb9[_0x44907f(0xf9)]['length']>0x0&&(_0x1db5f1['notification'][_0x44907f(0x117)]=_0x4c7bb9[_0x44907f(0xf9)]),_0x4c7bb9[_0x44907f(0x11b)]&&_0x4c7bb9[_0x44907f(0x11b)][_0x44907f(0x10b)]>0x0&&(_0x1db5f1[_0x44907f(0xce)][_0x44907f(0x11d)]=_0x4c7bb9[_0x44907f(0x11b)]['map'](_0x40301b=>{const _0xda7c=_0x44907f,_0x1c9645=_0xd80df4?.[_0xda7c(0x123)](_0x40301b);return _0x1c9645??String(_0x40301b);})));_0x4c7bb9['connectorConfig']&&Object[_0x44907f(0xf0)](_0x4c7bb9['connectorConfig'])[_0x44907f(0x10b)]>0x0&&(_0x1db5f1[_0x44907f(0xe9)]=normalizeConnectorConfigForYaml(_0x4c7bb9[_0x44907f(0x10f)]));_0x4c7bb9['activationTemplateId']&&(_0x1db5f1[_0x44907f(0xa7)]=_0x4c7bb9[_0x44907f(0xde)]);if(_0x4c7bb9['syndicationBehavior']){const _0x1d078b={},_0x1c1eea=_0x4c7bb9[_0x44907f(0x128)];_0x1c1eea[_0x44907f(0x132)]&&_0x1c1eea[_0x44907f(0x132)][_0x44907f(0x10b)]>0x0&&(_0x1d078b[_0x44907f(0x132)]=_0x1c1eea[_0x44907f(0x132)]['filter'](_0x4b415a=>_0x4b415a&&_0x4b415a[_0x44907f(0xea)])[_0x44907f(0xb3)](_0x4fb764=>({'name':_0x4fb764[_0x44907f(0xea)],..._0x4fb764[_0x44907f(0x124)]&&{'type':_0x4fb764[_0x44907f(0x124)]},..._0x4fb764[_0x44907f(0xe1)]&&{'visibility':_0x4fb764[_0x44907f(0xe1)]}}))),_0x1c1eea[_0x44907f(0x107)]&&(_0x1d078b['behavior_table']=_0x1c1eea[_0x44907f(0x107)]),_0x1c1eea['joinRow']!==undefined&&(_0x1d078b['join_row']=_0x1c1eea['joinRow']),_0x1c1eea[_0x44907f(0x10a)]&&(_0x1d078b[_0x44907f(0xdf)]=_0x1c1eea[_0x44907f(0x10a)]),_0x1c1eea[_0x44907f(0xfa)]&&(_0x1d078b[_0x44907f(0xfa)]=_0x1c1eea['formatting']),_0x1c1eea[_0x44907f(0xba)]&&_0x1c1eea[_0x44907f(0xba)][_0x44907f(0x10b)]>0x0&&(_0x1d078b['order_by']=_0x1c1eea[_0x44907f(0xba)]),Object[_0x44907f(0xf0)](_0x1d078b)[_0x44907f(0x10b)]>0x0&&(_0x1db5f1[_0x44907f(0xc6)]=_0x1d078b);}return _0x1db5f1;}export function segmentWithActivationsToYaml(_0x49fcda,_0xde339d,_0x209882,_0xb51b23,_0x5b6ce9){const _0x1f36d1=a107_0x34f8a1,_0x19b1ce=segmentResponseToDefSync(_0x49fcda,_0x209882);return _0xde339d[_0x1f36d1(0x10b)]>0x0&&(_0x19b1ce['activations']=_0xde339d[_0x1f36d1(0xb3)](_0x5a13b9=>activationResponseToDef(_0x5a13b9,_0xb51b23,_0x5b6ce9))),_0x19b1ce;}function normalizeColumn(_0x34bbd0){const _0x391e4c=a107_0x34f8a1;if(typeof _0x34bbd0===_0x391e4c(0xe8))return{'name':_0x34bbd0};return{'name':_0x34bbd0['name'],..._0x34bbd0[_0x391e4c(0x124)]&&{'type':_0x34bbd0[_0x391e4c(0x124)]},..._0x34bbd0[_0x391e4c(0xe1)]&&{'visibility':_0x34bbd0[_0x391e4c(0xe1)]}};}export async function activationDefToCreateRequest(_0x1df663,_0x4fa4ad){const _0x4322d9=a107_0x34f8a1,_0x12a9ef=_0x4fa4ad?.[_0x4322d9(0xc5)],_0x19ced1=_0x4fa4ad?.[_0x4322d9(0x102)],_0x59e262=_0x1df663[_0x4322d9(0x103)];let _0x128aed;const _0x3b5061=parseInt(_0x59e262,0xa);if(!isNaN(_0x3b5061)&&String(_0x3b5061)===_0x59e262)_0x128aed=_0x3b5061;else{const _0x3d53c9=_0x19ced1?.['get'](_0x59e262);if(_0x3d53c9===undefined)throw new SDKError(ErrorCode[_0x4322d9(0xa8)],'Unknown\x20connection:\x20'+_0x59e262,undefined,{'helpText':_0x4322d9(0xf5)});_0x128aed=_0x3d53c9;}const _0x5e8886={'name':_0x1df663[_0x4322d9(0xea)],'connectionId':_0x128aed};_0x1df663[_0x4322d9(0xf6)]&&(_0x5e8886[_0x4322d9(0xf6)]=_0x1df663[_0x4322d9(0xf6)]);let _0x469a1f=[];_0x1df663[_0x4322d9(0x132)]&&_0x1df663['columns'][_0x4322d9(0x10b)]>0x0&&(_0x469a1f=_0x1df663[_0x4322d9(0x132)][_0x4322d9(0xd2)](_0x322fe7=>_0x322fe7!=null)['map'](normalizeColumn));_0x469a1f['length']>0x0&&(_0x5e8886[_0x4322d9(0x132)]=_0x469a1f);_0x1df663['all_columns']!==undefined&&(_0x1df663[_0x4322d9(0xb9)]===![]&&_0x469a1f[_0x4322d9(0x10b)]===0x0?_0x5e8886[_0x4322d9(0xbb)]=!![]:_0x5e8886[_0x4322d9(0xbb)]=_0x1df663[_0x4322d9(0xb9)]);if(_0x1df663['schedule']){const _0x36d539=_0x1df663[_0x4322d9(0xeb)];_0x36d539[_0x4322d9(0x124)]&&(_0x5e8886['scheduleType']=_0x36d539['type']),_0x36d539['repeat_unit']&&(_0x5e8886[_0x4322d9(0x135)]=_0x36d539[_0x4322d9(0x10c)]),_0x36d539[_0x4322d9(0x11c)]!==undefined&&(_0x5e8886[_0x4322d9(0x10d)]=_0x36d539[_0x4322d9(0x11c)]),_0x36d539[_0x4322d9(0xf3)]&&(_0x5e8886['repeatSubFrequency']=_0x36d539[_0x4322d9(0xf3)]),_0x36d539[_0x4322d9(0xbf)]!==undefined&&(_0x5e8886['startAt']=_0x36d539['start_at']),_0x36d539[_0x4322d9(0xf2)]!==undefined&&(_0x5e8886[_0x4322d9(0x114)]=_0x36d539[_0x4322d9(0xf2)]),_0x36d539['timezone']&&(_0x5e8886[_0x4322d9(0x11e)]=_0x36d539[_0x4322d9(0x11e)]);}_0x1df663['notification']&&(_0x1df663[_0x4322d9(0xce)]['notify_on']&&(_0x5e8886[_0x4322d9(0xf9)]=_0x1df663[_0x4322d9(0xce)][_0x4322d9(0x117)]),_0x1df663[_0x4322d9(0xce)][_0x4322d9(0x11d)]&&(_0x5e8886[_0x4322d9(0x11b)]=_0x1df663[_0x4322d9(0xce)][_0x4322d9(0x11d)][_0x4322d9(0xb3)](_0x59edb4=>{const _0x4e2954=_0x4322d9,_0x5c442e=Number(_0x59edb4);if(!isNaN(_0x5c442e)&&String(_0x5c442e)===_0x59edb4)return _0x5c442e;const _0x2f645e=_0x12a9ef?.[_0x4e2954(0x123)](_0x59edb4['toLowerCase']());if(_0x2f645e===undefined)throw new SDKError(ErrorCode[_0x4e2954(0xb8)],'Unknown\x20email\x20recipient:\x20'+_0x59edb4+'.\x20Use\x20\x27tdx\x20user\x20list\x27\x20to\x20see\x20valid\x20emails.');return _0x2f645e;})));if(_0x1df663[_0x4322d9(0xe9)]){const _0x1571eb=_0x4fa4ad?.[_0x4322d9(0xec)]?.['get'](_0x59e262);if(_0x1571eb&&_0x4fa4ad?.['getSchema'])try{const _0x159d9a=await _0x4fa4ad['getSchema'](_0x1571eb),_0xd818e=validateConnectorConfig(_0x1df663['connector_config'],_0x159d9a);if(!_0xd818e[_0x4322d9(0xfd)])throw new SDKError(ErrorCode[_0x4322d9(0x104)],_0x4322d9(0xd3)+_0x1df663[_0x4322d9(0xea)]+_0x4322d9(0xad)+formatValidationErrors(_0xd818e['errors']),undefined,{'helpText':_0x4322d9(0xe0)+_0x1571eb+'\x0a\x0aAvailable\x20fields:\x0a'+formatSchemaAsHelp(_0x159d9a)});if(_0xd818e['warnings'][_0x4322d9(0x10b)]>0x0){const _0x514a17=formatValidationWarnings(_0xd818e[_0x4322d9(0xca)]);console[_0x4322d9(0x131)](_0x4322d9(0xcb)+_0x1df663[_0x4322d9(0xea)]+_0x4322d9(0xad)+_0x514a17);}_0x5e8886[_0x4322d9(0x10f)]=transformConfigToLegacy(_0x1df663[_0x4322d9(0xe9)],_0x159d9a);}catch(_0x1936ce){if(_0x1936ce instanceof SDKError&&_0x1936ce[_0x4322d9(0x116)]===ErrorCode[_0x4322d9(0xf1)])_0x5e8886[_0x4322d9(0x10f)]=_0x1df663[_0x4322d9(0xe9)];else throw _0x1936ce;}else _0x5e8886[_0x4322d9(0x10f)]=_0x1df663[_0x4322d9(0xe9)];}_0x1df663[_0x4322d9(0xa7)]!==undefined&&(_0x5e8886[_0x4322d9(0xde)]=_0x1df663[_0x4322d9(0xa7)]);if(_0x1df663[_0x4322d9(0xc6)]){const _0xb8f41f=_0x1df663[_0x4322d9(0xc6)],_0x2c18a8={};if(_0xb8f41f[_0x4322d9(0x132)]&&_0xb8f41f['columns'][_0x4322d9(0x10b)]>0x0){const _0x9693f7=_0xb8f41f[_0x4322d9(0x132)][_0x4322d9(0xd2)](_0x13d14f=>_0x13d14f&&_0x13d14f[_0x4322d9(0xea)]);_0x9693f7[_0x4322d9(0x10b)]>0x0&&(_0x2c18a8['columns']=_0x9693f7);}_0xb8f41f[_0x4322d9(0xac)]&&(_0x2c18a8['behaviorTableName']=_0xb8f41f['behavior_table']),_0xb8f41f[_0x4322d9(0xc3)]!==undefined&&(_0x2c18a8[_0x4322d9(0xd6)]=_0xb8f41f['join_row']),_0xb8f41f[_0x4322d9(0xdf)]&&(_0x2c18a8[_0x4322d9(0x10a)]=_0xb8f41f[_0x4322d9(0xdf)]),_0xb8f41f[_0x4322d9(0xfa)]&&(_0x2c18a8[_0x4322d9(0xfa)]=_0xb8f41f['formatting']),_0xb8f41f[_0x4322d9(0x125)]&&(_0x2c18a8[_0x4322d9(0xba)]=_0xb8f41f[_0x4322d9(0x125)]),_0x5e8886[_0x4322d9(0x128)]=_0x2c18a8;}return _0x5e8886;}export async function activationDefToUpdateRequest(_0x5628b6,_0x1374f7){return activationDefToCreateRequest(_0x5628b6,_0x1374f7);}export function deepSortObject(_0x3d5d29){const _0xd24a58=a107_0x34f8a1;if(_0x3d5d29===null||typeof _0x3d5d29!==_0xd24a58(0xc4))return _0x3d5d29;if(Array[_0xd24a58(0x126)](_0x3d5d29))return _0x3d5d29['map'](deepSortObject)[_0xd24a58(0x122)]((_0x545ed3,_0x52e693)=>JSON[_0xd24a58(0xe7)](_0x545ed3)[_0xd24a58(0x108)](JSON['stringify'](_0x52e693)));const _0x29650f={};for(const _0x218a46 of Object['keys'](_0x3d5d29)['sort']()){_0x29650f[_0x218a46]=deepSortObject(_0x3d5d29[_0x218a46]);}return _0x29650f;}export function serializeRule(_0xdeba81){return JSON['stringify'](deepSortObject(_0xdeba81));}export function normalizeRuleForMatching(_0x3c51d9){return normalizeConditionsForMatching(_0x3c51d9);}function normalizeConditionsForMatching(_0x6a8a15){const _0x37bc3c=a107_0x34f8a1;if(_0x6a8a15===null||typeof _0x6a8a15!=='object')return _0x6a8a15;if(Array['isArray'](_0x6a8a15))return _0x6a8a15[_0x37bc3c(0xb3)](normalizeConditionsForMatching);const _0x2a048f=_0x6a8a15;if((_0x2a048f[_0x37bc3c(0x124)]==='include'||_0x2a048f[_0x37bc3c(0x124)]===_0x37bc3c(0x133))&&typeof _0x2a048f['segment']===_0x37bc3c(0xe8))return{..._0x2a048f,'segment':'__SEGMENT_REF__'};const _0x47db1e={};for(const _0x50389b of Object[_0x37bc3c(0xf0)](_0x2a048f)){_0x47db1e[_0x50389b]=normalizeConditionsForMatching(_0x2a048f[_0x50389b]);}return _0x47db1e;}export function serializeRuleForMatching(_0x22c179){return JSON['stringify'](deepSortObject(normalizeRuleForMatching(_0x22c179)));}export function expandSegmentReferences(_0xce4e82,_0x4982fc,_0x591e73=new Set()){return expandConditions(_0xce4e82,_0x4982fc,_0x591e73);}function expandConditions(_0x30d24b,_0x45508d,_0xd3dbfe){const _0x58446d=a107_0x34f8a1;if(_0x30d24b===null||typeof _0x30d24b!=='object')return _0x30d24b;if(Array['isArray'](_0x30d24b))return _0x30d24b[_0x58446d(0xb3)](_0x347185=>expandConditions(_0x347185,_0x45508d,_0xd3dbfe));const _0x57ceaa=_0x30d24b;if((_0x57ceaa[_0x58446d(0x124)]===_0x58446d(0x12f)||_0x57ceaa[_0x58446d(0x124)]===_0x58446d(0x133))&&typeof _0x57ceaa[_0x58446d(0x12b)]===_0x58446d(0xe8)){const _0x336af2=_0x57ceaa[_0x58446d(0x12b)],_0x8d54df=_0x45508d['get'](_0x336af2);if(_0x8d54df&&!_0xd3dbfe['has'](_0x336af2)){const _0x28b888=new Set(_0xd3dbfe);_0x28b888[_0x58446d(0xdc)](_0x336af2);const _0x392b19=expandConditions(_0x8d54df,_0x45508d,_0x28b888);return{'type':_0x57ceaa[_0x58446d(0x124)],'expanded_rule':_0x392b19};}return{'type':_0x57ceaa[_0x58446d(0x124)],'expanded_rule':'__UNRESOLVED__'};}const _0xe2a388={};for(const _0x74d6b0 of Object[_0x58446d(0xf0)](_0x57ceaa)){_0xe2a388[_0x74d6b0]=expandConditions(_0x57ceaa[_0x74d6b0],_0x45508d,_0xd3dbfe);}return _0xe2a388;}export function serializeExpandedRule(_0x1c93c8,_0x5a7d3b){const _0x30d5ed=expandSegmentReferences(_0x1c93c8,_0x5a7d3b);return JSON['stringify'](deepSortObject(_0x30d5ed));}export function createSegmentNameContext(_0x477ffd){const _0x4b230d=a107_0x34f8a1,_0xdb0fd6=new Set(),_0x4973ea=new Map(),_0x12b89d=new Map();if(_0x477ffd)for(const [_0x11ccfc,_0x31abd2]of Object['entries'](_0x477ffd)){if(_0x31abd2[_0x4b230d(0xda)]){const _0x31be4c=serializeRule(_0x31abd2[_0x4b230d(0xda)]);_0x12b89d[_0x4b230d(0x115)](_0x31be4c,_0x11ccfc),_0xdb0fd6['add'](_0x11ccfc);}}return{'usedNames':_0xdb0fd6,'ruleHashToName':_0x4973ea,'localRuleToName':_0x477ffd?_0x12b89d:undefined};}export function resolveSegmentName(_0x3c2282,_0x393f64,_0x1ddb2f,_0x784fd4){const _0x1ae26e=a107_0x34f8a1,_0x5ac379=serializeRule(_0x393f64);if(_0x1ddb2f[_0x1ae26e(0xdb)]){const _0x5c075e=_0x1ddb2f[_0x1ae26e(0xdb)][_0x1ae26e(0x123)](_0x5ac379);if(_0x5c075e)return{'name':_0x5c075e,'isDuplicate':![],'isLocalMatch':!![]};}const _0x51b6a9=_0x1ddb2f['ruleHashToName']['get'](_0x5ac379);if(_0x51b6a9)return{'name':_0x51b6a9,'isDuplicate':!![],'isLocalMatch':![]};const _0x1803ef=_0x784fd4(_0x3c2282);let _0x254ace=_0x1803ef||_0x3c2282,_0x263dd2=_0x254ace,_0x1cf7d6=0x2;while(_0x1ddb2f['usedNames'][_0x1ae26e(0xb1)](_0x263dd2)){_0x263dd2=_0x254ace+'_'+_0x1cf7d6,_0x1cf7d6++;}return _0x1ddb2f[_0x1ae26e(0x121)][_0x1ae26e(0xdc)](_0x263dd2),_0x1ddb2f[_0x1ae26e(0xab)]['set'](_0x5ac379,_0x263dd2),{'name':_0x263dd2,'isDuplicate':![],'isLocalMatch':![]};}function a107_0x1e3a(_0x463fc7,_0x83484){_0x463fc7=_0x463fc7-0xa7;const _0x757434=a107_0x7574();let _0x1e3a37=_0x757434[_0x463fc7];return _0x1e3a37;}export function collectSegmentRefsFromRule(_0x380a8d){const _0x359fdf=[],_0xf53dc1=_0x1c41cc=>{const _0x5ac75e=a107_0x1e3a;if(!_0x1c41cc||typeof _0x1c41cc!=='object')return;if(Array[_0x5ac75e(0x126)](_0x1c41cc)){_0x1c41cc[_0x5ac75e(0x101)](_0xf53dc1);return;}const _0x537e02=_0x1c41cc;(_0x537e02[_0x5ac75e(0x124)]===_0x5ac75e(0x12f)||_0x537e02[_0x5ac75e(0x124)]===_0x5ac75e(0x133))&&typeof _0x537e02[_0x5ac75e(0x12b)]===_0x5ac75e(0xe8)&&_0x359fdf['push'](_0x537e02[_0x5ac75e(0x12b)]);for(const _0x12df9c of Object[_0x5ac75e(0x113)](_0x537e02)){_0xf53dc1(_0x12df9c);}};return _0xf53dc1(_0x380a8d),_0x359fdf;}export function validateSegmentRule(_0x515696,_0x1b5a55){const _0x40237b=a107_0x34f8a1;if(!_0x1b5a55||!_0x1b5a55['conditions'])return;for(let _0x467c09=0x0;_0x467c09<_0x1b5a55[_0x40237b(0x110)][_0x40237b(0x10b)];_0x467c09++){const _0x4ec476=_0x1b5a55[_0x40237b(0x110)][_0x467c09];if(_0x40237b(0x124)in _0x4ec476&&_0x4ec476[_0x40237b(0x124)]==='Value'){const _0x58d262=_0x4ec476;if(!_0x58d262[_0x40237b(0xf8)]||_0x58d262[_0x40237b(0xf8)]==='')throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],'Invalid\x20condition\x20in\x20embedded\x20segment\x20\x27'+_0x515696+_0x40237b(0xbc)+(_0x40237b(0xd9)+_0x467c09+'].attribute\x20cannot\x20be\x20empty.\x0a')+_0x40237b(0xf7));}}}
1
+ const a107_0x6fd5bf=a107_0x1a38;(function(_0x64cd7d,_0x50b446){const _0x1f6527=a107_0x1a38,_0x398b4d=_0x64cd7d();while(!![]){try{const _0x343edc=-parseInt(_0x1f6527(0x247))/0x1*(parseInt(_0x1f6527(0x206))/0x2)+parseInt(_0x1f6527(0x239))/0x3+-parseInt(_0x1f6527(0x1f6))/0x4*(parseInt(_0x1f6527(0x259))/0x5)+-parseInt(_0x1f6527(0x1d9))/0x6+parseInt(_0x1f6527(0x22e))/0x7*(parseInt(_0x1f6527(0x203))/0x8)+-parseInt(_0x1f6527(0x241))/0x9*(-parseInt(_0x1f6527(0x209))/0xa)+-parseInt(_0x1f6527(0x223))/0xb;if(_0x343edc===_0x50b446)break;else _0x398b4d['push'](_0x398b4d['shift']());}catch(_0x2e8334){_0x398b4d['push'](_0x398b4d['shift']());}}}(a107_0x5356,0x54225));import*as a107_0x1a547d from'yaml';import{SDKError,ErrorCode}from'../errors.js';import{validateConnectorConfig,transformConfigToLegacy,normalizeConnectorConfigForYaml,formatValidationErrors,formatValidationWarnings,formatSchemaAsHelp}from'../connection-validator.js';export function segmentResponseToDefSync(_0x4d2cd3,_0x31a8ff){const _0x3a9f33=a107_0x1a38,_0x45e62e=_0x4d2cd3[_0x3a9f33(0x200)]&&'type'in _0x4d2cd3[_0x3a9f33(0x200)]&&_0x4d2cd3[_0x3a9f33(0x200)][_0x3a9f33(0x1f9)];return{'type':_0x3a9f33(0x25b),'name':_0x4d2cd3['name'],..._0x4d2cd3[_0x3a9f33(0x1f1)]&&{'description':_0x4d2cd3[_0x3a9f33(0x1f1)]},..._0x31a8ff&&{'folder':_0x31a8ff},..._0x45e62e&&{'rule':apiRuleToYaml(_0x4d2cd3[_0x3a9f33(0x200)])},..._0x4d2cd3['kind']!==undefined&&{'kind':_0x4d2cd3[_0x3a9f33(0x1d6)]===0x0?'batch':_0x4d2cd3[_0x3a9f33(0x1d6)]===0x1?_0x3a9f33(0x240):'funnel_stage'},..._0x4d2cd3['isVisible']!==undefined&&{'visible':_0x4d2cd3[_0x3a9f33(0x1de)]}};}export async function segmentResponseToDef(_0x18de05,_0x591344,_0x5224d9){const _0x53cc31=a107_0x1a38,_0x174281=segmentResponseToDefSync(_0x18de05,_0x5224d9);if(!_0x591344||!_0x591344['resolveSegmentName'])return _0x174281;return _0x174281['rule']&&(_0x174281[_0x53cc31(0x200)]=await resolveRuleSegmentRefs(_0x174281[_0x53cc31(0x200)],_0x591344[_0x53cc31(0x210)])),_0x174281;}export function apiRuleToYaml(_0x16de2a){const _0x1ce40f=a107_0x1a38,_0x5b1439=(_0x16de2a[_0x1ce40f(0x23a)]||[])[_0x1ce40f(0x260)](apiConditionToYaml);if(_0x5b1439[_0x1ce40f(0x1ee)]===0x1&&!_0x16de2a[_0x1ce40f(0x1f1)]&&'type'in _0x5b1439[0x0]&&(_0x5b1439[0x0]['type']==='And'||_0x5b1439[0x0]['type']==='Or')){const _0x3be35b=_0x5b1439[0x0];if(_0x3be35b['type']===_0x16de2a[_0x1ce40f(0x1f9)]&&_0x3be35b['conditions'])return{'type':_0x16de2a['type'],'conditions':_0x3be35b['conditions'],..._0x3be35b['description']&&{'description':_0x3be35b[_0x1ce40f(0x1f1)]}};}return{'type':_0x16de2a['type'],'conditions':_0x5b1439,..._0x16de2a[_0x1ce40f(0x1f1)]&&{'description':_0x16de2a['description']}};}export async function resolveRuleSegmentRefs(_0x11e0f2,_0x3f55f4){const _0x5313ad=a107_0x1a38,_0x3fc3a8=await Promise[_0x5313ad(0x20d)](_0x11e0f2[_0x5313ad(0x23a)]['map'](_0x59673e=>resolveConditionSegmentRefs(_0x59673e,_0x3f55f4)));return{..._0x11e0f2,'conditions':_0x3fc3a8};}async function resolveConditionSegmentRefs(_0x336169,_0x54f509){const _0x25fb0c=a107_0x1a38;if(_0x25fb0c(0x25b)in _0x336169&&(_0x336169[_0x25fb0c(0x1f9)]===_0x25fb0c(0x23c)||_0x336169['type']==='exclude')){const _0x48db4a=_0x336169;if(/^\d+$/[_0x25fb0c(0x1e5)](_0x48db4a['segment'])){const _0x54cfaf=await _0x54f509(_0x48db4a[_0x25fb0c(0x25b)]);return{..._0x48db4a,'segment':_0x54cfaf};}return _0x336169;}if(_0x25fb0c(0x23a)in _0x336169&&_0x336169[_0x25fb0c(0x23a)]){const _0x3023c8=_0x336169,_0x5ae51a=await Promise[_0x25fb0c(0x20d)](_0x3023c8['conditions'][_0x25fb0c(0x260)](_0x5374c5=>resolveConditionSegmentRefs(_0x5374c5,_0x54f509)));return{..._0x3023c8,'conditions':_0x5ae51a};}if('filter'in _0x336169&&_0x336169['filter']){const _0x1c65a2=_0x336169,_0x3cf64a=await resolveRuleSegmentRefs(_0x1c65a2[_0x25fb0c(0x202)],_0x54f509);return{..._0x1c65a2,'filter':_0x3cf64a};}return _0x336169;}export async function resolveRuleSegmentIds(_0x3f5a73,_0x31b930){const _0x49286f=a107_0x1a38,_0x2c9c3e=await Promise[_0x49286f(0x20d)](_0x3f5a73['conditions'][_0x49286f(0x260)](_0x2e63a3=>resolveConditionSegmentIds(_0x2e63a3,_0x31b930)));return{..._0x3f5a73,'conditions':_0x2c9c3e};}async function resolveConditionSegmentIds(_0x47f7c7,_0x1cd40f){const _0x571436=a107_0x1a38;if(_0x571436(0x25b)in _0x47f7c7&&(_0x47f7c7[_0x571436(0x1f9)]===_0x571436(0x23c)||_0x47f7c7[_0x571436(0x1f9)]===_0x571436(0x21d))){const _0x23bd0c=_0x47f7c7;if(!/^\d+$/['test'](_0x23bd0c['segment'])){const _0x54c769=await _0x1cd40f(_0x23bd0c['segment']);return{..._0x23bd0c,'segment':_0x54c769};}return _0x47f7c7;}if(_0x571436(0x23a)in _0x47f7c7&&_0x47f7c7['conditions']){const _0xc4bc04=_0x47f7c7,_0x4935c7=await Promise['all'](_0xc4bc04[_0x571436(0x23a)][_0x571436(0x260)](_0x494821=>resolveConditionSegmentIds(_0x494821,_0x1cd40f)));return{..._0xc4bc04,'conditions':_0x4935c7};}if(_0x571436(0x202)in _0x47f7c7&&_0x47f7c7['filter']){const _0x5bcd89=_0x47f7c7,_0x4d8658=await resolveRuleSegmentIds(_0x5bcd89['filter'],_0x1cd40f);return{..._0x5bcd89,'filter':_0x4d8658};}return _0x47f7c7;}function apiConditionToYaml(_0x729d97){const _0x243a6f=a107_0x1a38;if(_0x729d97['type']===_0x243a6f(0x211)||_0x729d97[_0x243a6f(0x1f9)]==='Or'){if(_0x729d97[_0x243a6f(0x23a)]){const _0x21c2c4=_0x729d97[_0x243a6f(0x23a)][_0x243a6f(0x260)](apiConditionToYaml);if(_0x21c2c4[_0x243a6f(0x1ee)]===0x1&&!_0x729d97[_0x243a6f(0x1f1)])return _0x21c2c4[0x0];return{'type':_0x729d97[_0x243a6f(0x1f9)],'conditions':_0x21c2c4,..._0x729d97[_0x243a6f(0x1f1)]&&{'description':_0x729d97[_0x243a6f(0x1f1)]}};}}if(_0x729d97[_0x243a6f(0x1f9)]===_0x243a6f(0x1e1)&&_0x729d97[_0x243a6f(0x25e)]&&_0x729d97[_0x243a6f(0x24b)]){const _0x35cfd4=_0x729d97['leftValue'][_0x243a6f(0x221)]?{'type':_0x729d97[_0x243a6f(0x25e)][_0x243a6f(0x221)]['type'],..._0x729d97[_0x243a6f(0x25e)][_0x243a6f(0x221)][_0x243a6f(0x248)]&&{'groupingColumns':_0x729d97['leftValue']['aggregation'][_0x243a6f(0x248)]}}:undefined;return{'type':_0x243a6f(0x1e1),'attribute':_0x729d97[_0x243a6f(0x25e)][_0x243a6f(0x1db)]||'','operator':apiOperatorToYaml(_0x729d97[_0x243a6f(0x24b)]),..._0x729d97[_0x243a6f(0x21b)]&&_0x729d97[_0x243a6f(0x21b)]!=='any'?{'arrayMatching':_0x729d97[_0x243a6f(0x21b)]}:{},..._0x729d97[_0x243a6f(0x21d)]?{'exclude':_0x729d97[_0x243a6f(0x21d)]}:{},..._0x35cfd4?{'aggregation':_0x35cfd4}:{},..._0x729d97[_0x243a6f(0x25e)][_0x243a6f(0x1dc)]?{'source':_0x729d97[_0x243a6f(0x25e)]['source']['name']}:{},..._0x729d97[_0x243a6f(0x25e)][_0x243a6f(0x202)]?{'filter':apiRuleToYaml(_0x729d97[_0x243a6f(0x25e)][_0x243a6f(0x202)])}:{},..._0x729d97['limit']!==undefined&&_0x729d97[_0x243a6f(0x20e)]!==null?{'limit':_0x729d97[_0x243a6f(0x20e)]}:{}};}if(_0x729d97[_0x243a6f(0x1f9)]===_0x243a6f(0x1f4)&&_0x729d97['id'])return{'type':_0x729d97[_0x243a6f(0x21d)]?'exclude':_0x243a6f(0x23c),'segment':_0x729d97['id']};return{'type':_0x243a6f(0x211),'conditions':[]};}function isTemporalOperator(_0x26dc7b){const _0x29f871=a107_0x1a38;return _0x26dc7b===_0x29f871(0x1ea)||_0x26dc7b==='TimeWithinNext';}function getEffectiveValue(_0x430f6c){const _0x419ac5=a107_0x1a38,_0x393906=_0x430f6c[_0x419ac5(0x249)];return _0x430f6c[_0x419ac5(0x22c)]??_0x393906;}function apiOperatorToYaml(_0x1346f9){const _0x1e7bff=a107_0x1a38;let _0x40d2c8;if(_0x1346f9[_0x1e7bff(0x25c)]&&_0x1346f9['rightValues'][_0x1e7bff(0x1ee)]>0x0)_0x40d2c8=_0x1346f9[_0x1e7bff(0x25c)];else{if(_0x1346f9[_0x1e7bff(0x25d)]!==undefined)_0x40d2c8=_0x1346f9[_0x1e7bff(0x25d)];else isTemporalOperator(_0x1346f9[_0x1e7bff(0x1f9)])&&_0x1346f9[_0x1e7bff(0x22c)]!==undefined&&(_0x40d2c8=_0x1346f9['value']);}return{'type':mapApiOperatorType(_0x1346f9[_0x1e7bff(0x1f9)]),..._0x1346f9['not']&&{'not':_0x1346f9[_0x1e7bff(0x1fc)]},..._0x40d2c8!==undefined&&{'value':_0x40d2c8},..._0x1346f9[_0x1e7bff(0x246)]&&{'unit':_0x1346f9['unit']}};}function mapApiOperatorType(_0x54c63b){return _0x54c63b;}export function segmentDefToCreateRequest(_0x3ebaa9,_0x5dc020){const _0x4eb7f2=a107_0x1a38,_0x7b16a2={'name':_0x3ebaa9[_0x4eb7f2(0x1db)]};return _0x3ebaa9['description']&&(_0x7b16a2[_0x4eb7f2(0x1f1)]=_0x3ebaa9[_0x4eb7f2(0x1f1)]),_0x3ebaa9['rule']&&(_0x7b16a2['rule']=yamlRuleToApi(_0x3ebaa9[_0x4eb7f2(0x200)])),_0x3ebaa9[_0x4eb7f2(0x1d6)]&&(_0x7b16a2[_0x4eb7f2(0x1d6)]=_0x3ebaa9[_0x4eb7f2(0x1d6)]===_0x4eb7f2(0x21a)?0x0:_0x3ebaa9[_0x4eb7f2(0x1d6)]===_0x4eb7f2(0x240)?0x1:0x2),_0x3ebaa9[_0x4eb7f2(0x256)]!==undefined&&(_0x7b16a2[_0x4eb7f2(0x1de)]=_0x3ebaa9[_0x4eb7f2(0x256)]),_0x5dc020&&(_0x7b16a2[_0x4eb7f2(0x1f2)]=_0x5dc020),_0x7b16a2;}export function segmentDefToUpdateRequest(_0x3b1f7d){const _0x4d47be=a107_0x1a38,_0x7613e4={'name':_0x3b1f7d[_0x4d47be(0x1db)]};return _0x3b1f7d[_0x4d47be(0x1f1)]!==undefined&&(_0x7613e4[_0x4d47be(0x1f1)]=_0x3b1f7d[_0x4d47be(0x1f1)]),_0x3b1f7d['rule']&&(_0x7613e4[_0x4d47be(0x200)]=yamlRuleToApi(_0x3b1f7d[_0x4d47be(0x200)])),_0x3b1f7d[_0x4d47be(0x1d6)]&&(_0x7613e4['kind']=_0x3b1f7d[_0x4d47be(0x1d6)]===_0x4d47be(0x21a)?0x0:_0x3b1f7d[_0x4d47be(0x1d6)]===_0x4d47be(0x240)?0x1:0x2),_0x7613e4;}export function yamlRuleToApi(_0x5157ff,_0xbd7c66=![]){const _0x30c1d5=a107_0x1a38,_0x4355f8=_0x5157ff['conditions'][_0x30c1d5(0x260)](yamlConditionToApi);if(_0xbd7c66){const _0x289285=_0x4355f8[_0x30c1d5(0x253)](_0x52a164=>_0x52a164['type']===_0x30c1d5(0x211)||_0x52a164['type']==='Or');if(!_0x289285&&_0x4355f8['length']>0x0)return{'type':_0x5157ff[_0x30c1d5(0x1f9)],'conditions':[{'type':'And','description':_0x5157ff[_0x30c1d5(0x1f1)]||'','conditions':_0x4355f8}]};}return{'type':_0x5157ff[_0x30c1d5(0x1f9)],'conditions':_0x4355f8,..._0x5157ff['description']&&{'description':_0x5157ff['description']}};}function yamlConditionToApi(_0x7c4800){const _0x54ecbe=a107_0x1a38;if('segment'in _0x7c4800&&(_0x7c4800[_0x54ecbe(0x1f9)]===_0x54ecbe(0x23c)||_0x7c4800[_0x54ecbe(0x1f9)]===_0x54ecbe(0x21d))){const _0x5605f7=_0x7c4800;return{'type':_0x54ecbe(0x1f4),'id':_0x5605f7[_0x54ecbe(0x25b)],'exclude':_0x5605f7[_0x54ecbe(0x1f9)]===_0x54ecbe(0x21d)};}if(_0x54ecbe(0x1f9)in _0x7c4800&&(_0x7c4800[_0x54ecbe(0x1f9)]===_0x54ecbe(0x211)||_0x7c4800[_0x54ecbe(0x1f9)]==='Or')){const _0x22ea7d=_0x7c4800;return{'type':_0x22ea7d[_0x54ecbe(0x1f9)],'conditions':_0x22ea7d['conditions'][_0x54ecbe(0x260)](yamlConditionToApi),..._0x22ea7d[_0x54ecbe(0x1f1)]&&{'description':_0x22ea7d['description']}};}const _0x443466=_0x7c4800,_0x1368b3={'type':'Value','leftValue':buildLeftValue(_0x443466),'operator':yamlOperatorToApi(_0x443466[_0x54ecbe(0x24b)]),'exclude':_0x443466[_0x54ecbe(0x21d)]??![],'arrayMatching':_0x443466[_0x54ecbe(0x21b)]??_0x54ecbe(0x23d)};return _0x443466['limit']!==undefined&&(_0x1368b3['limit']=_0x443466[_0x54ecbe(0x20e)]),_0x1368b3;}function buildLeftValue(_0x819952){const _0xbbd188=a107_0x1a38,_0x1426aa={'name':_0x819952['attribute']};return _0x819952['aggregation']&&(_0x1426aa[_0xbbd188(0x221)]={'type':_0x819952[_0xbbd188(0x221)][_0xbbd188(0x1f9)],..._0x819952[_0xbbd188(0x221)][_0xbbd188(0x248)]&&{'groupingColumns':_0x819952[_0xbbd188(0x221)][_0xbbd188(0x248)]}}),_0x819952[_0xbbd188(0x1dc)]&&(_0x1426aa[_0xbbd188(0x1dc)]={'name':_0x819952['source']}),_0x819952[_0xbbd188(0x202)]&&(_0x1426aa[_0xbbd188(0x202)]=yamlRuleToApi(_0x819952['filter'])),_0x1426aa;}function yamlOperatorToApi(_0x2d9d07){const _0x479159=a107_0x1a38,_0xa94ab0={'type':mapYamlOperatorType(_0x2d9d07[_0x479159(0x1f9)]),'not':_0x2d9d07[_0x479159(0x1fc)]??![]},_0x2cb04e=getEffectiveValue(_0x2d9d07);if(_0x2cb04e!==undefined){if(Array[_0x479159(0x22d)](_0x2cb04e))_0xa94ab0['rightValues']=_0x2cb04e;else isTemporalOperator(_0x2d9d07[_0x479159(0x1f9)])?_0xa94ab0[_0x479159(0x22c)]=_0x2cb04e:_0xa94ab0[_0x479159(0x25d)]=_0x2cb04e;}return _0x2d9d07['unit']&&(_0xa94ab0[_0x479159(0x246)]=_0x2d9d07[_0x479159(0x246)]),_0xa94ab0;}function mapYamlOperatorType(_0x343946){return _0x343946;}export function toYamlString(_0x2c8df7){const _0x53ebd0=a107_0x1a38,_0x1424de=JSON['parse'](JSON[_0x53ebd0(0x1e6)](_0x2c8df7)),_0x122fdb=a107_0x1a547d[_0x53ebd0(0x1e6)](_0x1424de,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x53ebd0(0x1f7)}),_0x52c5ba=[_0x53ebd0(0x222)];let _0x164c4e=_0x122fdb;for(const _0x1d43d0 of _0x52c5ba){_0x164c4e=_0x164c4e[_0x53ebd0(0x25f)](new RegExp('^('+_0x1d43d0+')','m'),(_0x2b7d65,_0x32bd4d,_0x2d63dc)=>{if(_0x2d63dc===0x0||_0x164c4e[_0x2d63dc-0x1]==='\x0a'&&_0x164c4e[_0x2d63dc-0x2]==='\x0a')return _0x32bd4d;return'\x0a'+_0x32bd4d;});}return _0x164c4e;}export function parseYamlString(_0x161940){const _0x3fcfb0=a107_0x1a38,_0x4bb178=a107_0x1a547d[_0x3fcfb0(0x1f3)](_0x161940);if(!_0x4bb178['name'])throw new Error(_0x3fcfb0(0x231));if(_0x4bb178[_0x3fcfb0(0x1f9)]&&_0x4bb178[_0x3fcfb0(0x1f9)]!==_0x3fcfb0(0x25b))throw new Error(_0x3fcfb0(0x204)+_0x4bb178[_0x3fcfb0(0x1f9)]);return _0x4bb178;}export function isSegmentYaml(_0x4ab2fe){const _0x499149=a107_0x1a38;if(typeof _0x4ab2fe!=='object'||_0x4ab2fe===null)return![];const _0x27d63e=_0x4ab2fe;return _0x27d63e['type']==='segment'||_0x27d63e[_0x499149(0x1f9)]===undefined;}export function generateTemplate(_0x548470=a107_0x6fd5bf(0x1d8)){const _0x7c8375=a107_0x6fd5bf,_0x1a13d4={'type':_0x7c8375(0x25b),'name':_0x548470,'description':_0x7c8375(0x1ec),'rule':{'type':_0x7c8375(0x211),'conditions':[{'type':_0x7c8375(0x1e1),'attribute':'attribute_name','operator':{'type':'Equal','value':_0x7c8375(0x22c)}}]}};return toYamlString(_0x1a13d4);}export function segmentToYamlString(_0x5414f0){const _0x3317de=a107_0x6fd5bf,_0x2acf4f=JSON[_0x3317de(0x1f3)](JSON[_0x3317de(0x1e6)](_0x5414f0)),_0x330f5d=a107_0x1a547d['stringify'](_0x2acf4f,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x3317de(0x1f7)}),_0xa44915=[_0x3317de(0x222),_0x3317de(0x242)];let _0x1e93c5=_0x330f5d;for(const _0x57e11b of _0xa44915){_0x1e93c5=_0x1e93c5[_0x3317de(0x25f)](new RegExp('^('+_0x57e11b+')','m'),(_0x2333c5,_0x5ecf52,_0x35bead)=>{if(_0x35bead===0x0||_0x1e93c5[_0x35bead-0x1]==='\x0a'&&_0x1e93c5[_0x35bead-0x2]==='\x0a')return _0x5ecf52;return'\x0a'+_0x5ecf52;});}return _0x1e93c5;}export function parseSegmentYamlFile(_0x412ba3){const _0xbf6650=a107_0x6fd5bf,_0x41f7d2=a107_0x1a547d[_0xbf6650(0x1f3)](_0x412ba3);if(!_0x41f7d2[_0xbf6650(0x1db)])throw new Error(_0xbf6650(0x231));return _0x41f7d2;}export function normalizeChildSegmentYaml(_0x4ae0e4){const _0xa8f9f5=a107_0x6fd5bf;return{'type':_0xa8f9f5(0x25b),'name':_0x4ae0e4[_0xa8f9f5(0x1db)],..._0x4ae0e4[_0xa8f9f5(0x1f1)]!==undefined&&{'description':_0x4ae0e4['description']},..._0x4ae0e4[_0xa8f9f5(0x228)]!==undefined&&{'folder':_0x4ae0e4[_0xa8f9f5(0x228)]},..._0x4ae0e4[_0xa8f9f5(0x200)]&&{'rule':normalizeRule(_0x4ae0e4[_0xa8f9f5(0x200)])},..._0x4ae0e4[_0xa8f9f5(0x1d6)]!==undefined&&{'kind':_0x4ae0e4[_0xa8f9f5(0x1d6)]},..._0x4ae0e4[_0xa8f9f5(0x256)]!==undefined&&{'visible':_0x4ae0e4[_0xa8f9f5(0x256)]},..._0x4ae0e4[_0xa8f9f5(0x212)]&&{'activations':_0x4ae0e4[_0xa8f9f5(0x212)]['map'](normalizeActivation)}};}export function normalizeRule(_0x244793){const _0x576b13=a107_0x6fd5bf;return{'type':_0x244793[_0x576b13(0x1f9)],'conditions':_0x244793['conditions'][_0x576b13(0x260)](normalizeCondition),..._0x244793['description']!==undefined&&{'description':_0x244793[_0x576b13(0x1f1)]}};}function normalizeCondition(_0x4be31d){const _0xb98eef=a107_0x6fd5bf;if(_0xb98eef(0x25b)in _0x4be31d&&(_0x4be31d[_0xb98eef(0x1f9)]==='include'||_0x4be31d[_0xb98eef(0x1f9)]===_0xb98eef(0x21d))){const _0x5b332c=_0x4be31d;return{'type':_0x5b332c[_0xb98eef(0x1f9)],'segment':_0x5b332c[_0xb98eef(0x25b)]};}if(_0xb98eef(0x1f9)in _0x4be31d&&(_0x4be31d[_0xb98eef(0x1f9)]===_0xb98eef(0x211)||_0x4be31d[_0xb98eef(0x1f9)]==='Or')){const _0x3c4d6c=_0x4be31d;return{'type':_0x3c4d6c[_0xb98eef(0x1f9)],'conditions':_0x3c4d6c[_0xb98eef(0x23a)]['map'](normalizeCondition),..._0x3c4d6c[_0xb98eef(0x1f1)]!==undefined&&{'description':_0x3c4d6c[_0xb98eef(0x1f1)]}};}const _0x4d3ebe=_0x4be31d;return{'type':'Value','attribute':_0x4d3ebe[_0xb98eef(0x207)],'operator':normalizeOperator(_0x4d3ebe[_0xb98eef(0x24b)]),..._0x4d3ebe[_0xb98eef(0x21b)]!==undefined&&{'arrayMatching':_0x4d3ebe[_0xb98eef(0x21b)]},..._0x4d3ebe[_0xb98eef(0x21d)]!==undefined&&{'exclude':_0x4d3ebe[_0xb98eef(0x21d)]},..._0x4d3ebe[_0xb98eef(0x221)]!==undefined&&{'aggregation':_0x4d3ebe[_0xb98eef(0x221)]},..._0x4d3ebe[_0xb98eef(0x1dc)]!==undefined&&{'source':_0x4d3ebe[_0xb98eef(0x1dc)]},..._0x4d3ebe['filter']!==undefined&&{'filter':normalizeRule(_0x4d3ebe[_0xb98eef(0x202)])},..._0x4d3ebe[_0xb98eef(0x20e)]!==undefined&&{'limit':_0x4d3ebe[_0xb98eef(0x20e)]}};}function normalizeOperator(_0x5eb045){const _0x2f48f2=a107_0x6fd5bf,_0x442d8f=getEffectiveValue(_0x5eb045);return{'type':_0x5eb045['type'],..._0x5eb045['not']!==undefined&&{'not':_0x5eb045['not']},..._0x442d8f!==undefined&&{'value':_0x442d8f},..._0x5eb045['min']!==undefined&&{'min':_0x5eb045[_0x2f48f2(0x214)]},..._0x5eb045[_0x2f48f2(0x1e8)]!==undefined&&{'max':_0x5eb045[_0x2f48f2(0x1e8)]},..._0x5eb045[_0x2f48f2(0x246)]!==undefined&&{'unit':_0x5eb045[_0x2f48f2(0x246)]},..._0x5eb045['duration']!==undefined&&{'duration':_0x5eb045['duration']},..._0x5eb045[_0x2f48f2(0x1e7)]!==undefined&&{'from':_0x5eb045[_0x2f48f2(0x1e7)]}};}function normalizeActivation(_0x5a9310){const _0x24f368=a107_0x6fd5bf;return{'name':_0x5a9310['name'],'connection':_0x5a9310[_0x24f368(0x20c)],..._0x5a9310[_0x24f368(0x1f1)]!==undefined&&{'description':_0x5a9310[_0x24f368(0x1f1)]},..._0x5a9310[_0x24f368(0x1e0)]!==undefined&&{'all_columns':_0x5a9310[_0x24f368(0x1e0)]},..._0x5a9310['columns']!==undefined&&{'columns':_0x5a9310[_0x24f368(0x224)]},..._0x5a9310[_0x24f368(0x1dd)]!==undefined&&{'behavior':_0x5a9310[_0x24f368(0x1dd)]},..._0x5a9310[_0x24f368(0x24d)]!==undefined&&{'schedule':_0x5a9310[_0x24f368(0x24d)]},..._0x5a9310[_0x24f368(0x244)]!==undefined&&{'notification':_0x5a9310['notification']},..._0x5a9310[_0x24f368(0x20f)]!==undefined&&{'connector_config':_0x5a9310[_0x24f368(0x20f)]},..._0x5a9310[_0x24f368(0x257)]!==undefined&&{'activation_template_id':_0x5a9310[_0x24f368(0x257)]}};}export function activationResponseToDef(_0x4cac55,_0x2a46fe,_0x4f362f){const _0x271c27=a107_0x6fd5bf,_0x2b823c=_0x4cac55['connectionId']||'',_0x227f4c=_0x4f362f?.[_0x271c27(0x1f5)](_0x2b823c)??_0x2b823c,_0x29797b={'name':_0x4cac55['name'],'connection':_0x227f4c};_0x4cac55[_0x271c27(0x1f1)]&&(_0x29797b['description']=_0x4cac55['description']);let _0x22a43c=[];_0x4cac55[_0x271c27(0x224)]&&_0x4cac55[_0x271c27(0x224)]['length']>0x0&&(_0x22a43c=_0x4cac55[_0x271c27(0x224)][_0x271c27(0x202)](_0x85d925=>_0x85d925&&_0x85d925[_0x271c27(0x1db)])[_0x271c27(0x260)](_0x30b445=>{const _0x284623=_0x271c27;if(_0x30b445[_0x284623(0x1f9)]||_0x30b445[_0x284623(0x1e3)])return{'name':_0x30b445[_0x284623(0x1db)],..._0x30b445[_0x284623(0x1f9)]&&{'type':_0x30b445[_0x284623(0x1f9)]},..._0x30b445[_0x284623(0x1e3)]&&{'visibility':_0x30b445[_0x284623(0x1e3)]}};return _0x30b445[_0x284623(0x1db)];}));_0x22a43c['length']>0x0&&(_0x29797b['columns']=_0x22a43c);_0x4cac55['allColumns']!==undefined&&(_0x4cac55['allColumns']===![]&&_0x22a43c[_0x271c27(0x1ee)]===0x0?_0x29797b[_0x271c27(0x1e0)]=!![]:_0x29797b[_0x271c27(0x1e0)]=_0x4cac55[_0x271c27(0x1fd)]);const _0x474b30={};let _0x21f4c8=![];_0x4cac55[_0x271c27(0x1da)]&&(_0x474b30[_0x271c27(0x1f9)]=_0x4cac55[_0x271c27(0x1da)],_0x21f4c8=!![]);_0x4cac55[_0x271c27(0x236)]&&(_0x474b30[_0x271c27(0x20b)]=_0x4cac55['repeatUnit'],_0x21f4c8=!![]);_0x4cac55[_0x271c27(0x1fa)]!==undefined&&_0x4cac55[_0x271c27(0x1fa)]!==null&&(_0x474b30[_0x271c27(0x1eb)]=_0x4cac55[_0x271c27(0x1fa)],_0x21f4c8=!![]);_0x4cac55['repeatSubFrequency']&&_0x4cac55['repeatSubFrequency'][_0x271c27(0x1ee)]>0x0&&(_0x474b30[_0x271c27(0x219)]=_0x4cac55[_0x271c27(0x1fe)],_0x21f4c8=!![]);_0x4cac55[_0x271c27(0x243)]!==undefined&&(_0x474b30[_0x271c27(0x1d4)]=_0x4cac55['startAt'],_0x21f4c8=!![]);_0x4cac55[_0x271c27(0x24a)]!==undefined&&(_0x474b30[_0x271c27(0x201)]=_0x4cac55['endOn'],_0x21f4c8=!![]);_0x4cac55['timezone']&&(_0x474b30[_0x271c27(0x226)]=_0x4cac55[_0x271c27(0x226)],_0x21f4c8=!![]);_0x21f4c8&&(_0x29797b[_0x271c27(0x24d)]=_0x474b30);(_0x4cac55[_0x271c27(0x215)]&&_0x4cac55[_0x271c27(0x215)][_0x271c27(0x1ee)]>0x0||_0x4cac55[_0x271c27(0x258)]&&_0x4cac55[_0x271c27(0x258)][_0x271c27(0x1ee)]>0x0)&&(_0x29797b[_0x271c27(0x244)]={},_0x4cac55[_0x271c27(0x215)]&&_0x4cac55[_0x271c27(0x215)][_0x271c27(0x1ee)]>0x0&&(_0x29797b[_0x271c27(0x244)][_0x271c27(0x23f)]=_0x4cac55[_0x271c27(0x215)]),_0x4cac55[_0x271c27(0x258)]&&_0x4cac55['emailRecipients'][_0x271c27(0x1ee)]>0x0&&(_0x29797b[_0x271c27(0x244)][_0x271c27(0x23b)]=_0x4cac55[_0x271c27(0x258)][_0x271c27(0x260)](_0x3cdf5a=>{const _0x34c11c=_0x271c27,_0xe79ec7=_0x2a46fe?.[_0x34c11c(0x1f5)](_0x3cdf5a);return _0xe79ec7??String(_0x3cdf5a);})));_0x4cac55[_0x271c27(0x229)]&&Object[_0x271c27(0x25a)](_0x4cac55[_0x271c27(0x229)])[_0x271c27(0x1ee)]>0x0&&(_0x29797b['connector_config']=normalizeConnectorConfigForYaml(_0x4cac55[_0x271c27(0x229)]));_0x4cac55[_0x271c27(0x21e)]&&(_0x29797b['activation_template_id']=_0x4cac55[_0x271c27(0x21e)]);if(_0x4cac55['syndicationBehavior']){const _0x5a49bd={},_0x16fdb0=_0x4cac55[_0x271c27(0x1ff)];_0x16fdb0['columns']&&_0x16fdb0[_0x271c27(0x224)][_0x271c27(0x1ee)]>0x0&&(_0x5a49bd[_0x271c27(0x224)]=_0x16fdb0['columns'][_0x271c27(0x202)](_0x3f32fc=>_0x3f32fc&&_0x3f32fc['name'])[_0x271c27(0x260)](_0x2752fe=>({'name':_0x2752fe[_0x271c27(0x1db)],..._0x2752fe[_0x271c27(0x1f9)]&&{'type':_0x2752fe[_0x271c27(0x1f9)]},..._0x2752fe['visibility']&&{'visibility':_0x2752fe[_0x271c27(0x1e3)]}}))),_0x16fdb0['behaviorTableName']&&(_0x5a49bd[_0x271c27(0x1ef)]=_0x16fdb0[_0x271c27(0x21c)]),_0x16fdb0[_0x271c27(0x205)]!==undefined&&(_0x5a49bd[_0x271c27(0x220)]=_0x16fdb0[_0x271c27(0x205)]),_0x16fdb0['joinStrategy']&&(_0x5a49bd[_0x271c27(0x235)]=_0x16fdb0[_0x271c27(0x245)]),_0x16fdb0['formatting']&&(_0x5a49bd[_0x271c27(0x24c)]=_0x16fdb0['formatting']),_0x16fdb0[_0x271c27(0x230)]&&_0x16fdb0[_0x271c27(0x230)]['length']>0x0&&(_0x5a49bd['order_by']=_0x16fdb0['orderBy']),Object[_0x271c27(0x25a)](_0x5a49bd)[_0x271c27(0x1ee)]>0x0&&(_0x29797b['behavior']=_0x5a49bd);}return _0x29797b;}export function journeyActivationStepToYaml(_0x343648,_0x363386,_0x283af5){const _0x387333=a107_0x6fd5bf,_0x5ee671=_0x343648[_0x387333(0x208)][_0x387333(0x23e)],_0x5cf94b=_0x5ee671[_0x387333(0x262)]||'',_0x3924e8=_0x283af5?.[_0x387333(0x1f5)](_0x5cf94b)??_0x5cf94b,_0x1349a2={'name':_0x5ee671[_0x387333(0x1db)]||'','connection':_0x3924e8};_0x5ee671[_0x387333(0x1f1)]&&(_0x1349a2[_0x387333(0x1f1)]=_0x5ee671[_0x387333(0x1f1)]);let _0x3809f0=[];_0x5ee671[_0x387333(0x224)]&&_0x5ee671[_0x387333(0x224)][_0x387333(0x1ee)]>0x0&&(_0x3809f0=_0x5ee671[_0x387333(0x224)][_0x387333(0x202)](_0x28e4c8=>_0x28e4c8&&_0x28e4c8[_0x387333(0x1db)])[_0x387333(0x260)](_0x15413f=>{const _0x410cc4=_0x387333;if(_0x15413f[_0x410cc4(0x1f9)]||_0x15413f[_0x410cc4(0x1e3)])return{'name':_0x15413f[_0x410cc4(0x1db)],..._0x15413f[_0x410cc4(0x1f9)]&&{'type':_0x15413f[_0x410cc4(0x1f9)]},..._0x15413f['visibility']&&{'visibility':_0x15413f[_0x410cc4(0x1e3)]}};return _0x15413f[_0x410cc4(0x1db)];}));_0x3809f0[_0x387333(0x1ee)]>0x0&&(_0x1349a2[_0x387333(0x224)]=_0x3809f0);_0x5ee671[_0x387333(0x1fd)]!==undefined&&(_0x5ee671[_0x387333(0x1fd)]===![]&&_0x3809f0['length']===0x0?_0x1349a2[_0x387333(0x1e0)]=!![]:_0x1349a2[_0x387333(0x1e0)]=_0x5ee671[_0x387333(0x1fd)]);const _0x1d762f={};let _0x39a440=![];_0x5ee671[_0x387333(0x1da)]&&(_0x1d762f[_0x387333(0x1f9)]=_0x5ee671[_0x387333(0x1da)],_0x39a440=!![]);_0x5ee671['repeatUnit']&&(_0x1d762f['repeat_unit']=_0x5ee671[_0x387333(0x236)],_0x39a440=!![]);_0x5ee671[_0x387333(0x1fa)]!==undefined&&_0x5ee671['repeatFrequency']!==null&&(_0x1d762f[_0x387333(0x1eb)]=_0x5ee671['repeatFrequency'],_0x39a440=!![]);_0x5ee671[_0x387333(0x243)]!==undefined&&(_0x1d762f['start_at']=_0x5ee671[_0x387333(0x243)],_0x39a440=!![]);_0x5ee671[_0x387333(0x24a)]!==undefined&&(_0x1d762f[_0x387333(0x201)]=_0x5ee671[_0x387333(0x24a)],_0x39a440=!![]);_0x5ee671[_0x387333(0x226)]&&(_0x1d762f[_0x387333(0x226)]=_0x5ee671[_0x387333(0x226)],_0x39a440=!![]);_0x39a440&&(_0x1349a2['schedule']=_0x1d762f);(_0x5ee671[_0x387333(0x215)]&&_0x5ee671[_0x387333(0x215)][_0x387333(0x1ee)]>0x0||_0x5ee671[_0x387333(0x258)]&&_0x5ee671['emailRecipients']['length']>0x0)&&(_0x1349a2[_0x387333(0x244)]={},_0x5ee671['notifyOn']&&_0x5ee671['notifyOn'][_0x387333(0x1ee)]>0x0&&(_0x1349a2[_0x387333(0x244)][_0x387333(0x23f)]=_0x5ee671[_0x387333(0x215)]),_0x5ee671[_0x387333(0x258)]&&_0x5ee671[_0x387333(0x258)][_0x387333(0x1ee)]>0x0&&(_0x1349a2['notification'][_0x387333(0x23b)]=_0x5ee671[_0x387333(0x258)][_0x387333(0x260)](_0x29c8c3=>{const _0x245b96=_0x387333,_0x2778e5=_0x363386?.[_0x245b96(0x1f5)](_0x29c8c3);return _0x2778e5??String(_0x29c8c3);})));_0x5ee671[_0x387333(0x229)]&&Object[_0x387333(0x25a)](_0x5ee671[_0x387333(0x229)])[_0x387333(0x1ee)]>0x0&&(_0x1349a2[_0x387333(0x20f)]=normalizeConnectorConfigForYaml(_0x5ee671[_0x387333(0x229)]));_0x5ee671[_0x387333(0x21e)]&&(_0x1349a2['activation_template_id']=_0x5ee671['activationTemplateId']);if(_0x5ee671[_0x387333(0x1ff)]){const _0x1a4d3d={},_0xfddae0=_0x5ee671['syndicationBehavior'];_0xfddae0['columns']&&_0xfddae0[_0x387333(0x224)]['length']>0x0&&(_0x1a4d3d[_0x387333(0x224)]=_0xfddae0['columns'][_0x387333(0x202)](_0x2068d2=>_0x2068d2&&_0x2068d2[_0x387333(0x1db)])[_0x387333(0x260)](_0x22c0ff=>({'name':_0x22c0ff[_0x387333(0x1db)],..._0x22c0ff[_0x387333(0x1f9)]&&{'type':_0x22c0ff['type']},..._0x22c0ff[_0x387333(0x1e3)]&&{'visibility':_0x22c0ff['visibility']}}))),_0xfddae0[_0x387333(0x21c)]&&(_0x1a4d3d[_0x387333(0x1ef)]=_0xfddae0[_0x387333(0x21c)]),_0xfddae0[_0x387333(0x205)]!==undefined&&(_0x1a4d3d['join_row']=_0xfddae0[_0x387333(0x205)]),_0xfddae0['joinStrategy']&&(_0x1a4d3d[_0x387333(0x235)]=_0xfddae0[_0x387333(0x245)]),_0xfddae0[_0x387333(0x24c)]&&(_0x1a4d3d[_0x387333(0x24c)]=_0xfddae0[_0x387333(0x24c)]),_0xfddae0[_0x387333(0x230)]&&_0xfddae0[_0x387333(0x230)][_0x387333(0x1ee)]>0x0&&(_0x1a4d3d[_0x387333(0x1f8)]=_0xfddae0['orderBy']),Object['keys'](_0x1a4d3d)[_0x387333(0x1ee)]>0x0&&(_0x1349a2[_0x387333(0x1dd)]=_0x1a4d3d);}return _0x1349a2;}export function segmentWithActivationsToYaml(_0x23dc94,_0x142b87,_0x8eaee4,_0x126588,_0x306da0){const _0x4aad9d=a107_0x6fd5bf,_0x4e4f66=segmentResponseToDefSync(_0x23dc94,_0x8eaee4);return _0x142b87[_0x4aad9d(0x1ee)]>0x0&&(_0x4e4f66[_0x4aad9d(0x212)]=_0x142b87[_0x4aad9d(0x260)](_0x1dd9dc=>activationResponseToDef(_0x1dd9dc,_0x126588,_0x306da0))),_0x4e4f66;}function normalizeColumn(_0x5cb253){const _0x319971=a107_0x6fd5bf;if(typeof _0x5cb253==='string')return{'name':_0x5cb253};return{'name':_0x5cb253[_0x319971(0x1db)],..._0x5cb253['type']&&{'type':_0x5cb253[_0x319971(0x1f9)]},..._0x5cb253[_0x319971(0x1e3)]&&{'visibility':_0x5cb253[_0x319971(0x1e3)]}};}export async function activationDefToCreateRequest(_0x15f30b,_0x16b8c4){const _0x3e8da4=a107_0x6fd5bf,_0x1fc711=_0x16b8c4?.[_0x3e8da4(0x22a)],_0xef536f=_0x16b8c4?.['connectionNameToIdMap'],_0xe4943c=_0x15f30b[_0x3e8da4(0x20c)];let _0x531fba;const _0x2b306f=parseInt(_0xe4943c,0xa);if(!isNaN(_0x2b306f)&&String(_0x2b306f)===_0xe4943c)_0x531fba=_0x2b306f;else{const _0x2e65ff=_0xef536f?.[_0x3e8da4(0x1f5)](_0xe4943c);if(_0x2e65ff===undefined)throw new SDKError(ErrorCode[_0x3e8da4(0x232)],'Unknown\x20connection:\x20'+_0xe4943c,undefined,{'helpText':'Use\x20\x27tdx\x20connections\x27\x20to\x20list\x20available\x20connections'});_0x531fba=_0x2e65ff;}const _0xf88ae6={'name':_0x15f30b['name'],'connectionId':_0x531fba};_0x15f30b[_0x3e8da4(0x1f1)]&&(_0xf88ae6[_0x3e8da4(0x1f1)]=_0x15f30b[_0x3e8da4(0x1f1)]);let _0xd66e87=[];_0x15f30b[_0x3e8da4(0x224)]&&_0x15f30b[_0x3e8da4(0x224)][_0x3e8da4(0x1ee)]>0x0&&(_0xd66e87=_0x15f30b['columns'][_0x3e8da4(0x202)](_0x3cee49=>_0x3cee49!=null)[_0x3e8da4(0x260)](normalizeColumn));_0xd66e87[_0x3e8da4(0x1ee)]>0x0&&(_0xf88ae6[_0x3e8da4(0x224)]=_0xd66e87);_0x15f30b[_0x3e8da4(0x1e0)]!==undefined&&(_0x15f30b[_0x3e8da4(0x1e0)]===![]&&_0xd66e87[_0x3e8da4(0x1ee)]===0x0?_0xf88ae6['allColumns']=!![]:_0xf88ae6[_0x3e8da4(0x1fd)]=_0x15f30b[_0x3e8da4(0x1e0)]);if(_0x15f30b[_0x3e8da4(0x24d)]){const _0x5737e5=_0x15f30b[_0x3e8da4(0x24d)];_0x5737e5['type']&&(_0xf88ae6['scheduleType']=_0x5737e5['type']),_0x5737e5[_0x3e8da4(0x20b)]&&(_0xf88ae6[_0x3e8da4(0x236)]=_0x5737e5[_0x3e8da4(0x20b)]),_0x5737e5[_0x3e8da4(0x1eb)]!==undefined&&(_0xf88ae6['repeatFrequency']=_0x5737e5[_0x3e8da4(0x1eb)]),_0x5737e5['repeat_sub_frequency']&&(_0xf88ae6[_0x3e8da4(0x1fe)]=_0x5737e5[_0x3e8da4(0x219)]),_0x5737e5['start_at']!==undefined&&(_0xf88ae6['startAt']=_0x5737e5[_0x3e8da4(0x1d4)]),_0x5737e5['end_on']!==undefined&&(_0xf88ae6[_0x3e8da4(0x24a)]=_0x5737e5[_0x3e8da4(0x201)]),_0x5737e5[_0x3e8da4(0x226)]&&(_0xf88ae6['timezone']=_0x5737e5[_0x3e8da4(0x226)]);}_0x15f30b['notification']&&(_0x15f30b['notification'][_0x3e8da4(0x23f)]&&(_0xf88ae6[_0x3e8da4(0x215)]=_0x15f30b[_0x3e8da4(0x244)]['notify_on']),_0x15f30b['notification']['email_recipients']&&(_0xf88ae6[_0x3e8da4(0x258)]=_0x15f30b[_0x3e8da4(0x244)][_0x3e8da4(0x23b)][_0x3e8da4(0x260)](_0xdae8f9=>{const _0x2ffd91=_0x3e8da4,_0x2b5339=Number(_0xdae8f9);if(!isNaN(_0x2b5339)&&String(_0x2b5339)===_0xdae8f9)return _0x2b5339;const _0x49a095=_0x1fc711?.[_0x2ffd91(0x1f5)](_0xdae8f9[_0x2ffd91(0x225)]());if(_0x49a095===undefined)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x2ffd91(0x22b)+_0xdae8f9+_0x2ffd91(0x1d5));return _0x49a095;})));if(_0x15f30b['connector_config']){const _0xd80183=_0x16b8c4?.[_0x3e8da4(0x24f)]?.[_0x3e8da4(0x1f5)](_0xe4943c);if(_0xd80183&&_0x16b8c4?.[_0x3e8da4(0x261)])try{const _0x581d47=await _0x16b8c4[_0x3e8da4(0x261)](_0xd80183),_0x5f573a=validateConnectorConfig(_0x15f30b[_0x3e8da4(0x20f)],_0x581d47);if(!_0x5f573a['valid'])throw new SDKError(ErrorCode[_0x3e8da4(0x24e)],_0x3e8da4(0x238)+_0x15f30b[_0x3e8da4(0x1db)]+_0x3e8da4(0x233)+formatValidationErrors(_0x5f573a['errors']),undefined,{'helpText':_0x3e8da4(0x254)+_0xd80183+_0x3e8da4(0x22f)+formatSchemaAsHelp(_0x581d47)});if(_0x5f573a['warnings'][_0x3e8da4(0x1ee)]>0x0){const _0x418d16=formatValidationWarnings(_0x5f573a[_0x3e8da4(0x1e9)]);console[_0x3e8da4(0x218)](_0x3e8da4(0x217)+_0x15f30b[_0x3e8da4(0x1db)]+_0x3e8da4(0x233)+_0x418d16);}_0xf88ae6[_0x3e8da4(0x229)]=transformConfigToLegacy(_0x15f30b[_0x3e8da4(0x20f)],_0x581d47);}catch(_0x100cd6){if(_0x100cd6 instanceof SDKError&&_0x100cd6[_0x3e8da4(0x1d7)]===ErrorCode[_0x3e8da4(0x255)])_0xf88ae6['connectorConfig']=_0x15f30b[_0x3e8da4(0x20f)];else throw _0x100cd6;}else _0xf88ae6[_0x3e8da4(0x229)]=_0x15f30b['connector_config'];}_0x15f30b[_0x3e8da4(0x257)]!==undefined&&(_0xf88ae6[_0x3e8da4(0x21e)]=_0x15f30b[_0x3e8da4(0x257)]);if(_0x15f30b[_0x3e8da4(0x1dd)]){const _0x10f785=_0x15f30b[_0x3e8da4(0x1dd)],_0x5db522={};if(_0x10f785[_0x3e8da4(0x224)]&&_0x10f785[_0x3e8da4(0x224)][_0x3e8da4(0x1ee)]>0x0){const _0x28241f=_0x10f785['columns']['filter'](_0x2db163=>_0x2db163&&_0x2db163[_0x3e8da4(0x1db)]);_0x28241f[_0x3e8da4(0x1ee)]>0x0&&(_0x5db522[_0x3e8da4(0x224)]=_0x28241f);}_0x10f785['behavior_table']&&(_0x5db522[_0x3e8da4(0x21c)]=_0x10f785[_0x3e8da4(0x1ef)]),_0x10f785['join_row']!==undefined&&(_0x5db522['joinRow']=_0x10f785[_0x3e8da4(0x220)]),_0x10f785[_0x3e8da4(0x235)]&&(_0x5db522[_0x3e8da4(0x245)]=_0x10f785[_0x3e8da4(0x235)]),_0x10f785[_0x3e8da4(0x24c)]&&(_0x5db522[_0x3e8da4(0x24c)]=_0x10f785['formatting']),_0x10f785[_0x3e8da4(0x1f8)]&&(_0x5db522[_0x3e8da4(0x230)]=_0x10f785[_0x3e8da4(0x1f8)]),_0xf88ae6['syndicationBehavior']=_0x5db522;}return _0xf88ae6;}export async function activationDefToUpdateRequest(_0xc10028,_0x31818e){return activationDefToCreateRequest(_0xc10028,_0x31818e);}export function deepSortObject(_0x1b19af){const _0x154044=a107_0x6fd5bf;if(_0x1b19af===null||typeof _0x1b19af!==_0x154044(0x250))return _0x1b19af;if(Array['isArray'](_0x1b19af))return _0x1b19af[_0x154044(0x260)](deepSortObject)[_0x154044(0x1f0)]((_0x3705e0,_0x5ef1f6)=>JSON['stringify'](_0x3705e0)['localeCompare'](JSON['stringify'](_0x5ef1f6)));const _0x9d1efe={};for(const _0x24fb1a of Object['keys'](_0x1b19af)[_0x154044(0x1f0)]()){_0x9d1efe[_0x24fb1a]=deepSortObject(_0x1b19af[_0x24fb1a]);}return _0x9d1efe;}function a107_0x1a38(_0x41a5c2,_0x19a023){_0x41a5c2=_0x41a5c2-0x1d4;const _0x535630=a107_0x5356();let _0x1a38c9=_0x535630[_0x41a5c2];return _0x1a38c9;}export function serializeRule(_0x4720bf){const _0x505d29=a107_0x6fd5bf;return JSON[_0x505d29(0x1e6)](deepSortObject(_0x4720bf));}export function normalizeRuleForMatching(_0x2a188a){return normalizeConditionsForMatching(_0x2a188a);}function normalizeConditionsForMatching(_0xf5ad1){const _0x51ff55=a107_0x6fd5bf;if(_0xf5ad1===null||typeof _0xf5ad1!=='object')return _0xf5ad1;if(Array[_0x51ff55(0x22d)](_0xf5ad1))return _0xf5ad1[_0x51ff55(0x260)](normalizeConditionsForMatching);const _0x40094e=_0xf5ad1;if((_0x40094e[_0x51ff55(0x1f9)]===_0x51ff55(0x23c)||_0x40094e[_0x51ff55(0x1f9)]===_0x51ff55(0x21d))&&typeof _0x40094e['segment']===_0x51ff55(0x20a))return{..._0x40094e,'segment':_0x51ff55(0x213)};const _0x4f05d2={};for(const _0x58bbc1 of Object[_0x51ff55(0x25a)](_0x40094e)){_0x4f05d2[_0x58bbc1]=normalizeConditionsForMatching(_0x40094e[_0x58bbc1]);}return _0x4f05d2;}export function serializeRuleForMatching(_0x3a835c){const _0x4641ad=a107_0x6fd5bf;return JSON[_0x4641ad(0x1e6)](deepSortObject(normalizeRuleForMatching(_0x3a835c)));}export function expandSegmentReferences(_0xeb4abb,_0x3d550c,_0x29db92=new Set()){return expandConditions(_0xeb4abb,_0x3d550c,_0x29db92);}function expandConditions(_0x100582,_0x48796b,_0x23e3c4){const _0x3fcf78=a107_0x6fd5bf;if(_0x100582===null||typeof _0x100582!==_0x3fcf78(0x250))return _0x100582;if(Array[_0x3fcf78(0x22d)](_0x100582))return _0x100582[_0x3fcf78(0x260)](_0x2f5397=>expandConditions(_0x2f5397,_0x48796b,_0x23e3c4));const _0x2f3ade=_0x100582;if((_0x2f3ade[_0x3fcf78(0x1f9)]===_0x3fcf78(0x23c)||_0x2f3ade[_0x3fcf78(0x1f9)]==='exclude')&&typeof _0x2f3ade[_0x3fcf78(0x25b)]===_0x3fcf78(0x20a)){const _0x25fc8f=_0x2f3ade[_0x3fcf78(0x25b)],_0x2f21ba=_0x48796b[_0x3fcf78(0x1f5)](_0x25fc8f);if(_0x2f21ba&&!_0x23e3c4[_0x3fcf78(0x21f)](_0x25fc8f)){const _0x57093f=new Set(_0x23e3c4);_0x57093f[_0x3fcf78(0x227)](_0x25fc8f);const _0x17badd=expandConditions(_0x2f21ba,_0x48796b,_0x57093f);return{'type':_0x2f3ade[_0x3fcf78(0x1f9)],'expanded_rule':_0x17badd};}return{'type':_0x2f3ade[_0x3fcf78(0x1f9)],'expanded_rule':_0x3fcf78(0x1df)};}const _0x3651af={};for(const _0x4606f7 of Object[_0x3fcf78(0x25a)](_0x2f3ade)){_0x3651af[_0x4606f7]=expandConditions(_0x2f3ade[_0x4606f7],_0x48796b,_0x23e3c4);}return _0x3651af;}export function serializeExpandedRule(_0x36f8c4,_0xe66041){const _0x480f08=expandSegmentReferences(_0x36f8c4,_0xe66041);return JSON['stringify'](deepSortObject(_0x480f08));}export function createSegmentNameContext(_0x135376){const _0x52d3bd=a107_0x6fd5bf,_0x170ebd=new Set(),_0x101d04=new Map(),_0x4eb8de=new Map();if(_0x135376)for(const [_0x23d5b0,_0xdccc15]of Object[_0x52d3bd(0x216)](_0x135376)){if(_0xdccc15[_0x52d3bd(0x200)]){const _0xf68186=serializeRule(_0xdccc15[_0x52d3bd(0x200)]);_0x4eb8de[_0x52d3bd(0x263)](_0xf68186,_0x23d5b0),_0x170ebd[_0x52d3bd(0x227)](_0x23d5b0);}}return{'usedNames':_0x170ebd,'ruleHashToName':_0x101d04,'localRuleToName':_0x135376?_0x4eb8de:undefined};}export function resolveSegmentName(_0x2a0130,_0x8ee4d6,_0x5b93f8,_0x34303e){const _0x5c3bcf=a107_0x6fd5bf,_0x342ba1=serializeRule(_0x8ee4d6);if(_0x5b93f8['localRuleToName']){const _0x3955e4=_0x5b93f8[_0x5c3bcf(0x251)]['get'](_0x342ba1);if(_0x3955e4)return{'name':_0x3955e4,'isDuplicate':![],'isLocalMatch':!![]};}const _0x27da7b=_0x5b93f8['ruleHashToName'][_0x5c3bcf(0x1f5)](_0x342ba1);if(_0x27da7b)return{'name':_0x27da7b,'isDuplicate':!![],'isLocalMatch':![]};const _0x2f85d7=_0x34303e(_0x2a0130);let _0x54a9ce=_0x2f85d7||_0x2a0130,_0x286722=_0x54a9ce,_0x48e87a=0x2;while(_0x5b93f8['usedNames']['has'](_0x286722)){_0x286722=_0x54a9ce+'_'+_0x48e87a,_0x48e87a++;}return _0x5b93f8[_0x5c3bcf(0x252)][_0x5c3bcf(0x227)](_0x286722),_0x5b93f8[_0x5c3bcf(0x1ed)]['set'](_0x342ba1,_0x286722),{'name':_0x286722,'isDuplicate':![],'isLocalMatch':![]};}export function collectSegmentRefsFromRule(_0x33bf9a){const _0x567eca=[],_0x3addc5=_0x96278=>{const _0x54940f=a107_0x1a38;if(!_0x96278||typeof _0x96278!==_0x54940f(0x250))return;if(Array[_0x54940f(0x22d)](_0x96278)){_0x96278[_0x54940f(0x1fb)](_0x3addc5);return;}const _0x3a855c=_0x96278;(_0x3a855c[_0x54940f(0x1f9)]===_0x54940f(0x23c)||_0x3a855c['type']===_0x54940f(0x21d))&&typeof _0x3a855c[_0x54940f(0x25b)]===_0x54940f(0x20a)&&_0x567eca['push'](_0x3a855c[_0x54940f(0x25b)]);for(const _0x1ef37a of Object['values'](_0x3a855c)){_0x3addc5(_0x1ef37a);}};return _0x3addc5(_0x33bf9a),_0x567eca;}function a107_0x5356(){const _0x5b0c9f=['source','behavior','isVisible','__UNRESOLVED__','all_columns','Value','\x27:\x20','visibility','].attribute\x20cannot\x20be\x20empty.\x0a','test','stringify','from','max','warnings','TimeWithinPast','repeat_frequency','Segment\x20description','ruleHashToName','length','behavior_table','sort','description','segmentFolderId','parse','Reference','get','4GzSyTk','null','order_by','type','repeatFrequency','forEach','not','allColumns','repeatSubFrequency','syndicationBehavior','rule','end_on','filter','200KVGQWD','YAML\x20type\x20must\x20be\x20\x27segment\x27\x20or\x20omitted,\x20got:\x20','joinRow','111056UGXnvi','attribute','attributes','40LWHlEi','string','repeat_unit','connection','all','limit','connector_config','resolveSegmentName','And','activations','__SEGMENT_REF__','min','notifyOn','entries','connector_config\x20for\x20activation\x20\x22','warn','repeat_sub_frequency','batch','arrayMatching','behaviorTableName','exclude','activationTemplateId','has','join_row','aggregation','rule:','569360vgLQOK','columns','toLowerCase','timezone','add','folder','connectorConfig','emailToIdMap','Unknown\x20email\x20recipient:\x20','value','isArray','38787sLAnfU','\x0a\x0aAvailable\x20fields:\x0a','orderBy','YAML\x20config\x20missing\x20required\x20field:\x20name','CONNECTION_NOT_FOUND','\x22:\x0a','conditions[','join_strategy','repeatUnit','Invalid\x20condition\x20in\x20embedded\x20segment\x20\x27','Invalid\x20connector_config\x20for\x20activation\x20\x22','630936ubEyzP','conditions','email_recipients','include','any','activationParams','notify_on','realtime','505179QIRVGG','activations:','startAt','notification','joinStrategy','unit','1ZuBgFI','groupingColumns','values','endOn','operator','formatting','schedule','CONNECTOR_INVALID_CONFIG','connectionNameToTypeMap','object','localRuleToName','usedNames','every','Connector:\x20','CONNECTOR_SCHEMA_NOT_FOUND','visible','activation_template_id','emailRecipients','48880KXopcO','keys','segment','rightValues','rightValue','leftValue','replace','map','getSchema','connectionId','set','start_at','.\x20Use\x20\x27tdx\x20user\x20list\x27\x20to\x20see\x20valid\x20emails.','kind','code','New\x20Segment','670104cGvSqY','scheduleType','name'];a107_0x5356=function(){return _0x5b0c9f;};return a107_0x5356();}export function validateSegmentRule(_0x35a417,_0x54a35d){const _0x3b6458=a107_0x6fd5bf;if(!_0x54a35d||!_0x54a35d[_0x3b6458(0x23a)])return;for(let _0x41409d=0x0;_0x41409d<_0x54a35d['conditions'][_0x3b6458(0x1ee)];_0x41409d++){const _0x22e261=_0x54a35d[_0x3b6458(0x23a)][_0x41409d];if('type'in _0x22e261&&_0x22e261[_0x3b6458(0x1f9)]===_0x3b6458(0x1e1)){const _0x50ec12=_0x22e261;if(!_0x50ec12['attribute']||_0x50ec12[_0x3b6458(0x207)]==='')throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],_0x3b6458(0x237)+_0x35a417+_0x3b6458(0x1e2)+(_0x3b6458(0x234)+_0x41409d+_0x3b6458(0x1e4))+'Please\x20specify\x20a\x20valid\x20attribute\x20name.');}}}
@@ -1 +1 @@
1
- (function(_0x52bd86,_0x5e24fc){const _0x5e468e=a108_0x1a5e,_0x2a7c2b=_0x52bd86();while(!![]){try{const _0x191485=parseInt(_0x5e468e(0xca))/0x1*(parseInt(_0x5e468e(0xb8))/0x2)+parseInt(_0x5e468e(0xd3))/0x3*(parseInt(_0x5e468e(0xd2))/0x4)+-parseInt(_0x5e468e(0xe7))/0x5*(parseInt(_0x5e468e(0xdc))/0x6)+parseInt(_0x5e468e(0xbd))/0x7+-parseInt(_0x5e468e(0xc4))/0x8+-parseInt(_0x5e468e(0xce))/0x9+-parseInt(_0x5e468e(0xcb))/0xa;if(_0x191485===_0x5e24fc)break;else _0x2a7c2b['push'](_0x2a7c2b['shift']());}catch(_0x216a5a){_0x2a7c2b['push'](_0x2a7c2b['shift']());}}}(a108_0x3dc4,0x4affe));import a108_0xfeed94 from'chalk';import{withProgressSpinner}from'../../utils/spinner.js';function a108_0x1a5e(_0x6459e3,_0x2c4a8b){_0x6459e3=_0x6459e3-0xb2;const _0x3dc40b=a108_0x3dc4();let _0x1a5e82=_0x3dc40b[_0x6459e3];return _0x1a5e82;}function a108_0x3dc4(){const _0x35c0aa=['push','behaviorName','filter','tableName','dim','Behaviors','9780MfpZUO','length','map','varchar','entries','query','slice','execute','attribute','displayName','size','1525KnBvxo','verbose','Attributes','source','sort','name','type','null','Fetching\x20schema...','10cvxhMa','\x0a)\x20AS\x20segment_query\x20LIMIT\x200','column_type','SELECT\x20*\x20FROM\x20(\x0a','error','1782081dBljmW','bold','get','cyan','key','information_schema','parentTableName','123072hqTIjc','fields','Schema\x20query:\x0a','YES','parentColumn','startsWith','116327aHUOoy','2223000JiwsnY','groupingName','setJobId','3275550KLKtBB','\x20\x20\x20\x20','localeCompare','trim','52ixvHAs','131484ASELzt','set','Unknown'];a108_0x3dc4=function(){return _0x35c0aa;};return a108_0x3dc4();}export function buildSchemaResult(_0x197234){const _0x1bbdfd=a108_0x1a5e,_0x507eeb=_0x197234['columns'][_0x1bbdfd(0xde)](_0x42683c=>({'column_name':_0x42683c[_0x1bbdfd(0xb4)],'column_type':_0x42683c[_0x1bbdfd(0xb5)],'null':_0x1bbdfd(0xc7),'key':null,'default':null,'extra':null}));return{..._0x197234,'columns':[{'name':'column_name','type':_0x1bbdfd(0xdf)},{'name':_0x1bbdfd(0xba),'type':_0x1bbdfd(0xdf)},{'name':_0x1bbdfd(0xb6),'type':'varchar'},{'name':_0x1bbdfd(0xc1),'type':_0x1bbdfd(0xdf)},{'name':'default','type':'varchar'},{'name':'extra','type':'varchar'}],'data':_0x507eeb};}export async function executeSchemaQuery(_0x510e28,_0x10d3b0,_0x4f2efb){const _0x5b5a81=a108_0x1a5e,_0xba79e0=_0x510e28[_0x5b5a81(0xd1)]()['replace'](/;+$/,''),_0x3ea2c8=_0x5b5a81(0xbb)+_0xba79e0+_0x5b5a81(0xb9);_0x4f2efb['verbose']&&console[_0x5b5a81(0xbc)](_0x5b5a81(0xc6)+_0x3ea2c8);const _0x114302=await withProgressSpinner(_0x5b5a81(0xb7),async _0xdee6e6=>{const _0x4d8a52=_0x5b5a81,_0x2c1d9d=await _0x10d3b0[_0x4d8a52(0xe1)][_0x4d8a52(0xe3)](_0x3ea2c8,{'catalog':'td','schema':_0x4d8a52(0xc2),'onJobId':_0x553232=>{const _0x318ed8=_0x4d8a52;_0xdee6e6[_0x318ed8(0xcd)](_0x553232);}});return _0x2c1d9d;},{'verbose':_0x4f2efb[_0x5b5a81(0xe8)]});return buildSchemaResult(_0x114302['data']);}export function displayFieldsHumanReadable(_0xd86fd3,_0x315a96){const _0x102b62=a108_0x1a5e,_0x364bb3=_0xd86fd3['filter'](_0x101ec7=>_0x101ec7[_0x102b62(0xb2)]===_0x102b62(0xe4)),_0x3aa400=_0xd86fd3[_0x102b62(0xd8)](_0x3e06b4=>_0x3e06b4[_0x102b62(0xb2)]==='behavior'),_0x3c59a4=new Map();for(const _0x55a96d of _0x364bb3){const _0x226240=_0x55a96d[_0x102b62(0xcc)]||_0x55a96d[_0x102b62(0xc3)]||_0x102b62(0xd5),_0x181434=_0x3c59a4[_0x102b62(0xbf)](_0x226240);_0x181434?_0x181434[_0x102b62(0xc5)][_0x102b62(0xd6)](_0x55a96d):_0x3c59a4[_0x102b62(0xd4)](_0x226240,{'displayName':_0x226240,'tableName':_0x55a96d['parentTableName'],'fields':[_0x55a96d]});}const _0x247b1e=new Map();for(const _0x51f669 of _0x3aa400){const _0x1c2c63=_0x51f669[_0x102b62(0xd7)]||'Unknown',_0x1ea19a=_0x247b1e['get'](_0x1c2c63)||[];_0x1ea19a[_0x102b62(0xd6)](_0x51f669),_0x247b1e[_0x102b62(0xd4)](_0x1c2c63,_0x1ea19a);}console[_0x102b62(0xbc)]('\x0a'+a108_0xfeed94['bold'](_0x315a96));if(_0x3c59a4[_0x102b62(0xe6)]>0x0){console[_0x102b62(0xbc)]('\x0a'+a108_0xfeed94[_0x102b62(0xda)](_0x102b62(0xe9)));const _0x12edc0=[..._0x3c59a4[_0x102b62(0xe0)]()]['sort']((_0x4d3ba7,_0x3c1ca1)=>_0x4d3ba7[0x0][_0x102b62(0xd0)](_0x3c1ca1[0x0]));for(const [,_0x59a811]of _0x12edc0){const _0x3f38a9=_0x59a811['tableName']&&_0x59a811['tableName']!==_0x59a811[_0x102b62(0xe5)]?'\x20'+a108_0xfeed94['dim']('('+_0x59a811[_0x102b62(0xd9)]+')'):'';console['error']('\x20\x20'+a108_0xfeed94[_0x102b62(0xbe)](_0x59a811[_0x102b62(0xe5)])+_0x3f38a9);const _0x552cbf=[..._0x59a811[_0x102b62(0xc5)]][_0x102b62(0xb3)]((_0x3461f2,_0x12e992)=>_0x3461f2[_0x102b62(0xb4)]['localeCompare'](_0x12e992[_0x102b62(0xb4)]));for(const _0x1ab364 of _0x552cbf){const _0x550217=_0x1ab364[_0x102b62(0xc8)]&&_0x1ab364[_0x102b62(0xc8)]!==_0x1ab364[_0x102b62(0xb4)]?'\x20'+a108_0xfeed94[_0x102b62(0xda)]('('+_0x1ab364['parentColumn']+')'):'';console[_0x102b62(0xbc)]('\x20\x20\x20\x20'+_0x1ab364['name']+_0x550217+':\x20'+a108_0xfeed94[_0x102b62(0xc0)](_0x1ab364[_0x102b62(0xb5)]));}}}if(_0x247b1e[_0x102b62(0xe6)]>0x0){console[_0x102b62(0xbc)]('\x0a'+a108_0xfeed94[_0x102b62(0xda)](_0x102b62(0xdb)));const _0x332030=[..._0x247b1e['entries']()][_0x102b62(0xb3)]((_0xbcdfb6,_0x3fdeeb)=>_0xbcdfb6[0x0][_0x102b62(0xd0)](_0x3fdeeb[0x0]));for(const [_0x11c253,_0x565c9c]of _0x332030){const _0x317b24=_0x565c9c[0x0],_0x4b10eb=_0x317b24?.['parentTableName']||'';console['error']('\x20\x20'+a108_0xfeed94[_0x102b62(0xbe)](_0x11c253)+(_0x4b10eb?'\x20'+a108_0xfeed94[_0x102b62(0xda)]('('+_0x4b10eb+')'):''));const _0xa6299f=[..._0x565c9c]['sort']((_0x29350d,_0x561cd1)=>_0x29350d[_0x102b62(0xb4)]['localeCompare'](_0x561cd1[_0x102b62(0xb4)]));for(const _0x1800d6 of _0xa6299f){const _0x40275f=_0x1800d6[_0x102b62(0xb4)][_0x102b62(0xc9)](_0x11c253+'.')?_0x1800d6[_0x102b62(0xb4)][_0x102b62(0xe2)](_0x11c253[_0x102b62(0xdd)]+0x1):_0x1800d6[_0x102b62(0xb4)],_0x448a2d=_0x1800d6[_0x102b62(0xc8)]&&_0x1800d6['parentColumn']!==_0x40275f?'\x20'+a108_0xfeed94['dim']('('+_0x1800d6['parentColumn']+')'):'';console['error'](_0x102b62(0xcf)+_0x40275f+_0x448a2d+':\x20'+a108_0xfeed94[_0x102b62(0xc0)](_0x1800d6[_0x102b62(0xb5)]));}}}console[_0x102b62(0xbc)]('');}
1
+ function a108_0x2796(){const _0xedcaa5=['Behaviors','\x20\x20\x20\x20','parentColumn','5779026qeZmSq','startsWith','set','2rsEXpu','behavior','bold','19560FBvMSo','behaviorName','6818585vtkDoU','source','name','SELECT\x20*\x20FROM\x20(\x0a','Schema\x20query:\x0a','15033730iMYJLD','Unknown','push','Fetching\x20schema...','dim','Attributes','columns','localeCompare','extra','replace','entries','execute','size','810KEdjZo','fields','2560467ZAWozK','attribute','data','parentTableName','groupingName','\x0a)\x20AS\x20segment_query\x20LIMIT\x200','length','slice','9edvEtY','verbose','sort','error','123870wbPoCy','varchar','column_type','cyan','setJobId','map','displayName','type','key','YES','get','957204dfXlXU','tableName'];a108_0x2796=function(){return _0xedcaa5;};return a108_0x2796();}(function(_0x4c4ea1,_0x237396){const _0x20a5a3=a108_0x30d6,_0x517789=_0x4c4ea1();while(!![]){try{const _0x322c33=parseInt(_0x20a5a3(0xc3))/0x1*(-parseInt(_0x20a5a3(0x9e))/0x2)+-parseInt(_0x20a5a3(0xbf))/0x3*(parseInt(_0x20a5a3(0x96))/0x4)+parseInt(_0x20a5a3(0xa3))/0x5+-parseInt(_0x20a5a3(0x9b))/0x6+-parseInt(_0x20a5a3(0xb7))/0x7+parseInt(_0x20a5a3(0xa1))/0x8*(parseInt(_0x20a5a3(0xb5))/0x9)+parseInt(_0x20a5a3(0xa8))/0xa;if(_0x322c33===_0x237396)break;else _0x517789['push'](_0x517789['shift']());}catch(_0x4a29eb){_0x517789['push'](_0x517789['shift']());}}}(a108_0x2796,0xdfbbf));import a108_0x5d6ff1 from'chalk';import{withProgressSpinner}from'../../utils/spinner.js';export function buildSchemaResult(_0x41ab6b){const _0x4d9493=a108_0x30d6,_0x4b5289=_0x41ab6b[_0x4d9493(0xae)][_0x4d9493(0xc8)](_0x500a5e=>({'column_name':_0x500a5e['name'],'column_type':_0x500a5e['type'],'null':_0x4d9493(0x94),'key':null,'default':null,'extra':null}));return{..._0x41ab6b,'columns':[{'name':'column_name','type':_0x4d9493(0xc4)},{'name':_0x4d9493(0xc5),'type':'varchar'},{'name':'null','type':_0x4d9493(0xc4)},{'name':_0x4d9493(0x93),'type':_0x4d9493(0xc4)},{'name':'default','type':_0x4d9493(0xc4)},{'name':_0x4d9493(0xb0),'type':'varchar'}],'data':_0x4b5289};}export async function executeSchemaQuery(_0x541083,_0x188869,_0x4d83dc){const _0x521b5a=a108_0x30d6,_0xe7c7e1=_0x541083['trim']()[_0x521b5a(0xb1)](/;+$/,''),_0x4cd9d6=_0x521b5a(0xa6)+_0xe7c7e1+_0x521b5a(0xbc);_0x4d83dc[_0x521b5a(0xc0)]&&console['error'](_0x521b5a(0xa7)+_0x4cd9d6);const _0x49c1c8=await withProgressSpinner(_0x521b5a(0xab),async _0x5e43df=>{const _0x4dc99b=_0x521b5a,_0x67052a=await _0x188869['query'][_0x4dc99b(0xb3)](_0x4cd9d6,{'catalog':'td','schema':'information_schema','onJobId':_0x25a5b8=>{const _0x9f73e5=_0x4dc99b;_0x5e43df[_0x9f73e5(0xc7)](_0x25a5b8);}});return _0x67052a;},{'verbose':_0x4d83dc['verbose']});return buildSchemaResult(_0x49c1c8[_0x521b5a(0xb9)]);}function a108_0x30d6(_0x37987d,_0x114376){_0x37987d=_0x37987d-0x91;const _0x2796fd=a108_0x2796();let _0x30d65f=_0x2796fd[_0x37987d];return _0x30d65f;}export function displayFieldsHumanReadable(_0x28affb,_0x2cd64c){const _0x52bf19=a108_0x30d6,_0x55df90=_0x28affb['filter'](_0x47a0ba=>_0x47a0ba[_0x52bf19(0xa4)]===_0x52bf19(0xb8)),_0x1748b8=_0x28affb['filter'](_0x5c621c=>_0x5c621c[_0x52bf19(0xa4)]===_0x52bf19(0x9f)),_0x14fedd=new Map();for(const _0x14bcba of _0x55df90){const _0x435279=_0x14bcba[_0x52bf19(0xbb)]||_0x14bcba[_0x52bf19(0xba)]||_0x52bf19(0xa9),_0x1d4e44=_0x14fedd[_0x52bf19(0x95)](_0x435279);_0x1d4e44?_0x1d4e44[_0x52bf19(0xb6)][_0x52bf19(0xaa)](_0x14bcba):_0x14fedd[_0x52bf19(0x9d)](_0x435279,{'displayName':_0x435279,'tableName':_0x14bcba[_0x52bf19(0xba)],'fields':[_0x14bcba]});}const _0x331444=new Map();for(const _0x1bd842 of _0x1748b8){const _0x5b56e4=_0x1bd842[_0x52bf19(0xa2)]||'Unknown',_0x6289d6=_0x331444[_0x52bf19(0x95)](_0x5b56e4)||[];_0x6289d6['push'](_0x1bd842),_0x331444[_0x52bf19(0x9d)](_0x5b56e4,_0x6289d6);}console[_0x52bf19(0xc2)]('\x0a'+a108_0x5d6ff1[_0x52bf19(0xa0)](_0x2cd64c));if(_0x14fedd[_0x52bf19(0xb4)]>0x0){console[_0x52bf19(0xc2)]('\x0a'+a108_0x5d6ff1['dim'](_0x52bf19(0xad)));const _0x130572=[..._0x14fedd[_0x52bf19(0xb2)]()]['sort']((_0x282561,_0x19f049)=>_0x282561[0x0][_0x52bf19(0xaf)](_0x19f049[0x0]));for(const [,_0x5675f8]of _0x130572){const _0x3385cf=_0x5675f8[_0x52bf19(0x97)]&&_0x5675f8['tableName']!==_0x5675f8['displayName']?'\x20'+a108_0x5d6ff1[_0x52bf19(0xac)]('('+_0x5675f8['tableName']+')'):'';console[_0x52bf19(0xc2)]('\x20\x20'+a108_0x5d6ff1[_0x52bf19(0xa0)](_0x5675f8[_0x52bf19(0x91)])+_0x3385cf);const _0x290f8f=[..._0x5675f8[_0x52bf19(0xb6)]][_0x52bf19(0xc1)]((_0x3b2253,_0x4143e3)=>_0x3b2253[_0x52bf19(0xa5)][_0x52bf19(0xaf)](_0x4143e3['name']));for(const _0x923f83 of _0x290f8f){const _0x1989c6=_0x923f83[_0x52bf19(0x9a)]&&_0x923f83['parentColumn']!==_0x923f83['name']?'\x20'+a108_0x5d6ff1['dim']('('+_0x923f83[_0x52bf19(0x9a)]+')'):'';console[_0x52bf19(0xc2)](_0x52bf19(0x99)+_0x923f83[_0x52bf19(0xa5)]+_0x1989c6+':\x20'+a108_0x5d6ff1[_0x52bf19(0xc6)](_0x923f83[_0x52bf19(0x92)]));}}}if(_0x331444['size']>0x0){console[_0x52bf19(0xc2)]('\x0a'+a108_0x5d6ff1['dim'](_0x52bf19(0x98)));const _0x36b0fb=[..._0x331444[_0x52bf19(0xb2)]()][_0x52bf19(0xc1)]((_0x539127,_0x21f7d7)=>_0x539127[0x0][_0x52bf19(0xaf)](_0x21f7d7[0x0]));for(const [_0x42ba88,_0x30901a]of _0x36b0fb){const _0x34d030=_0x30901a[0x0],_0x431291=_0x34d030?.[_0x52bf19(0xba)]||'';console[_0x52bf19(0xc2)]('\x20\x20'+a108_0x5d6ff1[_0x52bf19(0xa0)](_0x42ba88)+(_0x431291?'\x20'+a108_0x5d6ff1[_0x52bf19(0xac)]('('+_0x431291+')'):''));const _0x41a147=[..._0x30901a]['sort']((_0x294bb4,_0x229f1a)=>_0x294bb4[_0x52bf19(0xa5)]['localeCompare'](_0x229f1a[_0x52bf19(0xa5)]));for(const _0x8a8eae of _0x41a147){const _0x197651=_0x8a8eae[_0x52bf19(0xa5)][_0x52bf19(0x9c)](_0x42ba88+'.')?_0x8a8eae[_0x52bf19(0xa5)][_0x52bf19(0xbe)](_0x42ba88[_0x52bf19(0xbd)]+0x1):_0x8a8eae[_0x52bf19(0xa5)],_0x15fa66=_0x8a8eae[_0x52bf19(0x9a)]&&_0x8a8eae['parentColumn']!==_0x197651?'\x20'+a108_0x5d6ff1[_0x52bf19(0xac)]('('+_0x8a8eae[_0x52bf19(0x9a)]+')'):'';console[_0x52bf19(0xc2)](_0x52bf19(0x99)+_0x197651+_0x15fa66+':\x20'+a108_0x5d6ff1[_0x52bf19(0xc6)](_0x8a8eae[_0x52bf19(0x92)]));}}}console['error']('');}
@@ -1 +1 @@
1
- (function(_0x26f126,_0xbcace){const _0x168fd8=a109_0x48f9,_0x1aa50a=_0x26f126();while(!![]){try{const _0x5a51c4=parseInt(_0x168fd8(0xc6))/0x1+parseInt(_0x168fd8(0xc1))/0x2*(-parseInt(_0x168fd8(0xbf))/0x3)+-parseInt(_0x168fd8(0xbe))/0x4*(parseInt(_0x168fd8(0xc3))/0x5)+parseInt(_0x168fd8(0xcc))/0x6*(parseInt(_0x168fd8(0xb7))/0x7)+parseInt(_0x168fd8(0xc0))/0x8+parseInt(_0x168fd8(0xc5))/0x9*(parseInt(_0x168fd8(0xbd))/0xa)+-parseInt(_0x168fd8(0xb9))/0xb;if(_0x5a51c4===_0xbcace)break;else _0x1aa50a['push'](_0x1aa50a['shift']());}catch(_0x34c796){_0x1aa50a['push'](_0x1aa50a['shift']());}}}(a109_0x22bc,0x6fbca));function a109_0x22bc(){const _0x21069=['push','.yaml','isFile','10kWdoxR','1988980rcjhsZ','1530324LCoBRj','5936376UEbDTC','2TACFMA','toLowerCase','5SHrzVM','name','2901141kromjP','242731ZBTwBi','endsWith','.yml','map','relative','extname','132zdGjIQ','240177yyzuXP','dirname','6566362RVWggu'];a109_0x22bc=function(){return _0x21069;};return a109_0x22bc();}import{readdirSync,statSync}from'fs';import a109_0x3a053f from'path';function a109_0x48f9(_0xb0243,_0x2617a8){_0xb0243=_0xb0243-0xb7;const _0x22bc0a=a109_0x22bc();let _0x48f9ff=_0x22bc0a[_0xb0243];return _0x48f9ff;}export function findYamlFiles(_0xcc72ca){const _0x38e539=[];function _0x407a1c(_0x30a8b3){const _0x171198=a109_0x48f9,_0x733ffb=readdirSync(_0x30a8b3,{'withFileTypes':!![]});for(const _0x33a627 of _0x733ffb){const _0xd1fb97=a109_0x3a053f['join'](_0x30a8b3,_0x33a627[_0x171198(0xc4)]);if(_0x33a627['isDirectory']())_0x407a1c(_0xd1fb97);else(_0x33a627[_0x171198(0xc4)][_0x171198(0xc7)](_0x171198(0xc8))||_0x33a627[_0x171198(0xc4)]['endsWith'](_0x171198(0xbb)))&&_0x38e539[_0x171198(0xba)](_0xd1fb97);}}return _0x407a1c(_0xcc72ca),_0x38e539;}export function discoverYamlFiles(_0x2daaae){const _0xfe5f94=a109_0x48f9,_0x3f3682=findYamlFiles(_0x2daaae);return _0x3f3682[_0xfe5f94(0xc9)](_0x4b108e=>{const _0x29eb29=_0xfe5f94,_0x3194c3=a109_0x3a053f[_0x29eb29(0xca)](_0x2daaae,_0x4b108e),_0x342739=a109_0x3a053f[_0x29eb29(0xb8)](_0x3194c3);return{'absolutePath':_0x4b108e,'relativePath':_0x3194c3,'folderPath':_0x342739==='.'?'':_0x342739};});}export function isYamlFile(_0x583053){const _0xdf6485=a109_0x48f9;try{const _0x4e6360=statSync(_0x583053);if(!_0x4e6360[_0xdf6485(0xbc)]())return![];const _0x24db05=a109_0x3a053f[_0xdf6485(0xcb)](_0x583053)[_0xdf6485(0xc2)]();return _0x24db05===_0xdf6485(0xc8)||_0x24db05==='.yaml';}catch{return![];}}
1
+ (function(_0x50588e,_0xa296ad){const _0x33526b=a109_0x4f04,_0xe4b4db=_0x50588e();while(!![]){try{const _0x22060b=parseInt(_0x33526b(0x168))/0x1+parseInt(_0x33526b(0x166))/0x2+-parseInt(_0x33526b(0x167))/0x3+parseInt(_0x33526b(0x15e))/0x4+parseInt(_0x33526b(0x15d))/0x5+parseInt(_0x33526b(0x15b))/0x6*(parseInt(_0x33526b(0x158))/0x7)+-parseInt(_0x33526b(0x157))/0x8*(parseInt(_0x33526b(0x156))/0x9);if(_0x22060b===_0xa296ad)break;else _0xe4b4db['push'](_0xe4b4db['shift']());}catch(_0x481c3d){_0xe4b4db['push'](_0xe4b4db['shift']());}}}(a109_0x3981,0x469e3));function a109_0x3981(){const _0x59840f=['isDirectory','.yml','map','endsWith','546192otXJOs','136596Vuccar','166357xvEpqA','isFile','268911zaqOgg','336GCYgwa','7HxWcdY','relative','dirname','2467998WQVdNl','join','930640YIRInP','2211148RJqqzg','push','toLowerCase','name'];a109_0x3981=function(){return _0x59840f;};return a109_0x3981();}import{readdirSync,statSync}from'fs';import a109_0x3f78ef from'path';function a109_0x4f04(_0x28e564,_0x12abdd){_0x28e564=_0x28e564-0x155;const _0x398137=a109_0x3981();let _0x4f042e=_0x398137[_0x28e564];return _0x4f042e;}export function findYamlFiles(_0x10d85e){const _0x15f9a2=[];function _0x409050(_0x4670e5){const _0x316864=a109_0x4f04,_0x4b5e70=readdirSync(_0x4670e5,{'withFileTypes':!![]});for(const _0x16f2b3 of _0x4b5e70){const _0x24484a=a109_0x3f78ef[_0x316864(0x15c)](_0x4670e5,_0x16f2b3[_0x316864(0x161)]);if(_0x16f2b3[_0x316864(0x162)]())_0x409050(_0x24484a);else(_0x16f2b3[_0x316864(0x161)][_0x316864(0x165)]('.yml')||_0x16f2b3[_0x316864(0x161)][_0x316864(0x165)]('.yaml'))&&_0x15f9a2[_0x316864(0x15f)](_0x24484a);}}return _0x409050(_0x10d85e),_0x15f9a2;}export function discoverYamlFiles(_0x48fa12){const _0x393d7f=a109_0x4f04,_0x2ac4d8=findYamlFiles(_0x48fa12);return _0x2ac4d8[_0x393d7f(0x164)](_0x2f6af5=>{const _0x59bde5=_0x393d7f,_0x283982=a109_0x3f78ef[_0x59bde5(0x159)](_0x48fa12,_0x2f6af5),_0x3c41b5=a109_0x3f78ef[_0x59bde5(0x15a)](_0x283982);return{'absolutePath':_0x2f6af5,'relativePath':_0x283982,'folderPath':_0x3c41b5==='.'?'':_0x3c41b5};});}export function isYamlFile(_0x5c2db9){const _0x4b1a25=a109_0x4f04;try{const _0x30e37a=statSync(_0x5c2db9);if(!_0x30e37a[_0x4b1a25(0x155)]())return![];const _0x488bfb=a109_0x3f78ef['extname'](_0x5c2db9)[_0x4b1a25(0x160)]();return _0x488bfb===_0x4b1a25(0x163)||_0x488bfb==='.yaml';}catch{return![];}}
@@ -1 +1 @@
1
- (function(_0x55b7a5,_0x5a1de4){const _0x3f09fa=a110_0x2c19,_0x345edf=_0x55b7a5();while(!![]){try{const _0x40f501=-parseInt(_0x3f09fa(0xa0))/0x1+parseInt(_0x3f09fa(0xa2))/0x2+-parseInt(_0x3f09fa(0xac))/0x3*(-parseInt(_0x3f09fa(0xcc))/0x4)+parseInt(_0x3f09fa(0xba))/0x5+parseInt(_0x3f09fa(0xcd))/0x6+parseInt(_0x3f09fa(0xbc))/0x7*(parseInt(_0x3f09fa(0x96))/0x8)+-parseInt(_0x3f09fa(0xaa))/0x9;if(_0x40f501===_0x5a1de4)break;else _0x345edf['push'](_0x345edf['shift']());}catch(_0x3e2d31){_0x345edf['push'](_0x345edf['shift']());}}}(a110_0x22a8,0xaef50));import{serializeRule,deepSortObject}from'./child-segment-yaml.js';export const SEGMENT_KIND_JOURNEY=0x3;const MAX_MAPPING_CHAIN_DEPTH=0xa;export function sanitizeYamlKey(_0x318e2f){const _0x3aa5fe=a110_0x2c19;return _0x318e2f[_0x3aa5fe(0x95)]()['replace'](/\s+/g,'_')['replace'](/[^a-z0-9_]/g,'')['replace'](/_+/g,'_')['replace'](/^_|_$/g,'');}export function generateJourneyLocalName(_0x36e704){const _0x14eaa2=a110_0x2c19,_0x2c647f=_0x36e704[_0x14eaa2(0xb9)](/^journey_([a-z_]+)_([0-9a-f-]+)$/i);if(_0x2c647f){const _0x3b361e=_0x2c647f[0x1][_0x14eaa2(0x95)](),_0x5dc7cc=_0x2c647f[0x2],_0x359a07=_0x5dc7cc[_0x14eaa2(0x9f)](/-/g,'')[_0x14eaa2(0x9b)](0x0,0x4)[_0x14eaa2(0x95)]();return _0x3b361e+'_'+_0x359a07;}const _0x2c50e2=_0x36e704['match'](/^journey_\d+_stage_\d+_step_([0-9a-f-]+)_([a-z_]+)$/i);if(_0x2c50e2){const _0x111d51=_0x2c50e2[0x1],_0x204cc7=_0x2c50e2[0x2][_0x14eaa2(0x95)](),_0x2b5798=_0x111d51[_0x14eaa2(0x9f)](/-/g,'')[_0x14eaa2(0x9b)](0x0,0x4)['toLowerCase']();return _0x204cc7+'_'+_0x2b5798;}return undefined;}function a110_0x2c19(_0x436d8d,_0x240806){_0x436d8d=_0x436d8d-0x92;const _0x22a8e3=a110_0x22a8();let _0x2c196f=_0x22a8e3[_0x436d8d];return _0x2c196f;}function stableStringify(_0x2f16b0){const _0x3e8a63=a110_0x2c19;if(Array[_0x3e8a63(0x98)](_0x2f16b0))return'['+_0x2f16b0[_0x3e8a63(0xbd)](_0x21e218=>stableStringify(_0x21e218))['join'](',')+']';if(_0x2f16b0&&typeof _0x2f16b0===_0x3e8a63(0x97)){const _0x5ed7d9=_0x2f16b0,_0xca8da8=Object[_0x3e8a63(0x9e)](_0x5ed7d9)[_0x3e8a63(0xa8)](),_0xeb7df=_0xca8da8['map'](_0x3e2b75=>'\x22'+_0x3e2b75+'\x22:'+stableStringify(_0x5ed7d9[_0x3e2b75]));return'{'+_0xeb7df[_0x3e8a63(0xb7)](',')+'}';}const _0x1e2827=JSON[_0x3e8a63(0xc6)](_0x2f16b0);return _0x1e2827===undefined?_0x3e8a63(0xc9):_0x1e2827;}export function consolidateActivationsByContent(_0x1300e5){const _0x537a66=a110_0x2c19,_0x40d7eb={},_0x3f8c29=new Map(),_0x34683d=new Map();for(const _0x5bdf5a of _0x1300e5){if(!_0x5bdf5a)continue;for(const [_0x51e5b8,_0x38b797]of Object['entries'](_0x5bdf5a)){const _0x3bcdc9={'connection':_0x38b797[_0x537a66(0xb0)],..._0x38b797['all_columns']!==undefined&&{'all_columns':_0x38b797[_0x537a66(0xa9)]},..._0x38b797[_0x537a66(0xd5)]!==undefined&&{'columns':_0x38b797[_0x537a66(0xd5)]},..._0x38b797[_0x537a66(0x92)]!==undefined&&{'behavior':_0x38b797[_0x537a66(0x92)]},..._0x38b797[_0x537a66(0xb4)]!==undefined&&{'schedule':_0x38b797['schedule']},..._0x38b797[_0x537a66(0xd1)]!==undefined&&{'notification':_0x38b797[_0x537a66(0xd1)]},..._0x38b797[_0x537a66(0xca)]!==undefined&&{'connector_config':_0x38b797['connector_config']},..._0x38b797[_0x537a66(0xc4)]!==undefined&&{'activation_template_id':_0x38b797[_0x537a66(0xc4)]}},_0x3a797c=stableStringify(_0x3bcdc9),_0x328a36=_0x34683d[_0x537a66(0xae)](_0x3a797c);_0x328a36?_0x3f8c29[_0x537a66(0x99)](_0x51e5b8,_0x328a36):(_0x40d7eb[_0x51e5b8]=_0x38b797,_0x3f8c29[_0x537a66(0x99)](_0x51e5b8,_0x51e5b8),_0x34683d[_0x537a66(0x99)](_0x3a797c,_0x51e5b8));}}return{'merged':_0x40d7eb,'nameMapping':_0x3f8c29};}export function updateActivationReferences(_0x218a1d,_0x394922){const _0x428263=a110_0x2c19;if(!_0x218a1d)return;for(const _0x45b4bf of _0x218a1d){if(!_0x45b4bf[_0x428263(0x94)])continue;for(const _0x29bb09 of _0x45b4bf[_0x428263(0x94)]){if(_0x29bb09[_0x428263(0xd3)]===_0x428263(0xe0)&&_0x29bb09['with']?.[_0x428263(0xe0)]){const _0x3f219c=_0x394922['get'](_0x29bb09[_0x428263(0xbb)][_0x428263(0xe0)]);_0x3f219c&&_0x3f219c!==_0x29bb09[_0x428263(0xbb)]['activation']&&(_0x29bb09[_0x428263(0xbb)][_0x428263(0xe0)]=_0x3f219c);}}}}export function consolidateSegmentsByContent(_0x5d75d4,_0x523cf8){const _0x303aed=a110_0x2c19,_0x622061={},_0x2a4327=new Map(),_0x18a955=new Map();for(const _0x369aeb of _0x5d75d4){if(!_0x369aeb)continue;for(const [_0x2c17f6,_0x43b904]of Object['entries'](_0x369aeb)){if(!_0x43b904['rule']){_0x622061[_0x2c17f6]=_0x43b904,_0x2a4327[_0x303aed(0x99)](_0x2c17f6,_0x2c17f6);continue;}const _0x93c2ca=_0x43b904['description']&&_0x43b904[_0x303aed(0xce)]['trim']()?_0x43b904[_0x303aed(0xce)]:undefined,_0xfb6016=JSON[_0x303aed(0xc6)]({'description':_0x93c2ca,'rule':deepSortObject(_0x43b904['rule'])}),_0x3341cd=_0x18a955[_0x303aed(0xae)](_0xfb6016);if(_0x3341cd){const _0x59f2dc={..._0x43b904[_0x303aed(0xce)]!==undefined&&{'description':_0x43b904[_0x303aed(0xce)]},'rule':_0x43b904['rule']?deepSortObject(_0x43b904[_0x303aed(0xd2)]):_0x43b904[_0x303aed(0xd2)]};if(_0x2c17f6<_0x3341cd){_0x622061[_0x2c17f6]=_0x59f2dc,delete _0x622061[_0x3341cd];for(const [_0x3d75d1,_0x4fef69]of _0x2a4327[_0x303aed(0xc1)]()){_0x4fef69===_0x3341cd&&_0x2a4327['set'](_0x3d75d1,_0x2c17f6);}_0x2a4327[_0x303aed(0x99)](_0x2c17f6,_0x2c17f6),_0x18a955['set'](_0xfb6016,_0x2c17f6);}else _0x622061[_0x3341cd]=_0x59f2dc,_0x2a4327[_0x303aed(0x99)](_0x2c17f6,_0x3341cd);}else{let _0x31abe7=_0x2c17f6;if(_0x523cf8){const _0x4633ea=_0x523cf8[_0x303aed(0xae)](_0xfb6016);_0x4633ea&&_0x4633ea[_0x303aed(0xcf)]>0x0&&(_0x31abe7=_0x4633ea[_0x303aed(0x9b)]()[_0x303aed(0xa8)]()[0x0]);}const _0x43f009={..._0x43b904['description']!==undefined&&{'description':_0x43b904[_0x303aed(0xce)]},'rule':_0x43b904[_0x303aed(0xd2)]?deepSortObject(_0x43b904[_0x303aed(0xd2)]):_0x43b904[_0x303aed(0xd2)]};_0x622061[_0x31abe7]=_0x43f009,_0x2a4327[_0x303aed(0x99)](_0x2c17f6,_0x31abe7),_0x18a955[_0x303aed(0x99)](_0xfb6016,_0x31abe7);}}}return{'merged':_0x622061,'nameMapping':_0x2a4327};}export function updateSegmentReferences(_0x340733,_0x238b56){const _0xbbd201=a110_0x2c19;if(!_0x340733)return;for(const _0x1ceec7 of _0x340733){if(_0x1ceec7[_0xbbd201(0xb3)]?.[_0xbbd201(0xb6)]){const _0x12282a=_0x238b56['get'](_0x1ceec7[_0xbbd201(0xb3)][_0xbbd201(0xb6)]);_0x12282a&&(_0x1ceec7[_0xbbd201(0xb3)][_0xbbd201(0xb6)]=_0x12282a);}if(_0x1ceec7['steps'])for(const _0x1baac0 of _0x1ceec7[_0xbbd201(0x94)]){if(_0x1baac0[_0xbbd201(0xd3)]===_0xbbd201(0xdd)&&_0x1baac0['with']?.['branches'])for(const _0xfb5d2a of _0x1baac0[_0xbbd201(0xbb)]['branches']){if(_0xfb5d2a[_0xbbd201(0xb6)]){const _0x569e2e=_0x238b56[_0xbbd201(0xae)](_0xfb5d2a[_0xbbd201(0xb6)]);_0x569e2e&&(_0xfb5d2a[_0xbbd201(0xb6)]=_0x569e2e);}}}}}export function updateSegmentRefsInSegments(_0x3f9dac,_0x2f62ed){const _0x5c37bf=a110_0x2c19;for(const _0x277d24 of Object['values'](_0x3f9dac)){_0x277d24[_0x5c37bf(0xd2)]&&updateSegmentRefsInRule(_0x277d24[_0x5c37bf(0xd2)],_0x2f62ed);}}function updateSegmentRefsInRule(_0x237c99,_0x433da2){const _0x2f1430=a110_0x2c19;if(_0x237c99===null||typeof _0x237c99!==_0x2f1430(0x97))return;if(Array[_0x2f1430(0x98)](_0x237c99)){for(const _0x226668 of _0x237c99){updateSegmentRefsInRule(_0x226668,_0x433da2);}return;}const _0x5dbabf=_0x237c99;if((_0x5dbabf[_0x2f1430(0xd3)]==='include'||_0x5dbabf[_0x2f1430(0xd3)]===_0x2f1430(0xd6))&&typeof _0x5dbabf[_0x2f1430(0xb6)]===_0x2f1430(0xd8)){const _0xc1be5=_0x433da2[_0x2f1430(0xae)](_0x5dbabf[_0x2f1430(0xb6)]);_0xc1be5&&(_0x5dbabf[_0x2f1430(0xb6)]=_0xc1be5);}if(_0x5dbabf[_0x2f1430(0xd4)]&&Array[_0x2f1430(0x98)](_0x5dbabf[_0x2f1430(0xd4)]))for(const _0x12db11 of _0x5dbabf[_0x2f1430(0xd4)]){updateSegmentRefsInRule(_0x12db11,_0x433da2);}}export function buildJourneysArray(_0x73dfba){const _0x4c5afe=a110_0x2c19,_0x195868=Math['max'](..._0x73dfba[_0x4c5afe(0xbd)](_0x26648e=>_0x26648e[_0x4c5afe(0xc8)][_0x4c5afe(0xab)]||0x0));return _0x73dfba[_0x4c5afe(0xbd)](_0x20186e=>{const _0x1e75a3=_0x4c5afe,_0x2cd8a4=(_0x20186e[_0x1e75a3(0xc8)][_0x1e75a3(0xab)]||0x0)===_0x195868,_0xf0ef9a=_0x20186e[_0x1e75a3(0xb2)][_0x1e75a3(0xb5)]?.[0x0],_0x198d4d={'version':_0xf0ef9a?.['version']||_0x20186e[_0x1e75a3(0xb2)][_0x1e75a3(0xdc)]||_0x20186e[_0x1e75a3(0xc8)][_0x1e75a3(0xa1)],'state':_0x20186e[_0x1e75a3(0xc8)][_0x1e75a3(0xad)]===_0x1e75a3(0xc5)?_0x1e75a3(0xc5):_0x1e75a3(0xda),'stages':_0xf0ef9a?.['stages']||_0x20186e[_0x1e75a3(0xb2)]['stages']||[],'id':_0xf0ef9a?.['id']||_0x20186e[_0x1e75a3(0xb2)]['id'],'version_number':_0xf0ef9a?.[_0x1e75a3(0xbe)]||_0x20186e[_0x1e75a3(0xb2)]['version_number']};return _0x2cd8a4&&(_0x198d4d[_0x1e75a3(0xd7)]=!![]),_0x198d4d;});}export function buildMergedJourneyDef(_0x1f91af,_0x434836){const _0x261df5=a110_0x2c19,_0xc876bb=_0x1f91af[0x0][_0x261df5(0xb2)],_0x26b07f=buildJourneysArray(_0x1f91af),{merged:_0xa178d7,nameMapping:_0xc2a28e}=consolidateSegmentsByContent(_0x1f91af[_0x261df5(0xbd)](_0x49b4b0=>_0x49b4b0[_0x261df5(0xb2)][_0x261df5(0xc2)]),_0x434836);updateSegmentRefsInSegments(_0xa178d7,_0xc2a28e);const _0x3e5047=Array[_0x261df5(0xb1)](_0xc2a28e[_0x261df5(0xc1)]())['some'](([_0x26d6d8,_0x3612d4])=>_0x26d6d8!==_0x3612d4&&_0x26d6d8[_0x261df5(0x93)](_0x261df5(0xb3)));let _0x143470=_0xa178d7,_0x57dabb=new Map();if(_0x3e5047){const _0x3ad4b2=consolidateSegmentsByContent([_0xa178d7],_0x434836);_0x143470=_0x3ad4b2[_0x261df5(0xa5)],_0x57dabb=_0x3ad4b2[_0x261df5(0xd9)];}const _0x27f1d6=new Map(_0xc2a28e);for(const [_0x8cdaaa,_0x425ce4]of _0x57dabb[_0x261df5(0xc1)]()){_0x27f1d6[_0x261df5(0x99)](_0x8cdaaa,_0x425ce4);}for(const [_0x24ef74,_0x18add4]of _0x27f1d6['entries']()){let _0x3481a1=_0x18add4,_0x57bba7=0x0;while(_0x27f1d6[_0x261df5(0xdf)](_0x3481a1)&&_0x27f1d6[_0x261df5(0xae)](_0x3481a1)!==_0x3481a1&&_0x57bba7<MAX_MAPPING_CHAIN_DEPTH){_0x3481a1=_0x27f1d6[_0x261df5(0xae)](_0x3481a1),_0x57bba7++;}_0x3481a1!==_0x18add4&&_0x27f1d6[_0x261df5(0x99)](_0x24ef74,_0x3481a1);}for(const _0x16ee4a of _0x26b07f){updateSegmentReferences(_0x16ee4a['stages'],_0x27f1d6);}const {merged:_0x347da4,nameMapping:_0x140929}=consolidateActivationsByContent(_0x1f91af['map'](_0xc5a0d8=>_0xc5a0d8[_0x261df5(0xb2)][_0x261df5(0xa6)]));for(const _0x4d5b60 of _0x26b07f){updateActivationReferences(_0x4d5b60[_0x261df5(0xbf)],_0x140929);}let _0x2b76b6=_0xc876bb[_0x261df5(0xb8)];if(_0x2b76b6?.['segment']){const _0xeaea61=_0x27f1d6['get'](_0x2b76b6[_0x261df5(0xb6)]);_0xeaea61&&(_0x2b76b6={..._0x2b76b6,'segment':_0xeaea61});}for(const _0x14de2c of _0x26b07f){if(_0x14de2c[_0x261df5(0xb8)]?.['segment']){const _0x17072b=_0x27f1d6[_0x261df5(0xae)](_0x14de2c[_0x261df5(0xb8)]['segment']);_0x17072b&&(_0x14de2c[_0x261df5(0xb8)]={..._0x14de2c[_0x261df5(0xb8)],'segment':_0x17072b});}}return{'type':'journey','name':_0xc876bb['name'],'description':_0xc876bb[_0x261df5(0xce)],'goal':_0x2b76b6,'reentry':_0xc876bb[_0x261df5(0xa4)],'segments':Object[_0x261df5(0x9e)](_0x143470)[_0x261df5(0xcf)]>0x0?_0x143470:undefined,'activations':Object[_0x261df5(0x9e)](_0x347da4)[_0x261df5(0xcf)]>0x0?_0x347da4:undefined,'journeys':_0x26b07f,'bundle_id':_0xc876bb['bundle_id'],'bundle_name':_0xc876bb[_0x261df5(0xc0)]};}export function createJumpTargetCache(){return new Map();}export async function resolveJumpTarget(_0x2df439,_0x1602e2,_0x54e238,_0x23b8de){const _0x5de420=a110_0x2c19,_0x3e0a2c=_0x2df439+':'+_0x1602e2,_0x5a3b8d=_0x54e238['get'](_0x3e0a2c);if(_0x5a3b8d)return _0x5a3b8d;const _0x28917e=await _0x23b8de(_0x2df439),_0x342bd1=_0x28917e[_0x5de420(0xdb)][_0x5de420(0x9c)]||_0x28917e['attributes'][_0x5de420(0xa1)],_0x18c7e1=_0x28917e[_0x5de420(0xdb)][_0x5de420(0xa7)][_0x5de420(0xd0)](_0x4ce544=>String(_0x4ce544['id'])===String(_0x1602e2)),_0x54ccec=_0x18c7e1?.[_0x5de420(0xa1)]||_0x1602e2,_0x4d64d0={'journeyName':_0x342bd1,'stageName':_0x54ccec};return _0x54e238[_0x5de420(0x99)](_0x3e0a2c,_0x4d64d0),_0x4d64d0;}export function formatApiJourneyName(_0x2b28fa,_0x1e5035){return _0x1e5035+'\x20('+_0x2b28fa+')';}export function isLocalJourneyRef(_0x11653a){const _0x38285d=a110_0x2c19;return _0x11653a[_0x38285d(0xcb)](_0x38285d(0xa3))||_0x11653a['endsWith']('.yaml');}export function buildLocalRuleToNameMapping(_0x281ded){const _0x6b889=a110_0x2c19,_0x13e234=new Map();if(!_0x281ded)return _0x13e234;for(const [_0x18a4db,_0x110edb]of Object[_0x6b889(0xc1)](_0x281ded)){if(_0x110edb['rule']){const _0x896525=serializeRule(_0x110edb[_0x6b889(0xd2)]),_0x5a3cdc=_0x13e234['get'](_0x896525)||[];_0x5a3cdc[_0x6b889(0x9a)](_0x18a4db),_0x13e234[_0x6b889(0x99)](_0x896525,_0x5a3cdc);}}return _0x13e234;}export function buildLocalRuleToNameMappingFromJourney(_0x122a11){const _0x3160b7=a110_0x2c19,_0x49cc89=_0x122a11[_0x3160b7(0xc2)];if(!_0x49cc89)return new Map();const _0x1ad59b=collectSegmentUsageCounts(_0x122a11),_0x5d52e3=new Map();let _0x2c0dd7=0x0;for(const [_0x2b1f14,_0x22e71e]of Object[_0x3160b7(0xc1)](_0x49cc89)){if(!_0x22e71e[_0x3160b7(0xd2)]){_0x2c0dd7++;continue;}const _0x33d86a=serializeRule(_0x22e71e[_0x3160b7(0xd2)]),_0x6f17ed=_0x5d52e3[_0x3160b7(0xae)](_0x33d86a)||[];_0x6f17ed[_0x3160b7(0x9a)]({'name':_0x2b1f14,'index':_0x2c0dd7}),_0x5d52e3[_0x3160b7(0x99)](_0x33d86a,_0x6f17ed),_0x2c0dd7++;}const _0x21c776=new Map();for(const [_0x5931d6,_0x2c4eec]of _0x5d52e3){const _0x2e1aa0=_0x2c4eec[_0x3160b7(0x9b)]()[_0x3160b7(0xa8)]((_0x19b99e,_0x83c0aa)=>{const _0x19aaad=_0x3160b7,_0x4fb356=_0x1ad59b[_0x19aaad(0xae)](_0x19b99e[_0x19aaad(0xa1)])||0x0,_0x2133c4=_0x1ad59b[_0x19aaad(0xae)](_0x83c0aa[_0x19aaad(0xa1)])||0x0;if(_0x4fb356!==_0x2133c4)return _0x2133c4-_0x4fb356;return _0x19b99e[_0x19aaad(0xde)]-_0x83c0aa[_0x19aaad(0xde)];})[_0x3160b7(0xbd)](_0xb6591c=>_0xb6591c['name']);_0x21c776[_0x3160b7(0x99)](_0x5931d6,_0x2e1aa0);}return _0x21c776;}export function collectSegmentUsageCounts(_0x379451){const _0x1e4e3b=a110_0x2c19,_0x19a9df=new Map(),_0x441f8d=_0x2fdd73=>{const _0x2d3dba=a110_0x2c19;if(!_0x2fdd73)return;_0x19a9df['set'](_0x2fdd73,(_0x19a9df[_0x2d3dba(0xae)](_0x2fdd73)||0x0)+0x1);},_0x8e52d0=_0x2ff343=>{const _0x1dd63c=a110_0x2c19;for(const _0x184eae of _0x2ff343){_0x441f8d(_0x184eae['entry_criteria']?.[_0x1dd63c(0xb6)]);if(_0x184eae['exit_criteria'])for(const _0x449f92 of _0x184eae[_0x1dd63c(0x9d)]){_0x441f8d(_0x449f92[_0x1dd63c(0xb6)]);}_0x441f8d(_0x184eae['milestone']?.[_0x1dd63c(0xb6)]);if(_0x184eae['steps'])for(const _0x992596 of _0x184eae['steps']){if(_0x992596['type']===_0x1dd63c(0xdd))for(const _0x49791b of _0x992596[_0x1dd63c(0xbb)][_0x1dd63c(0xc3)]){_0x441f8d(_0x49791b['segment']);}else _0x992596[_0x1dd63c(0xd3)]==='wait'&&_0x441f8d(_0x992596[_0x1dd63c(0xbb)][_0x1dd63c(0xaf)]?.[_0x1dd63c(0xb6)]);}}};_0x441f8d(_0x379451[_0x1e4e3b(0xb8)]?.['segment']);if(_0x379451[_0x1e4e3b(0xb5)])for(const _0x13f200 of _0x379451[_0x1e4e3b(0xb5)]){_0x441f8d(_0x13f200[_0x1e4e3b(0xb8)]?.[_0x1e4e3b(0xb6)]),_0x8e52d0(_0x13f200[_0x1e4e3b(0xbf)]);}_0x379451[_0x1e4e3b(0xbf)]&&_0x8e52d0(_0x379451[_0x1e4e3b(0xbf)]);if(_0x379451[_0x1e4e3b(0xc7)])for(const _0x97d011 of _0x379451[_0x1e4e3b(0xc7)]){_0x8e52d0(_0x97d011[_0x1e4e3b(0xbf)]);}return _0x19a9df;}function a110_0x22a8(){const _0x36f6b9=['goal','match','5211255hEhfiM','with','9863ocwxfZ','map','version_number','stages','bundle_name','entries','segments','branches','activation_template_id','launched','stringify','versions','item','null','connector_config','endsWith','2607964qFTdJX','996696VBPtTN','description','length','find','notification','rule','type','conditions','columns','exclude','latest','string','nameMapping','draft','attributes','version','decision_point','index','has','activation','behavior','startsWith','steps','toLowerCase','6952qPBSiD','object','isArray','set','push','slice','journeyBundleName','exit_criteria','keys','replace','849684iWqoIw','name','2603512FygeYN','.yml','reentry','merged','activations','journeyStages','sort','all_columns','25382043YuZtWZ','versionNumber','3YbsfQq','state','get','condition','connection','from','yaml','entry_criteria','schedule','journeys','segment','join'];a110_0x22a8=function(){return _0x36f6b9;};return a110_0x22a8();}
1
+ (function(_0x155d3d,_0xf700c6){const _0x156f15=a110_0x41c8,_0x501295=_0x155d3d();while(!![]){try{const _0x1f5834=-parseInt(_0x156f15(0xbb))/0x1*(-parseInt(_0x156f15(0xe5))/0x2)+parseInt(_0x156f15(0xde))/0x3*(parseInt(_0x156f15(0xbe))/0x4)+-parseInt(_0x156f15(0xc9))/0x5+parseInt(_0x156f15(0xba))/0x6+-parseInt(_0x156f15(0xf9))/0x7+parseInt(_0x156f15(0xae))/0x8*(-parseInt(_0x156f15(0xd6))/0x9)+parseInt(_0x156f15(0xc2))/0xa*(parseInt(_0x156f15(0xf4))/0xb);if(_0x1f5834===_0xf700c6)break;else _0x501295['push'](_0x501295['shift']());}catch(_0x7ea39){_0x501295['push'](_0x501295['shift']());}}}(a110_0x5125,0xe5a92));import{serializeRule,deepSortObject}from'./child-segment-yaml.js';function a110_0x41c8(_0x199f49,_0x1f9363){_0x199f49=_0x199f49-0xab;const _0x51252f=a110_0x5125();let _0x41c816=_0x51252f[_0x199f49];return _0x41c816;}export const SEGMENT_KIND_JOURNEY=0x3;const MAX_MAPPING_CHAIN_DEPTH=0xa;export function sanitizeYamlKey(_0x10c0fa){const _0x4f67bb=a110_0x41c8;return _0x10c0fa[_0x4f67bb(0xce)]()['replace'](/\s+/g,'_')[_0x4f67bb(0xed)](/[^a-z0-9_]/g,'')[_0x4f67bb(0xed)](/_+/g,'_')[_0x4f67bb(0xed)](/^_|_$/g,'');}export function generateJourneyLocalName(_0x5c7091){const _0x383850=a110_0x41c8,_0xa74461=_0x5c7091[_0x383850(0xb2)](/^journey_([a-z_]+)_([0-9a-f-]+)$/i);if(_0xa74461){const _0x51dd42=_0xa74461[0x1][_0x383850(0xce)](),_0x3aac3c=_0xa74461[0x2],_0xeaf8e5=_0x3aac3c[_0x383850(0xed)](/-/g,'')[_0x383850(0xd0)](0x0,0x4)['toLowerCase']();return _0x51dd42+'_'+_0xeaf8e5;}const _0x4d555b=_0x5c7091[_0x383850(0xb2)](/^journey_\d+_stage_\d+_step_([0-9a-f-]+)_([a-z_]+)$/i);if(_0x4d555b){const _0x469992=_0x4d555b[0x1],_0x5c15cf=_0x4d555b[0x2][_0x383850(0xce)](),_0x598fc1=_0x469992[_0x383850(0xed)](/-/g,'')[_0x383850(0xd0)](0x0,0x4)['toLowerCase']();return _0x5c15cf+'_'+_0x598fc1;}return undefined;}function stableStringify(_0x2ef35c){const _0x37353d=a110_0x41c8;if(Array[_0x37353d(0xea)](_0x2ef35c))return'['+_0x2ef35c[_0x37353d(0xd1)](_0x267773=>stableStringify(_0x267773))[_0x37353d(0xe4)](',')+']';if(_0x2ef35c&&typeof _0x2ef35c===_0x37353d(0xf7)){const _0x655beb=_0x2ef35c,_0x3d56af=Object[_0x37353d(0xbd)](_0x655beb)[_0x37353d(0xc8)](),_0x582019=_0x3d56af[_0x37353d(0xd1)](_0x2ee1ae=>'\x22'+_0x2ee1ae+'\x22:'+stableStringify(_0x655beb[_0x2ee1ae]));return'{'+_0x582019['join'](',')+'}';}const _0xea2316=JSON[_0x37353d(0xb1)](_0x2ef35c);return _0xea2316===undefined?_0x37353d(0xe7):_0xea2316;}export function consolidateActivationsByContent(_0x36442c){const _0x3d482f=a110_0x41c8,_0x278fc5={},_0x39e8ae=new Map(),_0x5a5b19=new Map();for(const _0x7a6715 of _0x36442c){if(!_0x7a6715)continue;for(const [_0x3abcb4,_0x17f5fc]of Object[_0x3d482f(0xc7)](_0x7a6715)){const _0x47931b={'connection':_0x17f5fc[_0x3d482f(0xe6)],..._0x17f5fc['all_columns']!==undefined&&{'all_columns':_0x17f5fc['all_columns']},..._0x17f5fc[_0x3d482f(0xb9)]!==undefined&&{'columns':_0x17f5fc[_0x3d482f(0xb9)]},..._0x17f5fc[_0x3d482f(0xe2)]!==undefined&&{'behavior':_0x17f5fc['behavior']},..._0x17f5fc[_0x3d482f(0xd9)]!==undefined&&{'schedule':_0x17f5fc[_0x3d482f(0xd9)]},..._0x17f5fc[_0x3d482f(0xd3)]!==undefined&&{'notification':_0x17f5fc[_0x3d482f(0xd3)]},..._0x17f5fc[_0x3d482f(0xdb)]!==undefined&&{'connector_config':_0x17f5fc['connector_config']},..._0x17f5fc[_0x3d482f(0xb5)]!==undefined&&{'activation_template_id':_0x17f5fc[_0x3d482f(0xb5)]}},_0x13019c=stableStringify(_0x47931b),_0x4d94f8=_0x5a5b19[_0x3d482f(0xaf)](_0x13019c);_0x4d94f8?_0x39e8ae[_0x3d482f(0xfa)](_0x3abcb4,_0x4d94f8):(_0x278fc5[_0x3abcb4]=_0x17f5fc,_0x39e8ae[_0x3d482f(0xfa)](_0x3abcb4,_0x3abcb4),_0x5a5b19['set'](_0x13019c,_0x3abcb4));}}return{'merged':_0x278fc5,'nameMapping':_0x39e8ae};}export function updateActivationReferences(_0x4735c9,_0x1027b4){const _0xbe068c=a110_0x41c8;if(!_0x4735c9)return;for(const _0xf1a5b2 of _0x4735c9){if(!_0xf1a5b2['steps'])continue;for(const _0x16e811 of _0xf1a5b2[_0xbe068c(0xb8)]){if(_0x16e811[_0xbe068c(0xc0)]===_0xbe068c(0xdd)&&_0x16e811['with']?.[_0xbe068c(0xdd)]){const _0x2b69e7=_0x1027b4[_0xbe068c(0xaf)](_0x16e811[_0xbe068c(0xfd)][_0xbe068c(0xdd)]);_0x2b69e7&&_0x2b69e7!==_0x16e811[_0xbe068c(0xfd)][_0xbe068c(0xdd)]&&(_0x16e811['with'][_0xbe068c(0xdd)]=_0x2b69e7);}}}}export function consolidateSegmentsByContent(_0x18e806,_0x514315){const _0x239691=a110_0x41c8,_0x4c9028={},_0xdeef6=new Map(),_0x441e0e=new Map();for(const _0x358faa of _0x18e806){if(!_0x358faa)continue;for(const [_0x346f1b,_0x132981]of Object[_0x239691(0xc7)](_0x358faa)){if(!_0x132981[_0x239691(0xfb)]){_0x4c9028[_0x346f1b]=_0x132981,_0xdeef6[_0x239691(0xfa)](_0x346f1b,_0x346f1b);continue;}const _0x2f1105=_0x132981[_0x239691(0xc5)]&&_0x132981[_0x239691(0xc5)][_0x239691(0xf1)]()?_0x132981[_0x239691(0xc5)]:undefined,_0x2f515b=JSON['stringify']({'description':_0x2f1105,'rule':deepSortObject(_0x132981[_0x239691(0xfb)])}),_0x91037d=_0x441e0e['get'](_0x2f515b);if(_0x91037d){const _0x334a4a={..._0x132981['description']!==undefined&&{'description':_0x132981['description']},'rule':_0x132981[_0x239691(0xfb)]?deepSortObject(_0x132981[_0x239691(0xfb)]):_0x132981['rule']};if(_0x346f1b<_0x91037d){_0x4c9028[_0x346f1b]=_0x334a4a,delete _0x4c9028[_0x91037d];for(const [_0x53649a,_0x56f9a6]of _0xdeef6['entries']()){_0x56f9a6===_0x91037d&&_0xdeef6[_0x239691(0xfa)](_0x53649a,_0x346f1b);}_0xdeef6[_0x239691(0xfa)](_0x346f1b,_0x346f1b),_0x441e0e[_0x239691(0xfa)](_0x2f515b,_0x346f1b);}else _0x4c9028[_0x91037d]=_0x334a4a,_0xdeef6[_0x239691(0xfa)](_0x346f1b,_0x91037d);}else{let _0x1da5ef=_0x346f1b;if(_0x514315){const _0x3e3587=_0x514315[_0x239691(0xaf)](_0x2f515b);_0x3e3587&&_0x3e3587[_0x239691(0xda)]>0x0&&(_0x1da5ef=_0x3e3587[_0x239691(0xd0)]()[_0x239691(0xc8)]()[0x0]);}const _0x4a1e64={..._0x132981[_0x239691(0xc5)]!==undefined&&{'description':_0x132981[_0x239691(0xc5)]},'rule':_0x132981['rule']?deepSortObject(_0x132981[_0x239691(0xfb)]):_0x132981[_0x239691(0xfb)]};_0x4c9028[_0x1da5ef]=_0x4a1e64,_0xdeef6[_0x239691(0xfa)](_0x346f1b,_0x1da5ef),_0x441e0e[_0x239691(0xfa)](_0x2f515b,_0x1da5ef);}}}return{'merged':_0x4c9028,'nameMapping':_0xdeef6};}export function updateSegmentReferences(_0x165761,_0x44e09d){const _0x9f148a=a110_0x41c8;if(!_0x165761)return;for(const _0x5257a7 of _0x165761){if(_0x5257a7['entry_criteria']?.['segment']){const _0x2542b0=_0x44e09d[_0x9f148a(0xaf)](_0x5257a7[_0x9f148a(0xf2)][_0x9f148a(0xac)]);_0x2542b0&&(_0x5257a7[_0x9f148a(0xf2)]['segment']=_0x2542b0);}if(_0x5257a7[_0x9f148a(0xb8)])for(const _0x3e5c4a of _0x5257a7['steps']){if(_0x3e5c4a[_0x9f148a(0xc0)]===_0x9f148a(0xe9)&&_0x3e5c4a[_0x9f148a(0xfd)]?.[_0x9f148a(0xf6)])for(const _0x3a63a1 of _0x3e5c4a[_0x9f148a(0xfd)][_0x9f148a(0xf6)]){if(_0x3a63a1[_0x9f148a(0xac)]){const _0x2d8d70=_0x44e09d['get'](_0x3a63a1[_0x9f148a(0xac)]);_0x2d8d70&&(_0x3a63a1[_0x9f148a(0xac)]=_0x2d8d70);}}}}}export function updateSegmentRefsInSegments(_0x514419,_0x325cd7){const _0x165d12=a110_0x41c8;for(const _0x123214 of Object['values'](_0x514419)){_0x123214['rule']&&updateSegmentRefsInRule(_0x123214[_0x165d12(0xfb)],_0x325cd7);}}function updateSegmentRefsInRule(_0x3d85a5,_0x1501bf){const _0x383eb7=a110_0x41c8;if(_0x3d85a5===null||typeof _0x3d85a5!=='object')return;if(Array['isArray'](_0x3d85a5)){for(const _0x48308d of _0x3d85a5){updateSegmentRefsInRule(_0x48308d,_0x1501bf);}return;}const _0x4b9889=_0x3d85a5;if((_0x4b9889[_0x383eb7(0xc0)]===_0x383eb7(0xf3)||_0x4b9889[_0x383eb7(0xc0)]===_0x383eb7(0xe0))&&typeof _0x4b9889['segment']===_0x383eb7(0xcd)){const _0x29cbf4=_0x1501bf[_0x383eb7(0xaf)](_0x4b9889['segment']);_0x29cbf4&&(_0x4b9889[_0x383eb7(0xac)]=_0x29cbf4);}if(_0x4b9889[_0x383eb7(0xdf)]&&Array['isArray'](_0x4b9889[_0x383eb7(0xdf)]))for(const _0x30d2ae of _0x4b9889[_0x383eb7(0xdf)]){updateSegmentRefsInRule(_0x30d2ae,_0x1501bf);}}export function buildJourneysArray(_0x252715){const _0x146ad1=a110_0x41c8,_0x43f103=Math[_0x146ad1(0xd4)](..._0x252715['map'](_0x1c3615=>_0x1c3615[_0x146ad1(0xbf)]['versionNumber']||0x0));return _0x252715[_0x146ad1(0xd1)](_0x5854fd=>{const _0x2d1287=_0x146ad1,_0x596af3=(_0x5854fd[_0x2d1287(0xbf)][_0x2d1287(0xcf)]||0x0)===_0x43f103,_0x54bb7c=_0x5854fd[_0x2d1287(0xd2)]['journeys']?.[0x0],_0x5eaa9d={'version':_0x54bb7c?.[_0x2d1287(0xdc)]||_0x5854fd[_0x2d1287(0xd2)]['version']||_0x5854fd[_0x2d1287(0xbf)][_0x2d1287(0xe8)],'state':_0x5854fd[_0x2d1287(0xbf)][_0x2d1287(0xca)]===_0x2d1287(0xfc)?_0x2d1287(0xfc):_0x2d1287(0xb7),'stages':_0x54bb7c?.['stages']||_0x5854fd[_0x2d1287(0xd2)][_0x2d1287(0xad)]||[],'id':_0x54bb7c?.['id']||_0x5854fd[_0x2d1287(0xd2)]['id'],'version_number':_0x54bb7c?.[_0x2d1287(0xab)]||_0x5854fd[_0x2d1287(0xd2)][_0x2d1287(0xab)]};return _0x596af3&&(_0x5eaa9d[_0x2d1287(0xee)]=!![]),_0x5eaa9d;});}export function buildMergedJourneyDef(_0x1e3cb7,_0x2d7fab){const _0xa9a995=a110_0x41c8,_0x5c79b1=_0x1e3cb7[0x0][_0xa9a995(0xd2)],_0xbf433c=buildJourneysArray(_0x1e3cb7),{merged:_0x4ac24b,nameMapping:_0x138b5c}=consolidateSegmentsByContent(_0x1e3cb7['map'](_0x2e0385=>_0x2e0385['yaml'][_0xa9a995(0xb6)]),_0x2d7fab);updateSegmentRefsInSegments(_0x4ac24b,_0x138b5c);const _0x204123=Array[_0xa9a995(0xd7)](_0x138b5c[_0xa9a995(0xc7)]())[_0xa9a995(0xcb)](([_0x8ac9c1,_0x3811a2])=>_0x8ac9c1!==_0x3811a2&&_0x8ac9c1['startsWith'](_0xa9a995(0xf2)));let _0x68add9=_0x4ac24b,_0x420258=new Map();if(_0x204123){const _0x171386=consolidateSegmentsByContent([_0x4ac24b],_0x2d7fab);_0x68add9=_0x171386[_0xa9a995(0xe3)],_0x420258=_0x171386[_0xa9a995(0xb3)];}const _0x12a1aa=new Map(_0x138b5c);for(const [_0x471dea,_0x3ceb5d]of _0x420258['entries']()){_0x12a1aa[_0xa9a995(0xfa)](_0x471dea,_0x3ceb5d);}for(const [_0x5f3aea,_0x3ae8e]of _0x12a1aa[_0xa9a995(0xc7)]()){let _0x50cd0b=_0x3ae8e,_0x46996c=0x0;while(_0x12a1aa[_0xa9a995(0xf8)](_0x50cd0b)&&_0x12a1aa['get'](_0x50cd0b)!==_0x50cd0b&&_0x46996c<MAX_MAPPING_CHAIN_DEPTH){_0x50cd0b=_0x12a1aa[_0xa9a995(0xaf)](_0x50cd0b),_0x46996c++;}_0x50cd0b!==_0x3ae8e&&_0x12a1aa[_0xa9a995(0xfa)](_0x5f3aea,_0x50cd0b);}for(const _0x534af2 of _0xbf433c){updateSegmentReferences(_0x534af2[_0xa9a995(0xad)],_0x12a1aa);}const {merged:_0x977219,nameMapping:_0x358eab}=consolidateActivationsByContent(_0x1e3cb7[_0xa9a995(0xd1)](_0x4e7c79=>_0x4e7c79['yaml'][_0xa9a995(0xc6)]));for(const _0x5a978c of _0xbf433c){updateActivationReferences(_0x5a978c[_0xa9a995(0xad)],_0x358eab);}let _0x481645=_0x5c79b1[_0xa9a995(0xeb)];if(_0x481645?.[_0xa9a995(0xac)]){const _0x3c1300=_0x12a1aa[_0xa9a995(0xaf)](_0x481645[_0xa9a995(0xac)]);_0x3c1300&&(_0x481645={..._0x481645,'segment':_0x3c1300});}for(const _0x5b683d of _0xbf433c){if(_0x5b683d[_0xa9a995(0xeb)]?.[_0xa9a995(0xac)]){const _0x41698b=_0x12a1aa['get'](_0x5b683d[_0xa9a995(0xeb)][_0xa9a995(0xac)]);_0x41698b&&(_0x5b683d['goal']={..._0x5b683d[_0xa9a995(0xeb)],'segment':_0x41698b});}}return{'type':'journey','name':_0x5c79b1[_0xa9a995(0xe8)],'description':_0x5c79b1[_0xa9a995(0xc5)],'goal':_0x481645,'reentry':_0x5c79b1[_0xa9a995(0xec)],'segments':Object[_0xa9a995(0xbd)](_0x68add9)['length']>0x0?_0x68add9:undefined,'activations':Object[_0xa9a995(0xbd)](_0x977219)[_0xa9a995(0xda)]>0x0?_0x977219:undefined,'journeys':_0xbf433c,'bundle_id':_0x5c79b1[_0xa9a995(0xc4)],'bundle_name':_0x5c79b1[_0xa9a995(0xbc)]};}function a110_0x5125(){const _0x3ce52e=['behavior','merged','join','668daafLz','connection','null','name','decision_point','isArray','goal','reentry','replace','latest','condition','exit_criteria','trim','entry_criteria','include','444334oIINYo','endsWith','branches','object','has','1737750FbFKPQ','set','rule','launched','with','version_number','segment','stages','70960CTXRFJ','get','.yaml','stringify','match','nameMapping','versions','activation_template_id','segments','draft','steps','columns','6745794bTKcsz','932Zripky','bundle_name','keys','171892BeovcP','item','type','journeys','350ovLjWJ','push','bundle_id','description','activations','entries','sort','663255LPVTFR','state','some','index','string','toLowerCase','versionNumber','slice','map','yaml','notification','max','milestone','1899ogyOkx','from','find','schedule','length','connector_config','version','activation','24IozlrK','conditions','exclude','journeyStages'];a110_0x5125=function(){return _0x3ce52e;};return a110_0x5125();}export function createJumpTargetCache(){return new Map();}export async function resolveJumpTarget(_0x3962e8,_0x393161,_0x516325,_0x317ffb){const _0x20924e=a110_0x41c8,_0x365fc1=_0x3962e8+':'+_0x393161,_0x5a282e=_0x516325[_0x20924e(0xaf)](_0x365fc1);if(_0x5a282e)return _0x5a282e;const _0x291b9f=await _0x317ffb(_0x3962e8),_0x2ac550=_0x291b9f['attributes']['journeyBundleName']||_0x291b9f['attributes'][_0x20924e(0xe8)],_0x280d92=_0x291b9f['attributes'][_0x20924e(0xe1)][_0x20924e(0xd8)](_0x5d4ced=>String(_0x5d4ced['id'])===String(_0x393161)),_0x343578=_0x280d92?.[_0x20924e(0xe8)]||_0x393161,_0x57df1a={'journeyName':_0x2ac550,'stageName':_0x343578};return _0x516325['set'](_0x365fc1,_0x57df1a),_0x57df1a;}export function formatApiJourneyName(_0x31a4bd,_0x161a05){return _0x161a05+'\x20('+_0x31a4bd+')';}export function isLocalJourneyRef(_0x4de01){const _0x59a792=a110_0x41c8;return _0x4de01[_0x59a792(0xf5)]('.yml')||_0x4de01[_0x59a792(0xf5)](_0x59a792(0xb0));}export function buildLocalRuleToNameMapping(_0x2a4ac4){const _0x256794=a110_0x41c8,_0x13e076=new Map();if(!_0x2a4ac4)return _0x13e076;for(const [_0x4e5cac,_0x13de9a]of Object[_0x256794(0xc7)](_0x2a4ac4)){if(_0x13de9a['rule']){const _0x42bc59=serializeRule(_0x13de9a[_0x256794(0xfb)]),_0x135472=_0x13e076[_0x256794(0xaf)](_0x42bc59)||[];_0x135472[_0x256794(0xc3)](_0x4e5cac),_0x13e076['set'](_0x42bc59,_0x135472);}}return _0x13e076;}export function buildLocalRuleToNameMappingFromJourney(_0x530662){const _0x106011=a110_0x41c8,_0x134c8a=_0x530662[_0x106011(0xb6)];if(!_0x134c8a)return new Map();const _0x4c4274=collectSegmentUsageCounts(_0x530662),_0x2a6384=new Map();let _0x549e55=0x0;for(const [_0x28841a,_0x5519f7]of Object[_0x106011(0xc7)](_0x134c8a)){if(!_0x5519f7[_0x106011(0xfb)]){_0x549e55++;continue;}const _0x5cd1ca=serializeRule(_0x5519f7[_0x106011(0xfb)]),_0x15f8db=_0x2a6384[_0x106011(0xaf)](_0x5cd1ca)||[];_0x15f8db[_0x106011(0xc3)]({'name':_0x28841a,'index':_0x549e55}),_0x2a6384[_0x106011(0xfa)](_0x5cd1ca,_0x15f8db),_0x549e55++;}const _0x438221=new Map();for(const [_0x52d0ce,_0x39c44a]of _0x2a6384){const _0x4d0cf9=_0x39c44a[_0x106011(0xd0)]()[_0x106011(0xc8)]((_0x2a7f9a,_0x4c4ffc)=>{const _0x351f6d=_0x106011,_0x539385=_0x4c4274[_0x351f6d(0xaf)](_0x2a7f9a[_0x351f6d(0xe8)])||0x0,_0x142917=_0x4c4274[_0x351f6d(0xaf)](_0x4c4ffc[_0x351f6d(0xe8)])||0x0;if(_0x539385!==_0x142917)return _0x142917-_0x539385;return _0x2a7f9a[_0x351f6d(0xcc)]-_0x4c4ffc[_0x351f6d(0xcc)];})[_0x106011(0xd1)](_0x1bd36b=>_0x1bd36b[_0x106011(0xe8)]);_0x438221['set'](_0x52d0ce,_0x4d0cf9);}return _0x438221;}export function collectSegmentUsageCounts(_0x963319){const _0x228570=a110_0x41c8,_0x15833d=new Map(),_0x482fbd=_0x33bb4a=>{const _0x39fe47=a110_0x41c8;if(!_0x33bb4a)return;_0x15833d[_0x39fe47(0xfa)](_0x33bb4a,(_0x15833d['get'](_0x33bb4a)||0x0)+0x1);},_0x5376c2=_0x37dff8=>{const _0x8f9b17=a110_0x41c8;for(const _0x5c0543 of _0x37dff8){_0x482fbd(_0x5c0543[_0x8f9b17(0xf2)]?.[_0x8f9b17(0xac)]);if(_0x5c0543[_0x8f9b17(0xf0)])for(const _0x56684f of _0x5c0543[_0x8f9b17(0xf0)]){_0x482fbd(_0x56684f[_0x8f9b17(0xac)]);}_0x482fbd(_0x5c0543[_0x8f9b17(0xd5)]?.[_0x8f9b17(0xac)]);if(_0x5c0543[_0x8f9b17(0xb8)])for(const _0x4f1285 of _0x5c0543[_0x8f9b17(0xb8)]){if(_0x4f1285[_0x8f9b17(0xc0)]===_0x8f9b17(0xe9))for(const _0x461afd of _0x4f1285[_0x8f9b17(0xfd)][_0x8f9b17(0xf6)]){_0x482fbd(_0x461afd[_0x8f9b17(0xac)]);}else _0x4f1285['type']==='wait'&&_0x482fbd(_0x4f1285['with'][_0x8f9b17(0xef)]?.[_0x8f9b17(0xac)]);}}};_0x482fbd(_0x963319[_0x228570(0xeb)]?.['segment']);if(_0x963319['journeys'])for(const _0x2a2831 of _0x963319[_0x228570(0xc1)]){_0x482fbd(_0x2a2831[_0x228570(0xeb)]?.[_0x228570(0xac)]),_0x5376c2(_0x2a2831['stages']);}_0x963319['stages']&&_0x5376c2(_0x963319[_0x228570(0xad)]);if(_0x963319[_0x228570(0xb4)])for(const _0x50fcbe of _0x963319[_0x228570(0xb4)]){_0x5376c2(_0x50fcbe[_0x228570(0xad)]);}return _0x15833d;}