@treasuredata/tdx 2026.3.32 → 2026.3.33

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 (245) 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.js +1 -1
  97. package/dist/sdk/cas/cas-api-client.js +1 -1
  98. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  99. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  100. package/dist/sdk/cas/index.js +1 -1
  101. package/dist/sdk/cas/pull-workflow.js +1 -1
  102. package/dist/sdk/cas/push-workflow.js +1 -1
  103. package/dist/sdk/client/cdp-api-client.js +1 -1
  104. package/dist/sdk/client/delivery-api-client.js +1 -1
  105. package/dist/sdk/client/endpoints.js +1 -1
  106. package/dist/sdk/client/engage-api-client.js +1 -1
  107. package/dist/sdk/client/http-client.js +1 -1
  108. package/dist/sdk/client/llm-api-client.js +1 -1
  109. package/dist/sdk/client/oauth-refresh.js +1 -1
  110. package/dist/sdk/client/rate-limiter.js +1 -1
  111. package/dist/sdk/client/td-api-client.js +1 -1
  112. package/dist/sdk/client/trino-api-client.js +1 -1
  113. package/dist/sdk/client/workflow-client.js +1 -1
  114. package/dist/sdk/connection-validator.js +1 -1
  115. package/dist/sdk/connection.js +1 -1
  116. package/dist/sdk/delivery.js +1 -1
  117. package/dist/sdk/engage/campaign-pull.js +1 -1
  118. package/dist/sdk/engage/campaign-push.js +1 -1
  119. package/dist/sdk/engage/campaign-validator.js +1 -1
  120. package/dist/sdk/engage/campaign-yaml.js +1 -1
  121. package/dist/sdk/engage/template-pull.js +1 -1
  122. package/dist/sdk/engage/template-push.js +1 -1
  123. package/dist/sdk/engage/template-validator.js +1 -1
  124. package/dist/sdk/engage/template-yaml.js +1 -1
  125. package/dist/sdk/engage/types/campaign-def.js +1 -1
  126. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  127. package/dist/sdk/engage/types/template-schema.js +1 -1
  128. package/dist/sdk/engage.js +1 -1
  129. package/dist/sdk/errors.js +1 -1
  130. package/dist/sdk/index.js +1 -1
  131. package/dist/sdk/io/index.js +1 -1
  132. package/dist/sdk/io/node-filesystem.js +1 -1
  133. package/dist/sdk/job.js +1 -1
  134. package/dist/sdk/journey.js +1 -1
  135. package/dist/sdk/llm/chat-cache.js +1 -1
  136. package/dist/sdk/llm/index.js +1 -1
  137. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  138. package/dist/sdk/llm/model-factors.js +1 -1
  139. package/dist/sdk/personalization.js +1 -1
  140. package/dist/sdk/policy.js +1 -1
  141. package/dist/sdk/query/index.js +1 -1
  142. package/dist/sdk/query/sql-parser.js +1 -1
  143. package/dist/sdk/realtime.js +1 -1
  144. package/dist/sdk/schedule.js +1 -1
  145. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  146. package/dist/sdk/segment/fields-display.js +1 -1
  147. package/dist/sdk/segment/file-discovery.js +1 -1
  148. package/dist/sdk/segment/journey-utils.js +1 -1
  149. package/dist/sdk/segment/journey-validator.js +1 -1
  150. package/dist/sdk/segment/journey-yaml.js +1 -1
  151. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  152. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  153. package/dist/sdk/segment/pull-workflow.js +1 -1
  154. package/dist/sdk/segment/push-recovery.js +1 -1
  155. package/dist/sdk/segment/push-workflow.js +1 -1
  156. package/dist/sdk/segment/resolution-context.js +1 -1
  157. package/dist/sdk/segment/segment-path-parser.js +1 -1
  158. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  159. package/dist/sdk/segment/segment-validator.js +1 -1
  160. package/dist/sdk/segment/target-resolution.js +1 -1
  161. package/dist/sdk/segment/tdx-config.js +1 -1
  162. package/dist/sdk/segment/types/activation-schema.js +1 -1
  163. package/dist/sdk/segment/types/journey-def.js +1 -1
  164. package/dist/sdk/segment/types/journey-schema.js +1 -1
  165. package/dist/sdk/segment/types/segment-def.js +1 -1
  166. package/dist/sdk/segment/types/segment-schema.js +1 -1
  167. package/dist/sdk/segment/validate-files.js +1 -1
  168. package/dist/sdk/segment/yaml-validator.js +1 -1
  169. package/dist/sdk/segment.js +1 -1
  170. package/dist/sdk/types/index.d.ts +1 -1
  171. package/dist/sdk/types/index.d.ts.map +1 -1
  172. package/dist/sdk/types/index.js +1 -1
  173. package/dist/sdk/types/progress.js +1 -1
  174. package/dist/sdk/types/workspace.d.ts +42 -19
  175. package/dist/sdk/types/workspace.d.ts.map +1 -1
  176. package/dist/sdk/types/workspace.js +1 -1
  177. package/dist/sdk/types/workspace.js.map +1 -1
  178. package/dist/sdk/user.js +1 -1
  179. package/dist/sdk/util/format-detector.js +1 -1
  180. package/dist/sdk/util/formatters.js +1 -1
  181. package/dist/sdk/util/index.js +1 -1
  182. package/dist/sdk/util/paginate.js +1 -1
  183. package/dist/sdk/util/tree-formatter.js +1 -1
  184. package/dist/sdk/workflow/archive-validation.js +1 -1
  185. package/dist/sdk/workflow/clone-workflow.js +1 -1
  186. package/dist/sdk/workflow/index.js +1 -1
  187. package/dist/sdk/workflow/pull-workflow.js +1 -1
  188. package/dist/sdk/workflow/push-workflow.js +1 -1
  189. package/dist/sdk/workflow/tdx-config.js +1 -1
  190. package/dist/sdk/workflow/workflow-utils.js +1 -1
  191. package/dist/sdk/workspace/frontmatter.js +1 -1
  192. package/dist/sdk/workspace/git.d.ts +15 -0
  193. package/dist/sdk/workspace/git.d.ts.map +1 -1
  194. package/dist/sdk/workspace/git.js +1 -1
  195. package/dist/sdk/workspace/git.js.map +1 -1
  196. package/dist/sdk/workspace/index.d.ts +38 -21
  197. package/dist/sdk/workspace/index.d.ts.map +1 -1
  198. package/dist/sdk/workspace/index.js +1 -1
  199. package/dist/sdk/workspace/index.js.map +1 -1
  200. package/dist/sdk/workspace/templates.js +1 -1
  201. package/dist/sdk/workspace/weekly.d.ts +49 -0
  202. package/dist/sdk/workspace/weekly.d.ts.map +1 -0
  203. package/dist/sdk/workspace/weekly.js +1 -0
  204. package/dist/sdk/workspace/weekly.js.map +1 -0
  205. package/dist/sdk/workspace/wikilinks.d.ts +7 -2
  206. package/dist/sdk/workspace/wikilinks.d.ts.map +1 -1
  207. package/dist/sdk/workspace/wikilinks.js +1 -1
  208. package/dist/sdk/workspace/wikilinks.js.map +1 -1
  209. package/dist/test-utils/command-runner.js +1 -1
  210. package/dist/test-utils/factories.js +1 -1
  211. package/dist/test-utils/fixtures.js +1 -1
  212. package/dist/test-utils/http-mock.js +1 -1
  213. package/dist/test-utils/index.js +1 -1
  214. package/dist/utils/async.js +1 -1
  215. package/dist/utils/colors.js +1 -1
  216. package/dist/utils/diff.js +1 -1
  217. package/dist/utils/file-permissions.js +1 -1
  218. package/dist/utils/file-reader.js +1 -1
  219. package/dist/utils/github-releases.js +1 -1
  220. package/dist/utils/global-cache.js +1 -1
  221. package/dist/utils/json-loader.js +1 -1
  222. package/dist/utils/local-cache.js +1 -1
  223. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  224. package/dist/utils/logger/formatters/index.js +1 -1
  225. package/dist/utils/logger/handlers/console-handler.js +1 -1
  226. package/dist/utils/logger/handlers/file-handler.js +1 -1
  227. package/dist/utils/logger/handlers/index.js +1 -1
  228. package/dist/utils/logger/handlers/null-handler.js +1 -1
  229. package/dist/utils/logger/index.js +1 -1
  230. package/dist/utils/logger/logger.js +1 -1
  231. package/dist/utils/logger/types.js +1 -1
  232. package/dist/utils/option-validation.js +1 -1
  233. package/dist/utils/process.js +1 -1
  234. package/dist/utils/prompt.js +1 -1
  235. package/dist/utils/spinner.js +1 -1
  236. package/dist/utils/sse-parser.js +1 -1
  237. package/dist/utils/string-utils.js +1 -1
  238. package/dist/utils/table-ref-parser.js +1 -1
  239. package/dist/utils/tdx-logger.js +1 -1
  240. package/dist/utils/version-check.js +1 -1
  241. package/package.json +1 -1
  242. package/dist/sdk/workspace/skills.d.ts +0 -34
  243. package/dist/sdk/workspace/skills.d.ts.map +0 -1
  244. package/dist/sdk/workspace/skills.js +0 -1
  245. 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(_0x16ffc0,_0x706c2e){const _0x58b2af=a151_0x21f3,_0x4ed2f1=_0x16ffc0();while(!![]){try{const _0x95cd8b=parseInt(_0x58b2af(0x116))/0x1*(parseInt(_0x58b2af(0x109))/0x2)+parseInt(_0x58b2af(0x107))/0x3+-parseInt(_0x58b2af(0x103))/0x4*(parseInt(_0x58b2af(0x114))/0x5)+parseInt(_0x58b2af(0x10c))/0x6+parseInt(_0x58b2af(0x118))/0x7*(parseInt(_0x58b2af(0x11a))/0x8)+parseInt(_0x58b2af(0x110))/0x9+-parseInt(_0x58b2af(0x111))/0xa*(parseInt(_0x58b2af(0x119))/0xb);if(_0x95cd8b===_0x706c2e)break;else _0x4ed2f1['push'](_0x4ed2f1['shift']());}catch(_0x49888f){_0x4ed2f1['push'](_0x4ed2f1['shift']());}}}(a151_0x5ae1,0xbd3c6));import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';import a151_0x403d74 from'path';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of']('tdx.sdk.push-recovery');export function getPushRecoveryPath(_0x28b34c){const _0x3fdb12=a151_0x21f3,_0xe2beb3=a151_0x403d74['dirname'](_0x28b34c),_0x48dbf6=a151_0x403d74[_0x3fdb12(0x117)](_0x28b34c);return a151_0x403d74[_0x3fdb12(0x108)](_0xe2beb3,'.'+_0x48dbf6+_0x3fdb12(0x104));}function a151_0x5ae1(){const _0x35e9d0=['Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20','ENOENT','3996wPxtiw','.push-recovery.json','code','version','4438701yfuwjk','join','838gvtwup','string','journeyName','7546470JUuZWB','stringify','utf-8','Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20','6494427YZnAZZ','1663140flVvWT','debug','.tmp','7460JeMuru','segments','2597dJDVyB','basename','406LLbzxA','209EtorWN','121176fSryiB'];a151_0x5ae1=function(){return _0x35e9d0;};return a151_0x5ae1();}export function readPushRecovery(_0x2fbc4b){const _0x102375=a151_0x21f3,_0x51f5e0=getPushRecoveryPath(_0x2fbc4b);if(!existsSync(_0x51f5e0))return undefined;try{const _0x3d2dd4=readFileSync(_0x51f5e0,_0x102375(0x10e)),_0x294bae=JSON['parse'](_0x3d2dd4);if(_0x294bae?.[_0x102375(0x106)]!==0x1||typeof _0x294bae['journeyName']!==_0x102375(0x10a))return undefined;return _0x294bae;}catch(_0x2938d7){return _0x2938d7 instanceof SyntaxError?logger[_0x102375(0x112)](_0x102375(0x11b)+_0x2938d7):logger['warn']('Failed\x20to\x20read\x20push\x20recovery\x20file:\x20'+_0x2938d7),undefined;}}function a151_0x21f3(_0x332927,_0x520bb4){_0x332927=_0x332927-0x102;const _0x5ae1df=a151_0x5ae1();let _0x21f341=_0x5ae1df[_0x332927];return _0x21f341;}export function writePushRecovery(_0x496612,_0x39cb08){const _0x46977b=a151_0x21f3,_0x27f672=getPushRecoveryPath(_0x496612),_0x4e59f0=_0x27f672+_0x46977b(0x113);writeFileSync(_0x4e59f0,JSON[_0x46977b(0x10d)](_0x39cb08,null,0x2)+'\x0a',_0x46977b(0x10e)),renameSync(_0x4e59f0,_0x27f672);}export function deletePushRecovery(_0x5e9e02){const _0x519abe=a151_0x21f3,_0x1356f1=getPushRecoveryPath(_0x5e9e02);try{unlinkSync(_0x1356f1);}catch(_0xfe41a){_0xfe41a[_0x519abe(0x105)]!==_0x519abe(0x102)&&logger['debug'](_0x519abe(0x10f)+_0xfe41a);}}export function saveSegmentToPushRecovery(_0xdf38,_0x1f8c86,_0x1a4ec0,_0x2b3e64){const _0x58447e=a151_0x21f3,_0x4609ef=readPushRecovery(_0xdf38),_0x39b4e2=_0x4609ef?.[_0x58447e(0x10b)]===_0x1f8c86?{..._0x4609ef,'updatedAt':new Date()['toISOString']()}:{'version':0x1,'journeyName':_0x1f8c86,'updatedAt':new Date()['toISOString'](),'segments':{}};_0x39b4e2[_0x58447e(0x115)][_0x1a4ec0]=_0x2b3e64,writePushRecovery(_0xdf38,_0x39b4e2);}
