@treasuredata/tdx 2026.6.0 → 2026.6.2

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 (248) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/agent-command.js +1 -1
  9. package/dist/commands/agent-test-command.js +1 -1
  10. package/dist/commands/api-command.js +1 -1
  11. package/dist/commands/auth-command.js +1 -1
  12. package/dist/commands/cas-command.js +1 -1
  13. package/dist/commands/cas-segment-command.js +1 -1
  14. package/dist/commands/chat-command.js +1 -1
  15. package/dist/commands/claude-command.js +1 -1
  16. package/dist/commands/claude-statusline-command.js +1 -1
  17. package/dist/commands/claude-usage-command.js +1 -1
  18. package/dist/commands/command.js +1 -1
  19. package/dist/commands/connection-command.js +1 -1
  20. package/dist/commands/databases.js +1 -1
  21. package/dist/commands/delivery-command.js +1 -1
  22. package/dist/commands/describe.js +1 -1
  23. package/dist/commands/engage-campaign-pull-command.js +1 -1
  24. package/dist/commands/engage-campaign-push-command.js +1 -1
  25. package/dist/commands/engage-campaign-validate-command.js +1 -1
  26. package/dist/commands/engage-command.js +1 -1
  27. package/dist/commands/engage-template-pull-command.js +1 -1
  28. package/dist/commands/engage-template-push-command.js +1 -1
  29. package/dist/commands/engage-template-validate-command.js +1 -1
  30. package/dist/commands/job-command.js +1 -1
  31. package/dist/commands/journey-command.js +1 -1
  32. package/dist/commands/journey-validate-command.js +1 -1
  33. package/dist/commands/llm-command.js +1 -1
  34. package/dist/commands/mcp-command.js +1 -1
  35. package/dist/commands/parent-segment-command.js +1 -1
  36. package/dist/commands/policy-command.js +1 -1
  37. package/dist/commands/profile-command.js +1 -1
  38. package/dist/commands/profiles-command.js +1 -1
  39. package/dist/commands/query-command.js +1 -1
  40. package/dist/commands/schedule-command.js +1 -1
  41. package/dist/commands/segment-command.js +1 -1
  42. package/dist/commands/segment-create-command.js +1 -1
  43. package/dist/commands/segment-fields-command.js +1 -1
  44. package/dist/commands/segment-pull-command.js +1 -1
  45. package/dist/commands/segment-push-command.js +1 -1
  46. package/dist/commands/segment-update-command.js +1 -1
  47. package/dist/commands/segment-use-command.js +1 -1
  48. package/dist/commands/segment-validate-command.js +1 -1
  49. package/dist/commands/segments.js +1 -1
  50. package/dist/commands/show.js +1 -1
  51. package/dist/commands/status-command.js +1 -1
  52. package/dist/commands/table-deleted.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.js +1 -1
  59. package/dist/commands/workflow-command.d.ts +2 -2
  60. package/dist/commands/workflow-command.d.ts.map +1 -1
  61. package/dist/commands/workflow-command.js +1 -1
  62. package/dist/commands/workflow-command.js.map +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/tools/work-create-item.js +1 -1
  84. package/dist/mcp/utils.js +1 -1
  85. package/dist/proxy/claude-usage-tracker.js +1 -1
  86. package/dist/proxy/passthrough-server.js +1 -1
  87. package/dist/proxy/sse-usage-parser.js +1 -1
  88. package/dist/sdk/agent/agent-config.js +1 -1
  89. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  90. package/dist/sdk/agent/agent-yaml.js +1 -1
  91. package/dist/sdk/agent/test/evaluator.js +1 -1
  92. package/dist/sdk/agent/test/executor.js +1 -1
  93. package/dist/sdk/agent/test/index.js +1 -1
  94. package/dist/sdk/agent/test/output.js +1 -1
  95. package/dist/sdk/agent/test/parser.js +1 -1
  96. package/dist/sdk/agent/tool-target-registry.js +1 -1
  97. package/dist/sdk/api.js +1 -1
  98. package/dist/sdk/cas/cas-api-client.js +1 -1
  99. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  100. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  101. package/dist/sdk/cas/index.js +1 -1
  102. package/dist/sdk/cas/pull-workflow.js +1 -1
  103. package/dist/sdk/cas/push-workflow.js +1 -1
  104. package/dist/sdk/client/cdp-api-client.js +1 -1
  105. package/dist/sdk/client/cdp-api-client.js.map +1 -1
  106. package/dist/sdk/client/delivery-api-client.js +1 -1
  107. package/dist/sdk/client/endpoints.js +1 -1
  108. package/dist/sdk/client/engage-api-client.js +1 -1
  109. package/dist/sdk/client/http-client.js +1 -1
  110. package/dist/sdk/client/llm-api-client.js +1 -1
  111. package/dist/sdk/client/oauth-refresh.js +1 -1
  112. package/dist/sdk/client/rate-limiter.js +1 -1
  113. package/dist/sdk/client/td-api-client.js +1 -1
  114. package/dist/sdk/client/trino-api-client.js +1 -1
  115. package/dist/sdk/client/workflow-client.d.ts +23 -1
  116. package/dist/sdk/client/workflow-client.d.ts.map +1 -1
  117. package/dist/sdk/client/workflow-client.js +1 -1
  118. package/dist/sdk/client/workflow-client.js.map +1 -1
  119. package/dist/sdk/connection-validator.js +1 -1
  120. package/dist/sdk/connection.js +1 -1
  121. package/dist/sdk/delivery.js +1 -1
  122. package/dist/sdk/engage/campaign-pull.js +1 -1
  123. package/dist/sdk/engage/campaign-push.js +1 -1
  124. package/dist/sdk/engage/campaign-validator.js +1 -1
  125. package/dist/sdk/engage/campaign-yaml.js +1 -1
  126. package/dist/sdk/engage/template-pull.js +1 -1
  127. package/dist/sdk/engage/template-push.js +1 -1
  128. package/dist/sdk/engage/template-validator.js +1 -1
  129. package/dist/sdk/engage/template-yaml.js +1 -1
  130. package/dist/sdk/engage/types/campaign-def.js +1 -1
  131. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  132. package/dist/sdk/engage/types/template-schema.js +1 -1
  133. package/dist/sdk/engage.js +1 -1
  134. package/dist/sdk/errors.js +1 -1
  135. package/dist/sdk/index.js +1 -1
  136. package/dist/sdk/io/index.js +1 -1
  137. package/dist/sdk/io/node-filesystem.js +1 -1
  138. package/dist/sdk/job.js +1 -1
  139. package/dist/sdk/journey.js +1 -1
  140. package/dist/sdk/llm/chat-cache.js +1 -1
  141. package/dist/sdk/llm/index.js +1 -1
  142. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  143. package/dist/sdk/llm/model-factors.d.ts +8 -4
  144. package/dist/sdk/llm/model-factors.d.ts.map +1 -1
  145. package/dist/sdk/llm/model-factors.js +1 -1
  146. package/dist/sdk/llm/model-factors.js.map +1 -1
  147. package/dist/sdk/llm/user-settings.js +1 -1
  148. package/dist/sdk/personalization.js +1 -1
  149. package/dist/sdk/policy.js +1 -1
  150. package/dist/sdk/query/deleted-table-validation.js +1 -1
  151. package/dist/sdk/query/index.js +1 -1
  152. package/dist/sdk/query/sql-parser.js +1 -1
  153. package/dist/sdk/realtime.js +1 -1
  154. package/dist/sdk/schedule.js +1 -1
  155. package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
  156. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  157. package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
  158. package/dist/sdk/segment/fields-display.js +1 -1
  159. package/dist/sdk/segment/file-discovery.js +1 -1
  160. package/dist/sdk/segment/journey-utils.js +1 -1
  161. package/dist/sdk/segment/journey-validator.js +1 -1
  162. package/dist/sdk/segment/journey-yaml.js +1 -1
  163. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  164. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  165. package/dist/sdk/segment/pull-workflow.js +1 -1
  166. package/dist/sdk/segment/push-recovery.js +1 -1
  167. package/dist/sdk/segment/push-workflow.js +1 -1
  168. package/dist/sdk/segment/resolution-context.js +1 -1
  169. package/dist/sdk/segment/segment-path-parser.js +1 -1
  170. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  171. package/dist/sdk/segment/segment-validator.js +1 -1
  172. package/dist/sdk/segment/target-resolution.js +1 -1
  173. package/dist/sdk/segment/tdx-config.js +1 -1
  174. package/dist/sdk/segment/types/activation-schema.js +1 -1
  175. package/dist/sdk/segment/types/journey-def.js +1 -1
  176. package/dist/sdk/segment/types/journey-schema.js +1 -1
  177. package/dist/sdk/segment/types/segment-def.js +1 -1
  178. package/dist/sdk/segment/types/segment-schema.js +1 -1
  179. package/dist/sdk/segment/validate-files.js +1 -1
  180. package/dist/sdk/segment/yaml-validator.js +1 -1
  181. package/dist/sdk/segment.js +1 -1
  182. package/dist/sdk/types/cdp.d.ts +4 -3
  183. package/dist/sdk/types/cdp.d.ts.map +1 -1
  184. package/dist/sdk/types/index.js +1 -1
  185. package/dist/sdk/types/progress.js +1 -1
  186. package/dist/sdk/types/workflow.d.ts +1 -1
  187. package/dist/sdk/types/workflow.d.ts.map +1 -1
  188. package/dist/sdk/types/workspace.js +1 -1
  189. package/dist/sdk/user.js +1 -1
  190. package/dist/sdk/util/format-detector.js +1 -1
  191. package/dist/sdk/util/formatters.js +1 -1
  192. package/dist/sdk/util/index.js +1 -1
  193. package/dist/sdk/util/paginate.js +1 -1
  194. package/dist/sdk/util/tree-formatter.js +1 -1
  195. package/dist/sdk/workflow/archive-validation.js +1 -1
  196. package/dist/sdk/workflow/clone-workflow.js +1 -1
  197. package/dist/sdk/workflow/index.d.ts +23 -2
  198. package/dist/sdk/workflow/index.d.ts.map +1 -1
  199. package/dist/sdk/workflow/index.js +1 -1
  200. package/dist/sdk/workflow/index.js.map +1 -1
  201. package/dist/sdk/workflow/pull-workflow.js +1 -1
  202. package/dist/sdk/workflow/push-workflow.d.ts +4 -0
  203. package/dist/sdk/workflow/push-workflow.d.ts.map +1 -1
  204. package/dist/sdk/workflow/push-workflow.js +1 -1
  205. package/dist/sdk/workflow/push-workflow.js.map +1 -1
  206. package/dist/sdk/workflow/task-graph.js +1 -1
  207. package/dist/sdk/workflow/tdx-config.js +1 -1
  208. package/dist/sdk/workflow/workflow-utils.js +1 -1
  209. package/dist/sdk/workspace/access-tracker.js +1 -1
  210. package/dist/sdk/workspace/frontmatter.js +1 -1
  211. package/dist/sdk/workspace/git.js +1 -1
  212. package/dist/sdk/workspace/index.js +1 -1
  213. package/dist/sdk/workspace/templates.js +1 -1
  214. package/dist/sdk/workspace/weekly.js +1 -1
  215. package/dist/sdk/workspace/wikilinks.js +1 -1
  216. package/dist/test-utils/command-runner.js +1 -1
  217. package/dist/test-utils/factories.js +1 -1
  218. package/dist/test-utils/fixtures.js +1 -1
  219. package/dist/test-utils/http-mock.js +1 -1
  220. package/dist/test-utils/index.js +1 -1
  221. package/dist/utils/async.js +1 -1
  222. package/dist/utils/colors.js +1 -1
  223. package/dist/utils/diff.js +1 -1
  224. package/dist/utils/file-permissions.js +1 -1
  225. package/dist/utils/file-reader.js +1 -1
  226. package/dist/utils/github-releases.js +1 -1
  227. package/dist/utils/global-cache.js +1 -1
  228. package/dist/utils/json-loader.js +1 -1
  229. package/dist/utils/local-cache.js +1 -1
  230. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  231. package/dist/utils/logger/formatters/index.js +1 -1
  232. package/dist/utils/logger/handlers/console-handler.js +1 -1
  233. package/dist/utils/logger/handlers/file-handler.js +1 -1
  234. package/dist/utils/logger/handlers/index.js +1 -1
  235. package/dist/utils/logger/handlers/null-handler.js +1 -1
  236. package/dist/utils/logger/index.js +1 -1
  237. package/dist/utils/logger/logger.js +1 -1
  238. package/dist/utils/logger/types.js +1 -1
  239. package/dist/utils/option-validation.js +1 -1
  240. package/dist/utils/process.js +1 -1
  241. package/dist/utils/prompt.js +1 -1
  242. package/dist/utils/spinner.js +1 -1
  243. package/dist/utils/sse-parser.js +1 -1
  244. package/dist/utils/string-utils.js +1 -1
  245. package/dist/utils/table-ref-parser.js +1 -1
  246. package/dist/utils/tdx-logger.js +1 -1
  247. package/dist/utils/version-check.js +1 -1
  248. package/package.json +1 -1
