@treasuredata/tdx 2026.8.3 → 2026.8.4

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 (285) 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.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/agent-command.js +1 -1
  9. package/dist/commands/agent-test-command.js +1 -1
  10. package/dist/commands/api-command.js +1 -1
  11. package/dist/commands/auth-command.js +1 -1
  12. package/dist/commands/cas-command.js +1 -1
  13. package/dist/commands/cas-segment-command.js +1 -1
  14. package/dist/commands/chat-command.js +1 -1
  15. package/dist/commands/claude-command.js +1 -1
  16. package/dist/commands/claude-statusline-command.js +1 -1
  17. package/dist/commands/claude-usage-command.js +1 -1
  18. package/dist/commands/command.js +1 -1
  19. package/dist/commands/connection-command.js +1 -1
  20. package/dist/commands/databases.js +1 -1
  21. package/dist/commands/delivery-command.js +1 -1
  22. package/dist/commands/describe.js +1 -1
  23. package/dist/commands/engage-always-on-campaign-pull-command.js +1 -1
  24. package/dist/commands/engage-always-on-campaign-push-command.js +1 -1
  25. package/dist/commands/engage-always-on-campaign-validate-command.js +1 -1
  26. package/dist/commands/engage-campaign-pull-command.js +1 -1
  27. package/dist/commands/engage-campaign-push-command.js +1 -1
  28. package/dist/commands/engage-campaign-validate-command.js +1 -1
  29. package/dist/commands/engage-command.js +1 -1
  30. package/dist/commands/engage-template-pull-command.js +1 -1
  31. package/dist/commands/engage-template-push-command.js +1 -1
  32. package/dist/commands/engage-template-validate-command.js +1 -1
  33. package/dist/commands/job-command.js +1 -1
  34. package/dist/commands/journey-command.js +1 -1
  35. package/dist/commands/journey-validate-command.js +1 -1
  36. package/dist/commands/llm-command.js +1 -1
  37. package/dist/commands/mcp-command.js +1 -1
  38. package/dist/commands/p13n-command.d.ts +11 -0
  39. package/dist/commands/p13n-command.d.ts.map +1 -0
  40. package/dist/commands/p13n-command.js +1 -0
  41. package/dist/commands/p13n-command.js.map +1 -0
  42. package/dist/commands/parent-segment-command.js +1 -1
  43. package/dist/commands/policy-command.js +1 -1
  44. package/dist/commands/profile-command.js +1 -1
  45. package/dist/commands/profiles-command.js +1 -1
  46. package/dist/commands/query-command.js +1 -1
  47. package/dist/commands/schedule-command.js +1 -1
  48. package/dist/commands/segment-command.js +1 -1
  49. package/dist/commands/segment-create-command.js +1 -1
  50. package/dist/commands/segment-fields-command.js +1 -1
  51. package/dist/commands/segment-move-command.js +1 -1
  52. package/dist/commands/segment-pull-command.js +1 -1
  53. package/dist/commands/segment-push-command.js +1 -1
  54. package/dist/commands/segment-update-command.js +1 -1
  55. package/dist/commands/segment-use-command.js +1 -1
  56. package/dist/commands/segment-validate-command.js +1 -1
  57. package/dist/commands/segments.js +1 -1
  58. package/dist/commands/show.js +1 -1
  59. package/dist/commands/status-command.js +1 -1
  60. package/dist/commands/table-deleted.js +1 -1
  61. package/dist/commands/tables.js +1 -1
  62. package/dist/commands/unset-command.js +1 -1
  63. package/dist/commands/upgrade-command.js +1 -1
  64. package/dist/commands/use-command.js +1 -1
  65. package/dist/commands/user-command.js +1 -1
  66. package/dist/commands/work-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.js +1 -1
  70. package/dist/core/config.js +1 -1
  71. package/dist/core/connection-cache.js +1 -1
  72. package/dist/core/constants.js +1 -1
  73. package/dist/core/credential-cache.js +1 -1
  74. package/dist/core/global-context.d.ts.map +1 -1
  75. package/dist/core/global-context.js +1 -1
  76. package/dist/core/global-context.js.map +1 -1
  77. package/dist/core/keychain.js +1 -1
  78. package/dist/core/oauth-keychain.js +1 -1
  79. package/dist/core/oauth.d.ts +9 -1
  80. package/dist/core/oauth.d.ts.map +1 -1
  81. package/dist/core/oauth.js +1 -1
  82. package/dist/core/oauth.js.map +1 -1
  83. package/dist/core/profile.js +1 -1
  84. package/dist/core/project-config.js +1 -1
  85. package/dist/core/session.js +1 -1
  86. package/dist/core/site-mismatch.js +1 -1
  87. package/dist/core/user-cache.js +1 -1
  88. package/dist/core/version.js +1 -1
  89. package/dist/index.js +1 -1
  90. package/dist/mcp/server.js +1 -1
  91. package/dist/mcp/tools/index.js +1 -1
  92. package/dist/mcp/tools/tdx-run.js +1 -1
  93. package/dist/mcp/tools/tdx-search.js +1 -1
  94. package/dist/mcp/tools/work-create-item.js +1 -1
  95. package/dist/mcp/utils.js +1 -1
  96. package/dist/proxy/claude-usage-tracker.js +1 -1
  97. package/dist/proxy/passthrough-server.d.ts.map +1 -1
  98. package/dist/proxy/passthrough-server.js +1 -1
  99. package/dist/proxy/passthrough-server.js.map +1 -1
  100. package/dist/proxy/sse-usage-parser.js +1 -1
  101. package/dist/sdk/agent/agent-config.js +1 -1
  102. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  103. package/dist/sdk/agent/agent-yaml.js +1 -1
  104. package/dist/sdk/agent/test/evaluator.js +1 -1
  105. package/dist/sdk/agent/test/executor.js +1 -1
  106. package/dist/sdk/agent/test/index.js +1 -1
  107. package/dist/sdk/agent/test/output.js +1 -1
  108. package/dist/sdk/agent/test/parser.js +1 -1
  109. package/dist/sdk/agent/tool-target-registry.js +1 -1
  110. package/dist/sdk/api.js +1 -1
  111. package/dist/sdk/auth-token.d.ts +42 -6
  112. package/dist/sdk/auth-token.d.ts.map +1 -1
  113. package/dist/sdk/auth-token.js +1 -1
  114. package/dist/sdk/auth-token.js.map +1 -1
  115. package/dist/sdk/cas/cas-api-client.js +1 -1
  116. package/dist/sdk/cas/cas-audience-schema.js +1 -1
  117. package/dist/sdk/cas/cas-audience-validator.js +1 -1
  118. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  119. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  120. package/dist/sdk/cas/index.js +1 -1
  121. package/dist/sdk/cas/pull-workflow.js +1 -1
  122. package/dist/sdk/cas/push-workflow.js +1 -1
  123. package/dist/sdk/cas/validate-files.js +1 -1
  124. package/dist/sdk/client/cdp-api-client.js +1 -1
  125. package/dist/sdk/client/delivery-api-client.js +1 -1
  126. package/dist/sdk/client/endpoints.d.ts +6 -0
  127. package/dist/sdk/client/endpoints.d.ts.map +1 -1
  128. package/dist/sdk/client/endpoints.js +1 -1
  129. package/dist/sdk/client/endpoints.js.map +1 -1
  130. package/dist/sdk/client/engage-api-client.js +1 -1
  131. package/dist/sdk/client/http-client.js +1 -1
  132. package/dist/sdk/client/llm-api-client.js +1 -1
  133. package/dist/sdk/client/oauth-refresh.d.ts +11 -2
  134. package/dist/sdk/client/oauth-refresh.d.ts.map +1 -1
  135. package/dist/sdk/client/oauth-refresh.js +1 -1
  136. package/dist/sdk/client/oauth-refresh.js.map +1 -1
  137. package/dist/sdk/client/p13n-studio-api-client.d.ts +19 -0
  138. package/dist/sdk/client/p13n-studio-api-client.d.ts.map +1 -0
  139. package/dist/sdk/client/p13n-studio-api-client.js +1 -0
  140. package/dist/sdk/client/p13n-studio-api-client.js.map +1 -0
  141. package/dist/sdk/client/rate-limiter.js +1 -1
  142. package/dist/sdk/client/td-api-client.js +1 -1
  143. package/dist/sdk/client/trino-api-client.js +1 -1
  144. package/dist/sdk/client/workflow-client.js +1 -1
  145. package/dist/sdk/connection-validator.js +1 -1
  146. package/dist/sdk/connection.js +1 -1
  147. package/dist/sdk/delivery.js +1 -1
  148. package/dist/sdk/engage/always-on-campaign-pull.js +1 -1
  149. package/dist/sdk/engage/always-on-campaign-push.js +1 -1
  150. package/dist/sdk/engage/always-on-campaign-validator.js +1 -1
  151. package/dist/sdk/engage/always-on-campaign-yaml.js +1 -1
  152. package/dist/sdk/engage/campaign-pull.js +1 -1
  153. package/dist/sdk/engage/campaign-push.js +1 -1
  154. package/dist/sdk/engage/campaign-validator.js +1 -1
  155. package/dist/sdk/engage/campaign-yaml.js +1 -1
  156. package/dist/sdk/engage/template-pull.js +1 -1
  157. package/dist/sdk/engage/template-push.js +1 -1
  158. package/dist/sdk/engage/template-validator.js +1 -1
  159. package/dist/sdk/engage/template-yaml.js +1 -1
  160. package/dist/sdk/engage/types/always-on-campaign-schema.js +1 -1
  161. package/dist/sdk/engage/types/campaign-def.js +1 -1
  162. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  163. package/dist/sdk/engage/types/template-schema.js +1 -1
  164. package/dist/sdk/engage.js +1 -1
  165. package/dist/sdk/errors.js +1 -1
  166. package/dist/sdk/index.d.ts +6 -0
  167. package/dist/sdk/index.d.ts.map +1 -1
  168. package/dist/sdk/index.js +1 -1
  169. package/dist/sdk/index.js.map +1 -1
  170. package/dist/sdk/io/index.js +1 -1
  171. package/dist/sdk/io/node-filesystem.js +1 -1
  172. package/dist/sdk/job.js +1 -1
  173. package/dist/sdk/journey.js +1 -1
  174. package/dist/sdk/llm/chat-cache.js +1 -1
  175. package/dist/sdk/llm/index.js +1 -1
  176. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  177. package/dist/sdk/llm/model-factors.js +1 -1
  178. package/dist/sdk/llm/user-settings.js +1 -1
  179. package/dist/sdk/p13n-studio.d.ts +13 -0
  180. package/dist/sdk/p13n-studio.d.ts.map +1 -0
  181. package/dist/sdk/p13n-studio.js +1 -0
  182. package/dist/sdk/p13n-studio.js.map +1 -0
  183. package/dist/sdk/personalization.js +1 -1
  184. package/dist/sdk/policy.js +1 -1
  185. package/dist/sdk/query/deleted-table-validation.js +1 -1
  186. package/dist/sdk/query/index.js +1 -1
  187. package/dist/sdk/query/sql-parser.js +1 -1
  188. package/dist/sdk/realtime.js +1 -1
  189. package/dist/sdk/schedule.js +1 -1
  190. package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
  191. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  192. package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
  193. package/dist/sdk/segment/fields-display.js +1 -1
  194. package/dist/sdk/segment/file-discovery.js +1 -1
  195. package/dist/sdk/segment/journey-utils.js +1 -1
  196. package/dist/sdk/segment/journey-validator.js +1 -1
  197. package/dist/sdk/segment/journey-yaml.js +1 -1
  198. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  199. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  200. package/dist/sdk/segment/pull-workflow.js +1 -1
  201. package/dist/sdk/segment/push-recovery.js +1 -1
  202. package/dist/sdk/segment/push-workflow.js +1 -1
  203. package/dist/sdk/segment/resolution-context.js +1 -1
  204. package/dist/sdk/segment/segment-path-parser.js +1 -1
  205. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  206. package/dist/sdk/segment/segment-validator.js +1 -1
  207. package/dist/sdk/segment/target-resolution.js +1 -1
  208. package/dist/sdk/segment/tdx-config.js +1 -1
  209. package/dist/sdk/segment/types/activation-schema.js +1 -1
  210. package/dist/sdk/segment/types/journey-def.js +1 -1
  211. package/dist/sdk/segment/types/journey-schema.js +1 -1
  212. package/dist/sdk/segment/types/segment-def.js +1 -1
  213. package/dist/sdk/segment/types/segment-schema.d.ts.map +1 -1
  214. package/dist/sdk/segment/types/segment-schema.js +1 -1
  215. package/dist/sdk/segment/types/segment-schema.js.map +1 -1
  216. package/dist/sdk/segment/validate-files.js +1 -1
  217. package/dist/sdk/segment/yaml-validator.js +1 -1
  218. package/dist/sdk/segment.js +1 -1
  219. package/dist/sdk/types/index.d.ts +2 -1
  220. package/dist/sdk/types/index.d.ts.map +1 -1
  221. package/dist/sdk/types/index.js +1 -1
  222. package/dist/sdk/types/index.js.map +1 -1
  223. package/dist/sdk/types/p13n-studio.d.ts +18 -0
  224. package/dist/sdk/types/p13n-studio.d.ts.map +1 -0
  225. package/dist/sdk/types/p13n-studio.js +1 -0
  226. package/dist/sdk/types/p13n-studio.js.map +1 -0
  227. package/dist/sdk/types/progress.js +1 -1
  228. package/dist/sdk/types/workspace.js +1 -1
  229. package/dist/sdk/user.js +1 -1
  230. package/dist/sdk/util/format-detector.js +1 -1
  231. package/dist/sdk/util/formatters.js +1 -1
  232. package/dist/sdk/util/index.js +1 -1
  233. package/dist/sdk/util/paginate.js +1 -1
  234. package/dist/sdk/util/tree-formatter.js +1 -1
  235. package/dist/sdk/util/tree-search.js +1 -1
  236. package/dist/sdk/workflow/archive-validation.js +1 -1
  237. package/dist/sdk/workflow/clone-workflow.js +1 -1
  238. package/dist/sdk/workflow/index.js +1 -1
  239. package/dist/sdk/workflow/pull-workflow.js +1 -1
  240. package/dist/sdk/workflow/push-workflow.js +1 -1
  241. package/dist/sdk/workflow/task-graph.js +1 -1
  242. package/dist/sdk/workflow/tdx-config.js +1 -1
  243. package/dist/sdk/workflow/workflow-utils.js +1 -1
  244. package/dist/sdk/workspace/access-tracker.js +1 -1
  245. package/dist/sdk/workspace/frontmatter.js +1 -1
  246. package/dist/sdk/workspace/git.js +1 -1
  247. package/dist/sdk/workspace/index.js +1 -1
  248. package/dist/sdk/workspace/templates.js +1 -1
  249. package/dist/sdk/workspace/weekly.js +1 -1
  250. package/dist/sdk/workspace/wikilinks.js +1 -1
  251. package/dist/test-utils/command-runner.js +1 -1
  252. package/dist/test-utils/factories.js +1 -1
  253. package/dist/test-utils/fixtures.js +1 -1
  254. package/dist/test-utils/http-mock.js +1 -1
  255. package/dist/test-utils/index.js +1 -1
  256. package/dist/utils/async.js +1 -1
  257. package/dist/utils/claude-code-state.js +1 -1
  258. package/dist/utils/colors.js +1 -1
  259. package/dist/utils/diff.js +1 -1
  260. package/dist/utils/file-permissions.js +1 -1
  261. package/dist/utils/file-reader.js +1 -1
  262. package/dist/utils/github-releases.js +1 -1
  263. package/dist/utils/global-cache.js +1 -1
  264. package/dist/utils/json-loader.js +1 -1
  265. package/dist/utils/local-cache.js +1 -1
  266. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  267. package/dist/utils/logger/formatters/index.js +1 -1
  268. package/dist/utils/logger/handlers/console-handler.js +1 -1
  269. package/dist/utils/logger/handlers/file-handler.js +1 -1
  270. package/dist/utils/logger/handlers/index.js +1 -1
  271. package/dist/utils/logger/handlers/null-handler.js +1 -1
  272. package/dist/utils/logger/index.js +1 -1
  273. package/dist/utils/logger/logger.js +1 -1
  274. package/dist/utils/logger/types.js +1 -1
  275. package/dist/utils/option-validation.js +1 -1
  276. package/dist/utils/process.js +1 -1
  277. package/dist/utils/prompt.js +1 -1
  278. package/dist/utils/proxy-fetch.js +1 -1
  279. package/dist/utils/spinner.js +1 -1
  280. package/dist/utils/sse-parser.js +1 -1
  281. package/dist/utils/string-utils.js +1 -1
  282. package/dist/utils/table-ref-parser.js +1 -1
  283. package/dist/utils/tdx-logger.js +1 -1
  284. package/dist/utils/version-check.js +1 -1
  285. package/package.json +1 -1
