@treasuredata/tdx 2026.3.32 → 2026.3.34

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 (275) 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/auth-login-command.js +1 -1
  13. package/dist/commands/cas-command.js +1 -1
  14. package/dist/commands/cas-segment-command.js +1 -1
  15. package/dist/commands/chat-command.js +1 -1
  16. package/dist/commands/claude-command.js +1 -1
  17. package/dist/commands/claude-statusline-command.js +1 -1
  18. package/dist/commands/claude-usage-command.js +1 -1
  19. package/dist/commands/command.js +1 -1
  20. package/dist/commands/connection-command.js +1 -1
  21. package/dist/commands/databases.js +1 -1
  22. package/dist/commands/delivery-command.js +1 -1
  23. package/dist/commands/describe.js +1 -1
  24. package/dist/commands/engage-campaign-pull-command.js +1 -1
  25. package/dist/commands/engage-campaign-push-command.js +1 -1
  26. package/dist/commands/engage-campaign-validate-command.js +1 -1
  27. package/dist/commands/engage-command.js +1 -1
  28. package/dist/commands/engage-template-pull-command.js +1 -1
  29. package/dist/commands/engage-template-push-command.js +1 -1
  30. package/dist/commands/engage-template-validate-command.js +1 -1
  31. package/dist/commands/job-command.js +1 -1
  32. package/dist/commands/journey-command.js +1 -1
  33. package/dist/commands/journey-validate-command.js +1 -1
  34. package/dist/commands/llm-command.js +1 -1
  35. package/dist/commands/mcp-command.js +1 -1
  36. package/dist/commands/parent-segment-command.js +1 -1
  37. package/dist/commands/policy-command.js +1 -1
  38. package/dist/commands/profile-command.js +1 -1
  39. package/dist/commands/profiles-command.js +1 -1
  40. package/dist/commands/query-command.js +1 -1
  41. package/dist/commands/schedule-command.js +1 -1
  42. package/dist/commands/segment-command.js +1 -1
  43. package/dist/commands/segment-create-command.js +1 -1
  44. package/dist/commands/segment-fields-command.js +1 -1
  45. package/dist/commands/segment-pull-command.js +1 -1
  46. package/dist/commands/segment-push-command.js +1 -1
  47. package/dist/commands/segment-update-command.js +1 -1
  48. package/dist/commands/segment-use-command.js +1 -1
  49. package/dist/commands/segment-validate-command.js +1 -1
  50. package/dist/commands/segments.js +1 -1
  51. package/dist/commands/show.js +1 -1
  52. package/dist/commands/status-command.js +1 -1
  53. package/dist/commands/tables.js +1 -1
  54. package/dist/commands/unset-command.js +1 -1
  55. package/dist/commands/upgrade-command.js +1 -1
  56. package/dist/commands/use-command.js +1 -1
  57. package/dist/commands/user-command.js +1 -1
  58. package/dist/commands/work-command.d.ts +1 -3
  59. package/dist/commands/work-command.d.ts.map +1 -1
  60. package/dist/commands/work-command.js +1 -1
  61. package/dist/commands/work-command.js.map +1 -1
  62. package/dist/commands/workflow-command.js +1 -1
  63. package/dist/core/auth.js +1 -1
  64. package/dist/core/command-output.js +1 -1
  65. package/dist/core/config.js +1 -1
  66. package/dist/core/connection-cache.js +1 -1
  67. package/dist/core/constants.js +1 -1
  68. package/dist/core/credential-cache.js +1 -1
  69. package/dist/core/global-context.js +1 -1
  70. package/dist/core/keychain.js +1 -1
  71. package/dist/core/oauth-keychain.js +1 -1
  72. package/dist/core/oauth.js +1 -1
  73. package/dist/core/profile.js +1 -1
  74. package/dist/core/project-config.js +1 -1
  75. package/dist/core/session.js +1 -1
  76. package/dist/core/user-cache.js +1 -1
  77. package/dist/core/version.js +1 -1
  78. package/dist/index.js +1 -1
  79. package/dist/mcp/server.js +1 -1
  80. package/dist/mcp/tools/index.js +1 -1
  81. package/dist/mcp/tools/tdx-run.js +1 -1
  82. package/dist/mcp/tools/tdx-search.js +1 -1
  83. package/dist/mcp/utils.js +1 -1
  84. package/dist/proxy/claude-usage-tracker.js +1 -1
  85. package/dist/proxy/passthrough-server.js +1 -1
  86. package/dist/proxy/sse-usage-parser.js +1 -1
  87. package/dist/sdk/agent/agent-config.js +1 -1
  88. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  89. package/dist/sdk/agent/agent-yaml.js +1 -1
  90. package/dist/sdk/agent/test/evaluator.js +1 -1
  91. package/dist/sdk/agent/test/executor.js +1 -1
  92. package/dist/sdk/agent/test/index.js +1 -1
  93. package/dist/sdk/agent/test/output.js +1 -1
  94. package/dist/sdk/agent/test/parser.js +1 -1
  95. package/dist/sdk/agent/tool-target-registry.js +1 -1
  96. package/dist/sdk/api.d.ts.map +1 -1
  97. package/dist/sdk/api.js +1 -1
  98. package/dist/sdk/api.js.map +1 -1
  99. package/dist/sdk/cas/cas-api-client.d.ts.map +1 -1
  100. package/dist/sdk/cas/cas-api-client.js +1 -1
  101. package/dist/sdk/cas/cas-api-client.js.map +1 -1
  102. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  103. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  104. package/dist/sdk/cas/index.js +1 -1
  105. package/dist/sdk/cas/pull-workflow.js +1 -1
  106. package/dist/sdk/cas/push-workflow.js +1 -1
  107. package/dist/sdk/client/cdp-api-client.d.ts.map +1 -1
  108. package/dist/sdk/client/cdp-api-client.js +1 -1
  109. package/dist/sdk/client/cdp-api-client.js.map +1 -1
  110. package/dist/sdk/client/delivery-api-client.d.ts.map +1 -1
  111. package/dist/sdk/client/delivery-api-client.js +1 -1
  112. package/dist/sdk/client/delivery-api-client.js.map +1 -1
  113. package/dist/sdk/client/endpoints.js +1 -1
  114. package/dist/sdk/client/engage-api-client.d.ts.map +1 -1
  115. package/dist/sdk/client/engage-api-client.js +1 -1
  116. package/dist/sdk/client/engage-api-client.js.map +1 -1
  117. package/dist/sdk/client/http-client.d.ts +7 -0
  118. package/dist/sdk/client/http-client.d.ts.map +1 -1
  119. package/dist/sdk/client/http-client.js +1 -1
  120. package/dist/sdk/client/http-client.js.map +1 -1
  121. package/dist/sdk/client/llm-api-client.d.ts.map +1 -1
  122. package/dist/sdk/client/llm-api-client.js +1 -1
  123. package/dist/sdk/client/llm-api-client.js.map +1 -1
  124. package/dist/sdk/client/oauth-refresh.js +1 -1
  125. package/dist/sdk/client/rate-limiter.js +1 -1
  126. package/dist/sdk/client/td-api-client.d.ts.map +1 -1
  127. package/dist/sdk/client/td-api-client.js +1 -1
  128. package/dist/sdk/client/td-api-client.js.map +1 -1
  129. package/dist/sdk/client/trino-api-client.d.ts.map +1 -1
  130. package/dist/sdk/client/trino-api-client.js +1 -1
  131. package/dist/sdk/client/trino-api-client.js.map +1 -1
  132. package/dist/sdk/client/workflow-client.d.ts.map +1 -1
  133. package/dist/sdk/client/workflow-client.js +1 -1
  134. package/dist/sdk/client/workflow-client.js.map +1 -1
  135. package/dist/sdk/connection-validator.js +1 -1
  136. package/dist/sdk/connection.js +1 -1
  137. package/dist/sdk/delivery.js +1 -1
  138. package/dist/sdk/engage/campaign-pull.js +1 -1
  139. package/dist/sdk/engage/campaign-push.js +1 -1
  140. package/dist/sdk/engage/campaign-validator.js +1 -1
  141. package/dist/sdk/engage/campaign-yaml.js +1 -1
  142. package/dist/sdk/engage/template-pull.js +1 -1
  143. package/dist/sdk/engage/template-push.js +1 -1
  144. package/dist/sdk/engage/template-validator.js +1 -1
  145. package/dist/sdk/engage/template-yaml.js +1 -1
  146. package/dist/sdk/engage/types/campaign-def.js +1 -1
  147. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  148. package/dist/sdk/engage/types/template-schema.js +1 -1
  149. package/dist/sdk/engage.js +1 -1
  150. package/dist/sdk/errors.js +1 -1
  151. package/dist/sdk/index.d.ts +12 -0
  152. package/dist/sdk/index.d.ts.map +1 -1
  153. package/dist/sdk/index.js +1 -1
  154. package/dist/sdk/index.js.map +1 -1
  155. package/dist/sdk/io/index.js +1 -1
  156. package/dist/sdk/io/node-filesystem.js +1 -1
  157. package/dist/sdk/job.js +1 -1
  158. package/dist/sdk/journey.js +1 -1
  159. package/dist/sdk/llm/chat-cache.js +1 -1
  160. package/dist/sdk/llm/index.js +1 -1
  161. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  162. package/dist/sdk/llm/model-factors.js +1 -1
  163. package/dist/sdk/personalization.d.ts.map +1 -1
  164. package/dist/sdk/personalization.js +1 -1
  165. package/dist/sdk/personalization.js.map +1 -1
  166. package/dist/sdk/policy.d.ts.map +1 -1
  167. package/dist/sdk/policy.js +1 -1
  168. package/dist/sdk/policy.js.map +1 -1
  169. package/dist/sdk/query/index.js +1 -1
  170. package/dist/sdk/query/sql-parser.js +1 -1
  171. package/dist/sdk/realtime.d.ts.map +1 -1
  172. package/dist/sdk/realtime.js +1 -1
  173. package/dist/sdk/realtime.js.map +1 -1
  174. package/dist/sdk/schedule.js +1 -1
  175. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  176. package/dist/sdk/segment/fields-display.js +1 -1
  177. package/dist/sdk/segment/file-discovery.js +1 -1
  178. package/dist/sdk/segment/journey-utils.js +1 -1
  179. package/dist/sdk/segment/journey-validator.js +1 -1
  180. package/dist/sdk/segment/journey-yaml.js +1 -1
  181. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  182. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  183. package/dist/sdk/segment/pull-workflow.js +1 -1
  184. package/dist/sdk/segment/push-recovery.js +1 -1
  185. package/dist/sdk/segment/push-workflow.js +1 -1
  186. package/dist/sdk/segment/resolution-context.js +1 -1
  187. package/dist/sdk/segment/segment-path-parser.js +1 -1
  188. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  189. package/dist/sdk/segment/segment-validator.js +1 -1
  190. package/dist/sdk/segment/target-resolution.js +1 -1
  191. package/dist/sdk/segment/tdx-config.js +1 -1
  192. package/dist/sdk/segment/types/activation-schema.js +1 -1
  193. package/dist/sdk/segment/types/journey-def.js +1 -1
  194. package/dist/sdk/segment/types/journey-schema.js +1 -1
  195. package/dist/sdk/segment/types/segment-def.js +1 -1
  196. package/dist/sdk/segment/types/segment-schema.js +1 -1
  197. package/dist/sdk/segment/validate-files.js +1 -1
  198. package/dist/sdk/segment/yaml-validator.js +1 -1
  199. package/dist/sdk/segment.js +1 -1
  200. package/dist/sdk/types/index.d.ts +1 -1
  201. package/dist/sdk/types/index.d.ts.map +1 -1
  202. package/dist/sdk/types/index.js +1 -1
  203. package/dist/sdk/types/progress.js +1 -1
  204. package/dist/sdk/types/workspace.d.ts +43 -19
  205. package/dist/sdk/types/workspace.d.ts.map +1 -1
  206. package/dist/sdk/types/workspace.js +1 -1
  207. package/dist/sdk/types/workspace.js.map +1 -1
  208. package/dist/sdk/user.js +1 -1
  209. package/dist/sdk/util/format-detector.js +1 -1
  210. package/dist/sdk/util/formatters.js +1 -1
  211. package/dist/sdk/util/index.js +1 -1
  212. package/dist/sdk/util/paginate.js +1 -1
  213. package/dist/sdk/util/tree-formatter.js +1 -1
  214. package/dist/sdk/workflow/archive-validation.js +1 -1
  215. package/dist/sdk/workflow/clone-workflow.js +1 -1
  216. package/dist/sdk/workflow/index.js +1 -1
  217. package/dist/sdk/workflow/pull-workflow.js +1 -1
  218. package/dist/sdk/workflow/push-workflow.js +1 -1
  219. package/dist/sdk/workflow/tdx-config.js +1 -1
  220. package/dist/sdk/workflow/workflow-utils.js +1 -1
  221. package/dist/sdk/workspace/frontmatter.js +1 -1
  222. package/dist/sdk/workspace/git.d.ts +15 -0
  223. package/dist/sdk/workspace/git.d.ts.map +1 -1
  224. package/dist/sdk/workspace/git.js +1 -1
  225. package/dist/sdk/workspace/git.js.map +1 -1
  226. package/dist/sdk/workspace/index.d.ts +38 -21
  227. package/dist/sdk/workspace/index.d.ts.map +1 -1
  228. package/dist/sdk/workspace/index.js +1 -1
  229. package/dist/sdk/workspace/index.js.map +1 -1
  230. package/dist/sdk/workspace/templates.js +1 -1
  231. package/dist/sdk/workspace/weekly.d.ts +49 -0
  232. package/dist/sdk/workspace/weekly.d.ts.map +1 -0
  233. package/dist/sdk/workspace/weekly.js +1 -0
  234. package/dist/sdk/workspace/weekly.js.map +1 -0
  235. package/dist/sdk/workspace/wikilinks.d.ts +7 -2
  236. package/dist/sdk/workspace/wikilinks.d.ts.map +1 -1
  237. package/dist/sdk/workspace/wikilinks.js +1 -1
  238. package/dist/sdk/workspace/wikilinks.js.map +1 -1
  239. package/dist/test-utils/command-runner.js +1 -1
  240. package/dist/test-utils/factories.js +1 -1
  241. package/dist/test-utils/fixtures.js +1 -1
  242. package/dist/test-utils/http-mock.js +1 -1
  243. package/dist/test-utils/index.js +1 -1
  244. package/dist/utils/async.js +1 -1
  245. package/dist/utils/colors.js +1 -1
  246. package/dist/utils/diff.js +1 -1
  247. package/dist/utils/file-permissions.js +1 -1
  248. package/dist/utils/file-reader.js +1 -1
  249. package/dist/utils/github-releases.js +1 -1
  250. package/dist/utils/global-cache.js +1 -1
  251. package/dist/utils/json-loader.js +1 -1
  252. package/dist/utils/local-cache.js +1 -1
  253. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  254. package/dist/utils/logger/formatters/index.js +1 -1
  255. package/dist/utils/logger/handlers/console-handler.js +1 -1
  256. package/dist/utils/logger/handlers/file-handler.js +1 -1
  257. package/dist/utils/logger/handlers/index.js +1 -1
  258. package/dist/utils/logger/handlers/null-handler.js +1 -1
  259. package/dist/utils/logger/index.js +1 -1
  260. package/dist/utils/logger/logger.js +1 -1
  261. package/dist/utils/logger/types.js +1 -1
  262. package/dist/utils/option-validation.js +1 -1
  263. package/dist/utils/process.js +1 -1
  264. package/dist/utils/prompt.js +1 -1
  265. package/dist/utils/spinner.js +1 -1
  266. package/dist/utils/sse-parser.js +1 -1
  267. package/dist/utils/string-utils.js +1 -1
  268. package/dist/utils/table-ref-parser.js +1 -1
  269. package/dist/utils/tdx-logger.js +1 -1
  270. package/dist/utils/version-check.js +1 -1
  271. package/package.json +1 -1
  272. package/dist/sdk/workspace/skills.d.ts +0 -34
  273. package/dist/sdk/workspace/skills.d.ts.map +0 -1
  274. package/dist/sdk/workspace/skills.js +0 -1
  275. package/dist/sdk/workspace/skills.js.map +0 -1
