@treasuredata/tdx 0.29.4 → 0.29.5

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 (243) 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.d.ts +1 -0
  5. package/dist/cli.d.ts.map +1 -1
  6. package/dist/cli.js +1 -1
  7. package/dist/cli.js.map +1 -1
  8. package/dist/commands/activations.js +1 -1
  9. package/dist/commands/agent-command.js +1 -1
  10. package/dist/commands/agent-test-command.js +1 -1
  11. package/dist/commands/api-command.js +1 -1
  12. package/dist/commands/auth-command.js +1 -1
  13. package/dist/commands/chat-command.js +1 -1
  14. package/dist/commands/claude-command.js +1 -1
  15. package/dist/commands/claude-statusline-command.js +1 -1
  16. package/dist/commands/claude-usage-command.js +1 -1
  17. package/dist/commands/command.js +1 -1
  18. package/dist/commands/connection-command.js +1 -1
  19. package/dist/commands/databases.js +1 -1
  20. package/dist/commands/delivery-command.js +1 -1
  21. package/dist/commands/describe.js +1 -1
  22. package/dist/commands/engage-campaign-pull-command.js +1 -1
  23. package/dist/commands/engage-campaign-push-command.js +1 -1
  24. package/dist/commands/engage-campaign-validate-command.js +1 -1
  25. package/dist/commands/engage-command.js +1 -1
  26. package/dist/commands/engage-command.js.map +1 -1
  27. package/dist/commands/engage-template-pull-command.d.ts +15 -0
  28. package/dist/commands/engage-template-pull-command.d.ts.map +1 -0
  29. package/dist/commands/engage-template-pull-command.js +1 -0
  30. package/dist/commands/engage-template-pull-command.js.map +1 -0
  31. package/dist/commands/engage-template-push-command.d.ts +16 -0
  32. package/dist/commands/engage-template-push-command.d.ts.map +1 -0
  33. package/dist/commands/engage-template-push-command.js +1 -0
  34. package/dist/commands/engage-template-push-command.js.map +1 -0
  35. package/dist/commands/engage-template-validate-command.d.ts +19 -0
  36. package/dist/commands/engage-template-validate-command.d.ts.map +1 -0
  37. package/dist/commands/engage-template-validate-command.js +1 -0
  38. package/dist/commands/engage-template-validate-command.js.map +1 -0
  39. package/dist/commands/job-command.js +1 -1
  40. package/dist/commands/journey-command.js +1 -1
  41. package/dist/commands/journey-validate-command.js +1 -1
  42. package/dist/commands/llm-command.js +1 -1
  43. package/dist/commands/mcp-command.js +1 -1
  44. package/dist/commands/parent-segment-command.js +1 -1
  45. package/dist/commands/profile-command.js +1 -1
  46. package/dist/commands/profiles-command.js +1 -1
  47. package/dist/commands/query-command.d.ts.map +1 -1
  48. package/dist/commands/query-command.js +1 -1
  49. package/dist/commands/query-command.js.map +1 -1
  50. package/dist/commands/schedule-command.js +1 -1
  51. package/dist/commands/segment-command.js +1 -1
  52. package/dist/commands/segment-create-command.js +1 -1
  53. package/dist/commands/segment-fields-command.js +1 -1
  54. package/dist/commands/segment-pull-command.js +1 -1
  55. package/dist/commands/segment-push-command.js +1 -1
  56. package/dist/commands/segment-update-command.js +1 -1
  57. package/dist/commands/segment-use-command.js +1 -1
  58. package/dist/commands/segment-validate-command.js +1 -1
  59. package/dist/commands/segments.js +1 -1
  60. package/dist/commands/show.js +1 -1
  61. package/dist/commands/status-command.js +1 -1
  62. package/dist/commands/tables.js +1 -1
  63. package/dist/commands/unset-command.js +1 -1
  64. package/dist/commands/upgrade-command.js +1 -1
  65. package/dist/commands/use-command.js +1 -1
  66. package/dist/commands/user-command.js +1 -1
  67. package/dist/commands/workflow-command.js +1 -1
  68. package/dist/core/auth.js +1 -1
  69. package/dist/core/command-output.d.ts +6 -0
  70. package/dist/core/command-output.d.ts.map +1 -1
  71. package/dist/core/command-output.js +1 -1
  72. package/dist/core/command-output.js.map +1 -1
  73. package/dist/core/config.js +1 -1
  74. package/dist/core/connection-cache.js +1 -1
  75. package/dist/core/constants.js +1 -1
  76. package/dist/core/credential-cache.js +1 -1
  77. package/dist/core/global-context.js +1 -1
  78. package/dist/core/keychain.js +1 -1
  79. package/dist/core/profile.js +1 -1
  80. package/dist/core/project-config.js +1 -1
  81. package/dist/core/session.js +1 -1
  82. package/dist/core/user-cache.js +1 -1
  83. package/dist/core/version.js +1 -1
  84. package/dist/index.js +1 -1
  85. package/dist/mcp/server.js +1 -1
  86. package/dist/mcp/tools/index.js +1 -1
  87. package/dist/mcp/tools/tdx-run.js +1 -1
  88. package/dist/mcp/tools/tdx-search.js +1 -1
  89. package/dist/mcp/utils.js +1 -1
  90. package/dist/proxy/claude-usage-tracker.js +1 -1
  91. package/dist/proxy/passthrough-server.js +1 -1
  92. package/dist/proxy/sse-usage-parser.js +1 -1
  93. package/dist/sdk/agent/agent-config.js +1 -1
  94. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  95. package/dist/sdk/agent/agent-yaml.js +1 -1
  96. package/dist/sdk/agent/test/evaluator.js +1 -1
  97. package/dist/sdk/agent/test/executor.js +1 -1
  98. package/dist/sdk/agent/test/index.js +1 -1
  99. package/dist/sdk/agent/test/output.js +1 -1
  100. package/dist/sdk/agent/test/parser.js +1 -1
  101. package/dist/sdk/agent/tool-target-registry.js +1 -1
  102. package/dist/sdk/api.js +1 -1
  103. package/dist/sdk/client/cdp-api-client.js +1 -1
  104. package/dist/sdk/client/delivery-api-client.js +1 -1
  105. package/dist/sdk/client/endpoints.d.ts +9 -0
  106. package/dist/sdk/client/endpoints.d.ts.map +1 -1
  107. package/dist/sdk/client/endpoints.js +1 -1
  108. package/dist/sdk/client/endpoints.js.map +1 -1
  109. package/dist/sdk/client/engage-api-client.js +1 -1
  110. package/dist/sdk/client/http-client.js +1 -1
  111. package/dist/sdk/client/llm-api-client.js +1 -1
  112. package/dist/sdk/client/rate-limiter.js +1 -1
  113. package/dist/sdk/client/td-api-client.js +1 -1
  114. package/dist/sdk/client/trino-api-client.js +1 -1
  115. package/dist/sdk/client/workflow-client.js +1 -1
  116. package/dist/sdk/connection-validator.js +1 -1
  117. package/dist/sdk/connection.js +1 -1
  118. package/dist/sdk/delivery.js +1 -1
  119. package/dist/sdk/engage/campaign-pull.js +1 -1
  120. package/dist/sdk/engage/campaign-push.js +1 -1
  121. package/dist/sdk/engage/campaign-validator.js +1 -1
  122. package/dist/sdk/engage/campaign-yaml.js +1 -1
  123. package/dist/sdk/engage/template-pull.d.ts +73 -0
  124. package/dist/sdk/engage/template-pull.d.ts.map +1 -0
  125. package/dist/sdk/engage/template-pull.js +1 -0
  126. package/dist/sdk/engage/template-pull.js.map +1 -0
  127. package/dist/sdk/engage/template-push.d.ts +99 -0
  128. package/dist/sdk/engage/template-push.d.ts.map +1 -0
  129. package/dist/sdk/engage/template-push.js +1 -0
  130. package/dist/sdk/engage/template-push.js.map +1 -0
  131. package/dist/sdk/engage/template-validator.d.ts +18 -0
  132. package/dist/sdk/engage/template-validator.d.ts.map +1 -0
  133. package/dist/sdk/engage/template-validator.js +1 -0
  134. package/dist/sdk/engage/template-validator.js.map +1 -0
  135. package/dist/sdk/engage/template-yaml.d.ts +69 -0
  136. package/dist/sdk/engage/template-yaml.d.ts.map +1 -0
  137. package/dist/sdk/engage/template-yaml.js +1 -0
  138. package/dist/sdk/engage/template-yaml.js.map +1 -0
  139. package/dist/sdk/engage/types/campaign-def.js +1 -1
  140. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  141. package/dist/sdk/engage/types/template-schema.d.ts +33 -0
  142. package/dist/sdk/engage/types/template-schema.d.ts.map +1 -0
  143. package/dist/sdk/engage/types/template-schema.js +1 -0
  144. package/dist/sdk/engage/types/template-schema.js.map +1 -0
  145. package/dist/sdk/engage.d.ts +1 -0
  146. package/dist/sdk/engage.d.ts.map +1 -1
  147. package/dist/sdk/engage.js +1 -1
  148. package/dist/sdk/engage.js.map +1 -1
  149. package/dist/sdk/errors.js +1 -1
  150. package/dist/sdk/index.js +1 -1
  151. package/dist/sdk/io/index.js +1 -1
  152. package/dist/sdk/io/node-filesystem.js +1 -1
  153. package/dist/sdk/job.js +1 -1
  154. package/dist/sdk/journey.js +1 -1
  155. package/dist/sdk/llm/chat-cache.js +1 -1
  156. package/dist/sdk/llm/index.js +1 -1
  157. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  158. package/dist/sdk/llm/model-factors.js +1 -1
  159. package/dist/sdk/personalization.js +1 -1
  160. package/dist/sdk/query/index.js +1 -1
  161. package/dist/sdk/query/sql-parser.js +1 -1
  162. package/dist/sdk/realtime.js +1 -1
  163. package/dist/sdk/schedule.js +1 -1
  164. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  165. package/dist/sdk/segment/fields-display.js +1 -1
  166. package/dist/sdk/segment/file-discovery.js +1 -1
  167. package/dist/sdk/segment/journey-utils.js +1 -1
  168. package/dist/sdk/segment/journey-validator.js +1 -1
  169. package/dist/sdk/segment/journey-yaml.js +1 -1
  170. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  171. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  172. package/dist/sdk/segment/pull-workflow.js +1 -1
  173. package/dist/sdk/segment/push-recovery.js +1 -1
  174. package/dist/sdk/segment/push-workflow.js +1 -1
  175. package/dist/sdk/segment/resolution-context.js +1 -1
  176. package/dist/sdk/segment/segment-path-parser.js +1 -1
  177. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  178. package/dist/sdk/segment/segment-validator.js +1 -1
  179. package/dist/sdk/segment/target-resolution.js +1 -1
  180. package/dist/sdk/segment/tdx-config.js +1 -1
  181. package/dist/sdk/segment/types/activation-schema.js +1 -1
  182. package/dist/sdk/segment/types/journey-def.js +1 -1
  183. package/dist/sdk/segment/types/journey-schema.js +1 -1
  184. package/dist/sdk/segment/types/segment-def.js +1 -1
  185. package/dist/sdk/segment/types/segment-schema.js +1 -1
  186. package/dist/sdk/segment/validate-files.d.ts +6 -1
  187. package/dist/sdk/segment/validate-files.d.ts.map +1 -1
  188. package/dist/sdk/segment/validate-files.js +1 -1
  189. package/dist/sdk/segment/validate-files.js.map +1 -1
  190. package/dist/sdk/segment/yaml-validator.d.ts +1 -1
  191. package/dist/sdk/segment/yaml-validator.d.ts.map +1 -1
  192. package/dist/sdk/segment/yaml-validator.js +1 -1
  193. package/dist/sdk/segment/yaml-validator.js.map +1 -1
  194. package/dist/sdk/segment.js +1 -1
  195. package/dist/sdk/types/engage.d.ts +2 -0
  196. package/dist/sdk/types/engage.d.ts.map +1 -1
  197. package/dist/sdk/types/index.js +1 -1
  198. package/dist/sdk/types/progress.js +1 -1
  199. package/dist/sdk/user.js +1 -1
  200. package/dist/sdk/util/format-detector.js +1 -1
  201. package/dist/sdk/util/formatters.js +1 -1
  202. package/dist/sdk/util/index.js +1 -1
  203. package/dist/sdk/util/tree-formatter.js +1 -1
  204. package/dist/sdk/workflow/archive-validation.js +1 -1
  205. package/dist/sdk/workflow/clone-workflow.js +1 -1
  206. package/dist/sdk/workflow/index.js +1 -1
  207. package/dist/sdk/workflow/pull-workflow.js +1 -1
  208. package/dist/sdk/workflow/push-workflow.js +1 -1
  209. package/dist/sdk/workflow/tdx-config.js +1 -1
  210. package/dist/sdk/workflow/workflow-utils.js +1 -1
  211. package/dist/test-utils/command-runner.js +1 -1
  212. package/dist/test-utils/factories.js +1 -1
  213. package/dist/test-utils/fixtures.js +1 -1
  214. package/dist/test-utils/http-mock.js +1 -1
  215. package/dist/test-utils/index.js +1 -1
  216. package/dist/utils/async.js +1 -1
  217. package/dist/utils/colors.js +1 -1
  218. package/dist/utils/diff.js +1 -1
  219. package/dist/utils/file-permissions.js +1 -1
  220. package/dist/utils/file-reader.js +1 -1
  221. package/dist/utils/github-releases.js +1 -1
  222. package/dist/utils/global-cache.js +1 -1
  223. package/dist/utils/json-loader.js +1 -1
  224. package/dist/utils/local-cache.js +1 -1
  225. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  226. package/dist/utils/logger/formatters/index.js +1 -1
  227. package/dist/utils/logger/handlers/console-handler.js +1 -1
  228. package/dist/utils/logger/handlers/file-handler.js +1 -1
  229. package/dist/utils/logger/handlers/index.js +1 -1
  230. package/dist/utils/logger/handlers/null-handler.js +1 -1
  231. package/dist/utils/logger/index.js +1 -1
  232. package/dist/utils/logger/logger.js +1 -1
  233. package/dist/utils/logger/types.js +1 -1
  234. package/dist/utils/option-validation.js +1 -1
  235. package/dist/utils/process.js +1 -1
  236. package/dist/utils/prompt.js +1 -1
  237. package/dist/utils/spinner.js +1 -1
  238. package/dist/utils/sse-parser.js +1 -1
  239. package/dist/utils/string-utils.js +1 -1
  240. package/dist/utils/table-ref-parser.js +1 -1
  241. package/dist/utils/tdx-logger.js +1 -1
  242. package/dist/utils/version-check.js +1 -1
  243. package/package.json +1 -1