@@ -1 +1 @@
1
- function a146_0x1678(_0x1814b3,_0x4a9472){_0x1814b3=_0x1814b3-0x1d0;const _0x176cde=a146_0x176c();let _0x1678aa=_0x176cde[_0x1814b3];return _0x1678aa;}const a146_0x5d6784=a146_0x1678;(function(_0x5ec770,_0x4cceb9){const _0x4c256c=a146_0x1678,_0x485f26=_0x5ec770();while(!![]){try{const _0x4241e5=parseInt(_0x4c256c(0x247))/0x1*(parseInt(_0x4c256c(0x259))/0x2)+-parseInt(_0x4c256c(0x1e2))/0x3*(parseInt(_0x4c256c(0x219))/0x4)+parseInt(_0x4c256c(0x1eb))/0x5+parseInt(_0x4c256c(0x202))/0x6+parseInt(_0x4c256c(0x21e))/0x7+parseInt(_0x4c256c(0x1dc))/0x8*(-parseInt(_0x4c256c(0x200))/0x9)+-parseInt(_0x4c256c(0x1f6))/0xa;if(_0x4241e5===_0x4cceb9)break;else _0x485f26['push'](_0x485f26['shift']());}catch(_0xcc4eae){_0x485f26['push'](_0x485f26['shift']());}}}(a146_0x176c,0x40f30));import{CDPApiClient}from'./client/cdp-api-client.js';import{SDKError,ErrorCode,isHttp404Error}from'./errors.js';function getBundleId(_0x46541a){const _0x23800f=a146_0x1678;return _0x46541a[_0x23800f(0x221)]??_0x46541a[_0x23800f(0x1ee)]?.[_0x23800f(0x221)]??undefined;}function getVersionNumber(_0x3f9a57){const _0x1ee7d8=a146_0x1678;return _0x3f9a57[_0x1ee7d8(0x1f0)]??_0x3f9a57[_0x1ee7d8(0x1ee)]?.[_0x1ee7d8(0x1f0)]??0x0;}function getState(_0x3e174b){const _0x593b01=a146_0x1678;return _0x3e174b[_0x593b01(0x233)]??_0x3e174b[_0x593b01(0x1ee)]?.['state'];}export function deduplicateJourneysByBundle(_0x912188){const _0x342436=a146_0x1678,_0x20bbe6=new Map();let _0x587d59=0x0;for(const _0x21421b of _0x912188){const _0xd66ed5=getBundleId(_0x21421b);if(!_0xd66ed5){const _0x4a39be='no-bundle-'+(_0x21421b['id']??_0x342436(0x22f)+_0x587d59++);_0x20bbe6[_0x342436(0x1f8)](_0x4a39be,_0x21421b);continue;}const _0x4036ab=_0x20bbe6[_0x342436(0x1fc)](_0xd66ed5);if(!_0x4036ab)_0x20bbe6['set'](_0xd66ed5,_0x21421b);else{const _0x2a3716=getState(_0x4036ab)===_0x342436(0x1fe),_0x2c98e9=getState(_0x21421b)===_0x342436(0x1fe);if(_0x2c98e9&&!_0x2a3716)_0x20bbe6['set'](_0xd66ed5,_0x21421b);else{if(!_0x2c98e9&&_0x2a3716){}else{const _0x5a1248=getVersionNumber(_0x4036ab),_0x2ce41f=getVersionNumber(_0x21421b);_0x2ce41f>_0x5a1248&&_0x20bbe6[_0x342436(0x1f8)](_0xd66ed5,_0x21421b);}}}}return Array['from'](_0x20bbe6['values']());}const VALID_JOURNEY_STATES=new Set([a146_0x5d6784(0x1f7),'simulation',a146_0x5d6784(0x1fe)]);function a146_0x176c(){const _0x371a4c=['length','listJourneysWithDetailsFromParentSegment','createJourneyVersion','isArray','excluded','fetchTrafficRaw','has','all','Journey\x20not\x20found:\x20','journeys','relationships','resolveRootFolderId','getJourneyActivation','audienceId','INVALID_ARGUMENT','4PsmfiZ','latestJourneyId','getActivation','getBundle','listJourneysWithDetails','intime_goal','listJourneysWithFolders','variants','create','exitOrJumpRate','map','intime_journey','replace','from','getStatistics','sort','704xQaYFE','toLowerCase','NOT_FOUND','getParentSegmentFull','push','goalInflux','76074FCKtjN','updatedAt','jumpInflux','type','description','parentFolder','getJourneyStatistics','runJourney','_exit_','1004985lBeNFV','reduce','step','attributes','_milestone','versionNumber','getTrafficData','Cannot\x20create\x20a\x20new\x20version:\x20this\x20journey\x20does\x20not\x20belong\x20to\x20a\x20bundle','entryCriteria','createActivation','time','3437950ZuQmzm','draft','set','resumeJourney','out','filter','get','exitInflux','launched','string','51525OAFaet','goal','1868736oumcHf','exit_criteria','activation','conditionSegmentId','journeyBundleName','intime_stage_','history','listActivationsFlat','branches','cdp_customer_id','getLatestJourneyId','steps','folder-segment','milestoneInflux','createJourney','conversion','applyVersionDeduplication','listJourneys','Excluded\x20profiles','getActivationSankeyChart','getJourneyBundle','createdAt','activationStepsById','32FtcITj','cdp_audience_','JOURNEY_NOT_FOUND','segmentFolderId','entryInflux','3237318ncSTXh','paused','conditions','journeyBundleId','milestone','journeyStages','size','outtime_journey','exitCriteria','client','branch','waitCondition','checkJourneyAppendable','Wait','data','journey','run','idx-','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','outtime_stage_','fixed','state','update','find','resolveJourneyId','getColumnMapping','stage','resume','entries','name','journeyId','getJourney','WaitStep','pauseJourney','includeAllVersions','segmentId','listEntitiesByFolder','listActivations','goalSize','getConversionSankeyChart','journeyStageId','170782tgkXrQ','ABTest','listJourneysFromParentSegment'];a146_0x176c=function(){return _0x371a4c;};return a146_0x176c();}export function parseJourneyState(_0x1327e5){const _0x8299a4=a146_0x5d6784;if(typeof _0x1327e5===_0x8299a4(0x1ff)&&VALID_JOURNEY_STATES[_0x8299a4(0x250)](_0x1327e5))return _0x1327e5;return _0x8299a4(0x1f7);}export function entityToJourneyListItem(_0x5534f6,_0x288c4c){const _0xab5d1a=a146_0x5d6784,_0xb39d19=_0x5534f6[_0xab5d1a(0x1ee)];return{'id':_0x5534f6['id'],'name':_0xb39d19[_0xab5d1a(0x23b)]??'','journeyBundleName':_0xb39d19[_0xab5d1a(0x206)]??_0xb39d19[_0xab5d1a(0x23b)]??'','journeyBundleId':_0xb39d19[_0xab5d1a(0x221)]??'','versionNumber':_0xb39d19[_0xab5d1a(0x1f0)],'description':_0xb39d19[_0xab5d1a(0x1e6)]??null,'state':parseJourneyState(_0xb39d19[_0xab5d1a(0x233)]),'paused':_0xb39d19[_0xab5d1a(0x21f)]??![],'audienceId':_0x288c4c,'folderId':_0xb39d19[_0xab5d1a(0x21c)]??_0x5534f6[_0xab5d1a(0x254)]?.[_0xab5d1a(0x1e7)]?.[_0xab5d1a(0x22c)]?.['id']??null,'createdAt':_0xb39d19[_0xab5d1a(0x217)]??'','updatedAt':_0xb39d19['updatedAt']??''};}function convertToColumnId(_0x4aa85f){const _0x3c59dc=a146_0x5d6784;return _0x4aa85f[_0x3c59dc(0x1d8)](/-/g,'_');}function getStepEntries(_0x29f97a){const _0x2dc269=a146_0x5d6784;if(!_0x29f97a)return[];if(Array[_0x2dc269(0x24d)](_0x29f97a))return _0x29f97a[_0x2dc269(0x1d6)](_0x234893=>[_0x234893['id'],_0x234893]);return Object[_0x2dc269(0x23a)](_0x29f97a);}export function flattenJourneyActivation(_0x3a4a17){const _0x4ce3bc=a146_0x5d6784,{activationParams:_0xf35d4f,activationId:_0x527bea,runAfterJourneyRefresh:_0x17e0f0}=_0x3a4a17[_0x4ce3bc(0x1ee)];return{'id':_0x3a4a17['id'],'activationId':_0x527bea,'runAfterJourneyRefresh':_0x17e0f0,..._0xf35d4f};}function col(_0x67188a,_0x2df192={}){const _0x2b8483=a146_0x5d6784;return{'column':_0x67188a,'direction':null,'stageIndex':null,'stageName':null,'category':_0x2b8483(0x232),'stepType':null,'stepName':null,'stepId':null,'detail':null,..._0x2df192};}export function generateColumnMapping(_0x4232a5){const _0x16231e=a146_0x5d6784,_0x2f86f9=[];_0x2f86f9[_0x16231e(0x1e0)](col(_0x16231e(0x20b))),_0x2f86f9[_0x16231e(0x1e0)](col(_0x16231e(0x1d7),{'direction':'in','category':_0x16231e(0x22d)})),_0x2f86f9['push'](col(_0x16231e(0x225),{'direction':_0x16231e(0x1fa),'category':'journey'}));_0x4232a5[_0x16231e(0x1ee)][_0x16231e(0x201)]&&_0x2f86f9[_0x16231e(0x1e0)](col(_0x16231e(0x1d1),{'direction':'in','category':_0x16231e(0x201),'detail':_0x4232a5['attributes']['goal'][_0x16231e(0x23b)]||null}));const _0xebab35=_0x4232a5[_0x16231e(0x1ee)][_0x16231e(0x223)]||[];for(let _0xccb975=0x0;_0xccb975<_0xebab35['length'];_0xccb975++){const _0x9e1190=_0xebab35[_0xccb975],_0x46cd57=_0x9e1190['name'],_0x6e04fc={'stageIndex':_0xccb975,'stageName':_0x46cd57},_0x465943=_0x9e1190[_0x16231e(0x1f3)]?.[_0x16231e(0x23b)]||null;_0x2f86f9[_0x16231e(0x1e0)](col(_0x16231e(0x207)+_0xccb975,{..._0x6e04fc,'direction':'in','category':_0x16231e(0x238),'detail':_0x465943})),_0x2f86f9[_0x16231e(0x1e0)](col(_0x16231e(0x231)+_0xccb975,{..._0x6e04fc,'direction':_0x16231e(0x1fa),'category':_0x16231e(0x238),'detail':_0x465943}));_0x9e1190[_0x16231e(0x222)]&&_0x2f86f9[_0x16231e(0x1e0)](col(_0x16231e(0x207)+_0xccb975+_0x16231e(0x1ef),{..._0x6e04fc,'direction':'in','category':_0x16231e(0x222),'detail':_0x9e1190[_0x16231e(0x222)]['name']||null}));const _0x3969cb=_0x9e1190['exitCriterias']||_0x9e1190[_0x16231e(0x226)]||[];for(let _0x54788f=0x0;_0x54788f<_0x3969cb[_0x16231e(0x24a)];_0x54788f++){_0x2f86f9[_0x16231e(0x1e0)](col('intime_stage_'+_0xccb975+_0x16231e(0x1ea)+_0x54788f,{..._0x6e04fc,'direction':'in','category':_0x16231e(0x203),'detail':_0x3969cb[_0x54788f][_0x16231e(0x23b)]||null}));}const _0x1247c5=getStepEntries(_0x9e1190[_0x16231e(0x20d)]);for(const [_0x776a73,_0x1db122]of _0x1247c5){const _0x355521=convertToColumnId(_0x776a73),_0x194cff=_0x1db122[_0x16231e(0x1e5)]||null,_0x2b61f5=_0x1db122[_0x16231e(0x23b)]||null,_0x18f5ce={..._0x6e04fc,'stepType':_0x194cff,'stepName':_0x2b61f5,'stepId':_0x776a73};_0x2f86f9[_0x16231e(0x1e0)](col(_0x16231e(0x207)+_0xccb975+'_'+_0x355521,{..._0x18f5ce,'direction':'in','category':'step'})),_0x2f86f9[_0x16231e(0x1e0)](col('outtime_stage_'+_0xccb975+'_'+_0x355521,{..._0x18f5ce,'direction':_0x16231e(0x1fa),'category':_0x16231e(0x1ed)}));if(_0x1db122['type']==='DecisionPoint'&&_0x1db122[_0x16231e(0x20a)])for(const _0x5d3dd4 of _0x1db122[_0x16231e(0x20a)]){_0x5d3dd4[_0x16231e(0x241)]&&_0x2f86f9['push'](col(_0x16231e(0x207)+_0xccb975+'_'+_0x355521+'_'+_0x5d3dd4['segmentId'],{..._0x18f5ce,'direction':'in','category':'branch','detail':_0x5d3dd4[_0x16231e(0x23b)]||(_0x5d3dd4[_0x16231e(0x24e)]?_0x16231e(0x214):null)}));}if((_0x1db122['type']==='AbTest'||_0x1db122[_0x16231e(0x1e5)]===_0x16231e(0x248))&&_0x1db122[_0x16231e(0x1d3)])for(const _0x5d6357 of _0x1db122['variants']){_0x5d6357['id']&&_0x2f86f9['push'](col(_0x16231e(0x207)+_0xccb975+'_'+_0x355521+'_variant_'+convertToColumnId(_0x5d6357['id']),{..._0x18f5ce,'direction':'in','category':'variant','detail':_0x5d6357[_0x16231e(0x23b)]||null}));}if(_0x1db122[_0x16231e(0x1e5)]===_0x16231e(0x23e)||_0x1db122[_0x16231e(0x1e5)]===_0x16231e(0x22b)){const _0x20d557=[];if(_0x1db122[_0x16231e(0x205)])_0x20d557['push'](_0x1db122[_0x16231e(0x205)]);else{if(Array['isArray'](_0x1db122[_0x16231e(0x220)]))for(const _0x3b65cf of _0x1db122['conditions']){_0x3b65cf['segmentId']&&!_0x3b65cf['timedOutPath']&&_0x20d557[_0x16231e(0x1e0)](_0x3b65cf['segmentId']);}else _0x1db122[_0x16231e(0x229)]?.[_0x16231e(0x241)]&&_0x20d557[_0x16231e(0x1e0)](_0x1db122['waitCondition'][_0x16231e(0x241)]);}for(const _0x380b3a of _0x20d557){_0x2f86f9[_0x16231e(0x1e0)](col(_0x16231e(0x207)+_0xccb975+'_'+_0x355521+'_'+_0x380b3a,{..._0x18f5ce,'direction':'in','category':_0x16231e(0x228)}));}}}}return _0x2f86f9[_0x16231e(0x1e0)](col(_0x16231e(0x1f5))),_0x2f86f9;}export function aggregateJourneyHistory(_0xecba53){const _0x54e2c2=a146_0x5d6784,_0x2f76f8=_0xecba53['reduce']((_0xf30904,_0x1c9403)=>_0xf30904+(_0x1c9403[_0x54e2c2(0x21d)]??0x0),0x0),_0x1b420b=_0xecba53[_0x54e2c2(0x1ec)]((_0xc8aa0d,_0x334ef5)=>_0xc8aa0d+(_0x334ef5[_0x54e2c2(0x1e1)]??0x0),0x0),_0x1c4273=_0xecba53[_0x54e2c2(0x1ec)]((_0x59f95a,_0x449869)=>_0x59f95a+((_0x449869[_0x54e2c2(0x1fd)]??0x0)+(_0x449869[_0x54e2c2(0x1e4)]??0x0)),0x0),_0x4cbaa5=_0xecba53[_0xecba53['length']-0x1];return{'size':_0x4cbaa5?.[_0x54e2c2(0x224)]??0x0,'entered':_0x2f76f8,'goal_achieved':_0x1b420b,'completion_rate':_0x1b420b&&_0x2f76f8?_0x1b420b/_0x2f76f8*0x64:0x0,'exit_or_jump':_0x1c4273,'exit_or_jump_rate':_0x1c4273&&_0x2f76f8?_0x1c4273/_0x2f76f8*0x64:0x0};}export function aggregateStageHistory(_0xa83450){const _0x411de9=a146_0x5d6784,_0x5eaca9=_0xa83450['reduce']((_0x2c3bb9,_0x3ed0aa)=>_0x2c3bb9+(_0x3ed0aa[_0x411de9(0x21d)]??0x0),0x0),_0x169743=_0xa83450[_0x411de9(0x1ec)]((_0x343975,_0x45b3b8)=>_0x343975+(_0x45b3b8[_0x411de9(0x20f)]??0x0),0x0),_0x4d9106=_0xa83450[_0x411de9(0x1ec)]((_0x506585,_0x2c1de2)=>_0x506585+((_0x2c1de2[_0x411de9(0x1fd)]??0x0)+(_0x2c1de2['jumpInflux']??0x0)),0x0),_0x370702=_0xa83450[_0xa83450['length']-0x1];return{'size':_0x370702?.['size']??0x0,'entered':_0x5eaca9,'milestone':_0x169743,'milestone_rate':_0x169743&&_0x5eaca9?_0x169743/_0x5eaca9*0x64:0x0,'exit_or_jump':_0x4d9106,'exit_or_jump_rate':_0x4d9106&&_0x5eaca9?_0x4d9106/_0x5eaca9*0x64:0x0};}export function assembleJourneyStats(_0x351ef3,_0x533e79){const _0x5de305=a146_0x5d6784,_0x140a32=!!(_0x533e79?.[_0x5de305(0x1d9)]||_0x533e79?.['to'])&&!!_0x351ef3['history']?.[_0x5de305(0x24a)];if(_0x140a32){const _0x216d4b=aggregateJourneyHistory(_0x351ef3[_0x5de305(0x208)]),_0x41c1b1={'journey_id':_0x351ef3['journeyId'],..._0x533e79?.[_0x5de305(0x1d9)]&&{'from':_0x533e79[_0x5de305(0x1d9)]},..._0x533e79?.['to']&&{'to':_0x533e79['to']},..._0x216d4b};return _0x533e79?.['includeHistory']&&(_0x41c1b1[_0x5de305(0x208)]=_0x351ef3[_0x5de305(0x208)]),_0x41c1b1;}return{'journey_id':_0x351ef3[_0x5de305(0x23c)],'size':_0x351ef3['size'],'entered':_0x351ef3['enteredSize'],'goal_achieved':_0x351ef3[_0x5de305(0x244)],'completion_rate':_0x351ef3['completionRate'],'exit_or_jump':_0x351ef3['exitOrJumpSize'],'exit_or_jump_rate':_0x351ef3[_0x5de305(0x1d5)]};}export function formatVersionsFromBundle(_0x377a26){const _0x2fd5f1=a146_0x5d6784,_0xc741c0=_0x377a26[_0x2fd5f1(0x253)]['map'](_0x3bce9e=>({'journeyId':_0x3bce9e['id'],'versionNumber':_0x3bce9e[_0x2fd5f1(0x1ee)][_0x2fd5f1(0x1f0)]??0x0,'name':_0x3bce9e['attributes'][_0x2fd5f1(0x23b)],'state':_0x3bce9e[_0x2fd5f1(0x1ee)][_0x2fd5f1(0x233)],'paused':_0x3bce9e[_0x2fd5f1(0x1ee)]['paused'],'createdAt':_0x3bce9e[_0x2fd5f1(0x1ee)][_0x2fd5f1(0x217)],'updatedAt':_0x3bce9e[_0x2fd5f1(0x1ee)][_0x2fd5f1(0x1e3)]}));return _0xc741c0[_0x2fd5f1(0x1db)]((_0x142e8a,_0x4f8f46)=>_0x142e8a[_0x2fd5f1(0x1f0)]-_0x4f8f46['versionNumber']),_0xc741c0;}export function synthesizePreBundleVersion(_0x3aeab6){const _0xa1a6ee=a146_0x5d6784;return{'journeyId':_0x3aeab6['id'],'versionNumber':0x1,'name':_0x3aeab6[_0xa1a6ee(0x1ee)][_0xa1a6ee(0x23b)],'state':_0x3aeab6[_0xa1a6ee(0x1ee)][_0xa1a6ee(0x233)],'paused':_0x3aeab6['attributes'][_0xa1a6ee(0x21f)],'createdAt':_0x3aeab6[_0xa1a6ee(0x1ee)][_0xa1a6ee(0x217)],'updatedAt':_0x3aeab6[_0xa1a6ee(0x1ee)][_0xa1a6ee(0x1e3)]};}export function buildStageNameMap(_0x1a23fe){const _0x42b49b=a146_0x5d6784;return new Map(_0x1a23fe['attributes'][_0x42b49b(0x223)]?.[_0x42b49b(0x1d6)](_0x710878=>[_0x710878['id'],_0x710878['name']])??[]);}export class JourneySDK{['client'];constructor(_0x1668ce){const _0x452b18=a146_0x5d6784;this[_0x452b18(0x227)]=new CDPApiClient(_0x1668ce);}[a146_0x5d6784(0x212)](_0x4f8d1b,_0x403bf1){return _0x403bf1?_0x4f8d1b:deduplicateJourneysByBundle(_0x4f8d1b);}async[a146_0x5d6784(0x255)](_0x114057){const _0x21dee6=a146_0x5d6784,_0x17a47e=await this[_0x21dee6(0x227)][_0x21dee6(0x1df)](_0x114057);return _0x17a47e['rootFolderId']??undefined;}async[a146_0x5d6784(0x1d0)](_0x1a2a3a,_0x679c7d){const _0x2cd5a2=a146_0x5d6784;try{const _0x1dcd20=await this[_0x2cd5a2(0x227)]['listJourneysWithDetails'](_0x1a2a3a);return{'journeys':this[_0x2cd5a2(0x212)](_0x1dcd20[_0x2cd5a2(0x253)],_0x679c7d),'activationStepsById':_0x1dcd20[_0x2cd5a2(0x218)]};}catch(_0x37a347){if(isHttp404Error(_0x37a347))return{'journeys':[],'activationStepsById':new Map()};throw _0x37a347;}}async[a146_0x5d6784(0x249)](_0xcc9e87,_0x96a705,_0xc6ca48){const _0x8d80c9=a146_0x5d6784;let _0x37dfde=_0x96a705;if(!_0x37dfde)try{_0x37dfde=await this[_0x8d80c9(0x255)](_0xcc9e87);}catch(_0x260be5){if(isHttp404Error(_0x260be5))return[];throw _0x260be5;}if(!_0x37dfde)return[];let _0x4d16bd;if(_0xc6ca48?.[_0x8d80c9(0x240)])_0x4d16bd=await this[_0x8d80c9(0x227)][_0x8d80c9(0x213)](_0x37dfde);else{const _0x592448=await this['client']['listEntitiesByFolder'](_0x37dfde,0x20,![]),_0x2bcbc4=_0x592448[_0x8d80c9(0x22c)],_0x56f371=_0x2bcbc4[_0x8d80c9(0x1fb)](_0x47519c=>_0x47519c['type']===_0x8d80c9(0x22d));_0x4d16bd=_0x56f371[_0x8d80c9(0x1d6)](_0x2729ed=>entityToJourneyListItem(_0x2729ed,_0xcc9e87));}return this[_0x8d80c9(0x212)](_0x4d16bd,_0xc6ca48?.['includeAllVersions']);}async[a146_0x5d6784(0x1d2)](_0x3f6045,_0x15c1b2,_0x492c7a){const _0x31667e=a146_0x5d6784;if(!_0x15c1b2)return{'journeys':[],'folders':[]};const _0x2552ee=await this[_0x31667e(0x227)][_0x31667e(0x242)](_0x15c1b2,0x20,![]),_0x42e0d6=_0x2552ee[_0x31667e(0x22c)],_0x4ee2cf=_0x42e0d6[_0x31667e(0x1fb)](_0x162b74=>_0x162b74['type']===_0x31667e(0x20e)&&_0x162b74['id']!==_0x15c1b2),_0x145da2=_0x4ee2cf[_0x31667e(0x1d6)](_0x23ae31=>({'id':_0x23ae31['id'],'name':_0x23ae31[_0x31667e(0x1ee)][_0x31667e(0x23b)]})),_0x4e100d=_0x42e0d6['filter'](_0x4b627f=>_0x4b627f['type']===_0x31667e(0x22d)),_0x2c7df4=_0x4e100d[_0x31667e(0x1d6)](_0x2d0d1b=>entityToJourneyListItem(_0x2d0d1b,_0x3f6045));return{'journeys':this['applyVersionDeduplication'](_0x2c7df4,_0x492c7a?.[_0x31667e(0x240)]),'folders':_0x145da2};}async[a146_0x5d6784(0x24b)](_0xf7b3a7,_0x174e89){const _0x3434ff=a146_0x5d6784;let _0x439704;try{_0x439704=await this['resolveRootFolderId'](_0xf7b3a7);}catch(_0x14cc89){if(isHttp404Error(_0x14cc89))return{'journeys':[],'activationStepsById':new Map()};throw _0x14cc89;}if(!_0x439704)return{'journeys':[],'activationStepsById':new Map()};const _0x372dff=await this[_0x3434ff(0x1d0)](_0x439704,_0x174e89?.[_0x3434ff(0x240)]);return{'journeys':this[_0x3434ff(0x212)](_0x372dff[_0x3434ff(0x253)],_0x174e89?.[_0x3434ff(0x240)]),'activationStepsById':_0x372dff['activationStepsById']};}async[a146_0x5d6784(0x23d)](_0x2d4a97){const _0x38d053=a146_0x5d6784;try{return await this['client']['getJourney'](_0x2d4a97);}catch(_0x3f183f){if(isHttp404Error(_0x3f183f))throw new SDKError(ErrorCode[_0x38d053(0x21b)],'Journey\x20not\x20found:\x20'+_0x2d4a97,_0x3f183f);throw _0x3f183f;}}async[a146_0x5d6784(0x236)](_0x28156b,_0xac0ea){const _0x58117b=a146_0x5d6784,_0xd32444=await this[_0x58117b(0x249)](_0x28156b),_0x4ae049=_0xd32444[_0x58117b(0x235)](_0x101631=>_0x101631['journeyBundleName'][_0x58117b(0x1dd)]()===_0xac0ea[_0x58117b(0x1dd)]());if(!_0x4ae049)throw new SDKError(ErrorCode[_0x58117b(0x21b)],'Journey\x20not\x20found:\x20'+_0xac0ea,undefined,{'helpText':_0x58117b(0x230)});return _0x4ae049['id'];}async[a146_0x5d6784(0x1da)](_0x3721dd,_0x4ecce8){const _0x3ca855=a146_0x5d6784;try{return await this[_0x3ca855(0x227)][_0x3ca855(0x1e8)](_0x3721dd,_0x4ecce8);}catch(_0x478411){if(isHttp404Error(_0x478411))throw new SDKError(ErrorCode[_0x3ca855(0x21b)],_0x3ca855(0x252)+_0x3721dd,_0x478411);throw _0x478411;}}async[a146_0x5d6784(0x1f1)](_0x139cb2,_0x2adbfa){const _0x40d51f=a146_0x5d6784,_0x1cd25b={'from':_0x2adbfa?.[_0x40d51f(0x1d9)],'to':_0x2adbfa?.['to'],'limit':_0x2adbfa?.['limit']},_0x3e4e51=_0x2adbfa?.[_0x40d51f(0x1e5)]!==_0x40d51f(0x211);try{const [_0x5722b1,_0x263c2d]=await Promise[_0x40d51f(0x251)]([this['fetchTrafficRaw'](_0x139cb2,_0x2adbfa?.[_0x40d51f(0x1e5)],_0x1cd25b),_0x3e4e51?this['getJourney'](_0x139cb2):undefined]);if(_0x5722b1[_0x40d51f(0x204)]&&_0x263c2d){const _0x2e8a26=buildStageNameMap(_0x263c2d);_0x5722b1[_0x40d51f(0x204)]=_0x5722b1[_0x40d51f(0x204)][_0x40d51f(0x1d6)](_0x55bf71=>({..._0x55bf71,'journeyStageName':_0x2e8a26[_0x40d51f(0x1fc)](_0x55bf71[_0x40d51f(0x246)])??_0x55bf71[_0x40d51f(0x246)]}));}return _0x5722b1;}catch(_0x2c7c40){if(isHttp404Error(_0x2c7c40))throw new SDKError(ErrorCode[_0x40d51f(0x21b)],'Journey\x20not\x20found:\x20'+_0x139cb2,_0x2c7c40);throw _0x2c7c40;}}async[a146_0x5d6784(0x24f)](_0x48136f,_0x30403f,_0x34ce58){const _0x1fcd3c=a146_0x5d6784;if(_0x30403f===_0x1fcd3c(0x211)){const _0x972f61=await this['client'][_0x1fcd3c(0x245)](_0x48136f,_0x34ce58);return{'conversion':_0x972f61};}if(_0x30403f===_0x1fcd3c(0x204)){const _0x2c25fd=await this['client'][_0x1fcd3c(0x215)](_0x48136f,_0x34ce58);return{'activation':_0x2c25fd};}const [_0x41508a,_0x6893bf]=await Promise[_0x1fcd3c(0x251)]([this['client'][_0x1fcd3c(0x245)](_0x48136f,_0x34ce58),this[_0x1fcd3c(0x227)][_0x1fcd3c(0x215)](_0x48136f,_0x34ce58)]);return{'conversion':_0x41508a,'activation':_0x6893bf};}async['pause'](_0x5e3a97){const _0x5d987a=a146_0x5d6784;try{return await this[_0x5d987a(0x227)][_0x5d987a(0x23f)](_0x5e3a97);}catch(_0x19d6bd){if(isHttp404Error(_0x19d6bd))throw new SDKError(ErrorCode[_0x5d987a(0x21b)],_0x5d987a(0x252)+_0x5e3a97,_0x19d6bd);throw _0x19d6bd;}}async[a146_0x5d6784(0x239)](_0x481dab){const _0x4c85cc=a146_0x5d6784;try{return await this[_0x4c85cc(0x227)][_0x4c85cc(0x1f9)](_0x481dab);}catch(_0x199dcf){if(isHttp404Error(_0x199dcf))throw new SDKError(ErrorCode[_0x4c85cc(0x21b)],_0x4c85cc(0x252)+_0x481dab,_0x199dcf);throw _0x199dcf;}}async[a146_0x5d6784(0x22e)](_0x2d5ca8){const _0x388742=a146_0x5d6784;try{return await this[_0x388742(0x227)][_0x388742(0x1e9)](_0x2d5ca8);}catch(_0x54f16c){if(isHttp404Error(_0x54f16c))throw new SDKError(ErrorCode['JOURNEY_NOT_FOUND'],'Journey\x20not\x20found:\x20'+_0x2d5ca8,_0x54f16c);throw _0x54f16c;}}async[a146_0x5d6784(0x1d4)](_0x1ca0ce){const _0x20c805=a146_0x5d6784;return await this[_0x20c805(0x227)][_0x20c805(0x210)](_0x1ca0ce);}async[a146_0x5d6784(0x234)](_0x43b93d,_0x4d8969){const _0x5ecf36=a146_0x5d6784;try{return await this[_0x5ecf36(0x227)]['updateJourney'](_0x43b93d,_0x4d8969);}catch(_0x4480e7){if(isHttp404Error(_0x4480e7))throw new SDKError(ErrorCode[_0x5ecf36(0x21b)],_0x5ecf36(0x252)+_0x43b93d,_0x4480e7);throw _0x4480e7;}}async[a146_0x5d6784(0x25b)](_0x1a64f9,_0x43a22d){const _0x3a257a=a146_0x5d6784;try{return await this['client'][_0x3a257a(0x256)](_0x1a64f9,_0x43a22d);}catch(_0x7f58fe){if(isHttp404Error(_0x7f58fe))throw new SDKError(ErrorCode[_0x3a257a(0x1de)],'Journey\x20activation\x20step\x20not\x20found:\x20'+_0x43a22d+'\x20in\x20journey\x20'+_0x1a64f9,_0x7f58fe);throw _0x7f58fe;}}async[a146_0x5d6784(0x243)](_0x3935c3){try{return await this['client']['listJourneyActivations'](_0x3935c3);}catch(_0x13d9ba){if(isHttp404Error(_0x13d9ba))return[];throw _0x13d9ba;}}async[a146_0x5d6784(0x209)](_0x1b31b6){const _0x1bccf2=await this['listActivations'](_0x1b31b6);return _0x1bccf2['map'](flattenJourneyActivation);}async[a146_0x5d6784(0x1f4)](_0x268b70,_0x1d4e91){const _0x25eb48=a146_0x5d6784;return await this[_0x25eb48(0x227)]['createJourneyActivation'](_0x268b70,_0x1d4e91);}async[a146_0x5d6784(0x237)](_0x5f5438){const _0x341ceb=a146_0x5d6784,_0x2a0d6d=await this[_0x341ceb(0x23d)](_0x5f5438),_0x4f9f86=generateColumnMapping(_0x2a0d6d);return{'journeyId':_0x2a0d6d['id'],'journeyName':_0x2a0d6d[_0x341ceb(0x1ee)][_0x341ceb(0x23b)],'database':_0x341ceb(0x21a)+_0x2a0d6d['attributes'][_0x341ceb(0x257)],'table':'journey_'+_0x2a0d6d['id'],'columns':_0x4f9f86};}async[a146_0x5d6784(0x25c)](_0x162be3){const _0x5a85ef=a146_0x5d6784;return this[_0x5a85ef(0x227)]['getJourneyBundle'](_0x162be3);}async[a146_0x5d6784(0x20c)](_0x160931){const _0x2f1ced=a146_0x5d6784;if(!_0x160931)return undefined;try{const _0x1b30a4=await this[_0x2f1ced(0x25c)](_0x160931);return _0x1b30a4['latestJourneyId'];}catch{return undefined;}}async['listVersions'](_0x3a7304){const _0x503de7=a146_0x5d6784,_0xd7a7f2=await this[_0x503de7(0x23d)](_0x3a7304),_0x43bf99=_0xd7a7f2[_0x503de7(0x1ee)][_0x503de7(0x221)];if(!_0x43bf99)return{'bundleId':'','bundleName':_0xd7a7f2[_0x503de7(0x1ee)][_0x503de7(0x23b)],'bundleDescription':_0xd7a7f2[_0x503de7(0x1ee)][_0x503de7(0x1e6)]??null,'latestJourneyId':_0xd7a7f2['id'],'versions':[synthesizePreBundleVersion(_0xd7a7f2)]};const _0x557187=await this[_0x503de7(0x25c)](_0x43bf99);return{'bundleId':_0x43bf99,'bundleName':_0x557187[_0x503de7(0x23b)],'bundleDescription':_0x557187[_0x503de7(0x1e6)]??null,'latestJourneyId':_0x557187[_0x503de7(0x25a)],'versions':formatVersionsFromBundle(_0x557187)};}async['createVersion'](_0x48f707){const _0x43d124=a146_0x5d6784,_0x244ea7=await this[_0x43d124(0x23d)](_0x48f707),_0x3d4666=_0x244ea7['attributes'][_0x43d124(0x221)];if(!_0x3d4666)throw new SDKError(ErrorCode[_0x43d124(0x258)],_0x43d124(0x1f2));await this[_0x43d124(0x227)][_0x43d124(0x22a)](_0x3d4666);const _0x72c64d=await this[_0x43d124(0x227)][_0x43d124(0x216)](_0x3d4666),_0x23b442=_0x72c64d[_0x43d124(0x23b)]+'\x20v'+(_0x72c64d['lastVersionNumber']+0x1);return this[_0x43d124(0x227)][_0x43d124(0x24c)](_0x3d4666,{'sourceId':_0x48f707,'attributes':{'name':_0x23b442}});}}
1
+ const a148_0x32033a=a148_0x3dfa;(function(_0x10f863,_0x51d1c2){const _0x58a51e=a148_0x3dfa,_0x13d519=_0x10f863();while(!![]){try{const _0x225633=-parseInt(_0x58a51e(0xe0))/0x1+-parseInt(_0x58a51e(0xfe))/0x2*(-parseInt(_0x58a51e(0x132))/0x3)+-parseInt(_0x58a51e(0x135))/0x4+parseInt(_0x58a51e(0x144))/0x5*(-parseInt(_0x58a51e(0xed))/0x6)+-parseInt(_0x58a51e(0x101))/0x7+parseInt(_0x58a51e(0xfb))/0x8+parseInt(_0x58a51e(0x114))/0x9;if(_0x225633===_0x51d1c2)break;else _0x13d519['push'](_0x13d519['shift']());}catch(_0x3666a6){_0x13d519['push'](_0x13d519['shift']());}}}(a148_0x3b15,0x1d5a9));import{CDPApiClient}from'./client/cdp-api-client.js';import{SDKError,ErrorCode,isHttp404Error}from'./errors.js';function getBundleId(_0xfb1451){const _0x3e2feb=a148_0x3dfa;return _0xfb1451[_0x3e2feb(0xf9)]??_0xfb1451[_0x3e2feb(0x150)]?.['journeyBundleId']??undefined;}function getVersionNumber(_0x42c26b){const _0x47c0d0=a148_0x3dfa;return _0x42c26b['versionNumber']??_0x42c26b[_0x47c0d0(0x150)]?.[_0x47c0d0(0x15a)]??0x0;}function a148_0x3dfa(_0x12cb5a,_0x3cb103){_0x12cb5a=_0x12cb5a-0xdd;const _0x3b1564=a148_0x3b15();let _0x3dfaad=_0x3b1564[_0x12cb5a];return _0x3dfaad;}function getState(_0x1ae9d3){const _0x20836b=a148_0x3dfa;return _0x1ae9d3[_0x20836b(0x104)]??_0x1ae9d3['attributes']?.[_0x20836b(0x104)];}export function deduplicateJourneysByBundle(_0x45808e){const _0x16dd1f=a148_0x3dfa,_0x583610=new Map();let _0x422b34=0x0;for(const _0x92d9ab of _0x45808e){const _0x57cfef=getBundleId(_0x92d9ab);if(!_0x57cfef){const _0x4b03f6=_0x16dd1f(0x109)+(_0x92d9ab['id']??_0x16dd1f(0x12a)+_0x422b34++);_0x583610['set'](_0x4b03f6,_0x92d9ab);continue;}const _0x21b3e0=_0x583610[_0x16dd1f(0x13c)](_0x57cfef);if(!_0x21b3e0)_0x583610[_0x16dd1f(0x137)](_0x57cfef,_0x92d9ab);else{const _0x221992=getState(_0x21b3e0)===_0x16dd1f(0x153),_0x3b447e=getState(_0x92d9ab)===_0x16dd1f(0x153);if(_0x3b447e&&!_0x221992)_0x583610[_0x16dd1f(0x137)](_0x57cfef,_0x92d9ab);else{if(!_0x3b447e&&_0x221992){}else{const _0x29b10b=getVersionNumber(_0x21b3e0),_0x297ef9=getVersionNumber(_0x92d9ab);_0x297ef9>_0x29b10b&&_0x583610[_0x16dd1f(0x137)](_0x57cfef,_0x92d9ab);}}}}return Array['from'](_0x583610[_0x16dd1f(0xe5)]());}const VALID_JOURNEY_STATES=new Set([a148_0x32033a(0x11b),'simulation',a148_0x32033a(0x153)]);export function parseJourneyState(_0xa78dbd){const _0x989cc6=a148_0x32033a;if(typeof _0xa78dbd===_0x989cc6(0x103)&&VALID_JOURNEY_STATES[_0x989cc6(0xe8)](_0xa78dbd))return _0xa78dbd;return _0x989cc6(0x11b);}export function entityToJourneyListItem(_0x3bc9a1,_0x3496bb){const _0x5b3144=a148_0x32033a,_0x485464=_0x3bc9a1[_0x5b3144(0x150)];return{'id':_0x3bc9a1['id'],'name':_0x485464[_0x5b3144(0x115)]??'','journeyBundleName':_0x485464[_0x5b3144(0x15d)]??_0x485464['name']??'','journeyBundleId':_0x485464[_0x5b3144(0xf9)]??'','versionNumber':_0x485464[_0x5b3144(0x15a)],'description':_0x485464[_0x5b3144(0x11a)]??null,'state':parseJourneyState(_0x485464[_0x5b3144(0x104)]),'paused':_0x485464[_0x5b3144(0xea)]??![],'audienceId':_0x3496bb,'folderId':_0x485464[_0x5b3144(0x124)]??_0x3bc9a1[_0x5b3144(0x147)]?.[_0x5b3144(0x12b)]?.[_0x5b3144(0xf2)]?.['id']??null,'createdAt':_0x485464[_0x5b3144(0xfd)]??'','updatedAt':_0x485464[_0x5b3144(0x143)]??''};}function convertToColumnId(_0x3dbbb8){return _0x3dbbb8['replace'](/-/g,'_');}function getStepEntries(_0x1e311c){const _0x396e8c=a148_0x32033a;if(!_0x1e311c)return[];if(Array['isArray'](_0x1e311c))return _0x1e311c[_0x396e8c(0x113)](_0x223bc5=>[_0x223bc5['id'],_0x223bc5]);return Object['entries'](_0x1e311c);}export function flattenJourneyActivation(_0x419fd6){const {activationParams:_0x33ffc3,activationId:_0x5a65f8,runAfterJourneyRefresh:_0x4932ef}=_0x419fd6['attributes'];return{'id':_0x419fd6['id'],'activationId':_0x5a65f8,'runAfterJourneyRefresh':_0x4932ef,..._0x33ffc3};}function col(_0x326117,_0x234faa={}){const _0x5d8c06=a148_0x32033a;return{'column':_0x326117,'direction':null,'stageIndex':null,'stageName':null,'category':_0x5d8c06(0x15e),'stepType':null,'stepName':null,'stepId':null,'detail':null,..._0x234faa};}export function generateColumnMapping(_0x43bbe6){const _0x197f9b=a148_0x32033a,_0x3bd02a=[];_0x3bd02a[_0x197f9b(0xf3)](col(_0x197f9b(0xe1))),_0x3bd02a[_0x197f9b(0xf3)](col(_0x197f9b(0x125),{'direction':'in','category':_0x197f9b(0x128)})),_0x3bd02a['push'](col(_0x197f9b(0x145),{'direction':_0x197f9b(0xe2),'category':_0x197f9b(0x128)}));_0x43bbe6[_0x197f9b(0x150)]['goal']&&_0x3bd02a['push'](col(_0x197f9b(0x151),{'direction':'in','category':_0x197f9b(0xf7),'detail':_0x43bbe6[_0x197f9b(0x150)][_0x197f9b(0xf7)][_0x197f9b(0x115)]||null}));const _0x3dbb4f=_0x43bbe6[_0x197f9b(0x150)][_0x197f9b(0x105)]||[];for(let _0x51a404=0x0;_0x51a404<_0x3dbb4f[_0x197f9b(0x161)];_0x51a404++){const _0x55a995=_0x3dbb4f[_0x51a404],_0x3b6945=_0x55a995[_0x197f9b(0x115)],_0x522153={'stageIndex':_0x51a404,'stageName':_0x3b6945},_0xc34ca3=_0x55a995[_0x197f9b(0x142)]?.[_0x197f9b(0x115)]||null;_0x3bd02a[_0x197f9b(0xf3)](col(_0x197f9b(0x140)+_0x51a404,{..._0x522153,'direction':'in','category':_0x197f9b(0x112),'detail':_0xc34ca3})),_0x3bd02a[_0x197f9b(0xf3)](col(_0x197f9b(0x118)+_0x51a404,{..._0x522153,'direction':_0x197f9b(0xe2),'category':_0x197f9b(0x112),'detail':_0xc34ca3}));_0x55a995[_0x197f9b(0x126)]&&_0x3bd02a[_0x197f9b(0xf3)](col(_0x197f9b(0x140)+_0x51a404+'_milestone',{..._0x522153,'direction':'in','category':_0x197f9b(0x126),'detail':_0x55a995[_0x197f9b(0x126)]['name']||null}));const _0xb1f4d3=_0x55a995[_0x197f9b(0x15b)]||_0x55a995[_0x197f9b(0x155)]||[];for(let _0x337b49=0x0;_0x337b49<_0xb1f4d3[_0x197f9b(0x161)];_0x337b49++){_0x3bd02a[_0x197f9b(0xf3)](col(_0x197f9b(0x140)+_0x51a404+_0x197f9b(0xf5)+_0x337b49,{..._0x522153,'direction':'in','category':_0x197f9b(0x168),'detail':_0xb1f4d3[_0x337b49][_0x197f9b(0x115)]||null}));}const _0x28be7=getStepEntries(_0x55a995[_0x197f9b(0xe6)]);for(const [_0x2e029a,_0x26c4bb]of _0x28be7){const _0x497d9f=convertToColumnId(_0x2e029a),_0x4624d3=_0x26c4bb[_0x197f9b(0x164)]||null,_0xf81cd2=_0x26c4bb[_0x197f9b(0x115)]||null,_0x2022bf={..._0x522153,'stepType':_0x4624d3,'stepName':_0xf81cd2,'stepId':_0x2e029a};_0x3bd02a[_0x197f9b(0xf3)](col(_0x197f9b(0x140)+_0x51a404+'_'+_0x497d9f,{..._0x2022bf,'direction':'in','category':_0x197f9b(0x15f)})),_0x3bd02a[_0x197f9b(0xf3)](col(_0x197f9b(0x118)+_0x51a404+'_'+_0x497d9f,{..._0x2022bf,'direction':_0x197f9b(0xe2),'category':_0x197f9b(0x15f)}));if(_0x26c4bb[_0x197f9b(0x164)]===_0x197f9b(0x110)&&_0x26c4bb[_0x197f9b(0x138)])for(const _0x4c095f of _0x26c4bb['branches']){_0x4c095f['segmentId']&&_0x3bd02a[_0x197f9b(0xf3)](col(_0x197f9b(0x140)+_0x51a404+'_'+_0x497d9f+'_'+_0x4c095f[_0x197f9b(0x158)],{..._0x2022bf,'direction':'in','category':_0x197f9b(0x11d),'detail':_0x4c095f[_0x197f9b(0x115)]||(_0x4c095f['excluded']?_0x197f9b(0x139):null)}));}if((_0x26c4bb[_0x197f9b(0x164)]==='AbTest'||_0x26c4bb[_0x197f9b(0x164)]==='ABTest')&&_0x26c4bb[_0x197f9b(0xdf)])for(const _0xc40b9f of _0x26c4bb[_0x197f9b(0xdf)]){_0xc40b9f['id']&&_0x3bd02a['push'](col(_0x197f9b(0x140)+_0x51a404+'_'+_0x497d9f+_0x197f9b(0x108)+convertToColumnId(_0xc40b9f['id']),{..._0x2022bf,'direction':'in','category':_0x197f9b(0x133),'detail':_0xc40b9f[_0x197f9b(0x115)]||null}));}if(_0x26c4bb[_0x197f9b(0x164)]===_0x197f9b(0x14d)||_0x26c4bb[_0x197f9b(0x164)]===_0x197f9b(0x14b)){const _0x4ee53f=[];if(_0x26c4bb['conditionSegmentId'])_0x4ee53f[_0x197f9b(0xf3)](_0x26c4bb[_0x197f9b(0xf0)]);else{if(Array['isArray'](_0x26c4bb[_0x197f9b(0xec)]))for(const _0x4e0ffb of _0x26c4bb[_0x197f9b(0xec)]){_0x4e0ffb[_0x197f9b(0x158)]&&!_0x4e0ffb[_0x197f9b(0xf8)]&&_0x4ee53f[_0x197f9b(0xf3)](_0x4e0ffb[_0x197f9b(0x158)]);}else _0x26c4bb[_0x197f9b(0xe4)]?.['segmentId']&&_0x4ee53f['push'](_0x26c4bb[_0x197f9b(0xe4)][_0x197f9b(0x158)]);}for(const _0x222ed5 of _0x4ee53f){_0x3bd02a[_0x197f9b(0xf3)](col(_0x197f9b(0x140)+_0x51a404+'_'+_0x497d9f+'_'+_0x222ed5,{..._0x2022bf,'direction':'in','category':_0x197f9b(0x11d)}));}}}}return _0x3bd02a[_0x197f9b(0xf3)](col(_0x197f9b(0xf6))),_0x3bd02a;}export function aggregateJourneyHistory(_0x6f4629){const _0x24a8c8=a148_0x32033a,_0x3c7558=_0x6f4629[_0x24a8c8(0x136)]((_0x502bcb,_0x3f30cf)=>_0x502bcb+(_0x3f30cf['entryInflux']??0x0),0x0),_0x30712e=_0x6f4629[_0x24a8c8(0x136)]((_0x5304c0,_0x336fc0)=>_0x5304c0+(_0x336fc0['goalInflux']??0x0),0x0),_0x5951d5=_0x6f4629[_0x24a8c8(0x136)]((_0x73752a,_0x1f26b6)=>_0x73752a+((_0x1f26b6[_0x24a8c8(0x156)]??0x0)+(_0x1f26b6[_0x24a8c8(0x122)]??0x0)),0x0),_0x2fc953=_0x6f4629[_0x6f4629[_0x24a8c8(0x161)]-0x1];return{'size':_0x2fc953?.['size']??0x0,'entered':_0x3c7558,'goal_achieved':_0x30712e,'completion_rate':_0x30712e&&_0x3c7558?_0x30712e/_0x3c7558*0x64:0x0,'exit_or_jump':_0x5951d5,'exit_or_jump_rate':_0x5951d5&&_0x3c7558?_0x5951d5/_0x3c7558*0x64:0x0};}export function aggregateStageHistory(_0x2f5124){const _0x1d4ce7=a148_0x32033a,_0x54a488=_0x2f5124[_0x1d4ce7(0x136)]((_0x3edac6,_0x1154a9)=>_0x3edac6+(_0x1154a9[_0x1d4ce7(0x148)]??0x0),0x0),_0x2f5237=_0x2f5124['reduce']((_0x1ce0a9,_0x499d18)=>_0x1ce0a9+(_0x499d18[_0x1d4ce7(0x12c)]??0x0),0x0),_0x3bdc65=_0x2f5124['reduce']((_0x1b2fdf,_0x5bb8b6)=>_0x1b2fdf+((_0x5bb8b6[_0x1d4ce7(0x156)]??0x0)+(_0x5bb8b6[_0x1d4ce7(0x122)]??0x0)),0x0),_0x3637d9=_0x2f5124[_0x2f5124[_0x1d4ce7(0x161)]-0x1];return{'size':_0x3637d9?.[_0x1d4ce7(0x12e)]??0x0,'entered':_0x54a488,'milestone':_0x2f5237,'milestone_rate':_0x2f5237&&_0x54a488?_0x2f5237/_0x54a488*0x64:0x0,'exit_or_jump':_0x3bdc65,'exit_or_jump_rate':_0x3bdc65&&_0x54a488?_0x3bdc65/_0x54a488*0x64:0x0};}export function assembleJourneyStats(_0x127e8e,_0x14671f){const _0x295bcf=a148_0x32033a,_0x561346=!!(_0x14671f?.[_0x295bcf(0x12d)]||_0x14671f?.['to'])&&!!_0x127e8e[_0x295bcf(0xe9)]?.[_0x295bcf(0x161)];if(_0x561346){const _0x25cc36=aggregateJourneyHistory(_0x127e8e['history']),_0x1e7824={'journey_id':_0x127e8e[_0x295bcf(0x10a)],..._0x14671f?.[_0x295bcf(0x12d)]&&{'from':_0x14671f[_0x295bcf(0x12d)]},..._0x14671f?.['to']&&{'to':_0x14671f['to']},..._0x25cc36};return _0x14671f?.['includeHistory']&&(_0x1e7824[_0x295bcf(0xe9)]=_0x127e8e[_0x295bcf(0xe9)]),_0x1e7824;}return{'journey_id':_0x127e8e[_0x295bcf(0x10a)],'size':_0x127e8e[_0x295bcf(0x12e)],'entered':_0x127e8e['enteredSize'],'goal_achieved':_0x127e8e['goalSize'],'completion_rate':_0x127e8e[_0x295bcf(0x167)],'exit_or_jump':_0x127e8e['exitOrJumpSize'],'exit_or_jump_rate':_0x127e8e[_0x295bcf(0x154)]};}function a148_0x3b15(){const _0x555e1d=['conditions','6HAFKKv','resumeJourney','update','conditionSegmentId','all','data','push','pauseJourney','_exit_','time','goal','timedOutPath','journeyBundleId','activation','1245264TVGsNo','lastVersionNumber','createdAt','16GJTRKW','cdp_audience_','listVersions','1265845JvdQat','listActivations','string','state','journeyStages','folder-segment','journeys','_variant_','no-bundle-','journeyId','createJourneyVersion','getLatestJourneyId','createActivation','create','listEntitiesByFolder','DecisionPoint','audienceId','stage','map','3177693raHGTF','name','includeAllVersions','fetchTrafficRaw','outtime_stage_','createJourneyActivation','description','draft','getTrafficData','branch','Journey\x20activation\x20step\x20not\x20found:\x20','activationStepsById','getColumnMapping','journey_','jumpInflux','getJourneyBundle','segmentFolderId','intime_journey','milestone','getActivationSankeyChart','journey','rootFolderId','idx-','parentFolder','milestoneInflux','from','size','toLowerCase','checkJourneyAppendable','getJourneyStatistics','45534wGhddm','variant','run','180780KTMkeX','reduce','set','branches','Excluded\x20profiles','client','getStatistics','get','getActivation','listJourneysWithDetails','Journey\x20not\x20found:\x20','intime_stage_','listJourneysWithFolders','entryCriteria','updatedAt','490540QvPrHE','outtime_journey','getBundle','relationships','entryInflux','JOURNEY_NOT_FOUND','getJourney','Wait','Cannot\x20create\x20a\x20new\x20version:\x20this\x20journey\x20does\x20not\x20belong\x20to\x20a\x20bundle','WaitStep','listJourneys','getConversionSankeyChart','attributes','intime_goal','applyVersionDeduplication','launched','exitOrJumpRate','exitCriteria','exitInflux','resolveRootFolderId','segmentId','getParentSegmentFull','versionNumber','exitCriterias','listJourneysWithDetailsFromParentSegment','journeyBundleName','fixed','step','resolveJourneyId','length','journeyStageId','filter','type','latestJourneyId','createVersion','completionRate','exit_criteria','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','listJourneysFromParentSegment','variants','185788fhnDrU','cdp_customer_id','out','conversion','waitCondition','values','steps','NOT_FOUND','has','history','paused','\x20in\x20journey\x20'];a148_0x3b15=function(){return _0x555e1d;};return a148_0x3b15();}export function formatVersionsFromBundle(_0x395d58){const _0x3e087f=a148_0x32033a,_0x46bfdc=_0x395d58[_0x3e087f(0x107)][_0x3e087f(0x113)](_0x1fd336=>({'journeyId':_0x1fd336['id'],'versionNumber':_0x1fd336[_0x3e087f(0x150)][_0x3e087f(0x15a)]??0x0,'name':_0x1fd336[_0x3e087f(0x150)][_0x3e087f(0x115)],'state':_0x1fd336[_0x3e087f(0x150)][_0x3e087f(0x104)],'paused':_0x1fd336[_0x3e087f(0x150)][_0x3e087f(0xea)],'createdAt':_0x1fd336[_0x3e087f(0x150)]['createdAt'],'updatedAt':_0x1fd336[_0x3e087f(0x150)][_0x3e087f(0x143)]}));return _0x46bfdc['sort']((_0x4a8179,_0x2a3ce8)=>_0x4a8179[_0x3e087f(0x15a)]-_0x2a3ce8[_0x3e087f(0x15a)]),_0x46bfdc;}export function synthesizePreBundleVersion(_0x2b072a){const _0x900847=a148_0x32033a;return{'journeyId':_0x2b072a['id'],'versionNumber':0x1,'name':_0x2b072a[_0x900847(0x150)][_0x900847(0x115)],'state':_0x2b072a['attributes'][_0x900847(0x104)],'paused':_0x2b072a['attributes'][_0x900847(0xea)],'createdAt':_0x2b072a[_0x900847(0x150)]['createdAt'],'updatedAt':_0x2b072a[_0x900847(0x150)][_0x900847(0x143)]};}export function buildStageNameMap(_0x1c07eb){const _0x2c6b67=a148_0x32033a;return new Map(_0x1c07eb[_0x2c6b67(0x150)][_0x2c6b67(0x105)]?.[_0x2c6b67(0x113)](_0x18681b=>[_0x18681b['id'],_0x18681b['name']])??[]);}export class JourneySDK{[a148_0x32033a(0x13a)];constructor(_0x147370){this['client']=new CDPApiClient(_0x147370);}['applyVersionDeduplication'](_0xb45aa6,_0x5a66f8){return _0x5a66f8?_0xb45aa6:deduplicateJourneysByBundle(_0xb45aa6);}async[a148_0x32033a(0x157)](_0x106414){const _0xfecd17=a148_0x32033a,_0x4e9a82=await this[_0xfecd17(0x13a)][_0xfecd17(0x159)](_0x106414);return _0x4e9a82[_0xfecd17(0x129)]??undefined;}async[a148_0x32033a(0x13e)](_0x2ad1cf,_0x1aaf06){const _0x55c643=a148_0x32033a;try{const _0x3eada4=await this['client'][_0x55c643(0x13e)](_0x2ad1cf);return{'journeys':this['applyVersionDeduplication'](_0x3eada4[_0x55c643(0x107)],_0x1aaf06),'activationStepsById':_0x3eada4[_0x55c643(0x11f)]};}catch(_0x2f9e97){if(isHttp404Error(_0x2f9e97))return{'journeys':[],'activationStepsById':new Map()};throw _0x2f9e97;}}async[a148_0x32033a(0xde)](_0x26d770,_0x41f3ed,_0x5486c6){const _0x4f1257=a148_0x32033a;let _0x158576=_0x41f3ed;if(!_0x158576)try{_0x158576=await this['resolveRootFolderId'](_0x26d770);}catch(_0x28f1e1){if(isHttp404Error(_0x28f1e1))return[];throw _0x28f1e1;}if(!_0x158576)return[];let _0x30b973;if(_0x5486c6?.['includeAllVersions'])_0x30b973=await this[_0x4f1257(0x13a)][_0x4f1257(0x14e)](_0x158576);else{const _0x1eb67b=await this[_0x4f1257(0x13a)][_0x4f1257(0x10f)](_0x158576,0x20,![]),_0x203260=_0x1eb67b['data'],_0x543296=_0x203260[_0x4f1257(0x163)](_0x31ce2c=>_0x31ce2c['type']===_0x4f1257(0x128));_0x30b973=_0x543296['map'](_0x425cc9=>entityToJourneyListItem(_0x425cc9,_0x26d770));}return this[_0x4f1257(0x152)](_0x30b973,_0x5486c6?.[_0x4f1257(0x116)]);}async[a148_0x32033a(0x141)](_0x12c9ce,_0x301c79,_0x6c968a){const _0x6472bc=a148_0x32033a;if(!_0x301c79)return{'journeys':[],'folders':[]};const _0x3cfee1=await this[_0x6472bc(0x13a)]['listEntitiesByFolder'](_0x301c79,0x20,![]),_0x4a39fa=_0x3cfee1[_0x6472bc(0xf2)],_0x519a38=_0x4a39fa[_0x6472bc(0x163)](_0x1f7342=>_0x1f7342[_0x6472bc(0x164)]===_0x6472bc(0x106)&&_0x1f7342['id']!==_0x301c79),_0x5f4551=_0x519a38[_0x6472bc(0x113)](_0x34d258=>({'id':_0x34d258['id'],'name':_0x34d258[_0x6472bc(0x150)][_0x6472bc(0x115)]})),_0x333e37=_0x4a39fa['filter'](_0x131e34=>_0x131e34[_0x6472bc(0x164)]===_0x6472bc(0x128)),_0x2757fc=_0x333e37[_0x6472bc(0x113)](_0x5aa12d=>entityToJourneyListItem(_0x5aa12d,_0x12c9ce));return{'journeys':this[_0x6472bc(0x152)](_0x2757fc,_0x6c968a?.['includeAllVersions']),'folders':_0x5f4551};}async[a148_0x32033a(0x15c)](_0x1b8f5c,_0x2ec65c){const _0xd9d4f4=a148_0x32033a;let _0x53b945;try{_0x53b945=await this[_0xd9d4f4(0x157)](_0x1b8f5c);}catch(_0x331f0e){if(isHttp404Error(_0x331f0e))return{'journeys':[],'activationStepsById':new Map()};throw _0x331f0e;}if(!_0x53b945)return{'journeys':[],'activationStepsById':new Map()};const _0x4ce144=await this[_0xd9d4f4(0x13e)](_0x53b945,_0x2ec65c?.[_0xd9d4f4(0x116)]);return{'journeys':this[_0xd9d4f4(0x152)](_0x4ce144[_0xd9d4f4(0x107)],_0x2ec65c?.[_0xd9d4f4(0x116)]),'activationStepsById':_0x4ce144[_0xd9d4f4(0x11f)]};}async[a148_0x32033a(0x14a)](_0xf0192){const _0x1c9ab6=a148_0x32033a;try{return await this[_0x1c9ab6(0x13a)][_0x1c9ab6(0x14a)](_0xf0192);}catch(_0x52fc54){if(isHttp404Error(_0x52fc54))throw new SDKError(ErrorCode[_0x1c9ab6(0x149)],_0x1c9ab6(0x13f)+_0xf0192,_0x52fc54);throw _0x52fc54;}}async[a148_0x32033a(0x160)](_0x59d7d8,_0x4e8e6f){const _0x3ee0cc=a148_0x32033a,_0x53dc7f=await this[_0x3ee0cc(0xde)](_0x59d7d8),_0x4e8a64=_0x53dc7f['find'](_0xa6ee25=>_0xa6ee25[_0x3ee0cc(0x15d)][_0x3ee0cc(0x12f)]()===_0x4e8e6f[_0x3ee0cc(0x12f)]());if(!_0x4e8a64)throw new SDKError(ErrorCode[_0x3ee0cc(0x149)],'Journey\x20not\x20found:\x20'+_0x4e8e6f,undefined,{'helpText':_0x3ee0cc(0xdd)});return _0x4e8a64['id'];}async[a148_0x32033a(0x13b)](_0x3bbe7f,_0x3ab104){const _0xfbf1fb=a148_0x32033a;try{return await this['client'][_0xfbf1fb(0x131)](_0x3bbe7f,_0x3ab104);}catch(_0x11bd74){if(isHttp404Error(_0x11bd74))throw new SDKError(ErrorCode[_0xfbf1fb(0x149)],_0xfbf1fb(0x13f)+_0x3bbe7f,_0x11bd74);throw _0x11bd74;}}async[a148_0x32033a(0x11c)](_0x29cb71,_0x5b4108){const _0x5e12fd=a148_0x32033a,_0x5865ff={'from':_0x5b4108?.[_0x5e12fd(0x12d)],'to':_0x5b4108?.['to'],'limit':_0x5b4108?.['limit']},_0x2264f0=_0x5b4108?.['type']!==_0x5e12fd(0xe3);try{const [_0x2a172c,_0x2e49cb]=await Promise['all']([this[_0x5e12fd(0x117)](_0x29cb71,_0x5b4108?.[_0x5e12fd(0x164)],_0x5865ff),_0x2264f0?this[_0x5e12fd(0x14a)](_0x29cb71):undefined]);if(_0x2a172c[_0x5e12fd(0xfa)]&&_0x2e49cb){const _0x1192fd=buildStageNameMap(_0x2e49cb);_0x2a172c[_0x5e12fd(0xfa)]=_0x2a172c[_0x5e12fd(0xfa)][_0x5e12fd(0x113)](_0x2093b5=>({..._0x2093b5,'journeyStageName':_0x1192fd[_0x5e12fd(0x13c)](_0x2093b5[_0x5e12fd(0x162)])??_0x2093b5['journeyStageId']}));}return _0x2a172c;}catch(_0x398841){if(isHttp404Error(_0x398841))throw new SDKError(ErrorCode[_0x5e12fd(0x149)],_0x5e12fd(0x13f)+_0x29cb71,_0x398841);throw _0x398841;}}async['fetchTrafficRaw'](_0x2757f6,_0x373d88,_0x487dac){const _0x4d489f=a148_0x32033a;if(_0x373d88===_0x4d489f(0xe3)){const _0x4e19f3=await this[_0x4d489f(0x13a)][_0x4d489f(0x14f)](_0x2757f6,_0x487dac);return{'conversion':_0x4e19f3};}if(_0x373d88===_0x4d489f(0xfa)){const _0x37517b=await this[_0x4d489f(0x13a)][_0x4d489f(0x127)](_0x2757f6,_0x487dac);return{'activation':_0x37517b};}const [_0x333781,_0x55b2aa]=await Promise[_0x4d489f(0xf1)]([this[_0x4d489f(0x13a)][_0x4d489f(0x14f)](_0x2757f6,_0x487dac),this[_0x4d489f(0x13a)]['getActivationSankeyChart'](_0x2757f6,_0x487dac)]);return{'conversion':_0x333781,'activation':_0x55b2aa};}async['pause'](_0x441d96){const _0x170bd1=a148_0x32033a;try{return await this['client'][_0x170bd1(0xf4)](_0x441d96);}catch(_0x1d8b09){if(isHttp404Error(_0x1d8b09))throw new SDKError(ErrorCode[_0x170bd1(0x149)],'Journey\x20not\x20found:\x20'+_0x441d96,_0x1d8b09);throw _0x1d8b09;}}async['resume'](_0x1f109d){const _0x12ec82=a148_0x32033a;try{return await this['client'][_0x12ec82(0xee)](_0x1f109d);}catch(_0x2c745a){if(isHttp404Error(_0x2c745a))throw new SDKError(ErrorCode[_0x12ec82(0x149)],_0x12ec82(0x13f)+_0x1f109d,_0x2c745a);throw _0x2c745a;}}async[a148_0x32033a(0x134)](_0x25e9b5){const _0x33a400=a148_0x32033a;try{return await this['client']['runJourney'](_0x25e9b5);}catch(_0x2b2921){if(isHttp404Error(_0x2b2921))throw new SDKError(ErrorCode[_0x33a400(0x149)],_0x33a400(0x13f)+_0x25e9b5,_0x2b2921);throw _0x2b2921;}}async[a148_0x32033a(0x10e)](_0x393528){const _0x3987b1=a148_0x32033a;return await this[_0x3987b1(0x13a)]['createJourney'](_0x393528);}async[a148_0x32033a(0xef)](_0x14d0b0,_0x3bdaf6){const _0x4cc339=a148_0x32033a;try{return await this[_0x4cc339(0x13a)]['updateJourney'](_0x14d0b0,_0x3bdaf6);}catch(_0x5b06ce){if(isHttp404Error(_0x5b06ce))throw new SDKError(ErrorCode[_0x4cc339(0x149)],_0x4cc339(0x13f)+_0x14d0b0,_0x5b06ce);throw _0x5b06ce;}}async[a148_0x32033a(0x13d)](_0xb8f54b,_0x1e8f72){const _0x490ad7=a148_0x32033a;try{return await this[_0x490ad7(0x13a)]['getJourneyActivation'](_0xb8f54b,_0x1e8f72);}catch(_0x2a433f){if(isHttp404Error(_0x2a433f))throw new SDKError(ErrorCode[_0x490ad7(0xe7)],_0x490ad7(0x11e)+_0x1e8f72+_0x490ad7(0xeb)+_0xb8f54b,_0x2a433f);throw _0x2a433f;}}async[a148_0x32033a(0x102)](_0x1acb2d){const _0x5b356c=a148_0x32033a;try{return await this[_0x5b356c(0x13a)]['listJourneyActivations'](_0x1acb2d);}catch(_0x448cac){if(isHttp404Error(_0x448cac))return[];throw _0x448cac;}}async['listActivationsFlat'](_0x221393){const _0x212eed=a148_0x32033a,_0x347731=await this[_0x212eed(0x102)](_0x221393);return _0x347731[_0x212eed(0x113)](flattenJourneyActivation);}async[a148_0x32033a(0x10d)](_0x13ba93,_0x4581a5){const _0x450f61=a148_0x32033a;return await this['client'][_0x450f61(0x119)](_0x13ba93,_0x4581a5);}async[a148_0x32033a(0x120)](_0x339702){const _0x4a5b17=a148_0x32033a,_0x5c481d=await this[_0x4a5b17(0x14a)](_0x339702),_0x19e3fd=generateColumnMapping(_0x5c481d);return{'journeyId':_0x5c481d['id'],'journeyName':_0x5c481d[_0x4a5b17(0x150)]['name'],'database':_0x4a5b17(0xff)+_0x5c481d[_0x4a5b17(0x150)][_0x4a5b17(0x111)],'table':_0x4a5b17(0x121)+_0x5c481d['id'],'columns':_0x19e3fd};}async[a148_0x32033a(0x146)](_0x26488f){const _0x48192c=a148_0x32033a;return this[_0x48192c(0x13a)][_0x48192c(0x123)](_0x26488f);}async[a148_0x32033a(0x10c)](_0x38fa48){const _0xe64638=a148_0x32033a;if(!_0x38fa48)return undefined;try{const _0x2a7c9b=await this[_0xe64638(0x146)](_0x38fa48);return _0x2a7c9b[_0xe64638(0x165)];}catch{return undefined;}}async[a148_0x32033a(0x100)](_0xb60dd6){const _0x50678f=a148_0x32033a,_0x4d851a=await this[_0x50678f(0x14a)](_0xb60dd6),_0x3cb856=_0x4d851a['attributes'][_0x50678f(0xf9)];if(!_0x3cb856)return{'bundleId':'','bundleName':_0x4d851a['attributes'][_0x50678f(0x115)],'bundleDescription':_0x4d851a[_0x50678f(0x150)][_0x50678f(0x11a)]??null,'latestJourneyId':_0x4d851a['id'],'versions':[synthesizePreBundleVersion(_0x4d851a)]};const _0x509bf6=await this[_0x50678f(0x146)](_0x3cb856);return{'bundleId':_0x3cb856,'bundleName':_0x509bf6[_0x50678f(0x115)],'bundleDescription':_0x509bf6[_0x50678f(0x11a)]??null,'latestJourneyId':_0x509bf6[_0x50678f(0x165)],'versions':formatVersionsFromBundle(_0x509bf6)};}async[a148_0x32033a(0x166)](_0x377635){const _0x30dd21=a148_0x32033a,_0x2b2930=await this[_0x30dd21(0x14a)](_0x377635),_0xc403d3=_0x2b2930[_0x30dd21(0x150)][_0x30dd21(0xf9)];if(!_0xc403d3)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x30dd21(0x14c));await this[_0x30dd21(0x13a)][_0x30dd21(0x130)](_0xc403d3);const _0x3c0fa2=await this[_0x30dd21(0x13a)][_0x30dd21(0x123)](_0xc403d3),_0x40c010=_0x3c0fa2[_0x30dd21(0x115)]+'\x20v'+(_0x3c0fa2[_0x30dd21(0xfc)]+0x1);return this[_0x30dd21(0x13a)][_0x30dd21(0x10b)](_0xc403d3,{'sourceId':_0x377635,'attributes':{'name':_0x40c010}});}}
@@ -1 +1 @@
1
- const a147_0x1846fa=a147_0x422d;function a147_0x3659(){const _0x6da21a=['6000080yetYYE','8wusXwV','378644JzaTEt','286218BYKmFG','1077978zAJVhP','456MTnrol','clear','984143CkWnvY','6437442HeTzXE','llm/chat','544036BQNvOk','write','read'];a147_0x3659=function(){return _0x6da21a;};return a147_0x3659();}(function(_0x3bb8b5,_0x361e7e){const _0xffc685=a147_0x422d,_0x9be451=_0x3bb8b5();while(!![]){try{const _0x3b61e8=parseInt(_0xffc685(0x19f))/0x1+parseInt(_0xffc685(0x195))/0x2+-parseInt(_0xffc685(0x19c))/0x3*(parseInt(_0xffc685(0x199))/0x4)+parseInt(_0xffc685(0x198))/0x5+parseInt(_0xffc685(0x193))/0x6+-parseInt(_0xffc685(0x19a))/0x7+parseInt(_0xffc685(0x19d))/0x8*(-parseInt(_0xffc685(0x19b))/0x9);if(_0x3b61e8===_0x361e7e)break;else _0x9be451['push'](_0x9be451['shift']());}catch(_0xc89c40){_0x9be451['push'](_0x9be451['shift']());}}}(a147_0x3659,0xe660a));import{createTextCache}from'../../utils/local-cache.js';const chatIdCache=createTextCache('last_chat_id',a147_0x1846fa(0x194));export function saveLastChatId(_0x5d6eb7){const _0x33a2ce=a147_0x1846fa;chatIdCache[_0x33a2ce(0x196)](_0x5d6eb7);}export function loadLastChatId(){const _0x14efee=a147_0x1846fa;return chatIdCache[_0x14efee(0x197)]();}function a147_0x422d(_0x28cea4,_0x160b0c){_0x28cea4=_0x28cea4-0x193;const _0x3659d5=a147_0x3659();let _0x422d74=_0x3659d5[_0x28cea4];return _0x422d74;}export function clearLastChatId(){const _0x3693bc=a147_0x1846fa;chatIdCache[_0x3693bc(0x19e)]();}
1
+ function a149_0x58b0(_0x12503f,_0x11383c){_0x12503f=_0x12503f-0x13e;const _0x164c2d=a149_0x164c();let _0x58b049=_0x164c2d[_0x12503f];return _0x58b049;}const a149_0x18f119=a149_0x58b0;(function(_0x3cea72,_0x4bbe49){const _0xb32d08=a149_0x58b0,_0x4b48e3=_0x3cea72();while(!![]){try{const _0x59cf1b=-parseInt(_0xb32d08(0x149))/0x1+-parseInt(_0xb32d08(0x14a))/0x2*(-parseInt(_0xb32d08(0x146))/0x3)+-parseInt(_0xb32d08(0x142))/0x4+-parseInt(_0xb32d08(0x147))/0x5*(parseInt(_0xb32d08(0x145))/0x6)+-parseInt(_0xb32d08(0x13f))/0x7+-parseInt(_0xb32d08(0x144))/0x8+parseInt(_0xb32d08(0x140))/0x9;if(_0x59cf1b===_0x4bbe49)break;else _0x4b48e3['push'](_0x4b48e3['shift']());}catch(_0x3811cb){_0x4b48e3['push'](_0x4b48e3['shift']());}}}(a149_0x164c,0x5af2b));import{createTextCache}from'../../utils/local-cache.js';const chatIdCache=createTextCache('last_chat_id',a149_0x18f119(0x141));export function saveLastChatId(_0x81d174){const _0x287528=a149_0x18f119;chatIdCache[_0x287528(0x148)](_0x81d174);}function a149_0x164c(){const _0x3de443=['104374slKsuF','94gljUYi','clear','3845772GNIoLZ','25587855mOhACg','llm/chat','2303220nVFYYy','read','5006472vvxLlJ','4002738ptGNVa','3315Pvqbge','5tzeNAX','write'];a149_0x164c=function(){return _0x3de443;};return a149_0x164c();}export function loadLastChatId(){const _0x164c9a=a149_0x18f119;return chatIdCache[_0x164c9a(0x143)]();}export function clearLastChatId(){const _0x2e6fc2=a149_0x18f119;chatIdCache[_0x2e6fc2(0x13e)]();}