@@ -1 +1 @@
1
- function a151_0x5978(){const _0x189666=['warn','stringify','44200PiAMFv','dirname','join','16IbxHPA','.push-recovery.json','.tmp','toISOString','ENOENT','Failed\x20to\x20read\x20push\x20recovery\x20file:\x20','10kIRTRg','debug','13dIUqOe','956772xHaDFS','code','basename','segments','string','4450RfUFEE','716135jGEgGY','88576nYTYWI','utf-8','601668ijtNYy','Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20','journeyName','681789ndEqWa'];a151_0x5978=function(){return _0x189666;};return a151_0x5978();}(function(_0x1e27d8,_0x1a1161){const _0x331a21=a151_0x3ffe,_0x3017de=_0x1e27d8();while(!![]){try{const _0x40f55a=-parseInt(_0x331a21(0x1c7))/0x1*(-parseInt(_0x331a21(0x1b2))/0x2)+parseInt(_0x331a21(0x1b9))/0x3+parseInt(_0x331a21(0x1bf))/0x4*(-parseInt(_0x331a21(0x1bc))/0x5)+parseInt(_0x331a21(0x1b6))/0x6+-parseInt(_0x331a21(0x1b3))/0x7+parseInt(_0x331a21(0x1b4))/0x8+parseInt(_0x331a21(0x1c8))/0x9*(-parseInt(_0x331a21(0x1c5))/0xa);if(_0x40f55a===_0x1a1161)break;else _0x3017de['push'](_0x3017de['shift']());}catch(_0x178c8a){_0x3017de['push'](_0x3017de['shift']());}}}(a151_0x5978,0x1e2ad));import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';import a151_0x13d183 from'path';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of']('tdx.sdk.push-recovery');export function getPushRecoveryPath(_0x5af655){const _0x567cf5=a151_0x3ffe,_0x3f6643=a151_0x13d183[_0x567cf5(0x1bd)](_0x5af655),_0x507583=a151_0x13d183[_0x567cf5(0x1ca)](_0x5af655);return a151_0x13d183[_0x567cf5(0x1be)](_0x3f6643,'.'+_0x507583+_0x567cf5(0x1c0));}function a151_0x3ffe(_0x2bc35f,_0x20150f){_0x2bc35f=_0x2bc35f-0x1b1;const _0x5978bc=a151_0x5978();let _0x3ffe4e=_0x5978bc[_0x2bc35f];return _0x3ffe4e;}export function readPushRecovery(_0x2f698c){const _0x50ead3=a151_0x3ffe,_0x1cd960=getPushRecoveryPath(_0x2f698c);if(!existsSync(_0x1cd960))return undefined;try{const _0x5d3108=readFileSync(_0x1cd960,_0x50ead3(0x1b5)),_0x4f796b=JSON['parse'](_0x5d3108);if(_0x4f796b?.['version']!==0x1||typeof _0x4f796b[_0x50ead3(0x1b8)]!==_0x50ead3(0x1b1))return undefined;return _0x4f796b;}catch(_0x1cf2e3){return _0x1cf2e3 instanceof SyntaxError?logger['debug'](_0x50ead3(0x1b7)+_0x1cf2e3):logger[_0x50ead3(0x1ba)](_0x50ead3(0x1c4)+_0x1cf2e3),undefined;}}export function writePushRecovery(_0x56dfd0,_0xd8cafa){const _0x2e7363=a151_0x3ffe,_0x31caf1=getPushRecoveryPath(_0x56dfd0),_0x16ab6d=_0x31caf1+_0x2e7363(0x1c1);writeFileSync(_0x16ab6d,JSON[_0x2e7363(0x1bb)](_0xd8cafa,null,0x2)+'\x0a','utf-8'),renameSync(_0x16ab6d,_0x31caf1);}export function deletePushRecovery(_0x585663){const _0x3c8a28=a151_0x3ffe,_0x422f07=getPushRecoveryPath(_0x585663);try{unlinkSync(_0x422f07);}catch(_0xd29d2e){_0xd29d2e[_0x3c8a28(0x1c9)]!==_0x3c8a28(0x1c3)&&logger[_0x3c8a28(0x1c6)]('Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20'+_0xd29d2e);}}export function saveSegmentToPushRecovery(_0x20ab38,_0x52d983,_0x56224e,_0x52799b){const _0x57f00b=a151_0x3ffe,_0x1fdbf5=readPushRecovery(_0x20ab38),_0x492f4e=_0x1fdbf5?.['journeyName']===_0x52d983?{..._0x1fdbf5,'updatedAt':new Date()[_0x57f00b(0x1c2)]()}:{'version':0x1,'journeyName':_0x52d983,'updatedAt':new Date()['toISOString'](),'segments':{}};_0x492f4e[_0x57f00b(0x1cb)][_0x56224e]=_0x52799b,writePushRecovery(_0x20ab38,_0x492f4e);}
1
+ function a151_0x54af(_0x324c4c,_0x1a4593){_0x324c4c=_0x324c4c-0x1bc;const _0x5e50c9=a151_0x5e50();let _0x54af9b=_0x5e50c9[_0x324c4c];return _0x54af9b;}const a151_0x4a44f6=a151_0x54af;(function(_0xe8f706,_0x1fcf83){const _0x46f1d6=a151_0x54af,_0x5c18a0=_0xe8f706();while(!![]){try{const _0x4eb053=-parseInt(_0x46f1d6(0x1cf))/0x1+-parseInt(_0x46f1d6(0x1cc))/0x2*(-parseInt(_0x46f1d6(0x1cb))/0x3)+-parseInt(_0x46f1d6(0x1be))/0x4*(parseInt(_0x46f1d6(0x1bc))/0x5)+-parseInt(_0x46f1d6(0x1bf))/0x6*(parseInt(_0x46f1d6(0x1ca))/0x7)+-parseInt(_0x46f1d6(0x1c6))/0x8+-parseInt(_0x46f1d6(0x1c1))/0x9+-parseInt(_0x46f1d6(0x1d1))/0xa*(-parseInt(_0x46f1d6(0x1c5))/0xb);if(_0x4eb053===_0x1fcf83)break;else _0x5c18a0['push'](_0x5c18a0['shift']());}catch(_0x53ca2b){_0x5c18a0['push'](_0x5c18a0['shift']());}}}(a151_0x5e50,0xf2558));import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';import a151_0x1ecdd1 from'path';import{Logger}from'../../utils/logger/index.js';function a151_0x5e50(){const _0x220417=['6692TJIgkd','6918KMTaZy','parse','17255682sAVUlU','Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20','stringify','debug','194777dguLcA','11365312qsJXSK','toISOString','basename','string','5831VTRioj','3hPldrA','239218AvBUDr','join','journeyName','593783IXmlBp','warn','4110SzGcPj','segments','utf-8','tdx.sdk.push-recovery','4520pfhmtj','Failed\x20to\x20read\x20push\x20recovery\x20file:\x20'];a151_0x5e50=function(){return _0x220417;};return a151_0x5e50();}const logger=Logger['of'](a151_0x4a44f6(0x1d4));export function getPushRecoveryPath(_0x38ce22){const _0x4ae1e8=a151_0x4a44f6,_0x39cce3=a151_0x1ecdd1['dirname'](_0x38ce22),_0x461d9d=a151_0x1ecdd1[_0x4ae1e8(0x1c8)](_0x38ce22);return a151_0x1ecdd1[_0x4ae1e8(0x1cd)](_0x39cce3,'.'+_0x461d9d+'.push-recovery.json');}export function readPushRecovery(_0x2d8a27){const _0x167c88=a151_0x4a44f6,_0x1ec97c=getPushRecoveryPath(_0x2d8a27);if(!existsSync(_0x1ec97c))return undefined;try{const _0x1a4d93=readFileSync(_0x1ec97c,_0x167c88(0x1d3)),_0x1d56e1=JSON[_0x167c88(0x1c0)](_0x1a4d93);if(_0x1d56e1?.['version']!==0x1||typeof _0x1d56e1[_0x167c88(0x1ce)]!==_0x167c88(0x1c9))return undefined;return _0x1d56e1;}catch(_0xc8d0fa){return _0xc8d0fa instanceof SyntaxError?logger[_0x167c88(0x1c4)]('Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20'+_0xc8d0fa):logger[_0x167c88(0x1d0)](_0x167c88(0x1bd)+_0xc8d0fa),undefined;}}export function writePushRecovery(_0x12d57d,_0x4ffcaf){const _0x4f727c=a151_0x4a44f6,_0x34d15d=getPushRecoveryPath(_0x12d57d),_0x16d32c=_0x34d15d+'.tmp';writeFileSync(_0x16d32c,JSON[_0x4f727c(0x1c3)](_0x4ffcaf,null,0x2)+'\x0a','utf-8'),renameSync(_0x16d32c,_0x34d15d);}export function deletePushRecovery(_0xe6d425){const _0x26428d=a151_0x4a44f6,_0x2f70c7=getPushRecoveryPath(_0xe6d425);try{unlinkSync(_0x2f70c7);}catch(_0x3f57c8){_0x3f57c8['code']!=='ENOENT'&&logger['debug'](_0x26428d(0x1c2)+_0x3f57c8);}}export function saveSegmentToPushRecovery(_0x2f3da8,_0x183142,_0x5279de,_0x39d872){const _0x106be1=a151_0x4a44f6,_0xd7cf74=readPushRecovery(_0x2f3da8),_0x336aae=_0xd7cf74?.['journeyName']===_0x183142?{..._0xd7cf74,'updatedAt':new Date()[_0x106be1(0x1c7)]()}:{'version':0x1,'journeyName':_0x183142,'updatedAt':new Date()[_0x106be1(0x1c7)](),'segments':{}};_0x336aae[_0x106be1(0x1d2)][_0x5279de]=_0x39d872,writePushRecovery(_0x2f3da8,_0x336aae);}
@@ -1 +1 @@
1
- const a152_0x5aba4d=a152_0x17bc;(function(_0x47e598,_0x1f7df2){const _0x501884=a152_0x17bc,_0x4437ea=_0x47e598();while(!![]){try{const _0x4a36d9=-parseInt(_0x501884(0x11d))/0x1+-parseInt(_0x501884(0x118))/0x2+parseInt(_0x501884(0xf3))/0x3*(parseInt(_0x501884(0x11c))/0x4)+-parseInt(_0x501884(0xf4))/0x5*(-parseInt(_0x501884(0x159))/0x6)+parseInt(_0x501884(0x18b))/0x7*(-parseInt(_0x501884(0x18f))/0x8)+parseInt(_0x501884(0x114))/0x9+parseInt(_0x501884(0xef))/0xa*(parseInt(_0x501884(0x1cf))/0xb);if(_0x4a36d9===_0x1f7df2)break;else _0x4437ea['push'](_0x4437ea['shift']());}catch(_0xcb90cd){_0x4437ea['push'](_0x4437ea['shift']());}}}(a152_0x2a1b,0xae425));import{createHash}from'crypto';function a152_0x2a1b(){const _0x12c6bc=['state','segmentFolderId','segment','toString','JOURNEY_UPDATE_ERROR','folder_created','activation_updating','Deleted\x20activation\x20\x27','name','logDeleted','Stage\x20\x27','relationships','activation_creating','all_columns','segment_deleted','with','./child-segment-yaml.js','journey','activationParams','journeyStages','segment_created','embeddedSegmentNameToId','updated','\x20(referenced\x20in\x20journey\x20','\x0a\x20\x20','segment_updated','segmentNameToId','journeyId','versionNumber','delete','\x27\x20from\x20file:\x20','Deleted\x20segment\x20\x27','some','toISOString','replace','fetchJourney','154cItYWq','add','activation_updated','attributes','getSegmentEntity\x20also\x20failed\x20for\x20','run_after_journey_refresh','INTERNAL','uniqueSegmentName','description','localName','getSegment\x20failed\x20for\x20','Activation','created','Updating\x20activation\x20\x27','activation_created','embedded_activation_creating','entry','kind','waitStep','isNew','Failed\x20to\x20fetch\x20referenced\x20segment\x20','nameToType','digest','trim','Failed\x20to\x20','stages','embedded_activation_created','effectiveFolderId','getSegmentEntity','):\x20','user','diff','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','embedded_segment_created','Segment\x20not\x20found:\x20','activation_','736730KloWzu','activationsBySegmentId','idToName','activations','3hsSTTX','10rJtwUM','conditionSegmentId','activation_deleting','existingSegments','getJourney','waitStepType','deleteActivation','null','getLatestJourneyId','validatedRequest','stringify','folderPath','conditionTimeoutDuration','uniqueServerName',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','../../utils/async.js','getSegment','segment_deleting','entryCriteria','connector_config','__pending_act_','startsWith','waitStepUnit','connection','item','progress','segment_creating','existingJourney','valid','Created\x20folder\x20\x27','Updated\x20activation\x20\x27','goal\x20criteria','8369685eNHnKX','decision_point','object','\x20journey\x20from\x20file:\x20','1537954CFqhxg','get','createFolder','match','2991200mvWJTx','1286493kYTORH','Delete\x20the\x20push\x20recovery\x20file\x20(',').\x20','type','split','from','journeys','\x27\x20exit\x20criteria','WaitStep','deleted','entries','flatMap','join','Updated\x20segment\x20\x27','__pending_','activationContext','SEGMENT_NOT_FOUND','create','\x27...','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','Matched\x20server\x20segment\x20\x27','set','createdSegmentId','\x20error(s)','Creating\x20activation\x20\x27','createdSegmentIds','list','journeyBundlesByFolderAndName','update','unchanged','index','parentId','DecisionPoint','utf-8','ACTIVATION_UPDATE_ERROR','tdx.sdk.push-workflow','journey_entry_criteria_','draft','max','segments','behavior','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','\x20activation\x20\x27','Segment\x20not\x20found','parse','buildUserMaps','journey_updating','debug','stage\x20\x27','JOURNEY_SYNTAX_ERROR','\x27\x20milestone','includes','size','Fetching\x20','existingSegment','slice','Embedded\x20segment\x20\x27','existingActivation','getActivation','columns','1641336OWXtwg','resolveJourneyId','yamlConfig','find','journeyActivationStepId','resolvedRule','rule','activationActions','ACTIVATION_SYNTAX_ERROR','idToEmailMap','Failed\x20to\x20resolve\x20activation\x20','keys','schedule','verbose','conditionTimeoutUnit','parseDocument','journeyBundleName','listActivations','Created\x20journey\x20\x27','withProgress','.$1.push-recovery.json','steps','action','data','hasChanges','Duration','length','toLowerCase','exitCriterias','push','deps','updateActivation','connectionIdToNameMap','conditions','Creating\x20segment\x20\x27','notification','./journey-yaml.js','logSuccess','values','results','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','rootFolderId','map','yamlActivation','segmentId','Created\x20segment\x20\x27','has','day','Updating\x20segment\x20\x27','message','14ipgyou','folderPathToId','onProgress','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','1948256XsPCDw','journeyActivationNameToId','updateSegmentById','sort','journeyById','activation_template_id','branches','sha1','relative','logInfo','createActivation','journeyBundleId','NOT_FOUND','Activation\x20not\x20found:\x20','\x27\x20decision\x20point\x20branch\x20\x27','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','Condition','filter','folderId','resolveSegment','absolutePath','Name\x20has\x20already\x20been\x20taken','goal','SEGMENT_UPDATE_ERROR','Entry\x20criteria:\x20','\x27\x20not\x20found\x20in\x20journey\x20\x27','milestone','Failed\x20to\x20resolve\x20segment\x20'];a152_0x2a1b=function(){return _0x12c6bc;};return a152_0x2a1b();}import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a152_0x5aba4d(0x140));export const PENDING_SEGMENT_PREFIX=a152_0x5aba4d(0x12b);export const PENDING_ACTIVATION_PREFIX=a152_0x5aba4d(0x108);export function createPendingSegmentId(_0x329d6c){return''+PENDING_SEGMENT_PREFIX+_0x329d6c+'__';}export function isPendingSegmentId(_0x5da7da){const _0x51e3f5=a152_0x5aba4d;return _0x5da7da['startsWith'](PENDING_SEGMENT_PREFIX)&&!_0x5da7da[_0x51e3f5(0x109)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x1291f8){const _0x425588=a152_0x5aba4d;return _0x1291f8[_0x425588(0x1cd)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x4260fd){return''+PENDING_ACTIVATION_PREFIX+_0x4260fd+'__';}export function isPendingActivationId(_0x5c64f8){const _0x1a3d68=a152_0x5aba4d;return _0x5c64f8[_0x1a3d68(0x109)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x32d6fc){const _0x4267a1=a152_0x5aba4d;return _0x32d6fc[_0x4267a1(0x1cd)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0xc8de2c,_0x31393b){const _0x5d1907=a152_0x5aba4d,_0x329034=_0xc8de2c+'::'+(_0x31393b[_0x5d1907(0x1e6)]()||_0x5d1907(0x1ad)),_0x2d87e4=createHash(_0x5d1907(0x196))[_0x5d1907(0x139)](_0x329034)[_0x5d1907(0x1e5)]('hex')[_0x5d1907(0x154)](0x0,0xc);return _0x5d1907(0x141)+_0x2d87e4;}export function ensureJourneyDefaults(_0x759b4b){const _0x165d8f=a152_0x5aba4d;!_0x759b4b[_0x165d8f(0x1d7)]&&(_0x759b4b['description']=''),!_0x759b4b[_0x165d8f(0x1ab)]&&(_0x759b4b[_0x165d8f(0x1ab)]=_0x165d8f(0x142));}export function injectExistingStageIds(_0x5be680,_0x4829ca){const _0x38d8de=a152_0x5aba4d,_0x3ed6d8=new Map(_0x4829ca[_0x38d8de(0x183)](_0x30d878=>[_0x30d878[_0x38d8de(0x1b3)],_0x30d878['id']]));for(const _0x21f3be of _0x5be680){if(!_0x21f3be['id']){const _0x1dce5c=_0x3ed6d8['get'](_0x21f3be['name']);_0x1dce5c&&(_0x21f3be['id']=_0x1dce5c);}}}export function resolveTDFolderPath(_0x60d6ca,_0x4adcde,_0x301782){if(!_0x4adcde)return _0x60d6ca;if(_0x60d6ca===_0x301782||_0x60d6ca['startsWith'](_0x301782+'/'))return _0x60d6ca;return _0x60d6ca?_0x301782+'/'+_0x60d6ca:_0x301782;}export function addFoldersToCreate(_0x2bd381,_0x494c5c,_0x1e4055){const _0xfa14e5=a152_0x5aba4d;if(!_0x2bd381)return;if(_0x494c5c['has'](_0x2bd381))return;const _0x4d1e94=_0x2bd381[_0xfa14e5(0x121)]('/');let _0x5aa653='';for(const _0x4013c1 of _0x4d1e94){_0x5aa653=_0x5aa653?_0x5aa653+'/'+_0x4013c1:_0x4013c1,!_0x494c5c['has'](_0x5aa653)&&_0x1e4055[_0xfa14e5(0x1d0)](_0x5aa653);}}export function sortFoldersByDepth(_0x45cd50){const _0x4896f2=a152_0x5aba4d;return[..._0x45cd50][_0x4896f2(0x192)]((_0x569710,_0x237729)=>{const _0x332351=_0x4896f2,_0x45aa37=(_0x569710[_0x332351(0x11b)](/\//g)||[])[_0x332351(0x173)],_0x4fbf9f=(_0x237729[_0x332351(0x11b)](/\//g)||[])[_0x332351(0x173)];return _0x45aa37-_0x4fbf9f;});}function a152_0x17bc(_0x122c7d,_0x1b4884){_0x122c7d=_0x122c7d-0xeb;const _0x2a1b14=a152_0x2a1b();let _0x17bc88=_0x2a1b14[_0x122c7d];return _0x17bc88;}import*as a152_0xb08b55 from'yaml';import{readFileSync}from'fs';import a152_0x170dc1 from'path';import{isJourneyDef,parseYamlString as a152_0x19afe0,toYamlString as a152_0x5901d2,normalizeJourneyDef,hasMultipleVersions,journeyResponseToDef,collectSegmentIdsFromJourneyApi}from'./journey-yaml.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,createJumpTargetCache,resolveJumpTarget,buildMergedJourneyDef,buildLocalRuleToNameMappingFromJourney,collectSegmentUsageCounts}from'./journey-utils.js';import{activationResponseToDef,segmentToYamlString,segmentWithActivationsToYaml,parseSegmentYamlFile,normalizeChildSegmentYaml,apiRuleToYaml,yamlRuleToApi,serializeExpandedRule,collectSegmentRefsFromRule,resolveRuleSegmentRefs,resolveRuleSegmentIds,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{batchAsync}from'../../utils/async.js';import{buildFolderMaps}from'./resolution-context.js';import{SDKError,ErrorCode,isHttp400Error,getErrorMessage}from'../errors.js';import{readPushRecovery,saveSegmentToPushRecovery,deletePushRecovery}from'./push-recovery.js';import{validateSegmentDef,formatValidationResult}from'./yaml-validator.js';import{validateJourneyDef}from'./journey-validator.js';function stableStringify(_0x883ebc){const _0x407385=a152_0x5aba4d;if(Array['isArray'](_0x883ebc))return'['+_0x883ebc[_0x407385(0x183)](_0x1464cb=>stableStringify(_0x1464cb))['join'](',')+']';if(_0x883ebc&&typeof _0x883ebc===_0x407385(0x116)){const _0xfdc176=_0x883ebc,_0x1abe9c=Object['keys'](_0xfdc176)[_0x407385(0x192)](),_0x1d8456=_0x1abe9c[_0x407385(0x183)](_0x44001e=>'\x22'+_0x44001e+'\x22:'+stableStringify(_0xfdc176[_0x44001e]));return'{'+_0x1d8456[_0x407385(0x129)](',')+'}';}const _0x7afd16=JSON[_0x407385(0xfe)](_0x883ebc);return _0x7afd16===undefined?_0x407385(0xfb):_0x7afd16;}function activationSignature(_0x3f4d39){const _0x775153=a152_0x5aba4d,_0x594780={'connection':_0x3f4d39[_0x775153(0x10b)],..._0x3f4d39[_0x775153(0x1b8)]!==undefined&&{'all_columns':_0x3f4d39['all_columns']},..._0x3f4d39[_0x775153(0x158)]!==undefined&&{'columns':_0x3f4d39[_0x775153(0x158)]},..._0x3f4d39[_0x775153(0x145)]!==undefined&&{'behavior':_0x3f4d39[_0x775153(0x145)]},..._0x3f4d39[_0x775153(0x165)]!==undefined&&{'schedule':_0x3f4d39[_0x775153(0x165)]},..._0x3f4d39[_0x775153(0x17c)]!==undefined&&{'notification':_0x3f4d39[_0x775153(0x17c)]},..._0x3f4d39[_0x775153(0x107)]!==undefined&&{'connector_config':_0x3f4d39[_0x775153(0x107)]},..._0x3f4d39[_0x775153(0x194)]!==undefined&&{'activation_template_id':_0x3f4d39['activation_template_id']}};return stableStringify(_0x594780);}async function fetchSegment(_0x53d2ae,_0x50817e,_0x584117,_0x28c1e8){const _0x5ccf44=a152_0x5aba4d,_0x476791=_0x28c1e8?.[_0x5ccf44(0x15c)](_0xeec07a=>_0xeec07a['id']===_0x584117);if(_0x476791)return _0x476791;try{return await _0x53d2ae[_0x5ccf44(0x1ad)][_0x5ccf44(0x104)](_0x50817e,_0x584117);}catch(_0x28146f){logger[_0x5ccf44(0x14c)](_0x5ccf44(0x1d9)+_0x584117+_0x5ccf44(0x102)+_0x28146f);try{return await _0x53d2ae[_0x5ccf44(0x1ad)][_0x5ccf44(0x1eb)](_0x584117);}catch(_0x1a5c5b){return logger[_0x5ccf44(0x14c)](_0x5ccf44(0x1d3)+_0x584117+':\x20'+_0x1a5c5b),null;}}}function recoverSegmentIdsFromPushRecovery(_0x33692d,_0x446064,_0x2733ab){const _0x4d184b=a152_0x5aba4d,_0x9358bf=readPushRecovery(_0x33692d[_0x4d184b(0x1a3)]);if(_0x9358bf?.['journeyName']===_0x33692d[_0x4d184b(0x15b)][_0x4d184b(0x1b3)])for(const [_0x5db256,_0x3f48d2]of Object[_0x4d184b(0x127)](_0x9358bf[_0x4d184b(0x144)])){const _0x29dcf3=generateDeterministicJourneySegmentName(_0x33692d['yamlConfig'][_0x4d184b(0x1b3)],_0x5db256);_0x3f48d2[_0x4d184b(0x101)]===_0x29dcf3&&(_0x446064[_0x4d184b(0x132)](_0x5db256,_0x3f48d2[_0x4d184b(0x185)]),_0x2733ab[_0x4d184b(0x132)](_0x5db256,_0x3f48d2[_0x4d184b(0x185)]));}}async function createOrRecoverEmbeddedSegment(_0x56905e,_0x2302b6,_0xdee45e,_0x24d029){const _0x52293a=a152_0x5aba4d;let _0x216c5a;try{_0x216c5a=await _0x56905e[_0x52293a(0x1ad)]['createJourneySegment']({'name':_0xdee45e[_0x52293a(0x1d6)],'description':_0xdee45e[_0x52293a(0x1d7)],'journeyId':_0xdee45e['journeyId'],'rule':_0x24d029(_0xdee45e[_0x52293a(0x15e)],!![]),'countPopulation':!![],'parentFolderId':_0xdee45e['folderId'],'audienceId':_0xdee45e[_0x52293a(0x13c)]});}catch(_0x164278){const _0x3d95dd=_0x164278 instanceof Error&&_0x164278[_0x52293a(0x18a)][_0x52293a(0x150)](_0x52293a(0x1a4));if(_0x3d95dd){const _0x3d7133=readPushRecovery(_0x2302b6[_0x52293a(0x1a3)]),_0x31f81=_0x3d7133?.['journeyName']===_0x2302b6[_0x52293a(0x15b)][_0x52293a(0x1b3)]?_0x3d7133[_0x52293a(0x144)][_0xdee45e[_0x52293a(0x1d8)]]:undefined;if(_0x31f81?.[_0x52293a(0x101)]===_0xdee45e['uniqueSegmentName'])await _0x56905e[_0x52293a(0x1ad)]['updateSegmentById'](_0xdee45e[_0x52293a(0x13c)],_0x31f81['segmentId'],{'description':_0xdee45e[_0x52293a(0x1d7)],'rule':_0x24d029(_0xdee45e[_0x52293a(0x15e)],!![]),'countPopulation':!![]}),_0x216c5a=_0x31f81[_0x52293a(0x185)];else throw new SDKError(ErrorCode[_0x52293a(0x1a6)],_0x52293a(0x155)+_0xdee45e[_0x52293a(0x1d8)]+_0x52293a(0x146)+(_0x52293a(0x11e)+_0x2302b6[_0x52293a(0x1a3)][_0x52293a(0x1cd)](/([^/]+)$/,_0x52293a(0x16d))+')\x20')+'and\x20the\x20server\x20segment,\x20then\x20retry.',_0x164278);}else throw _0x164278;}return saveSegmentToPushRecovery(_0x2302b6[_0x52293a(0x1a3)],_0x2302b6['yamlConfig'][_0x52293a(0x1b3)],_0xdee45e[_0x52293a(0x1d8)],{'segmentId':_0x216c5a,'uniqueServerName':_0xdee45e[_0x52293a(0x1d6)],'createdAt':new Date()['toISOString']()}),_0x216c5a;}export async function prepareSegmentFiles(_0xbe2b93,_0x2854ae,_0x4111cc,_0x1f8acb,_0x1724d1){const _0x2cfe70=a152_0x5aba4d,{activationDefToCreateRequest:_0x10386e}=await import('./child-segment-yaml.js'),_0x51ed9b=[],_0x63a3c3=new Set();for(const {yamlConfig:_0x35a694,folderPath:_0x54d290,sourcePath:_0x3fe06a}of _0xbe2b93){const _0x19d0d0=resolveTDFolderPath(_0x54d290,_0x1f8acb,_0x1724d1),_0x3e9002=_0x19d0d0+':'+_0x35a694[_0x2cfe70(0x1b3)],_0x46edec=_0x2854ae['segmentByFolderAndName'][_0x2cfe70(0x119)](_0x3e9002),_0x5b12e5=_0x46edec?_0x2854ae[_0x2cfe70(0xf0)][_0x2cfe70(0x119)](_0x46edec['id'])||[]:[];addFoldersToCreate(_0x19d0d0,_0x2854ae[_0x2cfe70(0x18c)],_0x63a3c3);const _0x460ac6=calculateActivationActions(_0x35a694[_0x2cfe70(0xf2)]||[],_0x5b12e5,_0x2854ae[_0x2cfe70(0x162)],_0x2854ae['connectionIdToNameMap']);for(const _0x47ed01 of _0x460ac6){(_0x47ed01[_0x2cfe70(0x120)]===_0x2cfe70(0x12e)||_0x47ed01['type']===_0x2cfe70(0x139))&&_0x47ed01[_0x2cfe70(0x184)]&&(_0x47ed01[_0x2cfe70(0xfd)]=await _0x10386e(_0x47ed01[_0x2cfe70(0x184)],_0x4111cc));}const _0x262280=calculateSegmentDiff(_0x35a694,_0x46edec,_0x5b12e5,_0x2854ae[_0x2cfe70(0x162)],_0x2854ae[_0x2cfe70(0x179)]);_0x51ed9b[_0x2cfe70(0x176)]({'relativePath':_0x35a694[_0x2cfe70(0x1b3)],'absolutePath':_0x3fe06a,'yamlConfig':_0x35a694,'folderPath':_0x19d0d0,'existingSegment':_0x46edec,'existingActivations':_0x5b12e5,'isNew':_0x262280[_0x2cfe70(0x1e2)],'hasChanges':_0x262280[_0x2cfe70(0x171)],'diff':_0x262280[_0x2cfe70(0x1ee)],'activationActions':_0x460ac6});}return{'segmentFiles':_0x51ed9b,'foldersToCreate':_0x63a3c3};}export async function prepareJourneyFiles(_0x257929,_0x3e2ef9,_0x593a79,_0x2af3f7){const _0x2b34d9=a152_0x5aba4d,_0x11800c=[],_0x3f58f4=new Set();for(const {yamlConfig:_0x57ba0f,folderPath:_0x165c08,sourcePath:_0xb6bd75}of _0x257929){const _0x26d776=resolveTDFolderPath(_0x165c08,_0x593a79,_0x2af3f7),_0x3d93f0=_0x26d776+':'+_0x57ba0f[_0x2b34d9(0x1b3)],_0x11b041=_0x3e2ef9[_0x2b34d9(0x138)][_0x2b34d9(0x119)](_0x3d93f0);let _0x1a3d62,_0x32a377;if(_0x11b041&&_0x11b041['length']>0x0){const _0x4deb1=buildLocalExpandedRuleMappings(_0x57ba0f),{createYamlContext:_0x1e8d36,prefetchJourneySegments:_0x1fa50c}=createPushYamlContextForBundle(_0x3e2ef9[_0x2b34d9(0x177)],_0x3e2ef9[_0x2b34d9(0x13c)],_0x3e2ef9[_0x2b34d9(0xf7)],_0x4deb1,_0x3e2ef9[_0x2b34d9(0x162)],_0x3e2ef9[_0x2b34d9(0x179)],_0x3e2ef9['activationStepsById'],_0x3e2ef9['journeyById']);await _0x1fa50c(_0x11b041[_0x2b34d9(0x183)](_0x29cbbc=>_0x29cbbc['id']));const _0x47067f=await _0x3e2ef9['deps'][_0x2b34d9(0x1bc)][_0x2b34d9(0xfc)](_0x11b041[0x0][_0x2b34d9(0x19a)]),_0x2a471b=hasMultipleVersions(_0x57ba0f),_0x538bd0=async _0x474944=>{const _0x21ea4b=_0x2b34d9,_0x1005bd=_0x3e2ef9[_0x21ea4b(0x193)]?.[_0x21ea4b(0x119)](_0x474944);if(_0x1005bd)return _0x1005bd;return _0x3e2ef9[_0x21ea4b(0x1ce)]({'journeyId':_0x474944,'journeyName':_0x57ba0f[_0x21ea4b(0x1b3)],'isMultiVersion':_0x11b041[_0x21ea4b(0x173)]>0x1});};if(_0x2a471b&&_0x11b041[_0x2b34d9(0x173)]>0x1){const _0x216123=[];for(const _0x454f4c of _0x11b041){const _0x4b0bf6=_0x454f4c[_0x2b34d9(0x1c7)]||0x1;_0x3e2ef9[_0x2b34d9(0x10d)]?.[_0x2b34d9(0x139)](_0x2b34d9(0x152)+_0x57ba0f['name']+'\x20v'+_0x4b0bf6);const _0x372513=await _0x538bd0(_0x454f4c['id']),_0x44b721=_0x1e8d36(_0x454f4c['id']),_0x4f197d=await journeyResponseToDef(_0x372513,_0x44b721);_0x216123['push']({'item':_0x454f4c,'yaml':_0x4f197d});}const _0x52cc45=buildLocalRuleToNameMappingFromJourney(_0x57ba0f);_0x32a377=buildMergedJourneyDef(_0x216123,_0x52cc45,_0x47067f);const _0x400aca=Math['max'](..._0x216123[_0x2b34d9(0x183)](_0x3eceae=>_0x3eceae[_0x2b34d9(0x10c)][_0x2b34d9(0x1c7)]||0x0)),_0x456fed=_0x11b041[_0x2b34d9(0x15c)](_0x3c9c92=>(_0x3c9c92[_0x2b34d9(0x1c7)]||0x0)===_0x400aca);_0x456fed&&(_0x3e2ef9[_0x2b34d9(0x10d)]?.[_0x2b34d9(0x139)](_0x2b34d9(0x152)+_0x57ba0f[_0x2b34d9(0x1b3)]+'\x20v'+_0x400aca),_0x1a3d62=await _0x538bd0(_0x456fed['id']));}else{const _0x13e424=_0x11b041[_0x11b041[_0x2b34d9(0x173)]-0x1];_0x3e2ef9[_0x2b34d9(0x10d)]?.['update'](_0x2b34d9(0x152)+_0x57ba0f[_0x2b34d9(0x1b3)]),_0x1a3d62=await _0x538bd0(_0x13e424['id']);const _0x676628=_0x1e8d36(_0x13e424['id']),_0x1a1002=await journeyResponseToDef(_0x1a3d62,_0x676628),_0x23bd15=buildLocalRuleToNameMappingFromJourney(_0x57ba0f);_0x32a377=buildMergedJourneyDef([{'item':_0x13e424,'yaml':_0x1a1002}],_0x23bd15,_0x47067f);}}addFoldersToCreate(_0x26d776,_0x3e2ef9[_0x2b34d9(0x18c)],_0x3f58f4);const _0x580584=calculateJourneyDiff(_0x57ba0f,_0x32a377);_0x11800c['push']({'relativePath':_0x57ba0f[_0x2b34d9(0x1b3)],'absolutePath':_0xb6bd75,'yamlConfig':_0x57ba0f,'folderPath':_0x26d776,'existingJourney':_0x1a3d62,'isNew':_0x580584[_0x2b34d9(0x1e2)],'hasChanges':_0x580584[_0x2b34d9(0x171)],'diff':_0x580584['diff']});}return{'journeyFiles':_0x11800c,'foldersToCreate':_0x3f58f4};}export function calculateActivationActions(_0xb10eb5,_0x2c8bbd,_0x2981f1,_0x44715b){const _0x5cb3fa=a152_0x5aba4d,_0x5226b9=[],_0x13d868=new Map();for(const _0x22ae4c of _0x2c8bbd){_0x13d868[_0x5cb3fa(0x132)](_0x22ae4c['name'],_0x22ae4c);}const _0x4a62e6=new Map();for(const _0x594cbc of _0xb10eb5){_0x4a62e6[_0x5cb3fa(0x132)](_0x594cbc['name'],_0x594cbc);}for(const _0x3c441a of _0xb10eb5){const _0x23eff5=_0x13d868[_0x5cb3fa(0x119)](_0x3c441a[_0x5cb3fa(0x1b3)]);if(!_0x23eff5)_0x5226b9[_0x5cb3fa(0x176)]({'type':_0x5cb3fa(0x12e),'name':_0x3c441a[_0x5cb3fa(0x1b3)],'yamlActivation':_0x3c441a});else{const _0x4af5e1=activationResponseToDef(_0x23eff5,_0x2981f1,_0x44715b),_0x2a56a6=a152_0xb08b55[_0x5cb3fa(0xfe)](_0x4af5e1),_0x3e4c52=a152_0xb08b55[_0x5cb3fa(0xfe)](_0x3c441a);_0x2a56a6!==_0x3e4c52&&_0x5226b9[_0x5cb3fa(0x176)]({'type':_0x5cb3fa(0x139),'name':_0x3c441a[_0x5cb3fa(0x1b3)],'yamlActivation':_0x3c441a,'existingActivation':_0x23eff5});}}for(const _0x2d8f38 of _0x2c8bbd){!_0x4a62e6[_0x5cb3fa(0x187)](_0x2d8f38['name'])&&_0x5226b9[_0x5cb3fa(0x176)]({'type':_0x5cb3fa(0x1c8),'name':_0x2d8f38[_0x5cb3fa(0x1b3)],'existingActivation':_0x2d8f38});}return _0x5226b9;}function calculateYamlDiff(_0x130fa3,_0x571cd8){if(_0x571cd8){const _0x2c1e91=generateDiff(_0x571cd8,_0x130fa3),_0x3acddb=hasChanges(_0x2c1e91);return{'isNew':![],'hasChanges':_0x3acddb,'diff':_0x3acddb?formatDiffWithColors(_0x2c1e91):undefined};}const _0x49fa09=generateDiff('',_0x130fa3);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x49fa09)};}export function calculateSegmentDiff(_0x246552,_0x8367c3,_0x313706,_0x293cd3,_0x897d63){const _0x5864d1=segmentToYamlString(_0x246552),_0x2d1ffe=_0x8367c3?segmentToYamlString(segmentWithActivationsToYaml(_0x8367c3,_0x313706,undefined,_0x293cd3,_0x897d63)):undefined;return calculateYamlDiff(_0x5864d1,_0x2d1ffe);}export function calculateJourneyDiff(_0x1a249f,_0x4969ba){const _0x33235b=normalizeJourneyDef(_0x1a249f,_0x1a249f),_0x345eb3=a152_0x5901d2(_0x33235b),_0x391579=_0x4969ba?a152_0x5901d2(normalizeJourneyDef(_0x4969ba,_0x1a249f)):undefined;return calculateYamlDiff(_0x345eb3,_0x391579);}export function findSegmentsToDelete(_0x4142be,_0x23b799,_0x592367,_0x354dd3,_0x57f911){const _0x55d357=a152_0x5aba4d,_0x42f299=new Set();for(const {yamlConfig:_0x198d15,folderPath:_0x20de29}of _0x23b799){_0x42f299[_0x55d357(0x1d0)](_0x20de29+':'+_0x198d15['name']);}return _0x4142be[_0x55d357(0x1a0)](_0x10255e=>{const _0x887682=_0x55d357,_0x5df524=_0x10255e['segmentFolderId']?_0x592367[_0x887682(0x119)](_0x10255e['segmentFolderId'][_0x887682(0x1ae)]())||'':'',_0x2b19c=_0x5df524+':'+_0x10255e['name'];if(_0x42f299[_0x887682(0x187)](_0x2b19c))return![];if(_0x57f911)return _0x5df524===_0x354dd3||_0x5df524[_0x887682(0x109)](_0x354dd3+'/');return!![];});}export function findJourneysToDelete(_0x1ac684,_0x38ef06,_0x2ac426,_0x4007b7,_0x548b1a){const _0x431f49=a152_0x5aba4d,_0x5f28fe=new Set();for(const {yamlConfig:_0x1d7313,folderPath:_0x1e4907}of _0x38ef06){_0x5f28fe[_0x431f49(0x1d0)](_0x1e4907+':'+_0x1d7313[_0x431f49(0x1b3)]);}return _0x1ac684[_0x431f49(0x1a0)](_0x423e91=>{const _0x483b82=_0x431f49,_0x4b9d67=_0x423e91[_0x483b82(0x1a1)]?_0x2ac426[_0x483b82(0x119)](_0x423e91[_0x483b82(0x1a1)])||'':'',_0x1f04b8=_0x4b9d67+':'+_0x423e91['journeyBundleName'];if(_0x5f28fe['has'](_0x1f04b8))return![];if(_0x548b1a)return _0x4b9d67===_0x4007b7||_0x4b9d67['startsWith'](_0x4007b7+'/');return!![];});}export function buildSegmentLookupMap(_0x2b937c,_0x726e82){const _0x1ee1ba=a152_0x5aba4d,_0x34e238=new Map();for(const _0xd33094 of _0x2b937c){const _0x137d7e=_0xd33094[_0x1ee1ba(0x1ac)]?_0x726e82[_0x1ee1ba(0x119)](_0xd33094[_0x1ee1ba(0x1ac)]['toString']())||'':'',_0x176d67=_0x137d7e+':'+_0xd33094[_0x1ee1ba(0x1b3)];_0x34e238[_0x1ee1ba(0x132)](_0x176d67,_0xd33094);}return _0x34e238;}export function buildSegmentNameToIdMap(_0x876ee0){const _0x2b078d=a152_0x5aba4d,_0x4d0eb5=new Map();for(const _0x24367f of _0x876ee0){_0x4d0eb5[_0x2b078d(0x132)](_0x24367f[_0x2b078d(0x1b3)],_0x24367f['id']);}return _0x4d0eb5;}export function buildJourneyBundleLookupMap(_0x3278c6,_0x3f56bc){const _0x4def5a=a152_0x5aba4d,_0x4b120c=new Map();for(const _0x1e6ce4 of _0x3278c6){const _0x14103c=_0x1e6ce4[_0x4def5a(0x1a1)]?_0x3f56bc[_0x4def5a(0x119)](_0x1e6ce4[_0x4def5a(0x1a1)])||'':'',_0x1763fe=_0x14103c+':'+_0x1e6ce4[_0x4def5a(0x169)];!_0x4b120c[_0x4def5a(0x187)](_0x1763fe)&&_0x4b120c[_0x4def5a(0x132)](_0x1763fe,[]),_0x4b120c['get'](_0x1763fe)[_0x4def5a(0x176)](_0x1e6ce4);}for(const _0x588eb3 of _0x4b120c[_0x4def5a(0x17f)]()){_0x588eb3[_0x4def5a(0x192)]((_0x5f3157,_0x5f0a65)=>(_0x5f3157[_0x4def5a(0x1c7)]||0x0)-(_0x5f0a65[_0x4def5a(0x1c7)]||0x0));}return _0x4b120c;}export function collectFoldersToCreate(_0x3b1c3a,_0xc8e66d){const _0x4c9652=a152_0x5aba4d,_0xd1567=new Set();for(const _0x383c5e of _0x3b1c3a){if(!_0x383c5e)continue;if(_0xc8e66d[_0x4c9652(0x187)](_0x383c5e))continue;const _0x33af90=_0x383c5e[_0x4c9652(0x121)]('/');let _0x5f1426='';for(const _0x37e042 of _0x33af90){_0x5f1426=_0x5f1426?_0x5f1426+'/'+_0x37e042:_0x37e042,!_0xc8e66d[_0x4c9652(0x187)](_0x5f1426)&&_0xd1567['add'](_0x5f1426);}}return _0xd1567;}export function parseAndClassifyYamlFiles(_0x5a890b,_0x20a0b6,_0x121e60){const _0x23870e=a152_0x5aba4d,_0x2eb164=[],_0x371fc3=[];for(const _0x49aa00 of _0x5a890b){const _0xf10cc8=a152_0x170dc1['relative'](_0x20a0b6,a152_0x170dc1['dirname'](_0x49aa00)),_0x3aab82=_0xf10cc8==='.'?'':_0xf10cc8,_0xdd146d=readFileSync(_0x49aa00,_0x23870e(0x13e)),_0x340717=a152_0xb08b55[_0x23870e(0x149)](_0xdd146d);if(isJourneyDef(_0x340717)){const _0x2d5651=a152_0x19afe0(_0xdd146d);_0x371fc3[_0x23870e(0x176)]({'yamlConfig':_0x2d5651,'folderPath':_0x3aab82,'sourcePath':_0x49aa00});}else{if(!_0x121e60?.['skipSegments']){const _0x5d9858=parseSegmentYamlFile(_0xdd146d),_0x199a50=normalizeChildSegmentYaml(_0x5d9858);_0x2eb164[_0x23870e(0x176)]({'yamlConfig':_0x199a50,'folderPath':_0x3aab82,'sourcePath':_0x49aa00});}}}return{'segments':_0x2eb164,'journeys':_0x371fc3};}export function validateParsedFiles(_0x974add,_0x1555f6){const _0x23dd38=a152_0x5aba4d,_0x3cf962=[];for(const {yamlConfig:_0x2249b4,sourcePath:_0x50a07a}of _0x974add['segments']){const _0x47a50d=readFileSync(_0x50a07a,_0x23dd38(0x13e)),_0x55d2fe=a152_0xb08b55['parseDocument'](_0x47a50d),_0x18ae77=validateSegmentDef(_0x2249b4,{'source':_0x47a50d,'document':_0x55d2fe},{'skipSchema':!![]});if(!_0x18ae77[_0x23dd38(0x110)]){const _0x24859f=a152_0x170dc1[_0x23dd38(0x197)](_0x1555f6,_0x50a07a);_0x3cf962[_0x23dd38(0x176)]({'filePath':_0x24859f,'source':_0x47a50d,'result':_0x18ae77,'isJourney':![]});}}for(const {yamlConfig:_0x2fca53,sourcePath:_0x37b4ab}of _0x974add[_0x23dd38(0x123)]){const _0x4c3eb0=readFileSync(_0x37b4ab,_0x23dd38(0x13e)),_0x2d1dda=a152_0xb08b55[_0x23dd38(0x168)](_0x4c3eb0),_0x531712=validateJourneyDef(_0x2fca53,{'source':_0x4c3eb0,'document':_0x2d1dda},{'skipSchema':!![]});if(!_0x531712[_0x23dd38(0x110)]){const _0x5d9a23=a152_0x170dc1[_0x23dd38(0x197)](_0x1555f6,_0x37b4ab);_0x3cf962[_0x23dd38(0x176)]({'filePath':_0x5d9a23,'source':_0x4c3eb0,'result':_0x531712,'isJourney':!![]});}}return _0x3cf962;}export function formatValidationErrors(_0x288e02){const _0x1fd3a5=a152_0x5aba4d,_0x126b8b=[];for(const {filePath:_0x53bc0c,source:_0x59278e,result:_0x5edd49,isJourney:_0x390341}of _0x288e02){const _0x137c0f=_0x390341?_0x1fd3a5(0x1bc):'segment';_0x126b8b[_0x1fd3a5(0x176)]('\x0a'+_0x53bc0c+'\x20('+_0x137c0f+_0x1fd3a5(0x1ec)+_0x5edd49['errors']['length']+_0x1fd3a5(0x134)),_0x126b8b[_0x1fd3a5(0x176)](formatValidationResult(_0x5edd49,_0x59278e,_0x53bc0c));}return _0x126b8b[_0x1fd3a5(0x129)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x48e9e6){const _0x3653fd=a152_0x5aba4d,_0x99e53e=new Set(),_0x174e10=new Map(),_0x2e3679=collectSegmentUsageCounts(_0x48e9e6);if(_0x48e9e6[_0x3653fd(0x144)])for(const [_0x1fb924,_0x1c5062]of Object[_0x3653fd(0x127)](_0x48e9e6[_0x3653fd(0x144)])){_0x99e53e[_0x3653fd(0x1d0)](_0x1fb924);if(_0x1c5062['rule']){const _0x45d9e8=yamlRuleToApi(_0x1c5062[_0x3653fd(0x15f)]),_0xb9e826=apiRuleToYaml(_0x45d9e8);_0x174e10['set'](_0x1fb924,_0xb9e826);}}const _0x20257d=new Map();let _0x47104d=0x0;for(const [_0x3ebb99,_0x329cd8]of _0x174e10){const _0x424a13=serializeExpandedRule(_0x329cd8,_0x174e10),_0x25426a=_0x20257d['get'](_0x424a13)||[];_0x25426a[_0x3653fd(0x176)]({'name':_0x3ebb99,'index':_0x47104d}),_0x20257d[_0x3653fd(0x132)](_0x424a13,_0x25426a),_0x47104d++;}const _0x3e48cc=new Map();for(const [_0x51fedd,_0x4aeb78]of _0x20257d){const _0x1da6a0=_0x4aeb78[_0x3653fd(0x154)]()[_0x3653fd(0x192)]((_0x90cf9d,_0x4c3a65)=>{const _0x461588=_0x3653fd,_0x489c51=_0x2e3679[_0x461588(0x119)](_0x90cf9d[_0x461588(0x1b3)])||0x0,_0x418cd5=_0x2e3679[_0x461588(0x119)](_0x4c3a65[_0x461588(0x1b3)])||0x0;if(_0x489c51!==_0x418cd5)return _0x418cd5-_0x489c51;return _0x90cf9d['index']-_0x4c3a65[_0x461588(0x13b)];})[_0x3653fd(0x183)](_0x488691=>_0x488691[_0x3653fd(0x1b3)]),_0x39bd94=[];for(const _0x2ab2f8 of _0x1da6a0){const _0x4f6fef=_0x2e3679['get'](_0x2ab2f8)||0x0,_0x1c517f=Math[_0x3653fd(0x143)](_0x4f6fef,0x1);for(let _0x84b384=0x0;_0x84b384<_0x1c517f;_0x84b384++){_0x39bd94[_0x3653fd(0x176)](_0x2ab2f8);}}_0x3e48cc[_0x3653fd(0x132)](_0x51fedd,_0x39bd94);}return{'existingLocalSegmentNames':_0x99e53e,'localSegmentRules':_0x174e10,'localExpandedRuleToNames':_0x3e48cc};}export function createSegmentIdResolver(_0x276ac2,_0x4b9bc1){return async _0x259ecd=>{const _0x2933c9=a152_0x17bc,_0x19068e=_0x276ac2[_0x2933c9(0x119)](_0x259ecd);if(!_0x19068e)throw new SDKError(ErrorCode[_0x2933c9(0x12d)],_0x2933c9(0xed)+_0x259ecd+_0x2933c9(0x19e)+_0x4b9bc1+'\x27)');return _0x19068e;};}export function extractRootFolderId(_0x6644e3){const _0x1a32f3=a152_0x5aba4d;return _0x6644e3[_0x1a32f3(0x1b6)]?.['parentSegmentFolder']?.[_0x1a32f3(0x170)]?.['id']||_0x6644e3[_0x1a32f3(0x1b6)]?.['parentFolder']?.['data']?.['id'];}export function buildConnectionMaps(_0x573c29){const _0x244611=a152_0x5aba4d,_0x57137e=new Map(),_0x2d5d94=new Map(),_0x3afe70=new Map();for(const _0x535cee of _0x573c29){_0x57137e[_0x244611(0x132)](_0x535cee[_0x244611(0x1b3)],parseInt(_0x535cee['id'],0xa)),_0x2d5d94[_0x244611(0x132)](_0x535cee['id'],_0x535cee[_0x244611(0x1b3)]),_0x3afe70[_0x244611(0x132)](_0x535cee[_0x244611(0x1b3)],_0x535cee[_0x244611(0x120)]);}return{'nameToId':_0x57137e,'idToName':_0x2d5d94,'nameToType':_0x3afe70};}export function calculatePushStats(_0xf86cd2,_0x41a997,_0x52ba1d,_0x306c34,_0x19615c,_0x62fd39,_0x23057f){const _0x31e603=a152_0x5aba4d,_0x53cc3c=_0xf86cd2[_0x31e603(0x1a0)](_0xb0c585=>_0xb0c585[_0x31e603(0x1e2)]),_0x240936=_0xf86cd2[_0x31e603(0x1a0)](_0x4afdd3=>!_0x4afdd3[_0x31e603(0x1e2)]&&_0x4afdd3[_0x31e603(0x171)]),_0x3aecb0=_0xf86cd2[_0x31e603(0x1a0)](_0x26d5c0=>!_0x26d5c0[_0x31e603(0x1e2)]&&!_0x26d5c0[_0x31e603(0x171)]),_0x3f8a32=_0x62fd39?_0x306c34:[],_0x48f6be=_0x41a997['filter'](_0x247a17=>_0x247a17['isNew']),_0x5ad900=_0x41a997[_0x31e603(0x1a0)](_0xadde9b=>!_0xadde9b[_0x31e603(0x1e2)]&&_0xadde9b[_0x31e603(0x171)]),_0x3cead8=_0x41a997[_0x31e603(0x1a0)](_0x5d4834=>!_0x5d4834['isNew']&&!_0x5d4834[_0x31e603(0x171)]),_0x45828d=_0x62fd39?_0x19615c:[],_0x4e2544=_0xf86cd2[_0x31e603(0x128)](_0x2a10fc=>_0x2a10fc[_0x31e603(0x160)]),_0x37a2f1=_0x4e2544[_0x31e603(0x1a0)](_0x349f3a=>_0x349f3a['type']===_0x31e603(0x12e)),_0x1ee7fb=_0x4e2544[_0x31e603(0x1a0)](_0x2eb050=>_0x2eb050['type']===_0x31e603(0x139)),_0x19ec5b=_0x4e2544[_0x31e603(0x1a0)](_0x10c16f=>_0x10c16f['type']===_0x31e603(0x1c8)),_0xd7560b=Array[_0x31e603(0x122)](_0x52ba1d)[_0x31e603(0x192)](),_0x605f9f=_0x23057f?![]:_0x53cc3c['length']>0x0||_0x240936[_0x31e603(0x173)]>0x0||_0x3f8a32['length']>0x0,_0x13d566=_0x48f6be[_0x31e603(0x173)]>0x0||_0x5ad900[_0x31e603(0x173)]>0x0||_0x45828d[_0x31e603(0x173)]>0x0,_0x270434=_0x23057f?![]:_0x4e2544[_0x31e603(0x173)]>0x0,_0x3682bb=_0xd7560b[_0x31e603(0x173)]>0x0;return{'segments':{'new':_0x53cc3c,'changed':_0x240936,'unchanged':_0x3aecb0,'toDelete':_0x3f8a32},'journeys':{'new':_0x48f6be,'changed':_0x5ad900,'unchanged':_0x3cead8,'toDelete':_0x45828d},'activations':{'all':_0x4e2544,'toCreate':_0x37a2f1,'toUpdate':_0x1ee7fb,'toDelete':_0x19ec5b},'folders':{'toCreate':_0xd7560b},'counts':{'segments':{'new':_0x53cc3c[_0x31e603(0x173)],'changed':_0x240936[_0x31e603(0x173)],'unchanged':_0x3aecb0[_0x31e603(0x173)],'toDelete':_0x3f8a32[_0x31e603(0x173)]},'journeys':{'new':_0x48f6be[_0x31e603(0x173)],'changed':_0x5ad900[_0x31e603(0x173)],'unchanged':_0x3cead8[_0x31e603(0x173)],'toDelete':_0x45828d[_0x31e603(0x173)]},'activations':{'create':_0x37a2f1[_0x31e603(0x173)],'update':_0x1ee7fb[_0x31e603(0x173)],'delete':_0x19ec5b[_0x31e603(0x173)]},'folders':_0xd7560b['length']},'hasChanges':_0x605f9f||_0x13d566||_0x270434||_0x3682bb};}export async function buildPushExecutionContext(_0x5403e2,_0x2eff2e,_0x15e47f,_0x341a7e,_0xc5a04b,_0x4ee343){const _0x14443e=a152_0x5aba4d,_0x39b664=extractRootFolderId(_0x15e47f),{pathToId:_0x599e0b,idToPath:_0x5a351a}=buildFolderMaps(_0xc5a04b),_0x513c0d=buildSegmentNameToIdMap(_0x341a7e),_0x479570=new Map(),{batchAsync:_0x33effa}=await import('../../utils/async.js'),[_0x3e69ad,_0x45a96c]=await Promise['all']([_0x5403e2[_0x14443e(0x1ed)][_0x14443e(0x14a)](),_0x5403e2[_0x14443e(0x10b)][_0x14443e(0x137)](),((async()=>{!_0x4ee343&&_0x341a7e['length']>0x0&&await _0x33effa(_0x341a7e,async _0x27a07b=>{const _0x417653=a152_0x17bc,_0x555aed=await _0x5403e2['segment'][_0x417653(0x16a)](_0x2eff2e,_0x27a07b['id']);_0x479570[_0x417653(0x132)](_0x27a07b['id'],_0x555aed);});})())]),{emailToId:_0x872acd,idToEmail:_0x163bd0}=_0x3e69ad,_0x576d37=buildConnectionMaps(_0x45a96c);return{'rootFolderId':_0x39b664,'folderPathToId':_0x599e0b,'folderIdToPath':_0x5a351a,'segmentNameToId':_0x513c0d,'activationsBySegmentId':_0x479570,'emailToIdMap':_0x872acd,'idToEmailMap':_0x163bd0,'connectionNameToIdMap':_0x576d37['nameToId'],'connectionIdToNameMap':_0x576d37[_0x14443e(0xf1)],'connectionNameToTypeMap':_0x576d37[_0x14443e(0x1e4)]};}export function createPushYamlContextForBundle(_0xba1bf4,_0x62c01,_0x55fc27,_0x1f9fe5,_0xa4bf5c,_0x2a1646,_0x3b92f6,_0x262c3d){const {existingLocalSegmentNames:_0x2babff,localExpandedRuleToNames:_0x5dd515}=_0x1f9fe5,_0x170c0c=new Set(),_0x577a5e=new Map(),_0x4500a2=new Map(),_0x12c4b3=new Map(),_0x149f2b=createJumpTargetCache(),_0xd08920=new Map(),_0x2fdb46=new Map(),_0x380a1c=new Set();let _0x28b1ff;const _0x280ba9=_0xa41491=>{const _0x322e8a={'resolveSegment':async _0x4c391f=>{const _0x5d9262=a152_0x17bc,_0x2421ec=_0x12c4b3['get'](_0x4c391f);if(_0x2421ec!==undefined)return{'name':_0x2421ec,'isJourneyLocal':!![]};try{const _0x42b46f=await fetchSegment(_0xba1bf4,_0x62c01,_0x4c391f,_0x55fc27);if(!_0x42b46f)throw new Error(_0x5d9262(0x148));const _0x5908d7=generateJourneyLocalName(_0x42b46f[_0x5d9262(0x1b3)]),_0x1e8cb8=_0x42b46f[_0x5d9262(0x1e0)]===SEGMENT_KIND_JOURNEY&&_0x5908d7!==undefined;let _0xa43e4f=_0x42b46f[_0x5d9262(0x1b3)],_0x282427;if(_0x1e8cb8&&_0x42b46f[_0x5d9262(0x15f)]){const _0x5e8ebc=apiRuleToYaml(_0x42b46f[_0x5d9262(0x15f)]);_0x2fdb46[_0x5d9262(0x132)](_0x4c391f,_0x5e8ebc);const _0x3e68e1=async _0x853825=>{const _0xe2b0a2=_0x5d9262,_0x23a0e7=collectSegmentRefsFromRule(_0x853825);for(const _0x512df0 of _0x23a0e7){if(!_0x2fdb46[_0xe2b0a2(0x187)](_0x512df0))try{const _0xd81384=await fetchSegment(_0xba1bf4,_0x62c01,_0x512df0,_0x55fc27);if(_0xd81384?.['rule']){const _0x3298c4=apiRuleToYaml(_0xd81384[_0xe2b0a2(0x15f)]);_0x2fdb46[_0xe2b0a2(0x132)](_0x512df0,_0x3298c4),await _0x3e68e1(_0x3298c4);}}catch(_0xaa518e){logger['debug'](_0xe2b0a2(0x1e3)+_0x512df0+':\x20'+_0xaa518e);}}};await _0x3e68e1(_0x5e8ebc);const _0x15420f=serializeExpandedRule(_0x5e8ebc,_0x2fdb46),_0x10f1a3=_0x5dd515[_0x5d9262(0x119)](_0x15420f);if(_0x10f1a3&&_0x10f1a3['length']>0x0){const _0x39d31a=_0x577a5e[_0x5d9262(0x119)](_0x15420f)||0x0,_0x48b913=_0x10f1a3[_0x39d31a]||_0x10f1a3[_0x10f1a3['length']-0x1];_0x577a5e[_0x5d9262(0x132)](_0x15420f,_0x39d31a+0x1),_0xa43e4f=_0x48b913,_0x170c0c[_0x5d9262(0x1d0)](_0xa43e4f),_0x12c4b3['set'](_0x4c391f,_0xa43e4f);const _0x4a5e2f=await resolveRuleSegmentRefs(_0x5e8ebc,async _0x4117f7=>{const _0x2710b0=_0x5d9262,_0xe19d5c=_0x12c4b3[_0x2710b0(0x119)](_0x4117f7);if(_0xe19d5c)return _0xe19d5c;const _0x406fb1=await _0x28b1ff['resolveSegment'](_0x4117f7);return _0x406fb1[_0x2710b0(0x1b3)];});_0x282427={'description':_0x42b46f['description'],'rule':_0x4a5e2f};}else{const _0x81c77d=_0xd08920['get'](_0x15420f);if(_0x81c77d)_0xa43e4f=_0x81c77d,_0x12c4b3[_0x5d9262(0x132)](_0x4c391f,_0xa43e4f);else{if(_0x5908d7){let _0x4d5dbe=_0x5908d7,_0x201306=0x2;while(_0x170c0c[_0x5d9262(0x187)](_0x4d5dbe)||_0x2babff[_0x5d9262(0x187)](_0x4d5dbe)){_0x4d5dbe=_0x5908d7+'_'+_0x201306,_0x201306++;}_0x170c0c[_0x5d9262(0x1d0)](_0x4d5dbe),_0xa43e4f=_0x4d5dbe;}_0x12c4b3[_0x5d9262(0x132)](_0x4c391f,_0xa43e4f),_0xd08920['set'](_0x15420f,_0xa43e4f);const _0x51c87d=await resolveRuleSegmentRefs(_0x5e8ebc,async _0x152cff=>{const _0x5bd239=_0x5d9262,_0x4e6abd=_0x12c4b3[_0x5bd239(0x119)](_0x152cff);if(_0x4e6abd)return _0x4e6abd;const _0x2913b4=await _0x28b1ff[_0x5bd239(0x1a2)](_0x152cff);return _0x2913b4['name'];});_0x282427={'description':_0x42b46f[_0x5d9262(0x1d7)],'rule':_0x51c87d};}}}return{'name':_0xa43e4f,'isJourneyLocal':_0x1e8cb8,'definition':_0x282427};}catch(_0x279d3b){return logger[_0x5d9262(0x14c)](_0x5d9262(0x1aa)+_0x4c391f+':\x20'+_0x279d3b),{'name':_0x4c391f,'isJourneyLocal':![]};}},'resolveActivation':async _0x5346ff=>{const _0x375eee=a152_0x17bc,_0x59715d=_0x4500a2[_0x375eee(0x119)](_0x5346ff);if(_0x59715d!==undefined)return{'name':_0x59715d,'isJourneyLocal':!![]};try{let _0x3e127e=_0x3b92f6?.[_0x375eee(0x119)](_0x5346ff);!_0x3e127e&&(_0x3e127e=await _0xba1bf4[_0x375eee(0x1bc)][_0x375eee(0x157)](_0xa41491,_0x5346ff));const _0x485814=_0x3e127e[_0x375eee(0x1d2)][_0x375eee(0x1bd)][_0x375eee(0x1b3)]||_0x5346ff,_0x41587d=sanitizeYamlKey(_0x485814)||_0x375eee(0xee)+_0x5346ff,_0xf1c6da=_0x41587d;_0x4500a2[_0x375eee(0x132)](_0x5346ff,_0xf1c6da);const _0x188b6d=journeyActivationStepToYaml(_0x3e127e,_0xa4bf5c,_0x2a1646);return{'name':_0xf1c6da,'isJourneyLocal':!![],'definition':_0x188b6d};}catch(_0xc6c56d){return logger['debug'](_0x375eee(0x163)+_0x5346ff+':\x20'+_0xc6c56d),{'name':_0x5346ff,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x192d1a,_0x27fc4c)=>resolveJumpTarget(_0x192d1a,_0x27fc4c,_0x149f2b,async _0x1a3971=>{const _0x31bc8a=a152_0x17bc,_0x502366=_0x262c3d?.[_0x31bc8a(0x119)](_0x1a3971);if(_0x502366)return _0x502366;return _0xba1bf4[_0x31bc8a(0x1bc)][_0x31bc8a(0xf8)](_0x1a3971);})};return _0x28b1ff=_0x322e8a,_0x322e8a;},_0x15838e=async _0x48ca9b=>{const _0x53aa0f=a152_0x17bc,{collectSegmentIdsFromJourneyApi:_0x230576}=await import('./journey-yaml.js'),{batchAsync:_0x35ec89}=await import(_0x53aa0f(0x103)),_0x217db1=new Set();for(const _0x1a57ee of _0x48ca9b){let _0x42ecc8=_0x262c3d?.[_0x53aa0f(0x119)](_0x1a57ee);!_0x42ecc8&&(_0x42ecc8=await _0xba1bf4[_0x53aa0f(0x1bc)]['getJourney'](_0x1a57ee));const _0x5ccf74=_0x230576(_0x42ecc8);for(const _0x2170d8 of _0x5ccf74){_0x217db1[_0x53aa0f(0x1d0)](_0x2170d8);}}let _0x3066a6=Array[_0x53aa0f(0x122)](_0x217db1);while(_0x3066a6['length']>0x0){const _0x2d3f9a=_0x3066a6[_0x53aa0f(0x1a0)](_0x55acbf=>!_0x380a1c[_0x53aa0f(0x187)](_0x55acbf));if(_0x2d3f9a[_0x53aa0f(0x173)]===0x0)break;const _0x5ab0a5=await _0x35ec89(_0x2d3f9a,async _0x36f5f2=>{const _0xecc62b=_0x53aa0f;_0x380a1c[_0xecc62b(0x1d0)](_0x36f5f2);const _0x42c103=await fetchSegment(_0xba1bf4,_0x62c01,_0x36f5f2,_0x55fc27);if(!_0x42c103)return null;return{'segmentId':_0x36f5f2,'segment':_0x42c103};},0xa),_0x1fa43a=new Set();for(const _0x1197e2 of _0x5ab0a5){if(!_0x1197e2?.['segment']?.[_0x53aa0f(0x15f)])continue;const _0x5305fe=apiRuleToYaml(_0x1197e2[_0x53aa0f(0x1ad)][_0x53aa0f(0x15f)]);_0x2fdb46[_0x53aa0f(0x132)](_0x1197e2[_0x53aa0f(0x185)],_0x5305fe);const _0x115ffe=collectSegmentRefsFromRule(_0x5305fe);for(const _0x4ab74a of _0x115ffe){!_0x380a1c[_0x53aa0f(0x187)](_0x4ab74a)&&_0x1fa43a[_0x53aa0f(0x1d0)](_0x4ab74a);}}_0x3066a6=Array[_0x53aa0f(0x122)](_0x1fa43a);}};return{'createYamlContext':_0x280ba9,'prefetchJourneySegments':_0x15838e};}export async function executePushSegments(_0x328e2c,_0x5c028d,_0x257e28,_0x2a5a60,_0x96b961){const _0x77c624=a152_0x5aba4d,{segmentDefToCreateRequest:_0x3d699b,segmentDefToUpdateRequest:_0x2bb2c6}=await import(_0x77c624(0x1bb)),_0x5c4fff=_0x257e28[_0x77c624(0x18c)],_0x5e1bd7=0x5,_0xbe2fc2=async _0x20a704=>{const _0x1cba2d=_0x77c624,_0x452387=_0x20a704[_0x1cba2d(0xff)]?_0x5c4fff['get'](_0x20a704['folderPath']):undefined;let _0x9fa652;const _0x331c6b={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x1b0bc2=_0x20a704[_0x1cba2d(0x15b)];if(_0x20a704[_0x1cba2d(0x15b)][_0x1cba2d(0x15f)]){const _0x10be9e=createSegmentIdResolver(_0x257e28[_0x1cba2d(0x1c5)],_0x20a704[_0x1cba2d(0x15b)][_0x1cba2d(0x1b3)]),_0x330d0e=await resolveRuleSegmentIds(_0x20a704[_0x1cba2d(0x15b)]['rule'],_0x10be9e);_0x1b0bc2={..._0x20a704[_0x1cba2d(0x15b)],'rule':_0x330d0e};}try{if(_0x20a704[_0x1cba2d(0x1e2)]){_0x96b961['onProgress']?.({'type':_0x1cba2d(0x10e),'name':_0x20a704[_0x1cba2d(0x15b)][_0x1cba2d(0x1b3)]});const _0x54b913=_0x3d699b(_0x1b0bc2,_0x452387),_0x4fe6d1=await _0x96b961[_0x1cba2d(0x16c)](_0x1cba2d(0x17b)+_0x20a704[_0x1cba2d(0x15b)][_0x1cba2d(0x1b3)]+'\x27...',()=>_0x328e2c[_0x1cba2d(0x1ad)]['createSegment'](_0x2a5a60['parentId'],_0x54b913));_0x9fa652=_0x4fe6d1[_0x1cba2d(0x170)]['id'],_0x257e28[_0x1cba2d(0x1c5)]['set'](_0x20a704[_0x1cba2d(0x15b)]['name'],_0x9fa652),_0x331c6b[_0x1cba2d(0x133)]={'name':_0x20a704['yamlConfig']['name'],'id':_0x9fa652},_0x96b961['onProgress']?.({'type':_0x1cba2d(0x1bf),'name':_0x20a704['yamlConfig'][_0x1cba2d(0x1b3)],'segmentId':_0x9fa652}),_0x96b961[_0x1cba2d(0x17e)]?.(_0x1cba2d(0x186)+_0x20a704[_0x1cba2d(0x15b)][_0x1cba2d(0x1b3)]+'\x27'),_0x331c6b[_0x1cba2d(0x1db)]=0x1;}else{if(_0x20a704[_0x1cba2d(0x171)]){_0x96b961[_0x1cba2d(0x18d)]?.({'type':'segment_updating','name':_0x20a704[_0x1cba2d(0x15b)][_0x1cba2d(0x1b3)]});const _0x47e914=_0x2bb2c6(_0x1b0bc2);_0x452387!==_0x20a704[_0x1cba2d(0x153)]?.[_0x1cba2d(0x1ac)]&&(_0x47e914[_0x1cba2d(0x1ac)]=_0x452387?parseInt(_0x452387,0xa):undefined),await _0x96b961[_0x1cba2d(0x16c)](_0x1cba2d(0x189)+_0x20a704[_0x1cba2d(0x15b)]['name']+_0x1cba2d(0x12f),()=>_0x328e2c[_0x1cba2d(0x1ad)][_0x1cba2d(0x191)](_0x2a5a60[_0x1cba2d(0x13c)],_0x20a704[_0x1cba2d(0x153)]['id'],_0x47e914)),_0x9fa652=_0x20a704['existingSegment']['id'],_0x96b961[_0x1cba2d(0x18d)]?.({'type':_0x1cba2d(0x1c4),'name':_0x20a704[_0x1cba2d(0x15b)][_0x1cba2d(0x1b3)]}),_0x96b961[_0x1cba2d(0x17e)]?.(_0x1cba2d(0x12a)+_0x20a704[_0x1cba2d(0x15b)]['name']+'\x27'),_0x331c6b[_0x1cba2d(0x1c1)]=0x1;}else _0x9fa652=_0x20a704[_0x1cba2d(0x153)]['id'];}}catch(_0x3b59a4){const _0x4f1efb=isHttp400Error(_0x3b59a4),_0x80c41a=_0x4f1efb?ErrorCode['SEGMENT_SYNTAX_ERROR']:ErrorCode['SEGMENT_UPDATE_ERROR'],_0xd9d473=getErrorMessage(_0x3b59a4);throw new SDKError(_0x80c41a,_0x1cba2d(0x1e7)+(_0x20a704[_0x1cba2d(0x1e2)]?_0x1cba2d(0x12e):_0x1cba2d(0x139))+'\x20segment\x20from\x20file:\x20'+_0x20a704[_0x1cba2d(0x1a3)]+'\x0a\x20\x20'+_0xd9d473,_0x3b59a4);}try{const _0x50a0a3=await syncActivationsForSegment(_0x328e2c,_0x2a5a60[_0x1cba2d(0x13c)],_0x9fa652,_0x20a704[_0x1cba2d(0x15b)]['name'],_0x20a704['activationActions'],_0x96b961,_0x20a704[_0x1cba2d(0x1a3)]);_0x331c6b['activations']=_0x50a0a3;}catch(_0x54d7d6){if(_0x54d7d6 instanceof SDKError)throw _0x54d7d6;throw new SDKError(ErrorCode[_0x1cba2d(0x13f)],_0x1cba2d(0x181)+_0x20a704[_0x1cba2d(0x15b)]['name']+_0x1cba2d(0x1c9)+_0x20a704['absolutePath']+_0x1cba2d(0x1c3)+getErrorMessage(_0x54d7d6),_0x54d7d6);}return _0x331c6b;},_0x9301c2=await batchAsync(_0x5c028d,_0xbe2fc2,_0x5e1bd7),_0x46eaec={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x4c6213 of _0x9301c2){_0x46eaec['created']+=_0x4c6213[_0x77c624(0x1db)],_0x46eaec[_0x77c624(0x1c1)]+=_0x4c6213['updated'],_0x4c6213[_0x77c624(0x133)]&&_0x46eaec[_0x77c624(0x136)][_0x77c624(0x132)](_0x4c6213[_0x77c624(0x133)][_0x77c624(0x1b3)],_0x4c6213[_0x77c624(0x133)]['id']),_0x46eaec['activations'][_0x77c624(0x1db)]+=_0x4c6213['activations'][_0x77c624(0x1db)],_0x46eaec[_0x77c624(0xf2)][_0x77c624(0x1c1)]+=_0x4c6213['activations'][_0x77c624(0x1c1)],_0x46eaec['activations'][_0x77c624(0x126)]+=_0x4c6213[_0x77c624(0xf2)]['deleted'];}return _0x46eaec;}async function syncActivationsForSegment(_0x1605c2,_0x4572cc,_0x536eb8,_0x23b3af,_0x264284,_0xc60603,_0x5b70cd){const _0x253307=a152_0x5aba4d,_0x299532={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x4a592e of _0x264284){try{if(_0x4a592e['type']===_0x253307(0x12e)&&_0x4a592e['validatedRequest'])_0xc60603[_0x253307(0x18d)]?.({'type':_0x253307(0x1b7),'segmentName':_0x23b3af,'activationName':_0x4a592e[_0x253307(0x1b3)]}),await _0xc60603[_0x253307(0x16c)](_0x253307(0x135)+_0x4a592e[_0x253307(0x1b3)]+'\x27...',()=>_0x1605c2[_0x253307(0x1ad)]['createActivation'](_0x4572cc,_0x536eb8,_0x4a592e['validatedRequest'])),_0xc60603[_0x253307(0x18d)]?.({'type':_0x253307(0x1dd),'segmentName':_0x23b3af,'activationName':_0x4a592e['name']}),_0xc60603[_0x253307(0x17e)]?.('Created\x20activation\x20\x27'+_0x4a592e[_0x253307(0x1b3)]+'\x27'),_0x299532[_0x253307(0x1db)]++;else{if(_0x4a592e[_0x253307(0x120)]===_0x253307(0x139)&&_0x4a592e['validatedRequest']&&_0x4a592e[_0x253307(0x156)])_0xc60603['onProgress']?.({'type':_0x253307(0x1b1),'segmentName':_0x23b3af,'activationName':_0x4a592e[_0x253307(0x1b3)]}),await _0xc60603[_0x253307(0x16c)](_0x253307(0x1dc)+_0x4a592e[_0x253307(0x1b3)]+_0x253307(0x12f),()=>_0x1605c2[_0x253307(0x1ad)][_0x253307(0x178)](_0x4572cc,_0x536eb8,_0x4a592e['existingActivation']['id'],_0x4a592e[_0x253307(0xfd)])),_0xc60603['onProgress']?.({'type':_0x253307(0x1d1),'segmentName':_0x23b3af,'activationName':_0x4a592e[_0x253307(0x1b3)]}),_0xc60603[_0x253307(0x17e)]?.(_0x253307(0x112)+_0x4a592e[_0x253307(0x1b3)]+'\x27'),_0x299532[_0x253307(0x1c1)]++;else _0x4a592e[_0x253307(0x120)]===_0x253307(0x1c8)&&_0x4a592e[_0x253307(0x156)]&&(_0xc60603[_0x253307(0x18d)]?.({'type':_0x253307(0xf6),'segmentName':_0x23b3af,'activationName':_0x4a592e[_0x253307(0x1b3)]}),await _0xc60603[_0x253307(0x16c)]('Deleting\x20activation\x20\x27'+_0x4a592e['name']+_0x253307(0x12f),()=>_0x1605c2['segment'][_0x253307(0xfa)](_0x4572cc,_0x536eb8,_0x4a592e[_0x253307(0x156)]['id'])),_0xc60603[_0x253307(0x18d)]?.({'type':'activation_deleted','segmentName':_0x23b3af,'activationName':_0x4a592e['name']}),_0xc60603[_0x253307(0x1b4)]?.(_0x253307(0x1b2)+_0x4a592e[_0x253307(0x1b3)]+'\x27'),_0x299532['deleted']++);}}catch(_0x58ed16){const _0x4f56f7=isHttp400Error(_0x58ed16),_0x472c6b=_0x4f56f7?ErrorCode[_0x253307(0x161)]:ErrorCode[_0x253307(0x13f)],_0x193bbe=getErrorMessage(_0x58ed16);throw new SDKError(_0x472c6b,_0x253307(0x1e7)+_0x4a592e['type']+_0x253307(0x147)+_0x4a592e[_0x253307(0x1b3)]+_0x253307(0x1c9)+_0x5b70cd+_0x253307(0x1c3)+_0x193bbe,_0x58ed16);}}return _0x299532;}export async function executePushFolders(_0x2c243e,_0x126471,_0x52d3f0,_0x3f264b,_0x286d04){const _0x403c03=a152_0x5aba4d,_0x4e41d7=new Map(_0x52d3f0),_0x2d19f5=sortFoldersByDepth(_0x126471);for(const _0x35ed92 of _0x2d19f5){const _0x3dde1c=_0x35ed92[_0x403c03(0x121)]('/'),_0x5a1b88=_0x3dde1c[_0x3dde1c[_0x403c03(0x173)]-0x1],_0x2ba97c=_0x3dde1c['slice'](0x0,-0x1)['join']('/'),_0x1ee237=_0x4e41d7['get'](_0x2ba97c);_0x286d04[_0x403c03(0x18d)]?.({'type':'folder_creating','folder':_0x35ed92});const _0x3fabad={'name':_0x5a1b88,'parentFolderId':_0x1ee237},_0x4d5a04=await _0x286d04[_0x403c03(0x16c)]('Creating\x20folder\x20\x27'+_0x35ed92+'\x27...',()=>_0x2c243e['segment'][_0x403c03(0x11a)](_0x3f264b[_0x403c03(0x13c)],_0x3fabad));_0x4e41d7[_0x403c03(0x132)](_0x35ed92,_0x4d5a04[_0x403c03(0x170)]['id']),_0x286d04[_0x403c03(0x18d)]?.({'type':_0x403c03(0x1b0),'folder':_0x35ed92,'folderId':_0x4d5a04[_0x403c03(0x170)]['id']}),_0x286d04[_0x403c03(0x198)]?.(_0x403c03(0x111)+_0x35ed92+'\x27');}return _0x4e41d7;}export async function executePushSegmentDeletions(_0xfa769a,_0x3a666f,_0x1f98e7){const _0x562f0c=a152_0x5aba4d;if(_0x3a666f[_0x562f0c(0x173)]===0x0)return 0x0;const {batchAsync:_0x1f6748}=await import('../../utils/async.js'),_0x56db03=0x5,_0x52985f=await _0x1f6748(_0x3a666f,async _0xf54ca1=>{const _0x482b00=_0x562f0c;return _0x1f98e7[_0x482b00(0x18d)]?.({'type':_0x482b00(0x105),'name':_0xf54ca1['name']}),await _0xfa769a[_0x482b00(0x1ad)]['deleteSegment'](_0xf54ca1['id']),_0x1f98e7[_0x482b00(0x18d)]?.({'type':_0x482b00(0x1b9),'name':_0xf54ca1[_0x482b00(0x1b3)]}),_0x1f98e7[_0x482b00(0x1b4)]?.(_0x482b00(0x1ca)+_0xf54ca1[_0x482b00(0x1b3)]+'\x27'),0x1;},_0x56db03);return _0x52985f['reduce']((_0x5a61f3,_0xdd621c)=>_0x5a61f3+_0xdd621c,0x0);}export async function executePushJourneys(_0x48b7cb,_0xa81c2f,_0x504612,_0x517495,_0x59df95){const _0x8d64=a152_0x5aba4d,{journeyDefToRequest:_0x51c156}=await import(_0x8d64(0x17d)),{activationDefToCreateRequest:_0x3304f8,yamlRuleToApi:_0x3c08f0,validateSegmentRule:_0xf19da}=await import(_0x8d64(0x1bb)),_0x2f4be6={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x528d1e=new Map(_0x504612[_0x8d64(0x1c5)]),_0x524071=0x5;for(let _0x41fad=0x0;_0x41fad<_0xa81c2f[_0x8d64(0x173)];_0x41fad+=_0x524071){const _0x4ae85b=_0xa81c2f[_0x8d64(0x154)](_0x41fad,_0x41fad+_0x524071),_0x48cdf4=await Promise['all'](_0x4ae85b[_0x8d64(0x183)](async _0x21dc7f=>{const _0x507c68=_0x8d64;if(!_0x21dc7f[_0x507c68(0x1e2)]&&!_0x21dc7f[_0x507c68(0x171)])return{'action':_0x507c68(0x13a),'name':_0x21dc7f[_0x507c68(0x15b)][_0x507c68(0x1b3)],'journeyId':_0x21dc7f[_0x507c68(0x10f)]?.['id']};const _0x1bda5a=_0x21dc7f[_0x507c68(0xff)]?_0x504612['folderPathToId'][_0x507c68(0x119)](_0x21dc7f['folderPath']):undefined;_0x59df95[_0x507c68(0x18d)]?.({'type':_0x21dc7f['isNew']?'journey_creating':_0x507c68(0x14b),'name':_0x21dc7f[_0x507c68(0x15b)]['name']});try{const _0x3cb060=await executeSingleJourneyPush(_0x48b7cb,_0x21dc7f,{..._0x504612,'segmentNameToId':_0x528d1e},{'parentId':_0x517495[_0x507c68(0x13c)],'rootFolderId':_0x517495['rootFolderId'],'folderId':_0x1bda5a,'verbose':_0x517495[_0x507c68(0x166)]},_0x59df95,{'journeyDefToRequest':_0x51c156,'activationDefToCreateRequest':_0x3304f8,'yamlRuleToApi':_0x3c08f0,'validateSegmentRule':_0xf19da});for(const [_0xcc3a30,_0x5f47c1]of _0x3cb060[_0x507c68(0x1c0)]){_0x528d1e[_0x507c68(0x132)](_0xcc3a30,_0x5f47c1),_0x2f4be6[_0x507c68(0x1c0)]['set'](_0xcc3a30,_0x5f47c1);}if(_0x3cb060[_0x507c68(0x16f)]===_0x507c68(0x1db))_0x59df95[_0x507c68(0x18d)]?.({'type':'journey_created','name':_0x21dc7f[_0x507c68(0x15b)]['name'],'journeyId':_0x3cb060[_0x507c68(0x1c6)]}),_0x59df95['logSuccess']?.(_0x507c68(0x16b)+_0x21dc7f[_0x507c68(0x15b)][_0x507c68(0x1b3)]+'\x27'),_0x2f4be6[_0x507c68(0x1db)]++;else _0x3cb060[_0x507c68(0x16f)]===_0x507c68(0x1c1)&&(_0x59df95['onProgress']?.({'type':'journey_updated','name':_0x21dc7f[_0x507c68(0x15b)][_0x507c68(0x1b3)]}),_0x59df95['logSuccess']?.('Updated\x20journey\x20\x27'+_0x21dc7f[_0x507c68(0x15b)][_0x507c68(0x1b3)]+'\x27'),_0x2f4be6['updated']++);return{'action':_0x3cb060[_0x507c68(0x16f)],'name':_0x21dc7f[_0x507c68(0x15b)][_0x507c68(0x1b3)],'journeyId':_0x3cb060[_0x507c68(0x1c6)]};}catch(_0x314c4f){const _0x55b6e0=isHttp400Error(_0x314c4f),_0x4584b9=_0x55b6e0?ErrorCode[_0x507c68(0x14e)]:ErrorCode[_0x507c68(0x1af)],_0x785550=getErrorMessage(_0x314c4f);throw new SDKError(_0x4584b9,_0x507c68(0x1e7)+(_0x21dc7f[_0x507c68(0x1e2)]?_0x507c68(0x12e):_0x507c68(0x139))+_0x507c68(0x117)+_0x21dc7f[_0x507c68(0x1a3)]+_0x507c68(0x1c3)+_0x785550,_0x314c4f);}}));_0x2f4be6[_0x8d64(0x180)][_0x8d64(0x176)](..._0x48cdf4);}return _0x2f4be6;}async function matchExistingJourneySegments(_0x57ed2e,_0x23e7b0,_0x70d506,_0x25e7cf,_0x5658e1){const _0x5225e7=a152_0x5aba4d;if(!_0x23e7b0[_0x5225e7(0x10f)]||!_0x23e7b0[_0x5225e7(0x15b)][_0x5225e7(0x144)])return;const _0x534aa7=new Map(),_0x5958f5=new Set();for(const _0x5e4d62 of Object[_0x5225e7(0x164)](_0x23e7b0[_0x5225e7(0x15b)][_0x5225e7(0x144)])){const _0x2296de=generateDeterministicJourneySegmentName(_0x23e7b0[_0x5225e7(0x15b)][_0x5225e7(0x1b3)],_0x5e4d62);_0x534aa7[_0x5225e7(0x132)](_0x2296de,_0x5e4d62),_0x5958f5[_0x5225e7(0x1d0)](_0x5e4d62);}const _0x27438e=[],_0x119d1f=collectSegmentIdsFromJourneyApi(_0x23e7b0['existingJourney']);for(const _0x3f25b5 of _0x119d1f){const _0xf17120=await fetchSegment(_0x57ed2e,_0x70d506,_0x3f25b5,_0x25e7cf);if(!_0xf17120?.['name'])continue;const _0x2c9af9=_0x534aa7[_0x5225e7(0x119)](_0xf17120[_0x5225e7(0x1b3)]);_0x2c9af9?(_0x5658e1['set'](_0x2c9af9,_0x3f25b5),_0x5958f5[_0x5225e7(0x1c8)](_0x2c9af9)):_0x27438e[_0x5225e7(0x176)]({'id':_0x3f25b5,'seg':_0xf17120});}if(_0x5958f5[_0x5225e7(0x151)]>0x0&&_0x27438e['length']>0x0){const {localExpandedRuleToNames:_0x1abadb}=buildLocalExpandedRuleMappings(_0x23e7b0[_0x5225e7(0x15b)]),_0xe15124=new Map();for(const {id:_0xf499dc,seg:_0x468af3}of _0x27438e){if(_0x468af3[_0x5225e7(0x15f)]){const _0x586386=apiRuleToYaml(_0x468af3[_0x5225e7(0x15f)]);_0xe15124['set'](_0xf499dc,_0x586386);}}for(const {id:_0x4c2f91,seg:_0x465962}of _0x27438e){if(!_0x465962[_0x5225e7(0x15f)])continue;const _0x144c5e=_0xe15124[_0x5225e7(0x119)](_0x4c2f91);if(!_0x144c5e)continue;const _0x1f2ffe=serializeExpandedRule(_0x144c5e,_0xe15124),_0x55cc00=_0x1abadb[_0x5225e7(0x119)](_0x1f2ffe);if(_0x55cc00){const _0x351c11=_0x55cc00[_0x5225e7(0x15c)](_0x3be1c6=>_0x5958f5['has'](_0x3be1c6));_0x351c11&&(_0x5658e1[_0x5225e7(0x132)](_0x351c11,_0x4c2f91),_0x5958f5[_0x5225e7(0x1c8)](_0x351c11),logger[_0x5225e7(0x14c)](_0x5225e7(0x131)+_0x465962[_0x5225e7(0x1b3)]+'\x27\x20to\x20local\x20\x27'+_0x351c11+'\x27\x20by\x20rule\x20content'));}}}}async function executeSingleJourneyPush(_0x3415f4,_0xa7750e,_0x58f82f,_0x3166a1,_0x11445a,_0xb7a290){const _0x3e17d9=a152_0x5aba4d,{journeyDefToRequest:_0x3910a9,activationDefToCreateRequest:_0x454ed3,yamlRuleToApi:_0x40726a,validateSegmentRule:_0xb37332}=_0xb7a290,_0x116f4f=new Map(),_0x4be250=new Map();recoverSegmentIdsFromPushRecovery(_0xa7750e,_0x116f4f,_0x58f82f['segmentNameToId']);const _0x2d9c92=new Map(),_0x5b0f79=new Map(),_0x24031d=new Map();let _0x331871;const _0x3f7a05=async()=>{const _0x1ec50f=a152_0x17bc;if(_0x331871)return;_0x331871=new Map();if(!_0xa7750e[_0x1ec50f(0x10f)])return;const _0x188538=await _0x3415f4[_0x1ec50f(0x1bc)][_0x1ec50f(0x16a)](_0xa7750e[_0x1ec50f(0x10f)]['id']);for(const _0x45ef7d of _0x188538){const _0x4189ae=journeyActivationStepToYaml(_0x45ef7d,_0x58f82f[_0x1ec50f(0x162)],_0x58f82f['connectionIdToNameMap']),_0x5b1dca=activationSignature(_0x4189ae);!_0x331871['has'](_0x5b1dca)&&_0x331871[_0x1ec50f(0x132)](_0x5b1dca,_0x45ef7d['id']),_0x4189ae[_0x1ec50f(0x1b3)]&&_0x4be250[_0x1ec50f(0x132)](_0x4189ae['name'],_0x45ef7d['id']);}};await matchExistingJourneySegments(_0x3415f4,_0xa7750e,_0x3166a1['parentId'],_0x58f82f['existingSegments'],_0x58f82f[_0x3e17d9(0x1c5)]);const _0x59631a={'resolveSegmentId':async _0x34c8a2=>{const _0xa00d08=_0x3e17d9,_0x3bd103=_0x58f82f[_0xa00d08(0x1c5)][_0xa00d08(0x119)](_0x34c8a2);if(!_0x3bd103)throw new SDKError(ErrorCode[_0xa00d08(0x12d)],'Segment\x20not\x20found:\x20'+_0x34c8a2+_0xa00d08(0x1c2)+_0xa7750e['yamlConfig'][_0xa00d08(0x1b3)]+')');return _0x3bd103;},'resolveEmbeddedSegmentId':async(_0xb7b8a8,_0x1a441c)=>{const _0x1f534d=_0x3e17d9,_0x2e6ea5=_0x58f82f[_0x1f534d(0x1c5)][_0x1f534d(0x119)](_0xb7b8a8);if(_0x2e6ea5)return _0x2e6ea5;const _0x3b3022=_0x58f82f[_0x1f534d(0xf7)][_0x1f534d(0x15c)](_0x11560f=>_0x11560f['name']===_0xb7b8a8);if(_0x3b3022)return _0x58f82f['segmentNameToId']['set'](_0xb7b8a8,_0x3b3022['id']),_0x3b3022['id'];if(_0xa7750e[_0x1f534d(0x1e2)]){const {stageName:_0x22c6ce,criteriaName:_0x405acd}=findSegmentCriteriaLocation(_0xa7750e['yamlConfig'],_0xb7b8a8);return _0xb37332(_0xb7b8a8,_0x1a441c[_0x1f534d(0x15f)]),_0x5b0f79[_0x1f534d(0x132)](_0xb7b8a8,{'definition':_0x1a441c,'stageName':_0x22c6ce,'criteriaName':_0x405acd}),createPendingSegmentId(_0xb7b8a8);}const _0x149aa9=_0xa7750e['existingJourney']?.['id'];if(!_0x149aa9)throw new SDKError(ErrorCode['INTERNAL'],_0x1f534d(0x130));const _0x35fccc=_0x2d9c92[_0x1f534d(0x119)](_0xb7b8a8);if(_0x35fccc)return _0x35fccc;const _0x4ad40c=((async()=>{const _0x4eada9=_0x1f534d;_0xb37332(_0xb7b8a8,_0x1a441c[_0x4eada9(0x15f)]);const _0x49552a=generateDeterministicJourneySegmentName(_0xa7750e[_0x4eada9(0x15b)]['name'],_0xb7b8a8),_0x5cb952=_0x58f82f[_0x4eada9(0xf7)][_0x4eada9(0x15c)](_0x5b806e=>_0x5b806e[_0x4eada9(0x1b3)]===_0x49552a),_0xe62553=createSegmentIdResolver(_0x58f82f[_0x4eada9(0x1c5)],_0xb7b8a8),_0x2ed746=await resolveRuleSegmentIds(_0x1a441c[_0x4eada9(0x15f)],_0xe62553);let _0x2a8753;return _0x5cb952?(await _0x3415f4[_0x4eada9(0x1ad)][_0x4eada9(0x191)](_0x3166a1[_0x4eada9(0x13c)],_0x5cb952['id'],{'description':_0x1a441c[_0x4eada9(0x1d7)]||'Entry\x20criteria:\x20'+_0xb7b8a8,'rule':_0x40726a(_0x2ed746,!![]),'countPopulation':!![]}),_0x2a8753=_0x5cb952['id'],saveSegmentToPushRecovery(_0xa7750e[_0x4eada9(0x1a3)],_0xa7750e[_0x4eada9(0x15b)][_0x4eada9(0x1b3)],_0xb7b8a8,{'segmentId':_0x2a8753,'uniqueServerName':_0x49552a,'createdAt':new Date()[_0x4eada9(0x1cc)]()})):_0x2a8753=await createOrRecoverEmbeddedSegment(_0x3415f4,_0xa7750e,{'localName':_0xb7b8a8,'uniqueSegmentName':_0x49552a,'description':_0x1a441c[_0x4eada9(0x1d7)]||_0x4eada9(0x1a7)+_0xb7b8a8,'journeyId':_0x149aa9,'resolvedRule':_0x2ed746,'parentId':_0x3166a1['parentId'],'folderId':_0x3166a1['rootFolderId']||''},_0x40726a),_0x58f82f['segmentNameToId'][_0x4eada9(0x132)](_0xb7b8a8,_0x2a8753),_0x116f4f['set'](_0xb7b8a8,_0x2a8753),_0x2a8753;})());_0x2d9c92['set'](_0xb7b8a8,_0x4ad40c);try{return await _0x4ad40c;}finally{_0x2d9c92[_0x1f534d(0x1c8)](_0xb7b8a8);}},'resolveActivationId':async _0x183a4f=>{const _0x19f17c=_0x3e17d9,_0x540ac4=_0x4be250[_0x19f17c(0x119)](_0x183a4f);if(_0x540ac4)return _0x540ac4;if(_0xa7750e[_0x19f17c(0x10f)]){await _0x3f7a05();const _0x4b185f=_0x4be250['get'](_0x183a4f);if(_0x4b185f)return _0x4b185f;}throw new SDKError(ErrorCode[_0x19f17c(0x19b)],_0x19f17c(0x19c)+_0x183a4f+'\x20(referenced\x20in\x20journey\x20'+_0xa7750e['yamlConfig'][_0x19f17c(0x1b3)]+_0x19f17c(0x11f)+_0x19f17c(0x18e));},'resolveEmbeddedActivationId':async(_0x11653f,_0x42cd18)=>{const _0x1c89bc=_0x3e17d9,_0x5ba6ad=_0x4be250[_0x1c89bc(0x119)](_0x11653f);if(_0x5ba6ad)return _0x5ba6ad;if(_0xa7750e[_0x1c89bc(0x1e2)])return _0x24031d[_0x1c89bc(0x132)](_0x11653f,_0x42cd18),createPendingActivationId(_0x11653f);if(_0xa7750e[_0x1c89bc(0x10f)]){await _0x3f7a05();const _0x7e6916=_0x4be250[_0x1c89bc(0x119)](_0x42cd18[_0x1c89bc(0x1b3)]);if(_0x7e6916)return _0x4be250['set'](_0x11653f,_0x7e6916),_0x7e6916;const _0x6b62c2=activationSignature(_0x42cd18),_0x5b071f=_0x331871?.[_0x1c89bc(0x119)](_0x6b62c2);if(_0x5b071f)return _0x4be250[_0x1c89bc(0x132)](_0x11653f,_0x5b071f),_0x5b071f;const _0x281a73=await _0x454ed3(_0x42cd18,_0x58f82f[_0x1c89bc(0x12c)]),_0x1dbda3={..._0x281a73,..._0x42cd18[_0x1c89bc(0x1d4)]!==undefined&&{'runAfterJourneyRefresh':_0x42cd18[_0x1c89bc(0x1d4)]}},_0xd04ef1=await _0x3415f4[_0x1c89bc(0x1bc)][_0x1c89bc(0x199)](_0xa7750e[_0x1c89bc(0x10f)]['id'],_0x1dbda3);return _0x4be250['set'](_0x11653f,_0xd04ef1['id']),_0xd04ef1['id'];}throw new SDKError(ErrorCode[_0x1c89bc(0x1d5)],_0x1c89bc(0xeb));},'resolveJourneyId':async _0x47948f=>{const _0x577af2=_0x3e17d9;try{return await _0x3415f4['journey'][_0x577af2(0x15a)](_0x3166a1['parentId'],_0x47948f);}catch(_0x25975d){throw new SDKError(ErrorCode['NOT_FOUND'],'Journey\x20\x27'+_0x47948f+'\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27'+_0xa7750e[_0x577af2(0x15b)][_0x577af2(0x1b3)]+'\x27)',_0x25975d);}},'resolveStageId':async(_0xfc9f3,_0x410a98)=>{const _0x511408=_0x3e17d9,_0x510433=await _0x3415f4[_0x511408(0x1bc)][_0x511408(0xf8)](_0xfc9f3),_0x305e9c=_0x510433[_0x511408(0x1d2)][_0x511408(0x1be)][_0x511408(0x15c)](_0x25097c=>_0x25097c[_0x511408(0x1b3)][_0x511408(0x174)]()===_0x410a98[_0x511408(0x174)]());if(!_0x305e9c?.['id'])throw new SDKError(ErrorCode[_0x511408(0x19b)],_0x511408(0x1b5)+_0x410a98+_0x511408(0x1a8)+(_0x510433[_0x511408(0x1d2)][_0x511408(0x169)]||_0x510433['attributes']['name'])+'\x27');return _0x305e9c['id'];}},_0x145ff8=await _0x3910a9(_0xa7750e[_0x3e17d9(0x15b)],_0x3166a1[_0x3e17d9(0x13c)],_0x59631a),_0x5e5e90=_0x3166a1[_0x3e17d9(0x1a1)]||_0x3166a1[_0x3e17d9(0x182)];_0x5e5e90&&(_0x145ff8[_0x3e17d9(0x1b6)]={'parentFolder':{'data':{'id':_0x5e5e90,'type':'folder'}}});if(_0xa7750e['isNew']){if(_0x5b0f79[_0x3e17d9(0x151)]>0x0||_0x24031d[_0x3e17d9(0x151)]>0x0)return await executeThreeStepJourneyCreate(_0x3415f4,_0xa7750e,_0x145ff8,{'pendingEmbeddedSegments':_0x5b0f79,'pendingEmbeddedActivations':_0x24031d,'embeddedSegmentNameToId':_0x116f4f,'journeyActivationNameToId':_0x4be250},{..._0x3166a1,'effectiveFolderId':_0x5e5e90},_0x58f82f,_0x11445a,_0xb7a290);else{ensureJourneyDefaults(_0x145ff8[_0x3e17d9(0x1d2)]);const _0x204c4d=await _0x3415f4[_0x3e17d9(0x1bc)][_0x3e17d9(0x12e)](_0x145ff8);return deletePushRecovery(_0xa7750e[_0x3e17d9(0x1a3)]),{'action':_0x3e17d9(0x1db),'journeyId':_0x204c4d['id'],'embeddedSegmentNameToId':_0x116f4f};}}else{if(_0xa7750e[_0x3e17d9(0x171)]&&_0xa7750e[_0x3e17d9(0x10f)]){_0x145ff8['id']=_0xa7750e[_0x3e17d9(0x10f)]['id'];const _0x519291=_0x145ff8['attributes'];_0xa7750e[_0x3e17d9(0x10f)][_0x3e17d9(0x1d2)]?.['journeyBundleName']&&(_0x519291['journeyBundleName']=_0xa7750e[_0x3e17d9(0x10f)][_0x3e17d9(0x1d2)][_0x3e17d9(0x169)]);const _0x5d5bd6=_0xa7750e['existingJourney'][_0x3e17d9(0x1d2)]?.[_0x3e17d9(0x1be)];return _0x5d5bd6&&_0x145ff8[_0x3e17d9(0x1d2)][_0x3e17d9(0x1be)]&&injectExistingStageIds(_0x145ff8[_0x3e17d9(0x1d2)][_0x3e17d9(0x1be)],_0x5d5bd6),ensureJourneyDefaults(_0x519291),await _0x3415f4[_0x3e17d9(0x1bc)][_0x3e17d9(0x139)](_0xa7750e['existingJourney']['id'],_0x145ff8),deletePushRecovery(_0xa7750e[_0x3e17d9(0x1a3)]),{'action':'updated','journeyId':_0xa7750e[_0x3e17d9(0x10f)]['id'],'embeddedSegmentNameToId':_0x116f4f};}}return deletePushRecovery(_0xa7750e[_0x3e17d9(0x1a3)]),{'action':_0x3e17d9(0x13a),'journeyId':_0xa7750e[_0x3e17d9(0x10f)]?.['id'],'embeddedSegmentNameToId':_0x116f4f};}function findSegmentCriteriaLocation(_0x3cae97,_0x2bfded){const _0x15d06c=a152_0x5aba4d,_0x270495=_0x3cae97[_0x15d06c(0x1e8)]||_0x3cae97[_0x15d06c(0x123)]?.[0x0]?.['stages']||[];let _0x44c86e=_0x15d06c(0x1df),_0x2b6623=_0x2bfded;const _0x27ddf5=_0x3cae97[_0x15d06c(0x1a5)]||_0x3cae97['journeys']?.[0x0]?.[_0x15d06c(0x1a5)];if(_0x27ddf5?.[_0x15d06c(0x1ad)]===_0x2bfded)return{'stageName':'goal','criteriaName':_0x27ddf5[_0x15d06c(0x1b3)]||_0x2bfded};_0x39d9d4:for(const _0x11da38 of _0x270495){if(_0x11da38['entry_criteria']?.[_0x15d06c(0x1ad)]===_0x2bfded){_0x44c86e=_0x11da38[_0x15d06c(0x1b3)],_0x2b6623=_0x11da38['entry_criteria'][_0x15d06c(0x1b3)]||_0x2bfded;break;}if(_0x11da38['steps'])for(const _0x3a4c9f of _0x11da38[_0x15d06c(0x16e)]){if(_0x3a4c9f['type']===_0x15d06c(0x115)&&_0x3a4c9f[_0x15d06c(0x1ba)]?.[_0x15d06c(0x195)])for(const _0x304c73 of _0x3a4c9f[_0x15d06c(0x1ba)]['branches']){if(_0x304c73[_0x15d06c(0x1ad)]===_0x2bfded){_0x44c86e=_0x11da38[_0x15d06c(0x1b3)],_0x2b6623=_0x304c73[_0x15d06c(0x1b3)]||_0x2bfded;break _0x39d9d4;}}}}return{'stageName':_0x44c86e,'criteriaName':_0x2b6623};}async function executeThreeStepJourneyCreate(_0x2301be,_0x2ea10f,_0x11fd91,_0x2216d2,_0x4655b4,_0x1ff2c0,_0x56e045,_0x1b56ec){const _0x403911=a152_0x5aba4d,{activationDefToCreateRequest:_0x129659,yamlRuleToApi:_0xcd84f9}=_0x1b56ec,{pendingEmbeddedSegments:_0x23b19c,pendingEmbeddedActivations:_0x22f6b2,embeddedSegmentNameToId:_0x2157b7}=_0x2216d2,_0x2e3598=JSON['parse'](JSON[_0x403911(0xfe)](_0x11fd91));ensureJourneyDefaults(_0x2e3598[_0x403911(0x1d2)]),stripPendingIds(_0x2e3598);const _0x4d5c5b=await _0x2301be[_0x403911(0x1bc)]['create'](_0x2e3598),_0x1768b6=_0x4d5c5b['id'],_0x3f7d4f=new Map();for(const _0x99e74 of _0x4d5c5b[_0x403911(0x1d2)]['journeyStages']){_0x3f7d4f[_0x403911(0x132)](_0x99e74[_0x403911(0x1b3)][_0x403911(0x174)](),_0x99e74['id']);}recoverSegmentIdsFromPushRecovery(_0x2ea10f,_0x2157b7,_0x1ff2c0['segmentNameToId']);for(const [_0x32fb41,{definition:_0x255cef}]of _0x23b19c){if(_0x2157b7['has'](_0x32fb41)){_0x56e045[_0x403911(0x18d)]?.({'type':_0x403911(0xec),'journeyName':_0x2ea10f[_0x403911(0x15b)][_0x403911(0x1b3)],'segmentName':_0x32fb41});continue;}const _0x37b8d7=generateDeterministicJourneySegmentName(_0x2ea10f[_0x403911(0x15b)][_0x403911(0x1b3)],_0x32fb41);_0x56e045['onProgress']?.({'type':'embedded_segment_creating','journeyName':_0x2ea10f[_0x403911(0x15b)][_0x403911(0x1b3)],'segmentName':_0x32fb41});const _0x16812d=createSegmentIdResolver(_0x1ff2c0[_0x403911(0x1c5)],_0x32fb41),_0x32292c=await resolveRuleSegmentIds(_0x255cef['rule'],_0x16812d),_0x2aacd7=await createOrRecoverEmbeddedSegment(_0x2301be,_0x2ea10f,{'localName':_0x32fb41,'uniqueSegmentName':_0x37b8d7,'description':_0x255cef[_0x403911(0x1d7)]||'Entry\x20criteria:\x20'+_0x32fb41,'journeyId':_0x1768b6,'resolvedRule':_0x32292c,'parentId':_0x4655b4[_0x403911(0x13c)],'folderId':_0x4655b4[_0x403911(0x1ea)]||''},_0xcd84f9);_0x2157b7[_0x403911(0x132)](_0x32fb41,_0x2aacd7),_0x1ff2c0[_0x403911(0x1c5)][_0x403911(0x132)](_0x32fb41,_0x2aacd7),_0x56e045[_0x403911(0x18d)]?.({'type':'embedded_segment_created','journeyName':_0x2ea10f['yamlConfig'][_0x403911(0x1b3)],'segmentName':_0x32fb41});}const _0x1f5555=new Map();for(const [_0x21a3d3,_0x334126]of _0x22f6b2){_0x56e045['onProgress']?.({'type':_0x403911(0x1de),'journeyName':_0x2ea10f[_0x403911(0x15b)][_0x403911(0x1b3)],'activationName':_0x21a3d3});const _0x36d8a4=await _0x129659(_0x334126,_0x1ff2c0[_0x403911(0x12c)]),_0x3eb0a0={..._0x36d8a4,..._0x334126[_0x403911(0x1d4)]!==undefined&&{'runAfterJourneyRefresh':_0x334126['run_after_journey_refresh']}},_0x19fb15=await _0x2301be['journey'][_0x403911(0x199)](_0x1768b6,_0x3eb0a0);_0x1f5555[_0x403911(0x132)](_0x21a3d3,_0x19fb15['id']),_0x2216d2[_0x403911(0x190)][_0x403911(0x132)](_0x21a3d3,_0x19fb15['id']),_0x56e045['onProgress']?.({'type':_0x403911(0x1e9),'journeyName':_0x2ea10f[_0x403911(0x15b)][_0x403911(0x1b3)],'activationName':_0x21a3d3});}const _0x10ad1a=JSON['parse'](JSON['stringify'](_0x11fd91));return _0x10ad1a['id']=_0x1768b6,ensureJourneyDefaults(_0x10ad1a[_0x403911(0x1d2)]),resolvePendingIdsInRequest(_0x10ad1a,_0x11fd91,_0x3f7d4f,_0x2157b7,_0x1f5555,_0x56e045),await _0x2301be[_0x403911(0x1bc)]['update'](_0x1768b6,_0x10ad1a),deletePushRecovery(_0x2ea10f[_0x403911(0x1a3)]),{'action':_0x403911(0x1db),'journeyId':_0x1768b6,'embeddedSegmentNameToId':_0x2157b7};}export function stripWaitStepPendingIds(_0x306404){const _0x4f83c7=a152_0x5aba4d,_0x5619f9=_0x306404[_0x4f83c7(0xf5)]&&isPendingSegmentId(_0x306404['conditionSegmentId']),_0xa3400a=_0x306404[_0x4f83c7(0x17a)]?.[_0x4f83c7(0x1cb)](_0x223cdf=>_0x223cdf['segmentId']&&isPendingSegmentId(_0x223cdf[_0x4f83c7(0x185)]));(_0x5619f9||_0xa3400a)&&(_0x306404[_0x4f83c7(0xf9)]=_0x4f83c7(0x172),_0x306404[_0x4f83c7(0x1e1)]=0x1,_0x306404[_0x4f83c7(0x10a)]=_0x4f83c7(0x188),delete _0x306404[_0x4f83c7(0xf5)],delete _0x306404[_0x4f83c7(0x100)],delete _0x306404[_0x4f83c7(0x167)],delete _0x306404['conditions']);}export function resolveWaitStepPendingIds(_0x1767ab,_0x16cb34,_0x28ef76,_0x20d40d){const _0x3f6af5=a152_0x5aba4d;if(_0x16cb34[_0x3f6af5(0xf5)]&&isPendingSegmentId(_0x16cb34[_0x3f6af5(0xf5)])){const _0x3769c1=_0x28ef76(_0x16cb34[_0x3f6af5(0xf5)],_0x3f6af5(0x14d)+_0x20d40d+'\x27\x20wait\x20condition');_0x3769c1&&(_0x1767ab['waitStepType']=_0x3f6af5(0x19f),_0x1767ab[_0x3f6af5(0xf5)]=_0x3769c1,delete _0x1767ab[_0x3f6af5(0x1e1)],delete _0x1767ab['waitStepUnit'],_0x16cb34[_0x3f6af5(0x100)]!==undefined&&(_0x1767ab[_0x3f6af5(0x100)]=_0x16cb34[_0x3f6af5(0x100)]),_0x16cb34['conditionTimeoutUnit']&&(_0x1767ab[_0x3f6af5(0x167)]=_0x16cb34[_0x3f6af5(0x167)]));}if(_0x16cb34[_0x3f6af5(0x17a)]){const _0x7bcf63=_0x16cb34['conditions'][_0x3f6af5(0x1cb)](_0x1bfb0c=>_0x1bfb0c[_0x3f6af5(0x185)]&&isPendingSegmentId(_0x1bfb0c[_0x3f6af5(0x185)]));if(_0x7bcf63){const _0x2ccb16=_0x16cb34[_0x3f6af5(0x17a)][_0x3f6af5(0x183)](_0x543741=>{const _0x15e52c=_0x3f6af5;if(_0x543741['segmentId']&&isPendingSegmentId(_0x543741[_0x15e52c(0x185)])){const _0x563bbd=_0x28ef76(_0x543741[_0x15e52c(0x185)],'stage\x20\x27'+_0x20d40d+'\x27\x20wait\x20condition');return{..._0x543741,'segmentId':_0x563bbd||_0x543741[_0x15e52c(0x185)]};}return{..._0x543741};});_0x1767ab[_0x3f6af5(0xf9)]=_0x3f6af5(0x19f),_0x1767ab[_0x3f6af5(0x17a)]=_0x2ccb16,delete _0x1767ab[_0x3f6af5(0x1e1)],delete _0x1767ab[_0x3f6af5(0x10a)],delete _0x1767ab[_0x3f6af5(0xf5)],delete _0x1767ab[_0x3f6af5(0x100)],delete _0x1767ab[_0x3f6af5(0x167)];}}}function stripPendingIds(_0x361720){const _0x5df906=a152_0x5aba4d;_0x361720[_0x5df906(0x1d2)][_0x5df906(0x1a5)]?.[_0x5df906(0x185)]&&isPendingSegmentId(_0x361720[_0x5df906(0x1d2)][_0x5df906(0x1a5)]['segmentId'])&&delete _0x361720[_0x5df906(0x1d2)][_0x5df906(0x1a5)];for(const _0x4272dc of _0x361720[_0x5df906(0x1d2)][_0x5df906(0x1be)]||[]){_0x4272dc[_0x5df906(0x106)]?.[_0x5df906(0x185)]&&isPendingSegmentId(_0x4272dc['entryCriteria'][_0x5df906(0x185)])&&delete _0x4272dc[_0x5df906(0x106)];_0x4272dc[_0x5df906(0x1a9)]?.[_0x5df906(0x185)]&&isPendingSegmentId(_0x4272dc[_0x5df906(0x1a9)][_0x5df906(0x185)])&&delete _0x4272dc[_0x5df906(0x1a9)];_0x4272dc[_0x5df906(0x175)]&&(_0x4272dc[_0x5df906(0x175)]=_0x4272dc[_0x5df906(0x175)]['filter'](_0x61f514=>!_0x61f514[_0x5df906(0x185)]||!isPendingSegmentId(_0x61f514[_0x5df906(0x185)])));if(_0x4272dc[_0x5df906(0x16e)])for(const _0x548bc2 of Object[_0x5df906(0x164)](_0x4272dc[_0x5df906(0x16e)])){const _0xe9db5f=_0x4272dc[_0x5df906(0x16e)][_0x548bc2];_0xe9db5f[_0x5df906(0x120)]==='Activation'&&_0xe9db5f['journeyActivationStepId']&&isPendingActivationId(_0xe9db5f['journeyActivationStepId'])&&(_0xe9db5f['journeyActivationStepId']='');if(_0xe9db5f[_0x5df906(0x120)]===_0x5df906(0x13d)&&_0xe9db5f[_0x5df906(0x195)])for(const _0x33f25d of _0xe9db5f['branches']){_0x33f25d['segmentId']&&isPendingSegmentId(_0x33f25d[_0x5df906(0x185)])&&(_0x33f25d[_0x5df906(0x185)]='');}_0xe9db5f[_0x5df906(0x120)]==='WaitStep'&&stripWaitStepPendingIds(_0xe9db5f);}}}function resolvePendingIdsInRequest(_0x33d327,_0x40a7ba,_0x55c383,_0x2c8a2e,_0x588bb5,_0x3e22d4){const _0x3b3ca8=a152_0x5aba4d,_0x1f9751=(_0x592d75,_0x52fc6f)=>{const _0x546079=a152_0x17bc;if(!isPendingSegmentId(_0x592d75))return _0x592d75;const _0x18c465=extractPendingSegmentName(_0x592d75),_0x5ed270=_0x2c8a2e[_0x546079(0x119)](_0x18c465);return!_0x5ed270&&_0x3e22d4['logWarning']?.('Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27'+_0x18c465+'\x27\x20for\x20'+_0x52fc6f),_0x5ed270;};if(_0x33d327['attributes'][_0x3b3ca8(0x1a5)]?.['segmentId']&&isPendingSegmentId(_0x33d327[_0x3b3ca8(0x1d2)][_0x3b3ca8(0x1a5)][_0x3b3ca8(0x185)])){const _0x4b62c9=_0x1f9751(_0x33d327[_0x3b3ca8(0x1d2)][_0x3b3ca8(0x1a5)][_0x3b3ca8(0x185)],_0x3b3ca8(0x113));_0x4b62c9&&(_0x33d327[_0x3b3ca8(0x1d2)][_0x3b3ca8(0x1a5)][_0x3b3ca8(0x185)]=_0x4b62c9);}for(const _0x128967 of _0x33d327[_0x3b3ca8(0x1d2)][_0x3b3ca8(0x1be)]||[]){const _0x49342d=_0x55c383['get'](_0x128967[_0x3b3ca8(0x1b3)][_0x3b3ca8(0x174)]());_0x49342d&&(_0x128967['id']=_0x49342d);if(_0x128967['entryCriteria']?.[_0x3b3ca8(0x185)]&&isPendingSegmentId(_0x128967['entryCriteria']['segmentId'])){const _0x9ae961=_0x1f9751(_0x128967[_0x3b3ca8(0x106)]['segmentId'],_0x3b3ca8(0x14d)+_0x128967['name']+'\x27\x20entry\x20criteria');_0x9ae961&&(_0x128967[_0x3b3ca8(0x106)][_0x3b3ca8(0x185)]=_0x9ae961);}if(_0x128967[_0x3b3ca8(0x175)])for(const _0x15da04 of _0x128967[_0x3b3ca8(0x175)]){if(_0x15da04[_0x3b3ca8(0x185)]&&isPendingSegmentId(_0x15da04['segmentId'])){const _0xebd01e=_0x1f9751(_0x15da04[_0x3b3ca8(0x185)],_0x3b3ca8(0x14d)+_0x128967['name']+_0x3b3ca8(0x124));_0xebd01e&&(_0x15da04[_0x3b3ca8(0x185)]=_0xebd01e);}}if(_0x128967['milestone']?.[_0x3b3ca8(0x185)]&&isPendingSegmentId(_0x128967[_0x3b3ca8(0x1a9)][_0x3b3ca8(0x185)])){const _0x167306=_0x1f9751(_0x128967[_0x3b3ca8(0x1a9)][_0x3b3ca8(0x185)],_0x3b3ca8(0x14d)+_0x128967[_0x3b3ca8(0x1b3)]+_0x3b3ca8(0x14f));_0x167306&&(_0x128967[_0x3b3ca8(0x1a9)][_0x3b3ca8(0x185)]=_0x167306);}if(_0x128967[_0x3b3ca8(0x16e)]){const _0x22c5ee=_0x1232ed=>_0x40a7ba[_0x3b3ca8(0x1d2)]['journeyStages']?.[_0x3b3ca8(0x15c)](_0x855fc6=>_0x855fc6['name'][_0x3b3ca8(0x174)]()===_0x128967[_0x3b3ca8(0x1b3)][_0x3b3ca8(0x174)]())?.['steps']?.[_0x1232ed];for(const _0x2b6804 of Object[_0x3b3ca8(0x164)](_0x128967[_0x3b3ca8(0x16e)])){const _0xd07713=_0x128967['steps'][_0x2b6804],_0xf847b3=_0x22c5ee(_0x2b6804);if(_0xd07713[_0x3b3ca8(0x120)]===_0x3b3ca8(0x1da)&&_0xd07713[_0x3b3ca8(0x15d)]&&(isPendingActivationId(_0xd07713[_0x3b3ca8(0x15d)])||_0xd07713[_0x3b3ca8(0x15d)]==='')){if(_0xf847b3?.[_0x3b3ca8(0x15d)]&&isPendingActivationId(_0xf847b3[_0x3b3ca8(0x15d)])){const _0xaebaf8=extractPendingActivationName(_0xf847b3['journeyActivationStepId']),_0x815577=_0x588bb5['get'](_0xaebaf8);_0x815577&&(_0xd07713[_0x3b3ca8(0x15d)]=_0x815577);}}if(_0xd07713[_0x3b3ca8(0x120)]==='DecisionPoint'&&_0xd07713[_0x3b3ca8(0x195)]&&_0xf847b3?.[_0x3b3ca8(0x195)])for(let _0x5f24a7=0x0;_0x5f24a7<_0xd07713[_0x3b3ca8(0x195)]['length'];_0x5f24a7++){const _0x513fe6=_0xd07713[_0x3b3ca8(0x195)][_0x5f24a7],_0x41602d=_0xf847b3[_0x3b3ca8(0x195)][_0x5f24a7];if(_0x41602d?.[_0x3b3ca8(0x185)]&&isPendingSegmentId(_0x41602d[_0x3b3ca8(0x185)])){const _0x438be0=_0x1f9751(_0x41602d[_0x3b3ca8(0x185)],_0x3b3ca8(0x14d)+_0x128967['name']+_0x3b3ca8(0x19d)+(_0x513fe6['name']||_0x5f24a7)+'\x27');_0x438be0&&(_0x513fe6[_0x3b3ca8(0x185)]=_0x438be0);}}_0xd07713[_0x3b3ca8(0x120)]===_0x3b3ca8(0x125)&&_0xf847b3?.[_0x3b3ca8(0x120)]==='WaitStep'&&resolveWaitStepPendingIds(_0xd07713,_0xf847b3,_0x1f9751,_0x128967[_0x3b3ca8(0x1b3)]);}}}}
1
+ const a152_0x261771=a152_0x57f8;(function(_0x27c77b,_0x6671ae){const _0x2fa742=a152_0x57f8,_0x467e6b=_0x27c77b();while(!![]){try{const _0x281212=-parseInt(_0x2fa742(0x20a))/0x1+-parseInt(_0x2fa742(0x12a))/0x2*(parseInt(_0x2fa742(0x190))/0x3)+parseInt(_0x2fa742(0x171))/0x4*(parseInt(_0x2fa742(0x1a4))/0x5)+parseInt(_0x2fa742(0x1ba))/0x6+parseInt(_0x2fa742(0x1de))/0x7+parseInt(_0x2fa742(0x132))/0x8*(parseInt(_0x2fa742(0x15f))/0x9)+parseInt(_0x2fa742(0x166))/0xa*(-parseInt(_0x2fa742(0x17a))/0xb);if(_0x281212===_0x6671ae)break;else _0x467e6b['push'](_0x467e6b['shift']());}catch(_0x32e68b){_0x467e6b['push'](_0x467e6b['shift']());}}}(a152_0xf4f8,0x8c63d));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a152_0x261771(0x16e));export const PENDING_SEGMENT_PREFIX=a152_0x261771(0x1fc);export const PENDING_ACTIVATION_PREFIX=a152_0x261771(0x154);export function createPendingSegmentId(_0x16f008){return''+PENDING_SEGMENT_PREFIX+_0x16f008+'__';}export function isPendingSegmentId(_0x2259f6){const _0x5ae179=a152_0x261771;return _0x2259f6[_0x5ae179(0x110)](PENDING_SEGMENT_PREFIX)&&!_0x2259f6[_0x5ae179(0x110)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x21081a){return _0x21081a['replace'](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x3e8c33){return''+PENDING_ACTIVATION_PREFIX+_0x3e8c33+'__';}export function isPendingActivationId(_0x5a812b){const _0xdf3dc2=a152_0x261771;return _0x5a812b[_0xdf3dc2(0x110)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x13bc9f){return _0x13bc9f['replace'](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x1d91e9,_0x47673b){const _0x2c63ab=a152_0x261771,_0x51351c=_0x1d91e9+'::'+(_0x47673b[_0x2c63ab(0x147)]()||'segment'),_0x50d317=createHash('sha1')[_0x2c63ab(0x1b4)](_0x51351c)[_0x2c63ab(0x1db)]('hex')[_0x2c63ab(0x18c)](0x0,0xc);return _0x2c63ab(0x15d)+_0x50d317;}export function ensureJourneyDefaults(_0x2e6f16){const _0x33101f=a152_0x261771;!_0x2e6f16[_0x33101f(0x11a)]&&(_0x2e6f16['description']=''),!_0x2e6f16['state']&&(_0x2e6f16[_0x33101f(0x16c)]='draft');}function a152_0x57f8(_0x313a27,_0x2ad2a7){_0x313a27=_0x313a27-0x10f;const _0xf4f8f3=a152_0xf4f8();let _0x57f8b4=_0xf4f8f3[_0x313a27];return _0x57f8b4;}export function injectExistingStageIds(_0xac1ee2,_0x527c54){const _0x9685cb=a152_0x261771,_0x20969c=new Map(_0x527c54[_0x9685cb(0x15a)](_0x489184=>[_0x489184[_0x9685cb(0x1ff)],_0x489184['id']]));for(const _0x4cdff6 of _0xac1ee2){if(!_0x4cdff6['id']){const _0x3ca77b=_0x20969c[_0x9685cb(0x114)](_0x4cdff6[_0x9685cb(0x1ff)]);_0x3ca77b&&(_0x4cdff6['id']=_0x3ca77b);}}}export function resolveTDFolderPath(_0x5407d6,_0x51f426,_0x338c07){const _0x1582fe=a152_0x261771;if(!_0x51f426)return _0x5407d6;if(_0x5407d6===_0x338c07||_0x5407d6[_0x1582fe(0x110)](_0x338c07+'/'))return _0x5407d6;return _0x5407d6?_0x338c07+'/'+_0x5407d6:_0x338c07;}function a152_0xf4f8(){const _0x7ac0e1=['behavior','folderId','rule','Matched\x20server\x20segment\x20\x27','state',').\x20','tdx.sdk.push-workflow','journeyStages','relationships','1433764lSIlde','existingActivation','\x27\x20to\x20local\x20\x27','segments','Entry\x20criteria:\x20','entries','verbose','length','steps','473WPdJSY','message',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','segment_updating','all_columns','Failed\x20to\x20resolve\x20segment\x20','activationContext','journeys','dirname','Creating\x20folder\x20\x27','parentId','\x27\x20milestone','all','Failed\x20to\x20fetch\x20referenced\x20segment\x20','stages','index','.$1.push-recovery.json','item','slice','Segment\x20not\x20found:\x20','run_after_journey_refresh','createFolder','3BSinPv','Updating\x20activation\x20\x27','branches','ACTIVATION_UPDATE_ERROR','notification','getSegmentEntity\x20also\x20failed\x20for\x20','\x0a\x20\x20','withProgress','\x20journey\x20from\x20file:\x20','entry_criteria','\x27\x20exit\x20criteria','existingSegment','keys','goal\x20criteria','Name\x20has\x20already\x20been\x20taken','waitStepType','journeyActivationNameToId','Fetching\x20','activation_deleted','folderPathToId','5hkyCKc','logDeleted','journeyBundlesByFolderAndName','push','nameToId','getJourney','resolveSegment','Embedded\x20segment\x20\x27','has','filter','yamlConfig','with','createdSegmentId','kind','JOURNEY_UPDATE_ERROR','max','update','Activation','diff','journeyActivationStepId','segment_updated','updated','4742958SEqqbs','Delete\x20the\x20push\x20recovery\x20file\x20(','segment_creating','logWarning','idToEmailMap','\x20(referenced\x20in\x20journey\x20','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','segmentFolderId','Failed\x20to\x20','localName','deleted','\x27\x20wait\x20condition','folderPath','segment_created','folder_creating','stage\x20\x27','toString','delete','segmentNameToId','logSuccess','SEGMENT_SYNTAX_ERROR','\x27\x20not\x20found\x20in\x20journey\x20\x27','createSegment','parse','journey_updated','journeyById','existingJourney','join','SEGMENT_NOT_FOUND','and\x20the\x20server\x20segment,\x20then\x20retry.','resolvedRule','DecisionPoint','created','digest','activation_creating','conditionTimeoutDuration','6584130QAGMVX','reduce','size','Activation\x20not\x20found:\x20','rootFolderId','../../utils/async.js','toISOString','type','activation_created','buildUserMaps','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','columns','goal','fetchJourney','parentFolder','journeyBundleName','includes','connection','activationActions','Created\x20segment\x20\x27','connector_config','create','from','skipSegments','effectiveFolderId','uniqueServerName','WaitStep','\x20segment\x20from\x20file:\x20','Updated\x20segment\x20\x27','SEGMENT_UPDATE_ERROR','__pending_','segment_deleting','embedded_segment_created','name','conditionSegmentId','Updated\x20journey\x20\x27','segmentByFolderAndName','toLowerCase','createJourneySegment','connectionIdToNameMap','journeyId','getSegmentEntity','segment','JOURNEY_SYNTAX_ERROR','418799qqZTyj','\x27\x20from\x20file:\x20','segment_deleted','Failed\x20to\x20resolve\x20activation\x20','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','activation_template_id','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','Created\x20journey\x20\x27','\x27\x20by\x20rule\x20content','flatMap','activation_updating','\x27\x20decision\x20point\x20branch\x20\x27','Condition','Stage\x20\x27','stringify','user','NOT_FOUND','startsWith','utf-8','progress','INTERNAL','get','Updated\x20activation\x20\x27','journey_created','add','embedded_activation_creating','createdSegmentIds','description','decision_point','idToName','versionNumber','activations','Creating\x20activation\x20\x27','find','debug','createActivation','embeddedSegmentNameToId','deleteActivation','results','embedded_segment_creating','deps','journeyBundleId','validatedRequest','648454gRycVz','split','getLatestJourneyId','isNew','Duration','\x27...','uniqueSegmentName','conditionTimeoutUnit','34096TkARKg','getActivation','entryCriteria','valid','Creating\x20segment\x20\x27','object','yamlActivation','):\x20','embedded_activation_created','action','Updating\x20segment\x20\x27','exitCriterias','getSegment\x20failed\x20for\x20','activation_updated','absolutePath','activationParams','schedule','existingSegments','sort','attributes','./child-segment-yaml.js','trim','activationStepsById','updateActivation','set','conditions','folder','waitStep','list','null','waitStepUnit','unchanged','listActivations','match','__pending_act_','milestone','segmentId','relative','./journey-yaml.js','journey_creating','map','updateSegmentById','parseDocument','journey_entry_criteria_','\x20error(s)','1242TLDnhr','\x27\x20for\x20','onProgress','hasChanges','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','data','journey','316190VfqqFc','parentSegmentFolder'];a152_0xf4f8=function(){return _0x7ac0e1;};return a152_0xf4f8();}export function addFoldersToCreate(_0x2379eb,_0x5d0884,_0x3a287a){const _0x586468=a152_0x261771;if(!_0x2379eb)return;if(_0x5d0884['has'](_0x2379eb))return;const _0x57a8d9=_0x2379eb[_0x586468(0x12b)]('/');let _0x58fa84='';for(const _0x47d49c of _0x57a8d9){_0x58fa84=_0x58fa84?_0x58fa84+'/'+_0x47d49c:_0x47d49c,!_0x5d0884[_0x586468(0x1ac)](_0x58fa84)&&_0x3a287a[_0x586468(0x117)](_0x58fa84);}}export function sortFoldersByDepth(_0x398bdc){const _0x5f34cf=a152_0x261771;return[..._0x398bdc][_0x5f34cf(0x144)]((_0x548c35,_0x50395f)=>{const _0x46517d=_0x5f34cf,_0x4f19c3=(_0x548c35[_0x46517d(0x153)](/\//g)||[])[_0x46517d(0x178)],_0x1ed3d9=(_0x50395f[_0x46517d(0x153)](/\//g)||[])['length'];return _0x4f19c3-_0x1ed3d9;});}import*as a152_0x532ddb from'yaml';import{readFileSync}from'fs';import a152_0x4a0113 from'path';import{isJourneyDef,parseYamlString as a152_0x92db47,toYamlString as a152_0x274023,normalizeJourneyDef,hasMultipleVersions,journeyResponseToDef,collectSegmentIdsFromJourneyApi}from'./journey-yaml.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,createJumpTargetCache,resolveJumpTarget,buildMergedJourneyDef,buildLocalRuleToNameMappingFromJourney,collectSegmentUsageCounts}from'./journey-utils.js';import{activationResponseToDef,segmentToYamlString,segmentWithActivationsToYaml,parseSegmentYamlFile,normalizeChildSegmentYaml,apiRuleToYaml,yamlRuleToApi,serializeExpandedRule,collectSegmentRefsFromRule,resolveRuleSegmentRefs,resolveRuleSegmentIds,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{batchAsync}from'../../utils/async.js';import{buildFolderMaps}from'./resolution-context.js';import{SDKError,ErrorCode,isHttp400Error,getErrorMessage}from'../errors.js';import{readPushRecovery,saveSegmentToPushRecovery,deletePushRecovery}from'./push-recovery.js';import{validateSegmentDef,formatValidationResult}from'./yaml-validator.js';import{validateJourneyDef}from'./journey-validator.js';function stableStringify(_0x2918da){const _0x21593d=a152_0x261771;if(Array['isArray'](_0x2918da))return'['+_0x2918da[_0x21593d(0x15a)](_0x411a1c=>stableStringify(_0x411a1c))[_0x21593d(0x1d5)](',')+']';if(_0x2918da&&typeof _0x2918da===_0x21593d(0x137)){const _0x5c32c4=_0x2918da,_0xcfa1d4=Object[_0x21593d(0x19c)](_0x5c32c4)[_0x21593d(0x144)](),_0x3fa160=_0xcfa1d4[_0x21593d(0x15a)](_0x3d45c4=>'\x22'+_0x3d45c4+'\x22:'+stableStringify(_0x5c32c4[_0x3d45c4]));return'{'+_0x3fa160[_0x21593d(0x1d5)](',')+'}';}const _0x1fd34e=JSON[_0x21593d(0x218)](_0x2918da);return _0x1fd34e===undefined?_0x21593d(0x14f):_0x1fd34e;}function activationSignature(_0x4703c1){const _0x787a8c=a152_0x261771,_0x5ec16e={'connection':_0x4703c1[_0x787a8c(0x1ef)],..._0x4703c1[_0x787a8c(0x17e)]!==undefined&&{'all_columns':_0x4703c1[_0x787a8c(0x17e)]},..._0x4703c1[_0x787a8c(0x1e9)]!==undefined&&{'columns':_0x4703c1['columns']},..._0x4703c1[_0x787a8c(0x168)]!==undefined&&{'behavior':_0x4703c1['behavior']},..._0x4703c1['schedule']!==undefined&&{'schedule':_0x4703c1[_0x787a8c(0x142)]},..._0x4703c1[_0x787a8c(0x194)]!==undefined&&{'notification':_0x4703c1['notification']},..._0x4703c1[_0x787a8c(0x1f2)]!==undefined&&{'connector_config':_0x4703c1[_0x787a8c(0x1f2)]},..._0x4703c1[_0x787a8c(0x20f)]!==undefined&&{'activation_template_id':_0x4703c1[_0x787a8c(0x20f)]}};return stableStringify(_0x5ec16e);}async function fetchSegment(_0x215444,_0x370ab8,_0x58b82a,_0x521f2b){const _0x2f8c91=a152_0x261771,_0x355df3=_0x521f2b?.[_0x2f8c91(0x120)](_0xfbeae2=>_0xfbeae2['id']===_0x58b82a);if(_0x355df3)return _0x355df3;try{return await _0x215444['segment']['getSegment'](_0x370ab8,_0x58b82a);}catch(_0x453490){logger['debug'](_0x2f8c91(0x13e)+_0x58b82a+_0x2f8c91(0x17c)+_0x453490);try{return await _0x215444[_0x2f8c91(0x208)][_0x2f8c91(0x207)](_0x58b82a);}catch(_0xd1c054){return logger[_0x2f8c91(0x121)](_0x2f8c91(0x195)+_0x58b82a+':\x20'+_0xd1c054),null;}}}function recoverSegmentIdsFromPushRecovery(_0x13717a,_0x2dedfb,_0x1946a7){const _0x50b03a=a152_0x261771,_0x4727fd=readPushRecovery(_0x13717a[_0x50b03a(0x140)]);if(_0x4727fd?.['journeyName']===_0x13717a[_0x50b03a(0x1ae)][_0x50b03a(0x1ff)])for(const [_0x24eacc,_0x269f02]of Object[_0x50b03a(0x176)](_0x4727fd[_0x50b03a(0x174)])){const _0xa8f7cf=generateDeterministicJourneySegmentName(_0x13717a[_0x50b03a(0x1ae)]['name'],_0x24eacc);_0x269f02[_0x50b03a(0x1f7)]===_0xa8f7cf&&(_0x2dedfb[_0x50b03a(0x14a)](_0x24eacc,_0x269f02['segmentId']),_0x1946a7['set'](_0x24eacc,_0x269f02['segmentId']));}}async function createOrRecoverEmbeddedSegment(_0x2a51e5,_0x408a8c,_0x4b15ef,_0x33f101){const _0x356d8a=a152_0x261771;let _0x2f9c33;try{_0x2f9c33=await _0x2a51e5['segment'][_0x356d8a(0x204)]({'name':_0x4b15ef[_0x356d8a(0x130)],'description':_0x4b15ef[_0x356d8a(0x11a)],'journeyId':_0x4b15ef[_0x356d8a(0x206)],'rule':_0x33f101(_0x4b15ef[_0x356d8a(0x1d8)],!![]),'countPopulation':!![],'parentFolderId':_0x4b15ef['folderId'],'audienceId':_0x4b15ef[_0x356d8a(0x184)]});}catch(_0x460314){const _0x38743b=_0x460314 instanceof Error&&_0x460314[_0x356d8a(0x17b)][_0x356d8a(0x1ee)](_0x356d8a(0x19e));if(_0x38743b){const _0x26f46d=readPushRecovery(_0x408a8c[_0x356d8a(0x140)]),_0x11253c=_0x26f46d?.['journeyName']===_0x408a8c[_0x356d8a(0x1ae)][_0x356d8a(0x1ff)]?_0x26f46d[_0x356d8a(0x174)][_0x4b15ef[_0x356d8a(0x1c3)]]:undefined;if(_0x11253c?.[_0x356d8a(0x1f7)]===_0x4b15ef[_0x356d8a(0x130)])await _0x2a51e5['segment']['updateSegmentById'](_0x4b15ef[_0x356d8a(0x184)],_0x11253c[_0x356d8a(0x156)],{'description':_0x4b15ef[_0x356d8a(0x11a)],'rule':_0x33f101(_0x4b15ef[_0x356d8a(0x1d8)],!![]),'countPopulation':!![]}),_0x2f9c33=_0x11253c['segmentId'];else throw new SDKError(ErrorCode['SEGMENT_UPDATE_ERROR'],_0x356d8a(0x1ab)+_0x4b15ef['localName']+'\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20'+(_0x356d8a(0x1bb)+_0x408a8c[_0x356d8a(0x140)]['replace'](/([^/]+)$/,_0x356d8a(0x18a))+')\x20')+_0x356d8a(0x1d7),_0x460314);}else throw _0x460314;}return saveSegmentToPushRecovery(_0x408a8c[_0x356d8a(0x140)],_0x408a8c[_0x356d8a(0x1ae)][_0x356d8a(0x1ff)],_0x4b15ef[_0x356d8a(0x1c3)],{'segmentId':_0x2f9c33,'uniqueServerName':_0x4b15ef[_0x356d8a(0x130)],'createdAt':new Date()[_0x356d8a(0x1e4)]()}),_0x2f9c33;}export async function prepareSegmentFiles(_0x25abad,_0x459409,_0x55b501,_0x4fb6a5,_0x1582a3){const _0xb8b9e9=a152_0x261771,{activationDefToCreateRequest:_0x30a64a}=await import(_0xb8b9e9(0x146)),_0x2d34ad=[],_0x1531cc=new Set();for(const {yamlConfig:_0x41ee4a,folderPath:_0x2840a6,sourcePath:_0x52995e}of _0x25abad){const _0x47c0eb=resolveTDFolderPath(_0x2840a6,_0x4fb6a5,_0x1582a3),_0x554fc1=_0x47c0eb+':'+_0x41ee4a[_0xb8b9e9(0x1ff)],_0x530c2f=_0x459409[_0xb8b9e9(0x202)][_0xb8b9e9(0x114)](_0x554fc1),_0x209d53=_0x530c2f?_0x459409['activationsBySegmentId']['get'](_0x530c2f['id'])||[]:[];addFoldersToCreate(_0x47c0eb,_0x459409[_0xb8b9e9(0x1a3)],_0x1531cc);const _0x500ce6=calculateActivationActions(_0x41ee4a[_0xb8b9e9(0x11e)]||[],_0x209d53,_0x459409[_0xb8b9e9(0x1be)],_0x459409[_0xb8b9e9(0x205)]);for(const _0x24bf77 of _0x500ce6){(_0x24bf77[_0xb8b9e9(0x1e5)]===_0xb8b9e9(0x1f3)||_0x24bf77[_0xb8b9e9(0x1e5)]===_0xb8b9e9(0x1b4))&&_0x24bf77[_0xb8b9e9(0x138)]&&(_0x24bf77[_0xb8b9e9(0x129)]=await _0x30a64a(_0x24bf77['yamlActivation'],_0x55b501));}const _0x1bcb9a=calculateSegmentDiff(_0x41ee4a,_0x530c2f,_0x209d53,_0x459409['idToEmailMap'],_0x459409[_0xb8b9e9(0x205)]);_0x2d34ad[_0xb8b9e9(0x1a7)]({'relativePath':_0x41ee4a[_0xb8b9e9(0x1ff)],'absolutePath':_0x52995e,'yamlConfig':_0x41ee4a,'folderPath':_0x47c0eb,'existingSegment':_0x530c2f,'existingActivations':_0x209d53,'isNew':_0x1bcb9a[_0xb8b9e9(0x12d)],'hasChanges':_0x1bcb9a[_0xb8b9e9(0x162)],'diff':_0x1bcb9a['diff'],'activationActions':_0x500ce6});}return{'segmentFiles':_0x2d34ad,'foldersToCreate':_0x1531cc};}export async function prepareJourneyFiles(_0x5bd579,_0x121d57,_0x446f88,_0xd0260a){const _0x3ec0d6=a152_0x261771,_0xd30008=[],_0x59cf53=new Set();for(const {yamlConfig:_0x4cfef0,folderPath:_0x3a162a,sourcePath:_0x2a5f31}of _0x5bd579){const _0x2fd171=resolveTDFolderPath(_0x3a162a,_0x446f88,_0xd0260a),_0x16f5ed=_0x2fd171+':'+_0x4cfef0[_0x3ec0d6(0x1ff)],_0x30780b=_0x121d57[_0x3ec0d6(0x1a6)]['get'](_0x16f5ed);let _0xcf11bb,_0x1c14ee;if(_0x30780b&&_0x30780b['length']>0x0){const _0x299808=buildLocalExpandedRuleMappings(_0x4cfef0),{createYamlContext:_0x172fd8,prefetchJourneySegments:_0x5daad4}=createPushYamlContextForBundle(_0x121d57['deps'],_0x121d57['parentId'],_0x121d57[_0x3ec0d6(0x143)],_0x299808,_0x121d57[_0x3ec0d6(0x1be)],_0x121d57[_0x3ec0d6(0x205)],_0x121d57[_0x3ec0d6(0x148)],_0x121d57[_0x3ec0d6(0x1d3)]);await _0x5daad4(_0x30780b[_0x3ec0d6(0x15a)](_0x25378b=>_0x25378b['id']));const _0x2c00a7=await _0x121d57[_0x3ec0d6(0x127)][_0x3ec0d6(0x165)][_0x3ec0d6(0x12c)](_0x30780b[0x0][_0x3ec0d6(0x128)]),_0x4141c0=hasMultipleVersions(_0x4cfef0),_0x122fbb=async _0x299cc6=>{const _0x5d95cf=_0x3ec0d6,_0x5dfe7a=_0x121d57[_0x5d95cf(0x1d3)]?.[_0x5d95cf(0x114)](_0x299cc6);if(_0x5dfe7a)return _0x5dfe7a;return _0x121d57[_0x5d95cf(0x1eb)]({'journeyId':_0x299cc6,'journeyName':_0x4cfef0[_0x5d95cf(0x1ff)],'isMultiVersion':_0x30780b[_0x5d95cf(0x178)]>0x1});};if(_0x4141c0&&_0x30780b[_0x3ec0d6(0x178)]>0x1){const _0x5c2ccf=[];for(const _0x215e53 of _0x30780b){const _0x562ed9=_0x215e53[_0x3ec0d6(0x11d)]||0x1;_0x121d57[_0x3ec0d6(0x112)]?.[_0x3ec0d6(0x1b4)](_0x3ec0d6(0x1a1)+_0x4cfef0[_0x3ec0d6(0x1ff)]+'\x20v'+_0x562ed9);const _0x5a94e1=await _0x122fbb(_0x215e53['id']),_0x56d718=_0x172fd8(_0x215e53['id']),_0x13889b=await journeyResponseToDef(_0x5a94e1,_0x56d718);_0x5c2ccf[_0x3ec0d6(0x1a7)]({'item':_0x215e53,'yaml':_0x13889b});}const _0x391ef1=buildLocalRuleToNameMappingFromJourney(_0x4cfef0);_0x1c14ee=buildMergedJourneyDef(_0x5c2ccf,_0x391ef1,_0x2c00a7);const _0x378f23=Math[_0x3ec0d6(0x1b3)](..._0x5c2ccf[_0x3ec0d6(0x15a)](_0x231b16=>_0x231b16[_0x3ec0d6(0x18b)][_0x3ec0d6(0x11d)]||0x0)),_0x33cf2b=_0x30780b[_0x3ec0d6(0x120)](_0x1e0cc8=>(_0x1e0cc8[_0x3ec0d6(0x11d)]||0x0)===_0x378f23);_0x33cf2b&&(_0x121d57['progress']?.[_0x3ec0d6(0x1b4)]('Fetching\x20'+_0x4cfef0[_0x3ec0d6(0x1ff)]+'\x20v'+_0x378f23),_0xcf11bb=await _0x122fbb(_0x33cf2b['id']));}else{const _0x14a74c=_0x30780b[_0x30780b[_0x3ec0d6(0x178)]-0x1];_0x121d57[_0x3ec0d6(0x112)]?.[_0x3ec0d6(0x1b4)]('Fetching\x20'+_0x4cfef0[_0x3ec0d6(0x1ff)]),_0xcf11bb=await _0x122fbb(_0x14a74c['id']);const _0x367753=_0x172fd8(_0x14a74c['id']),_0x816ef4=await journeyResponseToDef(_0xcf11bb,_0x367753),_0x18a052=buildLocalRuleToNameMappingFromJourney(_0x4cfef0);_0x1c14ee=buildMergedJourneyDef([{'item':_0x14a74c,'yaml':_0x816ef4}],_0x18a052,_0x2c00a7);}}addFoldersToCreate(_0x2fd171,_0x121d57[_0x3ec0d6(0x1a3)],_0x59cf53);const _0x77eb2a=calculateJourneyDiff(_0x4cfef0,_0x1c14ee);_0xd30008[_0x3ec0d6(0x1a7)]({'relativePath':_0x4cfef0[_0x3ec0d6(0x1ff)],'absolutePath':_0x2a5f31,'yamlConfig':_0x4cfef0,'folderPath':_0x2fd171,'existingJourney':_0xcf11bb,'isNew':_0x77eb2a[_0x3ec0d6(0x12d)],'hasChanges':_0x77eb2a['hasChanges'],'diff':_0x77eb2a[_0x3ec0d6(0x1b6)]});}return{'journeyFiles':_0xd30008,'foldersToCreate':_0x59cf53};}export function calculateActivationActions(_0x4cb376,_0x2a6f2a,_0x329e35,_0xb8f26c){const _0xd54885=a152_0x261771,_0x281309=[],_0x3a2d72=new Map();for(const _0x5bd128 of _0x2a6f2a){_0x3a2d72[_0xd54885(0x14a)](_0x5bd128[_0xd54885(0x1ff)],_0x5bd128);}const _0x19714c=new Map();for(const _0x1a03ce of _0x4cb376){_0x19714c[_0xd54885(0x14a)](_0x1a03ce[_0xd54885(0x1ff)],_0x1a03ce);}for(const _0x438825 of _0x4cb376){const _0x2a700c=_0x3a2d72[_0xd54885(0x114)](_0x438825['name']);if(!_0x2a700c)_0x281309[_0xd54885(0x1a7)]({'type':_0xd54885(0x1f3),'name':_0x438825[_0xd54885(0x1ff)],'yamlActivation':_0x438825});else{const _0x18ed43=activationResponseToDef(_0x2a700c,_0x329e35,_0xb8f26c),_0x28366b=a152_0x532ddb[_0xd54885(0x218)](_0x18ed43),_0xc8335a=a152_0x532ddb[_0xd54885(0x218)](_0x438825);_0x28366b!==_0xc8335a&&_0x281309[_0xd54885(0x1a7)]({'type':_0xd54885(0x1b4),'name':_0x438825[_0xd54885(0x1ff)],'yamlActivation':_0x438825,'existingActivation':_0x2a700c});}}for(const _0x362cfb of _0x2a6f2a){!_0x19714c['has'](_0x362cfb['name'])&&_0x281309['push']({'type':_0xd54885(0x1cb),'name':_0x362cfb[_0xd54885(0x1ff)],'existingActivation':_0x362cfb});}return _0x281309;}function calculateYamlDiff(_0x4c6ce7,_0x539bfc){if(_0x539bfc){const _0x7ce2a4=generateDiff(_0x539bfc,_0x4c6ce7),_0x3ada94=hasChanges(_0x7ce2a4);return{'isNew':![],'hasChanges':_0x3ada94,'diff':_0x3ada94?formatDiffWithColors(_0x7ce2a4):undefined};}const _0x140b00=generateDiff('',_0x4c6ce7);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x140b00)};}export function calculateSegmentDiff(_0x1f3330,_0x2b09a7,_0x45834d,_0x3ba0e8,_0x203c0f){const _0x3e6d7b=segmentToYamlString(_0x1f3330),_0x524291=_0x2b09a7?segmentToYamlString(segmentWithActivationsToYaml(_0x2b09a7,_0x45834d,undefined,_0x3ba0e8,_0x203c0f)):undefined;return calculateYamlDiff(_0x3e6d7b,_0x524291);}export function calculateJourneyDiff(_0x3c4808,_0x37a7fb){const _0xf67213=normalizeJourneyDef(_0x3c4808,_0x3c4808),_0x259786=a152_0x274023(_0xf67213),_0x2e9a10=_0x37a7fb?a152_0x274023(normalizeJourneyDef(_0x37a7fb,_0x3c4808)):undefined;return calculateYamlDiff(_0x259786,_0x2e9a10);}export function findSegmentsToDelete(_0x12ed0a,_0x3c78fe,_0x3a446,_0xc512f5,_0x4b6f92){const _0x2e59f5=a152_0x261771,_0x49c66d=new Set();for(const {yamlConfig:_0x464b01,folderPath:_0x56da43}of _0x3c78fe){_0x49c66d[_0x2e59f5(0x117)](_0x56da43+':'+_0x464b01[_0x2e59f5(0x1ff)]);}return _0x12ed0a[_0x2e59f5(0x1ad)](_0x403319=>{const _0x3757fb=_0x2e59f5,_0x3d4d11=_0x403319[_0x3757fb(0x1c1)]?_0x3a446[_0x3757fb(0x114)](_0x403319[_0x3757fb(0x1c1)]['toString']())||'':'',_0x5217e6=_0x3d4d11+':'+_0x403319[_0x3757fb(0x1ff)];if(_0x49c66d[_0x3757fb(0x1ac)](_0x5217e6))return![];if(_0x4b6f92)return _0x3d4d11===_0xc512f5||_0x3d4d11[_0x3757fb(0x110)](_0xc512f5+'/');return!![];});}export function findJourneysToDelete(_0x592734,_0x13bb99,_0x36ff24,_0x58dac7,_0x5b164f){const _0xbc8d04=a152_0x261771,_0x3b3d9b=new Set();for(const {yamlConfig:_0x3131c0,folderPath:_0x57154b}of _0x13bb99){_0x3b3d9b[_0xbc8d04(0x117)](_0x57154b+':'+_0x3131c0['name']);}return _0x592734[_0xbc8d04(0x1ad)](_0x5131a5=>{const _0x412a9d=_0xbc8d04,_0x49ea54=_0x5131a5[_0x412a9d(0x169)]?_0x36ff24[_0x412a9d(0x114)](_0x5131a5[_0x412a9d(0x169)])||'':'',_0x2cf4b8=_0x49ea54+':'+_0x5131a5[_0x412a9d(0x1ed)];if(_0x3b3d9b[_0x412a9d(0x1ac)](_0x2cf4b8))return![];if(_0x5b164f)return _0x49ea54===_0x58dac7||_0x49ea54[_0x412a9d(0x110)](_0x58dac7+'/');return!![];});}export function buildSegmentLookupMap(_0x4b7896,_0x22bd80){const _0x1a86e2=a152_0x261771,_0x297d1d=new Map();for(const _0x52641e of _0x4b7896){const _0x16259e=_0x52641e[_0x1a86e2(0x1c1)]?_0x22bd80[_0x1a86e2(0x114)](_0x52641e['segmentFolderId'][_0x1a86e2(0x1ca)]())||'':'',_0x39a992=_0x16259e+':'+_0x52641e['name'];_0x297d1d['set'](_0x39a992,_0x52641e);}return _0x297d1d;}export function buildSegmentNameToIdMap(_0x328d18){const _0x5dbfd7=a152_0x261771,_0x24cbe9=new Map();for(const _0x5671a1 of _0x328d18){_0x24cbe9['set'](_0x5671a1[_0x5dbfd7(0x1ff)],_0x5671a1['id']);}return _0x24cbe9;}export function buildJourneyBundleLookupMap(_0x56aad9,_0x2bd5c8){const _0x1c6dce=a152_0x261771,_0xdc4095=new Map();for(const _0x50ab97 of _0x56aad9){const _0x4296f8=_0x50ab97['folderId']?_0x2bd5c8[_0x1c6dce(0x114)](_0x50ab97[_0x1c6dce(0x169)])||'':'',_0x1d6c0a=_0x4296f8+':'+_0x50ab97[_0x1c6dce(0x1ed)];!_0xdc4095[_0x1c6dce(0x1ac)](_0x1d6c0a)&&_0xdc4095['set'](_0x1d6c0a,[]),_0xdc4095['get'](_0x1d6c0a)[_0x1c6dce(0x1a7)](_0x50ab97);}for(const _0x440ce4 of _0xdc4095['values']()){_0x440ce4[_0x1c6dce(0x144)]((_0x4f2974,_0x152880)=>(_0x4f2974['versionNumber']||0x0)-(_0x152880[_0x1c6dce(0x11d)]||0x0));}return _0xdc4095;}export function collectFoldersToCreate(_0x49090a,_0x210314){const _0x4b1606=a152_0x261771,_0x1fff53=new Set();for(const _0x3469e9 of _0x49090a){if(!_0x3469e9)continue;if(_0x210314[_0x4b1606(0x1ac)](_0x3469e9))continue;const _0x1d47f8=_0x3469e9[_0x4b1606(0x12b)]('/');let _0x3b11b9='';for(const _0x5881b8 of _0x1d47f8){_0x3b11b9=_0x3b11b9?_0x3b11b9+'/'+_0x5881b8:_0x5881b8,!_0x210314[_0x4b1606(0x1ac)](_0x3b11b9)&&_0x1fff53['add'](_0x3b11b9);}}return _0x1fff53;}export function parseAndClassifyYamlFiles(_0x4179ec,_0x340f35,_0x39ef10){const _0x477a96=a152_0x261771,_0xdd1a16=[],_0x317592=[];for(const _0x557d8f of _0x4179ec){const _0x151ace=a152_0x4a0113[_0x477a96(0x157)](_0x340f35,a152_0x4a0113[_0x477a96(0x182)](_0x557d8f)),_0x2cbe09=_0x151ace==='.'?'':_0x151ace,_0x5b37dd=readFileSync(_0x557d8f,'utf-8'),_0x34ddb3=a152_0x532ddb[_0x477a96(0x1d1)](_0x5b37dd);if(isJourneyDef(_0x34ddb3)){const _0x303905=a152_0x92db47(_0x5b37dd);_0x317592['push']({'yamlConfig':_0x303905,'folderPath':_0x2cbe09,'sourcePath':_0x557d8f});}else{if(!_0x39ef10?.[_0x477a96(0x1f5)]){const _0x1df8e7=parseSegmentYamlFile(_0x5b37dd),_0x2629f4=normalizeChildSegmentYaml(_0x1df8e7);_0xdd1a16[_0x477a96(0x1a7)]({'yamlConfig':_0x2629f4,'folderPath':_0x2cbe09,'sourcePath':_0x557d8f});}}}return{'segments':_0xdd1a16,'journeys':_0x317592};}export function validateParsedFiles(_0x362b59,_0x411c15){const _0x378c45=a152_0x261771,_0x292989=[];for(const {yamlConfig:_0x119ce3,sourcePath:_0xccfa1b}of _0x362b59[_0x378c45(0x174)]){const _0x1c9e07=readFileSync(_0xccfa1b,_0x378c45(0x111)),_0x65c5a0=a152_0x532ddb[_0x378c45(0x15c)](_0x1c9e07),_0x553529=validateSegmentDef(_0x119ce3,{'source':_0x1c9e07,'document':_0x65c5a0},{'skipSchema':!![]});if(!_0x553529[_0x378c45(0x135)]){const _0x2345f9=a152_0x4a0113['relative'](_0x411c15,_0xccfa1b);_0x292989[_0x378c45(0x1a7)]({'filePath':_0x2345f9,'source':_0x1c9e07,'result':_0x553529,'isJourney':![]});}}for(const {yamlConfig:_0x472475,sourcePath:_0x360352}of _0x362b59['journeys']){const _0x194b68=readFileSync(_0x360352,_0x378c45(0x111)),_0x19aaf7=a152_0x532ddb[_0x378c45(0x15c)](_0x194b68),_0x7ca5e7=validateJourneyDef(_0x472475,{'source':_0x194b68,'document':_0x19aaf7},{'skipSchema':!![]});if(!_0x7ca5e7['valid']){const _0x8705af=a152_0x4a0113['relative'](_0x411c15,_0x360352);_0x292989[_0x378c45(0x1a7)]({'filePath':_0x8705af,'source':_0x194b68,'result':_0x7ca5e7,'isJourney':!![]});}}return _0x292989;}export function formatValidationErrors(_0x291310){const _0x5ce671=a152_0x261771,_0x3c8383=[];for(const {filePath:_0x3c21f8,source:_0x54feb0,result:_0x36038a,isJourney:_0x2952e6}of _0x291310){const _0x2152e5=_0x2952e6?_0x5ce671(0x165):_0x5ce671(0x208);_0x3c8383['push']('\x0a'+_0x3c21f8+'\x20('+_0x2152e5+_0x5ce671(0x139)+_0x36038a['errors']['length']+_0x5ce671(0x15e)),_0x3c8383[_0x5ce671(0x1a7)](formatValidationResult(_0x36038a,_0x54feb0,_0x3c21f8));}return _0x3c8383['join']('\x0a');}export function buildLocalExpandedRuleMappings(_0xacdcc6){const _0x2e7a30=a152_0x261771,_0x1aabfa=new Set(),_0x1ef687=new Map(),_0xeac6ca=collectSegmentUsageCounts(_0xacdcc6);if(_0xacdcc6['segments'])for(const [_0x3ac8fa,_0x4fbd24]of Object['entries'](_0xacdcc6[_0x2e7a30(0x174)])){_0x1aabfa['add'](_0x3ac8fa);if(_0x4fbd24[_0x2e7a30(0x16a)]){const _0x5f0ec0=yamlRuleToApi(_0x4fbd24['rule']),_0x341b0e=apiRuleToYaml(_0x5f0ec0);_0x1ef687['set'](_0x3ac8fa,_0x341b0e);}}const _0x30983f=new Map();let _0x5b8190=0x0;for(const [_0x378905,_0x7f226]of _0x1ef687){const _0xed2449=serializeExpandedRule(_0x7f226,_0x1ef687),_0x1e7917=_0x30983f[_0x2e7a30(0x114)](_0xed2449)||[];_0x1e7917['push']({'name':_0x378905,'index':_0x5b8190}),_0x30983f['set'](_0xed2449,_0x1e7917),_0x5b8190++;}const _0x205b77=new Map();for(const [_0x5a1026,_0xee4014]of _0x30983f){const _0x52c1dc=_0xee4014[_0x2e7a30(0x18c)]()[_0x2e7a30(0x144)]((_0x20c43e,_0x817cb6)=>{const _0x3a672d=_0x2e7a30,_0x3d45c8=_0xeac6ca[_0x3a672d(0x114)](_0x20c43e[_0x3a672d(0x1ff)])||0x0,_0xf7f4b3=_0xeac6ca['get'](_0x817cb6[_0x3a672d(0x1ff)])||0x0;if(_0x3d45c8!==_0xf7f4b3)return _0xf7f4b3-_0x3d45c8;return _0x20c43e[_0x3a672d(0x189)]-_0x817cb6[_0x3a672d(0x189)];})['map'](_0x31e40c=>_0x31e40c['name']),_0x1d9174=[];for(const _0x94a58 of _0x52c1dc){const _0x5609b9=_0xeac6ca['get'](_0x94a58)||0x0,_0x3d07fc=Math[_0x2e7a30(0x1b3)](_0x5609b9,0x1);for(let _0x1c59f1=0x0;_0x1c59f1<_0x3d07fc;_0x1c59f1++){_0x1d9174[_0x2e7a30(0x1a7)](_0x94a58);}}_0x205b77[_0x2e7a30(0x14a)](_0x5a1026,_0x1d9174);}return{'existingLocalSegmentNames':_0x1aabfa,'localSegmentRules':_0x1ef687,'localExpandedRuleToNames':_0x205b77};}export function createSegmentIdResolver(_0xeaefc,_0x2bcfd6){return async _0x209b37=>{const _0x1209ec=a152_0x57f8,_0x32bcd0=_0xeaefc[_0x1209ec(0x114)](_0x209b37);if(!_0x32bcd0)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x1209ec(0x18d)+_0x209b37+'\x20(referenced\x20in\x20embedded\x20segment\x20\x27'+_0x2bcfd6+'\x27)');return _0x32bcd0;};}export function extractRootFolderId(_0x496759){const _0x1ebafe=a152_0x261771;return _0x496759[_0x1ebafe(0x170)]?.[_0x1ebafe(0x167)]?.[_0x1ebafe(0x164)]?.['id']||_0x496759[_0x1ebafe(0x170)]?.[_0x1ebafe(0x1ec)]?.[_0x1ebafe(0x164)]?.['id'];}export function buildConnectionMaps(_0x51159c){const _0x5a5071=a152_0x261771,_0x234ab4=new Map(),_0x501991=new Map(),_0xf9a2eb=new Map();for(const _0x13c62e of _0x51159c){_0x234ab4['set'](_0x13c62e[_0x5a5071(0x1ff)],parseInt(_0x13c62e['id'],0xa)),_0x501991[_0x5a5071(0x14a)](_0x13c62e['id'],_0x13c62e['name']),_0xf9a2eb[_0x5a5071(0x14a)](_0x13c62e['name'],_0x13c62e[_0x5a5071(0x1e5)]);}return{'nameToId':_0x234ab4,'idToName':_0x501991,'nameToType':_0xf9a2eb};}export function calculatePushStats(_0x537d79,_0x252a3b,_0x1d5082,_0x314a79,_0x3ff12f,_0x40e0a7,_0x4a87bb){const _0x33dee2=a152_0x261771,_0x16d4c0=_0x537d79[_0x33dee2(0x1ad)](_0xda916f=>_0xda916f[_0x33dee2(0x12d)]),_0x77925d=_0x537d79[_0x33dee2(0x1ad)](_0x349b2b=>!_0x349b2b[_0x33dee2(0x12d)]&&_0x349b2b[_0x33dee2(0x162)]),_0x2931c8=_0x537d79[_0x33dee2(0x1ad)](_0x1fb3ab=>!_0x1fb3ab[_0x33dee2(0x12d)]&&!_0x1fb3ab['hasChanges']),_0x124f5e=_0x40e0a7?_0x314a79:[],_0x525cb5=_0x252a3b[_0x33dee2(0x1ad)](_0x2548b1=>_0x2548b1[_0x33dee2(0x12d)]),_0x54e485=_0x252a3b[_0x33dee2(0x1ad)](_0x540106=>!_0x540106[_0x33dee2(0x12d)]&&_0x540106[_0x33dee2(0x162)]),_0x1974cf=_0x252a3b['filter'](_0x4dc76b=>!_0x4dc76b[_0x33dee2(0x12d)]&&!_0x4dc76b['hasChanges']),_0x13b394=_0x40e0a7?_0x3ff12f:[],_0x2c96cb=_0x537d79[_0x33dee2(0x213)](_0x2ba467=>_0x2ba467[_0x33dee2(0x1f0)]),_0x34ffc2=_0x2c96cb['filter'](_0x3bd1e2=>_0x3bd1e2[_0x33dee2(0x1e5)]===_0x33dee2(0x1f3)),_0x177532=_0x2c96cb[_0x33dee2(0x1ad)](_0x369eb5=>_0x369eb5[_0x33dee2(0x1e5)]===_0x33dee2(0x1b4)),_0x1bfb56=_0x2c96cb[_0x33dee2(0x1ad)](_0x3297d6=>_0x3297d6[_0x33dee2(0x1e5)]===_0x33dee2(0x1cb)),_0xedfccc=Array['from'](_0x1d5082)[_0x33dee2(0x144)](),_0x1b657d=_0x4a87bb?![]:_0x16d4c0[_0x33dee2(0x178)]>0x0||_0x77925d['length']>0x0||_0x124f5e['length']>0x0,_0x24e023=_0x525cb5['length']>0x0||_0x54e485[_0x33dee2(0x178)]>0x0||_0x13b394[_0x33dee2(0x178)]>0x0,_0x455134=_0x4a87bb?![]:_0x2c96cb[_0x33dee2(0x178)]>0x0,_0x3b2be7=_0xedfccc['length']>0x0;return{'segments':{'new':_0x16d4c0,'changed':_0x77925d,'unchanged':_0x2931c8,'toDelete':_0x124f5e},'journeys':{'new':_0x525cb5,'changed':_0x54e485,'unchanged':_0x1974cf,'toDelete':_0x13b394},'activations':{'all':_0x2c96cb,'toCreate':_0x34ffc2,'toUpdate':_0x177532,'toDelete':_0x1bfb56},'folders':{'toCreate':_0xedfccc},'counts':{'segments':{'new':_0x16d4c0[_0x33dee2(0x178)],'changed':_0x77925d[_0x33dee2(0x178)],'unchanged':_0x2931c8[_0x33dee2(0x178)],'toDelete':_0x124f5e[_0x33dee2(0x178)]},'journeys':{'new':_0x525cb5[_0x33dee2(0x178)],'changed':_0x54e485[_0x33dee2(0x178)],'unchanged':_0x1974cf[_0x33dee2(0x178)],'toDelete':_0x13b394['length']},'activations':{'create':_0x34ffc2[_0x33dee2(0x178)],'update':_0x177532['length'],'delete':_0x1bfb56[_0x33dee2(0x178)]},'folders':_0xedfccc['length']},'hasChanges':_0x1b657d||_0x24e023||_0x455134||_0x3b2be7};}export async function buildPushExecutionContext(_0x28186f,_0x2fa525,_0x3b5b3b,_0x591a61,_0x3a7a34,_0x274fbb){const _0x41912b=a152_0x261771,_0x2fb4be=extractRootFolderId(_0x3b5b3b),{pathToId:_0x220227,idToPath:_0x5eb7fd}=buildFolderMaps(_0x3a7a34),_0x83f459=buildSegmentNameToIdMap(_0x591a61),_0x5a67c1=new Map(),{batchAsync:_0x47cb47}=await import('../../utils/async.js'),[_0x2895a1,_0x17f58a]=await Promise[_0x41912b(0x186)]([_0x28186f[_0x41912b(0x219)][_0x41912b(0x1e7)](),_0x28186f[_0x41912b(0x1ef)][_0x41912b(0x14e)](),((async()=>{const _0x448bff=_0x41912b;!_0x274fbb&&_0x591a61[_0x448bff(0x178)]>0x0&&await _0x47cb47(_0x591a61,async _0x59982c=>{const _0x513c2f=_0x448bff,_0x41114b=await _0x28186f['segment'][_0x513c2f(0x152)](_0x2fa525,_0x59982c['id']);_0x5a67c1[_0x513c2f(0x14a)](_0x59982c['id'],_0x41114b);});})())]),{emailToId:_0x460c7e,idToEmail:_0x20d3b3}=_0x2895a1,_0x1793e0=buildConnectionMaps(_0x17f58a);return{'rootFolderId':_0x2fb4be,'folderPathToId':_0x220227,'folderIdToPath':_0x5eb7fd,'segmentNameToId':_0x83f459,'activationsBySegmentId':_0x5a67c1,'emailToIdMap':_0x460c7e,'idToEmailMap':_0x20d3b3,'connectionNameToIdMap':_0x1793e0[_0x41912b(0x1a8)],'connectionIdToNameMap':_0x1793e0[_0x41912b(0x11c)],'connectionNameToTypeMap':_0x1793e0['nameToType']};}export function createPushYamlContextForBundle(_0x30abfc,_0x2bcffb,_0x2c28e8,_0x2020bc,_0x25e9f0,_0x3546fd,_0x456d62,_0xb9902f){const {existingLocalSegmentNames:_0x179eee,localExpandedRuleToNames:_0x783617}=_0x2020bc,_0x8aba82=new Set(),_0x196e03=new Map(),_0x3ae792=new Map(),_0x3bc40b=new Map(),_0xf7f3cb=createJumpTargetCache(),_0x5562e8=new Map(),_0x222b26=new Map(),_0x272081=new Set();let _0x4c1dac;const _0x1edd44=_0x3896bc=>{const _0x488855={'resolveSegment':async _0x9fa126=>{const _0x51439e=a152_0x57f8,_0x1ecb38=_0x3bc40b[_0x51439e(0x114)](_0x9fa126);if(_0x1ecb38!==undefined)return{'name':_0x1ecb38,'isJourneyLocal':!![]};try{const _0x1865a7=await fetchSegment(_0x30abfc,_0x2bcffb,_0x9fa126,_0x2c28e8);if(!_0x1865a7)throw new Error('Segment\x20not\x20found');const _0x166d26=generateJourneyLocalName(_0x1865a7['name']),_0x31f44c=_0x1865a7[_0x51439e(0x1b1)]===SEGMENT_KIND_JOURNEY&&_0x166d26!==undefined;let _0x5b597f=_0x1865a7['name'],_0x309b76;if(_0x31f44c&&_0x1865a7[_0x51439e(0x16a)]){const _0xb72e98=apiRuleToYaml(_0x1865a7[_0x51439e(0x16a)]);_0x222b26[_0x51439e(0x14a)](_0x9fa126,_0xb72e98);const _0x518591=async _0xf1f11=>{const _0x443a64=_0x51439e,_0x48efe3=collectSegmentRefsFromRule(_0xf1f11);for(const _0x462acb of _0x48efe3){if(!_0x222b26[_0x443a64(0x1ac)](_0x462acb))try{const _0x232f1c=await fetchSegment(_0x30abfc,_0x2bcffb,_0x462acb,_0x2c28e8);if(_0x232f1c?.['rule']){const _0x404554=apiRuleToYaml(_0x232f1c[_0x443a64(0x16a)]);_0x222b26[_0x443a64(0x14a)](_0x462acb,_0x404554),await _0x518591(_0x404554);}}catch(_0x291364){logger[_0x443a64(0x121)](_0x443a64(0x187)+_0x462acb+':\x20'+_0x291364);}}};await _0x518591(_0xb72e98);const _0x4af5b6=serializeExpandedRule(_0xb72e98,_0x222b26),_0x2e5cb4=_0x783617['get'](_0x4af5b6);if(_0x2e5cb4&&_0x2e5cb4[_0x51439e(0x178)]>0x0){const _0x411753=_0x196e03[_0x51439e(0x114)](_0x4af5b6)||0x0,_0x32b179=_0x2e5cb4[_0x411753]||_0x2e5cb4[_0x2e5cb4[_0x51439e(0x178)]-0x1];_0x196e03[_0x51439e(0x14a)](_0x4af5b6,_0x411753+0x1),_0x5b597f=_0x32b179,_0x8aba82[_0x51439e(0x117)](_0x5b597f),_0x3bc40b[_0x51439e(0x14a)](_0x9fa126,_0x5b597f);const _0x2bcc48=await resolveRuleSegmentRefs(_0xb72e98,async _0x17d3aa=>{const _0x595257=_0x51439e,_0x1fd8b0=_0x3bc40b['get'](_0x17d3aa);if(_0x1fd8b0)return _0x1fd8b0;const _0x33bc5b=await _0x4c1dac[_0x595257(0x1aa)](_0x17d3aa);return _0x33bc5b[_0x595257(0x1ff)];});_0x309b76={'description':_0x1865a7[_0x51439e(0x11a)],'rule':_0x2bcc48};}else{const _0x60f62c=_0x5562e8[_0x51439e(0x114)](_0x4af5b6);if(_0x60f62c)_0x5b597f=_0x60f62c,_0x3bc40b[_0x51439e(0x14a)](_0x9fa126,_0x5b597f);else{if(_0x166d26){let _0x1df5e0=_0x166d26,_0x3ccba5=0x2;while(_0x8aba82[_0x51439e(0x1ac)](_0x1df5e0)||_0x179eee[_0x51439e(0x1ac)](_0x1df5e0)){_0x1df5e0=_0x166d26+'_'+_0x3ccba5,_0x3ccba5++;}_0x8aba82[_0x51439e(0x117)](_0x1df5e0),_0x5b597f=_0x1df5e0;}_0x3bc40b['set'](_0x9fa126,_0x5b597f),_0x5562e8[_0x51439e(0x14a)](_0x4af5b6,_0x5b597f);const _0xed130c=await resolveRuleSegmentRefs(_0xb72e98,async _0x157744=>{const _0x3c1593=_0x51439e,_0x3a6c00=_0x3bc40b[_0x3c1593(0x114)](_0x157744);if(_0x3a6c00)return _0x3a6c00;const _0x41c47f=await _0x4c1dac['resolveSegment'](_0x157744);return _0x41c47f['name'];});_0x309b76={'description':_0x1865a7['description'],'rule':_0xed130c};}}}return{'name':_0x5b597f,'isJourneyLocal':_0x31f44c,'definition':_0x309b76};}catch(_0x27e306){return logger[_0x51439e(0x121)](_0x51439e(0x17f)+_0x9fa126+':\x20'+_0x27e306),{'name':_0x9fa126,'isJourneyLocal':![]};}},'resolveActivation':async _0x547999=>{const _0x1dfae2=a152_0x57f8,_0x55ce07=_0x3ae792[_0x1dfae2(0x114)](_0x547999);if(_0x55ce07!==undefined)return{'name':_0x55ce07,'isJourneyLocal':!![]};try{let _0x38beb8=_0x456d62?.[_0x1dfae2(0x114)](_0x547999);!_0x38beb8&&(_0x38beb8=await _0x30abfc[_0x1dfae2(0x165)][_0x1dfae2(0x133)](_0x3896bc,_0x547999));const _0x38e281=_0x38beb8['attributes'][_0x1dfae2(0x141)][_0x1dfae2(0x1ff)]||_0x547999,_0xaef879=sanitizeYamlKey(_0x38e281)||'activation_'+_0x547999,_0x357a73=_0xaef879;_0x3ae792['set'](_0x547999,_0x357a73);const _0x2632de=journeyActivationStepToYaml(_0x38beb8,_0x25e9f0,_0x3546fd);return{'name':_0x357a73,'isJourneyLocal':!![],'definition':_0x2632de};}catch(_0x532072){return logger[_0x1dfae2(0x121)](_0x1dfae2(0x20d)+_0x547999+':\x20'+_0x532072),{'name':_0x547999,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x4ca894,_0x40e96f)=>resolveJumpTarget(_0x4ca894,_0x40e96f,_0xf7f3cb,async _0x5a5c00=>{const _0x3be0c4=a152_0x57f8,_0x5b6cb5=_0xb9902f?.[_0x3be0c4(0x114)](_0x5a5c00);if(_0x5b6cb5)return _0x5b6cb5;return _0x30abfc[_0x3be0c4(0x165)][_0x3be0c4(0x1a9)](_0x5a5c00);})};return _0x4c1dac=_0x488855,_0x488855;},_0x255e1c=async _0x47843b=>{const _0x5d4eac=a152_0x57f8,{collectSegmentIdsFromJourneyApi:_0x5f70e6}=await import('./journey-yaml.js'),{batchAsync:_0x55856d}=await import(_0x5d4eac(0x1e3)),_0x179a30=new Set();for(const _0x431eb7 of _0x47843b){let _0x120c09=_0xb9902f?.[_0x5d4eac(0x114)](_0x431eb7);!_0x120c09&&(_0x120c09=await _0x30abfc[_0x5d4eac(0x165)]['getJourney'](_0x431eb7));const _0x4dd059=_0x5f70e6(_0x120c09);for(const _0x44f182 of _0x4dd059){_0x179a30[_0x5d4eac(0x117)](_0x44f182);}}let _0x1ddc39=Array[_0x5d4eac(0x1f4)](_0x179a30);while(_0x1ddc39[_0x5d4eac(0x178)]>0x0){const _0xb86abb=_0x1ddc39['filter'](_0x944466=>!_0x272081[_0x5d4eac(0x1ac)](_0x944466));if(_0xb86abb[_0x5d4eac(0x178)]===0x0)break;const _0x2647bd=await _0x55856d(_0xb86abb,async _0x1fa755=>{const _0x51a862=_0x5d4eac;_0x272081[_0x51a862(0x117)](_0x1fa755);const _0x4d9678=await fetchSegment(_0x30abfc,_0x2bcffb,_0x1fa755,_0x2c28e8);if(!_0x4d9678)return null;return{'segmentId':_0x1fa755,'segment':_0x4d9678};},0xa),_0x4e83a8=new Set();for(const _0x2f57be of _0x2647bd){if(!_0x2f57be?.[_0x5d4eac(0x208)]?.[_0x5d4eac(0x16a)])continue;const _0x276231=apiRuleToYaml(_0x2f57be[_0x5d4eac(0x208)][_0x5d4eac(0x16a)]);_0x222b26[_0x5d4eac(0x14a)](_0x2f57be[_0x5d4eac(0x156)],_0x276231);const _0x127f5e=collectSegmentRefsFromRule(_0x276231);for(const _0x17686b of _0x127f5e){!_0x272081[_0x5d4eac(0x1ac)](_0x17686b)&&_0x4e83a8[_0x5d4eac(0x117)](_0x17686b);}}_0x1ddc39=Array[_0x5d4eac(0x1f4)](_0x4e83a8);}};return{'createYamlContext':_0x1edd44,'prefetchJourneySegments':_0x255e1c};}export async function executePushSegments(_0xa38847,_0x5853b0,_0x25442c,_0x2a6c48,_0x178bed){const _0x35401d=a152_0x261771,{segmentDefToCreateRequest:_0x545faf,segmentDefToUpdateRequest:_0x35710b}=await import(_0x35401d(0x146)),_0x2c726e=_0x25442c[_0x35401d(0x1a3)],_0x550740=0x5,_0x4af20f=async _0x43122c=>{const _0x2e57c9=_0x35401d,_0x12048b=_0x43122c[_0x2e57c9(0x1c6)]?_0x2c726e['get'](_0x43122c['folderPath']):undefined;let _0x46544a;const _0x4ec16b={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0xb3cd26=_0x43122c[_0x2e57c9(0x1ae)];if(_0x43122c[_0x2e57c9(0x1ae)][_0x2e57c9(0x16a)]){const _0x42f36d=createSegmentIdResolver(_0x25442c[_0x2e57c9(0x1cc)],_0x43122c['yamlConfig'][_0x2e57c9(0x1ff)]),_0x48cf30=await resolveRuleSegmentIds(_0x43122c['yamlConfig']['rule'],_0x42f36d);_0xb3cd26={..._0x43122c[_0x2e57c9(0x1ae)],'rule':_0x48cf30};}try{if(_0x43122c[_0x2e57c9(0x12d)]){_0x178bed[_0x2e57c9(0x161)]?.({'type':_0x2e57c9(0x1bc),'name':_0x43122c[_0x2e57c9(0x1ae)][_0x2e57c9(0x1ff)]});const _0x1eb906=_0x545faf(_0xb3cd26,_0x12048b),_0x46a708=await _0x178bed[_0x2e57c9(0x197)](_0x2e57c9(0x136)+_0x43122c[_0x2e57c9(0x1ae)][_0x2e57c9(0x1ff)]+_0x2e57c9(0x12f),()=>_0xa38847[_0x2e57c9(0x208)][_0x2e57c9(0x1d0)](_0x2a6c48[_0x2e57c9(0x184)],_0x1eb906));_0x46544a=_0x46a708[_0x2e57c9(0x164)]['id'],_0x25442c['segmentNameToId']['set'](_0x43122c['yamlConfig'][_0x2e57c9(0x1ff)],_0x46544a),_0x4ec16b[_0x2e57c9(0x1b0)]={'name':_0x43122c['yamlConfig']['name'],'id':_0x46544a},_0x178bed[_0x2e57c9(0x161)]?.({'type':_0x2e57c9(0x1c7),'name':_0x43122c[_0x2e57c9(0x1ae)][_0x2e57c9(0x1ff)],'segmentId':_0x46544a}),_0x178bed[_0x2e57c9(0x1cd)]?.(_0x2e57c9(0x1f1)+_0x43122c[_0x2e57c9(0x1ae)]['name']+'\x27'),_0x4ec16b[_0x2e57c9(0x1da)]=0x1;}else{if(_0x43122c['hasChanges']){_0x178bed[_0x2e57c9(0x161)]?.({'type':_0x2e57c9(0x17d),'name':_0x43122c[_0x2e57c9(0x1ae)][_0x2e57c9(0x1ff)]});const _0x58ecc0=_0x35710b(_0xb3cd26);_0x12048b!==_0x43122c['existingSegment']?.[_0x2e57c9(0x1c1)]&&(_0x58ecc0[_0x2e57c9(0x1c1)]=_0x12048b?parseInt(_0x12048b,0xa):undefined),await _0x178bed[_0x2e57c9(0x197)](_0x2e57c9(0x13c)+_0x43122c['yamlConfig'][_0x2e57c9(0x1ff)]+_0x2e57c9(0x12f),()=>_0xa38847[_0x2e57c9(0x208)][_0x2e57c9(0x15b)](_0x2a6c48['parentId'],_0x43122c[_0x2e57c9(0x19b)]['id'],_0x58ecc0)),_0x46544a=_0x43122c['existingSegment']['id'],_0x178bed[_0x2e57c9(0x161)]?.({'type':_0x2e57c9(0x1b8),'name':_0x43122c['yamlConfig'][_0x2e57c9(0x1ff)]}),_0x178bed[_0x2e57c9(0x1cd)]?.(_0x2e57c9(0x1fa)+_0x43122c[_0x2e57c9(0x1ae)]['name']+'\x27'),_0x4ec16b['updated']=0x1;}else _0x46544a=_0x43122c[_0x2e57c9(0x19b)]['id'];}}catch(_0xba9256){const _0xcf148d=isHttp400Error(_0xba9256),_0x557bab=_0xcf148d?ErrorCode[_0x2e57c9(0x1ce)]:ErrorCode[_0x2e57c9(0x1fb)],_0x3397b9=getErrorMessage(_0xba9256);throw new SDKError(_0x557bab,_0x2e57c9(0x1c2)+(_0x43122c['isNew']?_0x2e57c9(0x1f3):_0x2e57c9(0x1b4))+_0x2e57c9(0x1f9)+_0x43122c[_0x2e57c9(0x140)]+_0x2e57c9(0x196)+_0x3397b9,_0xba9256);}try{const _0x487714=await syncActivationsForSegment(_0xa38847,_0x2a6c48[_0x2e57c9(0x184)],_0x46544a,_0x43122c['yamlConfig'][_0x2e57c9(0x1ff)],_0x43122c[_0x2e57c9(0x1f0)],_0x178bed,_0x43122c[_0x2e57c9(0x140)]);_0x4ec16b['activations']=_0x487714;}catch(_0x40532d){if(_0x40532d instanceof SDKError)throw _0x40532d;throw new SDKError(ErrorCode[_0x2e57c9(0x193)],_0x2e57c9(0x1c0)+_0x43122c['yamlConfig'][_0x2e57c9(0x1ff)]+_0x2e57c9(0x20b)+_0x43122c[_0x2e57c9(0x140)]+_0x2e57c9(0x196)+getErrorMessage(_0x40532d),_0x40532d);}return _0x4ec16b;},_0x1ab390=await batchAsync(_0x5853b0,_0x4af20f,_0x550740),_0x538135={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x25eb32 of _0x1ab390){_0x538135[_0x35401d(0x1da)]+=_0x25eb32[_0x35401d(0x1da)],_0x538135[_0x35401d(0x1b9)]+=_0x25eb32[_0x35401d(0x1b9)],_0x25eb32[_0x35401d(0x1b0)]&&_0x538135[_0x35401d(0x119)][_0x35401d(0x14a)](_0x25eb32['createdSegmentId']['name'],_0x25eb32[_0x35401d(0x1b0)]['id']),_0x538135[_0x35401d(0x11e)][_0x35401d(0x1da)]+=_0x25eb32[_0x35401d(0x11e)][_0x35401d(0x1da)],_0x538135[_0x35401d(0x11e)]['updated']+=_0x25eb32[_0x35401d(0x11e)][_0x35401d(0x1b9)],_0x538135[_0x35401d(0x11e)][_0x35401d(0x1c4)]+=_0x25eb32[_0x35401d(0x11e)]['deleted'];}return _0x538135;}async function syncActivationsForSegment(_0x42d97e,_0x3a6af3,_0x5d98af,_0x5c08ba,_0x30a749,_0x4a18d7,_0x510d96){const _0x10bf59=a152_0x261771,_0x2ed0ae={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x361e60 of _0x30a749){try{if(_0x361e60[_0x10bf59(0x1e5)]===_0x10bf59(0x1f3)&&_0x361e60['validatedRequest'])_0x4a18d7[_0x10bf59(0x161)]?.({'type':_0x10bf59(0x1dc),'segmentName':_0x5c08ba,'activationName':_0x361e60['name']}),await _0x4a18d7['withProgress'](_0x10bf59(0x11f)+_0x361e60[_0x10bf59(0x1ff)]+_0x10bf59(0x12f),()=>_0x42d97e[_0x10bf59(0x208)][_0x10bf59(0x122)](_0x3a6af3,_0x5d98af,_0x361e60[_0x10bf59(0x129)])),_0x4a18d7[_0x10bf59(0x161)]?.({'type':_0x10bf59(0x1e6),'segmentName':_0x5c08ba,'activationName':_0x361e60[_0x10bf59(0x1ff)]}),_0x4a18d7[_0x10bf59(0x1cd)]?.('Created\x20activation\x20\x27'+_0x361e60['name']+'\x27'),_0x2ed0ae[_0x10bf59(0x1da)]++;else{if(_0x361e60[_0x10bf59(0x1e5)]==='update'&&_0x361e60[_0x10bf59(0x129)]&&_0x361e60[_0x10bf59(0x172)])_0x4a18d7[_0x10bf59(0x161)]?.({'type':_0x10bf59(0x214),'segmentName':_0x5c08ba,'activationName':_0x361e60[_0x10bf59(0x1ff)]}),await _0x4a18d7['withProgress'](_0x10bf59(0x191)+_0x361e60[_0x10bf59(0x1ff)]+_0x10bf59(0x12f),()=>_0x42d97e[_0x10bf59(0x208)][_0x10bf59(0x149)](_0x3a6af3,_0x5d98af,_0x361e60[_0x10bf59(0x172)]['id'],_0x361e60[_0x10bf59(0x129)])),_0x4a18d7[_0x10bf59(0x161)]?.({'type':_0x10bf59(0x13f),'segmentName':_0x5c08ba,'activationName':_0x361e60[_0x10bf59(0x1ff)]}),_0x4a18d7[_0x10bf59(0x1cd)]?.(_0x10bf59(0x115)+_0x361e60[_0x10bf59(0x1ff)]+'\x27'),_0x2ed0ae[_0x10bf59(0x1b9)]++;else _0x361e60[_0x10bf59(0x1e5)]==='delete'&&_0x361e60[_0x10bf59(0x172)]&&(_0x4a18d7[_0x10bf59(0x161)]?.({'type':'activation_deleting','segmentName':_0x5c08ba,'activationName':_0x361e60['name']}),await _0x4a18d7[_0x10bf59(0x197)]('Deleting\x20activation\x20\x27'+_0x361e60[_0x10bf59(0x1ff)]+_0x10bf59(0x12f),()=>_0x42d97e[_0x10bf59(0x208)][_0x10bf59(0x124)](_0x3a6af3,_0x5d98af,_0x361e60[_0x10bf59(0x172)]['id'])),_0x4a18d7[_0x10bf59(0x161)]?.({'type':_0x10bf59(0x1a2),'segmentName':_0x5c08ba,'activationName':_0x361e60[_0x10bf59(0x1ff)]}),_0x4a18d7[_0x10bf59(0x1a5)]?.('Deleted\x20activation\x20\x27'+_0x361e60[_0x10bf59(0x1ff)]+'\x27'),_0x2ed0ae['deleted']++);}}catch(_0x4e2c8d){const _0x9966e3=isHttp400Error(_0x4e2c8d),_0x358f96=_0x9966e3?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode[_0x10bf59(0x193)],_0x2f8d81=getErrorMessage(_0x4e2c8d);throw new SDKError(_0x358f96,'Failed\x20to\x20'+_0x361e60[_0x10bf59(0x1e5)]+'\x20activation\x20\x27'+_0x361e60[_0x10bf59(0x1ff)]+_0x10bf59(0x20b)+_0x510d96+_0x10bf59(0x196)+_0x2f8d81,_0x4e2c8d);}}return _0x2ed0ae;}export async function executePushFolders(_0x37249f,_0x35594c,_0x1ce71b,_0x566506,_0x2e8f37){const _0x300ca5=a152_0x261771,_0x3f03e5=new Map(_0x1ce71b),_0x4645b6=sortFoldersByDepth(_0x35594c);for(const _0x4f0b81 of _0x4645b6){const _0x3caf75=_0x4f0b81['split']('/'),_0xeec225=_0x3caf75[_0x3caf75[_0x300ca5(0x178)]-0x1],_0x5f364c=_0x3caf75[_0x300ca5(0x18c)](0x0,-0x1)[_0x300ca5(0x1d5)]('/'),_0x856e25=_0x3f03e5[_0x300ca5(0x114)](_0x5f364c);_0x2e8f37[_0x300ca5(0x161)]?.({'type':_0x300ca5(0x1c8),'folder':_0x4f0b81});const _0x284292={'name':_0xeec225,'parentFolderId':_0x856e25},_0xe91b7c=await _0x2e8f37[_0x300ca5(0x197)](_0x300ca5(0x183)+_0x4f0b81+_0x300ca5(0x12f),()=>_0x37249f[_0x300ca5(0x208)][_0x300ca5(0x18f)](_0x566506[_0x300ca5(0x184)],_0x284292));_0x3f03e5[_0x300ca5(0x14a)](_0x4f0b81,_0xe91b7c[_0x300ca5(0x164)]['id']),_0x2e8f37[_0x300ca5(0x161)]?.({'type':'folder_created','folder':_0x4f0b81,'folderId':_0xe91b7c[_0x300ca5(0x164)]['id']}),_0x2e8f37['logInfo']?.('Created\x20folder\x20\x27'+_0x4f0b81+'\x27');}return _0x3f03e5;}export async function executePushSegmentDeletions(_0x9d2297,_0x49ee56,_0x4db592){const _0x50265d=a152_0x261771;if(_0x49ee56['length']===0x0)return 0x0;const {batchAsync:_0x148d8d}=await import(_0x50265d(0x1e3)),_0x36fe3d=0x5,_0x11cbd5=await _0x148d8d(_0x49ee56,async _0x1bc894=>{const _0x4aad1d=_0x50265d;return _0x4db592[_0x4aad1d(0x161)]?.({'type':_0x4aad1d(0x1fd),'name':_0x1bc894[_0x4aad1d(0x1ff)]}),await _0x9d2297[_0x4aad1d(0x208)]['deleteSegment'](_0x1bc894['id']),_0x4db592[_0x4aad1d(0x161)]?.({'type':_0x4aad1d(0x20c),'name':_0x1bc894[_0x4aad1d(0x1ff)]}),_0x4db592[_0x4aad1d(0x1a5)]?.('Deleted\x20segment\x20\x27'+_0x1bc894[_0x4aad1d(0x1ff)]+'\x27'),0x1;},_0x36fe3d);return _0x11cbd5[_0x50265d(0x1df)]((_0x2aca61,_0x3c0348)=>_0x2aca61+_0x3c0348,0x0);}export async function executePushJourneys(_0x3209ba,_0x2ec5f2,_0x7166aa,_0x16af00,_0x2da457){const _0x150876=a152_0x261771,{journeyDefToRequest:_0x4de684}=await import(_0x150876(0x158)),{activationDefToCreateRequest:_0x73ab1a,yamlRuleToApi:_0x4383fb,validateSegmentRule:_0x3dcbe4}=await import(_0x150876(0x146)),_0x1fee86={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x5b998d=new Map(_0x7166aa[_0x150876(0x1cc)]),_0xdaf0d9=0x5;for(let _0x4fde2d=0x0;_0x4fde2d<_0x2ec5f2[_0x150876(0x178)];_0x4fde2d+=_0xdaf0d9){const _0x17d58e=_0x2ec5f2[_0x150876(0x18c)](_0x4fde2d,_0x4fde2d+_0xdaf0d9),_0x5cc0c2=await Promise['all'](_0x17d58e[_0x150876(0x15a)](async _0x57e845=>{const _0xa7df67=_0x150876;if(!_0x57e845[_0xa7df67(0x12d)]&&!_0x57e845['hasChanges'])return{'action':_0xa7df67(0x151),'name':_0x57e845[_0xa7df67(0x1ae)][_0xa7df67(0x1ff)],'journeyId':_0x57e845[_0xa7df67(0x1d4)]?.['id']};const _0x15e834=_0x57e845[_0xa7df67(0x1c6)]?_0x7166aa[_0xa7df67(0x1a3)]['get'](_0x57e845[_0xa7df67(0x1c6)]):undefined;_0x2da457[_0xa7df67(0x161)]?.({'type':_0x57e845[_0xa7df67(0x12d)]?_0xa7df67(0x159):'journey_updating','name':_0x57e845[_0xa7df67(0x1ae)]['name']});try{const _0x3a2264=await executeSingleJourneyPush(_0x3209ba,_0x57e845,{..._0x7166aa,'segmentNameToId':_0x5b998d},{'parentId':_0x16af00[_0xa7df67(0x184)],'rootFolderId':_0x16af00['rootFolderId'],'folderId':_0x15e834,'verbose':_0x16af00[_0xa7df67(0x177)]},_0x2da457,{'journeyDefToRequest':_0x4de684,'activationDefToCreateRequest':_0x73ab1a,'yamlRuleToApi':_0x4383fb,'validateSegmentRule':_0x3dcbe4});for(const [_0x47d204,_0x23f89b]of _0x3a2264[_0xa7df67(0x123)]){_0x5b998d[_0xa7df67(0x14a)](_0x47d204,_0x23f89b),_0x1fee86['embeddedSegmentNameToId'][_0xa7df67(0x14a)](_0x47d204,_0x23f89b);}if(_0x3a2264['action']==='created')_0x2da457[_0xa7df67(0x161)]?.({'type':_0xa7df67(0x116),'name':_0x57e845[_0xa7df67(0x1ae)]['name'],'journeyId':_0x3a2264[_0xa7df67(0x206)]}),_0x2da457[_0xa7df67(0x1cd)]?.(_0xa7df67(0x211)+_0x57e845[_0xa7df67(0x1ae)]['name']+'\x27'),_0x1fee86[_0xa7df67(0x1da)]++;else _0x3a2264[_0xa7df67(0x13b)]===_0xa7df67(0x1b9)&&(_0x2da457[_0xa7df67(0x161)]?.({'type':_0xa7df67(0x1d2),'name':_0x57e845[_0xa7df67(0x1ae)][_0xa7df67(0x1ff)]}),_0x2da457[_0xa7df67(0x1cd)]?.(_0xa7df67(0x201)+_0x57e845['yamlConfig']['name']+'\x27'),_0x1fee86[_0xa7df67(0x1b9)]++);return{'action':_0x3a2264[_0xa7df67(0x13b)],'name':_0x57e845['yamlConfig'][_0xa7df67(0x1ff)],'journeyId':_0x3a2264[_0xa7df67(0x206)]};}catch(_0x42316d){const _0x4641e2=isHttp400Error(_0x42316d),_0x201843=_0x4641e2?ErrorCode[_0xa7df67(0x209)]:ErrorCode[_0xa7df67(0x1b2)],_0x4ed67f=getErrorMessage(_0x42316d);throw new SDKError(_0x201843,'Failed\x20to\x20'+(_0x57e845[_0xa7df67(0x12d)]?_0xa7df67(0x1f3):'update')+_0xa7df67(0x198)+_0x57e845[_0xa7df67(0x140)]+_0xa7df67(0x196)+_0x4ed67f,_0x42316d);}}));_0x1fee86[_0x150876(0x125)][_0x150876(0x1a7)](..._0x5cc0c2);}return _0x1fee86;}async function matchExistingJourneySegments(_0xa18ea2,_0x1c0b47,_0x40228f,_0x5d5a82,_0x114f80){const _0x3df456=a152_0x261771;if(!_0x1c0b47[_0x3df456(0x1d4)]||!_0x1c0b47[_0x3df456(0x1ae)]['segments'])return;const _0xa5d431=new Map(),_0x318acb=new Set();for(const _0x59f55f of Object[_0x3df456(0x19c)](_0x1c0b47[_0x3df456(0x1ae)][_0x3df456(0x174)])){const _0x1ce76d=generateDeterministicJourneySegmentName(_0x1c0b47['yamlConfig'][_0x3df456(0x1ff)],_0x59f55f);_0xa5d431[_0x3df456(0x14a)](_0x1ce76d,_0x59f55f),_0x318acb[_0x3df456(0x117)](_0x59f55f);}const _0x1c5aea=[],_0x386870=collectSegmentIdsFromJourneyApi(_0x1c0b47['existingJourney']);for(const _0x51f49b of _0x386870){const _0x2acf48=await fetchSegment(_0xa18ea2,_0x40228f,_0x51f49b,_0x5d5a82);if(!_0x2acf48?.[_0x3df456(0x1ff)])continue;const _0x4b9dbe=_0xa5d431[_0x3df456(0x114)](_0x2acf48[_0x3df456(0x1ff)]);_0x4b9dbe?(_0x114f80[_0x3df456(0x14a)](_0x4b9dbe,_0x51f49b),_0x318acb['delete'](_0x4b9dbe)):_0x1c5aea['push']({'id':_0x51f49b,'seg':_0x2acf48});}if(_0x318acb[_0x3df456(0x1e0)]>0x0&&_0x1c5aea[_0x3df456(0x178)]>0x0){const {localExpandedRuleToNames:_0x431736}=buildLocalExpandedRuleMappings(_0x1c0b47[_0x3df456(0x1ae)]),_0x387d9e=new Map();for(const {id:_0x139179,seg:_0xb90ec3}of _0x1c5aea){if(_0xb90ec3[_0x3df456(0x16a)]){const _0x57fdb1=apiRuleToYaml(_0xb90ec3[_0x3df456(0x16a)]);_0x387d9e[_0x3df456(0x14a)](_0x139179,_0x57fdb1);}}for(const {id:_0xd6577b,seg:_0x450bdb}of _0x1c5aea){if(!_0x450bdb['rule'])continue;const _0x27755e=_0x387d9e[_0x3df456(0x114)](_0xd6577b);if(!_0x27755e)continue;const _0x4f1b1a=serializeExpandedRule(_0x27755e,_0x387d9e),_0x3fda64=_0x431736['get'](_0x4f1b1a);if(_0x3fda64){const _0x4f21fb=_0x3fda64['find'](_0x9493ea=>_0x318acb[_0x3df456(0x1ac)](_0x9493ea));_0x4f21fb&&(_0x114f80['set'](_0x4f21fb,_0xd6577b),_0x318acb['delete'](_0x4f21fb),logger[_0x3df456(0x121)](_0x3df456(0x16b)+_0x450bdb['name']+_0x3df456(0x173)+_0x4f21fb+_0x3df456(0x212)));}}}}async function executeSingleJourneyPush(_0x19a21d,_0x1a439c,_0xf2e567,_0x3bd906,_0x120832,_0xc71411){const _0x426b95=a152_0x261771,{journeyDefToRequest:_0x519874,activationDefToCreateRequest:_0x181624,yamlRuleToApi:_0x49f28a,validateSegmentRule:_0x46ac96}=_0xc71411,_0xb4cc5f=new Map(),_0xcf0fb8=new Map();recoverSegmentIdsFromPushRecovery(_0x1a439c,_0xb4cc5f,_0xf2e567['segmentNameToId']);const _0x143db3=new Map(),_0x2f2378=new Map(),_0x374188=new Map();let _0x922a6c;const _0x2c0416=async()=>{const _0x9de7eb=a152_0x57f8;if(_0x922a6c)return;_0x922a6c=new Map();if(!_0x1a439c['existingJourney'])return;const _0x44aa6e=await _0x19a21d[_0x9de7eb(0x165)][_0x9de7eb(0x152)](_0x1a439c[_0x9de7eb(0x1d4)]['id']);for(const _0x3d2606 of _0x44aa6e){const _0x32a386=journeyActivationStepToYaml(_0x3d2606,_0xf2e567[_0x9de7eb(0x1be)],_0xf2e567[_0x9de7eb(0x205)]),_0xd301e0=activationSignature(_0x32a386);!_0x922a6c[_0x9de7eb(0x1ac)](_0xd301e0)&&_0x922a6c[_0x9de7eb(0x14a)](_0xd301e0,_0x3d2606['id']),_0x32a386[_0x9de7eb(0x1ff)]&&_0xcf0fb8[_0x9de7eb(0x14a)](_0x32a386['name'],_0x3d2606['id']);}};await matchExistingJourneySegments(_0x19a21d,_0x1a439c,_0x3bd906[_0x426b95(0x184)],_0xf2e567[_0x426b95(0x143)],_0xf2e567[_0x426b95(0x1cc)]);const _0x5e1578={'resolveSegmentId':async _0x123dac=>{const _0x5205dd=_0x426b95,_0x14cf85=_0xf2e567['segmentNameToId']['get'](_0x123dac);if(!_0x14cf85)throw new SDKError(ErrorCode[_0x5205dd(0x1d6)],_0x5205dd(0x18d)+_0x123dac+_0x5205dd(0x1bf)+_0x1a439c[_0x5205dd(0x1ae)][_0x5205dd(0x1ff)]+')');return _0x14cf85;},'resolveEmbeddedSegmentId':async(_0x1e2287,_0x389b4d)=>{const _0x27e2de=_0x426b95,_0x188784=_0xf2e567['segmentNameToId']['get'](_0x1e2287);if(_0x188784)return _0x188784;const _0x17f1c4=_0xf2e567[_0x27e2de(0x143)][_0x27e2de(0x120)](_0x5d8247=>_0x5d8247[_0x27e2de(0x1ff)]===_0x1e2287);if(_0x17f1c4)return _0xf2e567[_0x27e2de(0x1cc)][_0x27e2de(0x14a)](_0x1e2287,_0x17f1c4['id']),_0x17f1c4['id'];if(_0x1a439c[_0x27e2de(0x12d)]){const {stageName:_0x20a618,criteriaName:_0x1ccfe7}=findSegmentCriteriaLocation(_0x1a439c[_0x27e2de(0x1ae)],_0x1e2287);return _0x46ac96(_0x1e2287,_0x389b4d['rule']),_0x2f2378[_0x27e2de(0x14a)](_0x1e2287,{'definition':_0x389b4d,'stageName':_0x20a618,'criteriaName':_0x1ccfe7}),createPendingSegmentId(_0x1e2287);}const _0x5554d4=_0x1a439c[_0x27e2de(0x1d4)]?.['id'];if(!_0x5554d4)throw new SDKError(ErrorCode[_0x27e2de(0x113)],_0x27e2de(0x210));const _0x5f3ba4=_0x143db3[_0x27e2de(0x114)](_0x1e2287);if(_0x5f3ba4)return _0x5f3ba4;const _0x5acd42=((async()=>{const _0x240355=_0x27e2de;_0x46ac96(_0x1e2287,_0x389b4d[_0x240355(0x16a)]);const _0x2c2fc6=generateDeterministicJourneySegmentName(_0x1a439c['yamlConfig']['name'],_0x1e2287),_0x122211=_0xf2e567['existingSegments'][_0x240355(0x120)](_0x3015d7=>_0x3015d7[_0x240355(0x1ff)]===_0x2c2fc6),_0x590647=createSegmentIdResolver(_0xf2e567[_0x240355(0x1cc)],_0x1e2287),_0x2eabf5=await resolveRuleSegmentIds(_0x389b4d['rule'],_0x590647);let _0x35dc57;return _0x122211?(await _0x19a21d['segment']['updateSegmentById'](_0x3bd906['parentId'],_0x122211['id'],{'description':_0x389b4d[_0x240355(0x11a)]||_0x240355(0x175)+_0x1e2287,'rule':_0x49f28a(_0x2eabf5,!![]),'countPopulation':!![]}),_0x35dc57=_0x122211['id'],saveSegmentToPushRecovery(_0x1a439c[_0x240355(0x140)],_0x1a439c[_0x240355(0x1ae)]['name'],_0x1e2287,{'segmentId':_0x35dc57,'uniqueServerName':_0x2c2fc6,'createdAt':new Date()[_0x240355(0x1e4)]()})):_0x35dc57=await createOrRecoverEmbeddedSegment(_0x19a21d,_0x1a439c,{'localName':_0x1e2287,'uniqueSegmentName':_0x2c2fc6,'description':_0x389b4d['description']||'Entry\x20criteria:\x20'+_0x1e2287,'journeyId':_0x5554d4,'resolvedRule':_0x2eabf5,'parentId':_0x3bd906[_0x240355(0x184)],'folderId':_0x3bd906['rootFolderId']||''},_0x49f28a),_0xf2e567['segmentNameToId'][_0x240355(0x14a)](_0x1e2287,_0x35dc57),_0xb4cc5f['set'](_0x1e2287,_0x35dc57),_0x35dc57;})());_0x143db3[_0x27e2de(0x14a)](_0x1e2287,_0x5acd42);try{return await _0x5acd42;}finally{_0x143db3['delete'](_0x1e2287);}},'resolveActivationId':async _0xe6a41f=>{const _0x1cb411=_0x426b95,_0x2fdbde=_0xcf0fb8[_0x1cb411(0x114)](_0xe6a41f);if(_0x2fdbde)return _0x2fdbde;if(_0x1a439c[_0x1cb411(0x1d4)]){await _0x2c0416();const _0x4fcd79=_0xcf0fb8[_0x1cb411(0x114)](_0xe6a41f);if(_0x4fcd79)return _0x4fcd79;}throw new SDKError(ErrorCode[_0x1cb411(0x10f)],_0x1cb411(0x1e1)+_0xe6a41f+_0x1cb411(0x1bf)+_0x1a439c['yamlConfig'][_0x1cb411(0x1ff)]+_0x1cb411(0x16d)+'Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.');},'resolveEmbeddedActivationId':async(_0xbef352,_0x2ccbf3)=>{const _0x1ff152=_0x426b95,_0x1d1382=_0xcf0fb8[_0x1ff152(0x114)](_0xbef352);if(_0x1d1382)return _0x1d1382;if(_0x1a439c['isNew'])return _0x374188['set'](_0xbef352,_0x2ccbf3),createPendingActivationId(_0xbef352);if(_0x1a439c['existingJourney']){await _0x2c0416();const _0x46840c=_0xcf0fb8[_0x1ff152(0x114)](_0x2ccbf3[_0x1ff152(0x1ff)]);if(_0x46840c)return _0xcf0fb8[_0x1ff152(0x14a)](_0xbef352,_0x46840c),_0x46840c;const _0x109e90=activationSignature(_0x2ccbf3),_0x265272=_0x922a6c?.[_0x1ff152(0x114)](_0x109e90);if(_0x265272)return _0xcf0fb8[_0x1ff152(0x14a)](_0xbef352,_0x265272),_0x265272;const _0x409307=await _0x181624(_0x2ccbf3,_0xf2e567['activationContext']),_0x4ab7fc={..._0x409307,..._0x2ccbf3[_0x1ff152(0x18e)]!==undefined&&{'runAfterJourneyRefresh':_0x2ccbf3[_0x1ff152(0x18e)]}},_0x4b27b8=await _0x19a21d[_0x1ff152(0x165)]['createActivation'](_0x1a439c['existingJourney']['id'],_0x4ab7fc);return _0xcf0fb8['set'](_0xbef352,_0x4b27b8['id']),_0x4b27b8['id'];}throw new SDKError(ErrorCode[_0x1ff152(0x113)],_0x1ff152(0x20e));},'resolveJourneyId':async _0xbf3c88=>{const _0x24ff12=_0x426b95;try{return await _0x19a21d[_0x24ff12(0x165)]['resolveJourneyId'](_0x3bd906[_0x24ff12(0x184)],_0xbf3c88);}catch(_0x6b768e){throw new SDKError(ErrorCode[_0x24ff12(0x10f)],'Journey\x20\x27'+_0xbf3c88+_0x24ff12(0x163)+_0x1a439c[_0x24ff12(0x1ae)]['name']+'\x27)',_0x6b768e);}},'resolveStageId':async(_0x275e92,_0x2185a2)=>{const _0x135e82=_0x426b95,_0x5040b4=await _0x19a21d[_0x135e82(0x165)][_0x135e82(0x1a9)](_0x275e92),_0x40f15a=_0x5040b4['attributes'][_0x135e82(0x16f)][_0x135e82(0x120)](_0x27516c=>_0x27516c[_0x135e82(0x1ff)]['toLowerCase']()===_0x2185a2[_0x135e82(0x203)]());if(!_0x40f15a?.['id'])throw new SDKError(ErrorCode[_0x135e82(0x10f)],_0x135e82(0x217)+_0x2185a2+_0x135e82(0x1cf)+(_0x5040b4[_0x135e82(0x145)][_0x135e82(0x1ed)]||_0x5040b4[_0x135e82(0x145)][_0x135e82(0x1ff)])+'\x27');return _0x40f15a['id'];}},_0x21e0e7=await _0x519874(_0x1a439c['yamlConfig'],_0x3bd906[_0x426b95(0x184)],_0x5e1578),_0x26f57b=_0x3bd906[_0x426b95(0x169)]||_0x3bd906[_0x426b95(0x1e2)];_0x26f57b&&(_0x21e0e7[_0x426b95(0x170)]={'parentFolder':{'data':{'id':_0x26f57b,'type':_0x426b95(0x14c)}}});if(_0x1a439c[_0x426b95(0x12d)]){if(_0x2f2378['size']>0x0||_0x374188[_0x426b95(0x1e0)]>0x0)return await executeThreeStepJourneyCreate(_0x19a21d,_0x1a439c,_0x21e0e7,{'pendingEmbeddedSegments':_0x2f2378,'pendingEmbeddedActivations':_0x374188,'embeddedSegmentNameToId':_0xb4cc5f,'journeyActivationNameToId':_0xcf0fb8},{..._0x3bd906,'effectiveFolderId':_0x26f57b},_0xf2e567,_0x120832,_0xc71411);else{ensureJourneyDefaults(_0x21e0e7[_0x426b95(0x145)]);const _0x7e135a=await _0x19a21d[_0x426b95(0x165)][_0x426b95(0x1f3)](_0x21e0e7);return deletePushRecovery(_0x1a439c[_0x426b95(0x140)]),{'action':_0x426b95(0x1da),'journeyId':_0x7e135a['id'],'embeddedSegmentNameToId':_0xb4cc5f};}}else{if(_0x1a439c[_0x426b95(0x162)]&&_0x1a439c[_0x426b95(0x1d4)]){_0x21e0e7['id']=_0x1a439c[_0x426b95(0x1d4)]['id'];const _0x54f245=_0x21e0e7[_0x426b95(0x145)];_0x1a439c[_0x426b95(0x1d4)][_0x426b95(0x145)]?.[_0x426b95(0x1ed)]&&(_0x54f245[_0x426b95(0x1ed)]=_0x1a439c[_0x426b95(0x1d4)]['attributes'][_0x426b95(0x1ed)]);const _0x316851=_0x1a439c[_0x426b95(0x1d4)]['attributes']?.[_0x426b95(0x16f)];return _0x316851&&_0x21e0e7[_0x426b95(0x145)]['journeyStages']&&injectExistingStageIds(_0x21e0e7[_0x426b95(0x145)]['journeyStages'],_0x316851),ensureJourneyDefaults(_0x54f245),await _0x19a21d[_0x426b95(0x165)][_0x426b95(0x1b4)](_0x1a439c['existingJourney']['id'],_0x21e0e7),deletePushRecovery(_0x1a439c[_0x426b95(0x140)]),{'action':'updated','journeyId':_0x1a439c[_0x426b95(0x1d4)]['id'],'embeddedSegmentNameToId':_0xb4cc5f};}}return deletePushRecovery(_0x1a439c[_0x426b95(0x140)]),{'action':_0x426b95(0x151),'journeyId':_0x1a439c[_0x426b95(0x1d4)]?.['id'],'embeddedSegmentNameToId':_0xb4cc5f};}function findSegmentCriteriaLocation(_0x173eb8,_0x2bc54d){const _0x2ccc3f=a152_0x261771,_0x547771=_0x173eb8[_0x2ccc3f(0x188)]||_0x173eb8[_0x2ccc3f(0x181)]?.[0x0]?.[_0x2ccc3f(0x188)]||[];let _0x25ba6d='entry',_0x11d97f=_0x2bc54d;const _0x3ca139=_0x173eb8[_0x2ccc3f(0x1ea)]||_0x173eb8[_0x2ccc3f(0x181)]?.[0x0]?.[_0x2ccc3f(0x1ea)];if(_0x3ca139?.['segment']===_0x2bc54d)return{'stageName':_0x2ccc3f(0x1ea),'criteriaName':_0x3ca139[_0x2ccc3f(0x1ff)]||_0x2bc54d};_0xac3620:for(const _0x3a0623 of _0x547771){if(_0x3a0623[_0x2ccc3f(0x199)]?.[_0x2ccc3f(0x208)]===_0x2bc54d){_0x25ba6d=_0x3a0623['name'],_0x11d97f=_0x3a0623[_0x2ccc3f(0x199)][_0x2ccc3f(0x1ff)]||_0x2bc54d;break;}if(_0x3a0623['steps'])for(const _0x25fc96 of _0x3a0623['steps']){if(_0x25fc96[_0x2ccc3f(0x1e5)]===_0x2ccc3f(0x11b)&&_0x25fc96[_0x2ccc3f(0x1af)]?.[_0x2ccc3f(0x192)])for(const _0x22bb81 of _0x25fc96['with'][_0x2ccc3f(0x192)]){if(_0x22bb81[_0x2ccc3f(0x208)]===_0x2bc54d){_0x25ba6d=_0x3a0623['name'],_0x11d97f=_0x22bb81[_0x2ccc3f(0x1ff)]||_0x2bc54d;break _0xac3620;}}}}return{'stageName':_0x25ba6d,'criteriaName':_0x11d97f};}async function executeThreeStepJourneyCreate(_0x32912d,_0x1eef56,_0x337424,_0x43268e,_0x689fb8,_0x84cec5,_0x320e3c,_0x1af876){const _0x574551=a152_0x261771,{activationDefToCreateRequest:_0x11da17,yamlRuleToApi:_0x50cc76}=_0x1af876,{pendingEmbeddedSegments:_0xf3e3cd,pendingEmbeddedActivations:_0x45fb01,embeddedSegmentNameToId:_0x504154}=_0x43268e,_0x1a38a6=JSON[_0x574551(0x1d1)](JSON['stringify'](_0x337424));ensureJourneyDefaults(_0x1a38a6['attributes']),stripPendingIds(_0x1a38a6);const _0x2f80b0=await _0x32912d[_0x574551(0x165)][_0x574551(0x1f3)](_0x1a38a6),_0x6aaffb=_0x2f80b0['id'],_0xabfe15=new Map();for(const _0x3209fa of _0x2f80b0[_0x574551(0x145)][_0x574551(0x16f)]){_0xabfe15[_0x574551(0x14a)](_0x3209fa[_0x574551(0x1ff)][_0x574551(0x203)](),_0x3209fa['id']);}recoverSegmentIdsFromPushRecovery(_0x1eef56,_0x504154,_0x84cec5[_0x574551(0x1cc)]);for(const [_0x34c715,{definition:_0x2c23db}]of _0xf3e3cd){if(_0x504154[_0x574551(0x1ac)](_0x34c715)){_0x320e3c[_0x574551(0x161)]?.({'type':_0x574551(0x1fe),'journeyName':_0x1eef56['yamlConfig'][_0x574551(0x1ff)],'segmentName':_0x34c715});continue;}const _0x51c174=generateDeterministicJourneySegmentName(_0x1eef56[_0x574551(0x1ae)]['name'],_0x34c715);_0x320e3c[_0x574551(0x161)]?.({'type':_0x574551(0x126),'journeyName':_0x1eef56[_0x574551(0x1ae)][_0x574551(0x1ff)],'segmentName':_0x34c715});const _0x3d8e0e=createSegmentIdResolver(_0x84cec5[_0x574551(0x1cc)],_0x34c715),_0x4f6134=await resolveRuleSegmentIds(_0x2c23db[_0x574551(0x16a)],_0x3d8e0e),_0x14350d=await createOrRecoverEmbeddedSegment(_0x32912d,_0x1eef56,{'localName':_0x34c715,'uniqueSegmentName':_0x51c174,'description':_0x2c23db[_0x574551(0x11a)]||_0x574551(0x175)+_0x34c715,'journeyId':_0x6aaffb,'resolvedRule':_0x4f6134,'parentId':_0x689fb8[_0x574551(0x184)],'folderId':_0x689fb8[_0x574551(0x1f6)]||''},_0x50cc76);_0x504154[_0x574551(0x14a)](_0x34c715,_0x14350d),_0x84cec5[_0x574551(0x1cc)][_0x574551(0x14a)](_0x34c715,_0x14350d),_0x320e3c[_0x574551(0x161)]?.({'type':_0x574551(0x1fe),'journeyName':_0x1eef56[_0x574551(0x1ae)]['name'],'segmentName':_0x34c715});}const _0x694cd8=new Map();for(const [_0x2e27e9,_0x14e0da]of _0x45fb01){_0x320e3c[_0x574551(0x161)]?.({'type':_0x574551(0x118),'journeyName':_0x1eef56[_0x574551(0x1ae)]['name'],'activationName':_0x2e27e9});const _0x24e1fe=await _0x11da17(_0x14e0da,_0x84cec5[_0x574551(0x180)]),_0x4e85cb={..._0x24e1fe,..._0x14e0da[_0x574551(0x18e)]!==undefined&&{'runAfterJourneyRefresh':_0x14e0da[_0x574551(0x18e)]}},_0x335e94=await _0x32912d[_0x574551(0x165)][_0x574551(0x122)](_0x6aaffb,_0x4e85cb);_0x694cd8[_0x574551(0x14a)](_0x2e27e9,_0x335e94['id']),_0x43268e[_0x574551(0x1a0)][_0x574551(0x14a)](_0x2e27e9,_0x335e94['id']),_0x320e3c[_0x574551(0x161)]?.({'type':_0x574551(0x13a),'journeyName':_0x1eef56[_0x574551(0x1ae)][_0x574551(0x1ff)],'activationName':_0x2e27e9});}const _0x2f9eae=JSON['parse'](JSON['stringify'](_0x337424));return _0x2f9eae['id']=_0x6aaffb,ensureJourneyDefaults(_0x2f9eae['attributes']),resolvePendingIdsInRequest(_0x2f9eae,_0x337424,_0xabfe15,_0x504154,_0x694cd8,_0x320e3c),await _0x32912d[_0x574551(0x165)][_0x574551(0x1b4)](_0x6aaffb,_0x2f9eae),deletePushRecovery(_0x1eef56[_0x574551(0x140)]),{'action':_0x574551(0x1da),'journeyId':_0x6aaffb,'embeddedSegmentNameToId':_0x504154};}export function stripWaitStepPendingIds(_0x40ed6a){const _0xecc645=a152_0x261771,_0x12344c=_0x40ed6a[_0xecc645(0x200)]&&isPendingSegmentId(_0x40ed6a[_0xecc645(0x200)]),_0x47404f=_0x40ed6a[_0xecc645(0x14b)]?.['some'](_0x374912=>_0x374912[_0xecc645(0x156)]&&isPendingSegmentId(_0x374912[_0xecc645(0x156)]));(_0x12344c||_0x47404f)&&(_0x40ed6a[_0xecc645(0x19f)]=_0xecc645(0x12e),_0x40ed6a['waitStep']=0x1,_0x40ed6a['waitStepUnit']='day',delete _0x40ed6a['conditionSegmentId'],delete _0x40ed6a[_0xecc645(0x1dd)],delete _0x40ed6a['conditionTimeoutUnit'],delete _0x40ed6a[_0xecc645(0x14b)]);}export function resolveWaitStepPendingIds(_0x33f095,_0x92795d,_0x10ec3e,_0x2e2ad1){const _0x576e83=a152_0x261771;if(_0x92795d[_0x576e83(0x200)]&&isPendingSegmentId(_0x92795d['conditionSegmentId'])){const _0x1a1ba6=_0x10ec3e(_0x92795d[_0x576e83(0x200)],_0x576e83(0x1c9)+_0x2e2ad1+'\x27\x20wait\x20condition');_0x1a1ba6&&(_0x33f095[_0x576e83(0x19f)]=_0x576e83(0x216),_0x33f095[_0x576e83(0x200)]=_0x1a1ba6,delete _0x33f095[_0x576e83(0x14d)],delete _0x33f095[_0x576e83(0x150)],_0x92795d[_0x576e83(0x1dd)]!==undefined&&(_0x33f095['conditionTimeoutDuration']=_0x92795d[_0x576e83(0x1dd)]),_0x92795d[_0x576e83(0x131)]&&(_0x33f095[_0x576e83(0x131)]=_0x92795d[_0x576e83(0x131)]));}if(_0x92795d[_0x576e83(0x14b)]){const _0x48c296=_0x92795d[_0x576e83(0x14b)]['some'](_0x16b267=>_0x16b267[_0x576e83(0x156)]&&isPendingSegmentId(_0x16b267[_0x576e83(0x156)]));if(_0x48c296){const _0x40f723=_0x92795d['conditions']['map'](_0x189672=>{const _0x51adec=_0x576e83;if(_0x189672[_0x51adec(0x156)]&&isPendingSegmentId(_0x189672[_0x51adec(0x156)])){const _0x2d7915=_0x10ec3e(_0x189672[_0x51adec(0x156)],_0x51adec(0x1c9)+_0x2e2ad1+_0x51adec(0x1c5));return{..._0x189672,'segmentId':_0x2d7915||_0x189672[_0x51adec(0x156)]};}return{..._0x189672};});_0x33f095[_0x576e83(0x19f)]=_0x576e83(0x216),_0x33f095[_0x576e83(0x14b)]=_0x40f723,delete _0x33f095[_0x576e83(0x14d)],delete _0x33f095[_0x576e83(0x150)],delete _0x33f095[_0x576e83(0x200)],delete _0x33f095[_0x576e83(0x1dd)],delete _0x33f095[_0x576e83(0x131)];}}}function stripPendingIds(_0x5790d0){const _0x5b3e17=a152_0x261771;_0x5790d0[_0x5b3e17(0x145)]['goal']?.[_0x5b3e17(0x156)]&&isPendingSegmentId(_0x5790d0[_0x5b3e17(0x145)][_0x5b3e17(0x1ea)][_0x5b3e17(0x156)])&&delete _0x5790d0[_0x5b3e17(0x145)][_0x5b3e17(0x1ea)];for(const _0x378b74 of _0x5790d0[_0x5b3e17(0x145)][_0x5b3e17(0x16f)]||[]){_0x378b74[_0x5b3e17(0x134)]?.[_0x5b3e17(0x156)]&&isPendingSegmentId(_0x378b74[_0x5b3e17(0x134)][_0x5b3e17(0x156)])&&delete _0x378b74[_0x5b3e17(0x134)];_0x378b74[_0x5b3e17(0x155)]?.[_0x5b3e17(0x156)]&&isPendingSegmentId(_0x378b74[_0x5b3e17(0x155)][_0x5b3e17(0x156)])&&delete _0x378b74[_0x5b3e17(0x155)];_0x378b74['exitCriterias']&&(_0x378b74[_0x5b3e17(0x13d)]=_0x378b74[_0x5b3e17(0x13d)][_0x5b3e17(0x1ad)](_0x1f2b3b=>!_0x1f2b3b[_0x5b3e17(0x156)]||!isPendingSegmentId(_0x1f2b3b[_0x5b3e17(0x156)])));if(_0x378b74[_0x5b3e17(0x179)])for(const _0x5dbc69 of Object['keys'](_0x378b74[_0x5b3e17(0x179)])){const _0x317c0e=_0x378b74['steps'][_0x5dbc69];_0x317c0e[_0x5b3e17(0x1e5)]==='Activation'&&_0x317c0e[_0x5b3e17(0x1b7)]&&isPendingActivationId(_0x317c0e[_0x5b3e17(0x1b7)])&&(_0x317c0e['journeyActivationStepId']='');if(_0x317c0e[_0x5b3e17(0x1e5)]==='DecisionPoint'&&_0x317c0e['branches'])for(const _0x36d746 of _0x317c0e[_0x5b3e17(0x192)]){_0x36d746[_0x5b3e17(0x156)]&&isPendingSegmentId(_0x36d746[_0x5b3e17(0x156)])&&(_0x36d746['segmentId']='');}_0x317c0e[_0x5b3e17(0x1e5)]===_0x5b3e17(0x1f8)&&stripWaitStepPendingIds(_0x317c0e);}}}function resolvePendingIdsInRequest(_0x4c13c1,_0x181321,_0x142723,_0x5306d4,_0x325128,_0x416e36){const _0x472a9c=a152_0x261771,_0x11dd10=(_0x2e1d87,_0x868850)=>{const _0x159b8e=a152_0x57f8;if(!isPendingSegmentId(_0x2e1d87))return _0x2e1d87;const _0x1895ec=extractPendingSegmentName(_0x2e1d87),_0x3c071c=_0x5306d4[_0x159b8e(0x114)](_0x1895ec);return!_0x3c071c&&_0x416e36[_0x159b8e(0x1bd)]?.(_0x159b8e(0x1e8)+_0x1895ec+_0x159b8e(0x160)+_0x868850),_0x3c071c;};if(_0x4c13c1[_0x472a9c(0x145)][_0x472a9c(0x1ea)]?.[_0x472a9c(0x156)]&&isPendingSegmentId(_0x4c13c1['attributes']['goal'][_0x472a9c(0x156)])){const _0x25c24e=_0x11dd10(_0x4c13c1['attributes']['goal'][_0x472a9c(0x156)],_0x472a9c(0x19d));_0x25c24e&&(_0x4c13c1['attributes']['goal'][_0x472a9c(0x156)]=_0x25c24e);}for(const _0x36faf1 of _0x4c13c1['attributes'][_0x472a9c(0x16f)]||[]){const _0x4e7281=_0x142723[_0x472a9c(0x114)](_0x36faf1[_0x472a9c(0x1ff)]['toLowerCase']());_0x4e7281&&(_0x36faf1['id']=_0x4e7281);if(_0x36faf1[_0x472a9c(0x134)]?.[_0x472a9c(0x156)]&&isPendingSegmentId(_0x36faf1[_0x472a9c(0x134)]['segmentId'])){const _0x3bd31c=_0x11dd10(_0x36faf1[_0x472a9c(0x134)]['segmentId'],_0x472a9c(0x1c9)+_0x36faf1[_0x472a9c(0x1ff)]+'\x27\x20entry\x20criteria');_0x3bd31c&&(_0x36faf1[_0x472a9c(0x134)][_0x472a9c(0x156)]=_0x3bd31c);}if(_0x36faf1[_0x472a9c(0x13d)])for(const _0x1f7888 of _0x36faf1[_0x472a9c(0x13d)]){if(_0x1f7888[_0x472a9c(0x156)]&&isPendingSegmentId(_0x1f7888[_0x472a9c(0x156)])){const _0x303202=_0x11dd10(_0x1f7888['segmentId'],_0x472a9c(0x1c9)+_0x36faf1[_0x472a9c(0x1ff)]+_0x472a9c(0x19a));_0x303202&&(_0x1f7888[_0x472a9c(0x156)]=_0x303202);}}if(_0x36faf1[_0x472a9c(0x155)]?.['segmentId']&&isPendingSegmentId(_0x36faf1['milestone'][_0x472a9c(0x156)])){const _0x22e267=_0x11dd10(_0x36faf1['milestone'][_0x472a9c(0x156)],_0x472a9c(0x1c9)+_0x36faf1['name']+_0x472a9c(0x185));_0x22e267&&(_0x36faf1[_0x472a9c(0x155)][_0x472a9c(0x156)]=_0x22e267);}if(_0x36faf1[_0x472a9c(0x179)]){const _0x1c9099=_0x394c81=>_0x181321[_0x472a9c(0x145)][_0x472a9c(0x16f)]?.[_0x472a9c(0x120)](_0x586cb9=>_0x586cb9[_0x472a9c(0x1ff)][_0x472a9c(0x203)]()===_0x36faf1[_0x472a9c(0x1ff)][_0x472a9c(0x203)]())?.[_0x472a9c(0x179)]?.[_0x394c81];for(const _0x37f07b of Object[_0x472a9c(0x19c)](_0x36faf1[_0x472a9c(0x179)])){const _0x5465ef=_0x36faf1['steps'][_0x37f07b],_0x361a45=_0x1c9099(_0x37f07b);if(_0x5465ef['type']===_0x472a9c(0x1b5)&&_0x5465ef[_0x472a9c(0x1b7)]&&(isPendingActivationId(_0x5465ef[_0x472a9c(0x1b7)])||_0x5465ef['journeyActivationStepId']==='')){if(_0x361a45?.[_0x472a9c(0x1b7)]&&isPendingActivationId(_0x361a45[_0x472a9c(0x1b7)])){const _0x40b8b4=extractPendingActivationName(_0x361a45[_0x472a9c(0x1b7)]),_0x4a1bc6=_0x325128['get'](_0x40b8b4);_0x4a1bc6&&(_0x5465ef[_0x472a9c(0x1b7)]=_0x4a1bc6);}}if(_0x5465ef[_0x472a9c(0x1e5)]===_0x472a9c(0x1d9)&&_0x5465ef[_0x472a9c(0x192)]&&_0x361a45?.[_0x472a9c(0x192)])for(let _0x5ba989=0x0;_0x5ba989<_0x5465ef[_0x472a9c(0x192)][_0x472a9c(0x178)];_0x5ba989++){const _0x4dbaef=_0x5465ef[_0x472a9c(0x192)][_0x5ba989],_0x1cde75=_0x361a45[_0x472a9c(0x192)][_0x5ba989];if(_0x1cde75?.[_0x472a9c(0x156)]&&isPendingSegmentId(_0x1cde75[_0x472a9c(0x156)])){const _0x3ea4d9=_0x11dd10(_0x1cde75[_0x472a9c(0x156)],_0x472a9c(0x1c9)+_0x36faf1[_0x472a9c(0x1ff)]+_0x472a9c(0x215)+(_0x4dbaef[_0x472a9c(0x1ff)]||_0x5ba989)+'\x27');_0x3ea4d9&&(_0x4dbaef[_0x472a9c(0x156)]=_0x3ea4d9);}}_0x5465ef['type']===_0x472a9c(0x1f8)&&_0x361a45?.[_0x472a9c(0x1e5)]===_0x472a9c(0x1f8)&&resolveWaitStepPendingIds(_0x5465ef,_0x361a45,_0x11dd10,_0x36faf1[_0x472a9c(0x1ff)]);}}}}
@@ -1 +1 @@
1
- (function(_0x438d41,_0x5d043c){const _0x2d9e9b=a153_0x5353,_0x1cbc15=_0x438d41();while(!![]){try{const _0x734c95=-parseInt(_0x2d9e9b(0x1ef))/0x1+parseInt(_0x2d9e9b(0x1f0))/0x2+parseInt(_0x2d9e9b(0x1fc))/0x3*(parseInt(_0x2d9e9b(0x1f6))/0x4)+parseInt(_0x2d9e9b(0x1ed))/0x5*(parseInt(_0x2d9e9b(0x1f8))/0x6)+-parseInt(_0x2d9e9b(0x1f5))/0x7+-parseInt(_0x2d9e9b(0x1fb))/0x8*(parseInt(_0x2d9e9b(0x1fa))/0x9)+parseInt(_0x2d9e9b(0x1f3))/0xa;if(_0x734c95===_0x5d043c)break;else _0x1cbc15['push'](_0x1cbc15['shift']());}catch(_0x4a7a12){_0x1cbc15['push'](_0x1cbc15['shift']());}}}(a153_0x1676,0x6d3c8));export function buildFolderIdToPathMap(_0x2afcb3){const _0x115482=a153_0x5353,_0x3f9462=new Map(),_0x192cce=new Map();for(const _0x24500b of _0x2afcb3){_0x192cce[_0x115482(0x1ee)](_0x24500b['id'],_0x24500b);}const _0x21b1e5=new Set();for(const _0xbc7bdf of _0x2afcb3){!_0xbc7bdf[_0x115482(0x1f1)]&&_0x21b1e5[_0x115482(0x1f4)](_0xbc7bdf['id']);}function _0x3d629(_0x2f0a35){const _0x41c1f9=_0x115482;if(_0x3f9462[_0x41c1f9(0x1f7)](_0x2f0a35['id']))return _0x3f9462['get'](_0x2f0a35['id']);if(_0x21b1e5[_0x41c1f9(0x1f7)](_0x2f0a35['id']))return _0x3f9462['set'](_0x2f0a35['id'],''),'';if(_0x2f0a35[_0x41c1f9(0x1f1)]){const _0x118405=_0x192cce[_0x41c1f9(0x1f9)](_0x2f0a35['parentFolderId']);if(_0x118405){const _0x117564=_0x3d629(_0x118405),_0x2c7a49=_0x117564?_0x117564+'/'+_0x2f0a35[_0x41c1f9(0x1f2)]:_0x2f0a35[_0x41c1f9(0x1f2)];return _0x3f9462['set'](_0x2f0a35['id'],_0x2c7a49),_0x2c7a49;}}const _0x379a60=_0x2f0a35[_0x41c1f9(0x1f2)];return _0x3f9462[_0x41c1f9(0x1ee)](_0x2f0a35['id'],_0x379a60),_0x379a60;}for(const _0x4da586 of _0x2afcb3){_0x3d629(_0x4da586);}return _0x3f9462;}export function buildFolderPathToIdMap(_0x4db5e6){const _0x3a89c8=a153_0x5353,_0x5e3ca3=new Map(),_0x35e76e=new Map();for(const _0x25e9e2 of _0x4db5e6){_0x35e76e[_0x3a89c8(0x1ee)](_0x25e9e2['id'],_0x25e9e2);}const _0x4f71a3=new Set();for(const _0xf5397d of _0x4db5e6){!_0xf5397d[_0x3a89c8(0x1f1)]&&_0x4f71a3[_0x3a89c8(0x1f4)](_0xf5397d['id']);}function _0x3c09fb(_0x17d4b0){const _0x3d6b59=_0x3a89c8;if(_0x4f71a3[_0x3d6b59(0x1f7)](_0x17d4b0['id']))return'';if(_0x17d4b0['parentFolderId']){const _0x1c5f57=_0x35e76e[_0x3d6b59(0x1f9)](_0x17d4b0[_0x3d6b59(0x1f1)]);if(_0x1c5f57){const _0x1252e9=_0x3c09fb(_0x1c5f57);return _0x1252e9?_0x1252e9+'/'+_0x17d4b0[_0x3d6b59(0x1f2)]:_0x17d4b0[_0x3d6b59(0x1f2)];}}return _0x17d4b0[_0x3d6b59(0x1f2)];}for(const _0x4332f4 of _0x4db5e6){const _0x46a5a0=_0x3c09fb(_0x4332f4);_0x5e3ca3[_0x3a89c8(0x1ee)](_0x46a5a0,_0x4332f4['id']);}return _0x5e3ca3;}export function buildFolderMaps(_0x4d0823){const _0x3ba41a=a153_0x5353,_0x3e9bfd=buildFolderIdToPathMap(_0x4d0823),_0x31e165=new Map();for(const [_0x28db73,_0x5a9217]of _0x3e9bfd){_0x31e165[_0x3ba41a(0x1ee)](_0x5a9217,_0x28db73);}return{'idToPath':_0x3e9bfd,'pathToId':_0x31e165};}export function getFolderPath(_0x26055a,_0x4888f9){const _0x2ece46=a153_0x5353;if(!_0x26055a)return'';return _0x4888f9[_0x2ece46(0x1f9)](_0x26055a)??'';}function a153_0x5353(_0xa5fbcd,_0x452c90){_0xa5fbcd=_0xa5fbcd-0x1ed;const _0x1676ad=a153_0x1676();let _0x535341=_0x1676ad[_0xa5fbcd];return _0x535341;}function a153_0x1676(){const _0x337a71=['417046qYfLEv','106072NkhCMG','parentFolderId','name','7771780QKhsVJ','add','2094435GoOEwt','373540ehbFDe','has','30mSRfTr','get','153EDAxHQ','218104vlZIpG','3ycRBoR','703555YHkvHI','set'];a153_0x1676=function(){return _0x337a71;};return a153_0x1676();}
1
+ (function(_0xe05beb,_0xf04a45){const _0x4bd163=a153_0x73db,_0x17270b=_0xe05beb();while(!![]){try{const _0x3fdd82=-parseInt(_0x4bd163(0x74))/0x1*(parseInt(_0x4bd163(0x6f))/0x2)+-parseInt(_0x4bd163(0x79))/0x3*(-parseInt(_0x4bd163(0x76))/0x4)+-parseInt(_0x4bd163(0x6b))/0x5+-parseInt(_0x4bd163(0x77))/0x6+parseInt(_0x4bd163(0x6c))/0x7+parseInt(_0x4bd163(0x6d))/0x8+parseInt(_0x4bd163(0x78))/0x9*(-parseInt(_0x4bd163(0x73))/0xa);if(_0x3fdd82===_0xf04a45)break;else _0x17270b['push'](_0x17270b['shift']());}catch(_0x5580db){_0x17270b['push'](_0x17270b['shift']());}}}(a153_0xe563,0x5bf63));export function buildFolderIdToPathMap(_0x24517b){const _0x27ed6f=a153_0x73db,_0x93e4b3=new Map(),_0xb3c73f=new Map();for(const _0x23d645 of _0x24517b){_0xb3c73f[_0x27ed6f(0x71)](_0x23d645['id'],_0x23d645);}const _0x31568e=new Set();for(const _0x20cc14 of _0x24517b){!_0x20cc14[_0x27ed6f(0x75)]&&_0x31568e[_0x27ed6f(0x72)](_0x20cc14['id']);}function _0x489a8d(_0x2d0de1){const _0x58ca24=_0x27ed6f;if(_0x93e4b3[_0x58ca24(0x70)](_0x2d0de1['id']))return _0x93e4b3['get'](_0x2d0de1['id']);if(_0x31568e[_0x58ca24(0x70)](_0x2d0de1['id']))return _0x93e4b3[_0x58ca24(0x71)](_0x2d0de1['id'],''),'';if(_0x2d0de1[_0x58ca24(0x75)]){const _0x453d43=_0xb3c73f[_0x58ca24(0x6e)](_0x2d0de1['parentFolderId']);if(_0x453d43){const _0x42d312=_0x489a8d(_0x453d43),_0x289c72=_0x42d312?_0x42d312+'/'+_0x2d0de1[_0x58ca24(0x7a)]:_0x2d0de1[_0x58ca24(0x7a)];return _0x93e4b3[_0x58ca24(0x71)](_0x2d0de1['id'],_0x289c72),_0x289c72;}}const _0x34cc81=_0x2d0de1[_0x58ca24(0x7a)];return _0x93e4b3[_0x58ca24(0x71)](_0x2d0de1['id'],_0x34cc81),_0x34cc81;}for(const _0x3e7c56 of _0x24517b){_0x489a8d(_0x3e7c56);}return _0x93e4b3;}export function buildFolderPathToIdMap(_0x28d7f6){const _0x58125f=a153_0x73db,_0x579b97=new Map(),_0x12438a=new Map();for(const _0x2ce03f of _0x28d7f6){_0x12438a[_0x58125f(0x71)](_0x2ce03f['id'],_0x2ce03f);}const _0x12f8f2=new Set();for(const _0x48ee76 of _0x28d7f6){!_0x48ee76[_0x58125f(0x75)]&&_0x12f8f2['add'](_0x48ee76['id']);}function _0x25e23b(_0x505971){const _0x5b60dd=_0x58125f;if(_0x12f8f2[_0x5b60dd(0x70)](_0x505971['id']))return'';if(_0x505971[_0x5b60dd(0x75)]){const _0x13e271=_0x12438a['get'](_0x505971[_0x5b60dd(0x75)]);if(_0x13e271){const _0x450d55=_0x25e23b(_0x13e271);return _0x450d55?_0x450d55+'/'+_0x505971[_0x5b60dd(0x7a)]:_0x505971['name'];}}return _0x505971[_0x5b60dd(0x7a)];}for(const _0x234648 of _0x28d7f6){const _0x146afd=_0x25e23b(_0x234648);_0x579b97[_0x58125f(0x71)](_0x146afd,_0x234648['id']);}return _0x579b97;}export function buildFolderMaps(_0x1e5943){const _0x5d672b=a153_0x73db,_0x1f884a=buildFolderIdToPathMap(_0x1e5943),_0x227f67=new Map();for(const [_0xab823d,_0x4fa8e3]of _0x1f884a){_0x227f67[_0x5d672b(0x71)](_0x4fa8e3,_0xab823d);}return{'idToPath':_0x1f884a,'pathToId':_0x227f67};}export function getFolderPath(_0xcbd92e,_0x513256){const _0x5935b1=a153_0x73db;if(!_0xcbd92e)return'';return _0x513256[_0x5935b1(0x6e)](_0xcbd92e)??'';}function a153_0x73db(_0x34218f,_0x5da092){_0x34218f=_0x34218f-0x6b;const _0xe56304=a153_0xe563();let _0x73db8c=_0xe56304[_0x34218f];return _0x73db8c;}function a153_0xe563(){const _0xac7882=['306306BWOzeU','9HsDYTB','42CHeLja','name','1400030uEDqiD','4836104GgYVsJ','4764056NtzoQL','get','38yjiHQC','has','set','add','10807810taCDDF','7922HDDETr','parentFolderId','186472YiTKVg'];a153_0xe563=function(){return _0xac7882;};return a153_0xe563();}
@@ -1 +1 @@
1
- (function(_0x372d25,_0x45fcae){const _0x328065=a154_0x2296,_0x1164f3=_0x372d25();while(!![]){try{const _0x53b836=parseInt(_0x328065(0xba))/0x1*(parseInt(_0x328065(0xbd))/0x2)+-parseInt(_0x328065(0x9c))/0x3+-parseInt(_0x328065(0xae))/0x4+parseInt(_0x328065(0x94))/0x5+parseInt(_0x328065(0xb4))/0x6+-parseInt(_0x328065(0x9f))/0x7*(-parseInt(_0x328065(0xbc))/0x8)+-parseInt(_0x328065(0xad))/0x9;if(_0x53b836===_0x45fcae)break;else _0x1164f3['push'](_0x1164f3['shift']());}catch(_0x8d893){_0x1164f3['push'](_0x1164f3['shift']());}}}(a154_0x5448,0xa73ea));function a154_0x5448(){const _0x4ab974=['Cannot\x20navigate\x20above\x20root','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','.yaml','join','split','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','segment','parse','1848771tjEDAa','5152432rXeYcg','exists','startsWith','isAbsolute','replace','.yml','5704788JuvFZw','endsWith','slice','journey','name','test','182047QiXeRG','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','8738200eaaPFm','2sIGrSR','pop','segments','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','push','3343740BNewIo','readFile','length','Path\x20segment\x20cannot\x20be\x20empty','Cannot\x20split\x20empty\x20path','raw','substring','resolve','2145921iiRBIL','type','Path\x20attempts\x20to\x20navigate\x20above\x20root','7WQdhwt','File\x20not\x20found:\x20','trim','No\x20tdx.json\x20found\x20for\x20file:\x20','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','dirname'];a154_0x5448=function(){return _0x4ab974;};return a154_0x5448();}import a154_0x47c327 from'path';import{parse as a154_0x475363}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x3b3ebf){const _0x16a966=a154_0x2296;if(!_0x3b3ebf||_0x3b3ebf[_0x16a966(0xa1)]()==='')throw new Error('Path\x20cannot\x20be\x20empty');const _0x4f90ba=_0x3b3ebf[_0x16a966(0xa1)]();if(_0x4f90ba==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x3b3ebf};const _0x318974=_0x4f90ba[_0x16a966(0xb0)]('/')?_0x4f90ba[_0x16a966(0x9a)](0x1):_0x4f90ba,_0x132c68=_0x318974[_0x16a966(0xa9)]('/')['filter'](_0x14c2b2=>_0x14c2b2!=='');if(_0x132c68['length']===0x0)throw new Error(_0x16a966(0xaa));const _0x5d4ec2=_0x4f90ba[_0x16a966(0xb0)]('/')||!isRelativePathSegment(_0x132c68[0x0]);for(const _0x51a887 of _0x132c68){validatePathSegment(_0x51a887);}return{'segments':_0x132c68,'isAbsolute':_0x5d4ec2,'raw':_0x3b3ebf};}function isRelativePathSegment(_0x4fc45c){return _0x4fc45c==='.'||_0x4fc45c==='..';}function validatePathSegment(_0x12ae52){const _0x3037d4=a154_0x2296;if(_0x12ae52==='')throw new Error(_0x3037d4(0x97));if(_0x12ae52==='.'||_0x12ae52==='..')return;if(/[\x00-\x1F\x7F]/[_0x3037d4(0xb9)](_0x12ae52))throw new Error(_0x3037d4(0xa3)+_0x12ae52);if(_0x12ae52!==_0x12ae52['trim']()){}}export function validatePath(_0x46636b){const _0x24b726=a154_0x2296;if(_0x46636b[_0x24b726(0xbf)]['length']===0x0&&!_0x46636b[_0x24b726(0xb1)])throw new Error('Relative\x20path\x20cannot\x20be\x20empty');if(_0x46636b[_0x24b726(0xb1)]){if(_0x46636b[_0x24b726(0xbf)][0x0]==='..')throw new Error(_0x24b726(0xc0));let _0x1a68f7=0x0;for(const _0x48bb25 of _0x46636b[_0x24b726(0xbf)]){if(_0x48bb25==='..'){if(_0x1a68f7===0x0)throw new Error(_0x24b726(0x9e));_0x1a68f7--;}else _0x48bb25!=='.'&&_0x1a68f7++;}}}export function joinPaths(_0x3974a4,_0x5e9d7c){const _0x2d133c=a154_0x2296;if(!_0x3974a4||_0x3974a4==='/')return _0x5e9d7c;if(!_0x5e9d7c||_0x5e9d7c==='.')return _0x3974a4;if(_0x5e9d7c[_0x2d133c(0xb0)]('/'))return _0x5e9d7c;const _0x2c7db8=parsePath(_0x3974a4),_0x367daa=parsePath(_0x5e9d7c),_0x317bb8=[..._0x2c7db8[_0x2d133c(0xbf)]];for(const _0x35da80 of _0x367daa[_0x2d133c(0xbf)]){if(_0x35da80==='.')continue;else{if(_0x35da80==='..'){if(_0x317bb8['length']===0x0)throw new Error(_0x2d133c(0xa5));_0x317bb8['pop']();}else _0x317bb8[_0x2d133c(0xc1)](_0x35da80);}}const _0x4446e4=_0x317bb8[_0x2d133c(0xa8)]('/');return _0x2c7db8[_0x2d133c(0x99)]['startsWith']('/')?'/'+_0x4446e4:_0x4446e4;}function a154_0x2296(_0x4eaf7e,_0x1da5a0){_0x4eaf7e=_0x4eaf7e-0x94;const _0x544884=a154_0x5448();let _0x2296cf=_0x544884[_0x4eaf7e];return _0x2296cf;}export function normalizePath(_0x2fb78f){const _0x2efe9a=a154_0x2296,_0x44e1ce=parsePath(_0x2fb78f),_0xd704ca=[];for(const _0x45c52d of _0x44e1ce['segments']){if(_0x45c52d==='.')continue;else{if(_0x45c52d==='..'){if(_0xd704ca['length']===0x0){if(_0x44e1ce['isAbsolute'])throw new Error(_0x2efe9a(0xa5));_0xd704ca[_0x2efe9a(0xc1)]('..');}else _0xd704ca[_0xd704ca[_0x2efe9a(0x96)]-0x1]==='..'?_0xd704ca[_0x2efe9a(0xc1)]('..'):_0xd704ca[_0x2efe9a(0xbe)]();}else _0xd704ca[_0x2efe9a(0xc1)](_0x45c52d);}}if(_0xd704ca[_0x2efe9a(0x96)]===0x0)return _0x44e1ce[_0x2efe9a(0xb1)]?'/':'.';const _0x5e4a6c=_0xd704ca[_0x2efe9a(0xa8)]('/');return _0x44e1ce[_0x2efe9a(0x99)][_0x2efe9a(0xb0)]('/')?'/'+_0x5e4a6c:_0x5e4a6c;}export function getParentPath(_0x1e2087){const _0x4fc495=a154_0x2296,_0x580706=parsePath(_0x1e2087);if(_0x580706[_0x4fc495(0xbf)][_0x4fc495(0x96)]<=0x1)return'/';const _0x3ebf80=_0x580706[_0x4fc495(0xbf)][_0x4fc495(0xb6)](0x0,-0x1)[_0x4fc495(0xa8)]('/');return _0x580706[_0x4fc495(0x99)][_0x4fc495(0xb0)]('/')?'/'+_0x3ebf80:_0x3ebf80;}export function getBaseName(_0x4debae){const _0x158de3=a154_0x2296,_0x59d672=parsePath(_0x4debae);return _0x59d672['segments'][_0x59d672[_0x158de3(0xbf)][_0x158de3(0x96)]-0x1]||'';}export function isChildPath(_0x586d5b,_0xc0ff03){const _0x397d6a=a154_0x2296,_0x55046b=parsePath(_0x586d5b),_0x445c48=parsePath(_0xc0ff03);if(_0x55046b['segments'][_0x397d6a(0x96)]<=_0x445c48['segments'][_0x397d6a(0x96)])return![];for(let _0x51c4f3=0x0;_0x51c4f3<_0x445c48[_0x397d6a(0xbf)][_0x397d6a(0x96)];_0x51c4f3++){if(_0x55046b[_0x397d6a(0xbf)][_0x51c4f3]!==_0x445c48[_0x397d6a(0xbf)][_0x51c4f3])return![];}return!![];}export function splitPath(_0x309188){const _0x311411=a154_0x2296,_0xbea2f1=parsePath(_0x309188);if(_0xbea2f1[_0x311411(0xbf)][_0x311411(0x96)]===0x0)throw new Error(_0x311411(0x98));if(_0xbea2f1[_0x311411(0xbf)][_0x311411(0x96)]===0x1)return{'parent':_0xbea2f1['segments'][0x0]};return{'parent':_0xbea2f1[_0x311411(0xbf)][0x0],'child':_0xbea2f1[_0x311411(0xbf)][_0x311411(0xb6)](0x1)[_0x311411(0xa8)]('/')};}export function isYamlFilePath(_0x21d178){const _0x44881b=a154_0x2296;return _0x21d178['endsWith'](_0x44881b(0xb3))||_0x21d178[_0x44881b(0xb5)](_0x44881b(0xa7));}export async function resolveYamlFilePath(_0x59c682,_0x1303f1=nodeFileSystem){const _0x40afe8=a154_0x2296,_0x234cf2=a154_0x47c327[_0x40afe8(0x9b)](_0x59c682);if(!await _0x1303f1[_0x40afe8(0xaf)](_0x234cf2))throw new Error(_0x40afe8(0xa0)+_0x59c682);let _0x1f3323=a154_0x47c327[_0x40afe8(0xa4)](_0x234cf2),_0x2dcca8=null,_0x9b7b1f=null;const _0x665cfc=a154_0x47c327[_0x40afe8(0xac)](_0x1f3323)['root'];while(_0x1f3323!==_0x665cfc){const _0x229fe0=a154_0x47c327[_0x40afe8(0xa8)](_0x1f3323,'tdx.json');if(await _0x1303f1[_0x40afe8(0xaf)](_0x229fe0)){_0x2dcca8=_0x229fe0,_0x9b7b1f=_0x1f3323;break;}_0x1f3323=a154_0x47c327[_0x40afe8(0xa4)](_0x1f3323);}if(!_0x2dcca8||!_0x9b7b1f)throw new Error(_0x40afe8(0xa2)+_0x59c682+'\x0a'+'Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.');const _0x2c1c13=await _0x1303f1[_0x40afe8(0x95)](_0x2dcca8),_0x16e250=JSON[_0x40afe8(0xac)](_0x2c1c13),_0x2468d8=_0x16e250['parent_segment'];if(!_0x2468d8)throw new Error(_0x40afe8(0xa6));const _0x3742f8=await _0x1303f1['readFile'](_0x234cf2),_0x35c6f1=a154_0x475363(_0x3742f8),_0x363113=_0x35c6f1[_0x40afe8(0xb8)];if(!_0x363113)throw new Error(_0x40afe8(0xbb)+_0x59c682);const _0x3024a0=_0x35c6f1[_0x40afe8(0x9d)]===_0x40afe8(0xb7)?_0x40afe8(0xb7):_0x40afe8(0xab),_0x4c3832=a154_0x47c327['relative'](_0x9b7b1f,_0x234cf2),_0x145cb9=a154_0x47c327[_0x40afe8(0xa4)](_0x4c3832),_0x42d83c=_0x145cb9==='.'?'':_0x145cb9[_0x40afe8(0xb2)](/\\/g,'/'),_0x576ba0=_0x42d83c?_0x2468d8+'/'+_0x42d83c+'/'+_0x363113:_0x2468d8+'/'+_0x363113;return{'parentSegment':_0x2468d8,'segmentName':_0x363113,'folderPath':_0x42d83c,'fullPath':_0x576ba0,'resourceType':_0x3024a0,'content':_0x3742f8};}
1
+ (function(_0x2f9483,_0x3f6ee0){const _0x323c24=a154_0x3af0,_0x2b154a=_0x2f9483();while(!![]){try{const _0x45ce41=-parseInt(_0x323c24(0x193))/0x1+parseInt(_0x323c24(0x1b4))/0x2+parseInt(_0x323c24(0x1b1))/0x3+parseInt(_0x323c24(0x1b2))/0x4*(-parseInt(_0x323c24(0x1a0))/0x5)+-parseInt(_0x323c24(0x1a8))/0x6+parseInt(_0x323c24(0x1ba))/0x7+parseInt(_0x323c24(0x198))/0x8;if(_0x45ce41===_0x3f6ee0)break;else _0x2b154a['push'](_0x2b154a['shift']());}catch(_0x3f1adf){_0x2b154a['push'](_0x2b154a['shift']());}}}(a154_0x17e0,0x4df61));import a154_0x3e3fa7 from'path';import{parse as a154_0x5f48c8}from'yaml';function a154_0x3af0(_0x252ff6,_0x2f4e43){_0x252ff6=_0x252ff6-0x18f;const _0x17e04d=a154_0x17e0();let _0x3af0a3=_0x17e04d[_0x252ff6];return _0x3af0a3;}import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x3b2052){const _0x2d2fe8=a154_0x3af0;if(!_0x3b2052||_0x3b2052[_0x2d2fe8(0x1b9)]()==='')throw new Error(_0x2d2fe8(0x1ac));const _0x47631f=_0x3b2052[_0x2d2fe8(0x1b9)]();if(_0x47631f==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x3b2052};const _0x27b237=_0x47631f[_0x2d2fe8(0x1a1)]('/')?_0x47631f[_0x2d2fe8(0x1a5)](0x1):_0x47631f,_0x3e207b=_0x27b237[_0x2d2fe8(0x199)]('/')[_0x2d2fe8(0x1a6)](_0x552d83=>_0x552d83!=='');if(_0x3e207b[_0x2d2fe8(0x19b)]===0x0)throw new Error(_0x2d2fe8(0x192));const _0x15c6b6=_0x47631f[_0x2d2fe8(0x1a1)]('/')||!isRelativePathSegment(_0x3e207b[0x0]);for(const _0x228275 of _0x3e207b){validatePathSegment(_0x228275);}return{'segments':_0x3e207b,'isAbsolute':_0x15c6b6,'raw':_0x3b2052};}function isRelativePathSegment(_0x446202){return _0x446202==='.'||_0x446202==='..';}function validatePathSegment(_0x1bbd78){const _0x359c3b=a154_0x3af0;if(_0x1bbd78==='')throw new Error('Path\x20segment\x20cannot\x20be\x20empty');if(_0x1bbd78==='.'||_0x1bbd78==='..')return;if(/[\x00-\x1F\x7F]/[_0x359c3b(0x1b8)](_0x1bbd78))throw new Error('Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20'+_0x1bbd78);if(_0x1bbd78!==_0x1bbd78[_0x359c3b(0x1b9)]()){}}export function validatePath(_0x1e8aba){const _0x35dffb=a154_0x3af0;if(_0x1e8aba[_0x35dffb(0x1bc)][_0x35dffb(0x19b)]===0x0&&!_0x1e8aba[_0x35dffb(0x195)])throw new Error(_0x35dffb(0x19a));if(_0x1e8aba[_0x35dffb(0x195)]){if(_0x1e8aba[_0x35dffb(0x1bc)][0x0]==='..')throw new Error(_0x35dffb(0x1b0));let _0x6231e8=0x0;for(const _0xbbce9c of _0x1e8aba['segments']){if(_0xbbce9c==='..'){if(_0x6231e8===0x0)throw new Error('Path\x20attempts\x20to\x20navigate\x20above\x20root');_0x6231e8--;}else _0xbbce9c!=='.'&&_0x6231e8++;}}}export function joinPaths(_0x49d3a9,_0x2011e5){const _0x271f66=a154_0x3af0;if(!_0x49d3a9||_0x49d3a9==='/')return _0x2011e5;if(!_0x2011e5||_0x2011e5==='.')return _0x49d3a9;if(_0x2011e5[_0x271f66(0x1a1)]('/'))return _0x2011e5;const _0x4462b6=parsePath(_0x49d3a9),_0x47d547=parsePath(_0x2011e5),_0x250361=[..._0x4462b6['segments']];for(const _0x1f9539 of _0x47d547['segments']){if(_0x1f9539==='.')continue;else{if(_0x1f9539==='..'){if(_0x250361['length']===0x0)throw new Error(_0x271f66(0x191));_0x250361[_0x271f66(0x1a3)]();}else _0x250361[_0x271f66(0x1b7)](_0x1f9539);}}const _0x2630dd=_0x250361[_0x271f66(0x190)]('/');return _0x4462b6[_0x271f66(0x1ad)][_0x271f66(0x1a1)]('/')?'/'+_0x2630dd:_0x2630dd;}export function normalizePath(_0x562fe3){const _0x157b36=a154_0x3af0,_0x1453a7=parsePath(_0x562fe3),_0x2099dc=[];for(const _0x5f1023 of _0x1453a7[_0x157b36(0x1bc)]){if(_0x5f1023==='.')continue;else{if(_0x5f1023==='..'){if(_0x2099dc[_0x157b36(0x19b)]===0x0){if(_0x1453a7['isAbsolute'])throw new Error('Cannot\x20navigate\x20above\x20root');_0x2099dc[_0x157b36(0x1b7)]('..');}else _0x2099dc[_0x2099dc[_0x157b36(0x19b)]-0x1]==='..'?_0x2099dc[_0x157b36(0x1b7)]('..'):_0x2099dc['pop']();}else _0x2099dc['push'](_0x5f1023);}}if(_0x2099dc['length']===0x0)return _0x1453a7[_0x157b36(0x195)]?'/':'.';const _0x13e293=_0x2099dc[_0x157b36(0x190)]('/');return _0x1453a7[_0x157b36(0x1ad)][_0x157b36(0x1a1)]('/')?'/'+_0x13e293:_0x13e293;}export function getParentPath(_0x4bc720){const _0x243d13=a154_0x3af0,_0x4d294a=parsePath(_0x4bc720);if(_0x4d294a[_0x243d13(0x1bc)][_0x243d13(0x19b)]<=0x1)return'/';const _0x3861b5=_0x4d294a[_0x243d13(0x1bc)][_0x243d13(0x1b5)](0x0,-0x1)['join']('/');return _0x4d294a[_0x243d13(0x1ad)][_0x243d13(0x1a1)]('/')?'/'+_0x3861b5:_0x3861b5;}export function getBaseName(_0x20b8c4){const _0x34c296=a154_0x3af0,_0x2eaa7b=parsePath(_0x20b8c4);return _0x2eaa7b['segments'][_0x2eaa7b[_0x34c296(0x1bc)][_0x34c296(0x19b)]-0x1]||'';}export function isChildPath(_0x1be0b6,_0x556a2b){const _0x3477a3=a154_0x3af0,_0x497f18=parsePath(_0x1be0b6),_0x2286fd=parsePath(_0x556a2b);if(_0x497f18[_0x3477a3(0x1bc)][_0x3477a3(0x19b)]<=_0x2286fd[_0x3477a3(0x1bc)][_0x3477a3(0x19b)])return![];for(let _0x583b75=0x0;_0x583b75<_0x2286fd[_0x3477a3(0x1bc)][_0x3477a3(0x19b)];_0x583b75++){if(_0x497f18[_0x3477a3(0x1bc)][_0x583b75]!==_0x2286fd[_0x3477a3(0x1bc)][_0x583b75])return![];}return!![];}export function splitPath(_0x380cf2){const _0x58816d=a154_0x3af0,_0x5069b2=parsePath(_0x380cf2);if(_0x5069b2[_0x58816d(0x1bc)][_0x58816d(0x19b)]===0x0)throw new Error('Cannot\x20split\x20empty\x20path');if(_0x5069b2[_0x58816d(0x1bc)]['length']===0x1)return{'parent':_0x5069b2['segments'][0x0]};return{'parent':_0x5069b2[_0x58816d(0x1bc)][0x0],'child':_0x5069b2[_0x58816d(0x1bc)]['slice'](0x1)['join']('/')};}export function isYamlFilePath(_0x1cec17){const _0x7d11ab=a154_0x3af0;return _0x1cec17['endsWith'](_0x7d11ab(0x1b3))||_0x1cec17[_0x7d11ab(0x19e)](_0x7d11ab(0x1a2));}function a154_0x17e0(){const _0x17c8b5=['startsWith','.yaml','pop','parse','substring','filter','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','1546692eSkiEJ','segment','type','journey','Path\x20cannot\x20be\x20empty','raw','root','exists','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','756309HCcWqp','7424yqWAgm','.yml','430212ikwwkV','slice','File\x20not\x20found:\x20','push','test','trim','2591372rNjvwi','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','segments','resolve','join','Cannot\x20navigate\x20above\x20root','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','414426kxYbyr','dirname','isAbsolute','readFile','relative','3415712BAUniE','split','Relative\x20path\x20cannot\x20be\x20empty','length','replace','parent_segment','endsWith','No\x20tdx.json\x20found\x20for\x20file:\x20','735XUDrzT'];a154_0x17e0=function(){return _0x17c8b5;};return a154_0x17e0();}export async function resolveYamlFilePath(_0x31ad48,_0x28ad6e=nodeFileSystem){const _0x27dc7d=a154_0x3af0,_0x7e5588=a154_0x3e3fa7[_0x27dc7d(0x18f)](_0x31ad48);if(!await _0x28ad6e[_0x27dc7d(0x1af)](_0x7e5588))throw new Error(_0x27dc7d(0x1b6)+_0x31ad48);let _0x37c035=a154_0x3e3fa7[_0x27dc7d(0x194)](_0x7e5588),_0x1f016a=null,_0x22397d=null;const _0x3daf43=a154_0x3e3fa7[_0x27dc7d(0x1a4)](_0x37c035)[_0x27dc7d(0x1ae)];while(_0x37c035!==_0x3daf43){const _0x57a39e=a154_0x3e3fa7[_0x27dc7d(0x190)](_0x37c035,'tdx.json');if(await _0x28ad6e['exists'](_0x57a39e)){_0x1f016a=_0x57a39e,_0x22397d=_0x37c035;break;}_0x37c035=a154_0x3e3fa7[_0x27dc7d(0x194)](_0x37c035);}if(!_0x1f016a||!_0x22397d)throw new Error(_0x27dc7d(0x19f)+_0x31ad48+'\x0a'+'Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.');const _0xa9bded=await _0x28ad6e[_0x27dc7d(0x196)](_0x1f016a),_0xf485aa=JSON[_0x27dc7d(0x1a4)](_0xa9bded),_0x47dbd3=_0xf485aa[_0x27dc7d(0x19d)];if(!_0x47dbd3)throw new Error(_0x27dc7d(0x1a7));const _0x538075=await _0x28ad6e[_0x27dc7d(0x196)](_0x7e5588),_0x3cdfec=a154_0x5f48c8(_0x538075),_0x2b7203=_0x3cdfec['name'];if(!_0x2b7203)throw new Error(_0x27dc7d(0x1bb)+_0x31ad48);const _0x36dced=_0x3cdfec[_0x27dc7d(0x1aa)]==='journey'?_0x27dc7d(0x1ab):_0x27dc7d(0x1a9),_0x72a124=a154_0x3e3fa7[_0x27dc7d(0x197)](_0x22397d,_0x7e5588),_0x4a2a95=a154_0x3e3fa7[_0x27dc7d(0x194)](_0x72a124),_0x11b8fd=_0x4a2a95==='.'?'':_0x4a2a95[_0x27dc7d(0x19c)](/\\/g,'/'),_0x1d9a4d=_0x11b8fd?_0x47dbd3+'/'+_0x11b8fd+'/'+_0x2b7203:_0x47dbd3+'/'+_0x2b7203;return{'parentSegment':_0x47dbd3,'segmentName':_0x2b7203,'folderPath':_0x11b8fd,'fullPath':_0x1d9a4d,'resourceType':_0x36dced,'content':_0x538075};}
@@ -1 +1 @@
1
- function a155_0x21d8(){const _0x386e52=['783960TBDKLG','20psuVcu','substring','3569424bYQqGR','Invalid\x20segment\x20reference\x20format:\x20','10pjLxAE','213689ETsDig','64696lPIFDa','531ykzMGo','2890008RuEoFh','indexOf','3332090cYoPVB','10279KxcUhK','3RTpURk'];a155_0x21d8=function(){return _0x386e52;};return a155_0x21d8();}(function(_0x12ce02,_0x118677){const _0x327e76=a155_0x263e,_0x10030e=_0x12ce02();while(!![]){try{const _0x292f4e=-parseInt(_0x327e76(0x1cc))/0x1*(-parseInt(_0x327e76(0x1cf))/0x2)+-parseInt(_0x327e76(0x1cd))/0x3*(parseInt(_0x327e76(0x1d1))/0x4)+parseInt(_0x327e76(0x1c5))/0x5*(parseInt(_0x327e76(0x1ce))/0x6)+-parseInt(_0x327e76(0x1c6))/0x7+parseInt(_0x327e76(0x1c7))/0x8*(parseInt(_0x327e76(0x1c8))/0x9)+parseInt(_0x327e76(0x1cb))/0xa+parseInt(_0x327e76(0x1c9))/0xb;if(_0x292f4e===_0x118677)break;else _0x10030e['push'](_0x10030e['shift']());}catch(_0x488240){_0x10030e['push'](_0x10030e['shift']());}}}(a155_0x21d8,0x7d8f9));function a155_0x263e(_0x3b6f21,_0x20787f){_0x3b6f21=_0x3b6f21-0x1c4;const _0x21d8f2=a155_0x21d8();let _0x263ec3=_0x21d8f2[_0x3b6f21];return _0x263ec3;}export function parseSegmentRef(_0x2cad66){const _0x1f7c65=a155_0x263e,_0x123fcb=_0x2cad66[_0x1f7c65(0x1ca)]('/');if(_0x123fcb===-0x1)return{'parentId':_0x2cad66};if(_0x123fcb===0x0)throw new Error(_0x1f7c65(0x1c4)+_0x2cad66+'.\x20Parent\x20name\x20cannot\x20be\x20empty');const _0x4a0859=_0x2cad66[_0x1f7c65(0x1d0)](0x0,_0x123fcb),_0xb88ec3=_0x2cad66[_0x1f7c65(0x1d0)](_0x123fcb+0x1);if(_0xb88ec3==='')throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x2cad66+'.\x20Child\x20name\x20cannot\x20be\x20empty');return{'parentId':_0x4a0859,'childId':_0xb88ec3};}
1
+ (function(_0x2cc12d,_0x1c32e8){const _0x4803d6=a155_0x353d,_0x13a9b5=_0x2cc12d();while(!![]){try{const _0x1fc6bf=-parseInt(_0x4803d6(0x13b))/0x1*(-parseInt(_0x4803d6(0x139))/0x2)+-parseInt(_0x4803d6(0x13f))/0x3*(-parseInt(_0x4803d6(0x13c))/0x4)+parseInt(_0x4803d6(0x133))/0x5*(parseInt(_0x4803d6(0x140))/0x6)+-parseInt(_0x4803d6(0x135))/0x7*(parseInt(_0x4803d6(0x13e))/0x8)+-parseInt(_0x4803d6(0x13a))/0x9+parseInt(_0x4803d6(0x141))/0xa*(-parseInt(_0x4803d6(0x134))/0xb)+-parseInt(_0x4803d6(0x138))/0xc;if(_0x1fc6bf===_0x1c32e8)break;else _0x13a9b5['push'](_0x13a9b5['shift']());}catch(_0x2f7e05){_0x13a9b5['push'](_0x13a9b5['shift']());}}}(a155_0x4264,0x3683b));function a155_0x4264(){const _0x4a3a80=['595784uHEPKr','234PSlMRS','6BfPIoh','30ddHnVv','1325335dwKzpR','474474KfJJww','28faGTGV','indexOf','substring','2964624atBpTR','226tGxqML','288nqWhFq','2978cUOXvc','15184BFqWkL','.\x20Parent\x20name\x20cannot\x20be\x20empty'];a155_0x4264=function(){return _0x4a3a80;};return a155_0x4264();}function a155_0x353d(_0x478a3a,_0x5d83d2){_0x478a3a=_0x478a3a-0x133;const _0x4264ba=a155_0x4264();let _0x353d01=_0x4264ba[_0x478a3a];return _0x353d01;}export function parseSegmentRef(_0x343cd6){const _0x542bb0=a155_0x353d,_0x5cb275=_0x343cd6[_0x542bb0(0x136)]('/');if(_0x5cb275===-0x1)return{'parentId':_0x343cd6};if(_0x5cb275===0x0)throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x343cd6+_0x542bb0(0x13d));const _0x239a62=_0x343cd6[_0x542bb0(0x137)](0x0,_0x5cb275),_0x866a3=_0x343cd6[_0x542bb0(0x137)](_0x5cb275+0x1);if(_0x866a3==='')throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x343cd6+'.\x20Child\x20name\x20cannot\x20be\x20empty');return{'parentId':_0x239a62,'childId':_0x866a3};}