@@ -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
+ (function(_0xeddd9c,_0x216e6b){const _0x47506c=a152_0x4bbc,_0x4f0c3e=_0xeddd9c();while(!![]){try{const _0x1e3034=parseInt(_0x47506c(0x199))/0x1+-parseInt(_0x47506c(0x152))/0x2*(-parseInt(_0x47506c(0x178))/0x3)+parseInt(_0x47506c(0x1d4))/0x4+parseInt(_0x47506c(0xfa))/0x5*(parseInt(_0x47506c(0x12f))/0x6)+-parseInt(_0x47506c(0x174))/0x7*(parseInt(_0x47506c(0x143))/0x8)+parseInt(_0x47506c(0x1ab))/0x9*(-parseInt(_0x47506c(0x15b))/0xa)+parseInt(_0x47506c(0x1a9))/0xb*(-parseInt(_0x47506c(0x13d))/0xc);if(_0x1e3034===_0x216e6b)break;else _0x4f0c3e['push'](_0x4f0c3e['shift']());}catch(_0x512a6e){_0x4f0c3e['push'](_0x4f0c3e['shift']());}}}(a152_0x14ea,0x341bf));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of']('tdx.sdk.push-workflow');export const PENDING_SEGMENT_PREFIX='__pending_';export const PENDING_ACTIVATION_PREFIX='__pending_act_';export function createPendingSegmentId(_0x2422a2){return''+PENDING_SEGMENT_PREFIX+_0x2422a2+'__';}export function isPendingSegmentId(_0x15c739){const _0x8fb34b=a152_0x4bbc;return _0x15c739['startsWith'](PENDING_SEGMENT_PREFIX)&&!_0x15c739[_0x8fb34b(0x14c)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x136ba9){const _0x3bff9a=a152_0x4bbc;return _0x136ba9[_0x3bff9a(0x1cd)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x5ede46){return''+PENDING_ACTIVATION_PREFIX+_0x5ede46+'__';}export function isPendingActivationId(_0xe0bafd){const _0x46aa9d=a152_0x4bbc;return _0xe0bafd[_0x46aa9d(0x14c)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x1e58aa){const _0x5de08c=a152_0x4bbc;return _0x1e58aa[_0x5de08c(0x1cd)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x5b8101,_0x14c9d6){const _0xf5d277=a152_0x4bbc,_0x255c45=_0x5b8101+'::'+(_0x14c9d6[_0xf5d277(0x1a7)]()||'segment'),_0x2ff16f=createHash(_0xf5d277(0x1b2))[_0xf5d277(0x142)](_0x255c45)['digest']('hex')[_0xf5d277(0x1b9)](0x0,0xc);return _0xf5d277(0x13f)+_0x2ff16f;}export function ensureJourneyDefaults(_0x22ba80){const _0x1d0edf=a152_0x4bbc;!_0x22ba80[_0x1d0edf(0x19f)]&&(_0x22ba80['description']=''),!_0x22ba80['state']&&(_0x22ba80[_0x1d0edf(0x113)]='draft');}export function injectExistingStageIds(_0x6b93b1,_0x4a2509){const _0x1c9230=a152_0x4bbc,_0x30d0ff=new Map(_0x4a2509['map'](_0x16516b=>[_0x16516b[_0x1c9230(0x1da)],_0x16516b['id']]));for(const _0x102091 of _0x6b93b1){if(!_0x102091['id']){const _0x5f3fde=_0x30d0ff[_0x1c9230(0x138)](_0x102091[_0x1c9230(0x1da)]);_0x5f3fde&&(_0x102091['id']=_0x5f3fde);}}}export function resolveTDFolderPath(_0x56e625,_0x5a5e38,_0x399eac){const _0x557360=a152_0x4bbc;if(!_0x5a5e38)return _0x56e625;if(_0x56e625===_0x399eac||_0x56e625[_0x557360(0x14c)](_0x399eac+'/'))return _0x56e625;return _0x56e625?_0x399eac+'/'+_0x56e625:_0x399eac;}export function addFoldersToCreate(_0x55480a,_0x4384f1,_0x257c55){const _0x2160a4=a152_0x4bbc;if(!_0x55480a)return;if(_0x4384f1[_0x2160a4(0x1ad)](_0x55480a))return;const _0x54698f=_0x55480a['split']('/');let _0x4605bc='';for(const _0x3f53f2 of _0x54698f){_0x4605bc=_0x4605bc?_0x4605bc+'/'+_0x3f53f2:_0x3f53f2,!_0x4384f1['has'](_0x4605bc)&&_0x257c55[_0x2160a4(0x12c)](_0x4605bc);}}export function sortFoldersByDepth(_0x546df5){const _0x5192cf=a152_0x4bbc;return[..._0x546df5][_0x5192cf(0x135)]((_0x3dc8f2,_0x3e809f)=>{const _0x217abd=_0x5192cf,_0x6fd75a=(_0x3dc8f2[_0x217abd(0x13c)](/\//g)||[])[_0x217abd(0x175)],_0x45dc79=(_0x3e809f[_0x217abd(0x13c)](/\//g)||[])[_0x217abd(0x175)];return _0x6fd75a-_0x45dc79;});}import*as a152_0x24f2de from'yaml';import{readFileSync}from'fs';import a152_0x3752ae from'path';import{isJourneyDef,parseYamlString as a152_0x55956b,toYamlString as a152_0x585ff1,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(_0xa23781){const _0x1af84c=a152_0x4bbc;if(Array['isArray'](_0xa23781))return'['+_0xa23781[_0x1af84c(0x1db)](_0x1daf6d=>stableStringify(_0x1daf6d))[_0x1af84c(0x1ea)](',')+']';if(_0xa23781&&typeof _0xa23781==='object'){const _0x4b5fb4=_0xa23781,_0x7a53e6=Object[_0x1af84c(0x1b3)](_0x4b5fb4)[_0x1af84c(0x135)](),_0x820af3=_0x7a53e6[_0x1af84c(0x1db)](_0x47a3ce=>'\x22'+_0x47a3ce+'\x22:'+stableStringify(_0x4b5fb4[_0x47a3ce]));return'{'+_0x820af3[_0x1af84c(0x1ea)](',')+'}';}const _0x53fba6=JSON['stringify'](_0xa23781);return _0x53fba6===undefined?_0x1af84c(0x139):_0x53fba6;}function activationSignature(_0x11875b){const _0x4952d1=a152_0x4bbc,_0x679169={'connection':_0x11875b[_0x4952d1(0x1c7)],..._0x11875b[_0x4952d1(0x1cf)]!==undefined&&{'all_columns':_0x11875b[_0x4952d1(0x1cf)]},..._0x11875b[_0x4952d1(0x1ba)]!==undefined&&{'columns':_0x11875b['columns']},..._0x11875b[_0x4952d1(0x114)]!==undefined&&{'behavior':_0x11875b[_0x4952d1(0x114)]},..._0x11875b[_0x4952d1(0x196)]!==undefined&&{'schedule':_0x11875b[_0x4952d1(0x196)]},..._0x11875b[_0x4952d1(0x1e3)]!==undefined&&{'notification':_0x11875b[_0x4952d1(0x1e3)]},..._0x11875b[_0x4952d1(0x1b8)]!==undefined&&{'connector_config':_0x11875b[_0x4952d1(0x1b8)]},..._0x11875b[_0x4952d1(0x1a2)]!==undefined&&{'activation_template_id':_0x11875b[_0x4952d1(0x1a2)]}};return stableStringify(_0x679169);}async function fetchSegment(_0x51746f,_0x27e3c1,_0x18fb71,_0x45bf3d){const _0x19073b=a152_0x4bbc,_0x520bea=_0x45bf3d?.[_0x19073b(0x1a3)](_0x577a1d=>_0x577a1d['id']===_0x18fb71);if(_0x520bea)return _0x520bea;try{return await _0x51746f['segment'][_0x19073b(0x1ed)](_0x27e3c1,_0x18fb71);}catch(_0xbc4627){logger[_0x19073b(0x119)](_0x19073b(0x197)+_0x18fb71+_0x19073b(0x169)+_0xbc4627);try{return await _0x51746f[_0x19073b(0x161)][_0x19073b(0x15d)](_0x18fb71);}catch(_0x3657a2){return logger[_0x19073b(0x119)]('getSegmentEntity\x20also\x20failed\x20for\x20'+_0x18fb71+':\x20'+_0x3657a2),null;}}}function recoverSegmentIdsFromPushRecovery(_0x52c4d9,_0x37552d,_0x3682a5){const _0x47e2d7=a152_0x4bbc,_0x1b6a56=readPushRecovery(_0x52c4d9[_0x47e2d7(0x1ef)]);if(_0x1b6a56?.['journeyName']===_0x52c4d9[_0x47e2d7(0x1a1)][_0x47e2d7(0x1da)])for(const [_0x2787d2,_0x8fb067]of Object[_0x47e2d7(0x1cc)](_0x1b6a56[_0x47e2d7(0x134)])){const _0x383269=generateDeterministicJourneySegmentName(_0x52c4d9[_0x47e2d7(0x1a1)][_0x47e2d7(0x1da)],_0x2787d2);_0x8fb067[_0x47e2d7(0x159)]===_0x383269&&(_0x37552d[_0x47e2d7(0x18f)](_0x2787d2,_0x8fb067[_0x47e2d7(0x179)]),_0x3682a5[_0x47e2d7(0x18f)](_0x2787d2,_0x8fb067['segmentId']));}}async function createOrRecoverEmbeddedSegment(_0x460f0e,_0x41e80b,_0x368dee,_0x5c4751){const _0x2fb6a5=a152_0x4bbc;let _0x227d50;try{_0x227d50=await _0x460f0e[_0x2fb6a5(0x161)][_0x2fb6a5(0x1bf)]({'name':_0x368dee[_0x2fb6a5(0x1bd)],'description':_0x368dee[_0x2fb6a5(0x19f)],'journeyId':_0x368dee['journeyId'],'rule':_0x5c4751(_0x368dee[_0x2fb6a5(0x1e0)],!![]),'countPopulation':!![],'parentFolderId':_0x368dee['folderId'],'audienceId':_0x368dee[_0x2fb6a5(0x17c)]});}catch(_0x43a7cd){const _0x4afb08=_0x43a7cd instanceof Error&&_0x43a7cd[_0x2fb6a5(0x15f)][_0x2fb6a5(0x14e)](_0x2fb6a5(0x19d));if(_0x4afb08){const _0x277a12=readPushRecovery(_0x41e80b[_0x2fb6a5(0x1ef)]),_0x3ffa0e=_0x277a12?.[_0x2fb6a5(0x155)]===_0x41e80b[_0x2fb6a5(0x1a1)][_0x2fb6a5(0x1da)]?_0x277a12[_0x2fb6a5(0x134)][_0x368dee[_0x2fb6a5(0x1b6)]]:undefined;if(_0x3ffa0e?.['uniqueServerName']===_0x368dee[_0x2fb6a5(0x1bd)])await _0x460f0e[_0x2fb6a5(0x161)][_0x2fb6a5(0x1f0)](_0x368dee[_0x2fb6a5(0x17c)],_0x3ffa0e[_0x2fb6a5(0x179)],{'description':_0x368dee[_0x2fb6a5(0x19f)],'rule':_0x5c4751(_0x368dee[_0x2fb6a5(0x1e0)],!![]),'countPopulation':!![]}),_0x227d50=_0x3ffa0e[_0x2fb6a5(0x179)];else throw new SDKError(ErrorCode[_0x2fb6a5(0x1d1)],_0x2fb6a5(0x1ca)+_0x368dee[_0x2fb6a5(0x1b6)]+'\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20'+(_0x2fb6a5(0x10c)+_0x41e80b[_0x2fb6a5(0x1ef)]['replace'](/([^/]+)$/,_0x2fb6a5(0x13e))+')\x20')+_0x2fb6a5(0x131),_0x43a7cd);}else throw _0x43a7cd;}return saveSegmentToPushRecovery(_0x41e80b[_0x2fb6a5(0x1ef)],_0x41e80b['yamlConfig'][_0x2fb6a5(0x1da)],_0x368dee['localName'],{'segmentId':_0x227d50,'uniqueServerName':_0x368dee['uniqueSegmentName'],'createdAt':new Date()['toISOString']()}),_0x227d50;}function a152_0x4bbc(_0x270057,_0xa65067){_0x270057=_0x270057-0xf5;const _0x14ea14=a152_0x14ea();let _0x4bbc9a=_0x14ea14[_0x270057];return _0x4bbc9a;}export async function prepareSegmentFiles(_0x422333,_0x214058,_0x4e05f7,_0x7ea325,_0x54ff81){const _0x5831f8=a152_0x4bbc,{activationDefToCreateRequest:_0x18b438}=await import(_0x5831f8(0x16a)),_0x4a632e=[],_0x25bc62=new Set();for(const {yamlConfig:_0x42361d,folderPath:_0x234705,sourcePath:_0x2d1728}of _0x422333){const _0x2bf3f0=resolveTDFolderPath(_0x234705,_0x7ea325,_0x54ff81),_0x1ff323=_0x2bf3f0+':'+_0x42361d[_0x5831f8(0x1da)],_0x1394eb=_0x214058[_0x5831f8(0x158)]['get'](_0x1ff323),_0x36b916=_0x1394eb?_0x214058['activationsBySegmentId'][_0x5831f8(0x138)](_0x1394eb['id'])||[]:[];addFoldersToCreate(_0x2bf3f0,_0x214058[_0x5831f8(0x185)],_0x25bc62);const _0x15d7f9=calculateActivationActions(_0x42361d['activations']||[],_0x36b916,_0x214058[_0x5831f8(0x180)],_0x214058[_0x5831f8(0x186)]);for(const _0x145951 of _0x15d7f9){(_0x145951['type']===_0x5831f8(0x145)||_0x145951[_0x5831f8(0xf9)]===_0x5831f8(0x142))&&_0x145951['yamlActivation']&&(_0x145951[_0x5831f8(0x1a4)]=await _0x18b438(_0x145951[_0x5831f8(0x1c5)],_0x4e05f7));}const _0x2e6725=calculateSegmentDiff(_0x42361d,_0x1394eb,_0x36b916,_0x214058[_0x5831f8(0x180)],_0x214058['connectionIdToNameMap']);_0x4a632e['push']({'relativePath':_0x42361d[_0x5831f8(0x1da)],'absolutePath':_0x2d1728,'yamlConfig':_0x42361d,'folderPath':_0x2bf3f0,'existingSegment':_0x1394eb,'existingActivations':_0x36b916,'isNew':_0x2e6725[_0x5831f8(0x128)],'hasChanges':_0x2e6725['hasChanges'],'diff':_0x2e6725[_0x5831f8(0x121)],'activationActions':_0x15d7f9});}return{'segmentFiles':_0x4a632e,'foldersToCreate':_0x25bc62};}export async function prepareJourneyFiles(_0x4033a8,_0xe365cb,_0x43f3e2,_0x47655c){const _0x4c304f=a152_0x4bbc,_0x45295f=[],_0x32b978=new Set();for(const {yamlConfig:_0x1dbc28,folderPath:_0x24d7ea,sourcePath:_0x5b3432}of _0x4033a8){const _0x381041=resolveTDFolderPath(_0x24d7ea,_0x43f3e2,_0x47655c),_0x8cc1c6=_0x381041+':'+_0x1dbc28['name'],_0x53ff64=_0xe365cb[_0x4c304f(0x171)][_0x4c304f(0x138)](_0x8cc1c6);let _0x725dfe,_0xc2a7dc;if(_0x53ff64&&_0x53ff64[_0x4c304f(0x175)]>0x0){const _0x4fb3a7=buildLocalExpandedRuleMappings(_0x1dbc28),{createYamlContext:_0x123678,prefetchJourneySegments:_0x10cc80}=createPushYamlContextForBundle(_0xe365cb[_0x4c304f(0x11f)],_0xe365cb[_0x4c304f(0x17c)],_0xe365cb[_0x4c304f(0x122)],_0x4fb3a7,_0xe365cb[_0x4c304f(0x180)],_0xe365cb[_0x4c304f(0x186)],_0xe365cb[_0x4c304f(0xfb)],_0xe365cb[_0x4c304f(0x1a8)]);await _0x10cc80(_0x53ff64[_0x4c304f(0x1db)](_0x7ef6dd=>_0x7ef6dd['id']));const _0x2cc743=await _0xe365cb[_0x4c304f(0x11f)]['journey']['getLatestJourneyId'](_0x53ff64[0x0][_0x4c304f(0x126)]),_0x7737df=hasMultipleVersions(_0x1dbc28),_0x363c76=async _0x107a01=>{const _0x2b8b4e=_0x4c304f,_0x171f19=_0xe365cb[_0x2b8b4e(0x1a8)]?.[_0x2b8b4e(0x138)](_0x107a01);if(_0x171f19)return _0x171f19;return _0xe365cb[_0x2b8b4e(0x118)]({'journeyId':_0x107a01,'journeyName':_0x1dbc28[_0x2b8b4e(0x1da)],'isMultiVersion':_0x53ff64[_0x2b8b4e(0x175)]>0x1});};if(_0x7737df&&_0x53ff64['length']>0x1){const _0x305104=[];for(const _0x510158 of _0x53ff64){const _0x4a4800=_0x510158['versionNumber']||0x1;_0xe365cb[_0x4c304f(0x1af)]?.[_0x4c304f(0x142)](_0x4c304f(0x17f)+_0x1dbc28[_0x4c304f(0x1da)]+'\x20v'+_0x4a4800);const _0x56b36c=await _0x363c76(_0x510158['id']),_0x197c7c=_0x123678(_0x510158['id']),_0x40b174=await journeyResponseToDef(_0x56b36c,_0x197c7c);_0x305104['push']({'item':_0x510158,'yaml':_0x40b174});}const _0x593f50=buildLocalRuleToNameMappingFromJourney(_0x1dbc28);_0xc2a7dc=buildMergedJourneyDef(_0x305104,_0x593f50,_0x2cc743);const _0x4ebc76=Math['max'](..._0x305104[_0x4c304f(0x1db)](_0x1b8a77=>_0x1b8a77[_0x4c304f(0x1a0)]['versionNumber']||0x0)),_0x4a34ce=_0x53ff64['find'](_0x5ab72f=>(_0x5ab72f[_0x4c304f(0x129)]||0x0)===_0x4ebc76);_0x4a34ce&&(_0xe365cb[_0x4c304f(0x1af)]?.[_0x4c304f(0x142)](_0x4c304f(0x17f)+_0x1dbc28[_0x4c304f(0x1da)]+'\x20v'+_0x4ebc76),_0x725dfe=await _0x363c76(_0x4a34ce['id']));}else{const _0x4608c0=_0x53ff64[_0x53ff64[_0x4c304f(0x175)]-0x1];_0xe365cb[_0x4c304f(0x1af)]?.[_0x4c304f(0x142)](_0x4c304f(0x17f)+_0x1dbc28[_0x4c304f(0x1da)]),_0x725dfe=await _0x363c76(_0x4608c0['id']);const _0x23b4c1=_0x123678(_0x4608c0['id']),_0x2db159=await journeyResponseToDef(_0x725dfe,_0x23b4c1),_0x49cc24=buildLocalRuleToNameMappingFromJourney(_0x1dbc28);_0xc2a7dc=buildMergedJourneyDef([{'item':_0x4608c0,'yaml':_0x2db159}],_0x49cc24,_0x2cc743);}}addFoldersToCreate(_0x381041,_0xe365cb[_0x4c304f(0x185)],_0x32b978);const _0x2f0b7a=calculateJourneyDiff(_0x1dbc28,_0xc2a7dc);_0x45295f['push']({'relativePath':_0x1dbc28[_0x4c304f(0x1da)],'absolutePath':_0x5b3432,'yamlConfig':_0x1dbc28,'folderPath':_0x381041,'existingJourney':_0x725dfe,'isNew':_0x2f0b7a['isNew'],'hasChanges':_0x2f0b7a['hasChanges'],'diff':_0x2f0b7a['diff']});}return{'journeyFiles':_0x45295f,'foldersToCreate':_0x32b978};}export function calculateActivationActions(_0x5de89d,_0x37670b,_0x43eb17,_0x987a03){const _0x51be23=a152_0x4bbc,_0x2b760e=[],_0x20a79c=new Map();for(const _0x5f5549 of _0x37670b){_0x20a79c['set'](_0x5f5549['name'],_0x5f5549);}const _0x3dc699=new Map();for(const _0x2c5f52 of _0x5de89d){_0x3dc699[_0x51be23(0x18f)](_0x2c5f52['name'],_0x2c5f52);}for(const _0x251a06 of _0x5de89d){const _0x138311=_0x20a79c[_0x51be23(0x138)](_0x251a06[_0x51be23(0x1da)]);if(!_0x138311)_0x2b760e['push']({'type':_0x51be23(0x145),'name':_0x251a06[_0x51be23(0x1da)],'yamlActivation':_0x251a06});else{const _0x433309=activationResponseToDef(_0x138311,_0x43eb17,_0x987a03),_0x184aff=a152_0x24f2de[_0x51be23(0x172)](_0x433309),_0x102bf6=a152_0x24f2de[_0x51be23(0x172)](_0x251a06);_0x184aff!==_0x102bf6&&_0x2b760e[_0x51be23(0x1b5)]({'type':'update','name':_0x251a06[_0x51be23(0x1da)],'yamlActivation':_0x251a06,'existingActivation':_0x138311});}}for(const _0x27d6bb of _0x37670b){!_0x3dc699['has'](_0x27d6bb['name'])&&_0x2b760e[_0x51be23(0x1b5)]({'type':_0x51be23(0x144),'name':_0x27d6bb['name'],'existingActivation':_0x27d6bb});}return _0x2b760e;}function calculateYamlDiff(_0x2a58cf,_0x103583){if(_0x103583){const _0x49a9e5=generateDiff(_0x103583,_0x2a58cf),_0x5d28fc=hasChanges(_0x49a9e5);return{'isNew':![],'hasChanges':_0x5d28fc,'diff':_0x5d28fc?formatDiffWithColors(_0x49a9e5):undefined};}const _0x3244b7=generateDiff('',_0x2a58cf);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x3244b7)};}export function calculateSegmentDiff(_0x34d706,_0x477b6b,_0xba9f07,_0x37965e,_0x5d38a0){const _0x583aaf=segmentToYamlString(_0x34d706),_0x53256e=_0x477b6b?segmentToYamlString(segmentWithActivationsToYaml(_0x477b6b,_0xba9f07,undefined,_0x37965e,_0x5d38a0)):undefined;return calculateYamlDiff(_0x583aaf,_0x53256e);}export function calculateJourneyDiff(_0x1442b9,_0x42eaf4){const _0x1060c0=normalizeJourneyDef(_0x1442b9,_0x1442b9),_0x450ce9=a152_0x585ff1(_0x1060c0),_0x34e7ac=_0x42eaf4?a152_0x585ff1(normalizeJourneyDef(_0x42eaf4,_0x1442b9)):undefined;return calculateYamlDiff(_0x450ce9,_0x34e7ac);}export function findSegmentsToDelete(_0xa50285,_0x175e21,_0x5f0a53,_0x1944ed,_0xb95816){const _0x4c517e=a152_0x4bbc,_0x47f354=new Set();for(const {yamlConfig:_0xdf3b35,folderPath:_0x451a35}of _0x175e21){_0x47f354[_0x4c517e(0x12c)](_0x451a35+':'+_0xdf3b35['name']);}return _0xa50285['filter'](_0x31c5ff=>{const _0x20a9ec=_0x4c517e,_0x49cb1d=_0x31c5ff[_0x20a9ec(0x1de)]?_0x5f0a53[_0x20a9ec(0x138)](_0x31c5ff[_0x20a9ec(0x1de)][_0x20a9ec(0x19e)]())||'':'',_0x1425b4=_0x49cb1d+':'+_0x31c5ff['name'];if(_0x47f354['has'](_0x1425b4))return![];if(_0xb95816)return _0x49cb1d===_0x1944ed||_0x49cb1d['startsWith'](_0x1944ed+'/');return!![];});}export function findJourneysToDelete(_0x33f3ba,_0x10a8ce,_0x1b4e6d,_0x1ce655,_0x513877){const _0x542ffe=a152_0x4bbc,_0x35be70=new Set();for(const {yamlConfig:_0x2d01b5,folderPath:_0x20619a}of _0x10a8ce){_0x35be70['add'](_0x20619a+':'+_0x2d01b5[_0x542ffe(0x1da)]);}return _0x33f3ba[_0x542ffe(0x110)](_0xcf5bef=>{const _0xc529a9=_0x542ffe,_0x439c54=_0xcf5bef[_0xc529a9(0x157)]?_0x1b4e6d[_0xc529a9(0x138)](_0xcf5bef[_0xc529a9(0x157)])||'':'',_0x353660=_0x439c54+':'+_0xcf5bef[_0xc529a9(0x1e9)];if(_0x35be70['has'](_0x353660))return![];if(_0x513877)return _0x439c54===_0x1ce655||_0x439c54['startsWith'](_0x1ce655+'/');return!![];});}function a152_0x14ea(){const _0x503f1f=['max','journeyBundleId','existingJourney','isNew','versionNumber','\x0a\x20\x20','embedded_activation_creating','add','Deleted\x20activation\x20\x27','waitStepUnit','6tdtFxH','conditionTimeoutDuration','and\x20the\x20server\x20segment,\x20then\x20retry.','Entry\x20criteria:\x20','activation_deleted','segments','sort','\x20error(s)','\x27\x20not\x20found\x20in\x20journey\x20\x27','get','null','journey_updating','waitStepType','match','784452jKgzFJ','.$1.push-recovery.json','journey_entry_criteria_','Creating\x20activation\x20\x27','Failed\x20to\x20resolve\x20activation\x20','update','1671584NDyrhn','delete','create','activation_creating','exitCriterias','resolveJourneyId','Activation','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','unchanged','startsWith','segmentNameToId','includes','NOT_FOUND','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','813634ANolRb','reduce','getJourney','journeyName','size','folderId','segmentByFolderAndName','uniqueServerName','waitStep','40hpghiD','logDeleted','getSegmentEntity','journeyActivationStepId','message','journey','segment','../../utils/async.js','goal\x20criteria','Failed\x20to\x20','\x27\x20decision\x20point\x20branch\x20\x27','segment_creating','journeyStages','valid',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','./child-segment-yaml.js','conditionSegmentId','Creating\x20folder\x20\x27','updateActivation','segment_updating','Segment\x20not\x20found:\x20','SEGMENT_NOT_FOUND','journeyBundlesByFolderAndName','stringify','kind','7TqKqei','length','Failed\x20to\x20resolve\x20segment\x20','activation_updated','3aHTLag','segmentId','listActivations','utf-8','parentId','logSuccess','verbose','Fetching\x20','idToEmailMap','goal','withProgress','journeyId','Creating\x20segment\x20\x27','folderPathToId','connectionIdToNameMap','user','getActivation','Duration','Updating\x20activation\x20\x27','\x27\x20entry\x20criteria','WaitStep','folder','with','set','./journey-yaml.js','toISOString','flatMap','existingSegment','Condition','branches','schedule','getSegment\x20failed\x20for\x20','Activation\x20not\x20found:\x20','211622BOWzcL','errors','\x27...','parentSegmentFolder','Name\x20has\x20already\x20been\x20taken','toString','description','item','yamlConfig','activation_template_id','find','validatedRequest','activationContext','activation_','trim','journeyById','110XBBTMM','folder_created','370989KNUcVg','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','has','\x27\x20for\x20','progress','segment_deleting','steps','sha1','keys','data','push','localName','relationships','connector_config','slice','columns','parseDocument','logInfo','uniqueSegmentName','Created\x20segment\x20\x27','createJourneySegment','skipSegments','deleted','\x27\x20from\x20file:\x20','\x27\x20by\x20rule\x20content','createdSegmentId','yamlActivation','\x20segment\x20from\x20file:\x20','connection','entry_criteria','stage\x20\x27','Embedded\x20segment\x20\x27','results','entries','replace','Matched\x20server\x20segment\x20\x27','all_columns','embedded_segment_created','SEGMENT_UPDATE_ERROR','deleteSegment','entryCriteria','1410736zIgrXS','decision_point','conditions','stages','run_after_journey_refresh','action','name','map','ACTIVATION_UPDATE_ERROR','):\x20','segmentFolderId','conditionTimeoutUnit','resolvedRule','nameToId','logWarning','notification','Segment\x20not\x20found','\x20journey\x20from\x20file:\x20',').\x20','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','hasChanges','journeyBundleName','join','split','rule','getSegment','deleteActivation','absolutePath','updateSegmentById','segment_created','created','attributes','updated','Updated\x20journey\x20\x27','type','1349290zDFjGb','activationStepsById','\x27\x20exit\x20criteria','milestone','rootFolderId','activations','dirname','folderPath','DecisionPoint','journey_updated','resolveSegment','some','Created\x20journey\x20\x27','parentFolder','from','parse','onProgress','embeddedSegmentNameToId','Delete\x20the\x20push\x20recovery\x20file\x20(','journeys','all','Stage\x20\x27','filter','buildUserMaps','Updating\x20segment\x20\x27','state','behavior','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','nameToType','existingActivation','fetchJourney','debug','toLowerCase','\x20activation\x20\x27','Deleted\x20segment\x20\x27','INTERNAL','createActivation','deps','\x20(referenced\x20in\x20journey\x20','diff','existingSegments','index','relative'];a152_0x14ea=function(){return _0x503f1f;};return a152_0x14ea();}export function buildSegmentLookupMap(_0x48f232,_0x52bcd5){const _0x10922f=a152_0x4bbc,_0x3d36be=new Map();for(const _0x57123a of _0x48f232){const _0x3eb91a=_0x57123a[_0x10922f(0x1de)]?_0x52bcd5[_0x10922f(0x138)](_0x57123a['segmentFolderId'][_0x10922f(0x19e)]())||'':'',_0x14ff5a=_0x3eb91a+':'+_0x57123a[_0x10922f(0x1da)];_0x3d36be['set'](_0x14ff5a,_0x57123a);}return _0x3d36be;}export function buildSegmentNameToIdMap(_0x49a55b){const _0x362fdc=a152_0x4bbc,_0x5208f7=new Map();for(const _0x35d406 of _0x49a55b){_0x5208f7['set'](_0x35d406[_0x362fdc(0x1da)],_0x35d406['id']);}return _0x5208f7;}export function buildJourneyBundleLookupMap(_0x5ada5b,_0x27a3d8){const _0x4085c1=a152_0x4bbc,_0x33a5c5=new Map();for(const _0x29e764 of _0x5ada5b){const _0x11fe01=_0x29e764[_0x4085c1(0x157)]?_0x27a3d8[_0x4085c1(0x138)](_0x29e764['folderId'])||'':'',_0x41eed6=_0x11fe01+':'+_0x29e764['journeyBundleName'];!_0x33a5c5[_0x4085c1(0x1ad)](_0x41eed6)&&_0x33a5c5['set'](_0x41eed6,[]),_0x33a5c5[_0x4085c1(0x138)](_0x41eed6)['push'](_0x29e764);}for(const _0x3a28e3 of _0x33a5c5['values']()){_0x3a28e3[_0x4085c1(0x135)]((_0x10b4e3,_0x488a95)=>(_0x10b4e3[_0x4085c1(0x129)]||0x0)-(_0x488a95['versionNumber']||0x0));}return _0x33a5c5;}export function collectFoldersToCreate(_0x3120c5,_0x323150){const _0x5939d3=a152_0x4bbc,_0x4adc9d=new Set();for(const _0x2e76ed of _0x3120c5){if(!_0x2e76ed)continue;if(_0x323150[_0x5939d3(0x1ad)](_0x2e76ed))continue;const _0x45461d=_0x2e76ed[_0x5939d3(0x1eb)]('/');let _0x2aaef5='';for(const _0x1476d7 of _0x45461d){_0x2aaef5=_0x2aaef5?_0x2aaef5+'/'+_0x1476d7:_0x1476d7,!_0x323150[_0x5939d3(0x1ad)](_0x2aaef5)&&_0x4adc9d[_0x5939d3(0x12c)](_0x2aaef5);}}return _0x4adc9d;}export function parseAndClassifyYamlFiles(_0xa4e72,_0x2e9d51,_0x588116){const _0x28f676=a152_0x4bbc,_0x24257d=[],_0x5cbe55=[];for(const _0x22110a of _0xa4e72){const _0x2faf28=a152_0x3752ae[_0x28f676(0x124)](_0x2e9d51,a152_0x3752ae[_0x28f676(0x100)](_0x22110a)),_0x305f9d=_0x2faf28==='.'?'':_0x2faf28,_0x14eb0b=readFileSync(_0x22110a,_0x28f676(0x17b)),_0x271d12=a152_0x24f2de[_0x28f676(0x109)](_0x14eb0b);if(isJourneyDef(_0x271d12)){const _0x1d47e3=a152_0x55956b(_0x14eb0b);_0x5cbe55['push']({'yamlConfig':_0x1d47e3,'folderPath':_0x305f9d,'sourcePath':_0x22110a});}else{if(!_0x588116?.[_0x28f676(0x1c0)]){const _0x4b6b68=parseSegmentYamlFile(_0x14eb0b),_0x383673=normalizeChildSegmentYaml(_0x4b6b68);_0x24257d[_0x28f676(0x1b5)]({'yamlConfig':_0x383673,'folderPath':_0x305f9d,'sourcePath':_0x22110a});}}}return{'segments':_0x24257d,'journeys':_0x5cbe55};}export function validateParsedFiles(_0x49d516,_0x448e91){const _0x297b24=a152_0x4bbc,_0x220cc4=[];for(const {yamlConfig:_0x47f5f1,sourcePath:_0x43bf7c}of _0x49d516[_0x297b24(0x134)]){const _0x511ade=readFileSync(_0x43bf7c,_0x297b24(0x17b)),_0x5dc9ee=a152_0x24f2de['parseDocument'](_0x511ade),_0x5e9cb7=validateSegmentDef(_0x47f5f1,{'source':_0x511ade,'document':_0x5dc9ee},{'skipSchema':!![]});if(!_0x5e9cb7[_0x297b24(0x168)]){const _0x42cec6=a152_0x3752ae[_0x297b24(0x124)](_0x448e91,_0x43bf7c);_0x220cc4[_0x297b24(0x1b5)]({'filePath':_0x42cec6,'source':_0x511ade,'result':_0x5e9cb7,'isJourney':![]});}}for(const {yamlConfig:_0x374cb3,sourcePath:_0x39b6e4}of _0x49d516[_0x297b24(0x10d)]){const _0x4fd11a=readFileSync(_0x39b6e4,_0x297b24(0x17b)),_0x3f059f=a152_0x24f2de[_0x297b24(0x1bb)](_0x4fd11a),_0x1632d6=validateJourneyDef(_0x374cb3,{'source':_0x4fd11a,'document':_0x3f059f},{'skipSchema':!![]});if(!_0x1632d6[_0x297b24(0x168)]){const _0x12f498=a152_0x3752ae[_0x297b24(0x124)](_0x448e91,_0x39b6e4);_0x220cc4[_0x297b24(0x1b5)]({'filePath':_0x12f498,'source':_0x4fd11a,'result':_0x1632d6,'isJourney':!![]});}}return _0x220cc4;}export function formatValidationErrors(_0x5c2fb0){const _0x34483b=a152_0x4bbc,_0x3bc148=[];for(const {filePath:_0x3a3824,source:_0x340475,result:_0x354e91,isJourney:_0x28a452}of _0x5c2fb0){const _0x81af1a=_0x28a452?_0x34483b(0x160):_0x34483b(0x161);_0x3bc148['push']('\x0a'+_0x3a3824+'\x20('+_0x81af1a+_0x34483b(0x1dd)+_0x354e91[_0x34483b(0x19a)]['length']+_0x34483b(0x136)),_0x3bc148[_0x34483b(0x1b5)](formatValidationResult(_0x354e91,_0x340475,_0x3a3824));}return _0x3bc148[_0x34483b(0x1ea)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x31b976){const _0xa1ecf=a152_0x4bbc,_0x865af2=new Set(),_0x15bd77=new Map(),_0x16d1cc=collectSegmentUsageCounts(_0x31b976);if(_0x31b976[_0xa1ecf(0x134)])for(const [_0x431e94,_0x1670ac]of Object[_0xa1ecf(0x1cc)](_0x31b976[_0xa1ecf(0x134)])){_0x865af2[_0xa1ecf(0x12c)](_0x431e94);if(_0x1670ac['rule']){const _0x2f2a9c=yamlRuleToApi(_0x1670ac['rule']),_0x526573=apiRuleToYaml(_0x2f2a9c);_0x15bd77['set'](_0x431e94,_0x526573);}}const _0x13c42d=new Map();let _0x888e5=0x0;for(const [_0x42c4b7,_0x527dfc]of _0x15bd77){const _0x47f3e3=serializeExpandedRule(_0x527dfc,_0x15bd77),_0x521e43=_0x13c42d[_0xa1ecf(0x138)](_0x47f3e3)||[];_0x521e43['push']({'name':_0x42c4b7,'index':_0x888e5}),_0x13c42d[_0xa1ecf(0x18f)](_0x47f3e3,_0x521e43),_0x888e5++;}const _0x4ce410=new Map();for(const [_0xd6d128,_0x4fcf79]of _0x13c42d){const _0x4d7e58=_0x4fcf79[_0xa1ecf(0x1b9)]()[_0xa1ecf(0x135)]((_0x445668,_0x30b6c9)=>{const _0x1dd1eb=_0xa1ecf,_0x5a3ab9=_0x16d1cc['get'](_0x445668[_0x1dd1eb(0x1da)])||0x0,_0x523322=_0x16d1cc[_0x1dd1eb(0x138)](_0x30b6c9[_0x1dd1eb(0x1da)])||0x0;if(_0x5a3ab9!==_0x523322)return _0x523322-_0x5a3ab9;return _0x445668[_0x1dd1eb(0x123)]-_0x30b6c9[_0x1dd1eb(0x123)];})[_0xa1ecf(0x1db)](_0x20895d=>_0x20895d[_0xa1ecf(0x1da)]),_0x4b6f47=[];for(const _0x3104d1 of _0x4d7e58){const _0x344cc7=_0x16d1cc[_0xa1ecf(0x138)](_0x3104d1)||0x0,_0x2d1c0e=Math[_0xa1ecf(0x125)](_0x344cc7,0x1);for(let _0xdc761b=0x0;_0xdc761b<_0x2d1c0e;_0xdc761b++){_0x4b6f47[_0xa1ecf(0x1b5)](_0x3104d1);}}_0x4ce410[_0xa1ecf(0x18f)](_0xd6d128,_0x4b6f47);}return{'existingLocalSegmentNames':_0x865af2,'localSegmentRules':_0x15bd77,'localExpandedRuleToNames':_0x4ce410};}export function createSegmentIdResolver(_0x1e51b6,_0x40d2dc){return async _0x26a860=>{const _0x2aa85b=a152_0x4bbc,_0x79c82e=_0x1e51b6[_0x2aa85b(0x138)](_0x26a860);if(!_0x79c82e)throw new SDKError(ErrorCode[_0x2aa85b(0x170)],'Segment\x20not\x20found:\x20'+_0x26a860+_0x2aa85b(0x115)+_0x40d2dc+'\x27)');return _0x79c82e;};}export function extractRootFolderId(_0x50ddff){const _0x1d432d=a152_0x4bbc;return _0x50ddff[_0x1d432d(0x1b7)]?.[_0x1d432d(0x19c)]?.[_0x1d432d(0x1b4)]?.['id']||_0x50ddff['relationships']?.[_0x1d432d(0x107)]?.[_0x1d432d(0x1b4)]?.['id'];}export function buildConnectionMaps(_0x4d0938){const _0x2640ce=a152_0x4bbc,_0x130590=new Map(),_0x5c7fc1=new Map(),_0x4ccf62=new Map();for(const _0x376bf0 of _0x4d0938){_0x130590[_0x2640ce(0x18f)](_0x376bf0[_0x2640ce(0x1da)],parseInt(_0x376bf0['id'],0xa)),_0x5c7fc1[_0x2640ce(0x18f)](_0x376bf0['id'],_0x376bf0[_0x2640ce(0x1da)]),_0x4ccf62[_0x2640ce(0x18f)](_0x376bf0[_0x2640ce(0x1da)],_0x376bf0[_0x2640ce(0xf9)]);}return{'nameToId':_0x130590,'idToName':_0x5c7fc1,'nameToType':_0x4ccf62};}export function calculatePushStats(_0x6fd125,_0x3d3193,_0x59df58,_0x1f339c,_0x53f789,_0x42bada,_0x1ba02a){const _0x3d32c4=a152_0x4bbc,_0x263077=_0x6fd125[_0x3d32c4(0x110)](_0xc2c565=>_0xc2c565[_0x3d32c4(0x128)]),_0x1da4c8=_0x6fd125['filter'](_0x3a6be2=>!_0x3a6be2[_0x3d32c4(0x128)]&&_0x3a6be2[_0x3d32c4(0x1e8)]),_0x3f56a0=_0x6fd125['filter'](_0x35d7d3=>!_0x35d7d3[_0x3d32c4(0x128)]&&!_0x35d7d3[_0x3d32c4(0x1e8)]),_0x2582a1=_0x42bada?_0x1f339c:[],_0x31ba66=_0x3d3193['filter'](_0x2416eb=>_0x2416eb['isNew']),_0x1efa99=_0x3d3193['filter'](_0x349b2b=>!_0x349b2b[_0x3d32c4(0x128)]&&_0x349b2b[_0x3d32c4(0x1e8)]),_0x213424=_0x3d3193['filter'](_0x461baa=>!_0x461baa[_0x3d32c4(0x128)]&&!_0x461baa['hasChanges']),_0x4725c2=_0x42bada?_0x53f789:[],_0x328a90=_0x6fd125[_0x3d32c4(0x192)](_0x40f514=>_0x40f514['activationActions']),_0x541dac=_0x328a90['filter'](_0x121233=>_0x121233[_0x3d32c4(0xf9)]===_0x3d32c4(0x145)),_0x1e1d7b=_0x328a90['filter'](_0x189864=>_0x189864[_0x3d32c4(0xf9)]===_0x3d32c4(0x142)),_0x3bc845=_0x328a90['filter'](_0x278925=>_0x278925['type']===_0x3d32c4(0x144)),_0x5eae5a=Array['from'](_0x59df58)[_0x3d32c4(0x135)](),_0x8c5ca5=_0x1ba02a?![]:_0x263077['length']>0x0||_0x1da4c8[_0x3d32c4(0x175)]>0x0||_0x2582a1[_0x3d32c4(0x175)]>0x0,_0x38ac68=_0x31ba66['length']>0x0||_0x1efa99['length']>0x0||_0x4725c2[_0x3d32c4(0x175)]>0x0,_0x4187db=_0x1ba02a?![]:_0x328a90['length']>0x0,_0x299bb7=_0x5eae5a['length']>0x0;return{'segments':{'new':_0x263077,'changed':_0x1da4c8,'unchanged':_0x3f56a0,'toDelete':_0x2582a1},'journeys':{'new':_0x31ba66,'changed':_0x1efa99,'unchanged':_0x213424,'toDelete':_0x4725c2},'activations':{'all':_0x328a90,'toCreate':_0x541dac,'toUpdate':_0x1e1d7b,'toDelete':_0x3bc845},'folders':{'toCreate':_0x5eae5a},'counts':{'segments':{'new':_0x263077[_0x3d32c4(0x175)],'changed':_0x1da4c8[_0x3d32c4(0x175)],'unchanged':_0x3f56a0['length'],'toDelete':_0x2582a1['length']},'journeys':{'new':_0x31ba66['length'],'changed':_0x1efa99['length'],'unchanged':_0x213424[_0x3d32c4(0x175)],'toDelete':_0x4725c2['length']},'activations':{'create':_0x541dac[_0x3d32c4(0x175)],'update':_0x1e1d7b[_0x3d32c4(0x175)],'delete':_0x3bc845['length']},'folders':_0x5eae5a[_0x3d32c4(0x175)]},'hasChanges':_0x8c5ca5||_0x38ac68||_0x4187db||_0x299bb7};}export async function buildPushExecutionContext(_0x40dde1,_0x41174f,_0x15b552,_0x5c626a,_0x5c74ec,_0x7b15c8){const _0x3fc76e=a152_0x4bbc,_0x98cf55=extractRootFolderId(_0x15b552),{pathToId:_0x52b7c2,idToPath:_0x315688}=buildFolderMaps(_0x5c74ec),_0x2b2ed0=buildSegmentNameToIdMap(_0x5c626a),_0x348ee9=new Map(),{batchAsync:_0x1617ce}=await import(_0x3fc76e(0x162)),[_0x2d5cd2,_0x17b488]=await Promise['all']([_0x40dde1[_0x3fc76e(0x187)][_0x3fc76e(0x111)](),_0x40dde1['connection']['list'](),((async()=>{const _0x5d5a3e=_0x3fc76e;!_0x7b15c8&&_0x5c626a[_0x5d5a3e(0x175)]>0x0&&await _0x1617ce(_0x5c626a,async _0x4883f2=>{const _0x442639=_0x5d5a3e,_0x5d95fb=await _0x40dde1[_0x442639(0x161)][_0x442639(0x17a)](_0x41174f,_0x4883f2['id']);_0x348ee9[_0x442639(0x18f)](_0x4883f2['id'],_0x5d95fb);});})())]),{emailToId:_0x5912ca,idToEmail:_0x49ef36}=_0x2d5cd2,_0x41d474=buildConnectionMaps(_0x17b488);return{'rootFolderId':_0x98cf55,'folderPathToId':_0x52b7c2,'folderIdToPath':_0x315688,'segmentNameToId':_0x2b2ed0,'activationsBySegmentId':_0x348ee9,'emailToIdMap':_0x5912ca,'idToEmailMap':_0x49ef36,'connectionNameToIdMap':_0x41d474[_0x3fc76e(0x1e1)],'connectionIdToNameMap':_0x41d474['idToName'],'connectionNameToTypeMap':_0x41d474[_0x3fc76e(0x116)]};}export function createPushYamlContextForBundle(_0x290365,_0x48fa98,_0x1d60bd,_0x1f14ce,_0x2f95ca,_0x4e29e6,_0x241054,_0x5e8a74){const {existingLocalSegmentNames:_0x1a3573,localExpandedRuleToNames:_0x428dfa}=_0x1f14ce,_0x148556=new Set(),_0x3ab259=new Map(),_0x535dcd=new Map(),_0x3f0030=new Map(),_0x578c1c=createJumpTargetCache(),_0x29b54b=new Map(),_0x4032f7=new Map(),_0x4bbbcd=new Set();let _0x110b61;const _0x7aca00=_0x3dc6a4=>{const _0x2529c6={'resolveSegment':async _0x3c3a3f=>{const _0x5db759=a152_0x4bbc,_0x52c6fc=_0x3f0030[_0x5db759(0x138)](_0x3c3a3f);if(_0x52c6fc!==undefined)return{'name':_0x52c6fc,'isJourneyLocal':!![]};try{const _0x47fb64=await fetchSegment(_0x290365,_0x48fa98,_0x3c3a3f,_0x1d60bd);if(!_0x47fb64)throw new Error(_0x5db759(0x1e4));const _0x14eb26=generateJourneyLocalName(_0x47fb64[_0x5db759(0x1da)]),_0x2304b0=_0x47fb64[_0x5db759(0x173)]===SEGMENT_KIND_JOURNEY&&_0x14eb26!==undefined;let _0xf9a436=_0x47fb64[_0x5db759(0x1da)],_0xa062d7;if(_0x2304b0&&_0x47fb64[_0x5db759(0x1ec)]){const _0x2aff78=apiRuleToYaml(_0x47fb64[_0x5db759(0x1ec)]);_0x4032f7[_0x5db759(0x18f)](_0x3c3a3f,_0x2aff78);const _0x27caca=async _0x50dd86=>{const _0x30232a=_0x5db759,_0x3a8bce=collectSegmentRefsFromRule(_0x50dd86);for(const _0x4691ba of _0x3a8bce){if(!_0x4032f7[_0x30232a(0x1ad)](_0x4691ba))try{const _0x1df604=await fetchSegment(_0x290365,_0x48fa98,_0x4691ba,_0x1d60bd);if(_0x1df604?.[_0x30232a(0x1ec)]){const _0x2f38df=apiRuleToYaml(_0x1df604['rule']);_0x4032f7[_0x30232a(0x18f)](_0x4691ba,_0x2f38df),await _0x27caca(_0x2f38df);}}catch(_0x145083){logger[_0x30232a(0x119)]('Failed\x20to\x20fetch\x20referenced\x20segment\x20'+_0x4691ba+':\x20'+_0x145083);}}};await _0x27caca(_0x2aff78);const _0x54ece8=serializeExpandedRule(_0x2aff78,_0x4032f7),_0x1c4deb=_0x428dfa['get'](_0x54ece8);if(_0x1c4deb&&_0x1c4deb[_0x5db759(0x175)]>0x0){const _0x332674=_0x3ab259[_0x5db759(0x138)](_0x54ece8)||0x0,_0x5dd097=_0x1c4deb[_0x332674]||_0x1c4deb[_0x1c4deb['length']-0x1];_0x3ab259[_0x5db759(0x18f)](_0x54ece8,_0x332674+0x1),_0xf9a436=_0x5dd097,_0x148556[_0x5db759(0x12c)](_0xf9a436),_0x3f0030[_0x5db759(0x18f)](_0x3c3a3f,_0xf9a436);const _0xe4fd98=await resolveRuleSegmentRefs(_0x2aff78,async _0x214ec6=>{const _0x9c919d=_0x5db759,_0x67ccff=_0x3f0030[_0x9c919d(0x138)](_0x214ec6);if(_0x67ccff)return _0x67ccff;const _0x3dd1c1=await _0x110b61[_0x9c919d(0x104)](_0x214ec6);return _0x3dd1c1[_0x9c919d(0x1da)];});_0xa062d7={'description':_0x47fb64[_0x5db759(0x19f)],'rule':_0xe4fd98};}else{const _0x1973eb=_0x29b54b[_0x5db759(0x138)](_0x54ece8);if(_0x1973eb)_0xf9a436=_0x1973eb,_0x3f0030[_0x5db759(0x18f)](_0x3c3a3f,_0xf9a436);else{if(_0x14eb26){let _0x19c4ea=_0x14eb26,_0x18a559=0x2;while(_0x148556[_0x5db759(0x1ad)](_0x19c4ea)||_0x1a3573[_0x5db759(0x1ad)](_0x19c4ea)){_0x19c4ea=_0x14eb26+'_'+_0x18a559,_0x18a559++;}_0x148556[_0x5db759(0x12c)](_0x19c4ea),_0xf9a436=_0x19c4ea;}_0x3f0030[_0x5db759(0x18f)](_0x3c3a3f,_0xf9a436),_0x29b54b[_0x5db759(0x18f)](_0x54ece8,_0xf9a436);const _0x360bf2=await resolveRuleSegmentRefs(_0x2aff78,async _0xd2018f=>{const _0x65d378=_0x5db759,_0x4670aa=_0x3f0030[_0x65d378(0x138)](_0xd2018f);if(_0x4670aa)return _0x4670aa;const _0x2d5195=await _0x110b61['resolveSegment'](_0xd2018f);return _0x2d5195['name'];});_0xa062d7={'description':_0x47fb64[_0x5db759(0x19f)],'rule':_0x360bf2};}}}return{'name':_0xf9a436,'isJourneyLocal':_0x2304b0,'definition':_0xa062d7};}catch(_0x1cacfe){return logger['debug'](_0x5db759(0x176)+_0x3c3a3f+':\x20'+_0x1cacfe),{'name':_0x3c3a3f,'isJourneyLocal':![]};}},'resolveActivation':async _0x41bb96=>{const _0xe03f36=a152_0x4bbc,_0x11d039=_0x535dcd[_0xe03f36(0x138)](_0x41bb96);if(_0x11d039!==undefined)return{'name':_0x11d039,'isJourneyLocal':!![]};try{let _0x50e35e=_0x241054?.[_0xe03f36(0x138)](_0x41bb96);!_0x50e35e&&(_0x50e35e=await _0x290365[_0xe03f36(0x160)][_0xe03f36(0x188)](_0x3dc6a4,_0x41bb96));const _0x27064c=_0x50e35e['attributes']['activationParams'][_0xe03f36(0x1da)]||_0x41bb96,_0x4cd226=sanitizeYamlKey(_0x27064c)||_0xe03f36(0x1a6)+_0x41bb96,_0x3f30f4=_0x4cd226;_0x535dcd[_0xe03f36(0x18f)](_0x41bb96,_0x3f30f4);const _0x1d3885=journeyActivationStepToYaml(_0x50e35e,_0x2f95ca,_0x4e29e6);return{'name':_0x3f30f4,'isJourneyLocal':!![],'definition':_0x1d3885};}catch(_0x21d517){return logger[_0xe03f36(0x119)](_0xe03f36(0x141)+_0x41bb96+':\x20'+_0x21d517),{'name':_0x41bb96,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x5b97a7,_0x167996)=>resolveJumpTarget(_0x5b97a7,_0x167996,_0x578c1c,async _0x421e22=>{const _0x392b5c=a152_0x4bbc,_0x46d6a0=_0x5e8a74?.['get'](_0x421e22);if(_0x46d6a0)return _0x46d6a0;return _0x290365[_0x392b5c(0x160)][_0x392b5c(0x154)](_0x421e22);})};return _0x110b61=_0x2529c6,_0x2529c6;},_0x393f8a=async _0x4975a8=>{const _0x45a636=a152_0x4bbc,{collectSegmentIdsFromJourneyApi:_0x1132bb}=await import(_0x45a636(0x190)),{batchAsync:_0x28961d}=await import('../../utils/async.js'),_0x26adbd=new Set();for(const _0x115cf0 of _0x4975a8){let _0x10dfe7=_0x5e8a74?.['get'](_0x115cf0);!_0x10dfe7&&(_0x10dfe7=await _0x290365[_0x45a636(0x160)][_0x45a636(0x154)](_0x115cf0));const _0x19f560=_0x1132bb(_0x10dfe7);for(const _0x40fef3 of _0x19f560){_0x26adbd['add'](_0x40fef3);}}let _0x113128=Array['from'](_0x26adbd);while(_0x113128['length']>0x0){const _0x403600=_0x113128[_0x45a636(0x110)](_0x9bb244=>!_0x4bbbcd[_0x45a636(0x1ad)](_0x9bb244));if(_0x403600[_0x45a636(0x175)]===0x0)break;const _0x3be1bf=await _0x28961d(_0x403600,async _0x4995e5=>{_0x4bbbcd['add'](_0x4995e5);const _0x165ec4=await fetchSegment(_0x290365,_0x48fa98,_0x4995e5,_0x1d60bd);if(!_0x165ec4)return null;return{'segmentId':_0x4995e5,'segment':_0x165ec4};},0xa),_0x199813=new Set();for(const _0x170632 of _0x3be1bf){if(!_0x170632?.[_0x45a636(0x161)]?.[_0x45a636(0x1ec)])continue;const _0x57aeb8=apiRuleToYaml(_0x170632[_0x45a636(0x161)][_0x45a636(0x1ec)]);_0x4032f7[_0x45a636(0x18f)](_0x170632['segmentId'],_0x57aeb8);const _0x2f2bd1=collectSegmentRefsFromRule(_0x57aeb8);for(const _0x3434da of _0x2f2bd1){!_0x4bbbcd[_0x45a636(0x1ad)](_0x3434da)&&_0x199813[_0x45a636(0x12c)](_0x3434da);}}_0x113128=Array[_0x45a636(0x108)](_0x199813);}};return{'createYamlContext':_0x7aca00,'prefetchJourneySegments':_0x393f8a};}export async function executePushSegments(_0x4197a4,_0x33cdf6,_0x10b8a6,_0x1855bc,_0x4649c9){const _0x5dfd7d=a152_0x4bbc,{segmentDefToCreateRequest:_0x38bb06,segmentDefToUpdateRequest:_0x2022dd}=await import(_0x5dfd7d(0x16a)),_0x41fc44=_0x10b8a6[_0x5dfd7d(0x185)],_0x4d9867=0x5,_0x35c347=async _0xe64578=>{const _0x2a2a36=_0x5dfd7d,_0xf25577=_0xe64578[_0x2a2a36(0x101)]?_0x41fc44[_0x2a2a36(0x138)](_0xe64578[_0x2a2a36(0x101)]):undefined;let _0x1f7bed;const _0x583b31={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x418e4b=_0xe64578[_0x2a2a36(0x1a1)];if(_0xe64578['yamlConfig'][_0x2a2a36(0x1ec)]){const _0x24b096=createSegmentIdResolver(_0x10b8a6[_0x2a2a36(0x14d)],_0xe64578['yamlConfig']['name']),_0x42f985=await resolveRuleSegmentIds(_0xe64578['yamlConfig'][_0x2a2a36(0x1ec)],_0x24b096);_0x418e4b={..._0xe64578[_0x2a2a36(0x1a1)],'rule':_0x42f985};}try{if(_0xe64578['isNew']){_0x4649c9[_0x2a2a36(0x10a)]?.({'type':_0x2a2a36(0x166),'name':_0xe64578['yamlConfig']['name']});const _0xfc8cb0=_0x38bb06(_0x418e4b,_0xf25577),_0x4673b4=await _0x4649c9[_0x2a2a36(0x182)](_0x2a2a36(0x184)+_0xe64578[_0x2a2a36(0x1a1)][_0x2a2a36(0x1da)]+'\x27...',()=>_0x4197a4[_0x2a2a36(0x161)]['createSegment'](_0x1855bc[_0x2a2a36(0x17c)],_0xfc8cb0));_0x1f7bed=_0x4673b4['data']['id'],_0x10b8a6['segmentNameToId']['set'](_0xe64578[_0x2a2a36(0x1a1)][_0x2a2a36(0x1da)],_0x1f7bed),_0x583b31['createdSegmentId']={'name':_0xe64578[_0x2a2a36(0x1a1)]['name'],'id':_0x1f7bed},_0x4649c9['onProgress']?.({'type':_0x2a2a36(0x1f1),'name':_0xe64578[_0x2a2a36(0x1a1)][_0x2a2a36(0x1da)],'segmentId':_0x1f7bed}),_0x4649c9[_0x2a2a36(0x17d)]?.(_0x2a2a36(0x1be)+_0xe64578['yamlConfig'][_0x2a2a36(0x1da)]+'\x27'),_0x583b31[_0x2a2a36(0xf5)]=0x1;}else{if(_0xe64578[_0x2a2a36(0x1e8)]){_0x4649c9[_0x2a2a36(0x10a)]?.({'type':_0x2a2a36(0x16e),'name':_0xe64578['yamlConfig'][_0x2a2a36(0x1da)]});const _0x495697=_0x2022dd(_0x418e4b);_0xf25577!==_0xe64578[_0x2a2a36(0x193)]?.[_0x2a2a36(0x1de)]&&(_0x495697[_0x2a2a36(0x1de)]=_0xf25577?parseInt(_0xf25577,0xa):undefined),await _0x4649c9[_0x2a2a36(0x182)](_0x2a2a36(0x112)+_0xe64578[_0x2a2a36(0x1a1)][_0x2a2a36(0x1da)]+_0x2a2a36(0x19b),()=>_0x4197a4[_0x2a2a36(0x161)][_0x2a2a36(0x1f0)](_0x1855bc['parentId'],_0xe64578[_0x2a2a36(0x193)]['id'],_0x495697)),_0x1f7bed=_0xe64578[_0x2a2a36(0x193)]['id'],_0x4649c9[_0x2a2a36(0x10a)]?.({'type':'segment_updated','name':_0xe64578[_0x2a2a36(0x1a1)][_0x2a2a36(0x1da)]}),_0x4649c9[_0x2a2a36(0x17d)]?.('Updated\x20segment\x20\x27'+_0xe64578[_0x2a2a36(0x1a1)][_0x2a2a36(0x1da)]+'\x27'),_0x583b31[_0x2a2a36(0xf7)]=0x1;}else _0x1f7bed=_0xe64578['existingSegment']['id'];}}catch(_0x1bcaa6){const _0x356338=isHttp400Error(_0x1bcaa6),_0xc039af=_0x356338?ErrorCode['SEGMENT_SYNTAX_ERROR']:ErrorCode['SEGMENT_UPDATE_ERROR'],_0x419fc4=getErrorMessage(_0x1bcaa6);throw new SDKError(_0xc039af,'Failed\x20to\x20'+(_0xe64578[_0x2a2a36(0x128)]?'create':'update')+_0x2a2a36(0x1c6)+_0xe64578[_0x2a2a36(0x1ef)]+_0x2a2a36(0x12a)+_0x419fc4,_0x1bcaa6);}try{const _0x28844f=await syncActivationsForSegment(_0x4197a4,_0x1855bc[_0x2a2a36(0x17c)],_0x1f7bed,_0xe64578[_0x2a2a36(0x1a1)][_0x2a2a36(0x1da)],_0xe64578['activationActions'],_0x4649c9,_0xe64578[_0x2a2a36(0x1ef)]);_0x583b31[_0x2a2a36(0xff)]=_0x28844f;}catch(_0x24278a){if(_0x24278a instanceof SDKError)throw _0x24278a;throw new SDKError(ErrorCode[_0x2a2a36(0x1dc)],_0x2a2a36(0x1ac)+_0xe64578[_0x2a2a36(0x1a1)][_0x2a2a36(0x1da)]+_0x2a2a36(0x1c2)+_0xe64578[_0x2a2a36(0x1ef)]+'\x0a\x20\x20'+getErrorMessage(_0x24278a),_0x24278a);}return _0x583b31;},_0x48ea67=await batchAsync(_0x33cdf6,_0x35c347,_0x4d9867),_0x5957f0={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x365759 of _0x48ea67){_0x5957f0[_0x5dfd7d(0xf5)]+=_0x365759[_0x5dfd7d(0xf5)],_0x5957f0[_0x5dfd7d(0xf7)]+=_0x365759[_0x5dfd7d(0xf7)],_0x365759[_0x5dfd7d(0x1c4)]&&_0x5957f0['createdSegmentIds'][_0x5dfd7d(0x18f)](_0x365759['createdSegmentId'][_0x5dfd7d(0x1da)],_0x365759[_0x5dfd7d(0x1c4)]['id']),_0x5957f0[_0x5dfd7d(0xff)][_0x5dfd7d(0xf5)]+=_0x365759['activations'][_0x5dfd7d(0xf5)],_0x5957f0[_0x5dfd7d(0xff)][_0x5dfd7d(0xf7)]+=_0x365759['activations'][_0x5dfd7d(0xf7)],_0x5957f0['activations'][_0x5dfd7d(0x1c1)]+=_0x365759[_0x5dfd7d(0xff)]['deleted'];}return _0x5957f0;}async function syncActivationsForSegment(_0x177ed4,_0x223ccb,_0x3a1939,_0x4bb41e,_0x338059,_0x4a1509,_0x2317b2){const _0x107075=a152_0x4bbc,_0x7a0cee={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x4cb445 of _0x338059){try{if(_0x4cb445[_0x107075(0xf9)]===_0x107075(0x145)&&_0x4cb445[_0x107075(0x1a4)])_0x4a1509[_0x107075(0x10a)]?.({'type':_0x107075(0x146),'segmentName':_0x4bb41e,'activationName':_0x4cb445[_0x107075(0x1da)]}),await _0x4a1509[_0x107075(0x182)](_0x107075(0x140)+_0x4cb445[_0x107075(0x1da)]+_0x107075(0x19b),()=>_0x177ed4['segment'][_0x107075(0x11e)](_0x223ccb,_0x3a1939,_0x4cb445[_0x107075(0x1a4)])),_0x4a1509['onProgress']?.({'type':'activation_created','segmentName':_0x4bb41e,'activationName':_0x4cb445[_0x107075(0x1da)]}),_0x4a1509[_0x107075(0x17d)]?.('Created\x20activation\x20\x27'+_0x4cb445['name']+'\x27'),_0x7a0cee['created']++;else{if(_0x4cb445[_0x107075(0xf9)]===_0x107075(0x142)&&_0x4cb445['validatedRequest']&&_0x4cb445[_0x107075(0x117)])_0x4a1509[_0x107075(0x10a)]?.({'type':'activation_updating','segmentName':_0x4bb41e,'activationName':_0x4cb445[_0x107075(0x1da)]}),await _0x4a1509[_0x107075(0x182)](_0x107075(0x18a)+_0x4cb445['name']+'\x27...',()=>_0x177ed4[_0x107075(0x161)][_0x107075(0x16d)](_0x223ccb,_0x3a1939,_0x4cb445[_0x107075(0x117)]['id'],_0x4cb445[_0x107075(0x1a4)])),_0x4a1509[_0x107075(0x10a)]?.({'type':_0x107075(0x177),'segmentName':_0x4bb41e,'activationName':_0x4cb445[_0x107075(0x1da)]}),_0x4a1509[_0x107075(0x17d)]?.('Updated\x20activation\x20\x27'+_0x4cb445[_0x107075(0x1da)]+'\x27'),_0x7a0cee[_0x107075(0xf7)]++;else _0x4cb445['type']===_0x107075(0x144)&&_0x4cb445[_0x107075(0x117)]&&(_0x4a1509['onProgress']?.({'type':'activation_deleting','segmentName':_0x4bb41e,'activationName':_0x4cb445[_0x107075(0x1da)]}),await _0x4a1509[_0x107075(0x182)]('Deleting\x20activation\x20\x27'+_0x4cb445[_0x107075(0x1da)]+_0x107075(0x19b),()=>_0x177ed4[_0x107075(0x161)][_0x107075(0x1ee)](_0x223ccb,_0x3a1939,_0x4cb445[_0x107075(0x117)]['id'])),_0x4a1509[_0x107075(0x10a)]?.({'type':_0x107075(0x133),'segmentName':_0x4bb41e,'activationName':_0x4cb445[_0x107075(0x1da)]}),_0x4a1509[_0x107075(0x15c)]?.(_0x107075(0x12d)+_0x4cb445[_0x107075(0x1da)]+'\x27'),_0x7a0cee[_0x107075(0x1c1)]++);}}catch(_0x507480){const _0x34f492=isHttp400Error(_0x507480),_0x98c196=_0x34f492?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode[_0x107075(0x1dc)],_0x201fa5=getErrorMessage(_0x507480);throw new SDKError(_0x98c196,_0x107075(0x164)+_0x4cb445[_0x107075(0xf9)]+_0x107075(0x11b)+_0x4cb445[_0x107075(0x1da)]+_0x107075(0x1c2)+_0x2317b2+_0x107075(0x12a)+_0x201fa5,_0x507480);}}return _0x7a0cee;}export async function executePushFolders(_0x3f0a4c,_0x568794,_0x1e0189,_0x200d5b,_0x209919){const _0x5bd381=a152_0x4bbc,_0x6a27bf=new Map(_0x1e0189),_0x3448f6=sortFoldersByDepth(_0x568794);for(const _0xff3702 of _0x3448f6){const _0x1c3d7e=_0xff3702[_0x5bd381(0x1eb)]('/'),_0x34ed5d=_0x1c3d7e[_0x1c3d7e['length']-0x1],_0x3b7b10=_0x1c3d7e[_0x5bd381(0x1b9)](0x0,-0x1)[_0x5bd381(0x1ea)]('/'),_0x4342f7=_0x6a27bf[_0x5bd381(0x138)](_0x3b7b10);_0x209919[_0x5bd381(0x10a)]?.({'type':'folder_creating','folder':_0xff3702});const _0x1214ab={'name':_0x34ed5d,'parentFolderId':_0x4342f7},_0x2a6a5a=await _0x209919[_0x5bd381(0x182)](_0x5bd381(0x16c)+_0xff3702+_0x5bd381(0x19b),()=>_0x3f0a4c[_0x5bd381(0x161)]['createFolder'](_0x200d5b['parentId'],_0x1214ab));_0x6a27bf[_0x5bd381(0x18f)](_0xff3702,_0x2a6a5a[_0x5bd381(0x1b4)]['id']),_0x209919[_0x5bd381(0x10a)]?.({'type':_0x5bd381(0x1aa),'folder':_0xff3702,'folderId':_0x2a6a5a[_0x5bd381(0x1b4)]['id']}),_0x209919[_0x5bd381(0x1bc)]?.('Created\x20folder\x20\x27'+_0xff3702+'\x27');}return _0x6a27bf;}export async function executePushSegmentDeletions(_0xe3b10c,_0x2abd14,_0x45b3b9){const _0x44dff8=a152_0x4bbc;if(_0x2abd14[_0x44dff8(0x175)]===0x0)return 0x0;const {batchAsync:_0x232429}=await import(_0x44dff8(0x162)),_0x56cfef=0x5,_0x3375bb=await _0x232429(_0x2abd14,async _0x431f24=>{const _0x54322a=_0x44dff8;return _0x45b3b9['onProgress']?.({'type':_0x54322a(0x1b0),'name':_0x431f24[_0x54322a(0x1da)]}),await _0xe3b10c[_0x54322a(0x161)][_0x54322a(0x1d2)](_0x431f24['id']),_0x45b3b9[_0x54322a(0x10a)]?.({'type':'segment_deleted','name':_0x431f24[_0x54322a(0x1da)]}),_0x45b3b9[_0x54322a(0x15c)]?.(_0x54322a(0x11c)+_0x431f24['name']+'\x27'),0x1;},_0x56cfef);return _0x3375bb[_0x44dff8(0x153)]((_0x1de469,_0x235bb9)=>_0x1de469+_0x235bb9,0x0);}export async function executePushJourneys(_0x4ba479,_0xcac01,_0x1ff10b,_0x11dcc2,_0x470e5a){const _0x24cac9=a152_0x4bbc,{journeyDefToRequest:_0x5a9ca9}=await import(_0x24cac9(0x190)),{activationDefToCreateRequest:_0x207e83,yamlRuleToApi:_0x31edf1,validateSegmentRule:_0x548658}=await import('./child-segment-yaml.js'),_0x4706ed={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x4348e4=new Map(_0x1ff10b[_0x24cac9(0x14d)]),_0x2d6fbc=0x5;for(let _0x5ed94d=0x0;_0x5ed94d<_0xcac01[_0x24cac9(0x175)];_0x5ed94d+=_0x2d6fbc){const _0x2c39b6=_0xcac01[_0x24cac9(0x1b9)](_0x5ed94d,_0x5ed94d+_0x2d6fbc),_0x67a3f8=await Promise[_0x24cac9(0x10e)](_0x2c39b6[_0x24cac9(0x1db)](async _0x1eb578=>{const _0x2803bb=_0x24cac9;if(!_0x1eb578[_0x2803bb(0x128)]&&!_0x1eb578[_0x2803bb(0x1e8)])return{'action':_0x2803bb(0x14b),'name':_0x1eb578['yamlConfig'][_0x2803bb(0x1da)],'journeyId':_0x1eb578[_0x2803bb(0x127)]?.['id']};const _0x33072f=_0x1eb578[_0x2803bb(0x101)]?_0x1ff10b[_0x2803bb(0x185)][_0x2803bb(0x138)](_0x1eb578['folderPath']):undefined;_0x470e5a[_0x2803bb(0x10a)]?.({'type':_0x1eb578[_0x2803bb(0x128)]?'journey_creating':_0x2803bb(0x13a),'name':_0x1eb578['yamlConfig'][_0x2803bb(0x1da)]});try{const _0x10736f=await executeSingleJourneyPush(_0x4ba479,_0x1eb578,{..._0x1ff10b,'segmentNameToId':_0x4348e4},{'parentId':_0x11dcc2['parentId'],'rootFolderId':_0x11dcc2['rootFolderId'],'folderId':_0x33072f,'verbose':_0x11dcc2[_0x2803bb(0x17e)]},_0x470e5a,{'journeyDefToRequest':_0x5a9ca9,'activationDefToCreateRequest':_0x207e83,'yamlRuleToApi':_0x31edf1,'validateSegmentRule':_0x548658});for(const [_0x566b1b,_0x5d83e8]of _0x10736f[_0x2803bb(0x10b)]){_0x4348e4['set'](_0x566b1b,_0x5d83e8),_0x4706ed['embeddedSegmentNameToId']['set'](_0x566b1b,_0x5d83e8);}if(_0x10736f['action']===_0x2803bb(0xf5))_0x470e5a[_0x2803bb(0x10a)]?.({'type':'journey_created','name':_0x1eb578[_0x2803bb(0x1a1)][_0x2803bb(0x1da)],'journeyId':_0x10736f[_0x2803bb(0x183)]}),_0x470e5a[_0x2803bb(0x17d)]?.(_0x2803bb(0x106)+_0x1eb578[_0x2803bb(0x1a1)]['name']+'\x27'),_0x4706ed[_0x2803bb(0xf5)]++;else _0x10736f[_0x2803bb(0x1d9)]===_0x2803bb(0xf7)&&(_0x470e5a[_0x2803bb(0x10a)]?.({'type':_0x2803bb(0x103),'name':_0x1eb578[_0x2803bb(0x1a1)][_0x2803bb(0x1da)]}),_0x470e5a[_0x2803bb(0x17d)]?.(_0x2803bb(0xf8)+_0x1eb578[_0x2803bb(0x1a1)][_0x2803bb(0x1da)]+'\x27'),_0x4706ed['updated']++);return{'action':_0x10736f[_0x2803bb(0x1d9)],'name':_0x1eb578['yamlConfig'][_0x2803bb(0x1da)],'journeyId':_0x10736f['journeyId']};}catch(_0x5f530c){const _0x389793=isHttp400Error(_0x5f530c),_0x56c050=_0x389793?ErrorCode['JOURNEY_SYNTAX_ERROR']:ErrorCode['JOURNEY_UPDATE_ERROR'],_0x5be41a=getErrorMessage(_0x5f530c);throw new SDKError(_0x56c050,_0x2803bb(0x164)+(_0x1eb578[_0x2803bb(0x128)]?_0x2803bb(0x145):'update')+_0x2803bb(0x1e5)+_0x1eb578[_0x2803bb(0x1ef)]+_0x2803bb(0x12a)+_0x5be41a,_0x5f530c);}}));_0x4706ed[_0x24cac9(0x1cb)][_0x24cac9(0x1b5)](..._0x67a3f8);}return _0x4706ed;}async function matchExistingJourneySegments(_0x5a53ed,_0xce1176,_0x3d5624,_0x16fdd7,_0xd5c3a){const _0x55c9c6=a152_0x4bbc;if(!_0xce1176['existingJourney']||!_0xce1176[_0x55c9c6(0x1a1)][_0x55c9c6(0x134)])return;const _0x33c48e=new Map(),_0x417223=new Set();for(const _0x2958f1 of Object[_0x55c9c6(0x1b3)](_0xce1176[_0x55c9c6(0x1a1)][_0x55c9c6(0x134)])){const _0x19eb26=generateDeterministicJourneySegmentName(_0xce1176[_0x55c9c6(0x1a1)][_0x55c9c6(0x1da)],_0x2958f1);_0x33c48e['set'](_0x19eb26,_0x2958f1),_0x417223[_0x55c9c6(0x12c)](_0x2958f1);}const _0x495f00=[],_0x524dcd=collectSegmentIdsFromJourneyApi(_0xce1176[_0x55c9c6(0x127)]);for(const _0x569f86 of _0x524dcd){const _0x18b0fe=await fetchSegment(_0x5a53ed,_0x3d5624,_0x569f86,_0x16fdd7);if(!_0x18b0fe?.[_0x55c9c6(0x1da)])continue;const _0x32e1bf=_0x33c48e[_0x55c9c6(0x138)](_0x18b0fe[_0x55c9c6(0x1da)]);_0x32e1bf?(_0xd5c3a['set'](_0x32e1bf,_0x569f86),_0x417223['delete'](_0x32e1bf)):_0x495f00[_0x55c9c6(0x1b5)]({'id':_0x569f86,'seg':_0x18b0fe});}if(_0x417223[_0x55c9c6(0x156)]>0x0&&_0x495f00['length']>0x0){const {localExpandedRuleToNames:_0x35222c}=buildLocalExpandedRuleMappings(_0xce1176[_0x55c9c6(0x1a1)]),_0x544a13=new Map();for(const {id:_0x9b6ff8,seg:_0x1e7d1b}of _0x495f00){if(_0x1e7d1b['rule']){const _0x114efa=apiRuleToYaml(_0x1e7d1b['rule']);_0x544a13[_0x55c9c6(0x18f)](_0x9b6ff8,_0x114efa);}}for(const {id:_0x27784c,seg:_0x9f9d50}of _0x495f00){if(!_0x9f9d50[_0x55c9c6(0x1ec)])continue;const _0x22903f=_0x544a13[_0x55c9c6(0x138)](_0x27784c);if(!_0x22903f)continue;const _0x25a82f=serializeExpandedRule(_0x22903f,_0x544a13),_0x45f975=_0x35222c[_0x55c9c6(0x138)](_0x25a82f);if(_0x45f975){const _0x518de4=_0x45f975['find'](_0x472b68=>_0x417223[_0x55c9c6(0x1ad)](_0x472b68));_0x518de4&&(_0xd5c3a[_0x55c9c6(0x18f)](_0x518de4,_0x27784c),_0x417223['delete'](_0x518de4),logger[_0x55c9c6(0x119)](_0x55c9c6(0x1ce)+_0x9f9d50[_0x55c9c6(0x1da)]+'\x27\x20to\x20local\x20\x27'+_0x518de4+_0x55c9c6(0x1c3)));}}}}async function executeSingleJourneyPush(_0x1ac246,_0x43a1ab,_0x18c69d,_0x13192f,_0x35b3b1,_0x3cb95f){const _0xc5e80f=a152_0x4bbc,{journeyDefToRequest:_0x25468a,activationDefToCreateRequest:_0x106de3,yamlRuleToApi:_0x51873b,validateSegmentRule:_0x10b2d8}=_0x3cb95f,_0x88b05c=new Map(),_0x393493=new Map();recoverSegmentIdsFromPushRecovery(_0x43a1ab,_0x88b05c,_0x18c69d['segmentNameToId']);const _0x30b33a=new Map(),_0x2d18b0=new Map(),_0x424e0a=new Map();let _0x554034;const _0x584f98=async()=>{const _0x18d474=a152_0x4bbc;if(_0x554034)return;_0x554034=new Map();if(!_0x43a1ab['existingJourney'])return;const _0x4c5bf7=await _0x1ac246[_0x18d474(0x160)][_0x18d474(0x17a)](_0x43a1ab['existingJourney']['id']);for(const _0x47b4ff of _0x4c5bf7){const _0x481410=journeyActivationStepToYaml(_0x47b4ff,_0x18c69d[_0x18d474(0x180)],_0x18c69d[_0x18d474(0x186)]),_0x3c54ca=activationSignature(_0x481410);!_0x554034[_0x18d474(0x1ad)](_0x3c54ca)&&_0x554034[_0x18d474(0x18f)](_0x3c54ca,_0x47b4ff['id']),_0x481410[_0x18d474(0x1da)]&&_0x393493['set'](_0x481410[_0x18d474(0x1da)],_0x47b4ff['id']);}};await matchExistingJourneySegments(_0x1ac246,_0x43a1ab,_0x13192f['parentId'],_0x18c69d['existingSegments'],_0x18c69d['segmentNameToId']);const _0x4cdbb6={'resolveSegmentId':async _0x6f8f6e=>{const _0x1ad5f5=a152_0x4bbc,_0x1da3be=_0x18c69d['segmentNameToId'][_0x1ad5f5(0x138)](_0x6f8f6e);if(!_0x1da3be)throw new SDKError(ErrorCode[_0x1ad5f5(0x170)],_0x1ad5f5(0x16f)+_0x6f8f6e+_0x1ad5f5(0x120)+_0x43a1ab[_0x1ad5f5(0x1a1)][_0x1ad5f5(0x1da)]+')');return _0x1da3be;},'resolveEmbeddedSegmentId':async(_0x268dac,_0x5b6991)=>{const _0x3bbc18=a152_0x4bbc,_0x20cbe9=_0x18c69d[_0x3bbc18(0x14d)][_0x3bbc18(0x138)](_0x268dac);if(_0x20cbe9)return _0x20cbe9;const _0x3f24cb=_0x18c69d[_0x3bbc18(0x122)][_0x3bbc18(0x1a3)](_0x33caae=>_0x33caae[_0x3bbc18(0x1da)]===_0x268dac);if(_0x3f24cb)return _0x18c69d['segmentNameToId'][_0x3bbc18(0x18f)](_0x268dac,_0x3f24cb['id']),_0x3f24cb['id'];if(_0x43a1ab[_0x3bbc18(0x128)]){const {stageName:_0x1769ef,criteriaName:_0x3402e4}=findSegmentCriteriaLocation(_0x43a1ab['yamlConfig'],_0x268dac);return _0x10b2d8(_0x268dac,_0x5b6991[_0x3bbc18(0x1ec)]),_0x2d18b0[_0x3bbc18(0x18f)](_0x268dac,{'definition':_0x5b6991,'stageName':_0x1769ef,'criteriaName':_0x3402e4}),createPendingSegmentId(_0x268dac);}const _0x15041b=_0x43a1ab['existingJourney']?.['id'];if(!_0x15041b)throw new SDKError(ErrorCode[_0x3bbc18(0x11d)],_0x3bbc18(0x1e7));const _0x28071e=_0x30b33a['get'](_0x268dac);if(_0x28071e)return _0x28071e;const _0x4381f9=((async()=>{const _0x48d61f=_0x3bbc18;_0x10b2d8(_0x268dac,_0x5b6991[_0x48d61f(0x1ec)]);const _0x449e9f=generateDeterministicJourneySegmentName(_0x43a1ab[_0x48d61f(0x1a1)]['name'],_0x268dac),_0x11ec73=_0x18c69d['existingSegments'][_0x48d61f(0x1a3)](_0x5b6706=>_0x5b6706[_0x48d61f(0x1da)]===_0x449e9f),_0x2b3d19=createSegmentIdResolver(_0x18c69d[_0x48d61f(0x14d)],_0x268dac),_0x202849=await resolveRuleSegmentIds(_0x5b6991[_0x48d61f(0x1ec)],_0x2b3d19);let _0x49860f;return _0x11ec73?(await _0x1ac246[_0x48d61f(0x161)][_0x48d61f(0x1f0)](_0x13192f['parentId'],_0x11ec73['id'],{'description':_0x5b6991[_0x48d61f(0x19f)]||_0x48d61f(0x132)+_0x268dac,'rule':_0x51873b(_0x202849,!![]),'countPopulation':!![]}),_0x49860f=_0x11ec73['id'],saveSegmentToPushRecovery(_0x43a1ab[_0x48d61f(0x1ef)],_0x43a1ab[_0x48d61f(0x1a1)][_0x48d61f(0x1da)],_0x268dac,{'segmentId':_0x49860f,'uniqueServerName':_0x449e9f,'createdAt':new Date()[_0x48d61f(0x191)]()})):_0x49860f=await createOrRecoverEmbeddedSegment(_0x1ac246,_0x43a1ab,{'localName':_0x268dac,'uniqueSegmentName':_0x449e9f,'description':_0x5b6991[_0x48d61f(0x19f)]||_0x48d61f(0x132)+_0x268dac,'journeyId':_0x15041b,'resolvedRule':_0x202849,'parentId':_0x13192f[_0x48d61f(0x17c)],'folderId':_0x13192f['rootFolderId']||''},_0x51873b),_0x18c69d[_0x48d61f(0x14d)][_0x48d61f(0x18f)](_0x268dac,_0x49860f),_0x88b05c[_0x48d61f(0x18f)](_0x268dac,_0x49860f),_0x49860f;})());_0x30b33a[_0x3bbc18(0x18f)](_0x268dac,_0x4381f9);try{return await _0x4381f9;}finally{_0x30b33a[_0x3bbc18(0x144)](_0x268dac);}},'resolveActivationId':async _0x46316f=>{const _0x5d52e9=a152_0x4bbc,_0x5e8cde=_0x393493[_0x5d52e9(0x138)](_0x46316f);if(_0x5e8cde)return _0x5e8cde;if(_0x43a1ab[_0x5d52e9(0x127)]){await _0x584f98();const _0x302fb3=_0x393493[_0x5d52e9(0x138)](_0x46316f);if(_0x302fb3)return _0x302fb3;}throw new SDKError(ErrorCode['NOT_FOUND'],_0x5d52e9(0x198)+_0x46316f+_0x5d52e9(0x120)+_0x43a1ab[_0x5d52e9(0x1a1)][_0x5d52e9(0x1da)]+_0x5d52e9(0x1e6)+_0x5d52e9(0x151));},'resolveEmbeddedActivationId':async(_0x110804,_0x2da819)=>{const _0x10a47a=a152_0x4bbc,_0x3f19d5=_0x393493[_0x10a47a(0x138)](_0x110804);if(_0x3f19d5)return _0x3f19d5;if(_0x43a1ab['isNew'])return _0x424e0a['set'](_0x110804,_0x2da819),createPendingActivationId(_0x110804);if(_0x43a1ab[_0x10a47a(0x127)]){await _0x584f98();const _0x1a1b79=_0x393493[_0x10a47a(0x138)](_0x2da819[_0x10a47a(0x1da)]);if(_0x1a1b79)return _0x393493[_0x10a47a(0x18f)](_0x110804,_0x1a1b79),_0x1a1b79;const _0x139b60=activationSignature(_0x2da819),_0x27e967=_0x554034?.[_0x10a47a(0x138)](_0x139b60);if(_0x27e967)return _0x393493[_0x10a47a(0x18f)](_0x110804,_0x27e967),_0x27e967;const _0x3a216d=await _0x106de3(_0x2da819,_0x18c69d[_0x10a47a(0x1a5)]),_0x2bfbc7={..._0x3a216d,..._0x2da819[_0x10a47a(0x1d8)]!==undefined&&{'runAfterJourneyRefresh':_0x2da819[_0x10a47a(0x1d8)]}},_0x442194=await _0x1ac246[_0x10a47a(0x160)][_0x10a47a(0x11e)](_0x43a1ab[_0x10a47a(0x127)]['id'],_0x2bfbc7);return _0x393493[_0x10a47a(0x18f)](_0x110804,_0x442194['id']),_0x442194['id'];}throw new SDKError(ErrorCode[_0x10a47a(0x11d)],_0x10a47a(0x14a));},'resolveJourneyId':async _0x44b05c=>{const _0xf196c9=a152_0x4bbc;try{return await _0x1ac246[_0xf196c9(0x160)][_0xf196c9(0x148)](_0x13192f[_0xf196c9(0x17c)],_0x44b05c);}catch(_0x4c0f09){throw new SDKError(ErrorCode['NOT_FOUND'],'Journey\x20\x27'+_0x44b05c+_0xf196c9(0x150)+_0x43a1ab['yamlConfig'][_0xf196c9(0x1da)]+'\x27)',_0x4c0f09);}},'resolveStageId':async(_0xa06587,_0x4e8443)=>{const _0x10684d=a152_0x4bbc,_0x105001=await _0x1ac246[_0x10684d(0x160)]['getJourney'](_0xa06587),_0x27b088=_0x105001['attributes'][_0x10684d(0x167)][_0x10684d(0x1a3)](_0x476759=>_0x476759[_0x10684d(0x1da)][_0x10684d(0x11a)]()===_0x4e8443['toLowerCase']());if(!_0x27b088?.['id'])throw new SDKError(ErrorCode[_0x10684d(0x14f)],_0x10684d(0x10f)+_0x4e8443+_0x10684d(0x137)+(_0x105001[_0x10684d(0xf6)]['journeyBundleName']||_0x105001['attributes'][_0x10684d(0x1da)])+'\x27');return _0x27b088['id'];}},_0x20b76e=await _0x25468a(_0x43a1ab[_0xc5e80f(0x1a1)],_0x13192f['parentId'],_0x4cdbb6),_0x560f9a=_0x13192f[_0xc5e80f(0x157)]||_0x13192f[_0xc5e80f(0xfe)];_0x560f9a&&(_0x20b76e[_0xc5e80f(0x1b7)]={'parentFolder':{'data':{'id':_0x560f9a,'type':_0xc5e80f(0x18d)}}});if(_0x43a1ab[_0xc5e80f(0x128)]){if(_0x2d18b0[_0xc5e80f(0x156)]>0x0||_0x424e0a[_0xc5e80f(0x156)]>0x0)return await executeThreeStepJourneyCreate(_0x1ac246,_0x43a1ab,_0x20b76e,{'pendingEmbeddedSegments':_0x2d18b0,'pendingEmbeddedActivations':_0x424e0a,'embeddedSegmentNameToId':_0x88b05c,'journeyActivationNameToId':_0x393493},{..._0x13192f,'effectiveFolderId':_0x560f9a},_0x18c69d,_0x35b3b1,_0x3cb95f);else{ensureJourneyDefaults(_0x20b76e[_0xc5e80f(0xf6)]);const _0x38007a=await _0x1ac246[_0xc5e80f(0x160)][_0xc5e80f(0x145)](_0x20b76e);return deletePushRecovery(_0x43a1ab['absolutePath']),{'action':_0xc5e80f(0xf5),'journeyId':_0x38007a['id'],'embeddedSegmentNameToId':_0x88b05c};}}else{if(_0x43a1ab[_0xc5e80f(0x1e8)]&&_0x43a1ab['existingJourney']){_0x20b76e['id']=_0x43a1ab['existingJourney']['id'];const _0x41a681=_0x20b76e[_0xc5e80f(0xf6)];_0x43a1ab[_0xc5e80f(0x127)][_0xc5e80f(0xf6)]?.[_0xc5e80f(0x1e9)]&&(_0x41a681[_0xc5e80f(0x1e9)]=_0x43a1ab[_0xc5e80f(0x127)][_0xc5e80f(0xf6)][_0xc5e80f(0x1e9)]);const _0x4059e5=_0x43a1ab[_0xc5e80f(0x127)][_0xc5e80f(0xf6)]?.[_0xc5e80f(0x167)];return _0x4059e5&&_0x20b76e[_0xc5e80f(0xf6)][_0xc5e80f(0x167)]&&injectExistingStageIds(_0x20b76e[_0xc5e80f(0xf6)]['journeyStages'],_0x4059e5),ensureJourneyDefaults(_0x41a681),await _0x1ac246[_0xc5e80f(0x160)][_0xc5e80f(0x142)](_0x43a1ab[_0xc5e80f(0x127)]['id'],_0x20b76e),deletePushRecovery(_0x43a1ab['absolutePath']),{'action':'updated','journeyId':_0x43a1ab[_0xc5e80f(0x127)]['id'],'embeddedSegmentNameToId':_0x88b05c};}}return deletePushRecovery(_0x43a1ab[_0xc5e80f(0x1ef)]),{'action':_0xc5e80f(0x14b),'journeyId':_0x43a1ab[_0xc5e80f(0x127)]?.['id'],'embeddedSegmentNameToId':_0x88b05c};}function findSegmentCriteriaLocation(_0x4bc60d,_0x35b552){const _0x378cf4=a152_0x4bbc,_0x5ada35=_0x4bc60d[_0x378cf4(0x1d7)]||_0x4bc60d[_0x378cf4(0x10d)]?.[0x0]?.[_0x378cf4(0x1d7)]||[];let _0x5c240e='entry',_0x46c54e=_0x35b552;const _0x45b6c5=_0x4bc60d[_0x378cf4(0x181)]||_0x4bc60d['journeys']?.[0x0]?.[_0x378cf4(0x181)];if(_0x45b6c5?.['segment']===_0x35b552)return{'stageName':'goal','criteriaName':_0x45b6c5[_0x378cf4(0x1da)]||_0x35b552};_0x1d003d:for(const _0x3d9351 of _0x5ada35){if(_0x3d9351[_0x378cf4(0x1c8)]?.[_0x378cf4(0x161)]===_0x35b552){_0x5c240e=_0x3d9351['name'],_0x46c54e=_0x3d9351[_0x378cf4(0x1c8)]['name']||_0x35b552;break;}if(_0x3d9351[_0x378cf4(0x1b1)])for(const _0x4ee550 of _0x3d9351['steps']){if(_0x4ee550['type']===_0x378cf4(0x1d5)&&_0x4ee550[_0x378cf4(0x18e)]?.[_0x378cf4(0x195)])for(const _0x48a613 of _0x4ee550['with'][_0x378cf4(0x195)]){if(_0x48a613[_0x378cf4(0x161)]===_0x35b552){_0x5c240e=_0x3d9351['name'],_0x46c54e=_0x48a613[_0x378cf4(0x1da)]||_0x35b552;break _0x1d003d;}}}}return{'stageName':_0x5c240e,'criteriaName':_0x46c54e};}async function executeThreeStepJourneyCreate(_0x576d30,_0x1edc6a,_0x55811b,_0x43a69f,_0x313c8a,_0x2900d3,_0x4f8377,_0x506bfd){const _0x9e3141=a152_0x4bbc,{activationDefToCreateRequest:_0x3d2f0c,yamlRuleToApi:_0x1fd8c0}=_0x506bfd,{pendingEmbeddedSegments:_0x304c4b,pendingEmbeddedActivations:_0x53e345,embeddedSegmentNameToId:_0x325bab}=_0x43a69f,_0x5d7d76=JSON[_0x9e3141(0x109)](JSON[_0x9e3141(0x172)](_0x55811b));ensureJourneyDefaults(_0x5d7d76[_0x9e3141(0xf6)]),stripPendingIds(_0x5d7d76);const _0x38d151=await _0x576d30['journey'][_0x9e3141(0x145)](_0x5d7d76),_0x3ce49e=_0x38d151['id'],_0x4ac3f8=new Map();for(const _0x5e6496 of _0x38d151[_0x9e3141(0xf6)][_0x9e3141(0x167)]){_0x4ac3f8['set'](_0x5e6496[_0x9e3141(0x1da)][_0x9e3141(0x11a)](),_0x5e6496['id']);}recoverSegmentIdsFromPushRecovery(_0x1edc6a,_0x325bab,_0x2900d3[_0x9e3141(0x14d)]);for(const [_0xeef6f8,{definition:_0xd74fe5}]of _0x304c4b){if(_0x325bab[_0x9e3141(0x1ad)](_0xeef6f8)){_0x4f8377['onProgress']?.({'type':_0x9e3141(0x1d0),'journeyName':_0x1edc6a[_0x9e3141(0x1a1)][_0x9e3141(0x1da)],'segmentName':_0xeef6f8});continue;}const _0x51eeec=generateDeterministicJourneySegmentName(_0x1edc6a[_0x9e3141(0x1a1)]['name'],_0xeef6f8);_0x4f8377['onProgress']?.({'type':'embedded_segment_creating','journeyName':_0x1edc6a['yamlConfig'][_0x9e3141(0x1da)],'segmentName':_0xeef6f8});const _0x10e18c=createSegmentIdResolver(_0x2900d3['segmentNameToId'],_0xeef6f8),_0x4123a4=await resolveRuleSegmentIds(_0xd74fe5[_0x9e3141(0x1ec)],_0x10e18c),_0x45e8c5=await createOrRecoverEmbeddedSegment(_0x576d30,_0x1edc6a,{'localName':_0xeef6f8,'uniqueSegmentName':_0x51eeec,'description':_0xd74fe5[_0x9e3141(0x19f)]||_0x9e3141(0x132)+_0xeef6f8,'journeyId':_0x3ce49e,'resolvedRule':_0x4123a4,'parentId':_0x313c8a[_0x9e3141(0x17c)],'folderId':_0x313c8a['effectiveFolderId']||''},_0x1fd8c0);_0x325bab[_0x9e3141(0x18f)](_0xeef6f8,_0x45e8c5),_0x2900d3['segmentNameToId'][_0x9e3141(0x18f)](_0xeef6f8,_0x45e8c5),_0x4f8377[_0x9e3141(0x10a)]?.({'type':_0x9e3141(0x1d0),'journeyName':_0x1edc6a[_0x9e3141(0x1a1)][_0x9e3141(0x1da)],'segmentName':_0xeef6f8});}const _0x3f356e=new Map();for(const [_0x1fc100,_0x32d4a4]of _0x53e345){_0x4f8377[_0x9e3141(0x10a)]?.({'type':_0x9e3141(0x12b),'journeyName':_0x1edc6a[_0x9e3141(0x1a1)][_0x9e3141(0x1da)],'activationName':_0x1fc100});const _0x3b5b3b=await _0x3d2f0c(_0x32d4a4,_0x2900d3[_0x9e3141(0x1a5)]),_0x3730f9={..._0x3b5b3b,..._0x32d4a4[_0x9e3141(0x1d8)]!==undefined&&{'runAfterJourneyRefresh':_0x32d4a4['run_after_journey_refresh']}},_0x447ab1=await _0x576d30[_0x9e3141(0x160)]['createActivation'](_0x3ce49e,_0x3730f9);_0x3f356e[_0x9e3141(0x18f)](_0x1fc100,_0x447ab1['id']),_0x43a69f['journeyActivationNameToId'][_0x9e3141(0x18f)](_0x1fc100,_0x447ab1['id']),_0x4f8377[_0x9e3141(0x10a)]?.({'type':'embedded_activation_created','journeyName':_0x1edc6a[_0x9e3141(0x1a1)][_0x9e3141(0x1da)],'activationName':_0x1fc100});}const _0x1ac8e5=JSON[_0x9e3141(0x109)](JSON[_0x9e3141(0x172)](_0x55811b));return _0x1ac8e5['id']=_0x3ce49e,ensureJourneyDefaults(_0x1ac8e5[_0x9e3141(0xf6)]),resolvePendingIdsInRequest(_0x1ac8e5,_0x55811b,_0x4ac3f8,_0x325bab,_0x3f356e,_0x4f8377),await _0x576d30[_0x9e3141(0x160)][_0x9e3141(0x142)](_0x3ce49e,_0x1ac8e5),deletePushRecovery(_0x1edc6a[_0x9e3141(0x1ef)]),{'action':_0x9e3141(0xf5),'journeyId':_0x3ce49e,'embeddedSegmentNameToId':_0x325bab};}export function stripWaitStepPendingIds(_0x582586){const _0x141379=a152_0x4bbc,_0x2822c2=_0x582586[_0x141379(0x16b)]&&isPendingSegmentId(_0x582586[_0x141379(0x16b)]),_0x27e8f8=_0x582586[_0x141379(0x1d6)]?.[_0x141379(0x105)](_0xec7571=>_0xec7571[_0x141379(0x179)]&&isPendingSegmentId(_0xec7571[_0x141379(0x179)]));(_0x2822c2||_0x27e8f8)&&(_0x582586[_0x141379(0x13b)]=_0x141379(0x189),_0x582586[_0x141379(0x15a)]=0x1,_0x582586[_0x141379(0x12e)]='day',delete _0x582586[_0x141379(0x16b)],delete _0x582586[_0x141379(0x130)],delete _0x582586[_0x141379(0x1df)],delete _0x582586['conditions']);}export function resolveWaitStepPendingIds(_0x367411,_0x4933af,_0x290578,_0x5c12a2){const _0x2dea22=a152_0x4bbc;if(_0x4933af[_0x2dea22(0x16b)]&&isPendingSegmentId(_0x4933af['conditionSegmentId'])){const _0x3a82d6=_0x290578(_0x4933af['conditionSegmentId'],_0x2dea22(0x1c9)+_0x5c12a2+'\x27\x20wait\x20condition');_0x3a82d6&&(_0x367411[_0x2dea22(0x13b)]=_0x2dea22(0x194),_0x367411[_0x2dea22(0x16b)]=_0x3a82d6,delete _0x367411[_0x2dea22(0x15a)],delete _0x367411['waitStepUnit'],_0x4933af['conditionTimeoutDuration']!==undefined&&(_0x367411['conditionTimeoutDuration']=_0x4933af[_0x2dea22(0x130)]),_0x4933af[_0x2dea22(0x1df)]&&(_0x367411[_0x2dea22(0x1df)]=_0x4933af[_0x2dea22(0x1df)]));}if(_0x4933af[_0x2dea22(0x1d6)]){const _0x3e0e52=_0x4933af['conditions'][_0x2dea22(0x105)](_0x4b970b=>_0x4b970b[_0x2dea22(0x179)]&&isPendingSegmentId(_0x4b970b[_0x2dea22(0x179)]));if(_0x3e0e52){const _0x3ce1eb=_0x4933af['conditions']['map'](_0x5f0cd9=>{const _0xd697d3=_0x2dea22;if(_0x5f0cd9[_0xd697d3(0x179)]&&isPendingSegmentId(_0x5f0cd9[_0xd697d3(0x179)])){const _0x14ea7f=_0x290578(_0x5f0cd9[_0xd697d3(0x179)],'stage\x20\x27'+_0x5c12a2+'\x27\x20wait\x20condition');return{..._0x5f0cd9,'segmentId':_0x14ea7f||_0x5f0cd9[_0xd697d3(0x179)]};}return{..._0x5f0cd9};});_0x367411[_0x2dea22(0x13b)]='Condition',_0x367411[_0x2dea22(0x1d6)]=_0x3ce1eb,delete _0x367411[_0x2dea22(0x15a)],delete _0x367411[_0x2dea22(0x12e)],delete _0x367411[_0x2dea22(0x16b)],delete _0x367411[_0x2dea22(0x130)],delete _0x367411[_0x2dea22(0x1df)];}}}function stripPendingIds(_0x14331e){const _0x2491ca=a152_0x4bbc;_0x14331e['attributes'][_0x2491ca(0x181)]?.[_0x2491ca(0x179)]&&isPendingSegmentId(_0x14331e[_0x2491ca(0xf6)][_0x2491ca(0x181)][_0x2491ca(0x179)])&&delete _0x14331e[_0x2491ca(0xf6)]['goal'];for(const _0x5466bc of _0x14331e[_0x2491ca(0xf6)][_0x2491ca(0x167)]||[]){_0x5466bc[_0x2491ca(0x1d3)]?.[_0x2491ca(0x179)]&&isPendingSegmentId(_0x5466bc['entryCriteria'][_0x2491ca(0x179)])&&delete _0x5466bc[_0x2491ca(0x1d3)];_0x5466bc['milestone']?.[_0x2491ca(0x179)]&&isPendingSegmentId(_0x5466bc[_0x2491ca(0xfd)][_0x2491ca(0x179)])&&delete _0x5466bc[_0x2491ca(0xfd)];_0x5466bc[_0x2491ca(0x147)]&&(_0x5466bc[_0x2491ca(0x147)]=_0x5466bc[_0x2491ca(0x147)][_0x2491ca(0x110)](_0x50cbea=>!_0x50cbea['segmentId']||!isPendingSegmentId(_0x50cbea['segmentId'])));if(_0x5466bc[_0x2491ca(0x1b1)])for(const _0x23b650 of Object[_0x2491ca(0x1b3)](_0x5466bc[_0x2491ca(0x1b1)])){const _0x1592f3=_0x5466bc[_0x2491ca(0x1b1)][_0x23b650];_0x1592f3['type']==='Activation'&&_0x1592f3[_0x2491ca(0x15e)]&&isPendingActivationId(_0x1592f3[_0x2491ca(0x15e)])&&(_0x1592f3[_0x2491ca(0x15e)]='');if(_0x1592f3[_0x2491ca(0xf9)]===_0x2491ca(0x102)&&_0x1592f3[_0x2491ca(0x195)])for(const _0x58ce1e of _0x1592f3[_0x2491ca(0x195)]){_0x58ce1e[_0x2491ca(0x179)]&&isPendingSegmentId(_0x58ce1e[_0x2491ca(0x179)])&&(_0x58ce1e['segmentId']='');}_0x1592f3[_0x2491ca(0xf9)]==='WaitStep'&&stripWaitStepPendingIds(_0x1592f3);}}}function resolvePendingIdsInRequest(_0x1cd088,_0xa951e2,_0x38a662,_0x1abdaf,_0x7d2ce,_0x9a52fd){const _0x45ba8f=a152_0x4bbc,_0x49c8c1=(_0x563fee,_0x10125b)=>{const _0x33a823=a152_0x4bbc;if(!isPendingSegmentId(_0x563fee))return _0x563fee;const _0x14b042=extractPendingSegmentName(_0x563fee),_0x43aa20=_0x1abdaf[_0x33a823(0x138)](_0x14b042);return!_0x43aa20&&_0x9a52fd[_0x33a823(0x1e2)]?.('Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27'+_0x14b042+_0x33a823(0x1ae)+_0x10125b),_0x43aa20;};if(_0x1cd088[_0x45ba8f(0xf6)][_0x45ba8f(0x181)]?.[_0x45ba8f(0x179)]&&isPendingSegmentId(_0x1cd088[_0x45ba8f(0xf6)]['goal'][_0x45ba8f(0x179)])){const _0x2b340e=_0x49c8c1(_0x1cd088[_0x45ba8f(0xf6)][_0x45ba8f(0x181)][_0x45ba8f(0x179)],_0x45ba8f(0x163));_0x2b340e&&(_0x1cd088[_0x45ba8f(0xf6)][_0x45ba8f(0x181)][_0x45ba8f(0x179)]=_0x2b340e);}for(const _0x16de02 of _0x1cd088[_0x45ba8f(0xf6)][_0x45ba8f(0x167)]||[]){const _0x4ecf1e=_0x38a662[_0x45ba8f(0x138)](_0x16de02[_0x45ba8f(0x1da)]['toLowerCase']());_0x4ecf1e&&(_0x16de02['id']=_0x4ecf1e);if(_0x16de02[_0x45ba8f(0x1d3)]?.[_0x45ba8f(0x179)]&&isPendingSegmentId(_0x16de02[_0x45ba8f(0x1d3)][_0x45ba8f(0x179)])){const _0x46418f=_0x49c8c1(_0x16de02[_0x45ba8f(0x1d3)]['segmentId'],_0x45ba8f(0x1c9)+_0x16de02['name']+_0x45ba8f(0x18b));_0x46418f&&(_0x16de02['entryCriteria']['segmentId']=_0x46418f);}if(_0x16de02[_0x45ba8f(0x147)])for(const _0x289125 of _0x16de02[_0x45ba8f(0x147)]){if(_0x289125[_0x45ba8f(0x179)]&&isPendingSegmentId(_0x289125[_0x45ba8f(0x179)])){const _0x47c82e=_0x49c8c1(_0x289125[_0x45ba8f(0x179)],_0x45ba8f(0x1c9)+_0x16de02['name']+_0x45ba8f(0xfc));_0x47c82e&&(_0x289125['segmentId']=_0x47c82e);}}if(_0x16de02[_0x45ba8f(0xfd)]?.['segmentId']&&isPendingSegmentId(_0x16de02[_0x45ba8f(0xfd)]['segmentId'])){const _0x1afb2f=_0x49c8c1(_0x16de02[_0x45ba8f(0xfd)][_0x45ba8f(0x179)],_0x45ba8f(0x1c9)+_0x16de02[_0x45ba8f(0x1da)]+'\x27\x20milestone');_0x1afb2f&&(_0x16de02[_0x45ba8f(0xfd)][_0x45ba8f(0x179)]=_0x1afb2f);}if(_0x16de02[_0x45ba8f(0x1b1)]){const _0x48603b=_0x29891b=>_0xa951e2[_0x45ba8f(0xf6)]['journeyStages']?.[_0x45ba8f(0x1a3)](_0x34e537=>_0x34e537['name']['toLowerCase']()===_0x16de02[_0x45ba8f(0x1da)][_0x45ba8f(0x11a)]())?.[_0x45ba8f(0x1b1)]?.[_0x29891b];for(const _0x263c9d of Object['keys'](_0x16de02[_0x45ba8f(0x1b1)])){const _0x281be5=_0x16de02['steps'][_0x263c9d],_0x50ba6a=_0x48603b(_0x263c9d);if(_0x281be5[_0x45ba8f(0xf9)]===_0x45ba8f(0x149)&&_0x281be5[_0x45ba8f(0x15e)]&&(isPendingActivationId(_0x281be5[_0x45ba8f(0x15e)])||_0x281be5['journeyActivationStepId']==='')){if(_0x50ba6a?.[_0x45ba8f(0x15e)]&&isPendingActivationId(_0x50ba6a[_0x45ba8f(0x15e)])){const _0x1dafac=extractPendingActivationName(_0x50ba6a[_0x45ba8f(0x15e)]),_0x16eab4=_0x7d2ce[_0x45ba8f(0x138)](_0x1dafac);_0x16eab4&&(_0x281be5[_0x45ba8f(0x15e)]=_0x16eab4);}}if(_0x281be5[_0x45ba8f(0xf9)]===_0x45ba8f(0x102)&&_0x281be5[_0x45ba8f(0x195)]&&_0x50ba6a?.[_0x45ba8f(0x195)])for(let _0x4940ec=0x0;_0x4940ec<_0x281be5['branches'][_0x45ba8f(0x175)];_0x4940ec++){const _0x439b73=_0x281be5[_0x45ba8f(0x195)][_0x4940ec],_0x107551=_0x50ba6a[_0x45ba8f(0x195)][_0x4940ec];if(_0x107551?.[_0x45ba8f(0x179)]&&isPendingSegmentId(_0x107551['segmentId'])){const _0x3014b9=_0x49c8c1(_0x107551[_0x45ba8f(0x179)],_0x45ba8f(0x1c9)+_0x16de02[_0x45ba8f(0x1da)]+_0x45ba8f(0x165)+(_0x439b73[_0x45ba8f(0x1da)]||_0x4940ec)+'\x27');_0x3014b9&&(_0x439b73['segmentId']=_0x3014b9);}}_0x281be5['type']==='WaitStep'&&_0x50ba6a?.['type']===_0x45ba8f(0x18c)&&resolveWaitStepPendingIds(_0x281be5,_0x50ba6a,_0x49c8c1,_0x16de02[_0x45ba8f(0x1da)]);}}}}
@@ -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(_0x46ea28,_0x1df305){const _0x88f06e=a153_0x42fc,_0x595ce2=_0x46ea28();while(!![]){try{const _0x24a9a9=parseInt(_0x88f06e(0x147))/0x1*(parseInt(_0x88f06e(0x13e))/0x2)+-parseInt(_0x88f06e(0x145))/0x3+-parseInt(_0x88f06e(0x14c))/0x4*(-parseInt(_0x88f06e(0x14d))/0x5)+parseInt(_0x88f06e(0x140))/0x6*(parseInt(_0x88f06e(0x148))/0x7)+parseInt(_0x88f06e(0x141))/0x8+-parseInt(_0x88f06e(0x14a))/0x9*(-parseInt(_0x88f06e(0x14e))/0xa)+-parseInt(_0x88f06e(0x13f))/0xb;if(_0x24a9a9===_0x1df305)break;else _0x595ce2['push'](_0x595ce2['shift']());}catch(_0x33b7e9){_0x595ce2['push'](_0x595ce2['shift']());}}}(a153_0x1bdf,0x9f23b));export function buildFolderIdToPathMap(_0x49c329){const _0x2f9e91=a153_0x42fc,_0x530a04=new Map(),_0x26d35b=new Map();for(const _0x4ab34d of _0x49c329){_0x26d35b[_0x2f9e91(0x14b)](_0x4ab34d['id'],_0x4ab34d);}const _0x4e585a=new Set();for(const _0xe9650f of _0x49c329){!_0xe9650f[_0x2f9e91(0x149)]&&_0x4e585a[_0x2f9e91(0x144)](_0xe9650f['id']);}function _0x42367e(_0x15c70e){const _0x4b3dc0=_0x2f9e91;if(_0x530a04[_0x4b3dc0(0x142)](_0x15c70e['id']))return _0x530a04[_0x4b3dc0(0x143)](_0x15c70e['id']);if(_0x4e585a[_0x4b3dc0(0x142)](_0x15c70e['id']))return _0x530a04[_0x4b3dc0(0x14b)](_0x15c70e['id'],''),'';if(_0x15c70e[_0x4b3dc0(0x149)]){const _0x537786=_0x26d35b[_0x4b3dc0(0x143)](_0x15c70e[_0x4b3dc0(0x149)]);if(_0x537786){const _0x30b4c0=_0x42367e(_0x537786),_0x1f6b61=_0x30b4c0?_0x30b4c0+'/'+_0x15c70e[_0x4b3dc0(0x146)]:_0x15c70e[_0x4b3dc0(0x146)];return _0x530a04[_0x4b3dc0(0x14b)](_0x15c70e['id'],_0x1f6b61),_0x1f6b61;}}const _0xf1a3f7=_0x15c70e['name'];return _0x530a04[_0x4b3dc0(0x14b)](_0x15c70e['id'],_0xf1a3f7),_0xf1a3f7;}for(const _0x2ad9d1 of _0x49c329){_0x42367e(_0x2ad9d1);}return _0x530a04;}function a153_0x42fc(_0x2a603b,_0x14a6cd){_0x2a603b=_0x2a603b-0x13e;const _0x1bdfba=a153_0x1bdf();let _0x42fc95=_0x1bdfba[_0x2a603b];return _0x42fc95;}function a153_0x1bdf(){const _0x4fb965=['2294988RqPoaT','31755570guGBMv','1413282nLgSSR','8496272Vyogci','has','get','add','3266946nAOojK','name','1JrFjsI','35ElHRhc','parentFolderId','6309nGwFJR','set','19468KVRqtF','1270dEdDrj','60nADiEE'];a153_0x1bdf=function(){return _0x4fb965;};return a153_0x1bdf();}export function buildFolderPathToIdMap(_0x465959){const _0x4d863f=a153_0x42fc,_0x504edc=new Map(),_0x31a067=new Map();for(const _0x28a6c5 of _0x465959){_0x31a067[_0x4d863f(0x14b)](_0x28a6c5['id'],_0x28a6c5);}const _0x31c3b5=new Set();for(const _0x2bac05 of _0x465959){!_0x2bac05[_0x4d863f(0x149)]&&_0x31c3b5[_0x4d863f(0x144)](_0x2bac05['id']);}function _0x4f4da2(_0x400c54){const _0x20ea3b=_0x4d863f;if(_0x31c3b5['has'](_0x400c54['id']))return'';if(_0x400c54[_0x20ea3b(0x149)]){const _0x3631da=_0x31a067['get'](_0x400c54[_0x20ea3b(0x149)]);if(_0x3631da){const _0x223d05=_0x4f4da2(_0x3631da);return _0x223d05?_0x223d05+'/'+_0x400c54[_0x20ea3b(0x146)]:_0x400c54[_0x20ea3b(0x146)];}}return _0x400c54[_0x20ea3b(0x146)];}for(const _0x4fdee9 of _0x465959){const _0x252d1d=_0x4f4da2(_0x4fdee9);_0x504edc[_0x4d863f(0x14b)](_0x252d1d,_0x4fdee9['id']);}return _0x504edc;}export function buildFolderMaps(_0x4d5818){const _0x4152ed=a153_0x42fc,_0x5d960e=buildFolderIdToPathMap(_0x4d5818),_0x1190e1=new Map();for(const [_0x458ca5,_0x4f4d3a]of _0x5d960e){_0x1190e1[_0x4152ed(0x14b)](_0x4f4d3a,_0x458ca5);}return{'idToPath':_0x5d960e,'pathToId':_0x1190e1};}export function getFolderPath(_0x24a3ac,_0x57985b){const _0x593a28=a153_0x42fc;if(!_0x24a3ac)return'';return _0x57985b[_0x593a28(0x143)](_0x24a3ac)??'';}
@@ -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(_0x19d9e8,_0x16266d){const _0x3880a7=a154_0x45e7,_0x164c11=_0x19d9e8();while(!![]){try{const _0x8bb682=parseInt(_0x3880a7(0x14c))/0x1*(-parseInt(_0x3880a7(0x14b))/0x2)+-parseInt(_0x3880a7(0x13f))/0x3*(parseInt(_0x3880a7(0x160))/0x4)+parseInt(_0x3880a7(0x137))/0x5+parseInt(_0x3880a7(0x164))/0x6*(-parseInt(_0x3880a7(0x140))/0x7)+parseInt(_0x3880a7(0x146))/0x8+parseInt(_0x3880a7(0x15a))/0x9*(-parseInt(_0x3880a7(0x13d))/0xa)+parseInt(_0x3880a7(0x156))/0xb*(parseInt(_0x3880a7(0x158))/0xc);if(_0x8bb682===_0x16266d)break;else _0x164c11['push'](_0x164c11['shift']());}catch(_0x50c0a4){_0x164c11['push'](_0x164c11['shift']());}}}(a154_0x68fc,0x6c1ca));import a154_0x238df5 from'path';import{parse as a154_0x4e7c3c}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x566359){const _0x5b2290=a154_0x45e7;if(!_0x566359||_0x566359['trim']()==='')throw new Error(_0x5b2290(0x139));const _0xcc287d=_0x566359[_0x5b2290(0x165)]();if(_0xcc287d==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x566359};const _0x205cc1=_0xcc287d[_0x5b2290(0x13c)]('/')?_0xcc287d[_0x5b2290(0x163)](0x1):_0xcc287d,_0x3fb502=_0x205cc1[_0x5b2290(0x149)]('/')['filter'](_0x5177e0=>_0x5177e0!=='');if(_0x3fb502[_0x5b2290(0x141)]===0x0)throw new Error(_0x5b2290(0x142));const _0x3f488c=_0xcc287d['startsWith']('/')||!isRelativePathSegment(_0x3fb502[0x0]);for(const _0x4abf45 of _0x3fb502){validatePathSegment(_0x4abf45);}return{'segments':_0x3fb502,'isAbsolute':_0x3f488c,'raw':_0x566359};}function a154_0x45e7(_0x362a56,_0x41399d){_0x362a56=_0x362a56-0x137;const _0x68fc98=a154_0x68fc();let _0x45e790=_0x68fc98[_0x362a56];return _0x45e790;}function isRelativePathSegment(_0x2eb66c){return _0x2eb66c==='.'||_0x2eb66c==='..';}function validatePathSegment(_0x4c328e){const _0x35f25c=a154_0x45e7;if(_0x4c328e==='')throw new Error(_0x35f25c(0x151));if(_0x4c328e==='.'||_0x4c328e==='..')return;if(/[\x00-\x1F\x7F]/['test'](_0x4c328e))throw new Error(_0x35f25c(0x14d)+_0x4c328e);if(_0x4c328e!==_0x4c328e[_0x35f25c(0x165)]()){}}export function validatePath(_0xfeb9da){const _0x40b7ce=a154_0x45e7;if(_0xfeb9da[_0x40b7ce(0x162)][_0x40b7ce(0x141)]===0x0&&!_0xfeb9da[_0x40b7ce(0x15b)])throw new Error(_0x40b7ce(0x147));if(_0xfeb9da[_0x40b7ce(0x15b)]){if(_0xfeb9da['segments'][0x0]==='..')throw new Error(_0x40b7ce(0x169));let _0x5aff2e=0x0;for(const _0x51f588 of _0xfeb9da[_0x40b7ce(0x162)]){if(_0x51f588==='..'){if(_0x5aff2e===0x0)throw new Error(_0x40b7ce(0x168));_0x5aff2e--;}else _0x51f588!=='.'&&_0x5aff2e++;}}}export function joinPaths(_0x33a891,_0xe7890d){const _0x5be9cd=a154_0x45e7;if(!_0x33a891||_0x33a891==='/')return _0xe7890d;if(!_0xe7890d||_0xe7890d==='.')return _0x33a891;if(_0xe7890d['startsWith']('/'))return _0xe7890d;const _0x24ac2d=parsePath(_0x33a891),_0x4cc46d=parsePath(_0xe7890d),_0x417a1f=[..._0x24ac2d[_0x5be9cd(0x162)]];for(const _0x1d8b2f of _0x4cc46d['segments']){if(_0x1d8b2f==='.')continue;else{if(_0x1d8b2f==='..'){if(_0x417a1f[_0x5be9cd(0x141)]===0x0)throw new Error('Cannot\x20navigate\x20above\x20root');_0x417a1f[_0x5be9cd(0x143)]();}else _0x417a1f[_0x5be9cd(0x138)](_0x1d8b2f);}}const _0x4a9272=_0x417a1f[_0x5be9cd(0x161)]('/');return _0x24ac2d[_0x5be9cd(0x15c)][_0x5be9cd(0x13c)]('/')?'/'+_0x4a9272:_0x4a9272;}function a154_0x68fc(){const _0xdc84d6=['slice','endsWith','.yml','Path\x20segment\x20cannot\x20be\x20empty','journey','parse','readFile','Cannot\x20split\x20empty\x20path','9097jqTPNb','root','29976zxUYTI','.yaml','54alkbsf','isAbsolute','raw','Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.','name','relative','28sSQhkJ','join','segments','substring','480xhkAsK','trim','segment','Cannot\x20navigate\x20above\x20root','Path\x20attempts\x20to\x20navigate\x20above\x20root','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','2767095DUmAlp','push','Path\x20cannot\x20be\x20empty','replace','parent_segment','startsWith','285350UWfdyk','tdx.json','290661sDtRBt','56392YeuaJq','length','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','pop','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','type','1478664tExfvu','Relative\x20path\x20cannot\x20be\x20empty','dirname','split','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','1734746KnXtCH','1ENIHna','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20'];a154_0x68fc=function(){return _0xdc84d6;};return a154_0x68fc();}export function normalizePath(_0x21961d){const _0x2f3c4a=a154_0x45e7,_0x7e9a99=parsePath(_0x21961d),_0x57f3e8=[];for(const _0x3ec529 of _0x7e9a99['segments']){if(_0x3ec529==='.')continue;else{if(_0x3ec529==='..'){if(_0x57f3e8[_0x2f3c4a(0x141)]===0x0){if(_0x7e9a99['isAbsolute'])throw new Error(_0x2f3c4a(0x167));_0x57f3e8['push']('..');}else _0x57f3e8[_0x57f3e8[_0x2f3c4a(0x141)]-0x1]==='..'?_0x57f3e8[_0x2f3c4a(0x138)]('..'):_0x57f3e8[_0x2f3c4a(0x143)]();}else _0x57f3e8['push'](_0x3ec529);}}if(_0x57f3e8[_0x2f3c4a(0x141)]===0x0)return _0x7e9a99[_0x2f3c4a(0x15b)]?'/':'.';const _0x2da723=_0x57f3e8[_0x2f3c4a(0x161)]('/');return _0x7e9a99['raw']['startsWith']('/')?'/'+_0x2da723:_0x2da723;}export function getParentPath(_0x429ed8){const _0x2b8110=a154_0x45e7,_0x22d1eb=parsePath(_0x429ed8);if(_0x22d1eb[_0x2b8110(0x162)][_0x2b8110(0x141)]<=0x1)return'/';const _0x13c23c=_0x22d1eb['segments'][_0x2b8110(0x14e)](0x0,-0x1)[_0x2b8110(0x161)]('/');return _0x22d1eb[_0x2b8110(0x15c)][_0x2b8110(0x13c)]('/')?'/'+_0x13c23c:_0x13c23c;}export function getBaseName(_0x5340c8){const _0x4f0ea1=a154_0x45e7,_0x2cb3b6=parsePath(_0x5340c8);return _0x2cb3b6['segments'][_0x2cb3b6[_0x4f0ea1(0x162)][_0x4f0ea1(0x141)]-0x1]||'';}export function isChildPath(_0xdb0cf0,_0x4aa17c){const _0x1614b1=a154_0x45e7,_0x199132=parsePath(_0xdb0cf0),_0xc0e55a=parsePath(_0x4aa17c);if(_0x199132[_0x1614b1(0x162)][_0x1614b1(0x141)]<=_0xc0e55a[_0x1614b1(0x162)][_0x1614b1(0x141)])return![];for(let _0x13e696=0x0;_0x13e696<_0xc0e55a[_0x1614b1(0x162)][_0x1614b1(0x141)];_0x13e696++){if(_0x199132['segments'][_0x13e696]!==_0xc0e55a[_0x1614b1(0x162)][_0x13e696])return![];}return!![];}export function splitPath(_0x2eceb1){const _0x5dd360=a154_0x45e7,_0x59a652=parsePath(_0x2eceb1);if(_0x59a652[_0x5dd360(0x162)][_0x5dd360(0x141)]===0x0)throw new Error(_0x5dd360(0x155));if(_0x59a652['segments'][_0x5dd360(0x141)]===0x1)return{'parent':_0x59a652[_0x5dd360(0x162)][0x0]};return{'parent':_0x59a652['segments'][0x0],'child':_0x59a652[_0x5dd360(0x162)][_0x5dd360(0x14e)](0x1)[_0x5dd360(0x161)]('/')};}export function isYamlFilePath(_0x53493b){const _0x327e56=a154_0x45e7;return _0x53493b[_0x327e56(0x14f)](_0x327e56(0x150))||_0x53493b[_0x327e56(0x14f)](_0x327e56(0x159));}export async function resolveYamlFilePath(_0x579cc7,_0x25284d=nodeFileSystem){const _0x23c1e8=a154_0x45e7,_0x3eb19e=a154_0x238df5['resolve'](_0x579cc7);if(!await _0x25284d['exists'](_0x3eb19e))throw new Error('File\x20not\x20found:\x20'+_0x579cc7);let _0x3dc520=a154_0x238df5[_0x23c1e8(0x148)](_0x3eb19e),_0x408bc8=null,_0x42834d=null;const _0x548aeb=a154_0x238df5[_0x23c1e8(0x153)](_0x3dc520)[_0x23c1e8(0x157)];while(_0x3dc520!==_0x548aeb){const _0x232826=a154_0x238df5['join'](_0x3dc520,_0x23c1e8(0x13e));if(await _0x25284d['exists'](_0x232826)){_0x408bc8=_0x232826,_0x42834d=_0x3dc520;break;}_0x3dc520=a154_0x238df5['dirname'](_0x3dc520);}if(!_0x408bc8||!_0x42834d)throw new Error('No\x20tdx.json\x20found\x20for\x20file:\x20'+_0x579cc7+'\x0a'+_0x23c1e8(0x15d));const _0x3b1b29=await _0x25284d['readFile'](_0x408bc8),_0x2b8726=JSON['parse'](_0x3b1b29),_0x39e3ac=_0x2b8726[_0x23c1e8(0x13b)];if(!_0x39e3ac)throw new Error(_0x23c1e8(0x144));const _0x3bd80b=await _0x25284d[_0x23c1e8(0x154)](_0x3eb19e),_0x44ca5f=a154_0x4e7c3c(_0x3bd80b),_0x52fed9=_0x44ca5f[_0x23c1e8(0x15e)];if(!_0x52fed9)throw new Error(_0x23c1e8(0x14a)+_0x579cc7);const _0x14429f=_0x44ca5f[_0x23c1e8(0x145)]===_0x23c1e8(0x152)?'journey':_0x23c1e8(0x166),_0x5dbefb=a154_0x238df5[_0x23c1e8(0x15f)](_0x42834d,_0x3eb19e),_0x73b14f=a154_0x238df5[_0x23c1e8(0x148)](_0x5dbefb),_0x2c3d78=_0x73b14f==='.'?'':_0x73b14f[_0x23c1e8(0x13a)](/\\/g,'/'),_0x1734df=_0x2c3d78?_0x39e3ac+'/'+_0x2c3d78+'/'+_0x52fed9:_0x39e3ac+'/'+_0x52fed9;return{'parentSegment':_0x39e3ac,'segmentName':_0x52fed9,'folderPath':_0x2c3d78,'fullPath':_0x1734df,'resourceType':_0x14429f,'content':_0x3bd80b};}
@@ -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 a155_0xdf18(_0xbc6db5,_0x41f48e){_0xbc6db5=_0xbc6db5-0x9c;const _0x297e2f=a155_0x297e();let _0xdf1893=_0x297e2f[_0xbc6db5];return _0xdf1893;}(function(_0x2feebb,_0x6533cc){const _0x1f8786=a155_0xdf18,_0x3abaf6=_0x2feebb();while(!![]){try{const _0xe07786=-parseInt(_0x1f8786(0x9c))/0x1*(-parseInt(_0x1f8786(0xa5))/0x2)+-parseInt(_0x1f8786(0x9d))/0x3+parseInt(_0x1f8786(0xa3))/0x4*(-parseInt(_0x1f8786(0xa7))/0x5)+parseInt(_0x1f8786(0xa4))/0x6*(parseInt(_0x1f8786(0xa0))/0x7)+parseInt(_0x1f8786(0xa9))/0x8+-parseInt(_0x1f8786(0xa8))/0x9*(parseInt(_0x1f8786(0xaa))/0xa)+parseInt(_0x1f8786(0x9e))/0xb;if(_0xe07786===_0x6533cc)break;else _0x3abaf6['push'](_0x3abaf6['shift']());}catch(_0x2f72f7){_0x3abaf6['push'](_0x3abaf6['shift']());}}}(a155_0x297e,0xe2eaf));function a155_0x297e(){const _0x1ceb3f=['9693704GhKyAd','461660PuVdna','58153ofMUyF','3296349JFdCit','31232344NeBFyK','substring','14xFkJnP','.\x20Child\x20name\x20cannot\x20be\x20empty','.\x20Parent\x20name\x20cannot\x20be\x20empty','4lUFQeq','2427654QGvOVt','14weZlsV','Invalid\x20segment\x20reference\x20format:\x20','9039610hxswAF','279dAJtDU'];a155_0x297e=function(){return _0x1ceb3f;};return a155_0x297e();}export function parseSegmentRef(_0x2d532b){const _0x44fdad=a155_0xdf18,_0x51eb47=_0x2d532b['indexOf']('/');if(_0x51eb47===-0x1)return{'parentId':_0x2d532b};if(_0x51eb47===0x0)throw new Error(_0x44fdad(0xa6)+_0x2d532b+_0x44fdad(0xa2));const _0x3124fb=_0x2d532b['substring'](0x0,_0x51eb47),_0x3428a4=_0x2d532b[_0x44fdad(0x9f)](_0x51eb47+0x1);if(_0x3428a4==='')throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x2d532b+_0x44fdad(0xa1));return{'parentId':_0x3124fb,'childId':_0x3428a4};}