@@ -1 +1 @@
1
- const a108_0x8828b6=a108_0x4f2e;(function(_0x55895f,_0x207651){const _0x3e899a=a108_0x4f2e,_0x5c2199=_0x55895f();while(!![]){try{const _0xa5d8d2=-parseInt(_0x3e899a(0x1e4))/0x1*(parseInt(_0x3e899a(0x254))/0x2)+-parseInt(_0x3e899a(0x23e))/0x3+parseInt(_0x3e899a(0x266))/0x4*(parseInt(_0x3e899a(0x22f))/0x5)+parseInt(_0x3e899a(0x258))/0x6*(-parseInt(_0x3e899a(0x268))/0x7)+parseInt(_0x3e899a(0x205))/0x8+-parseInt(_0x3e899a(0x24a))/0x9*(parseInt(_0x3e899a(0x1fd))/0xa)+parseInt(_0x3e899a(0x1de))/0xb;if(_0xa5d8d2===_0x207651)break;else _0x5c2199['push'](_0x5c2199['shift']());}catch(_0x123e79){_0x5c2199['push'](_0x5c2199['shift']());}}}(a108_0x366c,0xad9bc));import{CDPApiClient}from'./client/cdp-api-client.js';import{SDKError,ErrorCode,isHttp404Error}from'./errors.js';function getBundleId(_0x4841fa){const _0x25a9e2=a108_0x4f2e;return _0x4841fa[_0x25a9e2(0x24c)]??_0x4841fa[_0x25a9e2(0x219)]?.[_0x25a9e2(0x24c)]??undefined;}function a108_0x4f2e(_0x7d38d3,_0xf64763){_0x7d38d3=_0x7d38d3-0x1de;const _0x366c88=a108_0x366c();let _0x4f2ef1=_0x366c88[_0x7d38d3];return _0x4f2ef1;}function getVersionNumber(_0x4c026a){const _0x55a224=a108_0x4f2e;return _0x4c026a[_0x55a224(0x224)]??_0x4c026a[_0x55a224(0x219)]?.['versionNumber']??0x0;}export function deduplicateJourneysByBundle(_0x38945e){const _0x5ddbda=a108_0x4f2e,_0x31ee6e=new Map();let _0x40ac46=0x0;for(const _0x8d1fc3 of _0x38945e){const _0x142fab=getBundleId(_0x8d1fc3);if(!_0x142fab){const _0x4e9f05=_0x5ddbda(0x246)+(_0x8d1fc3['id']??_0x5ddbda(0x1fa)+_0x40ac46++);_0x31ee6e[_0x5ddbda(0x215)](_0x4e9f05,_0x8d1fc3);continue;}const _0x4a0072=_0x31ee6e['get'](_0x142fab);if(!_0x4a0072)_0x31ee6e[_0x5ddbda(0x215)](_0x142fab,_0x8d1fc3);else{const _0x496679=getVersionNumber(_0x4a0072),_0x29c2d1=getVersionNumber(_0x8d1fc3);_0x29c2d1>_0x496679&&_0x31ee6e[_0x5ddbda(0x215)](_0x142fab,_0x8d1fc3);}}return Array['from'](_0x31ee6e[_0x5ddbda(0x201)]());}const VALID_JOURNEY_STATES=new Set([a108_0x8828b6(0x1fe),a108_0x8828b6(0x257),a108_0x8828b6(0x252)]);export function parseJourneyState(_0x578fab){const _0x49fd98=a108_0x8828b6;if(typeof _0x578fab===_0x49fd98(0x21a)&&VALID_JOURNEY_STATES['has'](_0x578fab))return _0x578fab;return _0x49fd98(0x1fe);}export function entityToJourneyListItem(_0x49a965,_0xb09ec6){const _0x452cb0=a108_0x8828b6,_0x10df15=_0x49a965[_0x452cb0(0x219)];return{'id':_0x49a965['id'],'name':_0x10df15[_0x452cb0(0x242)]??'','journeyBundleName':_0x10df15[_0x452cb0(0x231)]??_0x10df15['name']??'','journeyBundleId':_0x10df15[_0x452cb0(0x24c)]??'','versionNumber':_0x10df15[_0x452cb0(0x224)],'description':_0x10df15[_0x452cb0(0x212)]??null,'state':parseJourneyState(_0x10df15[_0x452cb0(0x25f)]),'paused':_0x10df15[_0x452cb0(0x1fc)]??![],'audienceId':_0xb09ec6,'folderId':_0x10df15['segmentFolderId']??_0x49a965[_0x452cb0(0x1f1)]?.[_0x452cb0(0x1f3)]?.[_0x452cb0(0x206)]?.['id']??null,'createdAt':_0x10df15['createdAt']??'','updatedAt':_0x10df15[_0x452cb0(0x243)]??''};}function convertToColumnId(_0x55d71e){const _0x44758c=a108_0x8828b6;return _0x55d71e[_0x44758c(0x26d)](/-/g,'_');}function getStepEntries(_0x518840){const _0x3205c2=a108_0x8828b6;if(!_0x518840)return[];if(Array[_0x3205c2(0x202)](_0x518840))return _0x518840['map'](_0x49d89e=>[_0x49d89e['id'],_0x49d89e]);return Object[_0x3205c2(0x1e1)](_0x518840);}export function flattenJourneyActivation(_0x396593){const _0x54fac2=a108_0x8828b6,{activationParams:_0x5d5e66,activationId:_0x103814,runAfterJourneyRefresh:_0x496e7b}=_0x396593[_0x54fac2(0x219)];return{'id':_0x396593['id'],'activationId':_0x103814,'runAfterJourneyRefresh':_0x496e7b,..._0x5d5e66};}function col(_0x5cbe9b,_0x345b18={}){return{'column':_0x5cbe9b,'direction':null,'stageIndex':null,'stageName':null,'category':'fixed','stepType':null,'stepName':null,'stepId':null,'detail':null,..._0x345b18};}export function generateColumnMapping(_0x37d86a){const _0x46c373=a108_0x8828b6,_0x48cd78=[];_0x48cd78[_0x46c373(0x264)](col('cdp_customer_id')),_0x48cd78['push'](col('intime_journey',{'direction':'in','category':_0x46c373(0x1ee)})),_0x48cd78['push'](col(_0x46c373(0x213),{'direction':_0x46c373(0x1e6),'category':_0x46c373(0x1ee)}));_0x37d86a[_0x46c373(0x219)]['goal']&&_0x48cd78[_0x46c373(0x264)](col(_0x46c373(0x204),{'direction':'in','category':_0x46c373(0x203),'detail':_0x37d86a[_0x46c373(0x219)][_0x46c373(0x203)][_0x46c373(0x242)]||null}));const _0x5737c2=_0x37d86a[_0x46c373(0x219)][_0x46c373(0x262)]||[];for(let _0x2dbaf8=0x0;_0x2dbaf8<_0x5737c2[_0x46c373(0x1e0)];_0x2dbaf8++){const _0x3b1015=_0x5737c2[_0x2dbaf8],_0x454318=_0x3b1015[_0x46c373(0x242)],_0x310f3c={'stageIndex':_0x2dbaf8,'stageName':_0x454318},_0x4088ce=_0x3b1015['entryCriteria']?.['name']||null;_0x48cd78['push'](col(_0x46c373(0x24f)+_0x2dbaf8,{..._0x310f3c,'direction':'in','category':_0x46c373(0x1ef),'detail':_0x4088ce})),_0x48cd78[_0x46c373(0x264)](col(_0x46c373(0x20a)+_0x2dbaf8,{..._0x310f3c,'direction':_0x46c373(0x1e6),'category':'stage','detail':_0x4088ce}));_0x3b1015[_0x46c373(0x21d)]&&_0x48cd78['push'](col(_0x46c373(0x24f)+_0x2dbaf8+_0x46c373(0x248),{..._0x310f3c,'direction':'in','category':_0x46c373(0x21d),'detail':_0x3b1015[_0x46c373(0x21d)][_0x46c373(0x242)]||null}));const _0x450fc3=_0x3b1015[_0x46c373(0x218)]||_0x3b1015['exitCriteria']||[];for(let _0x4c5a81=0x0;_0x4c5a81<_0x450fc3[_0x46c373(0x1e0)];_0x4c5a81++){_0x48cd78[_0x46c373(0x264)](col('intime_stage_'+_0x2dbaf8+_0x46c373(0x1f7)+_0x4c5a81,{..._0x310f3c,'direction':'in','category':_0x46c373(0x21e),'detail':_0x450fc3[_0x4c5a81][_0x46c373(0x242)]||null}));}const _0x268087=getStepEntries(_0x3b1015['steps']);for(const [_0x4adcc7,_0x4bfe37]of _0x268087){const _0x4b2b0b=convertToColumnId(_0x4adcc7),_0x13ee18=_0x4bfe37[_0x46c373(0x225)]||null,_0x52227f=_0x4bfe37['name']||null,_0x186002={..._0x310f3c,'stepType':_0x13ee18,'stepName':_0x52227f,'stepId':_0x4adcc7};_0x48cd78[_0x46c373(0x264)](col('intime_stage_'+_0x2dbaf8+'_'+_0x4b2b0b,{..._0x186002,'direction':'in','category':_0x46c373(0x22b)})),_0x48cd78[_0x46c373(0x264)](col(_0x46c373(0x20a)+_0x2dbaf8+'_'+_0x4b2b0b,{..._0x186002,'direction':_0x46c373(0x1e6),'category':_0x46c373(0x22b)}));if(_0x4bfe37['type']===_0x46c373(0x235)&&_0x4bfe37[_0x46c373(0x259)])for(const _0x537785 of _0x4bfe37[_0x46c373(0x259)]){_0x537785[_0x46c373(0x20e)]&&_0x48cd78[_0x46c373(0x264)](col(_0x46c373(0x24f)+_0x2dbaf8+'_'+_0x4b2b0b+'_'+_0x537785[_0x46c373(0x20e)],{..._0x186002,'direction':'in','category':'branch','detail':_0x537785[_0x46c373(0x242)]||(_0x537785['excluded']?'Excluded\x20profiles':null)}));}if((_0x4bfe37[_0x46c373(0x225)]==='AbTest'||_0x4bfe37[_0x46c373(0x225)]===_0x46c373(0x1f5))&&_0x4bfe37['variants'])for(const _0x32ca2e of _0x4bfe37[_0x46c373(0x1e9)]){_0x32ca2e['id']&&_0x48cd78[_0x46c373(0x264)](col(_0x46c373(0x24f)+_0x2dbaf8+'_'+_0x4b2b0b+'_variant_'+convertToColumnId(_0x32ca2e['id']),{..._0x186002,'direction':'in','category':_0x46c373(0x261),'detail':_0x32ca2e['name']||null}));}if(_0x4bfe37[_0x46c373(0x225)]==='WaitStep'||_0x4bfe37[_0x46c373(0x225)]===_0x46c373(0x238)){const _0x5594e3=[];if(_0x4bfe37[_0x46c373(0x227)])_0x5594e3[_0x46c373(0x264)](_0x4bfe37['conditionSegmentId']);else{if(Array[_0x46c373(0x202)](_0x4bfe37[_0x46c373(0x20f)]))for(const _0x4ed038 of _0x4bfe37[_0x46c373(0x20f)]){_0x4ed038['segmentId']&&!_0x4ed038[_0x46c373(0x1f6)]&&_0x5594e3[_0x46c373(0x264)](_0x4ed038[_0x46c373(0x20e)]);}else _0x4bfe37[_0x46c373(0x214)]?.[_0x46c373(0x20e)]&&_0x5594e3[_0x46c373(0x264)](_0x4bfe37[_0x46c373(0x214)][_0x46c373(0x20e)]);}for(const _0x2b7518 of _0x5594e3){_0x48cd78[_0x46c373(0x264)](col(_0x46c373(0x24f)+_0x2dbaf8+'_'+_0x4b2b0b+'_'+_0x2b7518,{..._0x186002,'direction':'in','category':_0x46c373(0x210)}));}}}}return _0x48cd78[_0x46c373(0x264)](col(_0x46c373(0x216))),_0x48cd78;}export function aggregateJourneyHistory(_0x5ad3b1){const _0x3da9de=a108_0x8828b6,_0x4155bc=_0x5ad3b1[_0x3da9de(0x21f)]((_0x5c45f6,_0x53db67)=>_0x5c45f6+(_0x53db67[_0x3da9de(0x237)]??0x0),0x0),_0xdfcdc0=_0x5ad3b1[_0x3da9de(0x21f)]((_0x264d18,_0x30355b)=>_0x264d18+(_0x30355b[_0x3da9de(0x247)]??0x0),0x0),_0xcb8e7b=_0x5ad3b1['reduce']((_0x59420b,_0x579ae3)=>_0x59420b+((_0x579ae3[_0x3da9de(0x222)]??0x0)+(_0x579ae3[_0x3da9de(0x22e)]??0x0)),0x0),_0xbf5f52=_0x5ad3b1[_0x5ad3b1[_0x3da9de(0x1e0)]-0x1];return{'size':_0xbf5f52?.[_0x3da9de(0x26b)]??0x0,'entered':_0x4155bc,'goal_achieved':_0xdfcdc0,'completion_rate':_0xdfcdc0&&_0x4155bc?_0xdfcdc0/_0x4155bc*0x64:0x0,'exit_or_jump':_0xcb8e7b,'exit_or_jump_rate':_0xcb8e7b&&_0x4155bc?_0xcb8e7b/_0x4155bc*0x64:0x0};}export function aggregateStageHistory(_0x3d3e36){const _0x1fb54f=a108_0x8828b6,_0x230485=_0x3d3e36[_0x1fb54f(0x21f)]((_0x573e16,_0xdfb601)=>_0x573e16+(_0xdfb601[_0x1fb54f(0x237)]??0x0),0x0),_0x5b40b1=_0x3d3e36[_0x1fb54f(0x21f)]((_0x558db6,_0x192af3)=>_0x558db6+(_0x192af3[_0x1fb54f(0x1e7)]??0x0),0x0),_0x3e469b=_0x3d3e36[_0x1fb54f(0x21f)]((_0x36c811,_0x4c8e84)=>_0x36c811+((_0x4c8e84[_0x1fb54f(0x222)]??0x0)+(_0x4c8e84['jumpInflux']??0x0)),0x0),_0x457d66=_0x3d3e36[_0x3d3e36[_0x1fb54f(0x1e0)]-0x1];return{'size':_0x457d66?.[_0x1fb54f(0x26b)]??0x0,'entered':_0x230485,'milestone':_0x5b40b1,'milestone_rate':_0x5b40b1&&_0x230485?_0x5b40b1/_0x230485*0x64:0x0,'exit_or_jump':_0x3e469b,'exit_or_jump_rate':_0x3e469b&&_0x230485?_0x3e469b/_0x230485*0x64:0x0};}export function assembleJourneyStats(_0x510560,_0x1ef1be){const _0x364d7a=a108_0x8828b6,_0x1fccab=!!(_0x1ef1be?.[_0x364d7a(0x25b)]||_0x1ef1be?.['to'])&&!!_0x510560[_0x364d7a(0x24d)]?.[_0x364d7a(0x1e0)];if(_0x1fccab){const _0x3ffc49=aggregateJourneyHistory(_0x510560[_0x364d7a(0x24d)]),_0x211280={'journey_id':_0x510560[_0x364d7a(0x24b)],..._0x1ef1be?.['from']&&{'from':_0x1ef1be[_0x364d7a(0x25b)]},..._0x1ef1be?.['to']&&{'to':_0x1ef1be['to']},..._0x3ffc49};return _0x1ef1be?.[_0x364d7a(0x241)]&&(_0x211280[_0x364d7a(0x24d)]=_0x510560[_0x364d7a(0x24d)]),_0x211280;}return{'journey_id':_0x510560[_0x364d7a(0x24b)],'size':_0x510560[_0x364d7a(0x26b)],'entered':_0x510560[_0x364d7a(0x1ec)],'goal_achieved':_0x510560[_0x364d7a(0x269)],'completion_rate':_0x510560[_0x364d7a(0x25a)],'exit_or_jump':_0x510560[_0x364d7a(0x25e)],'exit_or_jump_rate':_0x510560[_0x364d7a(0x234)]};}export function formatVersionsFromBundle(_0x4ffd10){const _0x4345f4=a108_0x8828b6,_0x39384e=_0x4ffd10[_0x4345f4(0x217)][_0x4345f4(0x207)](_0x1e95a8=>({'journeyId':_0x1e95a8['id'],'versionNumber':_0x1e95a8['attributes'][_0x4345f4(0x224)]??0x0,'name':_0x1e95a8[_0x4345f4(0x219)][_0x4345f4(0x242)],'state':_0x1e95a8['attributes'][_0x4345f4(0x25f)],'paused':_0x1e95a8[_0x4345f4(0x219)][_0x4345f4(0x1fc)],'createdAt':_0x1e95a8[_0x4345f4(0x219)][_0x4345f4(0x22c)],'updatedAt':_0x1e95a8[_0x4345f4(0x219)][_0x4345f4(0x243)]}));return _0x39384e[_0x4345f4(0x1fb)]((_0x2a0449,_0x11f76b)=>_0x2a0449[_0x4345f4(0x224)]-_0x11f76b['versionNumber']),_0x39384e;}export function synthesizePreBundleVersion(_0x2776e8){const _0xbb345c=a108_0x8828b6;return{'journeyId':_0x2776e8['id'],'versionNumber':0x1,'name':_0x2776e8[_0xbb345c(0x219)]['name'],'state':_0x2776e8[_0xbb345c(0x219)][_0xbb345c(0x25f)],'paused':_0x2776e8[_0xbb345c(0x219)][_0xbb345c(0x1fc)],'createdAt':_0x2776e8['attributes'][_0xbb345c(0x22c)],'updatedAt':_0x2776e8[_0xbb345c(0x219)][_0xbb345c(0x243)]};}function a108_0x366c(){const _0x5c2557=['variant','journeyStages','getJourneyActivation','push','getBundle','44ByaxQN','createJourneyVersion','7mwpUGA','goalSize','add','size','client','replace','18910463iVzRoZ','pause','length','entries','listJourneysWithFolders','getTrafficData','13GnFoZh','journeyStageId','out','milestoneInflux','applyVersionDeduplication','variants','filter','rootFolderId','enteredSize','createActivation','journey','stage','listActivationsFlat','relationships','listJourneyActivations','parentFolder','get','ABTest','timedOutPath','_exit_','listActivations','resumeJourney','idx-','sort','paused','1570pRkWkI','draft','find','listJourneysFromParentSegment','values','isArray','goal','intime_goal','1557832dYqfbx','data','map','JOURNEY_NOT_FOUND','getActivationSankeyChart','outtime_stage_','update','listSegmentFolders','includeAllVersions','segmentId','conditions','branch','listEntitiesByFolder','description','outtime_journey','waitCondition','set','time','journeys','exitCriterias','attributes','string','resolveJourneyId','create','milestone','exit_criteria','reduce','activation','createVersion','exitInflux','limit','versionNumber','type','getConversionSankeyChart','conditionSegmentId','INVALID_ARGUMENT','\x20in\x20journey\x20','resume','step','createdAt','getColumnMapping','jumpInflux','363395lBtHGO','activationStepsById','journeyBundleName','listJourneys','getStatistics','exitOrJumpRate','DecisionPoint','cdp_audience_','entryInflux','Wait','getLatestJourneyId','Journey\x20activation\x20step\x20not\x20found:\x20','audienceId','createJourney','getParentSegmentFull','3158535IRornt','fetchTrafficRaw','listJourneysWithDetails','includeHistory','name','updatedAt','flat','getJourney','no-bundle-','goalInflux','_milestone','createJourneyActivation','20493QeOwlO','journeyId','journeyBundleId','history','getActivation','intime_stage_','latestJourneyId','updateJourney','launched','Journey\x20not\x20found:\x20','60682VGwqca','lastVersionNumber','has','simulation','1184784QcnDNV','branches','completionRate','from','listVersions','all','exitOrJumpSize','state','getJourneyStatistics'];a108_0x366c=function(){return _0x5c2557;};return a108_0x366c();}export function buildStageNameMap(_0x84d794){const _0x2ac317=a108_0x8828b6;return new Map(_0x84d794[_0x2ac317(0x219)][_0x2ac317(0x262)]?.[_0x2ac317(0x207)](_0x2069d6=>[_0x2069d6['id'],_0x2069d6[_0x2ac317(0x242)]])??[]);}export class JourneySDK{[a108_0x8828b6(0x26c)];constructor(_0x2ac4ff){const _0xaaf4e9=a108_0x8828b6;this[_0xaaf4e9(0x26c)]=new CDPApiClient(_0x2ac4ff);}[a108_0x8828b6(0x1e8)](_0x30f470,_0xe3ecc4){return _0xe3ecc4?_0x30f470:deduplicateJourneysByBundle(_0x30f470);}async['listJourneysWithDetails'](_0x3d9fcd,_0x46e080){const _0x31250c=a108_0x8828b6;try{const _0x322936=await this[_0x31250c(0x26c)][_0x31250c(0x240)](_0x3d9fcd);return{'journeys':this[_0x31250c(0x1e8)](_0x322936[_0x31250c(0x217)],_0x46e080),'activationStepsById':_0x322936[_0x31250c(0x230)]};}catch(_0x3d227b){if(isHttp404Error(_0x3d227b))return{'journeys':[],'activationStepsById':new Map()};throw _0x3d227b;}}async[a108_0x8828b6(0x200)](_0x1ac74a,_0x5bdf99,_0x325f2f){const _0x416a3f=a108_0x8828b6;let _0x5a705a=_0x5bdf99;if(!_0x5a705a)try{const _0x5b7b11=await this['client'][_0x416a3f(0x23d)](_0x1ac74a);_0x5a705a=_0x5b7b11[_0x416a3f(0x1eb)]??undefined;}catch(_0x2db2ed){if(isHttp404Error(_0x2db2ed))return[];throw _0x2db2ed;}if(!_0x5a705a)return[];let _0x46466d;if(_0x325f2f?.[_0x416a3f(0x20d)]){const _0x216547=await this[_0x416a3f(0x26c)][_0x416a3f(0x20c)](_0x1ac74a),_0x21a949=_0x216547['map'](_0x39999e=>this[_0x416a3f(0x26c)][_0x416a3f(0x232)](_0x39999e['id'])),_0x54ac61=await Promise[_0x416a3f(0x25d)](_0x21a949),_0x5ab443=new Set();_0x46466d=_0x54ac61[_0x416a3f(0x244)]()['filter'](_0x226241=>{const _0x415eaf=_0x416a3f;if(_0x5ab443[_0x415eaf(0x256)](_0x226241['id']))return![];return _0x5ab443[_0x415eaf(0x26a)](_0x226241['id']),!![];});}else{const _0x4664b0=await this[_0x416a3f(0x26c)]['listEntitiesByFolder'](_0x5a705a,0x20,![]),_0x2781a1=_0x4664b0[_0x416a3f(0x206)],_0x3a541c=_0x2781a1[_0x416a3f(0x1ea)](_0x2f5821=>_0x2f5821['type']===_0x416a3f(0x1ee));_0x46466d=_0x3a541c['map'](_0x2ab98d=>entityToJourneyListItem(_0x2ab98d,_0x1ac74a));}return this['applyVersionDeduplication'](_0x46466d,_0x325f2f?.[_0x416a3f(0x20d)]);}async[a108_0x8828b6(0x1e2)](_0x1e500d,_0x1b0f67,_0x188c21){const _0x1e554c=a108_0x8828b6;if(!_0x1b0f67)return{'journeys':[],'folders':[]};const _0x25b6d2=await this[_0x1e554c(0x26c)][_0x1e554c(0x211)](_0x1b0f67,0x20,![]),_0x429c0f=_0x25b6d2['data'],_0x4b6719=_0x429c0f[_0x1e554c(0x1ea)](_0x1c7bb7=>_0x1c7bb7[_0x1e554c(0x225)]==='folder-segment'&&_0x1c7bb7['id']!==_0x1b0f67),_0x2bd4ee=_0x4b6719['map'](_0x3f1a9d=>({'id':_0x3f1a9d['id'],'name':_0x3f1a9d[_0x1e554c(0x219)][_0x1e554c(0x242)]})),_0x4d979c=_0x429c0f[_0x1e554c(0x1ea)](_0x1153b7=>_0x1153b7['type']===_0x1e554c(0x1ee)),_0x57e8be=_0x4d979c[_0x1e554c(0x207)](_0x2c2198=>entityToJourneyListItem(_0x2c2198,_0x1e500d));return{'journeys':this[_0x1e554c(0x1e8)](_0x57e8be,_0x188c21?.['includeAllVersions']),'folders':_0x2bd4ee};}async['listJourneysWithDetailsFromParentSegment'](_0x3d4e,_0x3c72a0){const _0x43c627=a108_0x8828b6;let _0x5df352;try{_0x5df352=await this[_0x43c627(0x26c)]['listSegmentFolders'](_0x3d4e);}catch(_0xf9b61a){if(isHttp404Error(_0xf9b61a))return{'journeys':[],'activationStepsById':new Map()};throw _0xf9b61a;}const _0x2532f8=_0x5df352['map'](async _0x30f3c2=>{const _0x277012=_0x43c627;return await this['listJourneysWithDetails'](_0x30f3c2['id'],_0x3c72a0?.[_0x277012(0x20d)]);}),_0x201ab8=await Promise['all'](_0x2532f8),_0x506391=new Map(),_0x144743=[];for(const _0x20de9c of _0x201ab8){_0x144743[_0x43c627(0x264)](..._0x20de9c[_0x43c627(0x217)]);for(const [_0xd4ab7e,_0x543b9a]of _0x20de9c[_0x43c627(0x230)]){_0x506391['set'](_0xd4ab7e,_0x543b9a);}}const _0x446a64=new Set(),_0x44825a=_0x144743[_0x43c627(0x1ea)](_0x26abc3=>{const _0x34958b=_0x43c627;if(_0x446a64[_0x34958b(0x256)](_0x26abc3['id']))return![];return _0x446a64[_0x34958b(0x26a)](_0x26abc3['id']),!![];});return{'journeys':this['applyVersionDeduplication'](_0x44825a,_0x3c72a0?.[_0x43c627(0x20d)]),'activationStepsById':_0x506391};}async['getJourney'](_0xc62dcc){const _0x5b7122=a108_0x8828b6;try{return await this['client']['getJourney'](_0xc62dcc);}catch(_0x2b5be7){if(isHttp404Error(_0x2b5be7))throw new SDKError(ErrorCode['JOURNEY_NOT_FOUND'],_0x5b7122(0x253)+_0xc62dcc,_0x2b5be7);throw _0x2b5be7;}}async[a108_0x8828b6(0x21b)](_0x2b65ad,_0x4f5dd9){const _0x539f7d=a108_0x8828b6,_0x4d268f=await this[_0x539f7d(0x200)](_0x2b65ad),_0x4310e8=_0x4d268f[_0x539f7d(0x1ff)](_0x453449=>_0x453449[_0x539f7d(0x231)]['toLowerCase']()===_0x4f5dd9['toLowerCase']());if(!_0x4310e8)throw new SDKError(ErrorCode[_0x539f7d(0x208)],'Journey\x20not\x20found:\x20'+_0x4f5dd9,undefined,{'helpText':'Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys'});return _0x4310e8['id'];}async[a108_0x8828b6(0x233)](_0x559ff0,_0x2d3ca1){const _0x48a798=a108_0x8828b6;try{return await this['client'][_0x48a798(0x260)](_0x559ff0,_0x2d3ca1);}catch(_0x15c7c2){if(isHttp404Error(_0x15c7c2))throw new SDKError(ErrorCode[_0x48a798(0x208)],_0x48a798(0x253)+_0x559ff0,_0x15c7c2);throw _0x15c7c2;}}async[a108_0x8828b6(0x1e3)](_0x11a3b3,_0xa7c553){const _0x23f1e3=a108_0x8828b6,_0xff0c66={'from':_0xa7c553?.[_0x23f1e3(0x25b)],'to':_0xa7c553?.['to'],'limit':_0xa7c553?.[_0x23f1e3(0x223)]},_0x4ebbdf=_0xa7c553?.[_0x23f1e3(0x225)]!=='conversion';try{const [_0x3c37d6,_0x50630a]=await Promise[_0x23f1e3(0x25d)]([this[_0x23f1e3(0x23f)](_0x11a3b3,_0xa7c553?.[_0x23f1e3(0x225)],_0xff0c66),_0x4ebbdf?this[_0x23f1e3(0x245)](_0x11a3b3):undefined]);if(_0x3c37d6[_0x23f1e3(0x220)]&&_0x50630a){const _0x14a67d=buildStageNameMap(_0x50630a);_0x3c37d6['activation']=_0x3c37d6[_0x23f1e3(0x220)]['map'](_0x59d105=>({..._0x59d105,'journeyStageName':_0x14a67d[_0x23f1e3(0x1f4)](_0x59d105[_0x23f1e3(0x1e5)])??_0x59d105[_0x23f1e3(0x1e5)]}));}return _0x3c37d6;}catch(_0x17326e){if(isHttp404Error(_0x17326e))throw new SDKError(ErrorCode[_0x23f1e3(0x208)],'Journey\x20not\x20found:\x20'+_0x11a3b3,_0x17326e);throw _0x17326e;}}async[a108_0x8828b6(0x23f)](_0x3eb90a,_0x20705e,_0x501b20){const _0x34845c=a108_0x8828b6;if(_0x20705e==='conversion'){const _0x464b2e=await this[_0x34845c(0x26c)][_0x34845c(0x226)](_0x3eb90a,_0x501b20);return{'conversion':_0x464b2e};}if(_0x20705e==='activation'){const _0x5a9aa8=await this[_0x34845c(0x26c)][_0x34845c(0x209)](_0x3eb90a,_0x501b20);return{'activation':_0x5a9aa8};}const [_0x565c12,_0x25c9e8]=await Promise[_0x34845c(0x25d)]([this[_0x34845c(0x26c)]['getConversionSankeyChart'](_0x3eb90a,_0x501b20),this[_0x34845c(0x26c)][_0x34845c(0x209)](_0x3eb90a,_0x501b20)]);return{'conversion':_0x565c12,'activation':_0x25c9e8};}async[a108_0x8828b6(0x1df)](_0x5cfff0){const _0x4b969e=a108_0x8828b6;try{return await this['client']['pauseJourney'](_0x5cfff0);}catch(_0x4b2d04){if(isHttp404Error(_0x4b2d04))throw new SDKError(ErrorCode[_0x4b969e(0x208)],_0x4b969e(0x253)+_0x5cfff0,_0x4b2d04);throw _0x4b2d04;}}async[a108_0x8828b6(0x22a)](_0x342fdf){const _0x43b1fb=a108_0x8828b6;try{return await this[_0x43b1fb(0x26c)][_0x43b1fb(0x1f9)](_0x342fdf);}catch(_0x472fd0){if(isHttp404Error(_0x472fd0))throw new SDKError(ErrorCode[_0x43b1fb(0x208)],_0x43b1fb(0x253)+_0x342fdf,_0x472fd0);throw _0x472fd0;}}async[a108_0x8828b6(0x21c)](_0xd356c9){const _0x5d05d6=a108_0x8828b6;return await this[_0x5d05d6(0x26c)][_0x5d05d6(0x23c)](_0xd356c9);}async[a108_0x8828b6(0x20b)](_0x2a45d8,_0x46f827){const _0x234d68=a108_0x8828b6;try{return await this['client'][_0x234d68(0x251)](_0x2a45d8,_0x46f827);}catch(_0xcbfe05){if(isHttp404Error(_0xcbfe05))throw new SDKError(ErrorCode[_0x234d68(0x208)],'Journey\x20not\x20found:\x20'+_0x2a45d8,_0xcbfe05);throw _0xcbfe05;}}async[a108_0x8828b6(0x24e)](_0x118beb,_0x15c8c8){const _0x487a2c=a108_0x8828b6;try{return await this['client'][_0x487a2c(0x263)](_0x118beb,_0x15c8c8);}catch(_0x3ac72e){if(isHttp404Error(_0x3ac72e))throw new SDKError(ErrorCode['NOT_FOUND'],_0x487a2c(0x23a)+_0x15c8c8+_0x487a2c(0x229)+_0x118beb,_0x3ac72e);throw _0x3ac72e;}}async[a108_0x8828b6(0x1f8)](_0x16def3){const _0x3557de=a108_0x8828b6;try{return await this[_0x3557de(0x26c)][_0x3557de(0x1f2)](_0x16def3);}catch(_0x1a0368){if(isHttp404Error(_0x1a0368))return[];throw _0x1a0368;}}async[a108_0x8828b6(0x1f0)](_0x254549){const _0x89955c=a108_0x8828b6,_0x326fbf=await this[_0x89955c(0x1f8)](_0x254549);return _0x326fbf[_0x89955c(0x207)](flattenJourneyActivation);}async[a108_0x8828b6(0x1ed)](_0x315f0c,_0x3bf7fb){const _0x1c68db=a108_0x8828b6;return await this[_0x1c68db(0x26c)][_0x1c68db(0x249)](_0x315f0c,_0x3bf7fb);}async[a108_0x8828b6(0x22d)](_0x1ab47b){const _0x340c26=a108_0x8828b6,_0x35ba9e=await this[_0x340c26(0x245)](_0x1ab47b),_0x2c1d2f=generateColumnMapping(_0x35ba9e);return{'journeyId':_0x35ba9e['id'],'journeyName':_0x35ba9e[_0x340c26(0x219)][_0x340c26(0x242)],'database':_0x340c26(0x236)+_0x35ba9e[_0x340c26(0x219)][_0x340c26(0x23b)],'table':'journey_'+_0x35ba9e['id'],'columns':_0x2c1d2f};}async['getBundle'](_0x35cb0b){return this['client']['getJourneyBundle'](_0x35cb0b);}async[a108_0x8828b6(0x239)](_0xea2ee5){const _0x16ae5a=a108_0x8828b6;if(!_0xea2ee5)return undefined;try{const _0x5cb611=await this[_0x16ae5a(0x265)](_0xea2ee5);return _0x5cb611[_0x16ae5a(0x250)];}catch{return undefined;}}async[a108_0x8828b6(0x25c)](_0x85e997){const _0x404946=a108_0x8828b6,_0x2dfc35=await this[_0x404946(0x245)](_0x85e997),_0x17a616=_0x2dfc35['attributes'][_0x404946(0x24c)];if(!_0x17a616)return{'bundleId':'','bundleName':_0x2dfc35[_0x404946(0x219)][_0x404946(0x242)],'bundleDescription':_0x2dfc35[_0x404946(0x219)][_0x404946(0x212)]??null,'latestJourneyId':_0x2dfc35['id'],'versions':[synthesizePreBundleVersion(_0x2dfc35)]};const _0x2ce152=await this[_0x404946(0x265)](_0x17a616);return{'bundleId':_0x17a616,'bundleName':_0x2ce152[_0x404946(0x242)],'bundleDescription':_0x2ce152['description']??null,'latestJourneyId':_0x2ce152[_0x404946(0x250)],'versions':formatVersionsFromBundle(_0x2ce152)};}async[a108_0x8828b6(0x221)](_0x54da5f){const _0x3987f0=a108_0x8828b6,_0x48da66=await this['getJourney'](_0x54da5f),_0x246f33=_0x48da66[_0x3987f0(0x219)][_0x3987f0(0x24c)];if(!_0x246f33)throw new SDKError(ErrorCode[_0x3987f0(0x228)],'Cannot\x20create\x20a\x20new\x20version:\x20this\x20journey\x20does\x20not\x20belong\x20to\x20a\x20bundle');await this[_0x3987f0(0x26c)]['checkJourneyAppendable'](_0x246f33);const _0x581b89=await this[_0x3987f0(0x26c)]['getJourneyBundle'](_0x246f33),_0x6946ba=_0x581b89[_0x3987f0(0x242)]+'\x20v'+(_0x581b89[_0x3987f0(0x255)]+0x1);return this[_0x3987f0(0x26c)][_0x3987f0(0x267)](_0x246f33,{'sourceId':_0x54da5f,'attributes':{'name':_0x6946ba}});}}
1
+ const a116_0x19a12f=a116_0x49ec;(function(_0x5879b7,_0x4f3966){const _0x1c1d75=a116_0x49ec,_0x2604d8=_0x5879b7();while(!![]){try{const _0x55f5d4=parseInt(_0x1c1d75(0x226))/0x1+parseInt(_0x1c1d75(0x1dd))/0x2+parseInt(_0x1c1d75(0x245))/0x3*(-parseInt(_0x1c1d75(0x1f8))/0x4)+-parseInt(_0x1c1d75(0x1d6))/0x5*(-parseInt(_0x1c1d75(0x268))/0x6)+parseInt(_0x1c1d75(0x231))/0x7*(parseInt(_0x1c1d75(0x1d8))/0x8)+-parseInt(_0x1c1d75(0x222))/0x9*(parseInt(_0x1c1d75(0x21e))/0xa)+-parseInt(_0x1c1d75(0x21d))/0xb;if(_0x55f5d4===_0x4f3966)break;else _0x2604d8['push'](_0x2604d8['shift']());}catch(_0x172a04){_0x2604d8['push'](_0x2604d8['shift']());}}}(a116_0x5ecf,0xb0585));import{CDPApiClient}from'./client/cdp-api-client.js';import{SDKError,ErrorCode,isHttp404Error}from'./errors.js';function getBundleId(_0x34560c){const _0xecacb4=a116_0x49ec;return _0x34560c[_0xecacb4(0x246)]??_0x34560c[_0xecacb4(0x1e1)]?.['journeyBundleId']??undefined;}function getVersionNumber(_0x4dd7d4){const _0x19d7ba=a116_0x49ec;return _0x4dd7d4[_0x19d7ba(0x22b)]??_0x4dd7d4[_0x19d7ba(0x1e1)]?.[_0x19d7ba(0x22b)]??0x0;}export function deduplicateJourneysByBundle(_0x122769){const _0x284592=a116_0x49ec,_0x109eb9=new Map();let _0x4be97b=0x0;for(const _0x50db45 of _0x122769){const _0x5c4cac=getBundleId(_0x50db45);if(!_0x5c4cac){const _0x19f720=_0x284592(0x20f)+(_0x50db45['id']??_0x284592(0x21c)+_0x4be97b++);_0x109eb9['set'](_0x19f720,_0x50db45);continue;}const _0x3754e4=_0x109eb9['get'](_0x5c4cac);if(!_0x3754e4)_0x109eb9[_0x284592(0x202)](_0x5c4cac,_0x50db45);else{const _0x2d15aa=getVersionNumber(_0x3754e4),_0x7244b=getVersionNumber(_0x50db45);_0x7244b>_0x2d15aa&&_0x109eb9[_0x284592(0x202)](_0x5c4cac,_0x50db45);}}return Array['from'](_0x109eb9[_0x284592(0x262)]());}const VALID_JOURNEY_STATES=new Set([a116_0x19a12f(0x224),a116_0x19a12f(0x236),a116_0x19a12f(0x242)]);export function parseJourneyState(_0x431678){const _0x45c158=a116_0x19a12f;if(typeof _0x431678==='string'&&VALID_JOURNEY_STATES[_0x45c158(0x204)](_0x431678))return _0x431678;return _0x45c158(0x224);}export function entityToJourneyListItem(_0x1321b0,_0x5093dc){const _0x149fc7=a116_0x19a12f,_0x2e6cc8=_0x1321b0['attributes'];return{'id':_0x1321b0['id'],'name':_0x2e6cc8[_0x149fc7(0x209)]??'','journeyBundleName':_0x2e6cc8[_0x149fc7(0x267)]??_0x2e6cc8[_0x149fc7(0x209)]??'','journeyBundleId':_0x2e6cc8[_0x149fc7(0x246)]??'','versionNumber':_0x2e6cc8['versionNumber'],'description':_0x2e6cc8[_0x149fc7(0x24b)]??null,'state':parseJourneyState(_0x2e6cc8[_0x149fc7(0x1f4)]),'paused':_0x2e6cc8[_0x149fc7(0x252)]??![],'audienceId':_0x5093dc,'folderId':_0x2e6cc8['segmentFolderId']??_0x1321b0['relationships']?.[_0x149fc7(0x217)]?.[_0x149fc7(0x211)]?.['id']??null,'createdAt':_0x2e6cc8[_0x149fc7(0x207)]??'','updatedAt':_0x2e6cc8[_0x149fc7(0x24c)]??''};}function convertToColumnId(_0x1791eb){const _0x4e8f38=a116_0x19a12f;return _0x1791eb[_0x4e8f38(0x25e)](/-/g,'_');}function getStepEntries(_0x583969){const _0x6d88ff=a116_0x19a12f;if(!_0x583969)return[];if(Array[_0x6d88ff(0x1f5)](_0x583969))return _0x583969[_0x6d88ff(0x25c)](_0x5ddb9d=>[_0x5ddb9d['id'],_0x5ddb9d]);return Object[_0x6d88ff(0x1f9)](_0x583969);}function a116_0x5ecf(){const _0x4e1247=['journey','pauseJourney','branch','intime_goal','getJourneyStatistics','set','resolveJourneyId','has','getActivationSankeyChart','timedOutPath','createdAt','getJourney','name','Journey\x20not\x20found:\x20','exitCriteria','listVersions','getParentSegmentFull','journeyStageId','no-bundle-','listJourneysFromParentSegment','data','goalSize','size','intime_journey','listActivations','createVersion','parentFolder','all','ABTest','step','getBundle','idx-','20981763DgiajG','503430YiDVzm','listJourneyActivations','folder-segment','cdp_customer_id','99kunSGQ','listJourneysWithFolders','draft','DecisionPoint','1415750OFPbzU','fetchTrafficRaw','INVALID_ARGUMENT','latestJourneyId','listJourneysWithDetails','versionNumber','applyVersionDeduplication','JOURNEY_NOT_FOUND','goal','from','rootFolderId','45178luGCNZ','exitInflux','fixed','Wait','journey_','simulation','out','add','getJourneyActivation','enteredSize','_variant_','segmentId','getTrafficData','limit','type','sort','getColumnMapping','launched','exit_criteria','getConversionSankeyChart','6tjSazO','journeyBundleId','variant','outtime_journey','updateJourney','pause','description','updatedAt','outtime_stage_','branches','createJourneyVersion','checkJourneyAppendable','jumpInflux','paused','completionRate','resumeJourney','Journey\x20activation\x20step\x20not\x20found:\x20','AbTest','WaitStep','\x20in\x20journey\x20','listEntitiesByFolder','find','Cannot\x20create\x20a\x20new\x20version:\x20this\x20journey\x20does\x20not\x20belong\x20to\x20a\x20bundle','map','history','replace','entryInflux','createJourneyActivation','reduce','values','conditions','createJourney','includeAllVersions','intime_stage_','journeyBundleName','10866eOnMmo','toLowerCase','1715PbcDzo','createActivation','1656qeiTlY','resume','time','getActivation','getJourneyBundle','2177272rwTPPt','exitOrJumpSize','journeys','variants','attributes','conditionSegmentId','journeyStages','listSegmentFolders','filter','activation','exitOrJumpRate','listActivationsFlat','client','conversion','create','getStatistics','activationStepsById','_milestone','_exit_','Excluded\x20profiles','milestone','stage','journeyId','state','isArray','getLatestJourneyId','listJourneys','2556044ZiPpIB','entries','push','length','flat'];a116_0x5ecf=function(){return _0x4e1247;};return a116_0x5ecf();}export function flattenJourneyActivation(_0x179e21){const {activationParams:_0x54e008,activationId:_0x11ffb7,runAfterJourneyRefresh:_0x1d0298}=_0x179e21['attributes'];return{'id':_0x179e21['id'],'activationId':_0x11ffb7,'runAfterJourneyRefresh':_0x1d0298,..._0x54e008};}function col(_0x4099c5,_0x26acac={}){const _0xbd9dc5=a116_0x19a12f;return{'column':_0x4099c5,'direction':null,'stageIndex':null,'stageName':null,'category':_0xbd9dc5(0x233),'stepType':null,'stepName':null,'stepId':null,'detail':null,..._0x26acac};}function a116_0x49ec(_0x25babe,_0x5273cf){_0x25babe=_0x25babe-0x1d5;const _0x5ecfef=a116_0x5ecf();let _0x49eccd=_0x5ecfef[_0x25babe];return _0x49eccd;}export function generateColumnMapping(_0xb2329e){const _0x5b3aef=a116_0x19a12f,_0x23c0ed=[];_0x23c0ed['push'](col(_0x5b3aef(0x221))),_0x23c0ed[_0x5b3aef(0x1fa)](col(_0x5b3aef(0x214),{'direction':'in','category':_0x5b3aef(0x1fd)})),_0x23c0ed[_0x5b3aef(0x1fa)](col(_0x5b3aef(0x248),{'direction':_0x5b3aef(0x237),'category':_0x5b3aef(0x1fd)}));_0xb2329e[_0x5b3aef(0x1e1)]['goal']&&_0x23c0ed[_0x5b3aef(0x1fa)](col(_0x5b3aef(0x200),{'direction':'in','category':_0x5b3aef(0x22e),'detail':_0xb2329e[_0x5b3aef(0x1e1)]['goal'][_0x5b3aef(0x209)]||null}));const _0x58d9fd=_0xb2329e['attributes'][_0x5b3aef(0x1e3)]||[];for(let _0x3b9dc4=0x0;_0x3b9dc4<_0x58d9fd[_0x5b3aef(0x1fb)];_0x3b9dc4++){const _0x3305f1=_0x58d9fd[_0x3b9dc4],_0x893d4a=_0x3305f1[_0x5b3aef(0x209)],_0x162e35={'stageIndex':_0x3b9dc4,'stageName':_0x893d4a},_0x57b156=_0x3305f1['entryCriteria']?.['name']||null;_0x23c0ed[_0x5b3aef(0x1fa)](col(_0x5b3aef(0x266)+_0x3b9dc4,{..._0x162e35,'direction':'in','category':'stage','detail':_0x57b156})),_0x23c0ed[_0x5b3aef(0x1fa)](col(_0x5b3aef(0x24d)+_0x3b9dc4,{..._0x162e35,'direction':_0x5b3aef(0x237),'category':_0x5b3aef(0x1f2),'detail':_0x57b156}));_0x3305f1[_0x5b3aef(0x1f1)]&&_0x23c0ed[_0x5b3aef(0x1fa)](col('intime_stage_'+_0x3b9dc4+_0x5b3aef(0x1ee),{..._0x162e35,'direction':'in','category':_0x5b3aef(0x1f1),'detail':_0x3305f1[_0x5b3aef(0x1f1)][_0x5b3aef(0x209)]||null}));const _0x452419=_0x3305f1['exitCriterias']||_0x3305f1[_0x5b3aef(0x20b)]||[];for(let _0x494872=0x0;_0x494872<_0x452419[_0x5b3aef(0x1fb)];_0x494872++){_0x23c0ed['push'](col(_0x5b3aef(0x266)+_0x3b9dc4+_0x5b3aef(0x1ef)+_0x494872,{..._0x162e35,'direction':'in','category':_0x5b3aef(0x243),'detail':_0x452419[_0x494872][_0x5b3aef(0x209)]||null}));}const _0x5b6d4f=getStepEntries(_0x3305f1['steps']);for(const [_0x203566,_0xc852dd]of _0x5b6d4f){const _0x17e478=convertToColumnId(_0x203566),_0x183514=_0xc852dd['type']||null,_0x1a3c7d=_0xc852dd['name']||null,_0x44f350={..._0x162e35,'stepType':_0x183514,'stepName':_0x1a3c7d,'stepId':_0x203566};_0x23c0ed[_0x5b3aef(0x1fa)](col(_0x5b3aef(0x266)+_0x3b9dc4+'_'+_0x17e478,{..._0x44f350,'direction':'in','category':_0x5b3aef(0x21a)})),_0x23c0ed[_0x5b3aef(0x1fa)](col(_0x5b3aef(0x24d)+_0x3b9dc4+'_'+_0x17e478,{..._0x44f350,'direction':_0x5b3aef(0x237),'category':'step'}));if(_0xc852dd[_0x5b3aef(0x23f)]===_0x5b3aef(0x225)&&_0xc852dd[_0x5b3aef(0x24e)])for(const _0x55b647 of _0xc852dd[_0x5b3aef(0x24e)]){_0x55b647['segmentId']&&_0x23c0ed[_0x5b3aef(0x1fa)](col(_0x5b3aef(0x266)+_0x3b9dc4+'_'+_0x17e478+'_'+_0x55b647[_0x5b3aef(0x23c)],{..._0x44f350,'direction':'in','category':_0x5b3aef(0x1ff),'detail':_0x55b647['name']||(_0x55b647['excluded']?_0x5b3aef(0x1f0):null)}));}if((_0xc852dd[_0x5b3aef(0x23f)]===_0x5b3aef(0x256)||_0xc852dd[_0x5b3aef(0x23f)]===_0x5b3aef(0x219))&&_0xc852dd[_0x5b3aef(0x1e0)])for(const _0x3f16fd of _0xc852dd[_0x5b3aef(0x1e0)]){_0x3f16fd['id']&&_0x23c0ed[_0x5b3aef(0x1fa)](col('intime_stage_'+_0x3b9dc4+'_'+_0x17e478+_0x5b3aef(0x23b)+convertToColumnId(_0x3f16fd['id']),{..._0x44f350,'direction':'in','category':_0x5b3aef(0x247),'detail':_0x3f16fd[_0x5b3aef(0x209)]||null}));}if(_0xc852dd[_0x5b3aef(0x23f)]===_0x5b3aef(0x257)||_0xc852dd[_0x5b3aef(0x23f)]===_0x5b3aef(0x234)){const _0x44b095=[];if(_0xc852dd['conditionSegmentId'])_0x44b095['push'](_0xc852dd[_0x5b3aef(0x1e2)]);else{if(Array['isArray'](_0xc852dd['conditions']))for(const _0x113fb9 of _0xc852dd[_0x5b3aef(0x263)]){_0x113fb9[_0x5b3aef(0x23c)]&&!_0x113fb9[_0x5b3aef(0x206)]&&_0x44b095[_0x5b3aef(0x1fa)](_0x113fb9[_0x5b3aef(0x23c)]);}else _0xc852dd['waitCondition']?.[_0x5b3aef(0x23c)]&&_0x44b095[_0x5b3aef(0x1fa)](_0xc852dd['waitCondition'][_0x5b3aef(0x23c)]);}for(const _0xc853fc of _0x44b095){_0x23c0ed[_0x5b3aef(0x1fa)](col(_0x5b3aef(0x266)+_0x3b9dc4+'_'+_0x17e478+'_'+_0xc853fc,{..._0x44f350,'direction':'in','category':_0x5b3aef(0x1ff)}));}}}}return _0x23c0ed[_0x5b3aef(0x1fa)](col(_0x5b3aef(0x1da))),_0x23c0ed;}export function aggregateJourneyHistory(_0x279a43){const _0x3f5b34=a116_0x19a12f,_0x295e3d=_0x279a43['reduce']((_0x40768b,_0x135717)=>_0x40768b+(_0x135717[_0x3f5b34(0x25f)]??0x0),0x0),_0xb35d87=_0x279a43[_0x3f5b34(0x261)]((_0x5dfe92,_0xd8fb56)=>_0x5dfe92+(_0xd8fb56['goalInflux']??0x0),0x0),_0x53d6f8=_0x279a43[_0x3f5b34(0x261)]((_0x5ea4e2,_0x29b370)=>_0x5ea4e2+((_0x29b370[_0x3f5b34(0x232)]??0x0)+(_0x29b370[_0x3f5b34(0x251)]??0x0)),0x0),_0xf3debf=_0x279a43[_0x279a43[_0x3f5b34(0x1fb)]-0x1];return{'size':_0xf3debf?.[_0x3f5b34(0x213)]??0x0,'entered':_0x295e3d,'goal_achieved':_0xb35d87,'completion_rate':_0xb35d87&&_0x295e3d?_0xb35d87/_0x295e3d*0x64:0x0,'exit_or_jump':_0x53d6f8,'exit_or_jump_rate':_0x53d6f8&&_0x295e3d?_0x53d6f8/_0x295e3d*0x64:0x0};}export function aggregateStageHistory(_0x514019){const _0x303149=a116_0x19a12f,_0x2489a1=_0x514019[_0x303149(0x261)]((_0x2beb65,_0x466ed1)=>_0x2beb65+(_0x466ed1[_0x303149(0x25f)]??0x0),0x0),_0x24593f=_0x514019[_0x303149(0x261)]((_0x599c00,_0x44c26d)=>_0x599c00+(_0x44c26d['milestoneInflux']??0x0),0x0),_0x57a6ee=_0x514019['reduce']((_0x36f49d,_0xb41c22)=>_0x36f49d+((_0xb41c22[_0x303149(0x232)]??0x0)+(_0xb41c22[_0x303149(0x251)]??0x0)),0x0),_0x33b887=_0x514019[_0x514019[_0x303149(0x1fb)]-0x1];return{'size':_0x33b887?.['size']??0x0,'entered':_0x2489a1,'milestone':_0x24593f,'milestone_rate':_0x24593f&&_0x2489a1?_0x24593f/_0x2489a1*0x64:0x0,'exit_or_jump':_0x57a6ee,'exit_or_jump_rate':_0x57a6ee&&_0x2489a1?_0x57a6ee/_0x2489a1*0x64:0x0};}export function assembleJourneyStats(_0x2a492e,_0x186d76){const _0x22ad8c=a116_0x19a12f,_0x4ad4fc=!!(_0x186d76?.[_0x22ad8c(0x22f)]||_0x186d76?.['to'])&&!!_0x2a492e['history']?.[_0x22ad8c(0x1fb)];if(_0x4ad4fc){const _0x2224a6=aggregateJourneyHistory(_0x2a492e[_0x22ad8c(0x25d)]),_0x1f53ac={'journey_id':_0x2a492e['journeyId'],..._0x186d76?.['from']&&{'from':_0x186d76[_0x22ad8c(0x22f)]},..._0x186d76?.['to']&&{'to':_0x186d76['to']},..._0x2224a6};return _0x186d76?.['includeHistory']&&(_0x1f53ac[_0x22ad8c(0x25d)]=_0x2a492e[_0x22ad8c(0x25d)]),_0x1f53ac;}return{'journey_id':_0x2a492e[_0x22ad8c(0x1f3)],'size':_0x2a492e[_0x22ad8c(0x213)],'entered':_0x2a492e[_0x22ad8c(0x23a)],'goal_achieved':_0x2a492e[_0x22ad8c(0x212)],'completion_rate':_0x2a492e[_0x22ad8c(0x253)],'exit_or_jump':_0x2a492e[_0x22ad8c(0x1de)],'exit_or_jump_rate':_0x2a492e[_0x22ad8c(0x1e7)]};}export function formatVersionsFromBundle(_0x6bb128){const _0xf53688=a116_0x19a12f,_0x191f35=_0x6bb128[_0xf53688(0x1df)][_0xf53688(0x25c)](_0x482ac0=>({'journeyId':_0x482ac0['id'],'versionNumber':_0x482ac0[_0xf53688(0x1e1)]['versionNumber']??0x0,'name':_0x482ac0[_0xf53688(0x1e1)]['name'],'state':_0x482ac0[_0xf53688(0x1e1)][_0xf53688(0x1f4)],'paused':_0x482ac0[_0xf53688(0x1e1)][_0xf53688(0x252)],'createdAt':_0x482ac0[_0xf53688(0x1e1)][_0xf53688(0x207)],'updatedAt':_0x482ac0[_0xf53688(0x1e1)][_0xf53688(0x24c)]}));return _0x191f35[_0xf53688(0x240)]((_0x358896,_0x5aa680)=>_0x358896[_0xf53688(0x22b)]-_0x5aa680[_0xf53688(0x22b)]),_0x191f35;}export function synthesizePreBundleVersion(_0x56b703){const _0x3f2a61=a116_0x19a12f;return{'journeyId':_0x56b703['id'],'versionNumber':0x1,'name':_0x56b703['attributes'][_0x3f2a61(0x209)],'state':_0x56b703['attributes']['state'],'paused':_0x56b703['attributes'][_0x3f2a61(0x252)],'createdAt':_0x56b703[_0x3f2a61(0x1e1)][_0x3f2a61(0x207)],'updatedAt':_0x56b703['attributes'][_0x3f2a61(0x24c)]};}export function buildStageNameMap(_0x40f8db){const _0x400fee=a116_0x19a12f;return new Map(_0x40f8db[_0x400fee(0x1e1)][_0x400fee(0x1e3)]?.[_0x400fee(0x25c)](_0x359751=>[_0x359751['id'],_0x359751[_0x400fee(0x209)]])??[]);}export class JourneySDK{[a116_0x19a12f(0x1e9)];constructor(_0x4006b8){const _0x2adea7=a116_0x19a12f;this[_0x2adea7(0x1e9)]=new CDPApiClient(_0x4006b8);}[a116_0x19a12f(0x22c)](_0x59fb88,_0x1f3f10){return _0x1f3f10?_0x59fb88:deduplicateJourneysByBundle(_0x59fb88);}async[a116_0x19a12f(0x22a)](_0x3ae014,_0x43ff43){const _0x31c572=a116_0x19a12f;try{const _0x59252f=await this[_0x31c572(0x1e9)][_0x31c572(0x22a)](_0x3ae014);return{'journeys':this[_0x31c572(0x22c)](_0x59252f[_0x31c572(0x1df)],_0x43ff43),'activationStepsById':_0x59252f[_0x31c572(0x1ed)]};}catch(_0xda8998){if(isHttp404Error(_0xda8998))return{'journeys':[],'activationStepsById':new Map()};throw _0xda8998;}}async[a116_0x19a12f(0x210)](_0x1b3d64,_0x3820b9,_0x526e0f){const _0x2ab157=a116_0x19a12f;let _0x1b0887=_0x3820b9;if(!_0x1b0887)try{const _0x576751=await this['client'][_0x2ab157(0x20d)](_0x1b3d64);_0x1b0887=_0x576751[_0x2ab157(0x230)]??undefined;}catch(_0x56182b){if(isHttp404Error(_0x56182b))return[];throw _0x56182b;}if(!_0x1b0887)return[];let _0x4ab94d;if(_0x526e0f?.[_0x2ab157(0x265)]){const _0x4be49d=await this[_0x2ab157(0x1e9)]['listSegmentFolders'](_0x1b3d64),_0x4b955d=_0x4be49d[_0x2ab157(0x25c)](_0x585783=>this[_0x2ab157(0x1e9)][_0x2ab157(0x1f7)](_0x585783['id'])),_0xb6ced0=await Promise[_0x2ab157(0x218)](_0x4b955d),_0xfe6db=new Set();_0x4ab94d=_0xb6ced0[_0x2ab157(0x1fc)]()['filter'](_0x2fb6ad=>{const _0x4ff136=_0x2ab157;if(_0xfe6db[_0x4ff136(0x204)](_0x2fb6ad['id']))return![];return _0xfe6db[_0x4ff136(0x238)](_0x2fb6ad['id']),!![];});}else{const _0x4e2d94=await this[_0x2ab157(0x1e9)][_0x2ab157(0x259)](_0x1b0887,0x20,![]),_0x5dce89=_0x4e2d94[_0x2ab157(0x211)],_0x35737c=_0x5dce89[_0x2ab157(0x1e5)](_0x3ef259=>_0x3ef259[_0x2ab157(0x23f)]===_0x2ab157(0x1fd));_0x4ab94d=_0x35737c[_0x2ab157(0x25c)](_0x37a968=>entityToJourneyListItem(_0x37a968,_0x1b3d64));}return this['applyVersionDeduplication'](_0x4ab94d,_0x526e0f?.[_0x2ab157(0x265)]);}async[a116_0x19a12f(0x223)](_0x2c43b9,_0x4a1f36,_0x323829){const _0x559a2d=a116_0x19a12f;if(!_0x4a1f36)return{'journeys':[],'folders':[]};const _0x42028f=await this[_0x559a2d(0x1e9)][_0x559a2d(0x259)](_0x4a1f36,0x20,![]),_0x5538ab=_0x42028f[_0x559a2d(0x211)],_0x11b8a0=_0x5538ab['filter'](_0x5453b2=>_0x5453b2[_0x559a2d(0x23f)]===_0x559a2d(0x220)&&_0x5453b2['id']!==_0x4a1f36),_0x45f252=_0x11b8a0[_0x559a2d(0x25c)](_0x1ed21b=>({'id':_0x1ed21b['id'],'name':_0x1ed21b[_0x559a2d(0x1e1)][_0x559a2d(0x209)]})),_0x3b8eac=_0x5538ab['filter'](_0x42b2a7=>_0x42b2a7[_0x559a2d(0x23f)]===_0x559a2d(0x1fd)),_0x3591dd=_0x3b8eac[_0x559a2d(0x25c)](_0x2726d3=>entityToJourneyListItem(_0x2726d3,_0x2c43b9));return{'journeys':this[_0x559a2d(0x22c)](_0x3591dd,_0x323829?.[_0x559a2d(0x265)]),'folders':_0x45f252};}async['listJourneysWithDetailsFromParentSegment'](_0x4e8e22,_0x15f1ff){const _0x5c81cc=a116_0x19a12f;let _0x16245f;try{_0x16245f=await this[_0x5c81cc(0x1e9)][_0x5c81cc(0x1e4)](_0x4e8e22);}catch(_0xd7264e){if(isHttp404Error(_0xd7264e))return{'journeys':[],'activationStepsById':new Map()};throw _0xd7264e;}const _0x5dc603=_0x16245f[_0x5c81cc(0x25c)](async _0x1e740e=>{const _0x269798=_0x5c81cc;return await this[_0x269798(0x22a)](_0x1e740e['id'],_0x15f1ff?.['includeAllVersions']);}),_0x328e01=await Promise[_0x5c81cc(0x218)](_0x5dc603),_0x460a1f=new Map(),_0x89b128=[];for(const _0x1fd5f5 of _0x328e01){_0x89b128[_0x5c81cc(0x1fa)](..._0x1fd5f5['journeys']);for(const [_0x55abc7,_0x3180fc]of _0x1fd5f5[_0x5c81cc(0x1ed)]){_0x460a1f[_0x5c81cc(0x202)](_0x55abc7,_0x3180fc);}}const _0x4131e4=new Set(),_0x71b8d6=_0x89b128['filter'](_0x5e9530=>{const _0x243e7b=_0x5c81cc;if(_0x4131e4[_0x243e7b(0x204)](_0x5e9530['id']))return![];return _0x4131e4[_0x243e7b(0x238)](_0x5e9530['id']),!![];});return{'journeys':this[_0x5c81cc(0x22c)](_0x71b8d6,_0x15f1ff?.['includeAllVersions']),'activationStepsById':_0x460a1f};}async[a116_0x19a12f(0x208)](_0x3647bf){const _0x36a140=a116_0x19a12f;try{return await this[_0x36a140(0x1e9)][_0x36a140(0x208)](_0x3647bf);}catch(_0x2690a2){if(isHttp404Error(_0x2690a2))throw new SDKError(ErrorCode[_0x36a140(0x22d)],'Journey\x20not\x20found:\x20'+_0x3647bf,_0x2690a2);throw _0x2690a2;}}async[a116_0x19a12f(0x203)](_0xdb2df7,_0x17b30e){const _0x3d0e99=a116_0x19a12f,_0x3498f4=await this[_0x3d0e99(0x210)](_0xdb2df7),_0x6749f0=_0x3498f4[_0x3d0e99(0x25a)](_0x43e6e0=>_0x43e6e0[_0x3d0e99(0x267)][_0x3d0e99(0x1d5)]()===_0x17b30e[_0x3d0e99(0x1d5)]());if(!_0x6749f0)throw new SDKError(ErrorCode[_0x3d0e99(0x22d)],_0x3d0e99(0x20a)+_0x17b30e,undefined,{'helpText':'Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys'});return _0x6749f0['id'];}async[a116_0x19a12f(0x1ec)](_0x1d516f,_0x1b1f44){const _0x139807=a116_0x19a12f;try{return await this[_0x139807(0x1e9)][_0x139807(0x201)](_0x1d516f,_0x1b1f44);}catch(_0x3856b6){if(isHttp404Error(_0x3856b6))throw new SDKError(ErrorCode[_0x139807(0x22d)],_0x139807(0x20a)+_0x1d516f,_0x3856b6);throw _0x3856b6;}}async[a116_0x19a12f(0x23d)](_0x502a2c,_0x298d58){const _0x1c725e=a116_0x19a12f,_0x2e6d3b={'from':_0x298d58?.[_0x1c725e(0x22f)],'to':_0x298d58?.['to'],'limit':_0x298d58?.[_0x1c725e(0x23e)]},_0xe0eb4c=_0x298d58?.[_0x1c725e(0x23f)]!==_0x1c725e(0x1ea);try{const [_0xa4f7f2,_0x204084]=await Promise[_0x1c725e(0x218)]([this[_0x1c725e(0x227)](_0x502a2c,_0x298d58?.[_0x1c725e(0x23f)],_0x2e6d3b),_0xe0eb4c?this['getJourney'](_0x502a2c):undefined]);if(_0xa4f7f2[_0x1c725e(0x1e6)]&&_0x204084){const _0x5461df=buildStageNameMap(_0x204084);_0xa4f7f2[_0x1c725e(0x1e6)]=_0xa4f7f2[_0x1c725e(0x1e6)][_0x1c725e(0x25c)](_0x49448f=>({..._0x49448f,'journeyStageName':_0x5461df['get'](_0x49448f[_0x1c725e(0x20e)])??_0x49448f[_0x1c725e(0x20e)]}));}return _0xa4f7f2;}catch(_0xc04a4e){if(isHttp404Error(_0xc04a4e))throw new SDKError(ErrorCode[_0x1c725e(0x22d)],_0x1c725e(0x20a)+_0x502a2c,_0xc04a4e);throw _0xc04a4e;}}async['fetchTrafficRaw'](_0x57bf63,_0x33fd0a,_0x394c74){const _0x154fb4=a116_0x19a12f;if(_0x33fd0a===_0x154fb4(0x1ea)){const _0x47f2a4=await this['client']['getConversionSankeyChart'](_0x57bf63,_0x394c74);return{'conversion':_0x47f2a4};}if(_0x33fd0a==='activation'){const _0x5ea9c8=await this[_0x154fb4(0x1e9)][_0x154fb4(0x205)](_0x57bf63,_0x394c74);return{'activation':_0x5ea9c8};}const [_0x4361e9,_0x4952d0]=await Promise['all']([this['client'][_0x154fb4(0x244)](_0x57bf63,_0x394c74),this[_0x154fb4(0x1e9)][_0x154fb4(0x205)](_0x57bf63,_0x394c74)]);return{'conversion':_0x4361e9,'activation':_0x4952d0};}async[a116_0x19a12f(0x24a)](_0x445aa8){const _0x11d062=a116_0x19a12f;try{return await this[_0x11d062(0x1e9)][_0x11d062(0x1fe)](_0x445aa8);}catch(_0x3e893d){if(isHttp404Error(_0x3e893d))throw new SDKError(ErrorCode[_0x11d062(0x22d)],_0x11d062(0x20a)+_0x445aa8,_0x3e893d);throw _0x3e893d;}}async[a116_0x19a12f(0x1d9)](_0x420608){const _0x447b4f=a116_0x19a12f;try{return await this[_0x447b4f(0x1e9)][_0x447b4f(0x254)](_0x420608);}catch(_0x229de1){if(isHttp404Error(_0x229de1))throw new SDKError(ErrorCode['JOURNEY_NOT_FOUND'],_0x447b4f(0x20a)+_0x420608,_0x229de1);throw _0x229de1;}}async[a116_0x19a12f(0x1eb)](_0x272122){const _0x2da182=a116_0x19a12f;return await this[_0x2da182(0x1e9)][_0x2da182(0x264)](_0x272122);}async['update'](_0x49e3d9,_0x3e1778){const _0x489117=a116_0x19a12f;try{return await this[_0x489117(0x1e9)][_0x489117(0x249)](_0x49e3d9,_0x3e1778);}catch(_0x149e2a){if(isHttp404Error(_0x149e2a))throw new SDKError(ErrorCode[_0x489117(0x22d)],_0x489117(0x20a)+_0x49e3d9,_0x149e2a);throw _0x149e2a;}}async[a116_0x19a12f(0x1db)](_0x310088,_0x40edf3){const _0x3b9e2b=a116_0x19a12f;try{return await this[_0x3b9e2b(0x1e9)][_0x3b9e2b(0x239)](_0x310088,_0x40edf3);}catch(_0x258283){if(isHttp404Error(_0x258283))throw new SDKError(ErrorCode['NOT_FOUND'],_0x3b9e2b(0x255)+_0x40edf3+_0x3b9e2b(0x258)+_0x310088,_0x258283);throw _0x258283;}}async[a116_0x19a12f(0x215)](_0xf8ebf){const _0x26ee26=a116_0x19a12f;try{return await this['client'][_0x26ee26(0x21f)](_0xf8ebf);}catch(_0x1403cf){if(isHttp404Error(_0x1403cf))return[];throw _0x1403cf;}}async[a116_0x19a12f(0x1e8)](_0x3c5b0d){const _0x3df45a=a116_0x19a12f,_0x3a35b0=await this[_0x3df45a(0x215)](_0x3c5b0d);return _0x3a35b0[_0x3df45a(0x25c)](flattenJourneyActivation);}async[a116_0x19a12f(0x1d7)](_0x425baf,_0x5259fe){const _0x57d6a2=a116_0x19a12f;return await this[_0x57d6a2(0x1e9)][_0x57d6a2(0x260)](_0x425baf,_0x5259fe);}async[a116_0x19a12f(0x241)](_0x317f24){const _0x5d84b7=a116_0x19a12f,_0x3645d7=await this[_0x5d84b7(0x208)](_0x317f24),_0x2930e1=generateColumnMapping(_0x3645d7);return{'journeyId':_0x3645d7['id'],'journeyName':_0x3645d7[_0x5d84b7(0x1e1)][_0x5d84b7(0x209)],'database':'cdp_audience_'+_0x3645d7[_0x5d84b7(0x1e1)]['audienceId'],'table':_0x5d84b7(0x235)+_0x3645d7['id'],'columns':_0x2930e1};}async[a116_0x19a12f(0x21b)](_0x1b008a){const _0x2bb3db=a116_0x19a12f;return this[_0x2bb3db(0x1e9)][_0x2bb3db(0x1dc)](_0x1b008a);}async[a116_0x19a12f(0x1f6)](_0x66b843){const _0x4bc6ba=a116_0x19a12f;if(!_0x66b843)return undefined;try{const _0x305a2a=await this[_0x4bc6ba(0x21b)](_0x66b843);return _0x305a2a[_0x4bc6ba(0x229)];}catch{return undefined;}}async[a116_0x19a12f(0x20c)](_0x268099){const _0x26740c=a116_0x19a12f,_0xa612a6=await this['getJourney'](_0x268099),_0x4292f1=_0xa612a6[_0x26740c(0x1e1)]['journeyBundleId'];if(!_0x4292f1)return{'bundleId':'','bundleName':_0xa612a6[_0x26740c(0x1e1)]['name'],'bundleDescription':_0xa612a6[_0x26740c(0x1e1)][_0x26740c(0x24b)]??null,'latestJourneyId':_0xa612a6['id'],'versions':[synthesizePreBundleVersion(_0xa612a6)]};const _0x4a5d66=await this[_0x26740c(0x21b)](_0x4292f1);return{'bundleId':_0x4292f1,'bundleName':_0x4a5d66[_0x26740c(0x209)],'bundleDescription':_0x4a5d66[_0x26740c(0x24b)]??null,'latestJourneyId':_0x4a5d66['latestJourneyId'],'versions':formatVersionsFromBundle(_0x4a5d66)};}async[a116_0x19a12f(0x216)](_0x334da5){const _0x2501c5=a116_0x19a12f,_0x24622f=await this['getJourney'](_0x334da5),_0xb47862=_0x24622f['attributes'][_0x2501c5(0x246)];if(!_0xb47862)throw new SDKError(ErrorCode[_0x2501c5(0x228)],_0x2501c5(0x25b));await this[_0x2501c5(0x1e9)][_0x2501c5(0x250)](_0xb47862);const _0x1adae8=await this[_0x2501c5(0x1e9)][_0x2501c5(0x1dc)](_0xb47862),_0x44785b=_0x1adae8[_0x2501c5(0x209)]+'\x20v'+(_0x1adae8['lastVersionNumber']+0x1);return this['client'][_0x2501c5(0x24f)](_0xb47862,{'sourceId':_0x334da5,'attributes':{'name':_0x44785b}});}}
@@ -1 +1 @@
1
- const a109_0x10cb3f=a109_0x4d73;(function(_0x2be078,_0x4bede2){const _0x3487ac=a109_0x4d73,_0x1d1c44=_0x2be078();while(!![]){try{const _0x31b4df=parseInt(_0x3487ac(0x18a))/0x1*(parseInt(_0x3487ac(0x17b))/0x2)+parseInt(_0x3487ac(0x183))/0x3*(-parseInt(_0x3487ac(0x182))/0x4)+parseInt(_0x3487ac(0x188))/0x5*(-parseInt(_0x3487ac(0x184))/0x6)+parseInt(_0x3487ac(0x17c))/0x7+parseInt(_0x3487ac(0x187))/0x8*(parseInt(_0x3487ac(0x186))/0x9)+-parseInt(_0x3487ac(0x189))/0xa+parseInt(_0x3487ac(0x185))/0xb;if(_0x31b4df===_0x4bede2)break;else _0x1d1c44['push'](_0x1d1c44['shift']());}catch(_0x4b70da){_0x1d1c44['push'](_0x1d1c44['shift']());}}}(a109_0x2204,0xd73c5));import{createTextCache}from'../../utils/local-cache.js';const chatIdCache=createTextCache(a109_0x10cb3f(0x180),a109_0x10cb3f(0x17e));export function saveLastChatId(_0x19a066){const _0x42700d=a109_0x10cb3f;chatIdCache[_0x42700d(0x17d)](_0x19a066);}export function loadLastChatId(){const _0x587d7f=a109_0x10cb3f;return chatIdCache[_0x587d7f(0x17f)]();}function a109_0x4d73(_0x55972c,_0x2b8ae3){_0x55972c=_0x55972c-0x17b;const _0x2204ad=a109_0x2204();let _0x4d73e7=_0x2204ad[_0x55972c];return _0x4d73e7;}function a109_0x2204(){const _0x25e386=['643398LrpQSp','4133118icYgwX','45KDFOSn','2216584tqRsRJ','30wmrdEq','14718970ertjjh','286593Chfqtc','6UGsjyM','5754084eVJFle','write','llm/chat','read','last_chat_id','clear','692igkBdb','7734sChRfq'];a109_0x2204=function(){return _0x25e386;};return a109_0x2204();}export function clearLastChatId(){const _0x226950=a109_0x10cb3f;chatIdCache[_0x226950(0x181)]();}
1
+ function a117_0x4fd9(_0x51c982,_0x36e05b){_0x51c982=_0x51c982-0x18c;const _0x455f45=a117_0x455f();let _0x4fd9ed=_0x455f45[_0x51c982];return _0x4fd9ed;}const a117_0x225fde=a117_0x4fd9;(function(_0x2ab3c7,_0x3c037b){const _0x18b661=a117_0x4fd9,_0x491aca=_0x2ab3c7();while(!![]){try{const _0x4ccf3b=parseInt(_0x18b661(0x194))/0x1*(parseInt(_0x18b661(0x193))/0x2)+parseInt(_0x18b661(0x18e))/0x3*(parseInt(_0x18b661(0x18f))/0x4)+-parseInt(_0x18b661(0x191))/0x5*(parseInt(_0x18b661(0x197))/0x6)+-parseInt(_0x18b661(0x18c))/0x7+-parseInt(_0x18b661(0x199))/0x8+-parseInt(_0x18b661(0x192))/0x9*(-parseInt(_0x18b661(0x198))/0xa)+parseInt(_0x18b661(0x19a))/0xb;if(_0x4ccf3b===_0x3c037b)break;else _0x491aca['push'](_0x491aca['shift']());}catch(_0x510c9c){_0x491aca['push'](_0x491aca['shift']());}}}(a117_0x455f,0x6b02a));import{createTextCache}from'../../utils/local-cache.js';function a117_0x455f(){const _0x51d686=['212062OTQnAu','1ONnaOz','last_chat_id','clear','20562DGdCZc','71530RIcUHl','3139696zfmMQm','7323162YXuPpD','3781610lvUAhQ','write','1027797khdfoc','4ZpmVuU','llm/chat','210zwyYvr','504vsXfJr'];a117_0x455f=function(){return _0x51d686;};return a117_0x455f();}const chatIdCache=createTextCache(a117_0x225fde(0x195),a117_0x225fde(0x190));export function saveLastChatId(_0x2c49ee){const _0x5804db=a117_0x225fde;chatIdCache[_0x5804db(0x18d)](_0x2c49ee);}export function loadLastChatId(){return chatIdCache['read']();}export function clearLastChatId(){const _0x46c1cd=a117_0x225fde;chatIdCache[_0x46c1cd(0x196)]();}