@@ -1 +1 @@
1
- (function(_0x27d095,_0xd38d83){const _0x4645b4=a154_0x3c9d,_0x5481d7=_0x27d095();while(!![]){try{const _0x4f0616=-parseInt(_0x4645b4(0x1bc))/0x1+parseInt(_0x4645b4(0x1af))/0x2+-parseInt(_0x4645b4(0x1c3))/0x3*(-parseInt(_0x4645b4(0x1c4))/0x4)+-parseInt(_0x4645b4(0x1ad))/0x5+parseInt(_0x4645b4(0x1b1))/0x6+-parseInt(_0x4645b4(0x1b2))/0x7*(parseInt(_0x4645b4(0x1b9))/0x8)+parseInt(_0x4645b4(0x1c1))/0x9;if(_0x4f0616===_0xd38d83)break;else _0x5481d7['push'](_0x5481d7['shift']());}catch(_0x570a87){_0x5481d7['push'](_0x5481d7['shift']());}}}(a154_0x3f62,0x3e188));import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';import a154_0xf9a604 from'path';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of']('tdx.sdk.push-recovery');export function getPushRecoveryPath(_0x5da0de){const _0xf57c5=a154_0x3c9d,_0x277ed9=a154_0xf9a604[_0xf57c5(0x1c2)](_0x5da0de),_0x4ce19c=a154_0xf9a604[_0xf57c5(0x1c6)](_0x5da0de);return a154_0xf9a604[_0xf57c5(0x1b4)](_0x277ed9,'.'+_0x4ce19c+'.push-recovery.json');}function a154_0x3c9d(_0x577f69,_0xe14978){_0x577f69=_0x577f69-0x1ad;const _0x3f625d=a154_0x3f62();let _0x3c9df5=_0x3f625d[_0x577f69];return _0x3c9df5;}export function readPushRecovery(_0x6e24b){const _0x5f9ed1=a154_0x3c9d,_0x289e74=getPushRecoveryPath(_0x6e24b);if(!existsSync(_0x289e74))return undefined;try{const _0x33dadd=readFileSync(_0x289e74,_0x5f9ed1(0x1bd)),_0x167fee=JSON['parse'](_0x33dadd);if(_0x167fee?.['version']!==0x1||typeof _0x167fee['journeyName']!==_0x5f9ed1(0x1c5))return undefined;return _0x167fee;}catch(_0x4ff0bb){return _0x4ff0bb instanceof SyntaxError?logger[_0x5f9ed1(0x1b6)](_0x5f9ed1(0x1b0)+_0x4ff0bb):logger[_0x5f9ed1(0x1b7)](_0x5f9ed1(0x1c0)+_0x4ff0bb),undefined;}}function a154_0x3f62(){const _0x555470=['4376CAygvr','segments','code','440085adXEvC','utf-8','toISOString','ENOENT','Failed\x20to\x20read\x20push\x20recovery\x20file:\x20','4922991eVfziM','dirname','12GOopRP','246620nBbysL','string','basename','1162045KiNngY','.tmp','179840jxBZqX','Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20','1300188kalmkO','2219tcyKHB','stringify','join','Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20','debug','warn','journeyName'];a154_0x3f62=function(){return _0x555470;};return a154_0x3f62();}export function writePushRecovery(_0x4c33d1,_0x1af8c6){const _0x267738=a154_0x3c9d,_0x46daaa=getPushRecoveryPath(_0x4c33d1),_0x53bdbb=_0x46daaa+_0x267738(0x1ae);writeFileSync(_0x53bdbb,JSON[_0x267738(0x1b3)](_0x1af8c6,null,0x2)+'\x0a',_0x267738(0x1bd)),renameSync(_0x53bdbb,_0x46daaa);}export function deletePushRecovery(_0x3e4633){const _0x1c2cf3=a154_0x3c9d,_0x20bd06=getPushRecoveryPath(_0x3e4633);try{unlinkSync(_0x20bd06);}catch(_0x405db0){_0x405db0[_0x1c2cf3(0x1bb)]!==_0x1c2cf3(0x1bf)&&logger['debug'](_0x1c2cf3(0x1b5)+_0x405db0);}}export function saveSegmentToPushRecovery(_0x1b81cb,_0x236fbc,_0x2ac1d7,_0x4c635d){const _0x35fc44=a154_0x3c9d,_0x5a7aea=readPushRecovery(_0x1b81cb),_0x56ff5e=_0x5a7aea?.[_0x35fc44(0x1b8)]===_0x236fbc?{..._0x5a7aea,'updatedAt':new Date()[_0x35fc44(0x1be)]()}:{'version':0x1,'journeyName':_0x236fbc,'updatedAt':new Date()[_0x35fc44(0x1be)](),'segments':{}};_0x56ff5e[_0x35fc44(0x1ba)][_0x2ac1d7]=_0x4c635d,writePushRecovery(_0x1b81cb,_0x56ff5e);}
1
+ const a154_0x2f2862=a154_0x56b5;function a154_0x56b5(_0x32c0a3,_0x19f783){_0x32c0a3=_0x32c0a3-0xc9;const _0x37b58e=a154_0x37b5();let _0x56b550=_0x37b58e[_0x32c0a3];return _0x56b550;}(function(_0x3db265,_0x47da35){const _0x5b4cda=a154_0x56b5,_0x18f5cb=_0x3db265();while(!![]){try{const _0x55378b=parseInt(_0x5b4cda(0xd9))/0x1+parseInt(_0x5b4cda(0xda))/0x2*(-parseInt(_0x5b4cda(0xd4))/0x3)+-parseInt(_0x5b4cda(0xd2))/0x4+-parseInt(_0x5b4cda(0xcd))/0x5+-parseInt(_0x5b4cda(0xd6))/0x6*(-parseInt(_0x5b4cda(0xd0))/0x7)+-parseInt(_0x5b4cda(0xcf))/0x8+parseInt(_0x5b4cda(0xe0))/0x9*(parseInt(_0x5b4cda(0xd8))/0xa);if(_0x55378b===_0x47da35)break;else _0x18f5cb['push'](_0x18f5cb['shift']());}catch(_0x2e81fe){_0x18f5cb['push'](_0x18f5cb['shift']());}}}(a154_0x37b5,0xbea27));import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';function a154_0x37b5(){const _0x3d7f43=['basename','6AyCRqV','Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20','60090UBAqao','851372IjSZcU','6dlUtlc','segments','utf-8','journeyName','stringify','dirname','4338tfWLeX','.tmp','tdx.sdk.push-recovery','debug','toISOString','ENOENT','4239275BVEIUz','warn','5841376DBCOWz','5937827lKWITV','.push-recovery.json','4023596YlboAZ','Failed\x20to\x20read\x20push\x20recovery\x20file:\x20','1231206NpKkdi'];a154_0x37b5=function(){return _0x3d7f43;};return a154_0x37b5();}import a154_0x3659ee from'path';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a154_0x2f2862(0xc9));export function getPushRecoveryPath(_0x2cb906){const _0x2fad43=a154_0x2f2862,_0x185e00=a154_0x3659ee[_0x2fad43(0xdf)](_0x2cb906),_0x2847ae=a154_0x3659ee[_0x2fad43(0xd5)](_0x2cb906);return a154_0x3659ee['join'](_0x185e00,'.'+_0x2847ae+_0x2fad43(0xd1));}export function readPushRecovery(_0x3083eb){const _0x5dc174=a154_0x2f2862,_0x3fd9b1=getPushRecoveryPath(_0x3083eb);if(!existsSync(_0x3fd9b1))return undefined;try{const _0x2e6935=readFileSync(_0x3fd9b1,_0x5dc174(0xdc)),_0x1c414f=JSON['parse'](_0x2e6935);if(_0x1c414f?.['version']!==0x1||typeof _0x1c414f[_0x5dc174(0xdd)]!=='string')return undefined;return _0x1c414f;}catch(_0x555f4e){return _0x555f4e instanceof SyntaxError?logger[_0x5dc174(0xca)]('Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20'+_0x555f4e):logger[_0x5dc174(0xce)](_0x5dc174(0xd3)+_0x555f4e),undefined;}}export function writePushRecovery(_0x2c898e,_0x2a8fb8){const _0x1d2063=a154_0x2f2862,_0x5b7e04=getPushRecoveryPath(_0x2c898e),_0x13f380=_0x5b7e04+_0x1d2063(0xe1);writeFileSync(_0x13f380,JSON[_0x1d2063(0xde)](_0x2a8fb8,null,0x2)+'\x0a',_0x1d2063(0xdc)),renameSync(_0x13f380,_0x5b7e04);}export function deletePushRecovery(_0x2a9f66){const _0xd007df=a154_0x2f2862,_0x11f582=getPushRecoveryPath(_0x2a9f66);try{unlinkSync(_0x11f582);}catch(_0x4b0677){_0x4b0677['code']!==_0xd007df(0xcc)&&logger[_0xd007df(0xca)](_0xd007df(0xd7)+_0x4b0677);}}export function saveSegmentToPushRecovery(_0x1b1fab,_0x43c7f9,_0x42c1aa,_0x2f6fab){const _0x1add09=a154_0x2f2862,_0x40917a=readPushRecovery(_0x1b1fab),_0x5b7c49=_0x40917a?.['journeyName']===_0x43c7f9?{..._0x40917a,'updatedAt':new Date()[_0x1add09(0xcb)]()}:{'version':0x1,'journeyName':_0x43c7f9,'updatedAt':new Date()[_0x1add09(0xcb)](),'segments':{}};_0x5b7c49[_0x1add09(0xdb)][_0x42c1aa]=_0x2f6fab,writePushRecovery(_0x1b1fab,_0x5b7c49);}
@@ -1 +1 @@
1
- const a155_0x285d0a=a155_0x5fe8;(function(_0x24daac,_0x48b225){const _0x120252=a155_0x5fe8,_0x957f8c=_0x24daac();while(!![]){try{const _0x34bfb0=parseInt(_0x120252(0x1b2))/0x1+-parseInt(_0x120252(0x19e))/0x2+parseInt(_0x120252(0x1fc))/0x3*(-parseInt(_0x120252(0x1b6))/0x4)+-parseInt(_0x120252(0x162))/0x5*(-parseInt(_0x120252(0x1cb))/0x6)+parseInt(_0x120252(0x128))/0x7+-parseInt(_0x120252(0x161))/0x8+parseInt(_0x120252(0x18e))/0x9;if(_0x34bfb0===_0x48b225)break;else _0x957f8c['push'](_0x957f8c['shift']());}catch(_0x39fb96){_0x957f8c['push'](_0x957f8c['shift']());}}}(a155_0x512e,0x2992f));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of']('tdx.sdk.push-workflow');export const PENDING_SEGMENT_PREFIX=a155_0x285d0a(0x1f7);export const PENDING_ACTIVATION_PREFIX=a155_0x285d0a(0x127);export function createPendingSegmentId(_0x5e8c88){return''+PENDING_SEGMENT_PREFIX+_0x5e8c88+'__';}export function isPendingSegmentId(_0x1e1679){const _0x47b763=a155_0x285d0a;return _0x1e1679[_0x47b763(0x151)](PENDING_SEGMENT_PREFIX)&&!_0x1e1679[_0x47b763(0x151)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x4c1ba5){return _0x4c1ba5['replace'](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x36a68c){return''+PENDING_ACTIVATION_PREFIX+_0x36a68c+'__';}export function isPendingActivationId(_0x5bd62b){return _0x5bd62b['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x3c156b){const _0x459664=a155_0x285d0a;return _0x3c156b[_0x459664(0x197)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0xc1a03f,_0xbc7c87){const _0x7498f9=a155_0x285d0a,_0x31ce36=_0xc1a03f+'::'+(_0xbc7c87[_0x7498f9(0x13b)]()||'segment'),_0x9f566=createHash('sha1')[_0x7498f9(0x1a6)](_0x31ce36)[_0x7498f9(0x18f)]('hex')[_0x7498f9(0x1b5)](0x0,0xc);return'journey_entry_criteria_'+_0x9f566;}export function ensureJourneyDefaults(_0x3eb1b9){const _0x3e2f38=a155_0x285d0a;!_0x3eb1b9[_0x3e2f38(0x1a8)]&&(_0x3eb1b9['description']=''),!_0x3eb1b9[_0x3e2f38(0x205)]&&(_0x3eb1b9[_0x3e2f38(0x205)]=_0x3e2f38(0x146));}export function injectExistingStageIds(_0x4b3641,_0x23f498){const _0x2b21cc=a155_0x285d0a,_0x3a9b87=new Map(_0x23f498[_0x2b21cc(0x21f)](_0x511331=>[_0x511331[_0x2b21cc(0x208)],_0x511331['id']]));for(const _0x13035d of _0x4b3641){if(!_0x13035d['id']){const _0x50cf5b=_0x3a9b87['get'](_0x13035d[_0x2b21cc(0x208)]);_0x50cf5b&&(_0x13035d['id']=_0x50cf5b);}}}export function resolveTDFolderPath(_0xd98017,_0x17f7d0,_0xd2d058){if(!_0x17f7d0)return _0xd98017;if(_0xd98017===_0xd2d058||_0xd98017['startsWith'](_0xd2d058+'/'))return _0xd98017;return _0xd98017?_0xd2d058+'/'+_0xd98017:_0xd2d058;}export function addFoldersToCreate(_0x412a97,_0x2580d4,_0xf7d607){const _0x2ccc84=a155_0x285d0a;if(!_0x412a97)return;if(_0x2580d4[_0x2ccc84(0x1e3)](_0x412a97))return;const _0x34f3df=_0x412a97[_0x2ccc84(0x1c5)]('/');let _0x3ed2ca='';for(const _0x4d7982 of _0x34f3df){_0x3ed2ca=_0x3ed2ca?_0x3ed2ca+'/'+_0x4d7982:_0x4d7982,!_0x2580d4[_0x2ccc84(0x1e3)](_0x3ed2ca)&&_0xf7d607['add'](_0x3ed2ca);}}export function sortFoldersByDepth(_0x147181){const _0x40d279=a155_0x285d0a;return[..._0x147181][_0x40d279(0x167)]((_0x2abfa5,_0x3c8d39)=>{const _0xb83f28=_0x40d279,_0x9b1c7a=(_0x2abfa5[_0xb83f28(0x157)](/\//g)||[])['length'],_0x422832=(_0x3c8d39[_0xb83f28(0x157)](/\//g)||[])[_0xb83f28(0x13c)];return _0x9b1c7a-_0x422832;});}import*as a155_0x3c593c from'yaml';import{readFileSync}from'fs';import a155_0x45cde5 from'path';import{isJourneyDef,parseYamlString as a155_0x4f65d2,toYamlString as a155_0x2d82ca,normalizeJourneyDef,hasMultipleVersions,journeyResponseToDef,collectSegmentIdsFromJourneyApi}from'./journey-yaml.js';function a155_0x512e(){const _0x38ba8a=['existingActivation','reduce','\x27...','toString','with','update','create','description','entry_criteria','segment_created','resolveSegment','parentFolder','some','segmentByFolderAndName','activationStepsById','Activation','Creating\x20segment\x20\x27','219100ETPbsQ','entryCriteria','exitCriterias','slice','59256xVLQOn','logDeleted','segment','localName','createdSegmentId','\x20activation\x20\x27','entries','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','buildUserMaps','INTERNAL','Created\x20activation\x20\x27','segmentNameToId','yamlActivation','rootFolderId','Updating\x20activation\x20\x27','split','conditionTimeoutDuration','journeyId','\x20(referenced\x20in\x20journey\x20','notification','segmentFolderId','24jpSYtt','embedded_activation_created','getLatestJourneyId','Activation\x20not\x20found:\x20','Updated\x20journey\x20\x27','getSegment','verbose','diff','stage\x20\x27','Failed\x20to\x20','conditions','updateActivation','\x27\x20entry\x20criteria','Matched\x20server\x20segment\x20\x27','Entry\x20criteria:\x20','hasChanges','goal\x20criteria','createSegment','existingSegments','stringify','all','message','uniqueServerName','delete','has','createActivation','activationsBySegmentId','existingSegment','Deleted\x20segment\x20\x27','toLowerCase','segmentId','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','activation_','segment_updated','max','Stage\x20\x27','updateSegmentById','activation_deleting','isNew','./child-segment-yaml.js','kind','.$1.push-recovery.json','Segment\x20not\x20found','):\x20','__pending_','journey_created','stages','Segment\x20not\x20found:\x20','SEGMENT_NOT_FOUND','45VbgoAD','validatedRequest','ACTIVATION_UPDATE_ERROR','steps','unchanged','logSuccess','embedded_segment_creating','journey','milestone','state','day','getJourney','name','journeyBundleId','relative','deleted','Journey\x20\x27','rule','Created\x20folder\x20\x27','conditionSegmentId','uniqueSegmentName','nameToType','createJourneySegment','attributes','effectiveFolderId','activation_updated','parentId','toISOString','set','null','flatMap','Failed\x20to\x20resolve\x20segment\x20','journeyActivationStepId','schedule','waitStepType','map','connectionIdToNameMap','waitStep','action','resolvedRule','Embedded\x20segment\x20\x27','Updated\x20segment\x20\x27','parseDocument','user','connector_config','createFolder','embedded_activation_creating','Fetching\x20','__pending_act_','398041vsPfAg','activationContext','\x27\x20by\x20rule\x20content','run_after_journey_refresh','journeyById','yamlConfig','filter','JOURNEY_SYNTAX_ERROR','Name\x20has\x20already\x20been\x20taken','values','folderPath','WaitStep','logWarning','object','embedded_segment_created','item','data','DecisionPoint','Creating\x20folder\x20\x27','trim','length','journeyName','connection','versionNumber','type','index',').\x20','folderPathToId','Failed\x20to\x20resolve\x20activation\x20','\x27\x20from\x20file:\x20','draft','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','deleteSegment','Condition','relationships','existingJourney','created','activation_created','embeddedSegmentNameToId','and\x20the\x20server\x20segment,\x20then\x20retry.','\x0a\x20\x20','startsWith','updated','join','progress','all_columns','activation_template_id','match','NOT_FOUND','activations','journeyStages','Creating\x20activation\x20\x27','\x27\x20milestone','getSegmentEntity\x20also\x20failed\x20for\x20','segment_creating','isArray','getActivation','1087960mhNmOf','400970fmGEry','Duration','journeyBundlesByFolderAndName','size','journeys','sort','segment_updating','absolutePath','idToEmailMap','segment_deleted','nameToId','valid','Created\x20journey\x20\x27','utf-8','../../utils/async.js','logInfo','journeyBundleName','createdSegmentIds','decision_point','keys','find','waitStepUnit','idToName','Created\x20segment\x20\x27','Failed\x20to\x20fetch\x20referenced\x20segment\x20','parse','listActivations','Deleting\x20activation\x20\x27','folder_creating','fetchJourney','columns','onProgress','journey_updated','get','from','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','\x27\x20wait\x20condition','conditionTimeoutUnit','getSegmentEntity','push','segments',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','\x27\x20to\x20local\x20\x27','withProgress','1243719sFgxyG','digest','results','activationParams','debug','Delete\x20the\x20push\x20recovery\x20file\x20(','add','Updating\x20segment\x20\x27','folder','replace','goal','folderId','JOURNEY_UPDATE_ERROR','branches','resolveJourneyId','journey_updating','412876EhZPSP','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','\x27\x20for\x20'];a155_0x512e=function(){return _0x38ba8a;};return a155_0x512e();}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(_0x1a78bc){const _0x4ec955=a155_0x285d0a;if(Array[_0x4ec955(0x15f)](_0x1a78bc))return'['+_0x1a78bc[_0x4ec955(0x21f)](_0x37e597=>stableStringify(_0x37e597))[_0x4ec955(0x153)](',')+']';if(_0x1a78bc&&typeof _0x1a78bc===_0x4ec955(0x135)){const _0xcee97b=_0x1a78bc,_0x37918b=Object[_0x4ec955(0x175)](_0xcee97b)[_0x4ec955(0x167)](),_0x4c5b16=_0x37918b['map'](_0x5bb869=>'\x22'+_0x5bb869+'\x22:'+stableStringify(_0xcee97b[_0x5bb869]));return'{'+_0x4c5b16[_0x4ec955(0x153)](',')+'}';}const _0x5e9cba=JSON['stringify'](_0x1a78bc);return _0x5e9cba===undefined?_0x4ec955(0x219):_0x5e9cba;}function a155_0x5fe8(_0x49e16e,_0x9d318b){_0x49e16e=_0x49e16e-0x126;const _0x512ea9=a155_0x512e();let _0x5fe880=_0x512ea9[_0x49e16e];return _0x5fe880;}function activationSignature(_0x4e2434){const _0x2f9ee1=a155_0x285d0a,_0x15db3c={'connection':_0x4e2434[_0x2f9ee1(0x13e)],..._0x4e2434['all_columns']!==undefined&&{'all_columns':_0x4e2434[_0x2f9ee1(0x155)]},..._0x4e2434[_0x2f9ee1(0x180)]!==undefined&&{'columns':_0x4e2434['columns']},..._0x4e2434['behavior']!==undefined&&{'behavior':_0x4e2434['behavior']},..._0x4e2434[_0x2f9ee1(0x21d)]!==undefined&&{'schedule':_0x4e2434['schedule']},..._0x4e2434[_0x2f9ee1(0x1c9)]!==undefined&&{'notification':_0x4e2434['notification']},..._0x4e2434[_0x2f9ee1(0x228)]!==undefined&&{'connector_config':_0x4e2434[_0x2f9ee1(0x228)]},..._0x4e2434[_0x2f9ee1(0x156)]!==undefined&&{'activation_template_id':_0x4e2434[_0x2f9ee1(0x156)]}};return stableStringify(_0x15db3c);}async function fetchSegment(_0x305b08,_0x3f1510,_0xd3adcb,_0x4ed367){const _0x59cf1a=a155_0x285d0a,_0x12b964=_0x4ed367?.[_0x59cf1a(0x176)](_0x657b51=>_0x657b51['id']===_0xd3adcb);if(_0x12b964)return _0x12b964;try{return await _0x305b08[_0x59cf1a(0x1b8)][_0x59cf1a(0x1d0)](_0x3f1510,_0xd3adcb);}catch(_0x1c5381){logger[_0x59cf1a(0x192)]('getSegment\x20failed\x20for\x20'+_0xd3adcb+_0x59cf1a(0x18b)+_0x1c5381);try{return await _0x305b08[_0x59cf1a(0x1b8)][_0x59cf1a(0x188)](_0xd3adcb);}catch(_0x2e2453){return logger['debug'](_0x59cf1a(0x15d)+_0xd3adcb+':\x20'+_0x2e2453),null;}}}function recoverSegmentIdsFromPushRecovery(_0x3ab8b8,_0x513dbe,_0x106b9c){const _0x2ee82a=a155_0x285d0a,_0x157c1d=readPushRecovery(_0x3ab8b8[_0x2ee82a(0x169)]);if(_0x157c1d?.[_0x2ee82a(0x13d)]===_0x3ab8b8[_0x2ee82a(0x12d)][_0x2ee82a(0x208)])for(const [_0x11ef88,_0x260ff5]of Object[_0x2ee82a(0x1bc)](_0x157c1d[_0x2ee82a(0x18a)])){const _0x124701=generateDeterministicJourneySegmentName(_0x3ab8b8[_0x2ee82a(0x12d)]['name'],_0x11ef88);_0x260ff5[_0x2ee82a(0x1e1)]===_0x124701&&(_0x513dbe[_0x2ee82a(0x218)](_0x11ef88,_0x260ff5[_0x2ee82a(0x1e9)]),_0x106b9c[_0x2ee82a(0x218)](_0x11ef88,_0x260ff5[_0x2ee82a(0x1e9)]));}}async function createOrRecoverEmbeddedSegment(_0x1ed772,_0x50ec56,_0x4d8b0b,_0x58da92){const _0x598cd5=a155_0x285d0a;let _0x5a0f1c;try{_0x5a0f1c=await _0x1ed772[_0x598cd5(0x1b8)][_0x598cd5(0x212)]({'name':_0x4d8b0b[_0x598cd5(0x210)],'description':_0x4d8b0b[_0x598cd5(0x1a8)],'journeyId':_0x4d8b0b[_0x598cd5(0x1c7)],'rule':_0x58da92(_0x4d8b0b[_0x598cd5(0x223)],!![]),'countPopulation':!![],'parentFolderId':_0x4d8b0b[_0x598cd5(0x199)],'audienceId':_0x4d8b0b[_0x598cd5(0x216)]});}catch(_0x5a70cb){const _0x1a3565=_0x5a70cb instanceof Error&&_0x5a70cb[_0x598cd5(0x1e0)]['includes'](_0x598cd5(0x130));if(_0x1a3565){const _0x4ecb46=readPushRecovery(_0x50ec56['absolutePath']),_0x2b5ff4=_0x4ecb46?.[_0x598cd5(0x13d)]===_0x50ec56['yamlConfig'][_0x598cd5(0x208)]?_0x4ecb46[_0x598cd5(0x18a)][_0x4d8b0b[_0x598cd5(0x1b9)]]:undefined;if(_0x2b5ff4?.[_0x598cd5(0x1e1)]===_0x4d8b0b['uniqueSegmentName'])await _0x1ed772[_0x598cd5(0x1b8)]['updateSegmentById'](_0x4d8b0b[_0x598cd5(0x216)],_0x2b5ff4['segmentId'],{'description':_0x4d8b0b[_0x598cd5(0x1a8)],'rule':_0x58da92(_0x4d8b0b[_0x598cd5(0x223)],!![]),'countPopulation':!![]}),_0x5a0f1c=_0x2b5ff4['segmentId'];else throw new SDKError(ErrorCode['SEGMENT_UPDATE_ERROR'],_0x598cd5(0x224)+_0x4d8b0b[_0x598cd5(0x1b9)]+'\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20'+(_0x598cd5(0x193)+_0x50ec56[_0x598cd5(0x169)][_0x598cd5(0x197)](/([^/]+)$/,_0x598cd5(0x1f4))+')\x20')+_0x598cd5(0x14f),_0x5a70cb);}else throw _0x5a70cb;}return saveSegmentToPushRecovery(_0x50ec56[_0x598cd5(0x169)],_0x50ec56[_0x598cd5(0x12d)][_0x598cd5(0x208)],_0x4d8b0b['localName'],{'segmentId':_0x5a0f1c,'uniqueServerName':_0x4d8b0b['uniqueSegmentName'],'createdAt':new Date()[_0x598cd5(0x217)]()}),_0x5a0f1c;}export async function prepareSegmentFiles(_0x7251e4,_0x4ee893,_0x36930e,_0x1c059e,_0x410205){const _0x388a6d=a155_0x285d0a,{activationDefToCreateRequest:_0x2df816}=await import(_0x388a6d(0x1f2)),_0x3b4d7e=[],_0x3a6a34=new Set();for(const {yamlConfig:_0x5118e4,folderPath:_0x169e47,sourcePath:_0x29cc85}of _0x7251e4){const _0x111b30=resolveTDFolderPath(_0x169e47,_0x1c059e,_0x410205),_0x1a72a3=_0x111b30+':'+_0x5118e4[_0x388a6d(0x208)],_0x4fc182=_0x4ee893[_0x388a6d(0x1ae)][_0x388a6d(0x183)](_0x1a72a3),_0x1e6ce2=_0x4fc182?_0x4ee893[_0x388a6d(0x1e5)][_0x388a6d(0x183)](_0x4fc182['id'])||[]:[];addFoldersToCreate(_0x111b30,_0x4ee893[_0x388a6d(0x143)],_0x3a6a34);const _0x19f6d9=calculateActivationActions(_0x5118e4[_0x388a6d(0x159)]||[],_0x1e6ce2,_0x4ee893[_0x388a6d(0x16a)],_0x4ee893['connectionIdToNameMap']);for(const _0x4d3313 of _0x19f6d9){(_0x4d3313['type']===_0x388a6d(0x1a7)||_0x4d3313['type']===_0x388a6d(0x1a6))&&_0x4d3313[_0x388a6d(0x1c2)]&&(_0x4d3313[_0x388a6d(0x1fd)]=await _0x2df816(_0x4d3313['yamlActivation'],_0x36930e));}const _0xb7257a=calculateSegmentDiff(_0x5118e4,_0x4fc182,_0x1e6ce2,_0x4ee893[_0x388a6d(0x16a)],_0x4ee893['connectionIdToNameMap']);_0x3b4d7e[_0x388a6d(0x189)]({'relativePath':_0x5118e4[_0x388a6d(0x208)],'absolutePath':_0x29cc85,'yamlConfig':_0x5118e4,'folderPath':_0x111b30,'existingSegment':_0x4fc182,'existingActivations':_0x1e6ce2,'isNew':_0xb7257a['isNew'],'hasChanges':_0xb7257a[_0x388a6d(0x1da)],'diff':_0xb7257a[_0x388a6d(0x1d2)],'activationActions':_0x19f6d9});}return{'segmentFiles':_0x3b4d7e,'foldersToCreate':_0x3a6a34};}export async function prepareJourneyFiles(_0x4af5fe,_0x2f59a0,_0x48704a,_0x3ca9b3){const _0x25a80f=a155_0x285d0a,_0x2d62c9=[],_0x163f14=new Set();for(const {yamlConfig:_0x218eb1,folderPath:_0x43c1dd,sourcePath:_0x234913}of _0x4af5fe){const _0x56c7fd=resolveTDFolderPath(_0x43c1dd,_0x48704a,_0x3ca9b3),_0x5004fd=_0x56c7fd+':'+_0x218eb1[_0x25a80f(0x208)],_0x560da4=_0x2f59a0[_0x25a80f(0x164)][_0x25a80f(0x183)](_0x5004fd);let _0x1cd958,_0x4d7722;if(_0x560da4&&_0x560da4[_0x25a80f(0x13c)]>0x0){const _0x1e5650=buildLocalExpandedRuleMappings(_0x218eb1),{createYamlContext:_0x5ab646,prefetchJourneySegments:_0x47545e}=createPushYamlContextForBundle(_0x2f59a0['deps'],_0x2f59a0['parentId'],_0x2f59a0[_0x25a80f(0x1dd)],_0x1e5650,_0x2f59a0[_0x25a80f(0x16a)],_0x2f59a0['connectionIdToNameMap'],_0x2f59a0[_0x25a80f(0x1af)],_0x2f59a0[_0x25a80f(0x12c)]);await _0x47545e(_0x560da4['map'](_0x768a2b=>_0x768a2b['id']));const _0x1cb160=await _0x2f59a0['deps'][_0x25a80f(0x203)][_0x25a80f(0x1cd)](_0x560da4[0x0][_0x25a80f(0x209)]),_0xe829e6=hasMultipleVersions(_0x218eb1),_0x32c2d6=async _0x5b6711=>{const _0x336c75=_0x25a80f,_0x6db995=_0x2f59a0[_0x336c75(0x12c)]?.[_0x336c75(0x183)](_0x5b6711);if(_0x6db995)return _0x6db995;return _0x2f59a0[_0x336c75(0x17f)]({'journeyId':_0x5b6711,'journeyName':_0x218eb1[_0x336c75(0x208)],'isMultiVersion':_0x560da4[_0x336c75(0x13c)]>0x1});};if(_0xe829e6&&_0x560da4['length']>0x1){const _0xa2dde1=[];for(const _0x1860ed of _0x560da4){const _0x32717b=_0x1860ed[_0x25a80f(0x13f)]||0x1;_0x2f59a0[_0x25a80f(0x154)]?.['update'](_0x25a80f(0x126)+_0x218eb1['name']+'\x20v'+_0x32717b);const _0x8c407a=await _0x32c2d6(_0x1860ed['id']),_0x54b4b5=_0x5ab646(_0x1860ed['id']),_0xef09cf=await journeyResponseToDef(_0x8c407a,_0x54b4b5);_0xa2dde1[_0x25a80f(0x189)]({'item':_0x1860ed,'yaml':_0xef09cf});}const _0x4a9d42=buildLocalRuleToNameMappingFromJourney(_0x218eb1);_0x4d7722=buildMergedJourneyDef(_0xa2dde1,_0x4a9d42,_0x1cb160);const _0x29edd5=Math['max'](..._0xa2dde1[_0x25a80f(0x21f)](_0x3e3fa7=>_0x3e3fa7[_0x25a80f(0x137)][_0x25a80f(0x13f)]||0x0)),_0x2586df=_0x560da4[_0x25a80f(0x176)](_0xa5364d=>(_0xa5364d[_0x25a80f(0x13f)]||0x0)===_0x29edd5);_0x2586df&&(_0x2f59a0[_0x25a80f(0x154)]?.['update']('Fetching\x20'+_0x218eb1[_0x25a80f(0x208)]+'\x20v'+_0x29edd5),_0x1cd958=await _0x32c2d6(_0x2586df['id']));}else{const _0x2b5ccc=_0x560da4[_0x560da4[_0x25a80f(0x13c)]-0x1];_0x2f59a0[_0x25a80f(0x154)]?.['update'](_0x25a80f(0x126)+_0x218eb1[_0x25a80f(0x208)]),_0x1cd958=await _0x32c2d6(_0x2b5ccc['id']);const _0x3ef0cb=_0x5ab646(_0x2b5ccc['id']),_0x193665=await journeyResponseToDef(_0x1cd958,_0x3ef0cb),_0x38840b=buildLocalRuleToNameMappingFromJourney(_0x218eb1);_0x4d7722=buildMergedJourneyDef([{'item':_0x2b5ccc,'yaml':_0x193665}],_0x38840b,_0x1cb160);}}addFoldersToCreate(_0x56c7fd,_0x2f59a0[_0x25a80f(0x143)],_0x163f14);const _0x245df0=calculateJourneyDiff(_0x218eb1,_0x4d7722);_0x2d62c9[_0x25a80f(0x189)]({'relativePath':_0x218eb1[_0x25a80f(0x208)],'absolutePath':_0x234913,'yamlConfig':_0x218eb1,'folderPath':_0x56c7fd,'existingJourney':_0x1cd958,'isNew':_0x245df0['isNew'],'hasChanges':_0x245df0[_0x25a80f(0x1da)],'diff':_0x245df0['diff']});}return{'journeyFiles':_0x2d62c9,'foldersToCreate':_0x163f14};}export function calculateActivationActions(_0x14296c,_0x278f49,_0x3aa5ea,_0x2c10c5){const _0x17556d=a155_0x285d0a,_0x8b2348=[],_0x5f0cf6=new Map();for(const _0x6db725 of _0x278f49){_0x5f0cf6[_0x17556d(0x218)](_0x6db725[_0x17556d(0x208)],_0x6db725);}const _0x123be4=new Map();for(const _0x22c835 of _0x14296c){_0x123be4[_0x17556d(0x218)](_0x22c835[_0x17556d(0x208)],_0x22c835);}for(const _0x4adfb8 of _0x14296c){const _0x1e9ece=_0x5f0cf6[_0x17556d(0x183)](_0x4adfb8['name']);if(!_0x1e9ece)_0x8b2348[_0x17556d(0x189)]({'type':'create','name':_0x4adfb8['name'],'yamlActivation':_0x4adfb8});else{const _0x19cbe7=activationResponseToDef(_0x1e9ece,_0x3aa5ea,_0x2c10c5),_0x201037=a155_0x3c593c['stringify'](_0x19cbe7),_0x2e4025=a155_0x3c593c['stringify'](_0x4adfb8);_0x201037!==_0x2e4025&&_0x8b2348[_0x17556d(0x189)]({'type':_0x17556d(0x1a6),'name':_0x4adfb8[_0x17556d(0x208)],'yamlActivation':_0x4adfb8,'existingActivation':_0x1e9ece});}}for(const _0x77e233 of _0x278f49){!_0x123be4[_0x17556d(0x1e3)](_0x77e233['name'])&&_0x8b2348['push']({'type':'delete','name':_0x77e233['name'],'existingActivation':_0x77e233});}return _0x8b2348;}function calculateYamlDiff(_0x2c65a8,_0x5160a1){if(_0x5160a1){const _0x3c396a=generateDiff(_0x5160a1,_0x2c65a8),_0x5a78cb=hasChanges(_0x3c396a);return{'isNew':![],'hasChanges':_0x5a78cb,'diff':_0x5a78cb?formatDiffWithColors(_0x3c396a):undefined};}const _0x5bef00=generateDiff('',_0x2c65a8);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x5bef00)};}export function calculateSegmentDiff(_0x1828d8,_0x307d99,_0x7babac,_0x44429e,_0x1c7956){const _0x35dac0=segmentToYamlString(_0x1828d8),_0x3ede36=_0x307d99?segmentToYamlString(segmentWithActivationsToYaml(_0x307d99,_0x7babac,undefined,_0x44429e,_0x1c7956)):undefined;return calculateYamlDiff(_0x35dac0,_0x3ede36);}export function calculateJourneyDiff(_0x18e133,_0x16553e){const _0x1a56ff=normalizeJourneyDef(_0x18e133,_0x18e133),_0x12a584=a155_0x2d82ca(_0x1a56ff),_0x145b8f=_0x16553e?a155_0x2d82ca(normalizeJourneyDef(_0x16553e,_0x18e133)):undefined;return calculateYamlDiff(_0x12a584,_0x145b8f);}export function findSegmentsToDelete(_0x386a91,_0x1983c9,_0x553e27,_0x4644a9,_0x18034b){const _0x181474=a155_0x285d0a,_0x21f5f6=new Set();for(const {yamlConfig:_0x48984f,folderPath:_0x242f1b}of _0x1983c9){_0x21f5f6['add'](_0x242f1b+':'+_0x48984f[_0x181474(0x208)]);}return _0x386a91[_0x181474(0x12e)](_0x4b6a1d=>{const _0x50487c=_0x181474,_0xa69a1d=_0x4b6a1d['segmentFolderId']?_0x553e27[_0x50487c(0x183)](_0x4b6a1d[_0x50487c(0x1ca)][_0x50487c(0x1a4)]())||'':'',_0x24bd9f=_0xa69a1d+':'+_0x4b6a1d['name'];if(_0x21f5f6['has'](_0x24bd9f))return![];if(_0x18034b)return _0xa69a1d===_0x4644a9||_0xa69a1d['startsWith'](_0x4644a9+'/');return!![];});}export function findJourneysToDelete(_0x540f83,_0x28f070,_0x19e766,_0x108786,_0x10506b){const _0xbb2982=a155_0x285d0a,_0x79d2e7=new Set();for(const {yamlConfig:_0x51d0b2,folderPath:_0x1aab21}of _0x28f070){_0x79d2e7[_0xbb2982(0x194)](_0x1aab21+':'+_0x51d0b2[_0xbb2982(0x208)]);}return _0x540f83[_0xbb2982(0x12e)](_0x4ab0d9=>{const _0x4e1a81=_0xbb2982,_0x4a300c=_0x4ab0d9['folderId']?_0x19e766[_0x4e1a81(0x183)](_0x4ab0d9[_0x4e1a81(0x199)])||'':'',_0x170aad=_0x4a300c+':'+_0x4ab0d9['journeyBundleName'];if(_0x79d2e7[_0x4e1a81(0x1e3)](_0x170aad))return![];if(_0x10506b)return _0x4a300c===_0x108786||_0x4a300c['startsWith'](_0x108786+'/');return!![];});}export function buildSegmentLookupMap(_0x53ca19,_0x5cac9b){const _0x38b353=a155_0x285d0a,_0x4ab320=new Map();for(const _0x5a19c0 of _0x53ca19){const _0x1141e4=_0x5a19c0[_0x38b353(0x1ca)]?_0x5cac9b['get'](_0x5a19c0['segmentFolderId']['toString']())||'':'',_0x3b9ac9=_0x1141e4+':'+_0x5a19c0[_0x38b353(0x208)];_0x4ab320['set'](_0x3b9ac9,_0x5a19c0);}return _0x4ab320;}export function buildSegmentNameToIdMap(_0x86e2d0){const _0x301565=a155_0x285d0a,_0xac7fb2=new Map();for(const _0x479d92 of _0x86e2d0){_0xac7fb2[_0x301565(0x218)](_0x479d92[_0x301565(0x208)],_0x479d92['id']);}return _0xac7fb2;}export function buildJourneyBundleLookupMap(_0x367c2c,_0x4f53ec){const _0x179498=a155_0x285d0a,_0x39ad9b=new Map();for(const _0x588022 of _0x367c2c){const _0x353293=_0x588022['folderId']?_0x4f53ec['get'](_0x588022[_0x179498(0x199)])||'':'',_0x3d7619=_0x353293+':'+_0x588022[_0x179498(0x172)];!_0x39ad9b[_0x179498(0x1e3)](_0x3d7619)&&_0x39ad9b[_0x179498(0x218)](_0x3d7619,[]),_0x39ad9b['get'](_0x3d7619)['push'](_0x588022);}for(const _0x3129f0 of _0x39ad9b[_0x179498(0x131)]()){_0x3129f0[_0x179498(0x167)]((_0x5e6684,_0x441438)=>(_0x5e6684['versionNumber']||0x0)-(_0x441438[_0x179498(0x13f)]||0x0));}return _0x39ad9b;}export function collectFoldersToCreate(_0x1bd9ed,_0xa4393c){const _0x5a1dee=a155_0x285d0a,_0x3ef696=new Set();for(const _0xc1a7b1 of _0x1bd9ed){if(!_0xc1a7b1)continue;if(_0xa4393c[_0x5a1dee(0x1e3)](_0xc1a7b1))continue;const _0x486602=_0xc1a7b1[_0x5a1dee(0x1c5)]('/');let _0x35e8d6='';for(const _0x3e9000 of _0x486602){_0x35e8d6=_0x35e8d6?_0x35e8d6+'/'+_0x3e9000:_0x3e9000,!_0xa4393c[_0x5a1dee(0x1e3)](_0x35e8d6)&&_0x3ef696[_0x5a1dee(0x194)](_0x35e8d6);}}return _0x3ef696;}export function parseAndClassifyYamlFiles(_0x23d485,_0x23541c,_0x251f32){const _0x147c31=a155_0x285d0a,_0x257950=[],_0x42cc94=[];for(const _0x4d35bd of _0x23d485){const _0x3cc35b=a155_0x45cde5[_0x147c31(0x20a)](_0x23541c,a155_0x45cde5['dirname'](_0x4d35bd)),_0x1e9581=_0x3cc35b==='.'?'':_0x3cc35b['replace'](/\\/g,'/'),_0x520822=readFileSync(_0x4d35bd,_0x147c31(0x16f)),_0xea9c2b=a155_0x3c593c[_0x147c31(0x17b)](_0x520822);if(isJourneyDef(_0xea9c2b)){const _0x2d1b7d=a155_0x4f65d2(_0x520822);_0x42cc94[_0x147c31(0x189)]({'yamlConfig':_0x2d1b7d,'folderPath':_0x1e9581,'sourcePath':_0x4d35bd});}else{if(!_0x251f32?.['skipSegments']){const _0x571648=parseSegmentYamlFile(_0x520822),_0x1f66d5=normalizeChildSegmentYaml(_0x571648);_0x257950[_0x147c31(0x189)]({'yamlConfig':_0x1f66d5,'folderPath':_0x1e9581,'sourcePath':_0x4d35bd});}}}return{'segments':_0x257950,'journeys':_0x42cc94};}export function validateParsedFiles(_0x4ed951,_0x9f0c6e){const _0x4c0c57=a155_0x285d0a,_0x25a6a9=[];for(const {yamlConfig:_0x15d972,sourcePath:_0x177cfc}of _0x4ed951[_0x4c0c57(0x18a)]){const _0x15184e=readFileSync(_0x177cfc,_0x4c0c57(0x16f)),_0x2c6ca0=a155_0x3c593c['parseDocument'](_0x15184e),_0x33b15f=validateSegmentDef(_0x15d972,{'source':_0x15184e,'document':_0x2c6ca0},{'skipSchema':!![]});if(!_0x33b15f[_0x4c0c57(0x16d)]){const _0x18d9db=a155_0x45cde5['relative'](_0x9f0c6e,_0x177cfc);_0x25a6a9[_0x4c0c57(0x189)]({'filePath':_0x18d9db,'source':_0x15184e,'result':_0x33b15f,'isJourney':![]});}}for(const {yamlConfig:_0x5c1948,sourcePath:_0x4ea84c}of _0x4ed951[_0x4c0c57(0x166)]){const _0x1fcaea=readFileSync(_0x4ea84c,_0x4c0c57(0x16f)),_0x1a4e44=a155_0x3c593c[_0x4c0c57(0x226)](_0x1fcaea),_0x4f5826=validateJourneyDef(_0x5c1948,{'source':_0x1fcaea,'document':_0x1a4e44},{'skipSchema':!![]});if(!_0x4f5826[_0x4c0c57(0x16d)]){const _0x3ef488=a155_0x45cde5['relative'](_0x9f0c6e,_0x4ea84c);_0x25a6a9[_0x4c0c57(0x189)]({'filePath':_0x3ef488,'source':_0x1fcaea,'result':_0x4f5826,'isJourney':!![]});}}return _0x25a6a9;}export function formatValidationErrors(_0x286161){const _0x1b26df=a155_0x285d0a,_0x2a81ec=[];for(const {filePath:_0x2405db,source:_0x343bdb,result:_0x593a3f,isJourney:_0x476546}of _0x286161){const _0x418aa2=_0x476546?_0x1b26df(0x203):_0x1b26df(0x1b8);_0x2a81ec[_0x1b26df(0x189)]('\x0a'+_0x2405db+'\x20('+_0x418aa2+_0x1b26df(0x1f6)+_0x593a3f['errors']['length']+'\x20error(s)'),_0x2a81ec['push'](formatValidationResult(_0x593a3f,_0x343bdb,_0x2405db));}return _0x2a81ec[_0x1b26df(0x153)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x2704fd){const _0x421569=a155_0x285d0a,_0xdc2eb0=new Set(),_0x2568bf=new Map(),_0x3f6564=collectSegmentUsageCounts(_0x2704fd);if(_0x2704fd['segments'])for(const [_0xeaf0ea,_0x582d2b]of Object[_0x421569(0x1bc)](_0x2704fd[_0x421569(0x18a)])){_0xdc2eb0[_0x421569(0x194)](_0xeaf0ea);if(_0x582d2b[_0x421569(0x20d)]){const _0x5b311c=yamlRuleToApi(_0x582d2b['rule']),_0x3e8eae=apiRuleToYaml(_0x5b311c);_0x2568bf[_0x421569(0x218)](_0xeaf0ea,_0x3e8eae);}}const _0x2cf996=new Map();let _0x281b18=0x0;for(const [_0x308d0d,_0x2553fe]of _0x2568bf){const _0x419e6b=serializeExpandedRule(_0x2553fe,_0x2568bf),_0x3fb29e=_0x2cf996['get'](_0x419e6b)||[];_0x3fb29e[_0x421569(0x189)]({'name':_0x308d0d,'index':_0x281b18}),_0x2cf996[_0x421569(0x218)](_0x419e6b,_0x3fb29e),_0x281b18++;}const _0x29de76=new Map();for(const [_0x54639a,_0x275306]of _0x2cf996){const _0x539e5f=_0x275306[_0x421569(0x1b5)]()[_0x421569(0x167)]((_0x2d1f21,_0x381181)=>{const _0x55be23=_0x421569,_0x231717=_0x3f6564[_0x55be23(0x183)](_0x2d1f21[_0x55be23(0x208)])||0x0,_0x70e47c=_0x3f6564[_0x55be23(0x183)](_0x381181[_0x55be23(0x208)])||0x0;if(_0x231717!==_0x70e47c)return _0x70e47c-_0x231717;return _0x2d1f21[_0x55be23(0x141)]-_0x381181[_0x55be23(0x141)];})['map'](_0x51a722=>_0x51a722[_0x421569(0x208)]),_0x22868e=[];for(const _0xf8b3db of _0x539e5f){const _0x65429e=_0x3f6564[_0x421569(0x183)](_0xf8b3db)||0x0,_0x90842=Math[_0x421569(0x1ed)](_0x65429e,0x1);for(let _0x2fa81a=0x0;_0x2fa81a<_0x90842;_0x2fa81a++){_0x22868e[_0x421569(0x189)](_0xf8b3db);}}_0x29de76[_0x421569(0x218)](_0x54639a,_0x22868e);}return{'existingLocalSegmentNames':_0xdc2eb0,'localSegmentRules':_0x2568bf,'localExpandedRuleToNames':_0x29de76};}export function createSegmentIdResolver(_0x76b1f1,_0xd6d38e){return async _0x2e256c=>{const _0x48d4b7=a155_0x5fe8,_0x57fb0e=_0x76b1f1[_0x48d4b7(0x183)](_0x2e256c);if(!_0x57fb0e)throw new SDKError(ErrorCode[_0x48d4b7(0x1fb)],'Segment\x20not\x20found:\x20'+_0x2e256c+_0x48d4b7(0x185)+_0xd6d38e+'\x27)');return _0x57fb0e;};}export function extractRootFolderId(_0xa15988){const _0x3d0298=a155_0x285d0a;return _0xa15988[_0x3d0298(0x14a)]?.['parentSegmentFolder']?.['data']?.['id']||_0xa15988[_0x3d0298(0x14a)]?.[_0x3d0298(0x1ac)]?.[_0x3d0298(0x138)]?.['id'];}export function buildConnectionMaps(_0x45c925){const _0x4337ed=a155_0x285d0a,_0x62a769=new Map(),_0x40d30d=new Map(),_0xa76b4a=new Map();for(const _0x211785 of _0x45c925){_0x62a769['set'](_0x211785[_0x4337ed(0x208)],parseInt(_0x211785['id'],0xa)),_0x40d30d['set'](_0x211785['id'],_0x211785[_0x4337ed(0x208)]),_0xa76b4a['set'](_0x211785[_0x4337ed(0x208)],_0x211785[_0x4337ed(0x140)]);}return{'nameToId':_0x62a769,'idToName':_0x40d30d,'nameToType':_0xa76b4a};}export function calculatePushStats(_0x388409,_0x6b08ad,_0x1f5981,_0x6ca4c2,_0x16ea11,_0x6d28ba,_0x346ae7){const _0x5ea7ff=a155_0x285d0a,_0x3620b3=_0x388409[_0x5ea7ff(0x12e)](_0x5596d9=>_0x5596d9[_0x5ea7ff(0x1f1)]),_0x2bad75=_0x388409[_0x5ea7ff(0x12e)](_0x34a446=>!_0x34a446[_0x5ea7ff(0x1f1)]&&_0x34a446[_0x5ea7ff(0x1da)]),_0x4d5fef=_0x388409[_0x5ea7ff(0x12e)](_0x43a7e5=>!_0x43a7e5['isNew']&&!_0x43a7e5[_0x5ea7ff(0x1da)]),_0x3c8bf5=_0x6d28ba?_0x6ca4c2:[],_0x37ba8d=_0x6b08ad[_0x5ea7ff(0x12e)](_0x4c65f3=>_0x4c65f3[_0x5ea7ff(0x1f1)]),_0x1239de=_0x6b08ad[_0x5ea7ff(0x12e)](_0x388437=>!_0x388437[_0x5ea7ff(0x1f1)]&&_0x388437[_0x5ea7ff(0x1da)]),_0x538115=_0x6b08ad[_0x5ea7ff(0x12e)](_0x4cb49b=>!_0x4cb49b['isNew']&&!_0x4cb49b['hasChanges']),_0x5df96b=_0x6d28ba?_0x16ea11:[],_0x5cf5bf=_0x388409[_0x5ea7ff(0x21a)](_0x4d743b=>_0x4d743b['activationActions']),_0x30e097=_0x5cf5bf[_0x5ea7ff(0x12e)](_0x2a9b5e=>_0x2a9b5e['type']===_0x5ea7ff(0x1a7)),_0x2f072e=_0x5cf5bf[_0x5ea7ff(0x12e)](_0x38a7da=>_0x38a7da[_0x5ea7ff(0x140)]==='update'),_0xb5385=_0x5cf5bf[_0x5ea7ff(0x12e)](_0x4527e9=>_0x4527e9[_0x5ea7ff(0x140)]==='delete'),_0x5e8ecd=Array[_0x5ea7ff(0x184)](_0x1f5981)[_0x5ea7ff(0x167)](),_0x2c6b6e=_0x346ae7?![]:_0x3620b3['length']>0x0||_0x2bad75[_0x5ea7ff(0x13c)]>0x0||_0x3c8bf5[_0x5ea7ff(0x13c)]>0x0,_0x4c05d7=_0x37ba8d[_0x5ea7ff(0x13c)]>0x0||_0x1239de[_0x5ea7ff(0x13c)]>0x0||_0x5df96b[_0x5ea7ff(0x13c)]>0x0,_0x5a6af2=_0x346ae7?![]:_0x5cf5bf[_0x5ea7ff(0x13c)]>0x0,_0x27f56c=_0x5e8ecd[_0x5ea7ff(0x13c)]>0x0;return{'segments':{'new':_0x3620b3,'changed':_0x2bad75,'unchanged':_0x4d5fef,'toDelete':_0x3c8bf5},'journeys':{'new':_0x37ba8d,'changed':_0x1239de,'unchanged':_0x538115,'toDelete':_0x5df96b},'activations':{'all':_0x5cf5bf,'toCreate':_0x30e097,'toUpdate':_0x2f072e,'toDelete':_0xb5385},'folders':{'toCreate':_0x5e8ecd},'counts':{'segments':{'new':_0x3620b3[_0x5ea7ff(0x13c)],'changed':_0x2bad75[_0x5ea7ff(0x13c)],'unchanged':_0x4d5fef['length'],'toDelete':_0x3c8bf5[_0x5ea7ff(0x13c)]},'journeys':{'new':_0x37ba8d['length'],'changed':_0x1239de[_0x5ea7ff(0x13c)],'unchanged':_0x538115['length'],'toDelete':_0x5df96b[_0x5ea7ff(0x13c)]},'activations':{'create':_0x30e097[_0x5ea7ff(0x13c)],'update':_0x2f072e[_0x5ea7ff(0x13c)],'delete':_0xb5385[_0x5ea7ff(0x13c)]},'folders':_0x5e8ecd['length']},'hasChanges':_0x2c6b6e||_0x4c05d7||_0x5a6af2||_0x27f56c};}export async function buildPushExecutionContext(_0x3967a4,_0x3e8d3d,_0x2d7579,_0xb3d34c,_0x307bf3,_0x3d685d){const _0x43bc90=a155_0x285d0a,_0x4c96ee=extractRootFolderId(_0x2d7579),{pathToId:_0x26786a,idToPath:_0xa79817}=buildFolderMaps(_0x307bf3),_0x50c9a1=buildSegmentNameToIdMap(_0xb3d34c),_0x5d8caf=new Map(),{batchAsync:_0x540ac7}=await import('../../utils/async.js'),[_0x1f942b,_0x8f4c13]=await Promise[_0x43bc90(0x1df)]([_0x3967a4[_0x43bc90(0x227)][_0x43bc90(0x1be)](),_0x3967a4[_0x43bc90(0x13e)]['list'](),((async()=>{const _0x383396=_0x43bc90;!_0x3d685d&&_0xb3d34c[_0x383396(0x13c)]>0x0&&await _0x540ac7(_0xb3d34c,async _0x4e114a=>{const _0x4e3d73=_0x383396,_0x5b1ddc=await _0x3967a4[_0x4e3d73(0x1b8)][_0x4e3d73(0x17c)](_0x3e8d3d,_0x4e114a['id']);_0x5d8caf['set'](_0x4e114a['id'],_0x5b1ddc);});})())]),{emailToId:_0x7cd4a9,idToEmail:_0x2338ce}=_0x1f942b,_0x4fe79f=buildConnectionMaps(_0x8f4c13);return{'rootFolderId':_0x4c96ee,'folderPathToId':_0x26786a,'folderIdToPath':_0xa79817,'segmentNameToId':_0x50c9a1,'activationsBySegmentId':_0x5d8caf,'emailToIdMap':_0x7cd4a9,'idToEmailMap':_0x2338ce,'connectionNameToIdMap':_0x4fe79f[_0x43bc90(0x16c)],'connectionIdToNameMap':_0x4fe79f[_0x43bc90(0x178)],'connectionNameToTypeMap':_0x4fe79f[_0x43bc90(0x211)]};}export function createPushYamlContextForBundle(_0x446b1b,_0x4b0802,_0x3c89e3,_0x311820,_0x59876d,_0x30057d,_0x21d2d2,_0x2bc34d){const {existingLocalSegmentNames:_0x5bd048,localExpandedRuleToNames:_0x46cd7b}=_0x311820,_0x596776=new Set(),_0x3623d6=new Map(),_0x5717c5=new Map(),_0x263883=new Map(),_0x5cc1ec=createJumpTargetCache(),_0x15076a=new Map(),_0x9a8bc6=new Map(),_0x5c56bf=new Set();let _0x572768;const _0xdfd418=_0x4bf6ae=>{const _0x225452={'resolveSegment':async _0x387efe=>{const _0x225444=a155_0x5fe8,_0x569b8f=_0x263883[_0x225444(0x183)](_0x387efe);if(_0x569b8f!==undefined)return{'name':_0x569b8f,'isJourneyLocal':!![]};try{const _0x41f1af=await fetchSegment(_0x446b1b,_0x4b0802,_0x387efe,_0x3c89e3);if(!_0x41f1af)throw new Error(_0x225444(0x1f5));const _0x3bd5a0=generateJourneyLocalName(_0x41f1af[_0x225444(0x208)]),_0x565905=_0x41f1af[_0x225444(0x1f3)]===SEGMENT_KIND_JOURNEY&&_0x3bd5a0!==undefined;let _0x4bf4d3=_0x41f1af['name'],_0x12e09c;if(_0x565905&&_0x41f1af[_0x225444(0x20d)]){const _0x143306=apiRuleToYaml(_0x41f1af['rule']);_0x9a8bc6['set'](_0x387efe,_0x143306);const _0x2d52d5=async _0x13c120=>{const _0x58aa8c=_0x225444,_0x3ca384=collectSegmentRefsFromRule(_0x13c120);for(const _0x4d2e4c of _0x3ca384){if(!_0x9a8bc6[_0x58aa8c(0x1e3)](_0x4d2e4c))try{const _0x3e4030=await fetchSegment(_0x446b1b,_0x4b0802,_0x4d2e4c,_0x3c89e3);if(_0x3e4030?.[_0x58aa8c(0x20d)]){const _0x3da8ee=apiRuleToYaml(_0x3e4030['rule']);_0x9a8bc6[_0x58aa8c(0x218)](_0x4d2e4c,_0x3da8ee),await _0x2d52d5(_0x3da8ee);}}catch(_0x8493dd){logger[_0x58aa8c(0x192)](_0x58aa8c(0x17a)+_0x4d2e4c+':\x20'+_0x8493dd);}}};await _0x2d52d5(_0x143306);const _0x3bcc9a=serializeExpandedRule(_0x143306,_0x9a8bc6),_0x42ae2d=_0x46cd7b[_0x225444(0x183)](_0x3bcc9a);if(_0x42ae2d&&_0x42ae2d[_0x225444(0x13c)]>0x0){const _0x48b779=_0x3623d6[_0x225444(0x183)](_0x3bcc9a)||0x0,_0x1d4aff=_0x42ae2d[_0x48b779]||_0x42ae2d[_0x42ae2d['length']-0x1];_0x3623d6[_0x225444(0x218)](_0x3bcc9a,_0x48b779+0x1),_0x4bf4d3=_0x1d4aff,_0x596776[_0x225444(0x194)](_0x4bf4d3),_0x263883[_0x225444(0x218)](_0x387efe,_0x4bf4d3);const _0x23ed1a=await resolveRuleSegmentRefs(_0x143306,async _0x40bb42=>{const _0x4e44c8=_0x225444,_0x2e417e=_0x263883[_0x4e44c8(0x183)](_0x40bb42);if(_0x2e417e)return _0x2e417e;const _0x18767a=await _0x572768[_0x4e44c8(0x1ab)](_0x40bb42);return _0x18767a['name'];});_0x12e09c={'description':_0x41f1af[_0x225444(0x1a8)],'rule':_0x23ed1a};}else{const _0x1ed366=_0x15076a[_0x225444(0x183)](_0x3bcc9a);if(_0x1ed366)_0x4bf4d3=_0x1ed366,_0x263883[_0x225444(0x218)](_0x387efe,_0x4bf4d3);else{if(_0x3bd5a0){let _0x4fd9af=_0x3bd5a0,_0x279c2f=0x2;while(_0x596776[_0x225444(0x1e3)](_0x4fd9af)||_0x5bd048[_0x225444(0x1e3)](_0x4fd9af)){_0x4fd9af=_0x3bd5a0+'_'+_0x279c2f,_0x279c2f++;}_0x596776[_0x225444(0x194)](_0x4fd9af),_0x4bf4d3=_0x4fd9af;}_0x263883[_0x225444(0x218)](_0x387efe,_0x4bf4d3),_0x15076a[_0x225444(0x218)](_0x3bcc9a,_0x4bf4d3);const _0x1f4384=await resolveRuleSegmentRefs(_0x143306,async _0xd07b3b=>{const _0x18766e=_0x225444,_0x4a18af=_0x263883[_0x18766e(0x183)](_0xd07b3b);if(_0x4a18af)return _0x4a18af;const _0x3e9005=await _0x572768[_0x18766e(0x1ab)](_0xd07b3b);return _0x3e9005[_0x18766e(0x208)];});_0x12e09c={'description':_0x41f1af[_0x225444(0x1a8)],'rule':_0x1f4384};}}}return{'name':_0x4bf4d3,'isJourneyLocal':_0x565905,'definition':_0x12e09c};}catch(_0x349de6){return logger[_0x225444(0x192)](_0x225444(0x21b)+_0x387efe+':\x20'+_0x349de6),{'name':_0x387efe,'isJourneyLocal':![]};}},'resolveActivation':async _0x3a56cb=>{const _0x3b36e6=a155_0x5fe8,_0x24ad39=_0x5717c5['get'](_0x3a56cb);if(_0x24ad39!==undefined)return{'name':_0x24ad39,'isJourneyLocal':!![]};try{let _0x62ccc0=_0x21d2d2?.[_0x3b36e6(0x183)](_0x3a56cb);!_0x62ccc0&&(_0x62ccc0=await _0x446b1b[_0x3b36e6(0x203)][_0x3b36e6(0x160)](_0x4bf6ae,_0x3a56cb));const _0x50a5c5=_0x62ccc0[_0x3b36e6(0x213)][_0x3b36e6(0x191)][_0x3b36e6(0x208)]||_0x3a56cb,_0x284a42=sanitizeYamlKey(_0x50a5c5)||_0x3b36e6(0x1eb)+_0x3a56cb,_0x178b74=_0x284a42;_0x5717c5[_0x3b36e6(0x218)](_0x3a56cb,_0x178b74);const _0x46b255=journeyActivationStepToYaml(_0x62ccc0,_0x59876d,_0x30057d);return{'name':_0x178b74,'isJourneyLocal':!![],'definition':_0x46b255};}catch(_0xa11ddd){return logger[_0x3b36e6(0x192)](_0x3b36e6(0x144)+_0x3a56cb+':\x20'+_0xa11ddd),{'name':_0x3a56cb,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x534080,_0x4df3cc)=>resolveJumpTarget(_0x534080,_0x4df3cc,_0x5cc1ec,async _0x1747b4=>{const _0x414e7e=a155_0x5fe8,_0x3f8949=_0x2bc34d?.[_0x414e7e(0x183)](_0x1747b4);if(_0x3f8949)return _0x3f8949;return _0x446b1b['journey'][_0x414e7e(0x207)](_0x1747b4);})};return _0x572768=_0x225452,_0x225452;},_0x58fe83=async _0x36da95=>{const _0x276ff1=a155_0x5fe8,{collectSegmentIdsFromJourneyApi:_0x34fc73}=await import('./journey-yaml.js'),{batchAsync:_0x1a3407}=await import('../../utils/async.js'),_0x551411=new Set();for(const _0x4dcfaf of _0x36da95){let _0x5163ac=_0x2bc34d?.[_0x276ff1(0x183)](_0x4dcfaf);!_0x5163ac&&(_0x5163ac=await _0x446b1b['journey'][_0x276ff1(0x207)](_0x4dcfaf));const _0x4d4931=_0x34fc73(_0x5163ac);for(const _0x3ac158 of _0x4d4931){_0x551411[_0x276ff1(0x194)](_0x3ac158);}}let _0x51ea1b=Array[_0x276ff1(0x184)](_0x551411);while(_0x51ea1b[_0x276ff1(0x13c)]>0x0){const _0x30869e=_0x51ea1b['filter'](_0x300789=>!_0x5c56bf[_0x276ff1(0x1e3)](_0x300789));if(_0x30869e['length']===0x0)break;const _0x5d1956=await _0x1a3407(_0x30869e,async _0x52ef88=>{const _0x38d44b=_0x276ff1;_0x5c56bf[_0x38d44b(0x194)](_0x52ef88);const _0x40c5f2=await fetchSegment(_0x446b1b,_0x4b0802,_0x52ef88,_0x3c89e3);if(!_0x40c5f2)return null;return{'segmentId':_0x52ef88,'segment':_0x40c5f2};},0xa),_0x39b47f=new Set();for(const _0x4961ea of _0x5d1956){if(!_0x4961ea?.[_0x276ff1(0x1b8)]?.[_0x276ff1(0x20d)])continue;const _0x279112=apiRuleToYaml(_0x4961ea[_0x276ff1(0x1b8)]['rule']);_0x9a8bc6[_0x276ff1(0x218)](_0x4961ea[_0x276ff1(0x1e9)],_0x279112);const _0x472aa2=collectSegmentRefsFromRule(_0x279112);for(const _0x131eea of _0x472aa2){!_0x5c56bf[_0x276ff1(0x1e3)](_0x131eea)&&_0x39b47f[_0x276ff1(0x194)](_0x131eea);}}_0x51ea1b=Array[_0x276ff1(0x184)](_0x39b47f);}};return{'createYamlContext':_0xdfd418,'prefetchJourneySegments':_0x58fe83};}export async function executePushSegments(_0xaaf3ec,_0x264750,_0x550b9b,_0x481c90,_0x597c99){const _0x2e1096=a155_0x285d0a,{segmentDefToCreateRequest:_0x57be37,segmentDefToUpdateRequest:_0x356d43}=await import(_0x2e1096(0x1f2)),_0x5f3c5a=_0x550b9b['folderPathToId'],_0x30fd43=0x5,_0x4011f8=async _0x233c11=>{const _0x3f343e=_0x2e1096,_0x3b8335=_0x233c11[_0x3f343e(0x132)]?_0x5f3c5a['get'](_0x233c11[_0x3f343e(0x132)]):undefined;let _0x3a04e6;const _0x39a96b={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x29e46e=_0x233c11[_0x3f343e(0x12d)];if(_0x233c11[_0x3f343e(0x12d)][_0x3f343e(0x20d)]){const _0x5840b9=createSegmentIdResolver(_0x550b9b[_0x3f343e(0x1c1)],_0x233c11[_0x3f343e(0x12d)]['name']),_0x3ecfdd=await resolveRuleSegmentIds(_0x233c11['yamlConfig'][_0x3f343e(0x20d)],_0x5840b9);_0x29e46e={..._0x233c11[_0x3f343e(0x12d)],'rule':_0x3ecfdd};}try{if(_0x233c11[_0x3f343e(0x1f1)]){_0x597c99[_0x3f343e(0x181)]?.({'type':_0x3f343e(0x15e),'name':_0x233c11[_0x3f343e(0x12d)][_0x3f343e(0x208)]});const _0x4c77bb=_0x57be37(_0x29e46e,_0x3b8335),_0x15ba0e=await _0x597c99['withProgress'](_0x3f343e(0x1b1)+_0x233c11['yamlConfig']['name']+_0x3f343e(0x1a3),()=>_0xaaf3ec[_0x3f343e(0x1b8)][_0x3f343e(0x1dc)](_0x481c90['parentId'],_0x4c77bb));_0x3a04e6=_0x15ba0e[_0x3f343e(0x138)]['id'],_0x550b9b[_0x3f343e(0x1c1)][_0x3f343e(0x218)](_0x233c11[_0x3f343e(0x12d)]['name'],_0x3a04e6),_0x39a96b[_0x3f343e(0x1ba)]={'name':_0x233c11[_0x3f343e(0x12d)]['name'],'id':_0x3a04e6},_0x597c99[_0x3f343e(0x181)]?.({'type':_0x3f343e(0x1aa),'name':_0x233c11['yamlConfig'][_0x3f343e(0x208)],'segmentId':_0x3a04e6}),_0x597c99[_0x3f343e(0x201)]?.(_0x3f343e(0x179)+_0x233c11['yamlConfig']['name']+'\x27'),_0x39a96b[_0x3f343e(0x14c)]=0x1;}else{if(_0x233c11[_0x3f343e(0x1da)]){_0x597c99[_0x3f343e(0x181)]?.({'type':_0x3f343e(0x168),'name':_0x233c11[_0x3f343e(0x12d)][_0x3f343e(0x208)]});const _0x2e1e77=_0x356d43(_0x29e46e);_0x3b8335!==_0x233c11['existingSegment']?.[_0x3f343e(0x1ca)]&&(_0x2e1e77[_0x3f343e(0x1ca)]=_0x3b8335?parseInt(_0x3b8335,0xa):undefined),await _0x597c99[_0x3f343e(0x18d)](_0x3f343e(0x195)+_0x233c11['yamlConfig'][_0x3f343e(0x208)]+_0x3f343e(0x1a3),()=>_0xaaf3ec[_0x3f343e(0x1b8)][_0x3f343e(0x1ef)](_0x481c90['parentId'],_0x233c11[_0x3f343e(0x1e6)]['id'],_0x2e1e77)),_0x3a04e6=_0x233c11[_0x3f343e(0x1e6)]['id'],_0x597c99[_0x3f343e(0x181)]?.({'type':_0x3f343e(0x1ec),'name':_0x233c11[_0x3f343e(0x12d)][_0x3f343e(0x208)]}),_0x597c99[_0x3f343e(0x201)]?.(_0x3f343e(0x225)+_0x233c11[_0x3f343e(0x12d)][_0x3f343e(0x208)]+'\x27'),_0x39a96b['updated']=0x1;}else _0x3a04e6=_0x233c11[_0x3f343e(0x1e6)]['id'];}}catch(_0x291877){const _0x2d665b=isHttp400Error(_0x291877),_0x33f50b=_0x2d665b?ErrorCode['SEGMENT_SYNTAX_ERROR']:ErrorCode['SEGMENT_UPDATE_ERROR'],_0x492f85=getErrorMessage(_0x291877);throw new SDKError(_0x33f50b,_0x3f343e(0x1d4)+(_0x233c11[_0x3f343e(0x1f1)]?_0x3f343e(0x1a7):_0x3f343e(0x1a6))+'\x20segment\x20from\x20file:\x20'+_0x233c11[_0x3f343e(0x169)]+_0x3f343e(0x150)+_0x492f85,_0x291877);}try{const _0x5cf1a0=await syncActivationsForSegment(_0xaaf3ec,_0x481c90[_0x3f343e(0x216)],_0x3a04e6,_0x233c11[_0x3f343e(0x12d)][_0x3f343e(0x208)],_0x233c11['activationActions'],_0x597c99,_0x233c11['absolutePath']);_0x39a96b['activations']=_0x5cf1a0;}catch(_0x43f75a){if(_0x43f75a instanceof SDKError)throw _0x43f75a;throw new SDKError(ErrorCode[_0x3f343e(0x1fe)],'Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27'+_0x233c11[_0x3f343e(0x12d)]['name']+_0x3f343e(0x145)+_0x233c11[_0x3f343e(0x169)]+_0x3f343e(0x150)+getErrorMessage(_0x43f75a),_0x43f75a);}return _0x39a96b;},_0x3ac0ad=await batchAsync(_0x264750,_0x4011f8,_0x30fd43),_0x2f8295={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x37612f of _0x3ac0ad){_0x2f8295['created']+=_0x37612f[_0x2e1096(0x14c)],_0x2f8295['updated']+=_0x37612f[_0x2e1096(0x152)],_0x37612f[_0x2e1096(0x1ba)]&&_0x2f8295[_0x2e1096(0x173)][_0x2e1096(0x218)](_0x37612f[_0x2e1096(0x1ba)][_0x2e1096(0x208)],_0x37612f[_0x2e1096(0x1ba)]['id']),_0x2f8295[_0x2e1096(0x159)][_0x2e1096(0x14c)]+=_0x37612f[_0x2e1096(0x159)][_0x2e1096(0x14c)],_0x2f8295[_0x2e1096(0x159)]['updated']+=_0x37612f['activations']['updated'],_0x2f8295[_0x2e1096(0x159)]['deleted']+=_0x37612f['activations'][_0x2e1096(0x20b)];}return _0x2f8295;}async function syncActivationsForSegment(_0x2ded78,_0x42d5c9,_0x35766a,_0x26d4e8,_0x2f99cf,_0x1d2699,_0x2667c3){const _0x5d46f4=a155_0x285d0a,_0x165881={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x38fca7 of _0x2f99cf){try{if(_0x38fca7['type']===_0x5d46f4(0x1a7)&&_0x38fca7[_0x5d46f4(0x1fd)])_0x1d2699['onProgress']?.({'type':'activation_creating','segmentName':_0x26d4e8,'activationName':_0x38fca7[_0x5d46f4(0x208)]}),await _0x1d2699['withProgress'](_0x5d46f4(0x15b)+_0x38fca7['name']+_0x5d46f4(0x1a3),()=>_0x2ded78[_0x5d46f4(0x1b8)]['createActivation'](_0x42d5c9,_0x35766a,_0x38fca7[_0x5d46f4(0x1fd)])),_0x1d2699['onProgress']?.({'type':_0x5d46f4(0x14d),'segmentName':_0x26d4e8,'activationName':_0x38fca7[_0x5d46f4(0x208)]}),_0x1d2699[_0x5d46f4(0x201)]?.(_0x5d46f4(0x1c0)+_0x38fca7[_0x5d46f4(0x208)]+'\x27'),_0x165881[_0x5d46f4(0x14c)]++;else{if(_0x38fca7[_0x5d46f4(0x140)]===_0x5d46f4(0x1a6)&&_0x38fca7['validatedRequest']&&_0x38fca7['existingActivation'])_0x1d2699[_0x5d46f4(0x181)]?.({'type':'activation_updating','segmentName':_0x26d4e8,'activationName':_0x38fca7[_0x5d46f4(0x208)]}),await _0x1d2699[_0x5d46f4(0x18d)](_0x5d46f4(0x1c4)+_0x38fca7[_0x5d46f4(0x208)]+'\x27...',()=>_0x2ded78[_0x5d46f4(0x1b8)][_0x5d46f4(0x1d6)](_0x42d5c9,_0x35766a,_0x38fca7[_0x5d46f4(0x1a1)]['id'],_0x38fca7[_0x5d46f4(0x1fd)])),_0x1d2699['onProgress']?.({'type':_0x5d46f4(0x215),'segmentName':_0x26d4e8,'activationName':_0x38fca7['name']}),_0x1d2699[_0x5d46f4(0x201)]?.('Updated\x20activation\x20\x27'+_0x38fca7['name']+'\x27'),_0x165881[_0x5d46f4(0x152)]++;else _0x38fca7[_0x5d46f4(0x140)]===_0x5d46f4(0x1e2)&&_0x38fca7['existingActivation']&&(_0x1d2699[_0x5d46f4(0x181)]?.({'type':_0x5d46f4(0x1f0),'segmentName':_0x26d4e8,'activationName':_0x38fca7[_0x5d46f4(0x208)]}),await _0x1d2699[_0x5d46f4(0x18d)](_0x5d46f4(0x17d)+_0x38fca7[_0x5d46f4(0x208)]+_0x5d46f4(0x1a3),()=>_0x2ded78['segment']['deleteActivation'](_0x42d5c9,_0x35766a,_0x38fca7[_0x5d46f4(0x1a1)]['id'])),_0x1d2699[_0x5d46f4(0x181)]?.({'type':'activation_deleted','segmentName':_0x26d4e8,'activationName':_0x38fca7['name']}),_0x1d2699[_0x5d46f4(0x1b7)]?.('Deleted\x20activation\x20\x27'+_0x38fca7['name']+'\x27'),_0x165881[_0x5d46f4(0x20b)]++);}}catch(_0x4a52d5){const _0x3bf543=isHttp400Error(_0x4a52d5),_0x26490c=_0x3bf543?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode[_0x5d46f4(0x1fe)],_0x2dc546=getErrorMessage(_0x4a52d5);throw new SDKError(_0x26490c,_0x5d46f4(0x1d4)+_0x38fca7[_0x5d46f4(0x140)]+_0x5d46f4(0x1bb)+_0x38fca7[_0x5d46f4(0x208)]+'\x27\x20from\x20file:\x20'+_0x2667c3+_0x5d46f4(0x150)+_0x2dc546,_0x4a52d5);}}return _0x165881;}export async function executePushFolders(_0x111432,_0x30e923,_0x1fea96,_0x10d90e,_0x3befb3){const _0x161930=a155_0x285d0a,_0x41c2a9=new Map(_0x1fea96),_0x160f81=sortFoldersByDepth(_0x30e923);for(const _0x4d3354 of _0x160f81){const _0x46fb1f=_0x4d3354['split']('/'),_0x5ece1e=_0x46fb1f[_0x46fb1f[_0x161930(0x13c)]-0x1],_0x7027b3=_0x46fb1f['slice'](0x0,-0x1)[_0x161930(0x153)]('/'),_0x4b2b97=_0x41c2a9['get'](_0x7027b3);_0x3befb3[_0x161930(0x181)]?.({'type':_0x161930(0x17e),'folder':_0x4d3354});const _0x130304={'name':_0x5ece1e,'parentFolderId':_0x4b2b97},_0x2ca557=await _0x3befb3[_0x161930(0x18d)](_0x161930(0x13a)+_0x4d3354+_0x161930(0x1a3),()=>_0x111432[_0x161930(0x1b8)][_0x161930(0x229)](_0x10d90e['parentId'],_0x130304));_0x41c2a9[_0x161930(0x218)](_0x4d3354,_0x2ca557['data']['id']),_0x3befb3['onProgress']?.({'type':'folder_created','folder':_0x4d3354,'folderId':_0x2ca557[_0x161930(0x138)]['id']}),_0x3befb3[_0x161930(0x171)]?.(_0x161930(0x20e)+_0x4d3354+'\x27');}return _0x41c2a9;}export async function executePushSegmentDeletions(_0x9bf528,_0x5c8d2d,_0x590e42){const _0x33b115=a155_0x285d0a;if(_0x5c8d2d[_0x33b115(0x13c)]===0x0)return 0x0;const {batchAsync:_0x5abd5e}=await import(_0x33b115(0x170)),_0x239b7d=0x5,_0xa3abe6=await _0x5abd5e(_0x5c8d2d,async _0x59e41b=>{const _0x335820=_0x33b115;return _0x590e42[_0x335820(0x181)]?.({'type':'segment_deleting','name':_0x59e41b[_0x335820(0x208)]}),await _0x9bf528[_0x335820(0x1b8)][_0x335820(0x148)](_0x59e41b['id']),_0x590e42[_0x335820(0x181)]?.({'type':_0x335820(0x16b),'name':_0x59e41b[_0x335820(0x208)]}),_0x590e42[_0x335820(0x1b7)]?.(_0x335820(0x1e7)+_0x59e41b[_0x335820(0x208)]+'\x27'),0x1;},_0x239b7d);return _0xa3abe6[_0x33b115(0x1a2)]((_0x391d57,_0xdc708f)=>_0x391d57+_0xdc708f,0x0);}export async function executePushJourneys(_0x3f09ba,_0x3f3266,_0x2f4621,_0x5dd9ac,_0x487922){const _0x27ea0d=a155_0x285d0a,{journeyDefToRequest:_0x1c9925}=await import('./journey-yaml.js'),{activationDefToCreateRequest:_0x384ce6,yamlRuleToApi:_0x424bf9,validateSegmentRule:_0x557f1c}=await import(_0x27ea0d(0x1f2)),_0x453dc1={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x1b9a5e=new Map(_0x2f4621[_0x27ea0d(0x1c1)]),_0x8585e=0x5;for(let _0x1a0c90=0x0;_0x1a0c90<_0x3f3266[_0x27ea0d(0x13c)];_0x1a0c90+=_0x8585e){const _0x4caa1b=_0x3f3266['slice'](_0x1a0c90,_0x1a0c90+_0x8585e),_0x15b882=await Promise[_0x27ea0d(0x1df)](_0x4caa1b[_0x27ea0d(0x21f)](async _0x2b3728=>{const _0x517443=_0x27ea0d;if(!_0x2b3728[_0x517443(0x1f1)]&&!_0x2b3728[_0x517443(0x1da)])return{'action':_0x517443(0x200),'name':_0x2b3728[_0x517443(0x12d)][_0x517443(0x208)],'journeyId':_0x2b3728['existingJourney']?.['id']};const _0x239bea=_0x2b3728[_0x517443(0x132)]?_0x2f4621[_0x517443(0x143)]['get'](_0x2b3728[_0x517443(0x132)]):undefined;_0x487922['onProgress']?.({'type':_0x2b3728[_0x517443(0x1f1)]?'journey_creating':_0x517443(0x19d),'name':_0x2b3728[_0x517443(0x12d)]['name']});try{const _0x160273=await executeSingleJourneyPush(_0x3f09ba,_0x2b3728,{..._0x2f4621,'segmentNameToId':_0x1b9a5e},{'parentId':_0x5dd9ac[_0x517443(0x216)],'rootFolderId':_0x5dd9ac[_0x517443(0x1c3)],'folderId':_0x239bea,'verbose':_0x5dd9ac[_0x517443(0x1d1)]},_0x487922,{'journeyDefToRequest':_0x1c9925,'activationDefToCreateRequest':_0x384ce6,'yamlRuleToApi':_0x424bf9,'validateSegmentRule':_0x557f1c});for(const [_0xa5d9c5,_0x5f1e0d]of _0x160273[_0x517443(0x14e)]){_0x1b9a5e['set'](_0xa5d9c5,_0x5f1e0d),_0x453dc1[_0x517443(0x14e)][_0x517443(0x218)](_0xa5d9c5,_0x5f1e0d);}if(_0x160273[_0x517443(0x222)]==='created')_0x487922['onProgress']?.({'type':_0x517443(0x1f8),'name':_0x2b3728['yamlConfig']['name'],'journeyId':_0x160273[_0x517443(0x1c7)]}),_0x487922['logSuccess']?.(_0x517443(0x16e)+_0x2b3728[_0x517443(0x12d)][_0x517443(0x208)]+'\x27'),_0x453dc1[_0x517443(0x14c)]++;else _0x160273[_0x517443(0x222)]===_0x517443(0x152)&&(_0x487922['onProgress']?.({'type':_0x517443(0x182),'name':_0x2b3728[_0x517443(0x12d)][_0x517443(0x208)]}),_0x487922[_0x517443(0x201)]?.(_0x517443(0x1cf)+_0x2b3728['yamlConfig']['name']+'\x27'),_0x453dc1[_0x517443(0x152)]++);return{'action':_0x160273[_0x517443(0x222)],'name':_0x2b3728['yamlConfig']['name'],'journeyId':_0x160273[_0x517443(0x1c7)]};}catch(_0x4f8ebc){const _0x4bf425=isHttp400Error(_0x4f8ebc),_0x1d00a3=_0x4bf425?ErrorCode[_0x517443(0x12f)]:ErrorCode[_0x517443(0x19a)],_0x39b2db=getErrorMessage(_0x4f8ebc);throw new SDKError(_0x1d00a3,'Failed\x20to\x20'+(_0x2b3728[_0x517443(0x1f1)]?_0x517443(0x1a7):_0x517443(0x1a6))+'\x20journey\x20from\x20file:\x20'+_0x2b3728[_0x517443(0x169)]+_0x517443(0x150)+_0x39b2db,_0x4f8ebc);}}));_0x453dc1[_0x27ea0d(0x190)][_0x27ea0d(0x189)](..._0x15b882);}return _0x453dc1;}async function matchExistingJourneySegments(_0xc9dbc7,_0x2605bd,_0xfddc80,_0x557c08,_0x39e32e){const _0x3a4ec1=a155_0x285d0a;if(!_0x2605bd[_0x3a4ec1(0x14b)]||!_0x2605bd[_0x3a4ec1(0x12d)]['segments'])return;const _0x4a7129=new Map(),_0x10e2c7=new Set();for(const _0x515ecc of Object[_0x3a4ec1(0x175)](_0x2605bd['yamlConfig'][_0x3a4ec1(0x18a)])){const _0x41db88=generateDeterministicJourneySegmentName(_0x2605bd[_0x3a4ec1(0x12d)][_0x3a4ec1(0x208)],_0x515ecc);_0x4a7129[_0x3a4ec1(0x218)](_0x41db88,_0x515ecc),_0x10e2c7[_0x3a4ec1(0x194)](_0x515ecc);}const _0x409b92=[],_0x80ae9d=collectSegmentIdsFromJourneyApi(_0x2605bd[_0x3a4ec1(0x14b)]);for(const _0x28f5f2 of _0x80ae9d){const _0x5f10c5=await fetchSegment(_0xc9dbc7,_0xfddc80,_0x28f5f2,_0x557c08);if(!_0x5f10c5?.['name'])continue;const _0x12413d=_0x4a7129['get'](_0x5f10c5[_0x3a4ec1(0x208)]);_0x12413d?(_0x39e32e[_0x3a4ec1(0x218)](_0x12413d,_0x28f5f2),_0x10e2c7[_0x3a4ec1(0x1e2)](_0x12413d)):_0x409b92[_0x3a4ec1(0x189)]({'id':_0x28f5f2,'seg':_0x5f10c5});}if(_0x10e2c7[_0x3a4ec1(0x165)]>0x0&&_0x409b92['length']>0x0){const {localExpandedRuleToNames:_0x561bdc}=buildLocalExpandedRuleMappings(_0x2605bd[_0x3a4ec1(0x12d)]),_0x3665ad=new Map();for(const {id:_0x311f25,seg:_0x342985}of _0x409b92){if(_0x342985[_0x3a4ec1(0x20d)]){const _0x202962=apiRuleToYaml(_0x342985['rule']);_0x3665ad[_0x3a4ec1(0x218)](_0x311f25,_0x202962);}}for(const {id:_0x238d07,seg:_0x43dfd8}of _0x409b92){if(!_0x43dfd8[_0x3a4ec1(0x20d)])continue;const _0x1ebc5c=_0x3665ad['get'](_0x238d07);if(!_0x1ebc5c)continue;const _0x83f8e6=serializeExpandedRule(_0x1ebc5c,_0x3665ad),_0x836678=_0x561bdc[_0x3a4ec1(0x183)](_0x83f8e6);if(_0x836678){const _0x5bc64f=_0x836678['find'](_0x22f1fd=>_0x10e2c7[_0x3a4ec1(0x1e3)](_0x22f1fd));_0x5bc64f&&(_0x39e32e['set'](_0x5bc64f,_0x238d07),_0x10e2c7[_0x3a4ec1(0x1e2)](_0x5bc64f),logger[_0x3a4ec1(0x192)](_0x3a4ec1(0x1d8)+_0x43dfd8[_0x3a4ec1(0x208)]+_0x3a4ec1(0x18c)+_0x5bc64f+_0x3a4ec1(0x12a)));}}}}async function executeSingleJourneyPush(_0x2abe39,_0x3c04f1,_0xc4916b,_0x8ff234,_0x3e94ec,_0x448ae1){const _0x4e7c2e=a155_0x285d0a,{journeyDefToRequest:_0xbeed8b,activationDefToCreateRequest:_0x361f05,yamlRuleToApi:_0x5abfbf,validateSegmentRule:_0x8c00c4}=_0x448ae1,_0x3afa63=new Map(),_0x3c3efc=new Map();recoverSegmentIdsFromPushRecovery(_0x3c04f1,_0x3afa63,_0xc4916b['segmentNameToId']);const _0x1f6d27=new Map(),_0x23aeb9=new Map(),_0xaa6fc0=new Map();let _0x1828f5;const _0x5598e9=async()=>{const _0x43595e=a155_0x5fe8;if(_0x1828f5)return;_0x1828f5=new Map();if(!_0x3c04f1[_0x43595e(0x14b)])return;const _0x581a18=await _0x2abe39[_0x43595e(0x203)][_0x43595e(0x17c)](_0x3c04f1['existingJourney']['id']);for(const _0x2d2e12 of _0x581a18){const _0x484c18=journeyActivationStepToYaml(_0x2d2e12,_0xc4916b[_0x43595e(0x16a)],_0xc4916b[_0x43595e(0x220)]),_0x118720=activationSignature(_0x484c18);!_0x1828f5[_0x43595e(0x1e3)](_0x118720)&&_0x1828f5[_0x43595e(0x218)](_0x118720,_0x2d2e12['id']),_0x484c18[_0x43595e(0x208)]&&_0x3c3efc[_0x43595e(0x218)](_0x484c18[_0x43595e(0x208)],_0x2d2e12['id']);}};await matchExistingJourneySegments(_0x2abe39,_0x3c04f1,_0x8ff234[_0x4e7c2e(0x216)],_0xc4916b[_0x4e7c2e(0x1dd)],_0xc4916b[_0x4e7c2e(0x1c1)]);const _0x4769c5={'resolveSegmentId':async _0x30365c=>{const _0x14fbb4=_0x4e7c2e,_0x518fd2=_0xc4916b['segmentNameToId'][_0x14fbb4(0x183)](_0x30365c);if(!_0x518fd2)throw new SDKError(ErrorCode[_0x14fbb4(0x1fb)],_0x14fbb4(0x1fa)+_0x30365c+_0x14fbb4(0x1c8)+_0x3c04f1[_0x14fbb4(0x12d)][_0x14fbb4(0x208)]+')');return _0x518fd2;},'resolveEmbeddedSegmentId':async(_0x6bfa7a,_0x1d572b)=>{const _0xdc7785=_0x4e7c2e,_0x2324d0=_0xc4916b[_0xdc7785(0x1c1)][_0xdc7785(0x183)](_0x6bfa7a);if(_0x2324d0)return _0x2324d0;const _0x1618c9=_0xc4916b[_0xdc7785(0x1dd)]['find'](_0x38de5a=>_0x38de5a[_0xdc7785(0x208)]===_0x6bfa7a);if(_0x1618c9)return _0xc4916b[_0xdc7785(0x1c1)][_0xdc7785(0x218)](_0x6bfa7a,_0x1618c9['id']),_0x1618c9['id'];if(_0x3c04f1[_0xdc7785(0x1f1)]){const {stageName:_0x56cdf4,criteriaName:_0x1304c4}=findSegmentCriteriaLocation(_0x3c04f1[_0xdc7785(0x12d)],_0x6bfa7a);return _0x8c00c4(_0x6bfa7a,_0x1d572b['rule']),_0x23aeb9[_0xdc7785(0x218)](_0x6bfa7a,{'definition':_0x1d572b,'stageName':_0x56cdf4,'criteriaName':_0x1304c4}),createPendingSegmentId(_0x6bfa7a);}const _0x1c87dd=_0x3c04f1[_0xdc7785(0x14b)]?.['id'];if(!_0x1c87dd)throw new SDKError(ErrorCode[_0xdc7785(0x1bf)],_0xdc7785(0x19f));const _0x4c82ec=_0x1f6d27[_0xdc7785(0x183)](_0x6bfa7a);if(_0x4c82ec)return _0x4c82ec;const _0x423261=((async()=>{const _0x2df7d5=_0xdc7785;_0x8c00c4(_0x6bfa7a,_0x1d572b[_0x2df7d5(0x20d)]);const _0x263cfa=generateDeterministicJourneySegmentName(_0x3c04f1['yamlConfig'][_0x2df7d5(0x208)],_0x6bfa7a),_0x46e498=_0xc4916b[_0x2df7d5(0x1dd)][_0x2df7d5(0x176)](_0x1a1b17=>_0x1a1b17[_0x2df7d5(0x208)]===_0x263cfa),_0x2a2b9c=createSegmentIdResolver(_0xc4916b[_0x2df7d5(0x1c1)],_0x6bfa7a),_0x4c0f4c=await resolveRuleSegmentIds(_0x1d572b[_0x2df7d5(0x20d)],_0x2a2b9c);let _0x11b3a8;return _0x46e498?(await _0x2abe39[_0x2df7d5(0x1b8)][_0x2df7d5(0x1ef)](_0x8ff234['parentId'],_0x46e498['id'],{'description':_0x1d572b[_0x2df7d5(0x1a8)]||'Entry\x20criteria:\x20'+_0x6bfa7a,'rule':_0x5abfbf(_0x4c0f4c),'countPopulation':!![]}),_0x11b3a8=_0x46e498['id'],saveSegmentToPushRecovery(_0x3c04f1['absolutePath'],_0x3c04f1[_0x2df7d5(0x12d)]['name'],_0x6bfa7a,{'segmentId':_0x11b3a8,'uniqueServerName':_0x263cfa,'createdAt':new Date()[_0x2df7d5(0x217)]()})):_0x11b3a8=await createOrRecoverEmbeddedSegment(_0x2abe39,_0x3c04f1,{'localName':_0x6bfa7a,'uniqueSegmentName':_0x263cfa,'description':_0x1d572b[_0x2df7d5(0x1a8)]||_0x2df7d5(0x1d9)+_0x6bfa7a,'journeyId':_0x1c87dd,'resolvedRule':_0x4c0f4c,'parentId':_0x8ff234['parentId'],'folderId':_0x8ff234[_0x2df7d5(0x1c3)]||''},_0x5abfbf),_0xc4916b['segmentNameToId'][_0x2df7d5(0x218)](_0x6bfa7a,_0x11b3a8),_0x3afa63[_0x2df7d5(0x218)](_0x6bfa7a,_0x11b3a8),_0x11b3a8;})());_0x1f6d27[_0xdc7785(0x218)](_0x6bfa7a,_0x423261);try{return await _0x423261;}finally{_0x1f6d27['delete'](_0x6bfa7a);}},'resolveActivationId':async _0x487ab3=>{const _0xdf7265=_0x4e7c2e,_0x53eadb=_0x3c3efc[_0xdf7265(0x183)](_0x487ab3);if(_0x53eadb)return _0x53eadb;if(_0x3c04f1[_0xdf7265(0x14b)]){await _0x5598e9();const _0x1caf78=_0x3c3efc[_0xdf7265(0x183)](_0x487ab3);if(_0x1caf78)return _0x1caf78;}throw new SDKError(ErrorCode[_0xdf7265(0x158)],_0xdf7265(0x1ce)+_0x487ab3+_0xdf7265(0x1c8)+_0x3c04f1[_0xdf7265(0x12d)][_0xdf7265(0x208)]+_0xdf7265(0x142)+_0xdf7265(0x1bd));},'resolveEmbeddedActivationId':async(_0xcc899c,_0x4a350f)=>{const _0x323a8d=_0x4e7c2e,_0x5bc986=_0x3c3efc[_0x323a8d(0x183)](_0xcc899c);if(_0x5bc986)return _0x5bc986;if(_0x3c04f1[_0x323a8d(0x1f1)])return _0xaa6fc0['set'](_0xcc899c,_0x4a350f),createPendingActivationId(_0xcc899c);if(_0x3c04f1[_0x323a8d(0x14b)]){await _0x5598e9();const _0x25ec63=_0x3c3efc[_0x323a8d(0x183)](_0x4a350f[_0x323a8d(0x208)]);if(_0x25ec63)return _0x3c3efc[_0x323a8d(0x218)](_0xcc899c,_0x25ec63),_0x25ec63;const _0x593c64=activationSignature(_0x4a350f),_0x4b4a35=_0x1828f5?.[_0x323a8d(0x183)](_0x593c64);if(_0x4b4a35)return _0x3c3efc[_0x323a8d(0x218)](_0xcc899c,_0x4b4a35),_0x4b4a35;const _0x105204=await _0x361f05(_0x4a350f,_0xc4916b[_0x323a8d(0x129)]),_0x53150b={..._0x105204,..._0x4a350f[_0x323a8d(0x12b)]!==undefined&&{'runAfterJourneyRefresh':_0x4a350f[_0x323a8d(0x12b)]}},_0x431dd0=await _0x2abe39[_0x323a8d(0x203)]['createActivation'](_0x3c04f1[_0x323a8d(0x14b)]['id'],_0x53150b);return _0x3c3efc[_0x323a8d(0x218)](_0xcc899c,_0x431dd0['id']),_0x431dd0['id'];}throw new SDKError(ErrorCode[_0x323a8d(0x1bf)],_0x323a8d(0x1ea));},'resolveJourneyId':async _0x39c15a=>{const _0x3c4776=_0x4e7c2e;try{return await _0x2abe39['journey'][_0x3c4776(0x19c)](_0x8ff234[_0x3c4776(0x216)],_0x39c15a);}catch(_0x563d7b){throw new SDKError(ErrorCode[_0x3c4776(0x158)],_0x3c4776(0x20c)+_0x39c15a+'\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27'+_0x3c04f1['yamlConfig']['name']+'\x27)',_0x563d7b);}},'resolveStageId':async(_0xa79312,_0x43007f)=>{const _0x4586c5=_0x4e7c2e,_0x1c08fc=await _0x2abe39[_0x4586c5(0x203)][_0x4586c5(0x207)](_0xa79312),_0x2a3654=_0x1c08fc[_0x4586c5(0x213)][_0x4586c5(0x15a)][_0x4586c5(0x176)](_0x3c8f92=>_0x3c8f92[_0x4586c5(0x208)][_0x4586c5(0x1e8)]()===_0x43007f[_0x4586c5(0x1e8)]());if(!_0x2a3654?.['id'])throw new SDKError(ErrorCode[_0x4586c5(0x158)],_0x4586c5(0x1ee)+_0x43007f+'\x27\x20not\x20found\x20in\x20journey\x20\x27'+(_0x1c08fc[_0x4586c5(0x213)][_0x4586c5(0x172)]||_0x1c08fc[_0x4586c5(0x213)]['name'])+'\x27');return _0x2a3654['id'];}},_0x5039d4=await _0xbeed8b(_0x3c04f1[_0x4e7c2e(0x12d)],_0x8ff234['parentId'],_0x4769c5),_0x321a40=_0x8ff234[_0x4e7c2e(0x199)]||_0x8ff234[_0x4e7c2e(0x1c3)];_0x321a40&&(_0x5039d4[_0x4e7c2e(0x14a)]={'parentFolder':{'data':{'id':_0x321a40,'type':_0x4e7c2e(0x196)}}});if(_0x3c04f1['isNew']){if(_0x23aeb9[_0x4e7c2e(0x165)]>0x0||_0xaa6fc0['size']>0x0)return await executeThreeStepJourneyCreate(_0x2abe39,_0x3c04f1,_0x5039d4,{'pendingEmbeddedSegments':_0x23aeb9,'pendingEmbeddedActivations':_0xaa6fc0,'embeddedSegmentNameToId':_0x3afa63,'journeyActivationNameToId':_0x3c3efc},{..._0x8ff234,'effectiveFolderId':_0x321a40},_0xc4916b,_0x3e94ec,_0x448ae1);else{ensureJourneyDefaults(_0x5039d4[_0x4e7c2e(0x213)]);const _0xa13e79=await _0x2abe39['journey'][_0x4e7c2e(0x1a7)](_0x5039d4);return deletePushRecovery(_0x3c04f1[_0x4e7c2e(0x169)]),{'action':'created','journeyId':_0xa13e79['id'],'embeddedSegmentNameToId':_0x3afa63};}}else{if(_0x3c04f1[_0x4e7c2e(0x1da)]&&_0x3c04f1['existingJourney']){_0x5039d4['id']=_0x3c04f1[_0x4e7c2e(0x14b)]['id'];const _0x41e967=_0x5039d4[_0x4e7c2e(0x213)];_0x3c04f1['existingJourney'][_0x4e7c2e(0x213)]?.[_0x4e7c2e(0x172)]&&(_0x41e967[_0x4e7c2e(0x172)]=_0x3c04f1[_0x4e7c2e(0x14b)][_0x4e7c2e(0x213)]['journeyBundleName']);const _0x1342d2=_0x3c04f1['existingJourney'][_0x4e7c2e(0x213)]?.[_0x4e7c2e(0x15a)];return _0x1342d2&&_0x5039d4[_0x4e7c2e(0x213)][_0x4e7c2e(0x15a)]&&injectExistingStageIds(_0x5039d4[_0x4e7c2e(0x213)][_0x4e7c2e(0x15a)],_0x1342d2),ensureJourneyDefaults(_0x41e967),await _0x2abe39['journey'][_0x4e7c2e(0x1a6)](_0x3c04f1[_0x4e7c2e(0x14b)]['id'],_0x5039d4),deletePushRecovery(_0x3c04f1['absolutePath']),{'action':_0x4e7c2e(0x152),'journeyId':_0x3c04f1[_0x4e7c2e(0x14b)]['id'],'embeddedSegmentNameToId':_0x3afa63};}}return deletePushRecovery(_0x3c04f1['absolutePath']),{'action':_0x4e7c2e(0x200),'journeyId':_0x3c04f1[_0x4e7c2e(0x14b)]?.['id'],'embeddedSegmentNameToId':_0x3afa63};}function findSegmentCriteriaLocation(_0x38dd33,_0x27d7a7){const _0xbe6a56=a155_0x285d0a,_0x915e79=_0x38dd33['stages']||_0x38dd33[_0xbe6a56(0x166)]?.[0x0]?.[_0xbe6a56(0x1f9)]||[];let _0x1e14f0='entry',_0x47cac5=_0x27d7a7;const _0x1067d4=_0x38dd33[_0xbe6a56(0x198)]||_0x38dd33[_0xbe6a56(0x166)]?.[0x0]?.[_0xbe6a56(0x198)];if(_0x1067d4?.[_0xbe6a56(0x1b8)]===_0x27d7a7)return{'stageName':_0xbe6a56(0x198),'criteriaName':_0x1067d4['name']||_0x27d7a7};_0x31e475:for(const _0x556ddd of _0x915e79){if(_0x556ddd['entry_criteria']?.[_0xbe6a56(0x1b8)]===_0x27d7a7){_0x1e14f0=_0x556ddd[_0xbe6a56(0x208)],_0x47cac5=_0x556ddd[_0xbe6a56(0x1a9)]['name']||_0x27d7a7;break;}if(_0x556ddd[_0xbe6a56(0x1ff)])for(const _0x4059d6 of _0x556ddd[_0xbe6a56(0x1ff)]){if(_0x4059d6[_0xbe6a56(0x140)]===_0xbe6a56(0x174)&&_0x4059d6[_0xbe6a56(0x1a5)]?.[_0xbe6a56(0x19b)])for(const _0x423358 of _0x4059d6['with'][_0xbe6a56(0x19b)]){if(_0x423358[_0xbe6a56(0x1b8)]===_0x27d7a7){_0x1e14f0=_0x556ddd[_0xbe6a56(0x208)],_0x47cac5=_0x423358['name']||_0x27d7a7;break _0x31e475;}}}}return{'stageName':_0x1e14f0,'criteriaName':_0x47cac5};}async function executeThreeStepJourneyCreate(_0x38b966,_0x32fa11,_0x3a2b4e,_0x57634d,_0x52ac1b,_0x2a9a96,_0x2f9442,_0x1332bd){const _0x4136fa=a155_0x285d0a,{activationDefToCreateRequest:_0x391dac,yamlRuleToApi:_0xe50f93}=_0x1332bd,{pendingEmbeddedSegments:_0x123194,pendingEmbeddedActivations:_0x40c3b2,embeddedSegmentNameToId:_0x487171}=_0x57634d,_0x22b670=JSON[_0x4136fa(0x17b)](JSON[_0x4136fa(0x1de)](_0x3a2b4e));ensureJourneyDefaults(_0x22b670[_0x4136fa(0x213)]),stripPendingIds(_0x22b670);const _0x4f86f2=await _0x38b966['journey']['create'](_0x22b670),_0x2f5638=_0x4f86f2['id'],_0x3f15ec=new Map();for(const _0x4f67ea of _0x4f86f2[_0x4136fa(0x213)]['journeyStages']){_0x3f15ec[_0x4136fa(0x218)](_0x4f67ea[_0x4136fa(0x208)][_0x4136fa(0x1e8)](),_0x4f67ea['id']);}recoverSegmentIdsFromPushRecovery(_0x32fa11,_0x487171,_0x2a9a96['segmentNameToId']);for(const [_0x3ed83a,{definition:_0x4e30ca}]of _0x123194){if(_0x487171['has'](_0x3ed83a)){_0x2f9442[_0x4136fa(0x181)]?.({'type':_0x4136fa(0x136),'journeyName':_0x32fa11[_0x4136fa(0x12d)][_0x4136fa(0x208)],'segmentName':_0x3ed83a});continue;}const _0x55555d=generateDeterministicJourneySegmentName(_0x32fa11[_0x4136fa(0x12d)][_0x4136fa(0x208)],_0x3ed83a);_0x2f9442['onProgress']?.({'type':_0x4136fa(0x202),'journeyName':_0x32fa11[_0x4136fa(0x12d)]['name'],'segmentName':_0x3ed83a});const _0x36f7de=createSegmentIdResolver(_0x2a9a96[_0x4136fa(0x1c1)],_0x3ed83a),_0x23b294=await resolveRuleSegmentIds(_0x4e30ca[_0x4136fa(0x20d)],_0x36f7de),_0x99c479=await createOrRecoverEmbeddedSegment(_0x38b966,_0x32fa11,{'localName':_0x3ed83a,'uniqueSegmentName':_0x55555d,'description':_0x4e30ca['description']||'Entry\x20criteria:\x20'+_0x3ed83a,'journeyId':_0x2f5638,'resolvedRule':_0x23b294,'parentId':_0x52ac1b[_0x4136fa(0x216)],'folderId':_0x52ac1b[_0x4136fa(0x214)]||''},_0xe50f93);_0x487171[_0x4136fa(0x218)](_0x3ed83a,_0x99c479),_0x2a9a96['segmentNameToId']['set'](_0x3ed83a,_0x99c479),_0x2f9442[_0x4136fa(0x181)]?.({'type':_0x4136fa(0x136),'journeyName':_0x32fa11[_0x4136fa(0x12d)][_0x4136fa(0x208)],'segmentName':_0x3ed83a});}const _0x320663=new Map();for(const [_0x4e651d,_0x4a4d9]of _0x40c3b2){_0x2f9442[_0x4136fa(0x181)]?.({'type':_0x4136fa(0x22a),'journeyName':_0x32fa11['yamlConfig'][_0x4136fa(0x208)],'activationName':_0x4e651d});const _0x3a259e=await _0x391dac(_0x4a4d9,_0x2a9a96[_0x4136fa(0x129)]),_0x5f309a={..._0x3a259e,..._0x4a4d9[_0x4136fa(0x12b)]!==undefined&&{'runAfterJourneyRefresh':_0x4a4d9[_0x4136fa(0x12b)]}},_0x18b380=await _0x38b966[_0x4136fa(0x203)][_0x4136fa(0x1e4)](_0x2f5638,_0x5f309a);_0x320663[_0x4136fa(0x218)](_0x4e651d,_0x18b380['id']),_0x57634d['journeyActivationNameToId']['set'](_0x4e651d,_0x18b380['id']),_0x2f9442[_0x4136fa(0x181)]?.({'type':_0x4136fa(0x1cc),'journeyName':_0x32fa11['yamlConfig'][_0x4136fa(0x208)],'activationName':_0x4e651d});}const _0x55c885=JSON['parse'](JSON[_0x4136fa(0x1de)](_0x3a2b4e));return _0x55c885['id']=_0x2f5638,ensureJourneyDefaults(_0x55c885[_0x4136fa(0x213)]),resolvePendingIdsInRequest(_0x55c885,_0x3a2b4e,_0x3f15ec,_0x487171,_0x320663,_0x2f9442),await _0x38b966[_0x4136fa(0x203)][_0x4136fa(0x1a6)](_0x2f5638,_0x55c885),deletePushRecovery(_0x32fa11[_0x4136fa(0x169)]),{'action':'created','journeyId':_0x2f5638,'embeddedSegmentNameToId':_0x487171};}export function stripWaitStepPendingIds(_0xd46200){const _0x1a9548=a155_0x285d0a,_0x3a8dda=_0xd46200[_0x1a9548(0x20f)]&&isPendingSegmentId(_0xd46200[_0x1a9548(0x20f)]),_0x18a07e=_0xd46200[_0x1a9548(0x1d5)]?.[_0x1a9548(0x1ad)](_0x24a6b4=>_0x24a6b4[_0x1a9548(0x1e9)]&&isPendingSegmentId(_0x24a6b4[_0x1a9548(0x1e9)]));(_0x3a8dda||_0x18a07e)&&(_0xd46200[_0x1a9548(0x21e)]=_0x1a9548(0x163),_0xd46200[_0x1a9548(0x221)]=0x1,_0xd46200[_0x1a9548(0x177)]=_0x1a9548(0x206),delete _0xd46200['conditionSegmentId'],delete _0xd46200['conditionTimeoutDuration'],delete _0xd46200[_0x1a9548(0x187)],delete _0xd46200[_0x1a9548(0x1d5)]);}export function resolveWaitStepPendingIds(_0xfa617d,_0x487a3f,_0x50b3cc,_0x3496ef){const _0x5bd768=a155_0x285d0a;if(_0x487a3f[_0x5bd768(0x20f)]&&isPendingSegmentId(_0x487a3f[_0x5bd768(0x20f)])){const _0x5c2eff=_0x50b3cc(_0x487a3f[_0x5bd768(0x20f)],_0x5bd768(0x1d3)+_0x3496ef+_0x5bd768(0x186));_0x5c2eff&&(_0xfa617d['waitStepType']=_0x5bd768(0x149),_0xfa617d[_0x5bd768(0x20f)]=_0x5c2eff,delete _0xfa617d[_0x5bd768(0x221)],delete _0xfa617d[_0x5bd768(0x177)],_0x487a3f[_0x5bd768(0x1c6)]!==undefined&&(_0xfa617d[_0x5bd768(0x1c6)]=_0x487a3f[_0x5bd768(0x1c6)]),_0x487a3f['conditionTimeoutUnit']&&(_0xfa617d[_0x5bd768(0x187)]=_0x487a3f[_0x5bd768(0x187)]));}if(_0x487a3f['conditions']){const _0x202c22=_0x487a3f[_0x5bd768(0x1d5)]['some'](_0x469169=>_0x469169[_0x5bd768(0x1e9)]&&isPendingSegmentId(_0x469169[_0x5bd768(0x1e9)]));if(_0x202c22){const _0x374019=_0x487a3f[_0x5bd768(0x1d5)]['map'](_0x4c8768=>{const _0x5516da=_0x5bd768;if(_0x4c8768['segmentId']&&isPendingSegmentId(_0x4c8768[_0x5516da(0x1e9)])){const _0x4fa0e9=_0x50b3cc(_0x4c8768[_0x5516da(0x1e9)],_0x5516da(0x1d3)+_0x3496ef+_0x5516da(0x186));return{..._0x4c8768,'segmentId':_0x4fa0e9||_0x4c8768['segmentId']};}return{..._0x4c8768};});_0xfa617d[_0x5bd768(0x21e)]=_0x5bd768(0x149),_0xfa617d['conditions']=_0x374019,delete _0xfa617d['waitStep'],delete _0xfa617d[_0x5bd768(0x177)],delete _0xfa617d[_0x5bd768(0x20f)],delete _0xfa617d[_0x5bd768(0x1c6)],delete _0xfa617d['conditionTimeoutUnit'];}}}function stripPendingIds(_0x42c25d){const _0xeb14e0=a155_0x285d0a;_0x42c25d['attributes'][_0xeb14e0(0x198)]?.[_0xeb14e0(0x1e9)]&&isPendingSegmentId(_0x42c25d['attributes']['goal'][_0xeb14e0(0x1e9)])&&delete _0x42c25d[_0xeb14e0(0x213)][_0xeb14e0(0x198)];for(const _0x26603c of _0x42c25d[_0xeb14e0(0x213)][_0xeb14e0(0x15a)]||[]){_0x26603c[_0xeb14e0(0x1b3)]?.[_0xeb14e0(0x1e9)]&&isPendingSegmentId(_0x26603c[_0xeb14e0(0x1b3)]['segmentId'])&&delete _0x26603c[_0xeb14e0(0x1b3)];_0x26603c[_0xeb14e0(0x204)]?.[_0xeb14e0(0x1e9)]&&isPendingSegmentId(_0x26603c[_0xeb14e0(0x204)]['segmentId'])&&delete _0x26603c[_0xeb14e0(0x204)];_0x26603c[_0xeb14e0(0x1b4)]&&(_0x26603c['exitCriterias']=_0x26603c[_0xeb14e0(0x1b4)]['filter'](_0x50f118=>!_0x50f118[_0xeb14e0(0x1e9)]||!isPendingSegmentId(_0x50f118[_0xeb14e0(0x1e9)])));if(_0x26603c[_0xeb14e0(0x1ff)])for(const _0x1a0a63 of Object[_0xeb14e0(0x175)](_0x26603c[_0xeb14e0(0x1ff)])){const _0x180e30=_0x26603c[_0xeb14e0(0x1ff)][_0x1a0a63];_0x180e30[_0xeb14e0(0x140)]==='Activation'&&_0x180e30['journeyActivationStepId']&&isPendingActivationId(_0x180e30[_0xeb14e0(0x21c)])&&(_0x180e30[_0xeb14e0(0x21c)]='');if(_0x180e30[_0xeb14e0(0x140)]===_0xeb14e0(0x139)&&_0x180e30[_0xeb14e0(0x19b)])for(const _0x163d7a of _0x180e30[_0xeb14e0(0x19b)]){_0x163d7a['segmentId']&&isPendingSegmentId(_0x163d7a[_0xeb14e0(0x1e9)])&&(_0x163d7a[_0xeb14e0(0x1e9)]='');}_0x180e30['type']===_0xeb14e0(0x133)&&stripWaitStepPendingIds(_0x180e30);}}}function resolvePendingIdsInRequest(_0x4b0f08,_0x1defbe,_0x21cd1e,_0x501075,_0x59713d,_0x5b1982){const _0x481971=a155_0x285d0a,_0x4d8f01=(_0x4acf41,_0x2aa9b9)=>{const _0xbcde89=a155_0x5fe8;if(!isPendingSegmentId(_0x4acf41))return _0x4acf41;const _0x5eb974=extractPendingSegmentName(_0x4acf41),_0x3065de=_0x501075[_0xbcde89(0x183)](_0x5eb974);return!_0x3065de&&_0x5b1982[_0xbcde89(0x134)]?.(_0xbcde89(0x147)+_0x5eb974+_0xbcde89(0x1a0)+_0x2aa9b9),_0x3065de;};if(_0x4b0f08[_0x481971(0x213)][_0x481971(0x198)]?.[_0x481971(0x1e9)]&&isPendingSegmentId(_0x4b0f08['attributes']['goal'][_0x481971(0x1e9)])){const _0x4dbd6a=_0x4d8f01(_0x4b0f08['attributes']['goal'][_0x481971(0x1e9)],_0x481971(0x1db));_0x4dbd6a&&(_0x4b0f08[_0x481971(0x213)]['goal'][_0x481971(0x1e9)]=_0x4dbd6a);}for(const _0x4a52b0 of _0x4b0f08[_0x481971(0x213)][_0x481971(0x15a)]||[]){const _0x5ec808=_0x21cd1e[_0x481971(0x183)](_0x4a52b0[_0x481971(0x208)][_0x481971(0x1e8)]());_0x5ec808&&(_0x4a52b0['id']=_0x5ec808);if(_0x4a52b0[_0x481971(0x1b3)]?.['segmentId']&&isPendingSegmentId(_0x4a52b0[_0x481971(0x1b3)][_0x481971(0x1e9)])){const _0x550a5d=_0x4d8f01(_0x4a52b0['entryCriteria']['segmentId'],_0x481971(0x1d3)+_0x4a52b0[_0x481971(0x208)]+_0x481971(0x1d7));_0x550a5d&&(_0x4a52b0[_0x481971(0x1b3)][_0x481971(0x1e9)]=_0x550a5d);}if(_0x4a52b0['exitCriterias'])for(const _0x860a4f of _0x4a52b0[_0x481971(0x1b4)]){if(_0x860a4f['segmentId']&&isPendingSegmentId(_0x860a4f[_0x481971(0x1e9)])){const _0x548b2d=_0x4d8f01(_0x860a4f[_0x481971(0x1e9)],_0x481971(0x1d3)+_0x4a52b0['name']+'\x27\x20exit\x20criteria');_0x548b2d&&(_0x860a4f[_0x481971(0x1e9)]=_0x548b2d);}}if(_0x4a52b0[_0x481971(0x204)]?.['segmentId']&&isPendingSegmentId(_0x4a52b0[_0x481971(0x204)]['segmentId'])){const _0x24e263=_0x4d8f01(_0x4a52b0['milestone']['segmentId'],_0x481971(0x1d3)+_0x4a52b0[_0x481971(0x208)]+_0x481971(0x15c));_0x24e263&&(_0x4a52b0['milestone'][_0x481971(0x1e9)]=_0x24e263);}if(_0x4a52b0['steps']){const _0x330cc2=_0x148413=>_0x1defbe[_0x481971(0x213)]['journeyStages']?.[_0x481971(0x176)](_0x42581a=>_0x42581a['name'][_0x481971(0x1e8)]()===_0x4a52b0[_0x481971(0x208)][_0x481971(0x1e8)]())?.[_0x481971(0x1ff)]?.[_0x148413];for(const _0x4914b6 of Object[_0x481971(0x175)](_0x4a52b0['steps'])){const _0x39c1bf=_0x4a52b0['steps'][_0x4914b6],_0x26f988=_0x330cc2(_0x4914b6);if(_0x39c1bf['type']===_0x481971(0x1b0)&&_0x39c1bf[_0x481971(0x21c)]&&(isPendingActivationId(_0x39c1bf[_0x481971(0x21c)])||_0x39c1bf[_0x481971(0x21c)]==='')){if(_0x26f988?.[_0x481971(0x21c)]&&isPendingActivationId(_0x26f988[_0x481971(0x21c)])){const _0x1d9d5e=extractPendingActivationName(_0x26f988[_0x481971(0x21c)]),_0x2d10c0=_0x59713d[_0x481971(0x183)](_0x1d9d5e);_0x2d10c0&&(_0x39c1bf[_0x481971(0x21c)]=_0x2d10c0);}}if(_0x39c1bf[_0x481971(0x140)]===_0x481971(0x139)&&_0x39c1bf[_0x481971(0x19b)]&&_0x26f988?.['branches'])for(let _0x3ae14f=0x0;_0x3ae14f<_0x39c1bf['branches'][_0x481971(0x13c)];_0x3ae14f++){const _0x161d93=_0x39c1bf[_0x481971(0x19b)][_0x3ae14f],_0x1e9dc6=_0x26f988[_0x481971(0x19b)][_0x3ae14f];if(_0x1e9dc6?.[_0x481971(0x1e9)]&&isPendingSegmentId(_0x1e9dc6['segmentId'])){const _0x10144c=_0x4d8f01(_0x1e9dc6[_0x481971(0x1e9)],_0x481971(0x1d3)+_0x4a52b0[_0x481971(0x208)]+'\x27\x20decision\x20point\x20branch\x20\x27'+(_0x161d93[_0x481971(0x208)]||_0x3ae14f)+'\x27');_0x10144c&&(_0x161d93[_0x481971(0x1e9)]=_0x10144c);}}_0x39c1bf['type']===_0x481971(0x133)&&_0x26f988?.[_0x481971(0x140)]===_0x481971(0x133)&&resolveWaitStepPendingIds(_0x39c1bf,_0x26f988,_0x4d8f01,_0x4a52b0[_0x481971(0x208)]);}}}}
1
+ const a155_0x50aee1=a155_0x1494;(function(_0x1196e1,_0x38270e){const _0x115241=a155_0x1494,_0x5dcd61=_0x1196e1();while(!![]){try{const _0x44274f=-parseInt(_0x115241(0x12d))/0x1*(-parseInt(_0x115241(0x135))/0x2)+parseInt(_0x115241(0x95))/0x3+parseInt(_0x115241(0x7b))/0x4+parseInt(_0x115241(0x7e))/0x5*(parseInt(_0x115241(0x16f))/0x6)+parseInt(_0x115241(0xfc))/0x7*(-parseInt(_0x115241(0x83))/0x8)+-parseInt(_0x115241(0x162))/0x9*(-parseInt(_0x115241(0x11b))/0xa)+-parseInt(_0x115241(0x81))/0xb;if(_0x44274f===_0x38270e)break;else _0x5dcd61['push'](_0x5dcd61['shift']());}catch(_0x3b75ce){_0x5dcd61['push'](_0x5dcd61['shift']());}}}(a155_0x383d,0x8b3e6));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a155_0x50aee1(0x163));export const PENDING_SEGMENT_PREFIX=a155_0x50aee1(0x118);export const PENDING_ACTIVATION_PREFIX=a155_0x50aee1(0x175);export function createPendingSegmentId(_0x1da63a){return''+PENDING_SEGMENT_PREFIX+_0x1da63a+'__';}export function isPendingSegmentId(_0x3878af){const _0x4107f2=a155_0x50aee1;return _0x3878af[_0x4107f2(0x146)](PENDING_SEGMENT_PREFIX)&&!_0x3878af['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x46cfdd){const _0x1a825f=a155_0x50aee1;return _0x46cfdd[_0x1a825f(0x131)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x4112d9){return''+PENDING_ACTIVATION_PREFIX+_0x4112d9+'__';}export function isPendingActivationId(_0x307d70){const _0xa0edee=a155_0x50aee1;return _0x307d70[_0xa0edee(0x146)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0xeaba7b){const _0x249164=a155_0x50aee1;return _0xeaba7b[_0x249164(0x131)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x174cbc,_0x290f51){const _0x532c49=a155_0x50aee1,_0x27eee0=_0x174cbc+'::'+(_0x290f51['trim']()||_0x532c49(0xa7)),_0x41ab3c=createHash(_0x532c49(0x158))[_0x532c49(0xd7)](_0x27eee0)['digest'](_0x532c49(0x8d))[_0x532c49(0x8b)](0x0,0xc);return'journey_entry_criteria_'+_0x41ab3c;}export function ensureJourneyDefaults(_0x468d1a){const _0x14c537=a155_0x50aee1;!_0x468d1a['description']&&(_0x468d1a[_0x14c537(0x174)]=''),!_0x468d1a['state']&&(_0x468d1a[_0x14c537(0x17a)]=_0x14c537(0xb5));}export function injectExistingStageIds(_0x5c68ad,_0x4598dd){const _0x47ccd6=a155_0x50aee1,_0x2349a6=new Map(_0x4598dd['map'](_0x5b1d72=>[_0x5b1d72[_0x47ccd6(0xa3)],_0x5b1d72['id']]));for(const _0x4050cd of _0x5c68ad){if(!_0x4050cd['id']){const _0x1a171b=_0x2349a6[_0x47ccd6(0x100)](_0x4050cd[_0x47ccd6(0xa3)]);_0x1a171b&&(_0x4050cd['id']=_0x1a171b);}}}export function resolveTDFolderPath(_0x26c0fe,_0x6739ff,_0x2f3469){const _0x4b578b=a155_0x50aee1;if(!_0x6739ff)return _0x26c0fe;if(_0x26c0fe===_0x2f3469||_0x26c0fe[_0x4b578b(0x146)](_0x2f3469+'/'))return _0x26c0fe;return _0x26c0fe?_0x2f3469+'/'+_0x26c0fe:_0x2f3469;}export function addFoldersToCreate(_0x140aeb,_0x539a1f,_0x30b0a8){const _0x330b04=a155_0x50aee1;if(!_0x140aeb)return;if(_0x539a1f[_0x330b04(0x125)](_0x140aeb))return;const _0x4d6965=_0x140aeb['split']('/');let _0x4ef3bc='';for(const _0x6aa9 of _0x4d6965){_0x4ef3bc=_0x4ef3bc?_0x4ef3bc+'/'+_0x6aa9:_0x6aa9,!_0x539a1f[_0x330b04(0x125)](_0x4ef3bc)&&_0x30b0a8[_0x330b04(0x167)](_0x4ef3bc);}}export function sortFoldersByDepth(_0x1a7af0){const _0x2d0503=a155_0x50aee1;return[..._0x1a7af0][_0x2d0503(0xc4)]((_0x97beda,_0x5925b1)=>{const _0x288d54=_0x2d0503,_0x5966a6=(_0x97beda['match'](/\//g)||[])[_0x288d54(0xd1)],_0x2d446e=(_0x5925b1[_0x288d54(0x11e)](/\//g)||[])[_0x288d54(0xd1)];return _0x5966a6-_0x2d446e;});}import*as a155_0x2b1cb1 from'yaml';import{readFileSync}from'fs';import a155_0x156b1f from'path';import{isJourneyDef,parseYamlString as a155_0x41b119,toYamlString as a155_0x359912,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';function a155_0x383d(){const _0x20e812=['Condition','action','errors','yamlActivation','draft','join','data','logSuccess','includes','parse','createdSegmentIds','waitStepUnit','\x27\x20entry\x20criteria','embedded_activation_created','getSegment\x20failed\x20for\x20','keys','diff','yamlConfig','segment_updated','sort','some','folderPath','relationships','Updating\x20segment\x20\x27','toString','SEGMENT_NOT_FOUND','find','JOURNEY_UPDATE_ERROR','../../utils/async.js','message','debug','Duration','length','behavior','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','nameToType','deleteSegment','validatedRequest','update','getJourney','existingSegments','isNew','absolutePath','journeyActivationStepId','getLatestJourneyId','uniqueServerName','exitCriterias','existingJourney','all','Deleting\x20activation\x20\x27','\x27\x20wait\x20condition','Journey\x20\x27','object','columns','activations','./child-segment-yaml.js','activationStepsById','\x27\x20exit\x20criteria','decision_point','Failed\x20to\x20resolve\x20segment\x20','toISOString','effectiveFolderId','INTERNAL','DecisionPoint','conditionTimeoutUnit','toLowerCase','journeyStages','branches','ACTIVATION_UPDATE_ERROR','steps','uniqueSegmentName','Creating\x20folder\x20\x27','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','Matched\x20server\x20segment\x20\x27','rootFolderId','6219178NUiAOi','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','rule','Segment\x20not\x20found:\x20','get','notification','type','folder_created','journey_creating','segment_creating','idToEmailMap','journeyActivationNameToId','attributes','item','\x27\x20from\x20file:\x20','and\x20the\x20server\x20segment,\x20then\x20retry.','embedded_segment_created','push','Updated\x20segment\x20\x27','createdSegmentId','Delete\x20the\x20push\x20recovery\x20file\x20(',').\x20','activation_template_id','goal','Failed\x20to\x20','Entry\x20criteria:\x20','\x27\x20for\x20','journeyId','__pending_','list','segmentId','470WSpCcc','waitStep','max','match','split','.$1.push-recovery.json','schedule','parseDocument','resolvedRule','index','has','getSegmentEntity\x20also\x20failed\x20for\x20','\x27\x20not\x20found\x20in\x20journey\x20\x27','\x27\x20to\x20local\x20\x27','deleted','progress','listActivations','connection','274121bkhpFY','connector_config','logInfo','stringify','replace','journeyBundleId','entries','JOURNEY_SYNTAX_ERROR','2hAslfg','map','journeyBundleName','conditions','updated','SEGMENT_UPDATE_ERROR','\x0a\x20\x20','connectionIdToNameMap','Segment\x20not\x20found','versionNumber','Failed\x20to\x20resolve\x20activation\x20','Created\x20segment\x20\x27','segment_deleted','parentId','activationsBySegmentId','embeddedSegmentNameToId','segmentNameToId','startsWith','NOT_FOUND','folderId','relative','waitStepType','with','\x27\x20decision\x20point\x20branch\x20\x27','size','all_columns','entry_criteria','folderPathToId','embedded_activation_creating','activation_deleting','idToName','localName','SEGMENT_SYNTAX_ERROR','segments','createFolder','sha1','createJourneySegment','Name\x20has\x20already\x20been\x20taken','milestone','nameToId','Activation\x20not\x20found:\x20','filter','journeyName','delete','utf-8','198972DnrKIU','tdx.sdk.push-workflow','from','Fetching\x20','hasChanges','add','journeyBundlesByFolderAndName','dirname','fetchJourney','Creating\x20activation\x20\x27','\x20(referenced\x20in\x20journey\x20','WaitStep','created','176532PkfFva','logWarning','getSegmentEntity','journey_updating','\x20journey\x20from\x20file:\x20','description','__pending_act_','activation_created','entryCriteria','embedded_segment_creating','stages','state','segment_updating','activationParams','getActivation','resolveSegment','journey_created','values','segmentByFolderAndName','activation_deleted','flatMap','ACTIVATION_SYNTAX_ERROR','3399028BGiaVk','\x27...','set','5ZhdtBz','Created\x20activation\x20\x27','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','11852170gvueRA','segment_created','8ixlWEC','journey','Created\x20folder\x20\x27','Activation','create','existingActivation','parentFolder','Deleted\x20activation\x20\x27','slice','conditionTimeoutDuration','hex','segmentFolderId','createActivation','activationActions','Updated\x20journey\x20\x27','journeys','resolveJourneyId','logDeleted','1031670SssANQ','Embedded\x20segment\x20\x27','valid','journey_updated',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','folder_creating','goal\x20criteria','onProgress','Failed\x20to\x20fetch\x20referenced\x20segment\x20','\x27\x20milestone','conditionSegmentId','activation_','updateSegmentById','run_after_journey_refresh','name','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','./journey-yaml.js','reduce','segment','withProgress','isArray','existingSegment','journeyById','unchanged','stage\x20\x27','activationContext','deps','verbose'];a155_0x383d=function(){return _0x20e812;};return a155_0x383d();}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(_0x4e5f7c){const _0x547cfd=a155_0x50aee1;if(Array[_0x547cfd(0xa9)](_0x4e5f7c))return'['+_0x4e5f7c['map'](_0x4f6370=>stableStringify(_0x4f6370))['join'](',')+']';if(_0x4e5f7c&&typeof _0x4e5f7c===_0x547cfd(0xe5)){const _0x18a566=_0x4e5f7c,_0x4873db=Object[_0x547cfd(0xc0)](_0x18a566)[_0x547cfd(0xc4)](),_0x1a92ff=_0x4873db[_0x547cfd(0x136)](_0x56006a=>'\x22'+_0x56006a+'\x22:'+stableStringify(_0x18a566[_0x56006a]));return'{'+_0x1a92ff[_0x547cfd(0xb6)](',')+'}';}const _0x2b7f56=JSON[_0x547cfd(0x130)](_0x4e5f7c);return _0x2b7f56===undefined?'null':_0x2b7f56;}function activationSignature(_0xfa716b){const _0x135b72=a155_0x50aee1,_0x4c7c26={'connection':_0xfa716b['connection'],..._0xfa716b[_0x135b72(0x14e)]!==undefined&&{'all_columns':_0xfa716b[_0x135b72(0x14e)]},..._0xfa716b[_0x135b72(0xe6)]!==undefined&&{'columns':_0xfa716b[_0x135b72(0xe6)]},..._0xfa716b[_0x135b72(0xd2)]!==undefined&&{'behavior':_0xfa716b[_0x135b72(0xd2)]},..._0xfa716b[_0x135b72(0x121)]!==undefined&&{'schedule':_0xfa716b[_0x135b72(0x121)]},..._0xfa716b[_0x135b72(0x101)]!==undefined&&{'notification':_0xfa716b[_0x135b72(0x101)]},..._0xfa716b['connector_config']!==undefined&&{'connector_config':_0xfa716b[_0x135b72(0x12e)]},..._0xfa716b[_0x135b72(0x112)]!==undefined&&{'activation_template_id':_0xfa716b[_0x135b72(0x112)]}};return stableStringify(_0x4c7c26);}function a155_0x1494(_0x3bca8c,_0x248c4b){_0x3bca8c=_0x3bca8c-0x77;const _0x383d3a=a155_0x383d();let _0x14942b=_0x383d3a[_0x3bca8c];return _0x14942b;}async function fetchSegment(_0x4f3275,_0x5b148f,_0x541f29,_0x14e6af){const _0x47daf2=a155_0x50aee1,_0xb639e0=_0x14e6af?.[_0x47daf2(0xcb)](_0x2caa68=>_0x2caa68['id']===_0x541f29);if(_0xb639e0)return _0xb639e0;try{return await _0x4f3275[_0x47daf2(0xa7)]['getSegment'](_0x5b148f,_0x541f29);}catch(_0xdd6cfc){logger[_0x47daf2(0xcf)](_0x47daf2(0xbf)+_0x541f29+_0x47daf2(0x99)+_0xdd6cfc);try{return await _0x4f3275[_0x47daf2(0xa7)][_0x47daf2(0x171)](_0x541f29);}catch(_0x2f4273){return logger[_0x47daf2(0xcf)](_0x47daf2(0x126)+_0x541f29+':\x20'+_0x2f4273),null;}}}function recoverSegmentIdsFromPushRecovery(_0x485885,_0x543577,_0x4a6109){const _0x5cc31f=a155_0x50aee1,_0x3a5618=readPushRecovery(_0x485885[_0x5cc31f(0xdb)]);if(_0x3a5618?.[_0x5cc31f(0x15f)]===_0x485885[_0x5cc31f(0xc2)][_0x5cc31f(0xa3)])for(const [_0x1494ff,_0x882791]of Object[_0x5cc31f(0x133)](_0x3a5618['segments'])){const _0x2fe42f=generateDeterministicJourneySegmentName(_0x485885[_0x5cc31f(0xc2)][_0x5cc31f(0xa3)],_0x1494ff);_0x882791['uniqueServerName']===_0x2fe42f&&(_0x543577[_0x5cc31f(0x7d)](_0x1494ff,_0x882791[_0x5cc31f(0x11a)]),_0x4a6109[_0x5cc31f(0x7d)](_0x1494ff,_0x882791['segmentId']));}}async function createOrRecoverEmbeddedSegment(_0x210ebe,_0xfcf7ba,_0x1349f8,_0x1eb141){const _0x248385=a155_0x50aee1;let _0x228aaa;try{_0x228aaa=await _0x210ebe[_0x248385(0xa7)][_0x248385(0x159)]({'name':_0x1349f8[_0x248385(0xf7)],'description':_0x1349f8[_0x248385(0x174)],'journeyId':_0x1349f8['journeyId'],'rule':_0x1eb141(_0x1349f8[_0x248385(0x123)],!![]),'countPopulation':!![],'parentFolderId':_0x1349f8['folderId'],'audienceId':_0x1349f8[_0x248385(0x142)]});}catch(_0xdd8561){const _0x276634=_0xdd8561 instanceof Error&&_0xdd8561[_0x248385(0xce)][_0x248385(0xb9)](_0x248385(0x15a));if(_0x276634){const _0x52a676=readPushRecovery(_0xfcf7ba[_0x248385(0xdb)]),_0x765795=_0x52a676?.[_0x248385(0x15f)]===_0xfcf7ba[_0x248385(0xc2)][_0x248385(0xa3)]?_0x52a676[_0x248385(0x156)][_0x1349f8[_0x248385(0x154)]]:undefined;if(_0x765795?.[_0x248385(0xde)]===_0x1349f8['uniqueSegmentName'])await _0x210ebe[_0x248385(0xa7)][_0x248385(0xa1)](_0x1349f8[_0x248385(0x142)],_0x765795['segmentId'],{'description':_0x1349f8[_0x248385(0x174)],'rule':_0x1eb141(_0x1349f8[_0x248385(0x123)],!![]),'countPopulation':!![]}),_0x228aaa=_0x765795['segmentId'];else throw new SDKError(ErrorCode[_0x248385(0x13a)],_0x248385(0x96)+_0x1349f8[_0x248385(0x154)]+'\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20'+(_0x248385(0x110)+_0xfcf7ba[_0x248385(0xdb)][_0x248385(0x131)](/([^/]+)$/,_0x248385(0x120))+')\x20')+_0x248385(0x10b),_0xdd8561);}else throw _0xdd8561;}return saveSegmentToPushRecovery(_0xfcf7ba[_0x248385(0xdb)],_0xfcf7ba[_0x248385(0xc2)][_0x248385(0xa3)],_0x1349f8['localName'],{'segmentId':_0x228aaa,'uniqueServerName':_0x1349f8[_0x248385(0xf7)],'createdAt':new Date()['toISOString']()}),_0x228aaa;}export async function prepareSegmentFiles(_0x20dcc5,_0x21c2a4,_0x3030bd,_0x16d711,_0x281b7c){const _0x1f1c85=a155_0x50aee1,{activationDefToCreateRequest:_0x49fd86}=await import('./child-segment-yaml.js'),_0x25dd25=[],_0x17191a=new Set();for(const {yamlConfig:_0x4743ee,folderPath:_0x5591ab,sourcePath:_0x13a424}of _0x20dcc5){const _0xb557fe=resolveTDFolderPath(_0x5591ab,_0x16d711,_0x281b7c),_0x7ec1eb=_0xb557fe+':'+_0x4743ee['name'],_0x1c3e9d=_0x21c2a4[_0x1f1c85(0x77)][_0x1f1c85(0x100)](_0x7ec1eb),_0x3928e0=_0x1c3e9d?_0x21c2a4[_0x1f1c85(0x143)][_0x1f1c85(0x100)](_0x1c3e9d['id'])||[]:[];addFoldersToCreate(_0xb557fe,_0x21c2a4[_0x1f1c85(0x150)],_0x17191a);const _0x465243=calculateActivationActions(_0x4743ee[_0x1f1c85(0xe7)]||[],_0x3928e0,_0x21c2a4['idToEmailMap'],_0x21c2a4['connectionIdToNameMap']);for(const _0x193d16 of _0x465243){(_0x193d16[_0x1f1c85(0x102)]===_0x1f1c85(0x87)||_0x193d16[_0x1f1c85(0x102)]===_0x1f1c85(0xd7))&&_0x193d16[_0x1f1c85(0xb4)]&&(_0x193d16['validatedRequest']=await _0x49fd86(_0x193d16[_0x1f1c85(0xb4)],_0x3030bd));}const _0x13e7b5=calculateSegmentDiff(_0x4743ee,_0x1c3e9d,_0x3928e0,_0x21c2a4[_0x1f1c85(0x106)],_0x21c2a4[_0x1f1c85(0x13c)]);_0x25dd25[_0x1f1c85(0x10d)]({'relativePath':_0x4743ee[_0x1f1c85(0xa3)],'absolutePath':_0x13a424,'yamlConfig':_0x4743ee,'folderPath':_0xb557fe,'existingSegment':_0x1c3e9d,'existingActivations':_0x3928e0,'isNew':_0x13e7b5['isNew'],'hasChanges':_0x13e7b5['hasChanges'],'diff':_0x13e7b5[_0x1f1c85(0xc1)],'activationActions':_0x465243});}return{'segmentFiles':_0x25dd25,'foldersToCreate':_0x17191a};}export async function prepareJourneyFiles(_0x5bf83c,_0xdbc9f9,_0x3421af,_0x44a1af){const _0x213e0a=a155_0x50aee1,_0x437500=[],_0x231426=new Set();for(const {yamlConfig:_0x3cbb4f,folderPath:_0x3e8a16,sourcePath:_0x5130fe}of _0x5bf83c){const _0x11ea56=resolveTDFolderPath(_0x3e8a16,_0x3421af,_0x44a1af),_0x398c8e=_0x11ea56+':'+_0x3cbb4f[_0x213e0a(0xa3)],_0x1c3e38=_0xdbc9f9[_0x213e0a(0x168)][_0x213e0a(0x100)](_0x398c8e);let _0x58ab3c,_0x25fd28;if(_0x1c3e38&&_0x1c3e38[_0x213e0a(0xd1)]>0x0){const _0x51bb65=buildLocalExpandedRuleMappings(_0x3cbb4f),{createYamlContext:_0x2af5c3,prefetchJourneySegments:_0x36a382}=createPushYamlContextForBundle(_0xdbc9f9['deps'],_0xdbc9f9['parentId'],_0xdbc9f9[_0x213e0a(0xd9)],_0x51bb65,_0xdbc9f9[_0x213e0a(0x106)],_0xdbc9f9['connectionIdToNameMap'],_0xdbc9f9[_0x213e0a(0xe9)],_0xdbc9f9['journeyById']);await _0x36a382(_0x1c3e38[_0x213e0a(0x136)](_0x24ff93=>_0x24ff93['id']));const _0x4ee2ce=await _0xdbc9f9[_0x213e0a(0xaf)]['journey'][_0x213e0a(0xdd)](_0x1c3e38[0x0][_0x213e0a(0x132)]),_0x45ddca=hasMultipleVersions(_0x3cbb4f),_0x52172f=async _0xd18e22=>{const _0x394b88=_0x213e0a,_0x59af78=_0xdbc9f9[_0x394b88(0xab)]?.[_0x394b88(0x100)](_0xd18e22);if(_0x59af78)return _0x59af78;return _0xdbc9f9[_0x394b88(0x16a)]({'journeyId':_0xd18e22,'journeyName':_0x3cbb4f['name'],'isMultiVersion':_0x1c3e38[_0x394b88(0xd1)]>0x1});};if(_0x45ddca&&_0x1c3e38['length']>0x1){const _0x58ae41=[];for(const _0x322e9f of _0x1c3e38){const _0x5f6e54=_0x322e9f['versionNumber']||0x1;_0xdbc9f9['progress']?.['update'](_0x213e0a(0x165)+_0x3cbb4f[_0x213e0a(0xa3)]+'\x20v'+_0x5f6e54);const _0x149c8f=await _0x52172f(_0x322e9f['id']),_0x36be9a=_0x2af5c3(_0x322e9f['id']),_0x5568dc=await journeyResponseToDef(_0x149c8f,_0x36be9a);_0x58ae41[_0x213e0a(0x10d)]({'item':_0x322e9f,'yaml':_0x5568dc});}const _0x473e98=buildLocalRuleToNameMappingFromJourney(_0x3cbb4f);_0x25fd28=buildMergedJourneyDef(_0x58ae41,_0x473e98,_0x4ee2ce);const _0x63e2b3=Math[_0x213e0a(0x11d)](..._0x58ae41['map'](_0x308d0b=>_0x308d0b[_0x213e0a(0x109)]['versionNumber']||0x0)),_0x3aea8c=_0x1c3e38[_0x213e0a(0xcb)](_0x4f8b92=>(_0x4f8b92['versionNumber']||0x0)===_0x63e2b3);_0x3aea8c&&(_0xdbc9f9[_0x213e0a(0x12a)]?.[_0x213e0a(0xd7)]('Fetching\x20'+_0x3cbb4f[_0x213e0a(0xa3)]+'\x20v'+_0x63e2b3),_0x58ab3c=await _0x52172f(_0x3aea8c['id']));}else{const _0x407e32=_0x1c3e38[_0x1c3e38[_0x213e0a(0xd1)]-0x1];_0xdbc9f9[_0x213e0a(0x12a)]?.[_0x213e0a(0xd7)](_0x213e0a(0x165)+_0x3cbb4f[_0x213e0a(0xa3)]),_0x58ab3c=await _0x52172f(_0x407e32['id']);const _0x505d9d=_0x2af5c3(_0x407e32['id']),_0x4eab5a=await journeyResponseToDef(_0x58ab3c,_0x505d9d),_0xd0c230=buildLocalRuleToNameMappingFromJourney(_0x3cbb4f);_0x25fd28=buildMergedJourneyDef([{'item':_0x407e32,'yaml':_0x4eab5a}],_0xd0c230,_0x4ee2ce);}}addFoldersToCreate(_0x11ea56,_0xdbc9f9[_0x213e0a(0x150)],_0x231426);const _0x496f08=calculateJourneyDiff(_0x3cbb4f,_0x25fd28);_0x437500['push']({'relativePath':_0x3cbb4f[_0x213e0a(0xa3)],'absolutePath':_0x5130fe,'yamlConfig':_0x3cbb4f,'folderPath':_0x11ea56,'existingJourney':_0x58ab3c,'isNew':_0x496f08[_0x213e0a(0xda)],'hasChanges':_0x496f08[_0x213e0a(0x166)],'diff':_0x496f08[_0x213e0a(0xc1)]});}return{'journeyFiles':_0x437500,'foldersToCreate':_0x231426};}export function calculateActivationActions(_0x380762,_0x42d2a9,_0x252b60,_0x43626e){const _0x58c760=a155_0x50aee1,_0x5a7f1f=[],_0x2f62e6=new Map();for(const _0x5d2bf6 of _0x42d2a9){_0x2f62e6[_0x58c760(0x7d)](_0x5d2bf6['name'],_0x5d2bf6);}const _0x3c5455=new Map();for(const _0x3558b2 of _0x380762){_0x3c5455[_0x58c760(0x7d)](_0x3558b2[_0x58c760(0xa3)],_0x3558b2);}for(const _0x5051e1 of _0x380762){const _0x1e1fb5=_0x2f62e6[_0x58c760(0x100)](_0x5051e1[_0x58c760(0xa3)]);if(!_0x1e1fb5)_0x5a7f1f[_0x58c760(0x10d)]({'type':_0x58c760(0x87),'name':_0x5051e1[_0x58c760(0xa3)],'yamlActivation':_0x5051e1});else{const _0x20b055=activationResponseToDef(_0x1e1fb5,_0x252b60,_0x43626e),_0x3e8ae5=a155_0x2b1cb1[_0x58c760(0x130)](_0x20b055),_0x4965eb=a155_0x2b1cb1[_0x58c760(0x130)](_0x5051e1);_0x3e8ae5!==_0x4965eb&&_0x5a7f1f['push']({'type':_0x58c760(0xd7),'name':_0x5051e1[_0x58c760(0xa3)],'yamlActivation':_0x5051e1,'existingActivation':_0x1e1fb5});}}for(const _0x2b2d8c of _0x42d2a9){!_0x3c5455[_0x58c760(0x125)](_0x2b2d8c[_0x58c760(0xa3)])&&_0x5a7f1f['push']({'type':_0x58c760(0x160),'name':_0x2b2d8c[_0x58c760(0xa3)],'existingActivation':_0x2b2d8c});}return _0x5a7f1f;}function calculateYamlDiff(_0x44b5db,_0x5970a2){if(_0x5970a2){const _0x44d127=generateDiff(_0x5970a2,_0x44b5db),_0x231f8b=hasChanges(_0x44d127);return{'isNew':![],'hasChanges':_0x231f8b,'diff':_0x231f8b?formatDiffWithColors(_0x44d127):undefined};}const _0x5e30d6=generateDiff('',_0x44b5db);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x5e30d6)};}export function calculateSegmentDiff(_0x4937bf,_0x2c72fe,_0x10a89c,_0x44afc0,_0x34853d){const _0x4051a6=segmentToYamlString(_0x4937bf),_0x269e46=_0x2c72fe?segmentToYamlString(segmentWithActivationsToYaml(_0x2c72fe,_0x10a89c,undefined,_0x44afc0,_0x34853d)):undefined;return calculateYamlDiff(_0x4051a6,_0x269e46);}export function calculateJourneyDiff(_0x1ee8e6,_0x3797eb){const _0x655024=normalizeJourneyDef(_0x1ee8e6,_0x1ee8e6),_0x522a7a=a155_0x359912(_0x655024),_0x3373c9=_0x3797eb?a155_0x359912(normalizeJourneyDef(_0x3797eb,_0x1ee8e6)):undefined;return calculateYamlDiff(_0x522a7a,_0x3373c9);}export function findSegmentsToDelete(_0xbaca7d,_0x24a21b,_0x46bb9a,_0x178e75,_0x4fcbd6){const _0x373e17=a155_0x50aee1,_0x4850f8=new Set();for(const {yamlConfig:_0x273e03,folderPath:_0x533db7}of _0x24a21b){_0x4850f8[_0x373e17(0x167)](_0x533db7+':'+_0x273e03[_0x373e17(0xa3)]);}return _0xbaca7d[_0x373e17(0x15e)](_0x516c30=>{const _0x259dd3=_0x373e17,_0x3dcf55=_0x516c30[_0x259dd3(0x8e)]?_0x46bb9a[_0x259dd3(0x100)](_0x516c30[_0x259dd3(0x8e)][_0x259dd3(0xc9)]())||'':'',_0x4cbbf8=_0x3dcf55+':'+_0x516c30[_0x259dd3(0xa3)];if(_0x4850f8['has'](_0x4cbbf8))return![];if(_0x4fcbd6)return _0x3dcf55===_0x178e75||_0x3dcf55[_0x259dd3(0x146)](_0x178e75+'/');return!![];});}export function findJourneysToDelete(_0xeb6a0e,_0x1db81d,_0x3e4412,_0x593255,_0x909eb9){const _0x4cb2b8=a155_0x50aee1,_0x2ffcbb=new Set();for(const {yamlConfig:_0x88cefe,folderPath:_0x4319a1}of _0x1db81d){_0x2ffcbb[_0x4cb2b8(0x167)](_0x4319a1+':'+_0x88cefe[_0x4cb2b8(0xa3)]);}return _0xeb6a0e[_0x4cb2b8(0x15e)](_0x20ab50=>{const _0x446c5d=_0x4cb2b8,_0x11786c=_0x20ab50[_0x446c5d(0x148)]?_0x3e4412[_0x446c5d(0x100)](_0x20ab50[_0x446c5d(0x148)])||'':'',_0x3ad103=_0x11786c+':'+_0x20ab50['journeyBundleName'];if(_0x2ffcbb['has'](_0x3ad103))return![];if(_0x909eb9)return _0x11786c===_0x593255||_0x11786c[_0x446c5d(0x146)](_0x593255+'/');return!![];});}export function buildSegmentLookupMap(_0x5ae78a,_0x417084){const _0x255537=a155_0x50aee1,_0x1e2b37=new Map();for(const _0x515a9 of _0x5ae78a){const _0x128914=_0x515a9[_0x255537(0x8e)]?_0x417084['get'](_0x515a9[_0x255537(0x8e)][_0x255537(0xc9)]())||'':'',_0x482a0e=_0x128914+':'+_0x515a9[_0x255537(0xa3)];_0x1e2b37['set'](_0x482a0e,_0x515a9);}return _0x1e2b37;}export function buildSegmentNameToIdMap(_0x1314ac){const _0x2e5c04=a155_0x50aee1,_0x370602=new Map();for(const _0x129f1b of _0x1314ac){_0x370602[_0x2e5c04(0x7d)](_0x129f1b[_0x2e5c04(0xa3)],_0x129f1b['id']);}return _0x370602;}export function buildJourneyBundleLookupMap(_0x4f1d15,_0x35656d){const _0x5183e4=a155_0x50aee1,_0x172424=new Map();for(const _0x7a877a of _0x4f1d15){const _0x2eec36=_0x7a877a[_0x5183e4(0x148)]?_0x35656d[_0x5183e4(0x100)](_0x7a877a[_0x5183e4(0x148)])||'':'',_0x5d2f5b=_0x2eec36+':'+_0x7a877a['journeyBundleName'];!_0x172424[_0x5183e4(0x125)](_0x5d2f5b)&&_0x172424[_0x5183e4(0x7d)](_0x5d2f5b,[]),_0x172424[_0x5183e4(0x100)](_0x5d2f5b)[_0x5183e4(0x10d)](_0x7a877a);}for(const _0x3e80a5 of _0x172424[_0x5183e4(0x180)]()){_0x3e80a5[_0x5183e4(0xc4)]((_0x5571b6,_0x4c4b9d)=>(_0x5571b6[_0x5183e4(0x13e)]||0x0)-(_0x4c4b9d['versionNumber']||0x0));}return _0x172424;}export function collectFoldersToCreate(_0x4bc4fe,_0x4c2330){const _0x35555b=a155_0x50aee1,_0x18bed1=new Set();for(const _0xf2933b of _0x4bc4fe){if(!_0xf2933b)continue;if(_0x4c2330['has'](_0xf2933b))continue;const _0xf2237e=_0xf2933b[_0x35555b(0x11f)]('/');let _0x51ea3d='';for(const _0x16a032 of _0xf2237e){_0x51ea3d=_0x51ea3d?_0x51ea3d+'/'+_0x16a032:_0x16a032,!_0x4c2330[_0x35555b(0x125)](_0x51ea3d)&&_0x18bed1[_0x35555b(0x167)](_0x51ea3d);}}return _0x18bed1;}export function parseAndClassifyYamlFiles(_0x3c502c,_0x4ebac6,_0x29e1fa){const _0x5ed937=a155_0x50aee1,_0x18532d=[],_0x37ef07=[];for(const _0x46a073 of _0x3c502c){const _0x13f20b=a155_0x156b1f[_0x5ed937(0x149)](_0x4ebac6,a155_0x156b1f[_0x5ed937(0x169)](_0x46a073)),_0x27ca91=_0x13f20b==='.'?'':_0x13f20b['replace'](/\\/g,'/'),_0x187e93=readFileSync(_0x46a073,_0x5ed937(0x161)),_0x40291e=a155_0x2b1cb1[_0x5ed937(0xba)](_0x187e93);if(isJourneyDef(_0x40291e)){const _0x44425a=a155_0x41b119(_0x187e93);_0x37ef07[_0x5ed937(0x10d)]({'yamlConfig':_0x44425a,'folderPath':_0x27ca91,'sourcePath':_0x46a073});}else{if(!_0x29e1fa?.['skipSegments']){const _0x114d5c=parseSegmentYamlFile(_0x187e93),_0x1c0532=normalizeChildSegmentYaml(_0x114d5c);_0x18532d[_0x5ed937(0x10d)]({'yamlConfig':_0x1c0532,'folderPath':_0x27ca91,'sourcePath':_0x46a073});}}}return{'segments':_0x18532d,'journeys':_0x37ef07};}export function validateParsedFiles(_0x4dc75c,_0x1bf8b6){const _0x43003c=a155_0x50aee1,_0x511215=[];for(const {yamlConfig:_0x5686c0,sourcePath:_0x3d81b3}of _0x4dc75c[_0x43003c(0x156)]){const _0x47f214=readFileSync(_0x3d81b3,_0x43003c(0x161)),_0x27c33f=a155_0x2b1cb1[_0x43003c(0x122)](_0x47f214),_0x1c8278=validateSegmentDef(_0x5686c0,{'source':_0x47f214,'document':_0x27c33f},{'skipSchema':!![]});if(!_0x1c8278[_0x43003c(0x97)]){const _0x2bad7e=a155_0x156b1f[_0x43003c(0x149)](_0x1bf8b6,_0x3d81b3);_0x511215[_0x43003c(0x10d)]({'filePath':_0x2bad7e,'source':_0x47f214,'result':_0x1c8278,'isJourney':![]});}}for(const {yamlConfig:_0x2eb122,sourcePath:_0x1d0a66}of _0x4dc75c['journeys']){const _0x1bb9db=readFileSync(_0x1d0a66,_0x43003c(0x161)),_0xcfd8b4=a155_0x2b1cb1[_0x43003c(0x122)](_0x1bb9db),_0x34aabd=validateJourneyDef(_0x2eb122,{'source':_0x1bb9db,'document':_0xcfd8b4},{'skipSchema':!![]});if(!_0x34aabd[_0x43003c(0x97)]){const _0x25aac4=a155_0x156b1f['relative'](_0x1bf8b6,_0x1d0a66);_0x511215[_0x43003c(0x10d)]({'filePath':_0x25aac4,'source':_0x1bb9db,'result':_0x34aabd,'isJourney':!![]});}}return _0x511215;}export function formatValidationErrors(_0x1262b8){const _0x3f2c1f=a155_0x50aee1,_0x147970=[];for(const {filePath:_0x5d3241,source:_0x249772,result:_0x858520,isJourney:_0xc2cd4f}of _0x1262b8){const _0x31177c=_0xc2cd4f?_0x3f2c1f(0x84):'segment';_0x147970[_0x3f2c1f(0x10d)]('\x0a'+_0x5d3241+'\x20('+_0x31177c+'):\x20'+_0x858520[_0x3f2c1f(0xb3)][_0x3f2c1f(0xd1)]+'\x20error(s)'),_0x147970[_0x3f2c1f(0x10d)](formatValidationResult(_0x858520,_0x249772,_0x5d3241));}return _0x147970[_0x3f2c1f(0xb6)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x43027f){const _0x248d97=a155_0x50aee1,_0xfb019c=new Set(),_0x3ae564=new Map(),_0x511f0b=collectSegmentUsageCounts(_0x43027f);if(_0x43027f[_0x248d97(0x156)])for(const [_0x55e8a7,_0x54194c]of Object[_0x248d97(0x133)](_0x43027f[_0x248d97(0x156)])){_0xfb019c[_0x248d97(0x167)](_0x55e8a7);if(_0x54194c[_0x248d97(0xfe)]){const _0xb3ccf7=yamlRuleToApi(_0x54194c[_0x248d97(0xfe)]),_0x4477a4=apiRuleToYaml(_0xb3ccf7);_0x3ae564[_0x248d97(0x7d)](_0x55e8a7,_0x4477a4);}}const _0x22ca13=new Map();let _0x2b0048=0x0;for(const [_0x54ba10,_0x2d691a]of _0x3ae564){const _0x317ee0=serializeExpandedRule(_0x2d691a,_0x3ae564),_0x34c350=_0x22ca13[_0x248d97(0x100)](_0x317ee0)||[];_0x34c350[_0x248d97(0x10d)]({'name':_0x54ba10,'index':_0x2b0048}),_0x22ca13[_0x248d97(0x7d)](_0x317ee0,_0x34c350),_0x2b0048++;}const _0x3f302d=new Map();for(const [_0x468d1c,_0x405352]of _0x22ca13){const _0x7ddafb=_0x405352['slice']()[_0x248d97(0xc4)]((_0x59aee5,_0x159b26)=>{const _0x34c6b7=_0x248d97,_0xc11e7a=_0x511f0b[_0x34c6b7(0x100)](_0x59aee5['name'])||0x0,_0x18e616=_0x511f0b[_0x34c6b7(0x100)](_0x159b26['name'])||0x0;if(_0xc11e7a!==_0x18e616)return _0x18e616-_0xc11e7a;return _0x59aee5[_0x34c6b7(0x124)]-_0x159b26[_0x34c6b7(0x124)];})[_0x248d97(0x136)](_0x3fc4f4=>_0x3fc4f4[_0x248d97(0xa3)]),_0x186f38=[];for(const _0x5550fb of _0x7ddafb){const _0x48c578=_0x511f0b[_0x248d97(0x100)](_0x5550fb)||0x0,_0x250f2e=Math['max'](_0x48c578,0x1);for(let _0x449294=0x0;_0x449294<_0x250f2e;_0x449294++){_0x186f38['push'](_0x5550fb);}}_0x3f302d[_0x248d97(0x7d)](_0x468d1c,_0x186f38);}return{'existingLocalSegmentNames':_0xfb019c,'localSegmentRules':_0x3ae564,'localExpandedRuleToNames':_0x3f302d};}export function createSegmentIdResolver(_0x59b06a,_0x3aee7b){return async _0x532100=>{const _0x52e4e2=a155_0x1494,_0x3bbbc8=_0x59b06a[_0x52e4e2(0x100)](_0x532100);if(!_0x3bbbc8)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x52e4e2(0xff)+_0x532100+_0x52e4e2(0x80)+_0x3aee7b+'\x27)');return _0x3bbbc8;};}export function extractRootFolderId(_0x35dee5){const _0x10797c=a155_0x50aee1;return _0x35dee5[_0x10797c(0xc7)]?.['parentSegmentFolder']?.[_0x10797c(0xb7)]?.['id']||_0x35dee5[_0x10797c(0xc7)]?.[_0x10797c(0x89)]?.[_0x10797c(0xb7)]?.['id'];}export function buildConnectionMaps(_0x4f38bf){const _0x55bcd3=a155_0x50aee1,_0x120911=new Map(),_0x18b56d=new Map(),_0x105561=new Map();for(const _0x1bbb89 of _0x4f38bf){_0x120911[_0x55bcd3(0x7d)](_0x1bbb89['name'],parseInt(_0x1bbb89['id'],0xa)),_0x18b56d[_0x55bcd3(0x7d)](_0x1bbb89['id'],_0x1bbb89[_0x55bcd3(0xa3)]),_0x105561[_0x55bcd3(0x7d)](_0x1bbb89[_0x55bcd3(0xa3)],_0x1bbb89[_0x55bcd3(0x102)]);}return{'nameToId':_0x120911,'idToName':_0x18b56d,'nameToType':_0x105561};}export function calculatePushStats(_0x1710b8,_0x58a952,_0x3644ad,_0x124830,_0x597ad4,_0xa0d640,_0x1e947e){const _0x37c555=a155_0x50aee1,_0x11ee02=_0x1710b8[_0x37c555(0x15e)](_0x22d112=>_0x22d112['isNew']),_0x226177=_0x1710b8[_0x37c555(0x15e)](_0x34d17a=>!_0x34d17a[_0x37c555(0xda)]&&_0x34d17a[_0x37c555(0x166)]),_0x153752=_0x1710b8[_0x37c555(0x15e)](_0x51e60b=>!_0x51e60b['isNew']&&!_0x51e60b[_0x37c555(0x166)]),_0x19a49e=_0xa0d640?_0x124830:[],_0x538cae=_0x58a952[_0x37c555(0x15e)](_0x14c5e6=>_0x14c5e6[_0x37c555(0xda)]),_0x487ad3=_0x58a952[_0x37c555(0x15e)](_0x50b4a3=>!_0x50b4a3[_0x37c555(0xda)]&&_0x50b4a3[_0x37c555(0x166)]),_0x3428bf=_0x58a952[_0x37c555(0x15e)](_0x49dbb7=>!_0x49dbb7[_0x37c555(0xda)]&&!_0x49dbb7[_0x37c555(0x166)]),_0x3354ee=_0xa0d640?_0x597ad4:[],_0x5e9e5e=_0x1710b8[_0x37c555(0x79)](_0x26a59a=>_0x26a59a[_0x37c555(0x90)]),_0x2623c1=_0x5e9e5e['filter'](_0x21c6f2=>_0x21c6f2[_0x37c555(0x102)]===_0x37c555(0x87)),_0x1dbb05=_0x5e9e5e['filter'](_0x176c15=>_0x176c15[_0x37c555(0x102)]===_0x37c555(0xd7)),_0x37aa1a=_0x5e9e5e[_0x37c555(0x15e)](_0x515c25=>_0x515c25[_0x37c555(0x102)]==='delete'),_0x22873d=Array[_0x37c555(0x164)](_0x3644ad)[_0x37c555(0xc4)](),_0x4213d3=_0x1e947e?![]:_0x11ee02[_0x37c555(0xd1)]>0x0||_0x226177[_0x37c555(0xd1)]>0x0||_0x19a49e[_0x37c555(0xd1)]>0x0,_0x496e85=_0x538cae[_0x37c555(0xd1)]>0x0||_0x487ad3[_0x37c555(0xd1)]>0x0||_0x3354ee['length']>0x0,_0x72d108=_0x1e947e?![]:_0x5e9e5e[_0x37c555(0xd1)]>0x0,_0x2d0d57=_0x22873d['length']>0x0;return{'segments':{'new':_0x11ee02,'changed':_0x226177,'unchanged':_0x153752,'toDelete':_0x19a49e},'journeys':{'new':_0x538cae,'changed':_0x487ad3,'unchanged':_0x3428bf,'toDelete':_0x3354ee},'activations':{'all':_0x5e9e5e,'toCreate':_0x2623c1,'toUpdate':_0x1dbb05,'toDelete':_0x37aa1a},'folders':{'toCreate':_0x22873d},'counts':{'segments':{'new':_0x11ee02[_0x37c555(0xd1)],'changed':_0x226177['length'],'unchanged':_0x153752['length'],'toDelete':_0x19a49e['length']},'journeys':{'new':_0x538cae['length'],'changed':_0x487ad3[_0x37c555(0xd1)],'unchanged':_0x3428bf[_0x37c555(0xd1)],'toDelete':_0x3354ee[_0x37c555(0xd1)]},'activations':{'create':_0x2623c1[_0x37c555(0xd1)],'update':_0x1dbb05[_0x37c555(0xd1)],'delete':_0x37aa1a[_0x37c555(0xd1)]},'folders':_0x22873d['length']},'hasChanges':_0x4213d3||_0x496e85||_0x72d108||_0x2d0d57};}export async function buildPushExecutionContext(_0x6987cf,_0x327217,_0x3bada9,_0x5c8051,_0x2392d8,_0x31c7f5){const _0x153646=a155_0x50aee1,_0x1ec90e=extractRootFolderId(_0x3bada9),{pathToId:_0x3e8722,idToPath:_0x51f191}=buildFolderMaps(_0x2392d8),_0x48976a=buildSegmentNameToIdMap(_0x5c8051),_0x15048d=new Map(),{batchAsync:_0x642942}=await import(_0x153646(0xcd)),[_0x5c2123,_0x443e44]=await Promise[_0x153646(0xe1)]([_0x6987cf['user']['buildUserMaps'](),_0x6987cf[_0x153646(0x12c)][_0x153646(0x119)](),((async()=>{!_0x31c7f5&&_0x5c8051['length']>0x0&&await _0x642942(_0x5c8051,async _0x57a782=>{const _0x149c5=a155_0x1494,_0x4aacd2=await _0x6987cf[_0x149c5(0xa7)][_0x149c5(0x12b)](_0x327217,_0x57a782['id']);_0x15048d[_0x149c5(0x7d)](_0x57a782['id'],_0x4aacd2);});})())]),{emailToId:_0x16d2b9,idToEmail:_0x1fa136}=_0x5c2123,_0x265d3d=buildConnectionMaps(_0x443e44);return{'rootFolderId':_0x1ec90e,'folderPathToId':_0x3e8722,'folderIdToPath':_0x51f191,'segmentNameToId':_0x48976a,'activationsBySegmentId':_0x15048d,'emailToIdMap':_0x16d2b9,'idToEmailMap':_0x1fa136,'connectionNameToIdMap':_0x265d3d[_0x153646(0x15c)],'connectionIdToNameMap':_0x265d3d[_0x153646(0x153)],'connectionNameToTypeMap':_0x265d3d[_0x153646(0xd4)]};}export function createPushYamlContextForBundle(_0x39bcd1,_0xc13b73,_0x388341,_0x5db2e0,_0x4e6380,_0x4a09b1,_0x2a4a27,_0x279939){const {existingLocalSegmentNames:_0x45af1b,localExpandedRuleToNames:_0x17fe00}=_0x5db2e0,_0x351acc=new Set(),_0xc25a17=new Map(),_0x4f4a12=new Map(),_0x50d26e=new Map(),_0x56ae6e=createJumpTargetCache(),_0x1f5097=new Map(),_0x33c6be=new Map(),_0x61640d=new Set();let _0x32b8db;const _0x56963f=_0x81ec25=>{const _0x25b67d={'resolveSegment':async _0x38f794=>{const _0x5a292b=a155_0x1494,_0x335032=_0x50d26e[_0x5a292b(0x100)](_0x38f794);if(_0x335032!==undefined)return{'name':_0x335032,'isJourneyLocal':!![]};try{const _0x84163e=await fetchSegment(_0x39bcd1,_0xc13b73,_0x38f794,_0x388341);if(!_0x84163e)throw new Error(_0x5a292b(0x13d));const _0x4c521f=generateJourneyLocalName(_0x84163e[_0x5a292b(0xa3)]),_0x4a0a4a=_0x84163e['kind']===SEGMENT_KIND_JOURNEY&&_0x4c521f!==undefined;let _0x23e37c=_0x84163e[_0x5a292b(0xa3)],_0x30c55c;if(_0x4a0a4a&&_0x84163e[_0x5a292b(0xfe)]){const _0x36e33c=apiRuleToYaml(_0x84163e[_0x5a292b(0xfe)]);_0x33c6be[_0x5a292b(0x7d)](_0x38f794,_0x36e33c);const _0x570adb=async _0x3caea3=>{const _0x50a85a=_0x5a292b,_0x1dac4c=collectSegmentRefsFromRule(_0x3caea3);for(const _0xf7c6e6 of _0x1dac4c){if(!_0x33c6be[_0x50a85a(0x125)](_0xf7c6e6))try{const _0x5b2e5f=await fetchSegment(_0x39bcd1,_0xc13b73,_0xf7c6e6,_0x388341);if(_0x5b2e5f?.['rule']){const _0x4adcc1=apiRuleToYaml(_0x5b2e5f[_0x50a85a(0xfe)]);_0x33c6be[_0x50a85a(0x7d)](_0xf7c6e6,_0x4adcc1),await _0x570adb(_0x4adcc1);}}catch(_0x5b09a6){logger[_0x50a85a(0xcf)](_0x50a85a(0x9d)+_0xf7c6e6+':\x20'+_0x5b09a6);}}};await _0x570adb(_0x36e33c);const _0x5eb151=serializeExpandedRule(_0x36e33c,_0x33c6be),_0x2ca7e4=_0x17fe00[_0x5a292b(0x100)](_0x5eb151);if(_0x2ca7e4&&_0x2ca7e4[_0x5a292b(0xd1)]>0x0){const _0x1ccb5c=_0xc25a17['get'](_0x5eb151)||0x0,_0xca6fec=_0x2ca7e4[_0x1ccb5c]||_0x2ca7e4[_0x2ca7e4[_0x5a292b(0xd1)]-0x1];_0xc25a17[_0x5a292b(0x7d)](_0x5eb151,_0x1ccb5c+0x1),_0x23e37c=_0xca6fec,_0x351acc[_0x5a292b(0x167)](_0x23e37c),_0x50d26e[_0x5a292b(0x7d)](_0x38f794,_0x23e37c);const _0x125dd3=await resolveRuleSegmentRefs(_0x36e33c,async _0x5b5c2c=>{const _0x5d3531=_0x5a292b,_0x5175dc=_0x50d26e[_0x5d3531(0x100)](_0x5b5c2c);if(_0x5175dc)return _0x5175dc;const _0x8b80d0=await _0x32b8db[_0x5d3531(0x17e)](_0x5b5c2c);return _0x8b80d0[_0x5d3531(0xa3)];});_0x30c55c={'description':_0x84163e[_0x5a292b(0x174)],'rule':_0x125dd3};}else{const _0x57e02e=_0x1f5097['get'](_0x5eb151);if(_0x57e02e)_0x23e37c=_0x57e02e,_0x50d26e[_0x5a292b(0x7d)](_0x38f794,_0x23e37c);else{if(_0x4c521f){let _0x3bc99b=_0x4c521f,_0x36ec99=0x2;while(_0x351acc['has'](_0x3bc99b)||_0x45af1b['has'](_0x3bc99b)){_0x3bc99b=_0x4c521f+'_'+_0x36ec99,_0x36ec99++;}_0x351acc[_0x5a292b(0x167)](_0x3bc99b),_0x23e37c=_0x3bc99b;}_0x50d26e[_0x5a292b(0x7d)](_0x38f794,_0x23e37c),_0x1f5097[_0x5a292b(0x7d)](_0x5eb151,_0x23e37c);const _0x2771fe=await resolveRuleSegmentRefs(_0x36e33c,async _0xfe1871=>{const _0x35cebb=_0x5a292b,_0x11cafb=_0x50d26e[_0x35cebb(0x100)](_0xfe1871);if(_0x11cafb)return _0x11cafb;const _0x4c572b=await _0x32b8db[_0x35cebb(0x17e)](_0xfe1871);return _0x4c572b[_0x35cebb(0xa3)];});_0x30c55c={'description':_0x84163e[_0x5a292b(0x174)],'rule':_0x2771fe};}}}return{'name':_0x23e37c,'isJourneyLocal':_0x4a0a4a,'definition':_0x30c55c};}catch(_0x34389d){return logger[_0x5a292b(0xcf)](_0x5a292b(0xec)+_0x38f794+':\x20'+_0x34389d),{'name':_0x38f794,'isJourneyLocal':![]};}},'resolveActivation':async _0x588962=>{const _0x46ab04=a155_0x1494,_0x3e4282=_0x4f4a12[_0x46ab04(0x100)](_0x588962);if(_0x3e4282!==undefined)return{'name':_0x3e4282,'isJourneyLocal':!![]};try{let _0x167dd8=_0x2a4a27?.[_0x46ab04(0x100)](_0x588962);!_0x167dd8&&(_0x167dd8=await _0x39bcd1['journey'][_0x46ab04(0x17d)](_0x81ec25,_0x588962));const _0x6b0cd=_0x167dd8[_0x46ab04(0x108)][_0x46ab04(0x17c)]['name']||_0x588962,_0x32266d=sanitizeYamlKey(_0x6b0cd)||_0x46ab04(0xa0)+_0x588962,_0x1e119f=_0x32266d;_0x4f4a12[_0x46ab04(0x7d)](_0x588962,_0x1e119f);const _0x41f506=journeyActivationStepToYaml(_0x167dd8,_0x4e6380,_0x4a09b1);return{'name':_0x1e119f,'isJourneyLocal':!![],'definition':_0x41f506};}catch(_0x57e7d2){return logger[_0x46ab04(0xcf)](_0x46ab04(0x13f)+_0x588962+':\x20'+_0x57e7d2),{'name':_0x588962,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x54a17d,_0x1f6b7d)=>resolveJumpTarget(_0x54a17d,_0x1f6b7d,_0x56ae6e,async _0x47f1bc=>{const _0x3c03c0=a155_0x1494,_0x30be09=_0x279939?.[_0x3c03c0(0x100)](_0x47f1bc);if(_0x30be09)return _0x30be09;return _0x39bcd1['journey'][_0x3c03c0(0xd8)](_0x47f1bc);})};return _0x32b8db=_0x25b67d,_0x25b67d;},_0x3f4ea1=async _0xee3b88=>{const _0x5916d4=a155_0x1494,{collectSegmentIdsFromJourneyApi:_0x30867a}=await import(_0x5916d4(0xa5)),{batchAsync:_0x2071b5}=await import('../../utils/async.js'),_0x5ea57b=new Set();for(const _0x27e892 of _0xee3b88){let _0x562fe6=_0x279939?.[_0x5916d4(0x100)](_0x27e892);!_0x562fe6&&(_0x562fe6=await _0x39bcd1[_0x5916d4(0x84)][_0x5916d4(0xd8)](_0x27e892));const _0x47e9b7=_0x30867a(_0x562fe6);for(const _0x54953b of _0x47e9b7){_0x5ea57b[_0x5916d4(0x167)](_0x54953b);}}let _0x1c1722=Array[_0x5916d4(0x164)](_0x5ea57b);while(_0x1c1722['length']>0x0){const _0x401b3a=_0x1c1722[_0x5916d4(0x15e)](_0x4bb9fa=>!_0x61640d[_0x5916d4(0x125)](_0x4bb9fa));if(_0x401b3a['length']===0x0)break;const _0x2151bd=await _0x2071b5(_0x401b3a,async _0x3ecba9=>{const _0x2e8bc2=_0x5916d4;_0x61640d[_0x2e8bc2(0x167)](_0x3ecba9);const _0x5ea434=await fetchSegment(_0x39bcd1,_0xc13b73,_0x3ecba9,_0x388341);if(!_0x5ea434)return null;return{'segmentId':_0x3ecba9,'segment':_0x5ea434};},0xa),_0x564370=new Set();for(const _0x15efe7 of _0x2151bd){if(!_0x15efe7?.[_0x5916d4(0xa7)]?.[_0x5916d4(0xfe)])continue;const _0x11e207=apiRuleToYaml(_0x15efe7[_0x5916d4(0xa7)][_0x5916d4(0xfe)]);_0x33c6be[_0x5916d4(0x7d)](_0x15efe7[_0x5916d4(0x11a)],_0x11e207);const _0x2ff607=collectSegmentRefsFromRule(_0x11e207);for(const _0x2162ed of _0x2ff607){!_0x61640d['has'](_0x2162ed)&&_0x564370[_0x5916d4(0x167)](_0x2162ed);}}_0x1c1722=Array[_0x5916d4(0x164)](_0x564370);}};return{'createYamlContext':_0x56963f,'prefetchJourneySegments':_0x3f4ea1};}export async function executePushSegments(_0x49bb7d,_0x1237ef,_0x210b07,_0x44b4b2,_0x5cb7ed){const _0x2d9f96=a155_0x50aee1,{segmentDefToCreateRequest:_0x47365e,segmentDefToUpdateRequest:_0x519f9d}=await import(_0x2d9f96(0xe8)),_0x33daa2=_0x210b07[_0x2d9f96(0x150)],_0x57696e=0x5,_0x2f9b5b=async _0x572e3e=>{const _0x2d8c35=_0x2d9f96,_0x3b61fd=_0x572e3e[_0x2d8c35(0xc6)]?_0x33daa2[_0x2d8c35(0x100)](_0x572e3e['folderPath']):undefined;let _0x5c83e4;const _0x55728d={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x2c268e=_0x572e3e[_0x2d8c35(0xc2)];if(_0x572e3e[_0x2d8c35(0xc2)]['rule']){const _0x4903bb=createSegmentIdResolver(_0x210b07['segmentNameToId'],_0x572e3e[_0x2d8c35(0xc2)][_0x2d8c35(0xa3)]),_0x4ea86c=await resolveRuleSegmentIds(_0x572e3e[_0x2d8c35(0xc2)]['rule'],_0x4903bb);_0x2c268e={..._0x572e3e['yamlConfig'],'rule':_0x4ea86c};}try{if(_0x572e3e[_0x2d8c35(0xda)]){_0x5cb7ed['onProgress']?.({'type':_0x2d8c35(0x105),'name':_0x572e3e[_0x2d8c35(0xc2)][_0x2d8c35(0xa3)]});const _0x1b07a4=_0x47365e(_0x2c268e,_0x3b61fd),_0xdfc9e9=await _0x5cb7ed['withProgress']('Creating\x20segment\x20\x27'+_0x572e3e[_0x2d8c35(0xc2)][_0x2d8c35(0xa3)]+_0x2d8c35(0x7c),()=>_0x49bb7d[_0x2d8c35(0xa7)]['createSegment'](_0x44b4b2[_0x2d8c35(0x142)],_0x1b07a4));_0x5c83e4=_0xdfc9e9[_0x2d8c35(0xb7)]['id'],_0x210b07['segmentNameToId'][_0x2d8c35(0x7d)](_0x572e3e[_0x2d8c35(0xc2)][_0x2d8c35(0xa3)],_0x5c83e4),_0x55728d[_0x2d8c35(0x10f)]={'name':_0x572e3e[_0x2d8c35(0xc2)][_0x2d8c35(0xa3)],'id':_0x5c83e4},_0x5cb7ed['onProgress']?.({'type':_0x2d8c35(0x82),'name':_0x572e3e['yamlConfig']['name'],'segmentId':_0x5c83e4}),_0x5cb7ed[_0x2d8c35(0xb8)]?.(_0x2d8c35(0x140)+_0x572e3e[_0x2d8c35(0xc2)]['name']+'\x27'),_0x55728d[_0x2d8c35(0x16e)]=0x1;}else{if(_0x572e3e['hasChanges']){_0x5cb7ed[_0x2d8c35(0x9c)]?.({'type':_0x2d8c35(0x17b),'name':_0x572e3e[_0x2d8c35(0xc2)]['name']});const _0x4e8b26=_0x519f9d(_0x2c268e);_0x3b61fd!==_0x572e3e[_0x2d8c35(0xaa)]?.[_0x2d8c35(0x8e)]&&(_0x4e8b26[_0x2d8c35(0x8e)]=_0x3b61fd?parseInt(_0x3b61fd,0xa):undefined),await _0x5cb7ed['withProgress'](_0x2d8c35(0xc8)+_0x572e3e[_0x2d8c35(0xc2)][_0x2d8c35(0xa3)]+_0x2d8c35(0x7c),()=>_0x49bb7d[_0x2d8c35(0xa7)][_0x2d8c35(0xa1)](_0x44b4b2[_0x2d8c35(0x142)],_0x572e3e[_0x2d8c35(0xaa)]['id'],_0x4e8b26)),_0x5c83e4=_0x572e3e[_0x2d8c35(0xaa)]['id'],_0x5cb7ed[_0x2d8c35(0x9c)]?.({'type':_0x2d8c35(0xc3),'name':_0x572e3e['yamlConfig']['name']}),_0x5cb7ed[_0x2d8c35(0xb8)]?.(_0x2d8c35(0x10e)+_0x572e3e[_0x2d8c35(0xc2)][_0x2d8c35(0xa3)]+'\x27'),_0x55728d[_0x2d8c35(0x139)]=0x1;}else _0x5c83e4=_0x572e3e[_0x2d8c35(0xaa)]['id'];}}catch(_0x18f10b){const _0x3c10bd=isHttp400Error(_0x18f10b),_0x2eed67=_0x3c10bd?ErrorCode[_0x2d8c35(0x155)]:ErrorCode[_0x2d8c35(0x13a)],_0x1eaa9a=getErrorMessage(_0x18f10b);throw new SDKError(_0x2eed67,_0x2d8c35(0x114)+(_0x572e3e[_0x2d8c35(0xda)]?_0x2d8c35(0x87):_0x2d8c35(0xd7))+'\x20segment\x20from\x20file:\x20'+_0x572e3e[_0x2d8c35(0xdb)]+'\x0a\x20\x20'+_0x1eaa9a,_0x18f10b);}try{const _0x3beeac=await syncActivationsForSegment(_0x49bb7d,_0x44b4b2['parentId'],_0x5c83e4,_0x572e3e[_0x2d8c35(0xc2)][_0x2d8c35(0xa3)],_0x572e3e[_0x2d8c35(0x90)],_0x5cb7ed,_0x572e3e[_0x2d8c35(0xdb)]);_0x55728d[_0x2d8c35(0xe7)]=_0x3beeac;}catch(_0x115a89){if(_0x115a89 instanceof SDKError)throw _0x115a89;throw new SDKError(ErrorCode[_0x2d8c35(0xf5)],_0x2d8c35(0xfd)+_0x572e3e[_0x2d8c35(0xc2)][_0x2d8c35(0xa3)]+_0x2d8c35(0x10a)+_0x572e3e[_0x2d8c35(0xdb)]+_0x2d8c35(0x13b)+getErrorMessage(_0x115a89),_0x115a89);}return _0x55728d;},_0x5c8126=await batchAsync(_0x1237ef,_0x2f9b5b,_0x57696e),_0x48d36c={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x2ee420 of _0x5c8126){_0x48d36c['created']+=_0x2ee420[_0x2d9f96(0x16e)],_0x48d36c['updated']+=_0x2ee420['updated'],_0x2ee420[_0x2d9f96(0x10f)]&&_0x48d36c[_0x2d9f96(0xbb)][_0x2d9f96(0x7d)](_0x2ee420[_0x2d9f96(0x10f)][_0x2d9f96(0xa3)],_0x2ee420[_0x2d9f96(0x10f)]['id']),_0x48d36c[_0x2d9f96(0xe7)][_0x2d9f96(0x16e)]+=_0x2ee420[_0x2d9f96(0xe7)][_0x2d9f96(0x16e)],_0x48d36c[_0x2d9f96(0xe7)][_0x2d9f96(0x139)]+=_0x2ee420['activations'][_0x2d9f96(0x139)],_0x48d36c['activations'][_0x2d9f96(0x129)]+=_0x2ee420['activations']['deleted'];}return _0x48d36c;}async function syncActivationsForSegment(_0x2e83eb,_0x3ddcd9,_0x34c118,_0x25ebb5,_0x258d00,_0x30ea52,_0x5296f4){const _0x3d11a9=a155_0x50aee1,_0x53ca63={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x38e192 of _0x258d00){try{if(_0x38e192['type']===_0x3d11a9(0x87)&&_0x38e192[_0x3d11a9(0xd6)])_0x30ea52[_0x3d11a9(0x9c)]?.({'type':'activation_creating','segmentName':_0x25ebb5,'activationName':_0x38e192['name']}),await _0x30ea52['withProgress'](_0x3d11a9(0x16b)+_0x38e192[_0x3d11a9(0xa3)]+_0x3d11a9(0x7c),()=>_0x2e83eb['segment'][_0x3d11a9(0x8f)](_0x3ddcd9,_0x34c118,_0x38e192[_0x3d11a9(0xd6)])),_0x30ea52['onProgress']?.({'type':_0x3d11a9(0x176),'segmentName':_0x25ebb5,'activationName':_0x38e192[_0x3d11a9(0xa3)]}),_0x30ea52[_0x3d11a9(0xb8)]?.(_0x3d11a9(0x7f)+_0x38e192[_0x3d11a9(0xa3)]+'\x27'),_0x53ca63[_0x3d11a9(0x16e)]++;else{if(_0x38e192[_0x3d11a9(0x102)]===_0x3d11a9(0xd7)&&_0x38e192['validatedRequest']&&_0x38e192[_0x3d11a9(0x88)])_0x30ea52[_0x3d11a9(0x9c)]?.({'type':'activation_updating','segmentName':_0x25ebb5,'activationName':_0x38e192[_0x3d11a9(0xa3)]}),await _0x30ea52['withProgress']('Updating\x20activation\x20\x27'+_0x38e192[_0x3d11a9(0xa3)]+_0x3d11a9(0x7c),()=>_0x2e83eb[_0x3d11a9(0xa7)]['updateActivation'](_0x3ddcd9,_0x34c118,_0x38e192[_0x3d11a9(0x88)]['id'],_0x38e192['validatedRequest'])),_0x30ea52[_0x3d11a9(0x9c)]?.({'type':'activation_updated','segmentName':_0x25ebb5,'activationName':_0x38e192[_0x3d11a9(0xa3)]}),_0x30ea52[_0x3d11a9(0xb8)]?.('Updated\x20activation\x20\x27'+_0x38e192[_0x3d11a9(0xa3)]+'\x27'),_0x53ca63[_0x3d11a9(0x139)]++;else _0x38e192[_0x3d11a9(0x102)]===_0x3d11a9(0x160)&&_0x38e192[_0x3d11a9(0x88)]&&(_0x30ea52[_0x3d11a9(0x9c)]?.({'type':_0x3d11a9(0x152),'segmentName':_0x25ebb5,'activationName':_0x38e192[_0x3d11a9(0xa3)]}),await _0x30ea52['withProgress'](_0x3d11a9(0xe2)+_0x38e192['name']+_0x3d11a9(0x7c),()=>_0x2e83eb[_0x3d11a9(0xa7)]['deleteActivation'](_0x3ddcd9,_0x34c118,_0x38e192[_0x3d11a9(0x88)]['id'])),_0x30ea52[_0x3d11a9(0x9c)]?.({'type':_0x3d11a9(0x78),'segmentName':_0x25ebb5,'activationName':_0x38e192[_0x3d11a9(0xa3)]}),_0x30ea52[_0x3d11a9(0x94)]?.(_0x3d11a9(0x8a)+_0x38e192[_0x3d11a9(0xa3)]+'\x27'),_0x53ca63[_0x3d11a9(0x129)]++);}}catch(_0x3d998c){const _0x24ea4a=isHttp400Error(_0x3d998c),_0x61b44a=_0x24ea4a?ErrorCode[_0x3d11a9(0x7a)]:ErrorCode[_0x3d11a9(0xf5)],_0x434f8b=getErrorMessage(_0x3d998c);throw new SDKError(_0x61b44a,_0x3d11a9(0x114)+_0x38e192[_0x3d11a9(0x102)]+'\x20activation\x20\x27'+_0x38e192[_0x3d11a9(0xa3)]+_0x3d11a9(0x10a)+_0x5296f4+'\x0a\x20\x20'+_0x434f8b,_0x3d998c);}}return _0x53ca63;}export async function executePushFolders(_0x4e39a5,_0x4f8f7d,_0x3ee285,_0x2a4610,_0x5666fb){const _0x533b0d=a155_0x50aee1,_0x1f51c=new Map(_0x3ee285),_0x50812f=sortFoldersByDepth(_0x4f8f7d);for(const _0x5568bc of _0x50812f){const _0x176268=_0x5568bc[_0x533b0d(0x11f)]('/'),_0x3043ac=_0x176268[_0x176268['length']-0x1],_0x57e863=_0x176268[_0x533b0d(0x8b)](0x0,-0x1)['join']('/'),_0x53b1e7=_0x1f51c[_0x533b0d(0x100)](_0x57e863);_0x5666fb['onProgress']?.({'type':_0x533b0d(0x9a),'folder':_0x5568bc});const _0x3945d9={'name':_0x3043ac,'parentFolderId':_0x53b1e7},_0x406a95=await _0x5666fb[_0x533b0d(0xa8)](_0x533b0d(0xf8)+_0x5568bc+'\x27...',()=>_0x4e39a5[_0x533b0d(0xa7)][_0x533b0d(0x157)](_0x2a4610[_0x533b0d(0x142)],_0x3945d9));_0x1f51c[_0x533b0d(0x7d)](_0x5568bc,_0x406a95[_0x533b0d(0xb7)]['id']),_0x5666fb[_0x533b0d(0x9c)]?.({'type':_0x533b0d(0x103),'folder':_0x5568bc,'folderId':_0x406a95[_0x533b0d(0xb7)]['id']}),_0x5666fb[_0x533b0d(0x12f)]?.(_0x533b0d(0x85)+_0x5568bc+'\x27');}return _0x1f51c;}export async function executePushSegmentDeletions(_0x397910,_0x10ad72,_0x4de12b){const _0x4f5e81=a155_0x50aee1;if(_0x10ad72[_0x4f5e81(0xd1)]===0x0)return 0x0;const {batchAsync:_0x186238}=await import(_0x4f5e81(0xcd)),_0x514161=0x5,_0x4d4c64=await _0x186238(_0x10ad72,async _0x20ea8d=>{const _0x352288=_0x4f5e81;return _0x4de12b[_0x352288(0x9c)]?.({'type':'segment_deleting','name':_0x20ea8d[_0x352288(0xa3)]}),await _0x397910[_0x352288(0xa7)][_0x352288(0xd5)](_0x20ea8d['id']),_0x4de12b[_0x352288(0x9c)]?.({'type':_0x352288(0x141),'name':_0x20ea8d[_0x352288(0xa3)]}),_0x4de12b[_0x352288(0x94)]?.('Deleted\x20segment\x20\x27'+_0x20ea8d[_0x352288(0xa3)]+'\x27'),0x1;},_0x514161);return _0x4d4c64[_0x4f5e81(0xa6)]((_0x3c5574,_0x74bdb3)=>_0x3c5574+_0x74bdb3,0x0);}export async function executePushJourneys(_0xcfee1,_0x5c7743,_0x5a1064,_0x20ad1a,_0x1344af){const _0x2a30c8=a155_0x50aee1,{journeyDefToRequest:_0x51a5c4}=await import(_0x2a30c8(0xa5)),{activationDefToCreateRequest:_0x3ec110,yamlRuleToApi:_0x34c287,validateSegmentRule:_0x35d3a6}=await import(_0x2a30c8(0xe8)),_0x5479d7={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x103bef=new Map(_0x5a1064['segmentNameToId']),_0x15bf0b=0x5;for(let _0x3cecff=0x0;_0x3cecff<_0x5c7743[_0x2a30c8(0xd1)];_0x3cecff+=_0x15bf0b){const _0x229539=_0x5c7743['slice'](_0x3cecff,_0x3cecff+_0x15bf0b),_0x957928=await Promise[_0x2a30c8(0xe1)](_0x229539['map'](async _0x8e200d=>{const _0x2fe9d4=_0x2a30c8;if(!_0x8e200d[_0x2fe9d4(0xda)]&&!_0x8e200d[_0x2fe9d4(0x166)])return{'action':_0x2fe9d4(0xac),'name':_0x8e200d[_0x2fe9d4(0xc2)]['name'],'journeyId':_0x8e200d[_0x2fe9d4(0xe0)]?.['id']};const _0x133e33=_0x8e200d[_0x2fe9d4(0xc6)]?_0x5a1064[_0x2fe9d4(0x150)][_0x2fe9d4(0x100)](_0x8e200d[_0x2fe9d4(0xc6)]):undefined;_0x1344af[_0x2fe9d4(0x9c)]?.({'type':_0x8e200d['isNew']?_0x2fe9d4(0x104):_0x2fe9d4(0x172),'name':_0x8e200d['yamlConfig']['name']});try{const _0x447b2b=await executeSingleJourneyPush(_0xcfee1,_0x8e200d,{..._0x5a1064,'segmentNameToId':_0x103bef},{'parentId':_0x20ad1a[_0x2fe9d4(0x142)],'rootFolderId':_0x20ad1a[_0x2fe9d4(0xfb)],'folderId':_0x133e33,'verbose':_0x20ad1a[_0x2fe9d4(0xb0)]},_0x1344af,{'journeyDefToRequest':_0x51a5c4,'activationDefToCreateRequest':_0x3ec110,'yamlRuleToApi':_0x34c287,'validateSegmentRule':_0x35d3a6});for(const [_0x151924,_0x40ac7a]of _0x447b2b[_0x2fe9d4(0x144)]){_0x103bef[_0x2fe9d4(0x7d)](_0x151924,_0x40ac7a),_0x5479d7['embeddedSegmentNameToId'][_0x2fe9d4(0x7d)](_0x151924,_0x40ac7a);}if(_0x447b2b[_0x2fe9d4(0xb2)]==='created')_0x1344af['onProgress']?.({'type':_0x2fe9d4(0x17f),'name':_0x8e200d[_0x2fe9d4(0xc2)][_0x2fe9d4(0xa3)],'journeyId':_0x447b2b['journeyId']}),_0x1344af[_0x2fe9d4(0xb8)]?.('Created\x20journey\x20\x27'+_0x8e200d[_0x2fe9d4(0xc2)][_0x2fe9d4(0xa3)]+'\x27'),_0x5479d7[_0x2fe9d4(0x16e)]++;else _0x447b2b[_0x2fe9d4(0xb2)]==='updated'&&(_0x1344af['onProgress']?.({'type':_0x2fe9d4(0x98),'name':_0x8e200d['yamlConfig'][_0x2fe9d4(0xa3)]}),_0x1344af[_0x2fe9d4(0xb8)]?.(_0x2fe9d4(0x91)+_0x8e200d[_0x2fe9d4(0xc2)][_0x2fe9d4(0xa3)]+'\x27'),_0x5479d7[_0x2fe9d4(0x139)]++);return{'action':_0x447b2b[_0x2fe9d4(0xb2)],'name':_0x8e200d[_0x2fe9d4(0xc2)][_0x2fe9d4(0xa3)],'journeyId':_0x447b2b[_0x2fe9d4(0x117)]};}catch(_0x5a291a){const _0x312fc6=isHttp400Error(_0x5a291a),_0xaad62c=_0x312fc6?ErrorCode[_0x2fe9d4(0x134)]:ErrorCode[_0x2fe9d4(0xcc)],_0x4bb872=getErrorMessage(_0x5a291a);throw new SDKError(_0xaad62c,_0x2fe9d4(0x114)+(_0x8e200d['isNew']?_0x2fe9d4(0x87):_0x2fe9d4(0xd7))+_0x2fe9d4(0x173)+_0x8e200d['absolutePath']+_0x2fe9d4(0x13b)+_0x4bb872,_0x5a291a);}}));_0x5479d7['results'][_0x2a30c8(0x10d)](..._0x957928);}return _0x5479d7;}async function matchExistingJourneySegments(_0x2fcfdd,_0xbd1845,_0x54461f,_0x24fd55,_0x285b72){const _0x6e452a=a155_0x50aee1;if(!_0xbd1845[_0x6e452a(0xe0)]||!_0xbd1845[_0x6e452a(0xc2)][_0x6e452a(0x156)])return;const _0x562d1a=new Map(),_0x34c46c=new Set();for(const _0x4d5289 of Object[_0x6e452a(0xc0)](_0xbd1845[_0x6e452a(0xc2)][_0x6e452a(0x156)])){const _0x1561b3=generateDeterministicJourneySegmentName(_0xbd1845[_0x6e452a(0xc2)][_0x6e452a(0xa3)],_0x4d5289);_0x562d1a['set'](_0x1561b3,_0x4d5289),_0x34c46c[_0x6e452a(0x167)](_0x4d5289);}const _0x3f6aac=[],_0x2f705f=collectSegmentIdsFromJourneyApi(_0xbd1845['existingJourney']);for(const _0x5ef7a5 of _0x2f705f){const _0xa0b0d1=await fetchSegment(_0x2fcfdd,_0x54461f,_0x5ef7a5,_0x24fd55);if(!_0xa0b0d1?.[_0x6e452a(0xa3)])continue;const _0x5f5054=_0x562d1a[_0x6e452a(0x100)](_0xa0b0d1[_0x6e452a(0xa3)]);_0x5f5054?(_0x285b72['set'](_0x5f5054,_0x5ef7a5),_0x34c46c[_0x6e452a(0x160)](_0x5f5054)):_0x3f6aac[_0x6e452a(0x10d)]({'id':_0x5ef7a5,'seg':_0xa0b0d1});}if(_0x34c46c[_0x6e452a(0x14d)]>0x0&&_0x3f6aac[_0x6e452a(0xd1)]>0x0){const {localExpandedRuleToNames:_0x24543a}=buildLocalExpandedRuleMappings(_0xbd1845['yamlConfig']),_0x5bda60=new Map();for(const {id:_0xe8a8c7,seg:_0x485919}of _0x3f6aac){if(_0x485919['rule']){const _0x4354db=apiRuleToYaml(_0x485919[_0x6e452a(0xfe)]);_0x5bda60[_0x6e452a(0x7d)](_0xe8a8c7,_0x4354db);}}for(const {id:_0xb680c4,seg:_0x129284}of _0x3f6aac){if(!_0x129284[_0x6e452a(0xfe)])continue;const _0x42690a=_0x5bda60[_0x6e452a(0x100)](_0xb680c4);if(!_0x42690a)continue;const _0x2de0aa=serializeExpandedRule(_0x42690a,_0x5bda60),_0x2d1d3b=_0x24543a[_0x6e452a(0x100)](_0x2de0aa);if(_0x2d1d3b){const _0xfa9c89=_0x2d1d3b['find'](_0x51051d=>_0x34c46c['has'](_0x51051d));_0xfa9c89&&(_0x285b72[_0x6e452a(0x7d)](_0xfa9c89,_0xb680c4),_0x34c46c[_0x6e452a(0x160)](_0xfa9c89),logger[_0x6e452a(0xcf)](_0x6e452a(0xfa)+_0x129284[_0x6e452a(0xa3)]+_0x6e452a(0x128)+_0xfa9c89+'\x27\x20by\x20rule\x20content'));}}}}async function executeSingleJourneyPush(_0x25e109,_0x14c1cc,_0x3bdd23,_0x163caa,_0x32db20,_0x4553b3){const _0xec0b3a=a155_0x50aee1,{journeyDefToRequest:_0x5003da,activationDefToCreateRequest:_0x3686ae,yamlRuleToApi:_0x4bd32a,validateSegmentRule:_0x1ac64f}=_0x4553b3,_0x1c6c72=new Map(),_0x4e417a=new Map();recoverSegmentIdsFromPushRecovery(_0x14c1cc,_0x1c6c72,_0x3bdd23['segmentNameToId']);const _0x5b9bb4=new Map(),_0x337d2d=new Map(),_0x2c0769=new Map();let _0x27491d;const _0x547577=async()=>{const _0x2a0f7d=a155_0x1494;if(_0x27491d)return;_0x27491d=new Map();if(!_0x14c1cc[_0x2a0f7d(0xe0)])return;const _0x29394d=await _0x25e109['journey'][_0x2a0f7d(0x12b)](_0x14c1cc[_0x2a0f7d(0xe0)]['id']);for(const _0x2be7c2 of _0x29394d){const _0x5d1aeb=journeyActivationStepToYaml(_0x2be7c2,_0x3bdd23['idToEmailMap'],_0x3bdd23[_0x2a0f7d(0x13c)]),_0x576594=activationSignature(_0x5d1aeb);!_0x27491d[_0x2a0f7d(0x125)](_0x576594)&&_0x27491d[_0x2a0f7d(0x7d)](_0x576594,_0x2be7c2['id']),_0x5d1aeb['name']&&_0x4e417a['set'](_0x5d1aeb[_0x2a0f7d(0xa3)],_0x2be7c2['id']);}};await matchExistingJourneySegments(_0x25e109,_0x14c1cc,_0x163caa[_0xec0b3a(0x142)],_0x3bdd23['existingSegments'],_0x3bdd23[_0xec0b3a(0x145)]);const _0x305024={'resolveSegmentId':async _0x6a10a7=>{const _0xe017b6=_0xec0b3a,_0x308d97=_0x3bdd23['segmentNameToId'][_0xe017b6(0x100)](_0x6a10a7);if(!_0x308d97)throw new SDKError(ErrorCode[_0xe017b6(0xca)],_0xe017b6(0xff)+_0x6a10a7+_0xe017b6(0x16c)+_0x14c1cc['yamlConfig']['name']+')');return _0x308d97;},'resolveEmbeddedSegmentId':async(_0x496a9b,_0x4416d4)=>{const _0x57042b=_0xec0b3a,_0x2b0420=_0x3bdd23[_0x57042b(0x145)][_0x57042b(0x100)](_0x496a9b);if(_0x2b0420)return _0x2b0420;const _0x50ecef=_0x3bdd23[_0x57042b(0xd9)][_0x57042b(0xcb)](_0x22c06b=>_0x22c06b[_0x57042b(0xa3)]===_0x496a9b);if(_0x50ecef)return _0x3bdd23[_0x57042b(0x145)][_0x57042b(0x7d)](_0x496a9b,_0x50ecef['id']),_0x50ecef['id'];if(_0x14c1cc[_0x57042b(0xda)]){const {stageName:_0x418ecf,criteriaName:_0x7b874b}=findSegmentCriteriaLocation(_0x14c1cc[_0x57042b(0xc2)],_0x496a9b);return _0x1ac64f(_0x496a9b,_0x4416d4[_0x57042b(0xfe)]),_0x337d2d[_0x57042b(0x7d)](_0x496a9b,{'definition':_0x4416d4,'stageName':_0x418ecf,'criteriaName':_0x7b874b}),createPendingSegmentId(_0x496a9b);}const _0x3b4bfa=_0x14c1cc[_0x57042b(0xe0)]?.['id'];if(!_0x3b4bfa)throw new SDKError(ErrorCode[_0x57042b(0xef)],_0x57042b(0xf9));const _0x5007a8=_0x5b9bb4[_0x57042b(0x100)](_0x496a9b);if(_0x5007a8)return _0x5007a8;const _0x275411=((async()=>{const _0x31d853=_0x57042b;_0x1ac64f(_0x496a9b,_0x4416d4[_0x31d853(0xfe)]);const _0x4451c3=generateDeterministicJourneySegmentName(_0x14c1cc[_0x31d853(0xc2)]['name'],_0x496a9b),_0x25b35c=_0x3bdd23['existingSegments'][_0x31d853(0xcb)](_0x4d07d7=>_0x4d07d7[_0x31d853(0xa3)]===_0x4451c3),_0x2708f9=createSegmentIdResolver(_0x3bdd23[_0x31d853(0x145)],_0x496a9b),_0x536e39=await resolveRuleSegmentIds(_0x4416d4['rule'],_0x2708f9);let _0x289320;return _0x25b35c?(await _0x25e109['segment'][_0x31d853(0xa1)](_0x163caa[_0x31d853(0x142)],_0x25b35c['id'],{'description':_0x4416d4[_0x31d853(0x174)]||_0x31d853(0x115)+_0x496a9b,'rule':_0x4bd32a(_0x536e39),'countPopulation':!![]}),_0x289320=_0x25b35c['id'],saveSegmentToPushRecovery(_0x14c1cc['absolutePath'],_0x14c1cc[_0x31d853(0xc2)][_0x31d853(0xa3)],_0x496a9b,{'segmentId':_0x289320,'uniqueServerName':_0x4451c3,'createdAt':new Date()[_0x31d853(0xed)]()})):_0x289320=await createOrRecoverEmbeddedSegment(_0x25e109,_0x14c1cc,{'localName':_0x496a9b,'uniqueSegmentName':_0x4451c3,'description':_0x4416d4[_0x31d853(0x174)]||_0x31d853(0x115)+_0x496a9b,'journeyId':_0x3b4bfa,'resolvedRule':_0x536e39,'parentId':_0x163caa[_0x31d853(0x142)],'folderId':_0x163caa[_0x31d853(0xfb)]||''},_0x4bd32a),_0x3bdd23[_0x31d853(0x145)][_0x31d853(0x7d)](_0x496a9b,_0x289320),_0x1c6c72[_0x31d853(0x7d)](_0x496a9b,_0x289320),_0x289320;})());_0x5b9bb4[_0x57042b(0x7d)](_0x496a9b,_0x275411);try{return await _0x275411;}finally{_0x5b9bb4[_0x57042b(0x160)](_0x496a9b);}},'resolveActivationId':async _0x216be9=>{const _0x5270b9=_0xec0b3a,_0x4969ab=_0x4e417a[_0x5270b9(0x100)](_0x216be9);if(_0x4969ab)return _0x4969ab;if(_0x14c1cc[_0x5270b9(0xe0)]){await _0x547577();const _0x2986c3=_0x4e417a['get'](_0x216be9);if(_0x2986c3)return _0x2986c3;}throw new SDKError(ErrorCode[_0x5270b9(0x147)],_0x5270b9(0x15d)+_0x216be9+_0x5270b9(0x16c)+_0x14c1cc['yamlConfig'][_0x5270b9(0xa3)]+_0x5270b9(0x111)+_0x5270b9(0xa4));},'resolveEmbeddedActivationId':async(_0x484a51,_0x2cefde)=>{const _0x172ed7=_0xec0b3a,_0x5da23c=_0x4e417a[_0x172ed7(0x100)](_0x484a51);if(_0x5da23c)return _0x5da23c;if(_0x14c1cc[_0x172ed7(0xda)])return _0x2c0769[_0x172ed7(0x7d)](_0x484a51,_0x2cefde),createPendingActivationId(_0x484a51);if(_0x14c1cc[_0x172ed7(0xe0)]){await _0x547577();const _0x127347=_0x4e417a[_0x172ed7(0x100)](_0x2cefde['name']);if(_0x127347)return _0x4e417a[_0x172ed7(0x7d)](_0x484a51,_0x127347),_0x127347;const _0x4f2b96=activationSignature(_0x2cefde),_0x2a2bca=_0x27491d?.['get'](_0x4f2b96);if(_0x2a2bca)return _0x4e417a['set'](_0x484a51,_0x2a2bca),_0x2a2bca;const _0x221c7d=await _0x3686ae(_0x2cefde,_0x3bdd23[_0x172ed7(0xae)]),_0x224e65={..._0x221c7d,..._0x2cefde[_0x172ed7(0xa2)]!==undefined&&{'runAfterJourneyRefresh':_0x2cefde[_0x172ed7(0xa2)]}},_0x7fd1eb=await _0x25e109[_0x172ed7(0x84)][_0x172ed7(0x8f)](_0x14c1cc[_0x172ed7(0xe0)]['id'],_0x224e65);return _0x4e417a['set'](_0x484a51,_0x7fd1eb['id']),_0x7fd1eb['id'];}throw new SDKError(ErrorCode[_0x172ed7(0xef)],'Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context');},'resolveJourneyId':async _0xe004b8=>{const _0x1d9a00=_0xec0b3a;try{return await _0x25e109[_0x1d9a00(0x84)][_0x1d9a00(0x93)](_0x163caa[_0x1d9a00(0x142)],_0xe004b8);}catch(_0x45c30a){throw new SDKError(ErrorCode[_0x1d9a00(0x147)],_0x1d9a00(0xe4)+_0xe004b8+'\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27'+_0x14c1cc[_0x1d9a00(0xc2)][_0x1d9a00(0xa3)]+'\x27)',_0x45c30a);}},'resolveStageId':async(_0x1c2418,_0x8d3f28)=>{const _0x4b6314=_0xec0b3a,_0x5259aa=await _0x25e109[_0x4b6314(0x84)][_0x4b6314(0xd8)](_0x1c2418),_0x51a5e0=_0x5259aa[_0x4b6314(0x108)]['journeyStages'][_0x4b6314(0xcb)](_0x1c322c=>_0x1c322c[_0x4b6314(0xa3)][_0x4b6314(0xf2)]()===_0x8d3f28[_0x4b6314(0xf2)]());if(!_0x51a5e0?.['id'])throw new SDKError(ErrorCode['NOT_FOUND'],'Stage\x20\x27'+_0x8d3f28+_0x4b6314(0x127)+(_0x5259aa['attributes'][_0x4b6314(0x137)]||_0x5259aa[_0x4b6314(0x108)]['name'])+'\x27');return _0x51a5e0['id'];}},_0x1e82f9=await _0x5003da(_0x14c1cc[_0xec0b3a(0xc2)],_0x163caa[_0xec0b3a(0x142)],_0x305024),_0x3e4db8=_0x163caa[_0xec0b3a(0x148)]||_0x163caa[_0xec0b3a(0xfb)];_0x3e4db8&&(_0x1e82f9[_0xec0b3a(0xc7)]={'parentFolder':{'data':{'id':_0x3e4db8,'type':'folder'}}});if(_0x14c1cc[_0xec0b3a(0xda)]){if(_0x337d2d[_0xec0b3a(0x14d)]>0x0||_0x2c0769[_0xec0b3a(0x14d)]>0x0)return await executeThreeStepJourneyCreate(_0x25e109,_0x14c1cc,_0x1e82f9,{'pendingEmbeddedSegments':_0x337d2d,'pendingEmbeddedActivations':_0x2c0769,'embeddedSegmentNameToId':_0x1c6c72,'journeyActivationNameToId':_0x4e417a},{..._0x163caa,'effectiveFolderId':_0x3e4db8},_0x3bdd23,_0x32db20,_0x4553b3);else{ensureJourneyDefaults(_0x1e82f9[_0xec0b3a(0x108)]);const _0x49d82c=await _0x25e109[_0xec0b3a(0x84)][_0xec0b3a(0x87)](_0x1e82f9);return deletePushRecovery(_0x14c1cc[_0xec0b3a(0xdb)]),{'action':_0xec0b3a(0x16e),'journeyId':_0x49d82c['id'],'embeddedSegmentNameToId':_0x1c6c72};}}else{if(_0x14c1cc[_0xec0b3a(0x166)]&&_0x14c1cc[_0xec0b3a(0xe0)]){_0x1e82f9['id']=_0x14c1cc['existingJourney']['id'];const _0xb68fd9=_0x1e82f9[_0xec0b3a(0x108)];_0x14c1cc[_0xec0b3a(0xe0)][_0xec0b3a(0x108)]?.[_0xec0b3a(0x137)]&&(_0xb68fd9[_0xec0b3a(0x137)]=_0x14c1cc['existingJourney'][_0xec0b3a(0x108)][_0xec0b3a(0x137)]);const _0x476afb=_0x14c1cc[_0xec0b3a(0xe0)][_0xec0b3a(0x108)]?.['journeyStages'];return _0x476afb&&_0x1e82f9[_0xec0b3a(0x108)][_0xec0b3a(0xf3)]&&injectExistingStageIds(_0x1e82f9[_0xec0b3a(0x108)][_0xec0b3a(0xf3)],_0x476afb),ensureJourneyDefaults(_0xb68fd9),await _0x25e109['journey'][_0xec0b3a(0xd7)](_0x14c1cc[_0xec0b3a(0xe0)]['id'],_0x1e82f9),deletePushRecovery(_0x14c1cc['absolutePath']),{'action':_0xec0b3a(0x139),'journeyId':_0x14c1cc[_0xec0b3a(0xe0)]['id'],'embeddedSegmentNameToId':_0x1c6c72};}}return deletePushRecovery(_0x14c1cc['absolutePath']),{'action':_0xec0b3a(0xac),'journeyId':_0x14c1cc[_0xec0b3a(0xe0)]?.['id'],'embeddedSegmentNameToId':_0x1c6c72};}function findSegmentCriteriaLocation(_0x5ec0b3,_0x39317e){const _0x4b781e=a155_0x50aee1,_0x542d06=_0x5ec0b3[_0x4b781e(0x179)]||_0x5ec0b3[_0x4b781e(0x92)]?.[0x0]?.[_0x4b781e(0x179)]||[];let _0xb018a5='entry',_0xcc9d63=_0x39317e;const _0xb62fdb=_0x5ec0b3[_0x4b781e(0x113)]||_0x5ec0b3[_0x4b781e(0x92)]?.[0x0]?.[_0x4b781e(0x113)];if(_0xb62fdb?.[_0x4b781e(0xa7)]===_0x39317e)return{'stageName':_0x4b781e(0x113),'criteriaName':_0xb62fdb[_0x4b781e(0xa3)]||_0x39317e};_0x3ff5ba:for(const _0x1d5aa8 of _0x542d06){if(_0x1d5aa8[_0x4b781e(0x14f)]?.['segment']===_0x39317e){_0xb018a5=_0x1d5aa8['name'],_0xcc9d63=_0x1d5aa8['entry_criteria']['name']||_0x39317e;break;}if(_0x1d5aa8[_0x4b781e(0xf6)])for(const _0x50e0c6 of _0x1d5aa8[_0x4b781e(0xf6)]){if(_0x50e0c6['type']===_0x4b781e(0xeb)&&_0x50e0c6['with']?.[_0x4b781e(0xf4)])for(const _0x35a855 of _0x50e0c6[_0x4b781e(0x14b)]['branches']){if(_0x35a855[_0x4b781e(0xa7)]===_0x39317e){_0xb018a5=_0x1d5aa8[_0x4b781e(0xa3)],_0xcc9d63=_0x35a855['name']||_0x39317e;break _0x3ff5ba;}}}}return{'stageName':_0xb018a5,'criteriaName':_0xcc9d63};}async function executeThreeStepJourneyCreate(_0x230d58,_0x2c5e38,_0xab1331,_0x57d765,_0x5d570e,_0x164675,_0x4fbc5f,_0x593ee0){const _0x3cdcbb=a155_0x50aee1,{activationDefToCreateRequest:_0x254e9b,yamlRuleToApi:_0x595b07}=_0x593ee0,{pendingEmbeddedSegments:_0x38e4c1,pendingEmbeddedActivations:_0xb3211e,embeddedSegmentNameToId:_0x5ced84}=_0x57d765,_0x5c3b19=JSON[_0x3cdcbb(0xba)](JSON[_0x3cdcbb(0x130)](_0xab1331));ensureJourneyDefaults(_0x5c3b19[_0x3cdcbb(0x108)]),stripPendingIds(_0x5c3b19);const _0x155547=await _0x230d58[_0x3cdcbb(0x84)][_0x3cdcbb(0x87)](_0x5c3b19),_0x3c46bf=_0x155547['id'],_0x1349cc=new Map();for(const _0x512ea2 of _0x155547[_0x3cdcbb(0x108)][_0x3cdcbb(0xf3)]){_0x1349cc['set'](_0x512ea2[_0x3cdcbb(0xa3)]['toLowerCase'](),_0x512ea2['id']);}recoverSegmentIdsFromPushRecovery(_0x2c5e38,_0x5ced84,_0x164675[_0x3cdcbb(0x145)]);for(const [_0x3ee8b2,{definition:_0x34eb27}]of _0x38e4c1){if(_0x5ced84[_0x3cdcbb(0x125)](_0x3ee8b2)){_0x4fbc5f[_0x3cdcbb(0x9c)]?.({'type':_0x3cdcbb(0x10c),'journeyName':_0x2c5e38[_0x3cdcbb(0xc2)]['name'],'segmentName':_0x3ee8b2});continue;}const _0xeccecd=generateDeterministicJourneySegmentName(_0x2c5e38['yamlConfig']['name'],_0x3ee8b2);_0x4fbc5f[_0x3cdcbb(0x9c)]?.({'type':_0x3cdcbb(0x178),'journeyName':_0x2c5e38['yamlConfig'][_0x3cdcbb(0xa3)],'segmentName':_0x3ee8b2});const _0x2884fb=createSegmentIdResolver(_0x164675[_0x3cdcbb(0x145)],_0x3ee8b2),_0x1f7d57=await resolveRuleSegmentIds(_0x34eb27[_0x3cdcbb(0xfe)],_0x2884fb),_0x44f4d2=await createOrRecoverEmbeddedSegment(_0x230d58,_0x2c5e38,{'localName':_0x3ee8b2,'uniqueSegmentName':_0xeccecd,'description':_0x34eb27[_0x3cdcbb(0x174)]||'Entry\x20criteria:\x20'+_0x3ee8b2,'journeyId':_0x3c46bf,'resolvedRule':_0x1f7d57,'parentId':_0x5d570e[_0x3cdcbb(0x142)],'folderId':_0x5d570e[_0x3cdcbb(0xee)]||''},_0x595b07);_0x5ced84[_0x3cdcbb(0x7d)](_0x3ee8b2,_0x44f4d2),_0x164675[_0x3cdcbb(0x145)][_0x3cdcbb(0x7d)](_0x3ee8b2,_0x44f4d2),_0x4fbc5f[_0x3cdcbb(0x9c)]?.({'type':_0x3cdcbb(0x10c),'journeyName':_0x2c5e38[_0x3cdcbb(0xc2)][_0x3cdcbb(0xa3)],'segmentName':_0x3ee8b2});}const _0x18e9be=new Map();for(const [_0x2c3f18,_0x4a5cd8]of _0xb3211e){_0x4fbc5f[_0x3cdcbb(0x9c)]?.({'type':_0x3cdcbb(0x151),'journeyName':_0x2c5e38[_0x3cdcbb(0xc2)]['name'],'activationName':_0x2c3f18});const _0x509b54=await _0x254e9b(_0x4a5cd8,_0x164675[_0x3cdcbb(0xae)]),_0x212b26={..._0x509b54,..._0x4a5cd8['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x4a5cd8[_0x3cdcbb(0xa2)]}},_0x2db942=await _0x230d58['journey']['createActivation'](_0x3c46bf,_0x212b26);_0x18e9be[_0x3cdcbb(0x7d)](_0x2c3f18,_0x2db942['id']),_0x57d765[_0x3cdcbb(0x107)][_0x3cdcbb(0x7d)](_0x2c3f18,_0x2db942['id']),_0x4fbc5f[_0x3cdcbb(0x9c)]?.({'type':_0x3cdcbb(0xbe),'journeyName':_0x2c5e38[_0x3cdcbb(0xc2)][_0x3cdcbb(0xa3)],'activationName':_0x2c3f18});}const _0x554343=JSON[_0x3cdcbb(0xba)](JSON['stringify'](_0xab1331));return _0x554343['id']=_0x3c46bf,ensureJourneyDefaults(_0x554343[_0x3cdcbb(0x108)]),resolvePendingIdsInRequest(_0x554343,_0xab1331,_0x1349cc,_0x5ced84,_0x18e9be,_0x4fbc5f),await _0x230d58['journey'][_0x3cdcbb(0xd7)](_0x3c46bf,_0x554343),deletePushRecovery(_0x2c5e38[_0x3cdcbb(0xdb)]),{'action':_0x3cdcbb(0x16e),'journeyId':_0x3c46bf,'embeddedSegmentNameToId':_0x5ced84};}export function stripWaitStepPendingIds(_0x349828){const _0x33f457=a155_0x50aee1,_0x1ececc=_0x349828[_0x33f457(0x9f)]&&isPendingSegmentId(_0x349828['conditionSegmentId']),_0x2d70c4=_0x349828['conditions']?.[_0x33f457(0xc5)](_0x536361=>_0x536361[_0x33f457(0x11a)]&&isPendingSegmentId(_0x536361['segmentId']));(_0x1ececc||_0x2d70c4)&&(_0x349828[_0x33f457(0x14a)]=_0x33f457(0xd0),_0x349828[_0x33f457(0x11c)]=0x1,_0x349828[_0x33f457(0xbc)]='day',delete _0x349828[_0x33f457(0x9f)],delete _0x349828[_0x33f457(0x8c)],delete _0x349828[_0x33f457(0xf1)],delete _0x349828[_0x33f457(0x138)]);}export function resolveWaitStepPendingIds(_0x4bb036,_0x13a48f,_0x499b55,_0xb3c94e){const _0x5cc635=a155_0x50aee1;if(_0x13a48f['conditionSegmentId']&&isPendingSegmentId(_0x13a48f[_0x5cc635(0x9f)])){const _0x40d041=_0x499b55(_0x13a48f[_0x5cc635(0x9f)],'stage\x20\x27'+_0xb3c94e+_0x5cc635(0xe3));_0x40d041&&(_0x4bb036[_0x5cc635(0x14a)]='Condition',_0x4bb036[_0x5cc635(0x9f)]=_0x40d041,delete _0x4bb036['waitStep'],delete _0x4bb036[_0x5cc635(0xbc)],_0x13a48f[_0x5cc635(0x8c)]!==undefined&&(_0x4bb036[_0x5cc635(0x8c)]=_0x13a48f[_0x5cc635(0x8c)]),_0x13a48f[_0x5cc635(0xf1)]&&(_0x4bb036[_0x5cc635(0xf1)]=_0x13a48f[_0x5cc635(0xf1)]));}if(_0x13a48f[_0x5cc635(0x138)]){const _0x1955d1=_0x13a48f[_0x5cc635(0x138)][_0x5cc635(0xc5)](_0x211ce6=>_0x211ce6[_0x5cc635(0x11a)]&&isPendingSegmentId(_0x211ce6[_0x5cc635(0x11a)]));if(_0x1955d1){const _0x4933b8=_0x13a48f[_0x5cc635(0x138)][_0x5cc635(0x136)](_0x3c033e=>{const _0x1c2764=_0x5cc635;if(_0x3c033e[_0x1c2764(0x11a)]&&isPendingSegmentId(_0x3c033e[_0x1c2764(0x11a)])){const _0x3d6d26=_0x499b55(_0x3c033e[_0x1c2764(0x11a)],_0x1c2764(0xad)+_0xb3c94e+_0x1c2764(0xe3));return{..._0x3c033e,'segmentId':_0x3d6d26||_0x3c033e[_0x1c2764(0x11a)]};}return{..._0x3c033e};});_0x4bb036[_0x5cc635(0x14a)]=_0x5cc635(0xb1),_0x4bb036['conditions']=_0x4933b8,delete _0x4bb036['waitStep'],delete _0x4bb036[_0x5cc635(0xbc)],delete _0x4bb036[_0x5cc635(0x9f)],delete _0x4bb036['conditionTimeoutDuration'],delete _0x4bb036[_0x5cc635(0xf1)];}}}function stripPendingIds(_0x96b8f3){const _0x165a60=a155_0x50aee1;_0x96b8f3['attributes'][_0x165a60(0x113)]?.[_0x165a60(0x11a)]&&isPendingSegmentId(_0x96b8f3[_0x165a60(0x108)][_0x165a60(0x113)][_0x165a60(0x11a)])&&delete _0x96b8f3[_0x165a60(0x108)][_0x165a60(0x113)];for(const _0x3eb4f8 of _0x96b8f3[_0x165a60(0x108)][_0x165a60(0xf3)]||[]){_0x3eb4f8[_0x165a60(0x177)]?.[_0x165a60(0x11a)]&&isPendingSegmentId(_0x3eb4f8[_0x165a60(0x177)][_0x165a60(0x11a)])&&delete _0x3eb4f8[_0x165a60(0x177)];_0x3eb4f8[_0x165a60(0x15b)]?.['segmentId']&&isPendingSegmentId(_0x3eb4f8['milestone']['segmentId'])&&delete _0x3eb4f8[_0x165a60(0x15b)];_0x3eb4f8[_0x165a60(0xdf)]&&(_0x3eb4f8[_0x165a60(0xdf)]=_0x3eb4f8[_0x165a60(0xdf)][_0x165a60(0x15e)](_0x4818b0=>!_0x4818b0['segmentId']||!isPendingSegmentId(_0x4818b0[_0x165a60(0x11a)])));if(_0x3eb4f8[_0x165a60(0xf6)])for(const _0x30db2d of Object[_0x165a60(0xc0)](_0x3eb4f8[_0x165a60(0xf6)])){const _0x3b7b87=_0x3eb4f8[_0x165a60(0xf6)][_0x30db2d];_0x3b7b87[_0x165a60(0x102)]===_0x165a60(0x86)&&_0x3b7b87['journeyActivationStepId']&&isPendingActivationId(_0x3b7b87['journeyActivationStepId'])&&(_0x3b7b87[_0x165a60(0xdc)]='');if(_0x3b7b87[_0x165a60(0x102)]===_0x165a60(0xf0)&&_0x3b7b87['branches'])for(const _0x505e68 of _0x3b7b87[_0x165a60(0xf4)]){_0x505e68[_0x165a60(0x11a)]&&isPendingSegmentId(_0x505e68[_0x165a60(0x11a)])&&(_0x505e68[_0x165a60(0x11a)]='');}_0x3b7b87[_0x165a60(0x102)]===_0x165a60(0x16d)&&stripWaitStepPendingIds(_0x3b7b87);}}}function resolvePendingIdsInRequest(_0x272eca,_0x34eb85,_0x675199,_0x2cfe71,_0xebd268,_0x5cca25){const _0x400bfa=a155_0x50aee1,_0x156134=(_0xe4ca0e,_0x384004)=>{const _0x47c078=a155_0x1494;if(!isPendingSegmentId(_0xe4ca0e))return _0xe4ca0e;const _0x5bc245=extractPendingSegmentName(_0xe4ca0e),_0x41903a=_0x2cfe71['get'](_0x5bc245);return!_0x41903a&&_0x5cca25[_0x47c078(0x170)]?.(_0x47c078(0xd3)+_0x5bc245+_0x47c078(0x116)+_0x384004),_0x41903a;};if(_0x272eca[_0x400bfa(0x108)]['goal']?.[_0x400bfa(0x11a)]&&isPendingSegmentId(_0x272eca[_0x400bfa(0x108)][_0x400bfa(0x113)][_0x400bfa(0x11a)])){const _0x2ab228=_0x156134(_0x272eca[_0x400bfa(0x108)][_0x400bfa(0x113)][_0x400bfa(0x11a)],_0x400bfa(0x9b));_0x2ab228&&(_0x272eca[_0x400bfa(0x108)]['goal'][_0x400bfa(0x11a)]=_0x2ab228);}for(const _0x408a3e of _0x272eca[_0x400bfa(0x108)][_0x400bfa(0xf3)]||[]){const _0x228d94=_0x675199[_0x400bfa(0x100)](_0x408a3e[_0x400bfa(0xa3)][_0x400bfa(0xf2)]());_0x228d94&&(_0x408a3e['id']=_0x228d94);if(_0x408a3e[_0x400bfa(0x177)]?.[_0x400bfa(0x11a)]&&isPendingSegmentId(_0x408a3e[_0x400bfa(0x177)][_0x400bfa(0x11a)])){const _0x4df93d=_0x156134(_0x408a3e['entryCriteria'][_0x400bfa(0x11a)],_0x400bfa(0xad)+_0x408a3e['name']+_0x400bfa(0xbd));_0x4df93d&&(_0x408a3e[_0x400bfa(0x177)][_0x400bfa(0x11a)]=_0x4df93d);}if(_0x408a3e['exitCriterias'])for(const _0x5b1cfa of _0x408a3e['exitCriterias']){if(_0x5b1cfa[_0x400bfa(0x11a)]&&isPendingSegmentId(_0x5b1cfa[_0x400bfa(0x11a)])){const _0x27bdeb=_0x156134(_0x5b1cfa['segmentId'],_0x400bfa(0xad)+_0x408a3e[_0x400bfa(0xa3)]+_0x400bfa(0xea));_0x27bdeb&&(_0x5b1cfa[_0x400bfa(0x11a)]=_0x27bdeb);}}if(_0x408a3e['milestone']?.[_0x400bfa(0x11a)]&&isPendingSegmentId(_0x408a3e[_0x400bfa(0x15b)][_0x400bfa(0x11a)])){const _0x2f223e=_0x156134(_0x408a3e['milestone'][_0x400bfa(0x11a)],'stage\x20\x27'+_0x408a3e[_0x400bfa(0xa3)]+_0x400bfa(0x9e));_0x2f223e&&(_0x408a3e[_0x400bfa(0x15b)]['segmentId']=_0x2f223e);}if(_0x408a3e[_0x400bfa(0xf6)]){const _0x1fc1dc=_0x3eeacf=>_0x34eb85[_0x400bfa(0x108)]['journeyStages']?.['find'](_0x2aef32=>_0x2aef32[_0x400bfa(0xa3)][_0x400bfa(0xf2)]()===_0x408a3e['name']['toLowerCase']())?.[_0x400bfa(0xf6)]?.[_0x3eeacf];for(const _0x125593 of Object['keys'](_0x408a3e[_0x400bfa(0xf6)])){const _0x107f96=_0x408a3e[_0x400bfa(0xf6)][_0x125593],_0x1278ea=_0x1fc1dc(_0x125593);if(_0x107f96[_0x400bfa(0x102)]===_0x400bfa(0x86)&&_0x107f96[_0x400bfa(0xdc)]&&(isPendingActivationId(_0x107f96['journeyActivationStepId'])||_0x107f96[_0x400bfa(0xdc)]==='')){if(_0x1278ea?.[_0x400bfa(0xdc)]&&isPendingActivationId(_0x1278ea['journeyActivationStepId'])){const _0x15fd83=extractPendingActivationName(_0x1278ea[_0x400bfa(0xdc)]),_0x772dfa=_0xebd268[_0x400bfa(0x100)](_0x15fd83);_0x772dfa&&(_0x107f96[_0x400bfa(0xdc)]=_0x772dfa);}}if(_0x107f96[_0x400bfa(0x102)]===_0x400bfa(0xf0)&&_0x107f96['branches']&&_0x1278ea?.['branches'])for(let _0x5d934d=0x0;_0x5d934d<_0x107f96[_0x400bfa(0xf4)][_0x400bfa(0xd1)];_0x5d934d++){const _0x1de1e8=_0x107f96['branches'][_0x5d934d],_0x4b3bb6=_0x1278ea['branches'][_0x5d934d];if(_0x4b3bb6?.[_0x400bfa(0x11a)]&&isPendingSegmentId(_0x4b3bb6['segmentId'])){const _0x32b2c0=_0x156134(_0x4b3bb6[_0x400bfa(0x11a)],_0x400bfa(0xad)+_0x408a3e[_0x400bfa(0xa3)]+_0x400bfa(0x14c)+(_0x1de1e8[_0x400bfa(0xa3)]||_0x5d934d)+'\x27');_0x32b2c0&&(_0x1de1e8[_0x400bfa(0x11a)]=_0x32b2c0);}}_0x107f96[_0x400bfa(0x102)]===_0x400bfa(0x16d)&&_0x1278ea?.[_0x400bfa(0x102)]===_0x400bfa(0x16d)&&resolveWaitStepPendingIds(_0x107f96,_0x1278ea,_0x156134,_0x408a3e[_0x400bfa(0xa3)]);}}}}
@@ -1 +1 @@
1
- (function(_0x58a30f,_0x51b15f){const _0x3a5b51=a156_0x3d57,_0x46c392=_0x58a30f();while(!![]){try{const _0x5f2bc4=parseInt(_0x3a5b51(0x1ce))/0x1+parseInt(_0x3a5b51(0x1cd))/0x2+parseInt(_0x3a5b51(0x1d8))/0x3*(parseInt(_0x3a5b51(0x1d6))/0x4)+parseInt(_0x3a5b51(0x1c9))/0x5+-parseInt(_0x3a5b51(0x1ca))/0x6*(parseInt(_0x3a5b51(0x1d2))/0x7)+parseInt(_0x3a5b51(0x1d4))/0x8*(-parseInt(_0x3a5b51(0x1cc))/0x9)+-parseInt(_0x3a5b51(0x1d1))/0xa*(parseInt(_0x3a5b51(0x1cf))/0xb);if(_0x5f2bc4===_0x51b15f)break;else _0x46c392['push'](_0x46c392['shift']());}catch(_0x2d5df9){_0x46c392['push'](_0x46c392['shift']());}}}(a156_0x527e,0x56382));function a156_0x3d57(_0x5614e8,_0x1654d8){_0x5614e8=_0x5614e8-0x1c8;const _0x527e9d=a156_0x527e();let _0x3d57ef=_0x527e9d[_0x5614e8];return _0x3d57ef;}export function buildFolderIdToPathMap(_0x3d50ef){const _0x54507b=a156_0x3d57,_0x2b9ecd=new Map(),_0x5f01be=new Map();for(const _0x16be37 of _0x3d50ef){_0x5f01be[_0x54507b(0x1cb)](_0x16be37['id'],_0x16be37);}const _0x2009cb=new Set();for(const _0x4ba539 of _0x3d50ef){!_0x4ba539['parentFolderId']&&_0x2009cb['add'](_0x4ba539['id']);}function _0x390477(_0x12e5f0){const _0x3ffbf5=_0x54507b;if(_0x2b9ecd['has'](_0x12e5f0['id']))return _0x2b9ecd[_0x3ffbf5(0x1d3)](_0x12e5f0['id']);if(_0x2009cb[_0x3ffbf5(0x1d0)](_0x12e5f0['id']))return _0x2b9ecd[_0x3ffbf5(0x1cb)](_0x12e5f0['id'],''),'';if(_0x12e5f0['parentFolderId']){const _0x3dae76=_0x5f01be[_0x3ffbf5(0x1d3)](_0x12e5f0['parentFolderId']);if(_0x3dae76){const _0x42ceb5=_0x390477(_0x3dae76),_0x2a028a=_0x42ceb5?_0x42ceb5+'/'+_0x12e5f0[_0x3ffbf5(0x1d5)]:_0x12e5f0[_0x3ffbf5(0x1d5)];return _0x2b9ecd['set'](_0x12e5f0['id'],_0x2a028a),_0x2a028a;}}const _0x29d859=_0x12e5f0[_0x3ffbf5(0x1d5)];return _0x2b9ecd[_0x3ffbf5(0x1cb)](_0x12e5f0['id'],_0x29d859),_0x29d859;}for(const _0x5cae1b of _0x3d50ef){_0x390477(_0x5cae1b);}return _0x2b9ecd;}export function buildFolderPathToIdMap(_0x37b55c){const _0x480b8a=a156_0x3d57,_0x5b6307=new Map(),_0x2c747b=new Map();for(const _0x417b45 of _0x37b55c){_0x2c747b[_0x480b8a(0x1cb)](_0x417b45['id'],_0x417b45);}const _0x50e054=new Set();for(const _0x5e8057 of _0x37b55c){!_0x5e8057['parentFolderId']&&_0x50e054[_0x480b8a(0x1c8)](_0x5e8057['id']);}function _0x57de2b(_0x4c7f3c){const _0x423f9a=_0x480b8a;if(_0x50e054['has'](_0x4c7f3c['id']))return'';if(_0x4c7f3c[_0x423f9a(0x1d7)]){const _0xd654e7=_0x2c747b[_0x423f9a(0x1d3)](_0x4c7f3c[_0x423f9a(0x1d7)]);if(_0xd654e7){const _0xf2bf4b=_0x57de2b(_0xd654e7);return _0xf2bf4b?_0xf2bf4b+'/'+_0x4c7f3c['name']:_0x4c7f3c[_0x423f9a(0x1d5)];}}return _0x4c7f3c[_0x423f9a(0x1d5)];}for(const _0xea80b1 of _0x37b55c){const _0x52d5d3=_0x57de2b(_0xea80b1);_0x5b6307[_0x480b8a(0x1cb)](_0x52d5d3,_0xea80b1['id']);}return _0x5b6307;}export function buildFolderMaps(_0x2d0b77){const _0x1047ad=buildFolderIdToPathMap(_0x2d0b77),_0x47b7ed=new Map();for(const [_0x135683,_0x582a3e]of _0x1047ad){_0x47b7ed['set'](_0x582a3e,_0x135683);}return{'idToPath':_0x1047ad,'pathToId':_0x47b7ed};}function a156_0x527e(){const _0x1f1a27=['get','12656puDUSj','name','12YzscGM','parentFolderId','689499WRaBLr','add','2586400sfqcFZ','36bgmmRr','set','2286mfGyCr','434574ZTQUaP','701417NXvGId','11jXosLG','has','13030130wfnlGv','78736ZDTtih'];a156_0x527e=function(){return _0x1f1a27;};return a156_0x527e();}export function getFolderPath(_0x307144,_0x5d5e59){if(!_0x307144)return'';return _0x5d5e59['get'](_0x307144)??'';}
1
+ (function(_0xabb88a,_0x5cc42c){const _0x2cfe9c=a156_0x414d,_0x3ebad6=_0xabb88a();while(!![]){try{const _0x5a52da=-parseInt(_0x2cfe9c(0x193))/0x1*(-parseInt(_0x2cfe9c(0x194))/0x2)+-parseInt(_0x2cfe9c(0x19c))/0x3+parseInt(_0x2cfe9c(0x19e))/0x4+-parseInt(_0x2cfe9c(0x192))/0x5+parseInt(_0x2cfe9c(0x195))/0x6*(-parseInt(_0x2cfe9c(0x19a))/0x7)+-parseInt(_0x2cfe9c(0x19b))/0x8+parseInt(_0x2cfe9c(0x19d))/0x9*(parseInt(_0x2cfe9c(0x198))/0xa);if(_0x5a52da===_0x5cc42c)break;else _0x3ebad6['push'](_0x3ebad6['shift']());}catch(_0x139afd){_0x3ebad6['push'](_0x3ebad6['shift']());}}}(a156_0x29c9,0xe05be));export function buildFolderIdToPathMap(_0x21f93e){const _0x45df86=a156_0x414d,_0x1710f6=new Map(),_0x461594=new Map();for(const _0x30d7bc of _0x21f93e){_0x461594[_0x45df86(0x197)](_0x30d7bc['id'],_0x30d7bc);}const _0x2ca36c=new Set();for(const _0x2fde9f of _0x21f93e){!_0x2fde9f[_0x45df86(0x19f)]&&_0x2ca36c['add'](_0x2fde9f['id']);}function _0x413e55(_0x1b9783){const _0x5addf1=_0x45df86;if(_0x1710f6[_0x5addf1(0x1a0)](_0x1b9783['id']))return _0x1710f6[_0x5addf1(0x1a1)](_0x1b9783['id']);if(_0x2ca36c['has'](_0x1b9783['id']))return _0x1710f6[_0x5addf1(0x197)](_0x1b9783['id'],''),'';if(_0x1b9783['parentFolderId']){const _0x6d6191=_0x461594['get'](_0x1b9783[_0x5addf1(0x19f)]);if(_0x6d6191){const _0x592f9d=_0x413e55(_0x6d6191),_0x49c94d=_0x592f9d?_0x592f9d+'/'+_0x1b9783[_0x5addf1(0x199)]:_0x1b9783[_0x5addf1(0x199)];return _0x1710f6['set'](_0x1b9783['id'],_0x49c94d),_0x49c94d;}}const _0x2d23d4=_0x1b9783[_0x5addf1(0x199)];return _0x1710f6[_0x5addf1(0x197)](_0x1b9783['id'],_0x2d23d4),_0x2d23d4;}for(const _0x4bfd1d of _0x21f93e){_0x413e55(_0x4bfd1d);}return _0x1710f6;}export function buildFolderPathToIdMap(_0x4bee1){const _0x3c3242=a156_0x414d,_0x17f2fb=new Map(),_0x4bcf86=new Map();for(const _0x2e0ddc of _0x4bee1){_0x4bcf86[_0x3c3242(0x197)](_0x2e0ddc['id'],_0x2e0ddc);}const _0x180fd0=new Set();for(const _0x4318a9 of _0x4bee1){!_0x4318a9[_0x3c3242(0x19f)]&&_0x180fd0[_0x3c3242(0x196)](_0x4318a9['id']);}function _0x5cfa4e(_0x45f75f){const _0x5bca55=_0x3c3242;if(_0x180fd0[_0x5bca55(0x1a0)](_0x45f75f['id']))return'';if(_0x45f75f[_0x5bca55(0x19f)]){const _0xad2ce8=_0x4bcf86[_0x5bca55(0x1a1)](_0x45f75f['parentFolderId']);if(_0xad2ce8){const _0x19af43=_0x5cfa4e(_0xad2ce8);return _0x19af43?_0x19af43+'/'+_0x45f75f[_0x5bca55(0x199)]:_0x45f75f[_0x5bca55(0x199)];}}return _0x45f75f[_0x5bca55(0x199)];}for(const _0x201fc1 of _0x4bee1){const _0x2940c0=_0x5cfa4e(_0x201fc1);_0x17f2fb[_0x3c3242(0x197)](_0x2940c0,_0x201fc1['id']);}return _0x17f2fb;}function a156_0x414d(_0xa9cbb0,_0x8eaae){_0xa9cbb0=_0xa9cbb0-0x192;const _0x29c936=a156_0x29c9();let _0x414deb=_0x29c936[_0xa9cbb0];return _0x414deb;}export function buildFolderMaps(_0x2d64e9){const _0xc455c=a156_0x414d,_0x468d3c=buildFolderIdToPathMap(_0x2d64e9),_0xc95bda=new Map();for(const [_0x208261,_0x3d9dea]of _0x468d3c){_0xc95bda[_0xc455c(0x197)](_0x3d9dea,_0x208261);}return{'idToPath':_0x468d3c,'pathToId':_0xc95bda};}export function getFolderPath(_0x24b0e6,_0x454a7d){const _0x4a4317=a156_0x414d;if(!_0x24b0e6)return'';return _0x454a7d[_0x4a4317(0x1a1)](_0x24b0e6)??'';}function a156_0x29c9(){const _0x37d0ca=['1030722cwJEhl','9SNACsj','6811604zrrmqM','parentFolderId','has','get','356690zVWchl','1oSnJBc','850856EZwgPs','12vItrtk','add','set','3413380LpkJGY','name','879116sRcsth','7076840YyQIbP'];a156_0x29c9=function(){return _0x37d0ca;};return a156_0x29c9();}
@@ -1 +1 @@
1
- (function(_0x23da72,_0xdbcf7){const _0x4615a1=a157_0x4392,_0x42b0fe=_0x23da72();while(!![]){try{const _0x21a9d2=-parseInt(_0x4615a1(0x117))/0x1+-parseInt(_0x4615a1(0xfc))/0x2*(parseInt(_0x4615a1(0x113))/0x3)+parseInt(_0x4615a1(0xf9))/0x4*(parseInt(_0x4615a1(0x119))/0x5)+parseInt(_0x4615a1(0xee))/0x6*(parseInt(_0x4615a1(0x11c))/0x7)+parseInt(_0x4615a1(0xf7))/0x8*(parseInt(_0x4615a1(0xf8))/0x9)+-parseInt(_0x4615a1(0x104))/0xa*(parseInt(_0x4615a1(0x114))/0xb)+parseInt(_0x4615a1(0xfb))/0xc;if(_0x21a9d2===_0xdbcf7)break;else _0x42b0fe['push'](_0x42b0fe['shift']());}catch(_0x1a3585){_0x42b0fe['push'](_0x42b0fe['shift']());}}}(a157_0x256f,0xb8db8));import a157_0x2fa0f8 from'path';function a157_0x256f(){const _0x21584e=['2055450dtWxvW','tdx.json','pop','No\x20tdx.json\x20found\x20for\x20file:\x20','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','Path\x20cannot\x20be\x20empty','Path\x20segment\x20cannot\x20be\x20empty','readFile','length','.yml','push','exists','Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.','type','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','10794HLvJhl','55QCDOzz','substring','Relative\x20path\x20cannot\x20be\x20empty','1335343yqTyCs','journey','335zquEDT','startsWith','endsWith','20657aOipne','test','dirname','2886KMcQqG','raw','slice','relative','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','isAbsolute','Cannot\x20split\x20empty\x20path','parent_segment','trim','8njhrjP','7235172bizgMG','70744rAKutM','join','2069844ziXqgz','256jraohT','parse','name','segments','segment','.yaml','File\x20not\x20found:\x20','resolve'];a157_0x256f=function(){return _0x21584e;};return a157_0x256f();}import{parse as a157_0x55e13e}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x4d357c){const _0x74c50e=a157_0x4392;if(!_0x4d357c||_0x4d357c['trim']()==='')throw new Error(_0x74c50e(0x109));const _0x1fd046=_0x4d357c['trim']();if(_0x1fd046==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x4d357c};const _0x541bf0=_0x1fd046[_0x74c50e(0x11a)]('/')?_0x1fd046[_0x74c50e(0x115)](0x1):_0x1fd046,_0x505f4d=_0x541bf0['split']('/')['filter'](_0x15fdd0=>_0x15fdd0!=='');if(_0x505f4d[_0x74c50e(0x10c)]===0x0)throw new Error(_0x74c50e(0xf2));const _0x16430f=_0x1fd046['startsWith']('/')||!isRelativePathSegment(_0x505f4d[0x0]);for(const _0x577102 of _0x505f4d){validatePathSegment(_0x577102);}return{'segments':_0x505f4d,'isAbsolute':_0x16430f,'raw':_0x4d357c};}function isRelativePathSegment(_0x441325){return _0x441325==='.'||_0x441325==='..';}function validatePathSegment(_0xa63344){const _0x44a624=a157_0x4392;if(_0xa63344==='')throw new Error(_0x44a624(0x10a));if(_0xa63344==='.'||_0xa63344==='..')return;if(/[\x00-\x1F\x7F]/[_0x44a624(0x11d)](_0xa63344))throw new Error(_0x44a624(0x108)+_0xa63344);if(_0xa63344!==_0xa63344[_0x44a624(0xf6)]()){}}export function validatePath(_0x33e228){const _0x5dce1a=a157_0x4392;if(_0x33e228[_0x5dce1a(0xff)]['length']===0x0&&!_0x33e228[_0x5dce1a(0xf3)])throw new Error(_0x5dce1a(0x116));if(_0x33e228[_0x5dce1a(0xf3)]){if(_0x33e228[_0x5dce1a(0xff)][0x0]==='..')throw new Error('Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22');let _0x43c265=0x0;for(const _0x109ade of _0x33e228[_0x5dce1a(0xff)]){if(_0x109ade==='..'){if(_0x43c265===0x0)throw new Error('Path\x20attempts\x20to\x20navigate\x20above\x20root');_0x43c265--;}else _0x109ade!=='.'&&_0x43c265++;}}}export function joinPaths(_0x6c1b04,_0x392f6a){const _0x195001=a157_0x4392;if(!_0x6c1b04||_0x6c1b04==='/')return _0x392f6a;if(!_0x392f6a||_0x392f6a==='.')return _0x6c1b04;if(_0x392f6a[_0x195001(0x11a)]('/'))return _0x392f6a;const _0x41417d=parsePath(_0x6c1b04),_0x1c8490=parsePath(_0x392f6a),_0x8d19b7=[..._0x41417d[_0x195001(0xff)]];for(const _0x4bd76d of _0x1c8490[_0x195001(0xff)]){if(_0x4bd76d==='.')continue;else{if(_0x4bd76d==='..'){if(_0x8d19b7[_0x195001(0x10c)]===0x0)throw new Error('Cannot\x20navigate\x20above\x20root');_0x8d19b7[_0x195001(0x106)]();}else _0x8d19b7['push'](_0x4bd76d);}}const _0x5570c0=_0x8d19b7['join']('/');return _0x41417d[_0x195001(0xef)][_0x195001(0x11a)]('/')?'/'+_0x5570c0:_0x5570c0;}export function normalizePath(_0x265a62){const _0x1fe55b=a157_0x4392,_0xdb21e0=parsePath(_0x265a62),_0x51f6ac=[];for(const _0x3e3c7f of _0xdb21e0[_0x1fe55b(0xff)]){if(_0x3e3c7f==='.')continue;else{if(_0x3e3c7f==='..'){if(_0x51f6ac[_0x1fe55b(0x10c)]===0x0){if(_0xdb21e0[_0x1fe55b(0xf3)])throw new Error('Cannot\x20navigate\x20above\x20root');_0x51f6ac[_0x1fe55b(0x10e)]('..');}else _0x51f6ac[_0x51f6ac[_0x1fe55b(0x10c)]-0x1]==='..'?_0x51f6ac[_0x1fe55b(0x10e)]('..'):_0x51f6ac[_0x1fe55b(0x106)]();}else _0x51f6ac[_0x1fe55b(0x10e)](_0x3e3c7f);}}if(_0x51f6ac[_0x1fe55b(0x10c)]===0x0)return _0xdb21e0[_0x1fe55b(0xf3)]?'/':'.';const _0x1db077=_0x51f6ac['join']('/');return _0xdb21e0['raw']['startsWith']('/')?'/'+_0x1db077:_0x1db077;}export function getParentPath(_0x4c75cb){const _0x565509=a157_0x4392,_0x1c00b9=parsePath(_0x4c75cb);if(_0x1c00b9[_0x565509(0xff)][_0x565509(0x10c)]<=0x1)return'/';const _0xd781be=_0x1c00b9[_0x565509(0xff)][_0x565509(0xf0)](0x0,-0x1)[_0x565509(0xfa)]('/');return _0x1c00b9['raw']['startsWith']('/')?'/'+_0xd781be:_0xd781be;}export function getBaseName(_0x55b0c8){const _0x56e0cc=a157_0x4392,_0x71dfa5=parsePath(_0x55b0c8);return _0x71dfa5[_0x56e0cc(0xff)][_0x71dfa5[_0x56e0cc(0xff)][_0x56e0cc(0x10c)]-0x1]||'';}function a157_0x4392(_0x50745e,_0x1de31e){_0x50745e=_0x50745e-0xee;const _0x256fc3=a157_0x256f();let _0x4392c6=_0x256fc3[_0x50745e];return _0x4392c6;}export function isChildPath(_0x292314,_0xea340e){const _0x3eba2b=a157_0x4392,_0xb5fecd=parsePath(_0x292314),_0x188f91=parsePath(_0xea340e);if(_0xb5fecd['segments'][_0x3eba2b(0x10c)]<=_0x188f91['segments']['length'])return![];for(let _0x467015=0x0;_0x467015<_0x188f91[_0x3eba2b(0xff)]['length'];_0x467015++){if(_0xb5fecd[_0x3eba2b(0xff)][_0x467015]!==_0x188f91['segments'][_0x467015])return![];}return!![];}export function splitPath(_0x8ce8b5){const _0x4673c0=a157_0x4392,_0x16fe4e=parsePath(_0x8ce8b5);if(_0x16fe4e[_0x4673c0(0xff)][_0x4673c0(0x10c)]===0x0)throw new Error(_0x4673c0(0xf4));if(_0x16fe4e[_0x4673c0(0xff)][_0x4673c0(0x10c)]===0x1)return{'parent':_0x16fe4e[_0x4673c0(0xff)][0x0]};return{'parent':_0x16fe4e[_0x4673c0(0xff)][0x0],'child':_0x16fe4e[_0x4673c0(0xff)][_0x4673c0(0xf0)](0x1)[_0x4673c0(0xfa)]('/')};}export function isYamlFilePath(_0x344b41){const _0x2b2657=a157_0x4392;return _0x344b41[_0x2b2657(0x11b)](_0x2b2657(0x10d))||_0x344b41[_0x2b2657(0x11b)](_0x2b2657(0x101));}export async function resolveYamlFilePath(_0x50dd89,_0x395aea=nodeFileSystem){const _0x3db4f2=a157_0x4392,_0x462c14=a157_0x2fa0f8[_0x3db4f2(0x103)](_0x50dd89);if(!await _0x395aea[_0x3db4f2(0x10f)](_0x462c14))throw new Error(_0x3db4f2(0x102)+_0x50dd89);let _0x2c1cec=a157_0x2fa0f8[_0x3db4f2(0x11e)](_0x462c14),_0xe0729d=null,_0x1e6258=null;const _0x43b8a5=a157_0x2fa0f8[_0x3db4f2(0xfd)](_0x2c1cec)['root'];while(_0x2c1cec!==_0x43b8a5){const _0x2478c5=a157_0x2fa0f8['join'](_0x2c1cec,_0x3db4f2(0x105));if(await _0x395aea[_0x3db4f2(0x10f)](_0x2478c5)){_0xe0729d=_0x2478c5,_0x1e6258=_0x2c1cec;break;}_0x2c1cec=a157_0x2fa0f8[_0x3db4f2(0x11e)](_0x2c1cec);}if(!_0xe0729d||!_0x1e6258)throw new Error(_0x3db4f2(0x107)+_0x50dd89+'\x0a'+_0x3db4f2(0x110));const _0x5d7ede=await _0x395aea[_0x3db4f2(0x10b)](_0xe0729d),_0x293e65=JSON[_0x3db4f2(0xfd)](_0x5d7ede),_0x104721=_0x293e65[_0x3db4f2(0xf5)];if(!_0x104721)throw new Error(_0x3db4f2(0x112));const _0x1ed21e=await _0x395aea[_0x3db4f2(0x10b)](_0x462c14),_0x25ebfa=a157_0x55e13e(_0x1ed21e),_0x15c906=_0x25ebfa[_0x3db4f2(0xfe)];if(!_0x15c906)throw new Error('Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20'+_0x50dd89);const _0x5b0e0f=_0x25ebfa[_0x3db4f2(0x111)]===_0x3db4f2(0x118)?_0x3db4f2(0x118):_0x3db4f2(0x100),_0x4fef73=a157_0x2fa0f8[_0x3db4f2(0xf1)](_0x1e6258,_0x462c14),_0x119e60=a157_0x2fa0f8[_0x3db4f2(0x11e)](_0x4fef73),_0x4f7471=_0x119e60==='.'?'':_0x119e60['replace'](/\\/g,'/'),_0x109abe=_0x4f7471?_0x104721+'/'+_0x4f7471+'/'+_0x15c906:_0x104721+'/'+_0x15c906;return{'parentSegment':_0x104721,'segmentName':_0x15c906,'folderPath':_0x4f7471,'fullPath':_0x109abe,'resourceType':_0x5b0e0f,'content':_0x1ed21e};}
1
+ (function(_0xcb3d19,_0x38e246){const _0x38dda5=a157_0x57cc,_0x28101a=_0xcb3d19();while(!![]){try{const _0x40e6b4=-parseInt(_0x38dda5(0x83))/0x1*(-parseInt(_0x38dda5(0x96))/0x2)+parseInt(_0x38dda5(0x7f))/0x3*(parseInt(_0x38dda5(0xa0))/0x4)+parseInt(_0x38dda5(0xb2))/0x5+parseInt(_0x38dda5(0x99))/0x6*(-parseInt(_0x38dda5(0x92))/0x7)+parseInt(_0x38dda5(0x84))/0x8+-parseInt(_0x38dda5(0xa6))/0x9+parseInt(_0x38dda5(0xa4))/0xa*(-parseInt(_0x38dda5(0x9a))/0xb);if(_0x40e6b4===_0x38e246)break;else _0x28101a['push'](_0x28101a['shift']());}catch(_0x293060){_0x28101a['push'](_0x28101a['shift']());}}}(a157_0x4b29,0xe2d40));import a157_0x112c91 from'path';import{parse as a157_0x539c96}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x166886){const _0x23e7ca=a157_0x57cc;if(!_0x166886||_0x166886[_0x23e7ca(0xad)]()==='')throw new Error(_0x23e7ca(0x9c));const _0x25610e=_0x166886['trim']();if(_0x25610e==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x166886};const _0x2d1970=_0x25610e[_0x23e7ca(0xab)]('/')?_0x25610e[_0x23e7ca(0xa1)](0x1):_0x25610e,_0x49cfbb=_0x2d1970['split']('/')[_0x23e7ca(0x8c)](_0x48c149=>_0x48c149!=='');if(_0x49cfbb['length']===0x0)throw new Error(_0x23e7ca(0xae));const _0x4bdf04=_0x25610e['startsWith']('/')||!isRelativePathSegment(_0x49cfbb[0x0]);for(const _0x1a8312 of _0x49cfbb){validatePathSegment(_0x1a8312);}return{'segments':_0x49cfbb,'isAbsolute':_0x4bdf04,'raw':_0x166886};}function isRelativePathSegment(_0x4625b5){return _0x4625b5==='.'||_0x4625b5==='..';}function validatePathSegment(_0x4d6f57){const _0x3fa96f=a157_0x57cc;if(_0x4d6f57==='')throw new Error(_0x3fa96f(0xa5));if(_0x4d6f57==='.'||_0x4d6f57==='..')return;if(/[\x00-\x1F\x7F]/[_0x3fa96f(0x81)](_0x4d6f57))throw new Error(_0x3fa96f(0x82)+_0x4d6f57);if(_0x4d6f57!==_0x4d6f57[_0x3fa96f(0xad)]()){}}export function validatePath(_0x1baf56){const _0x552419=a157_0x57cc;if(_0x1baf56[_0x552419(0xb0)]['length']===0x0&&!_0x1baf56[_0x552419(0xb1)])throw new Error(_0x552419(0x90));if(_0x1baf56[_0x552419(0xb1)]){if(_0x1baf56['segments'][0x0]==='..')throw new Error(_0x552419(0xa2));let _0xb85714=0x0;for(const _0x57f0f8 of _0x1baf56[_0x552419(0xb0)]){if(_0x57f0f8==='..'){if(_0xb85714===0x0)throw new Error(_0x552419(0xa7));_0xb85714--;}else _0x57f0f8!=='.'&&_0xb85714++;}}}export function joinPaths(_0x569ab2,_0x172f25){const _0x1de9e4=a157_0x57cc;if(!_0x569ab2||_0x569ab2==='/')return _0x172f25;if(!_0x172f25||_0x172f25==='.')return _0x569ab2;if(_0x172f25[_0x1de9e4(0xab)]('/'))return _0x172f25;const _0x446190=parsePath(_0x569ab2),_0x4f8841=parsePath(_0x172f25),_0x2504d6=[..._0x446190[_0x1de9e4(0xb0)]];for(const _0x59674f of _0x4f8841[_0x1de9e4(0xb0)]){if(_0x59674f==='.')continue;else{if(_0x59674f==='..'){if(_0x2504d6[_0x1de9e4(0x9d)]===0x0)throw new Error('Cannot\x20navigate\x20above\x20root');_0x2504d6['pop']();}else _0x2504d6[_0x1de9e4(0x8b)](_0x59674f);}}const _0x4aad16=_0x2504d6[_0x1de9e4(0x95)]('/');return _0x446190[_0x1de9e4(0x8a)][_0x1de9e4(0xab)]('/')?'/'+_0x4aad16:_0x4aad16;}function a157_0x4b29(){const _0x41b351=['Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.','Path\x20cannot\x20be\x20empty','length','parent_segment','tdx.json','19704BXkClq','substring','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','resolve','610vJbeVm','Path\x20segment\x20cannot\x20be\x20empty','2953809DtvnVi','Path\x20attempts\x20to\x20navigate\x20above\x20root','slice','exists','readFile','startsWith','dirname','trim','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','type','segments','isAbsolute','8594065pQshFY','897wZTMtH','parse','test','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','4niWmBX','5649032FeJSDP','root','journey','endsWith','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','File\x20not\x20found:\x20','raw','push','filter','No\x20tdx.json\x20found\x20for\x20file:\x20','name','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','Relative\x20path\x20cannot\x20be\x20empty','Cannot\x20navigate\x20above\x20root','161ttcmJG','.yml','replace','join','53854dtEhVA','Cannot\x20split\x20empty\x20path','pop','441492ujQOoe','190399GDiRCj'];a157_0x4b29=function(){return _0x41b351;};return a157_0x4b29();}function a157_0x57cc(_0x1c83e9,_0x4dcb03){_0x1c83e9=_0x1c83e9-0x7f;const _0x4b295c=a157_0x4b29();let _0x57cce6=_0x4b295c[_0x1c83e9];return _0x57cce6;}export function normalizePath(_0x811509){const _0x4764f7=a157_0x57cc,_0x1a1990=parsePath(_0x811509),_0x1bc216=[];for(const _0x27b4ce of _0x1a1990[_0x4764f7(0xb0)]){if(_0x27b4ce==='.')continue;else{if(_0x27b4ce==='..'){if(_0x1bc216['length']===0x0){if(_0x1a1990[_0x4764f7(0xb1)])throw new Error(_0x4764f7(0x91));_0x1bc216[_0x4764f7(0x8b)]('..');}else _0x1bc216[_0x1bc216['length']-0x1]==='..'?_0x1bc216[_0x4764f7(0x8b)]('..'):_0x1bc216[_0x4764f7(0x98)]();}else _0x1bc216['push'](_0x27b4ce);}}if(_0x1bc216[_0x4764f7(0x9d)]===0x0)return _0x1a1990[_0x4764f7(0xb1)]?'/':'.';const _0x118784=_0x1bc216[_0x4764f7(0x95)]('/');return _0x1a1990[_0x4764f7(0x8a)][_0x4764f7(0xab)]('/')?'/'+_0x118784:_0x118784;}export function getParentPath(_0x541c3f){const _0x1a8a33=a157_0x57cc,_0x4154c5=parsePath(_0x541c3f);if(_0x4154c5[_0x1a8a33(0xb0)][_0x1a8a33(0x9d)]<=0x1)return'/';const _0x29a85f=_0x4154c5[_0x1a8a33(0xb0)][_0x1a8a33(0xa8)](0x0,-0x1)['join']('/');return _0x4154c5['raw'][_0x1a8a33(0xab)]('/')?'/'+_0x29a85f:_0x29a85f;}export function getBaseName(_0x1e1ceb){const _0x16f6a9=a157_0x57cc,_0x55b4d=parsePath(_0x1e1ceb);return _0x55b4d[_0x16f6a9(0xb0)][_0x55b4d[_0x16f6a9(0xb0)][_0x16f6a9(0x9d)]-0x1]||'';}export function isChildPath(_0xee3dc5,_0x479188){const _0x2a13ad=a157_0x57cc,_0x71835e=parsePath(_0xee3dc5),_0x32febc=parsePath(_0x479188);if(_0x71835e[_0x2a13ad(0xb0)][_0x2a13ad(0x9d)]<=_0x32febc[_0x2a13ad(0xb0)][_0x2a13ad(0x9d)])return![];for(let _0x4e9232=0x0;_0x4e9232<_0x32febc[_0x2a13ad(0xb0)][_0x2a13ad(0x9d)];_0x4e9232++){if(_0x71835e[_0x2a13ad(0xb0)][_0x4e9232]!==_0x32febc[_0x2a13ad(0xb0)][_0x4e9232])return![];}return!![];}export function splitPath(_0x5b0d50){const _0x2a03f1=a157_0x57cc,_0x239311=parsePath(_0x5b0d50);if(_0x239311[_0x2a03f1(0xb0)][_0x2a03f1(0x9d)]===0x0)throw new Error(_0x2a03f1(0x97));if(_0x239311[_0x2a03f1(0xb0)][_0x2a03f1(0x9d)]===0x1)return{'parent':_0x239311[_0x2a03f1(0xb0)][0x0]};return{'parent':_0x239311[_0x2a03f1(0xb0)][0x0],'child':_0x239311[_0x2a03f1(0xb0)][_0x2a03f1(0xa8)](0x1)[_0x2a03f1(0x95)]('/')};}export function isYamlFilePath(_0x88ab0d){const _0x32364f=a157_0x57cc;return _0x88ab0d['endsWith'](_0x32364f(0x93))||_0x88ab0d[_0x32364f(0x87)]('.yaml');}export async function resolveYamlFilePath(_0xa9cfa3,_0xf925db=nodeFileSystem){const _0x26ed08=a157_0x57cc,_0x5e934e=a157_0x112c91[_0x26ed08(0xa3)](_0xa9cfa3);if(!await _0xf925db[_0x26ed08(0xa9)](_0x5e934e))throw new Error(_0x26ed08(0x89)+_0xa9cfa3);let _0x1105f5=a157_0x112c91['dirname'](_0x5e934e),_0x5d1d4a=null,_0x3acd29=null;const _0x1aff38=a157_0x112c91[_0x26ed08(0x80)](_0x1105f5)[_0x26ed08(0x85)];while(_0x1105f5!==_0x1aff38){const _0x2b49c7=a157_0x112c91[_0x26ed08(0x95)](_0x1105f5,_0x26ed08(0x9f));if(await _0xf925db[_0x26ed08(0xa9)](_0x2b49c7)){_0x5d1d4a=_0x2b49c7,_0x3acd29=_0x1105f5;break;}_0x1105f5=a157_0x112c91[_0x26ed08(0xac)](_0x1105f5);}if(!_0x5d1d4a||!_0x3acd29)throw new Error(_0x26ed08(0x8d)+_0xa9cfa3+'\x0a'+_0x26ed08(0x9b));const _0x53135f=await _0xf925db[_0x26ed08(0xaa)](_0x5d1d4a),_0x2eae5b=JSON[_0x26ed08(0x80)](_0x53135f),_0x1fe413=_0x2eae5b[_0x26ed08(0x9e)];if(!_0x1fe413)throw new Error(_0x26ed08(0x8f));const _0x5c8a28=await _0xf925db[_0x26ed08(0xaa)](_0x5e934e),_0x55461c=a157_0x539c96(_0x5c8a28),_0x2fa232=_0x55461c[_0x26ed08(0x8e)];if(!_0x2fa232)throw new Error(_0x26ed08(0x88)+_0xa9cfa3);const _0x1dff07=_0x55461c[_0x26ed08(0xaf)]===_0x26ed08(0x86)?_0x26ed08(0x86):'segment',_0xfeb68f=a157_0x112c91['relative'](_0x3acd29,_0x5e934e),_0x2e7ad4=a157_0x112c91[_0x26ed08(0xac)](_0xfeb68f),_0x1db879=_0x2e7ad4==='.'?'':_0x2e7ad4[_0x26ed08(0x94)](/\\/g,'/'),_0xdc667b=_0x1db879?_0x1fe413+'/'+_0x1db879+'/'+_0x2fa232:_0x1fe413+'/'+_0x2fa232;return{'parentSegment':_0x1fe413,'segmentName':_0x2fa232,'folderPath':_0x1db879,'fullPath':_0xdc667b,'resourceType':_0x1dff07,'content':_0x5c8a28};}
@@ -1 +1 @@
1
- function a158_0x5c35(){const _0x54044d=['50060eZpejO','89748ifxRlh','substring','369TqCdjs','indexOf','303976DeTGmS','2503584BTpTpk','1865ZSpZqn','7QbCBOo','252738bIQBGi','673112xGOews','2396Xtfthe'];a158_0x5c35=function(){return _0x54044d;};return a158_0x5c35();}function a158_0x1b5f(_0x194b40,_0x5d9fc6){_0x194b40=_0x194b40-0x108;const _0x5c3597=a158_0x5c35();let _0x1b5fe8=_0x5c3597[_0x194b40];return _0x1b5fe8;}(function(_0x598ea1,_0x37d871){const _0x1db84a=a158_0x1b5f,_0x3784fd=_0x598ea1();while(!![]){try{const _0x2e712f=-parseInt(_0x1db84a(0x112))/0x1+parseInt(_0x1db84a(0x10a))/0x2+-parseInt(_0x1db84a(0x10e))/0x3+parseInt(_0x1db84a(0x10c))/0x4*(-parseInt(_0x1db84a(0x108))/0x5)+parseInt(_0x1db84a(0x113))/0x6+-parseInt(_0x1db84a(0x109))/0x7*(-parseInt(_0x1db84a(0x10b))/0x8)+parseInt(_0x1db84a(0x110))/0x9*(parseInt(_0x1db84a(0x10d))/0xa);if(_0x2e712f===_0x37d871)break;else _0x3784fd['push'](_0x3784fd['shift']());}catch(_0x1cc486){_0x3784fd['push'](_0x3784fd['shift']());}}}(a158_0x5c35,0x434f3));export function parseSegmentRef(_0x4e1b1f){const _0x4936bc=a158_0x1b5f,_0x3b3921=_0x4e1b1f[_0x4936bc(0x111)]('/');if(_0x3b3921===-0x1)return{'parentId':_0x4e1b1f};if(_0x3b3921===0x0)throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x4e1b1f+'.\x20Parent\x20name\x20cannot\x20be\x20empty');const _0x496a9b=_0x4e1b1f[_0x4936bc(0x10f)](0x0,_0x3b3921),_0x1dea28=_0x4e1b1f[_0x4936bc(0x10f)](_0x3b3921+0x1);if(_0x1dea28==='')throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x4e1b1f+'.\x20Child\x20name\x20cannot\x20be\x20empty');return{'parentId':_0x496a9b,'childId':_0x1dea28};}
1
+ function a158_0x2a64(){const _0xf17d46=['570699IfogkR','Invalid\x20segment\x20reference\x20format:\x20','6362163mIaLtu','.\x20Child\x20name\x20cannot\x20be\x20empty','substring','135yQNGnu','.\x20Parent\x20name\x20cannot\x20be\x20empty','7GvYclQ','2664192OmYWvs','68394BrRKUd','2842552PPwlEM','6lezrxo','3942323nzWXMv','indexOf','10aoeMiW','455205HhAkmh'];a158_0x2a64=function(){return _0xf17d46;};return a158_0x2a64();}(function(_0x20d7b1,_0x26383e){const _0x5694ab=a158_0x42e7,_0x36856d=_0x20d7b1();while(!![]){try{const _0x5e3622=-parseInt(_0x5694ab(0x178))/0x1+parseInt(_0x5694ab(0x174))/0x2*(parseInt(_0x5694ab(0x169))/0x3)+parseInt(_0x5694ab(0x171))/0x4+parseInt(_0x5694ab(0x16e))/0x5*(parseInt(_0x5694ab(0x172))/0x6)+parseInt(_0x5694ab(0x170))/0x7*(-parseInt(_0x5694ab(0x173))/0x8)+parseInt(_0x5694ab(0x16b))/0x9*(-parseInt(_0x5694ab(0x177))/0xa)+parseInt(_0x5694ab(0x175))/0xb;if(_0x5e3622===_0x26383e)break;else _0x36856d['push'](_0x36856d['shift']());}catch(_0x48e718){_0x36856d['push'](_0x36856d['shift']());}}}(a158_0x2a64,0x5e1ca));function a158_0x42e7(_0x37ae2d,_0x4af14e){_0x37ae2d=_0x37ae2d-0x169;const _0x2a647a=a158_0x2a64();let _0x42e75a=_0x2a647a[_0x37ae2d];return _0x42e75a;}export function parseSegmentRef(_0x2e79bb){const _0x1a4e1c=a158_0x42e7,_0x630e77=_0x2e79bb[_0x1a4e1c(0x176)]('/');if(_0x630e77===-0x1)return{'parentId':_0x2e79bb};if(_0x630e77===0x0)throw new Error(_0x1a4e1c(0x16a)+_0x2e79bb+_0x1a4e1c(0x16f));const _0x5a7eb6=_0x2e79bb['substring'](0x0,_0x630e77),_0x40a2a7=_0x2e79bb[_0x1a4e1c(0x16d)](_0x630e77+0x1);if(_0x40a2a7==='')throw new Error(_0x1a4e1c(0x16a)+_0x2e79bb+_0x1a4e1c(0x16c));return{'parentId':_0x5a7eb6,'childId':_0x40a2a7};}