@treasuredata/tdx 0.28.3 → 0.28.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (184) 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.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/chat-command.js +1 -1
  11. package/dist/commands/claude-command.js +1 -1
  12. package/dist/commands/claude-statusline-command.js +1 -1
  13. package/dist/commands/claude-usage-command.js +1 -1
  14. package/dist/commands/command.js +1 -1
  15. package/dist/commands/connection-command.js +1 -1
  16. package/dist/commands/databases.js +1 -1
  17. package/dist/commands/delivery-command.js +1 -1
  18. package/dist/commands/describe.js +1 -1
  19. package/dist/commands/engage-campaign-pull-command.js +1 -1
  20. package/dist/commands/engage-campaign-push-command.js +1 -1
  21. package/dist/commands/engage-campaign-validate-command.js +1 -1
  22. package/dist/commands/engage-command.js +1 -1
  23. package/dist/commands/job-command.js +1 -1
  24. package/dist/commands/journey-command.js +1 -1
  25. package/dist/commands/journey-validate-command.js +1 -1
  26. package/dist/commands/llm-command.js +1 -1
  27. package/dist/commands/mcp-command.js +1 -1
  28. package/dist/commands/parent-segment-command.js +1 -1
  29. package/dist/commands/profile-command.js +1 -1
  30. package/dist/commands/profiles-command.js +1 -1
  31. package/dist/commands/query-command.js +1 -1
  32. package/dist/commands/schedule-command.js +1 -1
  33. package/dist/commands/segment-command.js +1 -1
  34. package/dist/commands/segment-create-command.js +1 -1
  35. package/dist/commands/segment-fields-command.js +1 -1
  36. package/dist/commands/segment-pull-command.js +1 -1
  37. package/dist/commands/segment-push-command.js +1 -1
  38. package/dist/commands/segment-update-command.js +1 -1
  39. package/dist/commands/segment-use-command.js +1 -1
  40. package/dist/commands/segment-validate-command.js +1 -1
  41. package/dist/commands/segments.js +1 -1
  42. package/dist/commands/show.js +1 -1
  43. package/dist/commands/status-command.js +1 -1
  44. package/dist/commands/tables.js +1 -1
  45. package/dist/commands/unset-command.js +1 -1
  46. package/dist/commands/use-command.js +1 -1
  47. package/dist/commands/user-command.js +1 -1
  48. package/dist/commands/workflow-command.js +1 -1
  49. package/dist/core/auth.js +1 -1
  50. package/dist/core/command-output.js +1 -1
  51. package/dist/core/config.js +1 -1
  52. package/dist/core/connection-cache.js +1 -1
  53. package/dist/core/constants.js +1 -1
  54. package/dist/core/credential-cache.js +1 -1
  55. package/dist/core/global-context.js +1 -1
  56. package/dist/core/keychain.js +1 -1
  57. package/dist/core/profile.js +1 -1
  58. package/dist/core/project-config.js +1 -1
  59. package/dist/core/session.js +1 -1
  60. package/dist/core/user-cache.js +1 -1
  61. package/dist/core/version.js +1 -1
  62. package/dist/index.js +1 -1
  63. package/dist/mcp/server.js +1 -1
  64. package/dist/mcp/tools/index.js +1 -1
  65. package/dist/mcp/tools/tdx-run.js +1 -1
  66. package/dist/mcp/tools/tdx-search.js +1 -1
  67. package/dist/mcp/utils.js +1 -1
  68. package/dist/proxy/claude-usage-tracker.js +1 -1
  69. package/dist/proxy/passthrough-server.js +1 -1
  70. package/dist/proxy/sse-usage-parser.js +1 -1
  71. package/dist/sdk/agent/agent-config.js +1 -1
  72. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  73. package/dist/sdk/agent/agent-yaml.js +1 -1
  74. package/dist/sdk/agent/test/evaluator.js +1 -1
  75. package/dist/sdk/agent/test/executor.js +1 -1
  76. package/dist/sdk/agent/test/index.js +1 -1
  77. package/dist/sdk/agent/test/output.js +1 -1
  78. package/dist/sdk/agent/test/parser.js +1 -1
  79. package/dist/sdk/agent/tool-target-registry.js +1 -1
  80. package/dist/sdk/api.js +1 -1
  81. package/dist/sdk/client/cdp-api-client.js +1 -1
  82. package/dist/sdk/client/delivery-api-client.js +1 -1
  83. package/dist/sdk/client/endpoints.js +1 -1
  84. package/dist/sdk/client/engage-api-client.js +1 -1
  85. package/dist/sdk/client/http-client.js +1 -1
  86. package/dist/sdk/client/llm-api-client.js +1 -1
  87. package/dist/sdk/client/rate-limiter.js +1 -1
  88. package/dist/sdk/client/td-api-client.js +1 -1
  89. package/dist/sdk/client/trino-api-client.js +1 -1
  90. package/dist/sdk/client/workflow-client.js +1 -1
  91. package/dist/sdk/connection-validator.js +1 -1
  92. package/dist/sdk/connection.js +1 -1
  93. package/dist/sdk/delivery.js +1 -1
  94. package/dist/sdk/engage/campaign-pull.js +1 -1
  95. package/dist/sdk/engage/campaign-push.js +1 -1
  96. package/dist/sdk/engage/campaign-validator.js +1 -1
  97. package/dist/sdk/engage/campaign-yaml.js +1 -1
  98. package/dist/sdk/engage/types/campaign-def.js +1 -1
  99. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  100. package/dist/sdk/engage.js +1 -1
  101. package/dist/sdk/errors.js +1 -1
  102. package/dist/sdk/index.js +1 -1
  103. package/dist/sdk/io/index.js +1 -1
  104. package/dist/sdk/io/node-filesystem.js +1 -1
  105. package/dist/sdk/job.js +1 -1
  106. package/dist/sdk/journey.js +1 -1
  107. package/dist/sdk/llm/chat-cache.js +1 -1
  108. package/dist/sdk/llm/index.js +1 -1
  109. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  110. package/dist/sdk/llm/model-factors.js +1 -1
  111. package/dist/sdk/personalization.js +1 -1
  112. package/dist/sdk/query/index.js +1 -1
  113. package/dist/sdk/query/sql-parser.js +1 -1
  114. package/dist/sdk/realtime.js +1 -1
  115. package/dist/sdk/schedule.js +1 -1
  116. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  117. package/dist/sdk/segment/fields-display.js +1 -1
  118. package/dist/sdk/segment/file-discovery.js +1 -1
  119. package/dist/sdk/segment/journey-utils.d.ts.map +1 -1
  120. package/dist/sdk/segment/journey-utils.js +1 -1
  121. package/dist/sdk/segment/journey-utils.js.map +1 -1
  122. package/dist/sdk/segment/journey-validator.js +1 -1
  123. package/dist/sdk/segment/journey-validator.js.map +1 -1
  124. package/dist/sdk/segment/journey-yaml.d.ts.map +1 -1
  125. package/dist/sdk/segment/journey-yaml.js +1 -1
  126. package/dist/sdk/segment/journey-yaml.js.map +1 -1
  127. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  128. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  129. package/dist/sdk/segment/pull-workflow.js +1 -1
  130. package/dist/sdk/segment/push-recovery.js +1 -1
  131. package/dist/sdk/segment/push-workflow.js +1 -1
  132. package/dist/sdk/segment/resolution-context.js +1 -1
  133. package/dist/sdk/segment/segment-path-parser.js +1 -1
  134. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  135. package/dist/sdk/segment/target-resolution.js +1 -1
  136. package/dist/sdk/segment/tdx-config.js +1 -1
  137. package/dist/sdk/segment/validate-files.js +1 -1
  138. package/dist/sdk/segment/yaml-validator.js +1 -1
  139. package/dist/sdk/segment.js +1 -1
  140. package/dist/sdk/types/index.js +1 -1
  141. package/dist/sdk/types/progress.js +1 -1
  142. package/dist/sdk/user.js +1 -1
  143. package/dist/sdk/util/format-detector.js +1 -1
  144. package/dist/sdk/util/formatters.js +1 -1
  145. package/dist/sdk/util/index.js +1 -1
  146. package/dist/sdk/util/tree-formatter.js +1 -1
  147. package/dist/sdk/workflow/archive-validation.js +1 -1
  148. package/dist/sdk/workflow/clone-workflow.js +1 -1
  149. package/dist/sdk/workflow/index.js +1 -1
  150. package/dist/sdk/workflow/pull-workflow.js +1 -1
  151. package/dist/sdk/workflow/push-workflow.js +1 -1
  152. package/dist/sdk/workflow/tdx-config.js +1 -1
  153. package/dist/sdk/workflow/workflow-utils.js +1 -1
  154. package/dist/test-utils/command-runner.js +1 -1
  155. package/dist/test-utils/factories.js +1 -1
  156. package/dist/test-utils/fixtures.js +1 -1
  157. package/dist/test-utils/http-mock.js +1 -1
  158. package/dist/test-utils/index.js +1 -1
  159. package/dist/utils/async.js +1 -1
  160. package/dist/utils/colors.js +1 -1
  161. package/dist/utils/diff.js +1 -1
  162. package/dist/utils/file-permissions.js +1 -1
  163. package/dist/utils/global-cache.js +1 -1
  164. package/dist/utils/json-loader.js +1 -1
  165. package/dist/utils/local-cache.js +1 -1
  166. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  167. package/dist/utils/logger/formatters/index.js +1 -1
  168. package/dist/utils/logger/handlers/console-handler.js +1 -1
  169. package/dist/utils/logger/handlers/file-handler.js +1 -1
  170. package/dist/utils/logger/handlers/index.js +1 -1
  171. package/dist/utils/logger/handlers/null-handler.js +1 -1
  172. package/dist/utils/logger/index.js +1 -1
  173. package/dist/utils/logger/logger.js +1 -1
  174. package/dist/utils/logger/types.js +1 -1
  175. package/dist/utils/option-validation.js +1 -1
  176. package/dist/utils/process.js +1 -1
  177. package/dist/utils/prompt.js +1 -1
  178. package/dist/utils/spinner.js +1 -1
  179. package/dist/utils/sse-parser.js +1 -1
  180. package/dist/utils/string-utils.js +1 -1
  181. package/dist/utils/table-ref-parser.js +1 -1
  182. package/dist/utils/tdx-logger.js +1 -1
  183. package/dist/utils/version-check.js +1 -1
  184. package/package.json +1 -1
@@ -1 +1 @@
1
- const a126_0x4b70af=a126_0x2efb;(function(_0x5c478c,_0x1c3021){const _0x39a063=a126_0x2efb,_0x3150f5=_0x5c478c();while(!![]){try{const _0x2b7902=parseInt(_0x39a063(0x1d0))/0x1+parseInt(_0x39a063(0x1d4))/0x2+parseInt(_0x39a063(0x1bf))/0x3*(parseInt(_0x39a063(0x1d1))/0x4)+-parseInt(_0x39a063(0x1c7))/0x5+parseInt(_0x39a063(0x1cd))/0x6*(parseInt(_0x39a063(0x1cc))/0x7)+parseInt(_0x39a063(0x1c1))/0x8+parseInt(_0x39a063(0x1ce))/0x9*(-parseInt(_0x39a063(0x1c3))/0xa);if(_0x2b7902===_0x1c3021)break;else _0x3150f5['push'](_0x3150f5['shift']());}catch(_0x5385ed){_0x3150f5['push'](_0x3150f5['shift']());}}}(a126_0x2866,0x42297));import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';import a126_0x47f54b from'path';import{Logger}from'../../utils/logger/index.js';function a126_0x2efb(_0x4265a8,_0xd2dd21){_0x4265a8=_0x4265a8-0x1bc;const _0x286637=a126_0x2866();let _0x2efb94=_0x286637[_0x4265a8];return _0x2efb94;}const logger=Logger['of'](a126_0x4b70af(0x1bd));export function getPushRecoveryPath(_0x367e1f){const _0xd9be81=a126_0x4b70af,_0x462452=a126_0x47f54b[_0xd9be81(0x1be)](_0x367e1f),_0x51d0f7=a126_0x47f54b[_0xd9be81(0x1cf)](_0x367e1f);return a126_0x47f54b[_0xd9be81(0x1d6)](_0x462452,'.'+_0x51d0f7+_0xd9be81(0x1c6));}export function readPushRecovery(_0x460cdc){const _0xdcce0a=a126_0x4b70af,_0x976bcc=getPushRecoveryPath(_0x460cdc);if(!existsSync(_0x976bcc))return undefined;try{const _0x554bbc=readFileSync(_0x976bcc,'utf-8'),_0x424409=JSON[_0xdcce0a(0x1d2)](_0x554bbc);if(_0x424409?.[_0xdcce0a(0x1d8)]!==0x1||typeof _0x424409[_0xdcce0a(0x1c0)]!==_0xdcce0a(0x1ca))return undefined;return _0x424409;}catch(_0x382d32){return _0x382d32 instanceof SyntaxError?logger[_0xdcce0a(0x1c5)]('Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20'+_0x382d32):logger[_0xdcce0a(0x1c8)](_0xdcce0a(0x1c9)+_0x382d32),undefined;}}export function writePushRecovery(_0x45fc48,_0x383ee8){const _0x24cea5=a126_0x4b70af,_0x4d89f3=getPushRecoveryPath(_0x45fc48),_0x142a9a=_0x4d89f3+_0x24cea5(0x1d3);writeFileSync(_0x142a9a,JSON[_0x24cea5(0x1c2)](_0x383ee8,null,0x2)+'\x0a',_0x24cea5(0x1d7)),renameSync(_0x142a9a,_0x4d89f3);}function a126_0x2866(){const _0xb57f92=['dirname','18gSqohl','journeyName','1389480rLGzsN','stringify','3382930RNcDxU','toISOString','debug','.push-recovery.json','2686815ttAsso','warn','Failed\x20to\x20read\x20push\x20recovery\x20file:\x20','string','segments','5089eLBXWF','612MJKfEM','9HtYYGS','basename','278947MUCCbd','124252UKxYHZ','parse','.tmp','866982tomFvK','ENOENT','join','utf-8','version','code','tdx.sdk.push-recovery'];a126_0x2866=function(){return _0xb57f92;};return a126_0x2866();}export function deletePushRecovery(_0x15ea15){const _0x5a1984=a126_0x4b70af,_0x263368=getPushRecoveryPath(_0x15ea15);try{unlinkSync(_0x263368);}catch(_0x107fff){_0x107fff[_0x5a1984(0x1bc)]!==_0x5a1984(0x1d5)&&logger[_0x5a1984(0x1c5)]('Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20'+_0x107fff);}}export function saveSegmentToPushRecovery(_0x1cb4a4,_0x1e1fd6,_0x37396a,_0x3cbc38){const _0x50b3c1=a126_0x4b70af,_0x44b90b=readPushRecovery(_0x1cb4a4),_0x26133a=_0x44b90b?.[_0x50b3c1(0x1c0)]===_0x1e1fd6?{..._0x44b90b,'updatedAt':new Date()[_0x50b3c1(0x1c4)]()}:{'version':0x1,'journeyName':_0x1e1fd6,'updatedAt':new Date()['toISOString'](),'segments':{}};_0x26133a[_0x50b3c1(0x1cb)][_0x37396a]=_0x3cbc38,writePushRecovery(_0x1cb4a4,_0x26133a);}
1
+ function a126_0x1380(_0xc4c35b,_0x187af8){_0xc4c35b=_0xc4c35b-0x14b;const _0x54abd7=a126_0x54ab();let _0x1380ed=_0x54abd7[_0xc4c35b];return _0x1380ed;}(function(_0x5de7c8,_0x571676){const _0x3a6527=a126_0x1380,_0x22e248=_0x5de7c8();while(!![]){try{const _0x44ab8f=-parseInt(_0x3a6527(0x158))/0x1+parseInt(_0x3a6527(0x156))/0x2*(parseInt(_0x3a6527(0x15e))/0x3)+parseInt(_0x3a6527(0x14c))/0x4+parseInt(_0x3a6527(0x15d))/0x5*(parseInt(_0x3a6527(0x14e))/0x6)+-parseInt(_0x3a6527(0x14f))/0x7+-parseInt(_0x3a6527(0x151))/0x8+-parseInt(_0x3a6527(0x157))/0x9;if(_0x44ab8f===_0x571676)break;else _0x22e248['push'](_0x22e248['shift']());}catch(_0x1389ea){_0x22e248['push'](_0x22e248['shift']());}}}(a126_0x54ab,0x40378));import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';import a126_0x6e70e8 from'path';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of']('tdx.sdk.push-recovery');export function getPushRecoveryPath(_0x3ad24b){const _0x3c615d=a126_0x1380,_0x531d36=a126_0x6e70e8[_0x3c615d(0x153)](_0x3ad24b),_0x2bb78d=a126_0x6e70e8[_0x3c615d(0x155)](_0x3ad24b);return a126_0x6e70e8[_0x3c615d(0x162)](_0x531d36,'.'+_0x2bb78d+_0x3c615d(0x150));}export function readPushRecovery(_0x2e5dd2){const _0x426f9=a126_0x1380,_0x543a09=getPushRecoveryPath(_0x2e5dd2);if(!existsSync(_0x543a09))return undefined;try{const _0x3859c1=readFileSync(_0x543a09,_0x426f9(0x14d)),_0x1141d6=JSON['parse'](_0x3859c1);if(_0x1141d6?.[_0x426f9(0x15a)]!==0x1||typeof _0x1141d6[_0x426f9(0x154)]!=='string')return undefined;return _0x1141d6;}catch(_0x104873){return _0x104873 instanceof SyntaxError?logger[_0x426f9(0x15c)]('Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20'+_0x104873):logger[_0x426f9(0x161)]('Failed\x20to\x20read\x20push\x20recovery\x20file:\x20'+_0x104873),undefined;}}export function writePushRecovery(_0x280c78,_0x2b0f14){const _0x9e6d06=a126_0x1380,_0x18d6e6=getPushRecoveryPath(_0x280c78),_0x2e8adb=_0x18d6e6+_0x9e6d06(0x15b);writeFileSync(_0x2e8adb,JSON[_0x9e6d06(0x14b)](_0x2b0f14,null,0x2)+'\x0a',_0x9e6d06(0x14d)),renameSync(_0x2e8adb,_0x18d6e6);}function a126_0x54ab(){const _0x92efd1=['warn','join','stringify','1991652AUSBmP','utf-8','6ETsRoD','80899xZHKLO','.push-recovery.json','617216hGIQDT','toISOString','dirname','journeyName','basename','4oRWcuJ','5218902zrnZvl','197450PaVcFX','Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20','version','.tmp','debug','1168770RlJIEG','596103JlaaEp','segments','ENOENT'];a126_0x54ab=function(){return _0x92efd1;};return a126_0x54ab();}export function deletePushRecovery(_0x214bfa){const _0x4917ea=a126_0x1380,_0xae4782=getPushRecoveryPath(_0x214bfa);try{unlinkSync(_0xae4782);}catch(_0x19ce7d){_0x19ce7d['code']!==_0x4917ea(0x160)&&logger[_0x4917ea(0x15c)](_0x4917ea(0x159)+_0x19ce7d);}}export function saveSegmentToPushRecovery(_0x3a3ea6,_0x728e64,_0x3bcdf0,_0x3ec5db){const _0xc6e9b9=a126_0x1380,_0x3e4411=readPushRecovery(_0x3a3ea6),_0x156f0d=_0x3e4411?.[_0xc6e9b9(0x154)]===_0x728e64?{..._0x3e4411,'updatedAt':new Date()[_0xc6e9b9(0x152)]()}:{'version':0x1,'journeyName':_0x728e64,'updatedAt':new Date()[_0xc6e9b9(0x152)](),'segments':{}};_0x156f0d[_0xc6e9b9(0x15f)][_0x3bcdf0]=_0x3ec5db,writePushRecovery(_0x3a3ea6,_0x156f0d);}
@@ -1 +1 @@
1
- const a127_0x6d6e99=a127_0x3b0e;(function(_0x31ecee,_0x193ead){const _0x27f10b=a127_0x3b0e,_0x210df8=_0x31ecee();while(!![]){try{const _0x52f7df=parseInt(_0x27f10b(0x1b1))/0x1*(-parseInt(_0x27f10b(0x16b))/0x2)+-parseInt(_0x27f10b(0x1cb))/0x3+-parseInt(_0x27f10b(0x1b5))/0x4*(-parseInt(_0x27f10b(0x161))/0x5)+parseInt(_0x27f10b(0x1dc))/0x6*(-parseInt(_0x27f10b(0x127))/0x7)+parseInt(_0x27f10b(0x185))/0x8+parseInt(_0x27f10b(0x18a))/0x9+-parseInt(_0x27f10b(0x1ed))/0xa*(-parseInt(_0x27f10b(0x15e))/0xb);if(_0x52f7df===_0x193ead)break;else _0x210df8['push'](_0x210df8['shift']());}catch(_0x3a1658){_0x210df8['push'](_0x210df8['shift']());}}}(a127_0x1ce7,0x48b98));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a127_0x6d6e99(0x179));export const PENDING_SEGMENT_PREFIX=a127_0x6d6e99(0x126);export const PENDING_ACTIVATION_PREFIX=a127_0x6d6e99(0x194);export function createPendingSegmentId(_0x274bef){return''+PENDING_SEGMENT_PREFIX+_0x274bef+'__';}export function isPendingSegmentId(_0x1f67bb){const _0x1a1303=a127_0x6d6e99;return _0x1f67bb[_0x1a1303(0x1fa)](PENDING_SEGMENT_PREFIX)&&!_0x1f67bb[_0x1a1303(0x1fa)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x30b67a){const _0xd4a7f8=a127_0x6d6e99;return _0x30b67a[_0xd4a7f8(0x1a0)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x567c9e){return''+PENDING_ACTIVATION_PREFIX+_0x567c9e+'__';}export function isPendingActivationId(_0x3a6179){const _0x34805d=a127_0x6d6e99;return _0x3a6179[_0x34805d(0x1fa)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x4dd603){const _0x22482b=a127_0x6d6e99;return _0x4dd603[_0x22482b(0x1a0)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x16dab8,_0x264c33){const _0x167e01=a127_0x6d6e99,_0x5c857c=_0x16dab8+'::'+(_0x264c33[_0x167e01(0x1a3)]()||_0x167e01(0x13a)),_0x1ef56b=createHash(_0x167e01(0x13e))[_0x167e01(0x141)](_0x5c857c)['digest'](_0x167e01(0x10d))['slice'](0x0,0xc);return _0x167e01(0x1d9)+_0x1ef56b;}export function ensureJourneyDefaults(_0x162953){const _0x10fc1d=a127_0x6d6e99;!_0x162953[_0x10fc1d(0x123)]&&(_0x162953[_0x10fc1d(0x123)]=''),!_0x162953[_0x10fc1d(0x16e)]&&(_0x162953[_0x10fc1d(0x16e)]=_0x10fc1d(0x118));}export function injectExistingStageIds(_0x39eb96,_0x2b7bab){const _0x4ee870=a127_0x6d6e99,_0x32008e=new Map(_0x2b7bab[_0x4ee870(0x1b3)](_0x55ec05=>[_0x55ec05[_0x4ee870(0x1ef)],_0x55ec05['id']]));for(const _0x4b7d73 of _0x39eb96){if(!_0x4b7d73['id']){const _0x500656=_0x32008e[_0x4ee870(0x11b)](_0x4b7d73[_0x4ee870(0x1ef)]);_0x500656&&(_0x4b7d73['id']=_0x500656);}}}export function resolveTDFolderPath(_0x24f9c9,_0x38e8c2,_0x39ed3e){const _0x591ce9=a127_0x6d6e99;if(!_0x38e8c2)return _0x24f9c9;if(_0x24f9c9===_0x39ed3e||_0x24f9c9[_0x591ce9(0x1fa)](_0x39ed3e+'/'))return _0x24f9c9;return _0x24f9c9?_0x39ed3e+'/'+_0x24f9c9:_0x39ed3e;}export function addFoldersToCreate(_0x2e2aff,_0x560d9a,_0x2acaec){const _0xc92e06=a127_0x6d6e99;if(!_0x2e2aff)return;if(_0x560d9a[_0xc92e06(0x17d)](_0x2e2aff))return;const _0x58d4ac=_0x2e2aff[_0xc92e06(0x19a)]('/');let _0x257099='';for(const _0x20dac2 of _0x58d4ac){_0x257099=_0x257099?_0x257099+'/'+_0x20dac2:_0x20dac2,!_0x560d9a[_0xc92e06(0x17d)](_0x257099)&&_0x2acaec[_0xc92e06(0x13f)](_0x257099);}}export function sortFoldersByDepth(_0x1e8bb4){const _0x42e76f=a127_0x6d6e99;return[..._0x1e8bb4][_0x42e76f(0x17f)]((_0x42a9d3,_0x3d4dcd)=>{const _0x34d1a8=_0x42e76f,_0x1c7883=(_0x42a9d3[_0x34d1a8(0x140)](/\//g)||[])['length'],_0x1505a8=(_0x3d4dcd[_0x34d1a8(0x140)](/\//g)||[])[_0x34d1a8(0x105)];return _0x1c7883-_0x1505a8;});}import*as a127_0x230b02 from'yaml';import{readFileSync}from'fs';import a127_0x5bcaba from'path';import{isJourneyDef,parseYamlString as a127_0x1601b3,toYamlString as a127_0x2294a3,normalizeJourneyDef,hasMultipleVersions,journeyResponseToDef,collectSegmentIdsFromJourneyApi}from'./journey-yaml.js';function a127_0x3b0e(_0x10d9a,_0x297949){_0x10d9a=_0x10d9a-0xfc;const _0x1ce76e=a127_0x1ce7();let _0x3b0e54=_0x1ce76e[_0x10d9a];return _0x3b0e54;}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';function a127_0x1ce7(){const _0x31baea=['29379Llouyu','relative','Activation\x20not\x20found:\x20','updateSegmentById','activationStepsById','ACTIVATION_SYNTAX_ERROR','folder_created','activation_template_id','all','\x27\x20to\x20local\x20\x27','rootFolderId','isArray','toLowerCase','skipSegments','Updating\x20activation\x20\x27','size','set','waitStep','deps','segment','activationParams','):\x20','DecisionPoint','sha1','add','match','update','buildUserMaps','./journey-yaml.js','getSegment','yamlActivation','createActivation','logInfo','filter','journeyStages','ACTIVATION_UPDATE_ERROR','embedded_activation_creating','journey_creating','join','validatedRequest','Updating\x20segment\x20\x27','Fetching\x20','conditionSegmentId','parseDocument','behavior','Entry\x20criteria:\x20','journeys','toISOString','existingSegments','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','embedded_segment_creating','errors','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','Stage\x20\x27','\x27\x20wait\x20condition','204919tQwqJC','kind','idToEmailMap','10SnazTf','push','connectionIdToNameMap','branches','segment_updating','createSegment','segment_created','delete','resolveSegment','entries','2wsKMNt','createdSegmentId','Deleted\x20activation\x20\x27','state','keys','getSegment\x20failed\x20for\x20','resolvedRule','stages','Created\x20activation\x20\x27','connector_config',').\x20','flatMap','rule','withProgress','tdx.sdk.push-workflow','exitCriterias','listActivations','activation_updating','has','deleteSegment','sort','activation_','and\x20the\x20server\x20segment,\x20then\x20retry.','Failed\x20to\x20resolve\x20activation\x20','Failed\x20to\x20resolve\x20segment\x20','waitStepType','3465640rzLDZf','activations','\x27\x20by\x20rule\x20content','activation_creating','onProgress','1166229FGKwzT','connection','schedule','deleted','parentSegmentFolder','journeyBundleName','Segment\x20not\x20found:\x20','results','NOT_FOUND','debug','__pending_act_','../../utils/async.js','\x20activation\x20\x27','uniqueSegmentName','journey_created','created','split','JOURNEY_SYNTAX_ERROR','activation_updated','relationships','\x27\x20milestone','\x20error(s)','replace','Activation','notification','trim','activation_deleted','conditionTimeoutDuration','nameToId','Created\x20journey\x20\x27','list','milestone','unchanged','\x27...','folderPath','journey','deleteActivation','conditionTimeoutUnit','journeyById','249771zlySIM','Deleted\x20segment\x20\x27','map','updateActivation','593392UbxZfF','journeyActivationStepId','reduce','segmentNameToId','Condition','Matched\x20server\x20segment\x20\x27','SEGMENT_NOT_FOUND','segmentFolderId','data','segmentId','run_after_journey_refresh','\x20segment\x20from\x20file:\x20','isNew','with','segments','embedded_segment_created','activation_deleting','Failed\x20to\x20fetch\x20referenced\x20segment\x20','attributes','versionNumber','journeyActivationNameToId','hasChanges','1411749AqHBXt','localName','Created\x20segment\x20\x27','Journey\x20\x27','\x27\x20decision\x20point\x20branch\x20\x27','yamlConfig','some','Duration','\x20(referenced\x20in\x20journey\x20','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','null','Deleting\x20activation\x20\x27','activation_created','journey_entry_criteria_','Delete\x20the\x20push\x20recovery\x20file\x20(','absolutePath','66whyfzT','createJourneySegment','\x27\x20from\x20file:\x20','from','Embedded\x20segment\x20\x27','\x20journey\x20from\x20file:\x20','getJourney','folderPathToId','logDeleted','goal','Segment\x20not\x20found','journeyName','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','user','create','folder_creating','progress','110JauJLt','max','name','columns','parse','stringify','index','Updated\x20journey\x20\x27','entryCriteria','type','steps','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','parentId','startsWith','journeyId','activationContext','segment_deleted','\x0a\x20\x20','existingSegment','logSuccess','uniqueServerName','Creating\x20activation\x20\x27','Created\x20folder\x20\x27','journey_updating','segment_deleting','updated','all_columns','message','createFolder','existingJourney','Failed\x20to\x20','SEGMENT_UPDATE_ERROR','./child-segment-yaml.js','.$1.push-recovery.json','length','waitStepUnit','parentFolder','slice','Creating\x20folder\x20\x27','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','nameToType','existingActivation','hex','decision_point','diff','folderId','WaitStep','valid','idToName','logWarning','INTERNAL','entry_criteria','includes','draft','\x27\x20not\x20found\x20in\x20journey\x20\x27',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','get','\x27\x20exit\x20criteria','\x27\x20entry\x20criteria','conditions','object','stage\x20\x27','find','embeddedSegmentNameToId','description','utf-8','Creating\x20segment\x20\x27','__pending_'];a127_0x1ce7=function(){return _0x31baea;};return a127_0x1ce7();}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(_0x2a72ea){const _0x20bbbd=a127_0x6d6e99;if(Array[_0x20bbbd(0x132)](_0x2a72ea))return'['+_0x2a72ea[_0x20bbbd(0x1b3)](_0x2b9613=>stableStringify(_0x2b9613))['join'](',')+']';if(_0x2a72ea&&typeof _0x2a72ea===_0x20bbbd(0x11f)){const _0x10e916=_0x2a72ea,_0x48c5f4=Object['keys'](_0x10e916)[_0x20bbbd(0x17f)](),_0x5c10ce=_0x48c5f4[_0x20bbbd(0x1b3)](_0x1834cd=>'\x22'+_0x1834cd+'\x22:'+stableStringify(_0x10e916[_0x1834cd]));return'{'+_0x5c10ce[_0x20bbbd(0x14d)](',')+'}';}const _0x149ad0=JSON[_0x20bbbd(0x1f2)](_0x2a72ea);return _0x149ad0===undefined?_0x20bbbd(0x1d6):_0x149ad0;}function activationSignature(_0x227908){const _0x1336bc=a127_0x6d6e99,_0x23a9ff={'connection':_0x227908[_0x1336bc(0x18b)],..._0x227908[_0x1336bc(0xfd)]!==undefined&&{'all_columns':_0x227908[_0x1336bc(0xfd)]},..._0x227908[_0x1336bc(0x1f0)]!==undefined&&{'columns':_0x227908['columns']},..._0x227908[_0x1336bc(0x153)]!==undefined&&{'behavior':_0x227908[_0x1336bc(0x153)]},..._0x227908[_0x1336bc(0x18c)]!==undefined&&{'schedule':_0x227908[_0x1336bc(0x18c)]},..._0x227908[_0x1336bc(0x1a2)]!==undefined&&{'notification':_0x227908[_0x1336bc(0x1a2)]},..._0x227908['connector_config']!==undefined&&{'connector_config':_0x227908[_0x1336bc(0x174)]},..._0x227908[_0x1336bc(0x12e)]!==undefined&&{'activation_template_id':_0x227908[_0x1336bc(0x12e)]}};return stableStringify(_0x23a9ff);}async function fetchSegment(_0x1b4193,_0x1b16be,_0x543677,_0x53afb0){const _0x36c3d8=a127_0x6d6e99,_0x357cf5=_0x53afb0?.[_0x36c3d8(0x121)](_0x2c2692=>_0x2c2692['id']===_0x543677);if(_0x357cf5)return _0x357cf5;try{return await _0x1b4193[_0x36c3d8(0x13a)][_0x36c3d8(0x144)](_0x1b16be,_0x543677);}catch(_0x27bf76){logger[_0x36c3d8(0x193)](_0x36c3d8(0x170)+_0x543677+_0x36c3d8(0x11a)+_0x27bf76);try{return await _0x1b4193[_0x36c3d8(0x13a)]['getSegmentEntity'](_0x543677);}catch(_0x154fa4){return logger[_0x36c3d8(0x193)]('getSegmentEntity\x20also\x20failed\x20for\x20'+_0x543677+':\x20'+_0x154fa4),null;}}}function recoverSegmentIdsFromPushRecovery(_0x27282f,_0x270ef4,_0x265aee){const _0x59317f=a127_0x6d6e99,_0x3bcb7e=readPushRecovery(_0x27282f[_0x59317f(0x1db)]);if(_0x3bcb7e?.[_0x59317f(0x1e7)]===_0x27282f['yamlConfig'][_0x59317f(0x1ef)])for(const [_0x46e3d3,_0x105c7f]of Object[_0x59317f(0x16a)](_0x3bcb7e[_0x59317f(0x1c3)])){const _0x4e9321=generateDeterministicJourneySegmentName(_0x27282f[_0x59317f(0x1d0)][_0x59317f(0x1ef)],_0x46e3d3);_0x105c7f[_0x59317f(0x201)]===_0x4e9321&&(_0x270ef4[_0x59317f(0x137)](_0x46e3d3,_0x105c7f['segmentId']),_0x265aee['set'](_0x46e3d3,_0x105c7f[_0x59317f(0x1be)]));}}async function createOrRecoverEmbeddedSegment(_0x4aa3ea,_0xf68151,_0x4c6a4c,_0x677858){const _0x4c08fa=a127_0x6d6e99;let _0x2dcd3a;try{_0x2dcd3a=await _0x4aa3ea[_0x4c08fa(0x13a)][_0x4c08fa(0x1dd)]({'name':_0x4c6a4c[_0x4c08fa(0x197)],'description':_0x4c6a4c[_0x4c08fa(0x123)],'journeyId':_0x4c6a4c[_0x4c08fa(0x1fb)],'rule':_0x677858(_0x4c6a4c[_0x4c08fa(0x171)],!![]),'countPopulation':!![],'parentFolderId':_0x4c6a4c[_0x4c08fa(0x110)],'audienceId':_0x4c6a4c['parentId']});}catch(_0x8f06a0){const _0x2f5e17=_0x8f06a0 instanceof Error&&_0x8f06a0[_0x4c08fa(0xfe)][_0x4c08fa(0x117)]('Name\x20has\x20already\x20been\x20taken');if(_0x2f5e17){const _0xc18a72=readPushRecovery(_0xf68151[_0x4c08fa(0x1db)]),_0x21cb68=_0xc18a72?.['journeyName']===_0xf68151[_0x4c08fa(0x1d0)]['name']?_0xc18a72[_0x4c08fa(0x1c3)][_0x4c6a4c[_0x4c08fa(0x1cc)]]:undefined;if(_0x21cb68?.['uniqueServerName']===_0x4c6a4c[_0x4c08fa(0x197)])await _0x4aa3ea[_0x4c08fa(0x13a)][_0x4c08fa(0x12a)](_0x4c6a4c[_0x4c08fa(0x1f9)],_0x21cb68[_0x4c08fa(0x1be)],{'description':_0x4c6a4c[_0x4c08fa(0x123)],'rule':_0x677858(_0x4c6a4c[_0x4c08fa(0x171)],!![]),'countPopulation':!![]}),_0x2dcd3a=_0x21cb68[_0x4c08fa(0x1be)];else throw new SDKError(ErrorCode[_0x4c08fa(0x102)],_0x4c08fa(0x1e0)+_0x4c6a4c[_0x4c08fa(0x1cc)]+_0x4c08fa(0x15b)+(_0x4c08fa(0x1da)+_0xf68151[_0x4c08fa(0x1db)][_0x4c08fa(0x1a0)](/([^/]+)$/,_0x4c08fa(0x104))+')\x20')+_0x4c08fa(0x181),_0x8f06a0);}else throw _0x8f06a0;}return saveSegmentToPushRecovery(_0xf68151['absolutePath'],_0xf68151[_0x4c08fa(0x1d0)][_0x4c08fa(0x1ef)],_0x4c6a4c[_0x4c08fa(0x1cc)],{'segmentId':_0x2dcd3a,'uniqueServerName':_0x4c6a4c[_0x4c08fa(0x197)],'createdAt':new Date()['toISOString']()}),_0x2dcd3a;}export async function prepareSegmentFiles(_0xeae955,_0x31cb95,_0x33ebf3,_0xb1de8c,_0x297ffc){const _0x1d840b=a127_0x6d6e99,{activationDefToCreateRequest:_0x6d5a44}=await import(_0x1d840b(0x103)),_0x15346a=[],_0x589c9a=new Set();for(const {yamlConfig:_0x527188,folderPath:_0x1875a4,sourcePath:_0x5189ff}of _0xeae955){const _0x2f3c8e=resolveTDFolderPath(_0x1875a4,_0xb1de8c,_0x297ffc),_0x5ae6f7=_0x2f3c8e+':'+_0x527188[_0x1d840b(0x1ef)],_0x312709=_0x31cb95['segmentByFolderAndName'][_0x1d840b(0x11b)](_0x5ae6f7),_0x45a3f2=_0x312709?_0x31cb95['activationsBySegmentId'][_0x1d840b(0x11b)](_0x312709['id'])||[]:[];addFoldersToCreate(_0x2f3c8e,_0x31cb95['folderPathToId'],_0x589c9a);const _0x32c599=calculateActivationActions(_0x527188[_0x1d840b(0x186)]||[],_0x45a3f2,_0x31cb95[_0x1d840b(0x160)],_0x31cb95[_0x1d840b(0x163)]);for(const _0x25dc35 of _0x32c599){(_0x25dc35[_0x1d840b(0x1f6)]===_0x1d840b(0x1ea)||_0x25dc35[_0x1d840b(0x1f6)]===_0x1d840b(0x141))&&_0x25dc35[_0x1d840b(0x145)]&&(_0x25dc35['validatedRequest']=await _0x6d5a44(_0x25dc35['yamlActivation'],_0x33ebf3));}const _0x4b55ca=calculateSegmentDiff(_0x527188,_0x312709,_0x45a3f2,_0x31cb95[_0x1d840b(0x160)],_0x31cb95[_0x1d840b(0x163)]);_0x15346a['push']({'relativePath':_0x527188[_0x1d840b(0x1ef)],'absolutePath':_0x5189ff,'yamlConfig':_0x527188,'folderPath':_0x2f3c8e,'existingSegment':_0x312709,'existingActivations':_0x45a3f2,'isNew':_0x4b55ca[_0x1d840b(0x1c1)],'hasChanges':_0x4b55ca[_0x1d840b(0x1ca)],'diff':_0x4b55ca[_0x1d840b(0x10f)],'activationActions':_0x32c599});}return{'segmentFiles':_0x15346a,'foldersToCreate':_0x589c9a};}export async function prepareJourneyFiles(_0x58e811,_0x452f9a,_0x2d10b6,_0x3cee0a){const _0x39137b=a127_0x6d6e99,_0x3824b5=[],_0x42a6c1=new Set();for(const {yamlConfig:_0x287019,folderPath:_0x4b1f89,sourcePath:_0x25e001}of _0x58e811){const _0x30f95a=resolveTDFolderPath(_0x4b1f89,_0x2d10b6,_0x3cee0a),_0x4e03d8=_0x30f95a+':'+_0x287019[_0x39137b(0x1ef)],_0x1e74a3=_0x452f9a['journeyBundlesByFolderAndName'][_0x39137b(0x11b)](_0x4e03d8);let _0x3a4ea7,_0x4bf330;if(_0x1e74a3&&_0x1e74a3[_0x39137b(0x105)]>0x0){const _0x575a0d=buildLocalExpandedRuleMappings(_0x287019),{createYamlContext:_0x994189,prefetchJourneySegments:_0x504eab}=createPushYamlContextForBundle(_0x452f9a[_0x39137b(0x139)],_0x452f9a[_0x39137b(0x1f9)],_0x452f9a[_0x39137b(0x157)],_0x575a0d,_0x452f9a[_0x39137b(0x160)],_0x452f9a[_0x39137b(0x163)],_0x452f9a[_0x39137b(0x12b)],_0x452f9a[_0x39137b(0x1b0)]);await _0x504eab(_0x1e74a3[_0x39137b(0x1b3)](_0x1e1730=>_0x1e1730['id']));const _0x4d00f5=hasMultipleVersions(_0x287019),_0x3e5e4f=async _0x55aa97=>{const _0x59755b=_0x39137b,_0x5cdf3f=_0x452f9a[_0x59755b(0x1b0)]?.[_0x59755b(0x11b)](_0x55aa97);if(_0x5cdf3f)return _0x5cdf3f;return _0x452f9a['fetchJourney']({'journeyId':_0x55aa97,'journeyName':_0x287019[_0x59755b(0x1ef)],'isMultiVersion':_0x1e74a3['length']>0x1});};if(_0x4d00f5&&_0x1e74a3[_0x39137b(0x105)]>0x1){const _0x3e3ce2=[];for(const _0x3fbcdd of _0x1e74a3){const _0x492b9f=_0x3fbcdd[_0x39137b(0x1c8)]||0x1;_0x452f9a[_0x39137b(0x1ec)]?.[_0x39137b(0x141)](_0x39137b(0x150)+_0x287019[_0x39137b(0x1ef)]+'\x20v'+_0x492b9f);const _0x52dc13=await _0x3e5e4f(_0x3fbcdd['id']),_0x2df95a=_0x994189(_0x3fbcdd['id']),_0x524320=await journeyResponseToDef(_0x52dc13,_0x2df95a);_0x3e3ce2[_0x39137b(0x162)]({'item':_0x3fbcdd,'yaml':_0x524320});}const _0x2e7a1c=buildLocalRuleToNameMappingFromJourney(_0x287019);_0x4bf330=buildMergedJourneyDef(_0x3e3ce2,_0x2e7a1c);const _0x5ba48e=Math[_0x39137b(0x1ee)](..._0x3e3ce2[_0x39137b(0x1b3)](_0xcd86ec=>_0xcd86ec['item'][_0x39137b(0x1c8)]||0x0)),_0x4ab4a2=_0x1e74a3[_0x39137b(0x121)](_0x5c76ca=>(_0x5c76ca[_0x39137b(0x1c8)]||0x0)===_0x5ba48e);_0x4ab4a2&&(_0x452f9a[_0x39137b(0x1ec)]?.[_0x39137b(0x141)]('Fetching\x20'+_0x287019[_0x39137b(0x1ef)]+'\x20v'+_0x5ba48e),_0x3a4ea7=await _0x3e5e4f(_0x4ab4a2['id']));}else{const _0x4cb310=_0x1e74a3[_0x1e74a3['length']-0x1];_0x452f9a[_0x39137b(0x1ec)]?.[_0x39137b(0x141)]('Fetching\x20'+_0x287019[_0x39137b(0x1ef)]),_0x3a4ea7=await _0x3e5e4f(_0x4cb310['id']);const _0x3c4ebe=_0x994189(_0x4cb310['id']),_0x2d5d42=await journeyResponseToDef(_0x3a4ea7,_0x3c4ebe),_0x4e1208=buildLocalRuleToNameMappingFromJourney(_0x287019);_0x4bf330=buildMergedJourneyDef([{'item':_0x4cb310,'yaml':_0x2d5d42}],_0x4e1208);}}addFoldersToCreate(_0x30f95a,_0x452f9a[_0x39137b(0x1e3)],_0x42a6c1);const _0x45f488=calculateJourneyDiff(_0x287019,_0x4bf330);_0x3824b5[_0x39137b(0x162)]({'relativePath':_0x287019[_0x39137b(0x1ef)],'absolutePath':_0x25e001,'yamlConfig':_0x287019,'folderPath':_0x30f95a,'existingJourney':_0x3a4ea7,'isNew':_0x45f488[_0x39137b(0x1c1)],'hasChanges':_0x45f488[_0x39137b(0x1ca)],'diff':_0x45f488['diff']});}return{'journeyFiles':_0x3824b5,'foldersToCreate':_0x42a6c1};}export function calculateActivationActions(_0x469ee2,_0xd2e6e5,_0x2fbeb8,_0x46fba8){const _0x54600d=a127_0x6d6e99,_0x149b54=[],_0x5a32ba=new Map();for(const _0x2bbcb1 of _0xd2e6e5){_0x5a32ba[_0x54600d(0x137)](_0x2bbcb1[_0x54600d(0x1ef)],_0x2bbcb1);}const _0x28b761=new Map();for(const _0x5be2bc of _0x469ee2){_0x28b761['set'](_0x5be2bc[_0x54600d(0x1ef)],_0x5be2bc);}for(const _0x5e9c7a of _0x469ee2){const _0x375f02=_0x5a32ba[_0x54600d(0x11b)](_0x5e9c7a[_0x54600d(0x1ef)]);if(!_0x375f02)_0x149b54[_0x54600d(0x162)]({'type':'create','name':_0x5e9c7a[_0x54600d(0x1ef)],'yamlActivation':_0x5e9c7a});else{const _0x53dbb6=activationResponseToDef(_0x375f02,_0x2fbeb8,_0x46fba8),_0x457810=a127_0x230b02[_0x54600d(0x1f2)](_0x53dbb6),_0x3e61ef=a127_0x230b02[_0x54600d(0x1f2)](_0x5e9c7a);_0x457810!==_0x3e61ef&&_0x149b54[_0x54600d(0x162)]({'type':_0x54600d(0x141),'name':_0x5e9c7a[_0x54600d(0x1ef)],'yamlActivation':_0x5e9c7a,'existingActivation':_0x375f02});}}for(const _0x3b4cfc of _0xd2e6e5){!_0x28b761[_0x54600d(0x17d)](_0x3b4cfc[_0x54600d(0x1ef)])&&_0x149b54['push']({'type':_0x54600d(0x168),'name':_0x3b4cfc[_0x54600d(0x1ef)],'existingActivation':_0x3b4cfc});}return _0x149b54;}function calculateYamlDiff(_0x5dec6a,_0xccff76){if(_0xccff76){const _0x539a86=generateDiff(_0xccff76,_0x5dec6a),_0x2d4d46=hasChanges(_0x539a86);return{'isNew':![],'hasChanges':_0x2d4d46,'diff':_0x2d4d46?formatDiffWithColors(_0x539a86):undefined};}const _0x4994bb=generateDiff('',_0x5dec6a);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x4994bb)};}export function calculateSegmentDiff(_0x16bb7d,_0x91af9a,_0x37676e,_0x136f2f,_0x5ad2f4){const _0x1d47b4=segmentToYamlString(_0x16bb7d),_0x4cc4fc=_0x91af9a?segmentToYamlString(segmentWithActivationsToYaml(_0x91af9a,_0x37676e,undefined,_0x136f2f,_0x5ad2f4)):undefined;return calculateYamlDiff(_0x1d47b4,_0x4cc4fc);}export function calculateJourneyDiff(_0xa65ddd,_0x1b5a7f){const _0x277473=normalizeJourneyDef(_0xa65ddd,_0xa65ddd),_0x4933d9=a127_0x2294a3(_0x277473),_0x12d1bd=_0x1b5a7f?a127_0x2294a3(normalizeJourneyDef(_0x1b5a7f,_0xa65ddd)):undefined;return calculateYamlDiff(_0x4933d9,_0x12d1bd);}export function findSegmentsToDelete(_0x5627ff,_0x27584c,_0x45957b,_0x47ef3e,_0x24543e){const _0x162af4=a127_0x6d6e99,_0x5ae7f7=new Set();for(const {yamlConfig:_0x41aa94,folderPath:_0xa78b84}of _0x27584c){_0x5ae7f7[_0x162af4(0x13f)](_0xa78b84+':'+_0x41aa94[_0x162af4(0x1ef)]);}return _0x5627ff['filter'](_0x106a1f=>{const _0x242983=_0x162af4,_0x23b2c4=_0x106a1f[_0x242983(0x1bc)]?_0x45957b['get'](_0x106a1f[_0x242983(0x1bc)]['toString']())||'':'',_0x46b265=_0x23b2c4+':'+_0x106a1f[_0x242983(0x1ef)];if(_0x5ae7f7[_0x242983(0x17d)](_0x46b265))return![];if(_0x24543e)return _0x23b2c4===_0x47ef3e||_0x23b2c4[_0x242983(0x1fa)](_0x47ef3e+'/');return!![];});}export function findJourneysToDelete(_0x1ad12b,_0x3eac5d,_0x107ee6,_0x337c25,_0x56ac1b){const _0x553c39=a127_0x6d6e99,_0x20583e=new Set();for(const {yamlConfig:_0x40d4b2,folderPath:_0x47cf27}of _0x3eac5d){_0x20583e[_0x553c39(0x13f)](_0x47cf27+':'+_0x40d4b2[_0x553c39(0x1ef)]);}return _0x1ad12b[_0x553c39(0x148)](_0x2351e0=>{const _0x42de3f=_0x553c39,_0x364476=_0x2351e0[_0x42de3f(0x110)]?_0x107ee6[_0x42de3f(0x11b)](_0x2351e0[_0x42de3f(0x110)])||'':'',_0x43403f=_0x364476+':'+_0x2351e0[_0x42de3f(0x18f)];if(_0x20583e['has'](_0x43403f))return![];if(_0x56ac1b)return _0x364476===_0x337c25||_0x364476[_0x42de3f(0x1fa)](_0x337c25+'/');return!![];});}export function buildSegmentLookupMap(_0xcd6849,_0x3ea449){const _0x2b33c8=a127_0x6d6e99,_0x58d755=new Map();for(const _0x3aea1d of _0xcd6849){const _0x3b782d=_0x3aea1d[_0x2b33c8(0x1bc)]?_0x3ea449[_0x2b33c8(0x11b)](_0x3aea1d[_0x2b33c8(0x1bc)]['toString']())||'':'',_0x3e8f2c=_0x3b782d+':'+_0x3aea1d[_0x2b33c8(0x1ef)];_0x58d755['set'](_0x3e8f2c,_0x3aea1d);}return _0x58d755;}export function buildSegmentNameToIdMap(_0x2192ed){const _0x197226=a127_0x6d6e99,_0x1c2559=new Map();for(const _0x267ef1 of _0x2192ed){_0x1c2559[_0x197226(0x137)](_0x267ef1[_0x197226(0x1ef)],_0x267ef1['id']);}return _0x1c2559;}export function buildJourneyBundleLookupMap(_0x500f08,_0x20b289){const _0x2d055a=a127_0x6d6e99,_0x525ae4=new Map();for(const _0x248b6c of _0x500f08){const _0x209954=_0x248b6c['folderId']?_0x20b289['get'](_0x248b6c[_0x2d055a(0x110)])||'':'',_0x5ec750=_0x209954+':'+_0x248b6c[_0x2d055a(0x18f)];!_0x525ae4['has'](_0x5ec750)&&_0x525ae4[_0x2d055a(0x137)](_0x5ec750,[]),_0x525ae4[_0x2d055a(0x11b)](_0x5ec750)[_0x2d055a(0x162)](_0x248b6c);}for(const _0x2b67df of _0x525ae4['values']()){_0x2b67df['sort']((_0x596884,_0x1658b9)=>(_0x596884[_0x2d055a(0x1c8)]||0x0)-(_0x1658b9[_0x2d055a(0x1c8)]||0x0));}return _0x525ae4;}export function collectFoldersToCreate(_0x412e7f,_0x1bd399){const _0x4474ad=a127_0x6d6e99,_0x1cb9c2=new Set();for(const _0x4418e1 of _0x412e7f){if(!_0x4418e1)continue;if(_0x1bd399[_0x4474ad(0x17d)](_0x4418e1))continue;const _0x2b5b8f=_0x4418e1[_0x4474ad(0x19a)]('/');let _0x5d83ac='';for(const _0x43b725 of _0x2b5b8f){_0x5d83ac=_0x5d83ac?_0x5d83ac+'/'+_0x43b725:_0x43b725,!_0x1bd399[_0x4474ad(0x17d)](_0x5d83ac)&&_0x1cb9c2[_0x4474ad(0x13f)](_0x5d83ac);}}return _0x1cb9c2;}export function parseAndClassifyYamlFiles(_0x450b85,_0x3dfc6a,_0x383926){const _0x3de907=a127_0x6d6e99,_0x31fdad=[],_0x58b933=[];for(const _0x239246 of _0x450b85){const _0x4e2371=a127_0x5bcaba[_0x3de907(0x128)](_0x3dfc6a,a127_0x5bcaba['dirname'](_0x239246)),_0x4e0b08=_0x4e2371==='.'?'':_0x4e2371,_0xc42312=readFileSync(_0x239246,'utf-8'),_0x9de48e=a127_0x230b02[_0x3de907(0x1f1)](_0xc42312);if(isJourneyDef(_0x9de48e)){const _0x2b7e8c=a127_0x1601b3(_0xc42312);_0x58b933[_0x3de907(0x162)]({'yamlConfig':_0x2b7e8c,'folderPath':_0x4e0b08,'sourcePath':_0x239246});}else{if(!_0x383926?.[_0x3de907(0x134)]){const _0x51a3f2=parseSegmentYamlFile(_0xc42312),_0x43b3c2=normalizeChildSegmentYaml(_0x51a3f2);_0x31fdad[_0x3de907(0x162)]({'yamlConfig':_0x43b3c2,'folderPath':_0x4e0b08,'sourcePath':_0x239246});}}}return{'segments':_0x31fdad,'journeys':_0x58b933};}export function validateParsedFiles(_0x569cdc,_0x173dfe){const _0x11ffd3=a127_0x6d6e99,_0x11e814=[];for(const {yamlConfig:_0x2d7d32,sourcePath:_0x1b4f84}of _0x569cdc[_0x11ffd3(0x1c3)]){const _0x1a0e80=readFileSync(_0x1b4f84,_0x11ffd3(0x124)),_0x9fb574=a127_0x230b02[_0x11ffd3(0x152)](_0x1a0e80),_0x5eb11c=validateSegmentDef(_0x2d7d32,{'source':_0x1a0e80,'document':_0x9fb574});if(!_0x5eb11c[_0x11ffd3(0x112)]){const _0x504002=a127_0x5bcaba[_0x11ffd3(0x128)](_0x173dfe,_0x1b4f84);_0x11e814[_0x11ffd3(0x162)]({'filePath':_0x504002,'source':_0x1a0e80,'result':_0x5eb11c,'isJourney':![]});}}for(const {yamlConfig:_0xad7ddc,sourcePath:_0x150066}of _0x569cdc[_0x11ffd3(0x155)]){const _0x25b879=readFileSync(_0x150066,_0x11ffd3(0x124)),_0x136455=a127_0x230b02[_0x11ffd3(0x152)](_0x25b879),_0x31d75c=validateJourneyDef(_0xad7ddc,{'source':_0x25b879,'document':_0x136455});if(!_0x31d75c[_0x11ffd3(0x112)]){const _0x49852a=a127_0x5bcaba['relative'](_0x173dfe,_0x150066);_0x11e814['push']({'filePath':_0x49852a,'source':_0x25b879,'result':_0x31d75c,'isJourney':!![]});}}return _0x11e814;}export function formatValidationErrors(_0x9d57cb){const _0x4eeb54=a127_0x6d6e99,_0x37a8c9=[];for(const {filePath:_0x548984,source:_0x264e9c,result:_0x3ebe39,isJourney:_0x22a9f0}of _0x9d57cb){const _0xb6d5c6=_0x22a9f0?_0x4eeb54(0x1ad):'segment';_0x37a8c9['push']('\x0a'+_0x548984+'\x20('+_0xb6d5c6+_0x4eeb54(0x13c)+_0x3ebe39[_0x4eeb54(0x15a)][_0x4eeb54(0x105)]+_0x4eeb54(0x19f)),_0x37a8c9['push'](formatValidationResult(_0x3ebe39,_0x264e9c,_0x548984));}return _0x37a8c9[_0x4eeb54(0x14d)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x13c74c){const _0x45b08d=a127_0x6d6e99,_0x446d59=new Set(),_0x37a81c=new Map(),_0x37f96f=collectSegmentUsageCounts(_0x13c74c);if(_0x13c74c[_0x45b08d(0x1c3)])for(const [_0x291f24,_0x2220fb]of Object[_0x45b08d(0x16a)](_0x13c74c[_0x45b08d(0x1c3)])){_0x446d59[_0x45b08d(0x13f)](_0x291f24);if(_0x2220fb[_0x45b08d(0x177)]){const _0x14a6b5=yamlRuleToApi(_0x2220fb[_0x45b08d(0x177)]),_0x2821a6=apiRuleToYaml(_0x14a6b5);_0x37a81c[_0x45b08d(0x137)](_0x291f24,_0x2821a6);}}const _0x4d4557=new Map();let _0x21ac71=0x0;for(const [_0x1c8484,_0xddae9]of _0x37a81c){const _0xc3b021=serializeExpandedRule(_0xddae9,_0x37a81c),_0x130b20=_0x4d4557['get'](_0xc3b021)||[];_0x130b20[_0x45b08d(0x162)]({'name':_0x1c8484,'index':_0x21ac71}),_0x4d4557[_0x45b08d(0x137)](_0xc3b021,_0x130b20),_0x21ac71++;}const _0xaee23c=new Map();for(const [_0x378bc9,_0x284560]of _0x4d4557){const _0x331092=_0x284560[_0x45b08d(0x108)]()['sort']((_0x117641,_0x302716)=>{const _0x53befd=_0x45b08d,_0x31ef7a=_0x37f96f[_0x53befd(0x11b)](_0x117641['name'])||0x0,_0x158a69=_0x37f96f[_0x53befd(0x11b)](_0x302716[_0x53befd(0x1ef)])||0x0;if(_0x31ef7a!==_0x158a69)return _0x158a69-_0x31ef7a;return _0x117641['index']-_0x302716[_0x53befd(0x1f3)];})[_0x45b08d(0x1b3)](_0x3ea2ee=>_0x3ea2ee[_0x45b08d(0x1ef)]),_0x3d2cec=[];for(const _0x2b54fd of _0x331092){const _0x5321c3=_0x37f96f[_0x45b08d(0x11b)](_0x2b54fd)||0x0,_0x4c5305=Math[_0x45b08d(0x1ee)](_0x5321c3,0x1);for(let _0xec5d1e=0x0;_0xec5d1e<_0x4c5305;_0xec5d1e++){_0x3d2cec['push'](_0x2b54fd);}}_0xaee23c[_0x45b08d(0x137)](_0x378bc9,_0x3d2cec);}return{'existingLocalSegmentNames':_0x446d59,'localSegmentRules':_0x37a81c,'localExpandedRuleToNames':_0xaee23c};}export function createSegmentIdResolver(_0x61057f,_0x3c6be9){return async _0x4398ce=>{const _0x198d70=a127_0x3b0e,_0x568d77=_0x61057f[_0x198d70(0x11b)](_0x4398ce);if(!_0x568d77)throw new SDKError(ErrorCode[_0x198d70(0x1bb)],'Segment\x20not\x20found:\x20'+_0x4398ce+_0x198d70(0x158)+_0x3c6be9+'\x27)');return _0x568d77;};}export function extractRootFolderId(_0x38dab5){const _0x41fe20=a127_0x6d6e99;return _0x38dab5['relationships']?.[_0x41fe20(0x18e)]?.['data']?.['id']||_0x38dab5['relationships']?.[_0x41fe20(0x107)]?.['data']?.['id'];}export function buildConnectionMaps(_0x50e90e){const _0x5d5415=a127_0x6d6e99,_0x48e3da=new Map(),_0x4f47c8=new Map(),_0x3c93d1=new Map();for(const _0x32706a of _0x50e90e){_0x48e3da[_0x5d5415(0x137)](_0x32706a['name'],parseInt(_0x32706a['id'],0xa)),_0x4f47c8['set'](_0x32706a['id'],_0x32706a[_0x5d5415(0x1ef)]),_0x3c93d1['set'](_0x32706a[_0x5d5415(0x1ef)],_0x32706a[_0x5d5415(0x1f6)]);}return{'nameToId':_0x48e3da,'idToName':_0x4f47c8,'nameToType':_0x3c93d1};}export function calculatePushStats(_0x12001c,_0x753c1c,_0x229e6f,_0x2a0ae5,_0x192ef6,_0x30c95d,_0x5c1e2b){const _0x8eb8bf=a127_0x6d6e99,_0x1d6386=_0x12001c[_0x8eb8bf(0x148)](_0x4333aa=>_0x4333aa[_0x8eb8bf(0x1c1)]),_0x256f2b=_0x12001c['filter'](_0x3c9830=>!_0x3c9830[_0x8eb8bf(0x1c1)]&&_0x3c9830[_0x8eb8bf(0x1ca)]),_0x5bd225=_0x12001c[_0x8eb8bf(0x148)](_0x2774e0=>!_0x2774e0['isNew']&&!_0x2774e0[_0x8eb8bf(0x1ca)]),_0x5b3e9d=_0x30c95d?_0x2a0ae5:[],_0x115a0d=_0x753c1c[_0x8eb8bf(0x148)](_0x11e7f5=>_0x11e7f5[_0x8eb8bf(0x1c1)]),_0x4ed35c=_0x753c1c[_0x8eb8bf(0x148)](_0x13771d=>!_0x13771d['isNew']&&_0x13771d[_0x8eb8bf(0x1ca)]),_0x33a70c=_0x753c1c[_0x8eb8bf(0x148)](_0x60ff2c=>!_0x60ff2c['isNew']&&!_0x60ff2c['hasChanges']),_0x1a8938=_0x30c95d?_0x192ef6:[],_0x8953ef=_0x12001c[_0x8eb8bf(0x176)](_0x583153=>_0x583153['activationActions']),_0x47d541=_0x8953ef['filter'](_0xb8ad53=>_0xb8ad53[_0x8eb8bf(0x1f6)]===_0x8eb8bf(0x1ea)),_0xd81f78=_0x8953ef[_0x8eb8bf(0x148)](_0x5ee481=>_0x5ee481[_0x8eb8bf(0x1f6)]===_0x8eb8bf(0x141)),_0x4651e9=_0x8953ef[_0x8eb8bf(0x148)](_0x521add=>_0x521add[_0x8eb8bf(0x1f6)]===_0x8eb8bf(0x168)),_0x4503dc=Array[_0x8eb8bf(0x1df)](_0x229e6f)[_0x8eb8bf(0x17f)](),_0x33d64e=_0x5c1e2b?![]:_0x1d6386[_0x8eb8bf(0x105)]>0x0||_0x256f2b[_0x8eb8bf(0x105)]>0x0||_0x5b3e9d[_0x8eb8bf(0x105)]>0x0,_0x203788=_0x115a0d[_0x8eb8bf(0x105)]>0x0||_0x4ed35c[_0x8eb8bf(0x105)]>0x0||_0x1a8938[_0x8eb8bf(0x105)]>0x0,_0x28da4c=_0x5c1e2b?![]:_0x8953ef['length']>0x0,_0x4f47e7=_0x4503dc[_0x8eb8bf(0x105)]>0x0;return{'segments':{'new':_0x1d6386,'changed':_0x256f2b,'unchanged':_0x5bd225,'toDelete':_0x5b3e9d},'journeys':{'new':_0x115a0d,'changed':_0x4ed35c,'unchanged':_0x33a70c,'toDelete':_0x1a8938},'activations':{'all':_0x8953ef,'toCreate':_0x47d541,'toUpdate':_0xd81f78,'toDelete':_0x4651e9},'folders':{'toCreate':_0x4503dc},'counts':{'segments':{'new':_0x1d6386[_0x8eb8bf(0x105)],'changed':_0x256f2b[_0x8eb8bf(0x105)],'unchanged':_0x5bd225[_0x8eb8bf(0x105)],'toDelete':_0x5b3e9d[_0x8eb8bf(0x105)]},'journeys':{'new':_0x115a0d[_0x8eb8bf(0x105)],'changed':_0x4ed35c['length'],'unchanged':_0x33a70c['length'],'toDelete':_0x1a8938['length']},'activations':{'create':_0x47d541[_0x8eb8bf(0x105)],'update':_0xd81f78[_0x8eb8bf(0x105)],'delete':_0x4651e9[_0x8eb8bf(0x105)]},'folders':_0x4503dc[_0x8eb8bf(0x105)]},'hasChanges':_0x33d64e||_0x203788||_0x28da4c||_0x4f47e7};}export async function buildPushExecutionContext(_0xc7a7c7,_0x20d449,_0xf18f4d,_0x55e773,_0x47d7ef,_0x5e7bdc){const _0x574cf8=a127_0x6d6e99,_0x165afb=extractRootFolderId(_0xf18f4d),{pathToId:_0x3e268d,idToPath:_0x3f8204}=buildFolderMaps(_0x47d7ef),_0x55d84e=buildSegmentNameToIdMap(_0x55e773),_0x23f19e=new Map(),{batchAsync:_0x1a3c4e}=await import(_0x574cf8(0x195)),[_0x19781a,_0x3218ad]=await Promise[_0x574cf8(0x12f)]([_0xc7a7c7[_0x574cf8(0x1e9)][_0x574cf8(0x142)](),_0xc7a7c7['connection'][_0x574cf8(0x1a8)](),((async()=>{!_0x5e7bdc&&_0x55e773['length']>0x0&&await _0x1a3c4e(_0x55e773,async _0xecd6ad=>{const _0x14af45=a127_0x3b0e,_0x40aadd=await _0xc7a7c7[_0x14af45(0x13a)][_0x14af45(0x17b)](_0x20d449,_0xecd6ad['id']);_0x23f19e[_0x14af45(0x137)](_0xecd6ad['id'],_0x40aadd);});})())]),{emailToId:_0x5b44a6,idToEmail:_0xec9dd1}=_0x19781a,_0x5d6258=buildConnectionMaps(_0x3218ad);return{'rootFolderId':_0x165afb,'folderPathToId':_0x3e268d,'folderIdToPath':_0x3f8204,'segmentNameToId':_0x55d84e,'activationsBySegmentId':_0x23f19e,'emailToIdMap':_0x5b44a6,'idToEmailMap':_0xec9dd1,'connectionNameToIdMap':_0x5d6258[_0x574cf8(0x1a6)],'connectionIdToNameMap':_0x5d6258[_0x574cf8(0x113)],'connectionNameToTypeMap':_0x5d6258[_0x574cf8(0x10b)]};}export function createPushYamlContextForBundle(_0x379621,_0x5f2b4b,_0x855118,_0x5a860d,_0x1390ea,_0x1fc3e0,_0x516df0,_0x22488c){const {existingLocalSegmentNames:_0x1b5646,localExpandedRuleToNames:_0x24bf0c}=_0x5a860d,_0x301c45=new Set(),_0x2290aa=new Map(),_0x535ca0=new Map(),_0x4fb6f6=new Map(),_0x40a5d9=createJumpTargetCache(),_0x37dab1=new Map(),_0x58b63c=new Map(),_0x48271b=new Set();let _0x282551;const _0x983c08=_0x4b5ee8=>{const _0x273d96={'resolveSegment':async _0x160d0f=>{const _0xeb3341=a127_0x3b0e,_0x21942d=_0x4fb6f6[_0xeb3341(0x11b)](_0x160d0f);if(_0x21942d!==undefined)return{'name':_0x21942d,'isJourneyLocal':!![]};try{const _0x3c7dae=await fetchSegment(_0x379621,_0x5f2b4b,_0x160d0f,_0x855118);if(!_0x3c7dae)throw new Error(_0xeb3341(0x1e6));const _0x3c03b6=generateJourneyLocalName(_0x3c7dae['name']),_0x30312b=_0x3c7dae[_0xeb3341(0x15f)]===SEGMENT_KIND_JOURNEY&&_0x3c03b6!==undefined;let _0x14691f=_0x3c7dae[_0xeb3341(0x1ef)],_0x38ceb2;if(_0x30312b&&_0x3c7dae['rule']){const _0x40b1dc=apiRuleToYaml(_0x3c7dae[_0xeb3341(0x177)]);_0x58b63c[_0xeb3341(0x137)](_0x160d0f,_0x40b1dc);const _0x2a1fb5=async _0x27b0af=>{const _0x1d7e28=_0xeb3341,_0x155961=collectSegmentRefsFromRule(_0x27b0af);for(const _0x46a708 of _0x155961){if(!_0x58b63c[_0x1d7e28(0x17d)](_0x46a708))try{const _0x34f70b=await fetchSegment(_0x379621,_0x5f2b4b,_0x46a708,_0x855118);if(_0x34f70b?.[_0x1d7e28(0x177)]){const _0x195634=apiRuleToYaml(_0x34f70b[_0x1d7e28(0x177)]);_0x58b63c['set'](_0x46a708,_0x195634),await _0x2a1fb5(_0x195634);}}catch(_0x390bff){logger[_0x1d7e28(0x193)](_0x1d7e28(0x1c6)+_0x46a708+':\x20'+_0x390bff);}}};await _0x2a1fb5(_0x40b1dc);const _0x2efdb8=serializeExpandedRule(_0x40b1dc,_0x58b63c),_0x5ebe03=_0x24bf0c[_0xeb3341(0x11b)](_0x2efdb8);if(_0x5ebe03&&_0x5ebe03[_0xeb3341(0x105)]>0x0){const _0x2cabcc=_0x2290aa[_0xeb3341(0x11b)](_0x2efdb8)||0x0,_0x1cb0e7=_0x5ebe03[_0x2cabcc]||_0x5ebe03[_0x5ebe03[_0xeb3341(0x105)]-0x1];_0x2290aa['set'](_0x2efdb8,_0x2cabcc+0x1),_0x14691f=_0x1cb0e7,_0x301c45['add'](_0x14691f),_0x4fb6f6['set'](_0x160d0f,_0x14691f);const _0x22db63=await resolveRuleSegmentRefs(_0x40b1dc,async _0x59f351=>{const _0x53ac67=_0xeb3341,_0x17c58c=_0x4fb6f6[_0x53ac67(0x11b)](_0x59f351);if(_0x17c58c)return _0x17c58c;const _0x1813e5=await _0x282551[_0x53ac67(0x169)](_0x59f351);return _0x1813e5[_0x53ac67(0x1ef)];});_0x38ceb2={'description':_0x3c7dae[_0xeb3341(0x123)],'rule':_0x22db63};}else{const _0xab273a=_0x37dab1[_0xeb3341(0x11b)](_0x2efdb8);if(_0xab273a)_0x14691f=_0xab273a,_0x4fb6f6[_0xeb3341(0x137)](_0x160d0f,_0x14691f);else{if(_0x3c03b6){let _0x4a9c1f=_0x3c03b6,_0x12d3db=0x2;while(_0x301c45[_0xeb3341(0x17d)](_0x4a9c1f)||_0x1b5646[_0xeb3341(0x17d)](_0x4a9c1f)){_0x4a9c1f=_0x3c03b6+'_'+_0x12d3db,_0x12d3db++;}_0x301c45[_0xeb3341(0x13f)](_0x4a9c1f),_0x14691f=_0x4a9c1f;}_0x4fb6f6['set'](_0x160d0f,_0x14691f),_0x37dab1['set'](_0x2efdb8,_0x14691f);const _0x142306=await resolveRuleSegmentRefs(_0x40b1dc,async _0x3a6fda=>{const _0x3be241=_0xeb3341,_0x20a1ac=_0x4fb6f6[_0x3be241(0x11b)](_0x3a6fda);if(_0x20a1ac)return _0x20a1ac;const _0x21b1d7=await _0x282551[_0x3be241(0x169)](_0x3a6fda);return _0x21b1d7[_0x3be241(0x1ef)];});_0x38ceb2={'description':_0x3c7dae[_0xeb3341(0x123)],'rule':_0x142306};}}}return{'name':_0x14691f,'isJourneyLocal':_0x30312b,'definition':_0x38ceb2};}catch(_0x3e4793){return logger[_0xeb3341(0x193)](_0xeb3341(0x183)+_0x160d0f+':\x20'+_0x3e4793),{'name':_0x160d0f,'isJourneyLocal':![]};}},'resolveActivation':async _0x404a19=>{const _0x3c038b=a127_0x3b0e,_0x206947=_0x535ca0[_0x3c038b(0x11b)](_0x404a19);if(_0x206947!==undefined)return{'name':_0x206947,'isJourneyLocal':!![]};try{let _0x5875d6=_0x516df0?.[_0x3c038b(0x11b)](_0x404a19);!_0x5875d6&&(_0x5875d6=await _0x379621[_0x3c038b(0x1ad)]['getActivation'](_0x4b5ee8,_0x404a19));const _0x355172=_0x5875d6[_0x3c038b(0x1c7)][_0x3c038b(0x13b)][_0x3c038b(0x1ef)]||_0x404a19,_0xff6e8d=sanitizeYamlKey(_0x355172)||_0x3c038b(0x180)+_0x404a19,_0x43e703=_0xff6e8d;_0x535ca0[_0x3c038b(0x137)](_0x404a19,_0x43e703);const _0x46289f=journeyActivationStepToYaml(_0x5875d6,_0x1390ea,_0x1fc3e0);return{'name':_0x43e703,'isJourneyLocal':!![],'definition':_0x46289f};}catch(_0x364c26){return logger[_0x3c038b(0x193)](_0x3c038b(0x182)+_0x404a19+':\x20'+_0x364c26),{'name':_0x404a19,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x509e71,_0x33e1ff)=>resolveJumpTarget(_0x509e71,_0x33e1ff,_0x40a5d9,async _0x27c97b=>{const _0x2f846b=a127_0x3b0e,_0x87ee6f=_0x22488c?.['get'](_0x27c97b);if(_0x87ee6f)return _0x87ee6f;return _0x379621[_0x2f846b(0x1ad)]['getJourney'](_0x27c97b);})};return _0x282551=_0x273d96,_0x273d96;},_0x4aac6f=async _0x103342=>{const _0x160d09=a127_0x3b0e,{collectSegmentIdsFromJourneyApi:_0xb2bf26}=await import(_0x160d09(0x143)),{batchAsync:_0xb5fa87}=await import(_0x160d09(0x195)),_0x11d463=new Set();for(const _0x24b878 of _0x103342){let _0x259ef5=_0x22488c?.[_0x160d09(0x11b)](_0x24b878);!_0x259ef5&&(_0x259ef5=await _0x379621['journey'][_0x160d09(0x1e2)](_0x24b878));const _0x27b45e=_0xb2bf26(_0x259ef5);for(const _0xc64099 of _0x27b45e){_0x11d463[_0x160d09(0x13f)](_0xc64099);}}let _0x5dd568=Array[_0x160d09(0x1df)](_0x11d463);while(_0x5dd568[_0x160d09(0x105)]>0x0){const _0x4fa3c7=_0x5dd568['filter'](_0x36bc96=>!_0x48271b[_0x160d09(0x17d)](_0x36bc96));if(_0x4fa3c7[_0x160d09(0x105)]===0x0)break;const _0x233d8f=await _0xb5fa87(_0x4fa3c7,async _0x10192c=>{_0x48271b['add'](_0x10192c);const _0x587a30=await fetchSegment(_0x379621,_0x5f2b4b,_0x10192c,_0x855118);if(!_0x587a30)return null;return{'segmentId':_0x10192c,'segment':_0x587a30};},0xa),_0x56ff3c=new Set();for(const _0x1f86cf of _0x233d8f){if(!_0x1f86cf?.[_0x160d09(0x13a)]?.['rule'])continue;const _0x34fed1=apiRuleToYaml(_0x1f86cf[_0x160d09(0x13a)][_0x160d09(0x177)]);_0x58b63c['set'](_0x1f86cf[_0x160d09(0x1be)],_0x34fed1);const _0x2f8e60=collectSegmentRefsFromRule(_0x34fed1);for(const _0x19447e of _0x2f8e60){!_0x48271b['has'](_0x19447e)&&_0x56ff3c['add'](_0x19447e);}}_0x5dd568=Array[_0x160d09(0x1df)](_0x56ff3c);}};return{'createYamlContext':_0x983c08,'prefetchJourneySegments':_0x4aac6f};}export async function executePushSegments(_0x4aff8c,_0xcfd4fb,_0x283393,_0x55f204,_0x1fe4ae){const _0x7630ab=a127_0x6d6e99,{segmentDefToCreateRequest:_0x35b874,segmentDefToUpdateRequest:_0x50521a}=await import(_0x7630ab(0x103)),_0x53ea13=_0x283393[_0x7630ab(0x1e3)],_0x4abdd2=0x5,_0x4085ea=async _0x442cc3=>{const _0x3e4095=_0x7630ab,_0x542a27=_0x442cc3[_0x3e4095(0x1ac)]?_0x53ea13['get'](_0x442cc3[_0x3e4095(0x1ac)]):undefined;let _0x8ead2e;const _0x550769={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x442cc3[_0x3e4095(0x1c1)]){_0x1fe4ae[_0x3e4095(0x189)]?.({'type':'segment_creating','name':_0x442cc3[_0x3e4095(0x1d0)]['name']});const _0x578781=_0x35b874(_0x442cc3['yamlConfig'],_0x542a27),_0x53e930=await _0x1fe4ae[_0x3e4095(0x178)](_0x3e4095(0x125)+_0x442cc3[_0x3e4095(0x1d0)][_0x3e4095(0x1ef)]+_0x3e4095(0x1ab),()=>_0x4aff8c[_0x3e4095(0x13a)][_0x3e4095(0x166)](_0x55f204[_0x3e4095(0x1f9)],_0x578781));_0x8ead2e=_0x53e930['data']['id'],_0x550769['createdSegmentId']={'name':_0x442cc3[_0x3e4095(0x1d0)][_0x3e4095(0x1ef)],'id':_0x8ead2e},_0x1fe4ae[_0x3e4095(0x189)]?.({'type':_0x3e4095(0x167),'name':_0x442cc3[_0x3e4095(0x1d0)][_0x3e4095(0x1ef)],'segmentId':_0x8ead2e}),_0x1fe4ae['logSuccess']?.(_0x3e4095(0x1cd)+_0x442cc3['yamlConfig']['name']+'\x27'),_0x550769[_0x3e4095(0x199)]=0x1;}else{if(_0x442cc3[_0x3e4095(0x1ca)]){_0x1fe4ae[_0x3e4095(0x189)]?.({'type':_0x3e4095(0x165),'name':_0x442cc3[_0x3e4095(0x1d0)][_0x3e4095(0x1ef)]});const _0x59a6c2=_0x50521a(_0x442cc3[_0x3e4095(0x1d0)]);_0x542a27!==_0x442cc3['existingSegment']?.[_0x3e4095(0x1bc)]&&(_0x59a6c2[_0x3e4095(0x1bc)]=_0x542a27?parseInt(_0x542a27,0xa):undefined),await _0x1fe4ae[_0x3e4095(0x178)](_0x3e4095(0x14f)+_0x442cc3[_0x3e4095(0x1d0)][_0x3e4095(0x1ef)]+_0x3e4095(0x1ab),()=>_0x4aff8c[_0x3e4095(0x13a)][_0x3e4095(0x12a)](_0x55f204[_0x3e4095(0x1f9)],_0x442cc3[_0x3e4095(0x1ff)]['id'],_0x59a6c2)),_0x8ead2e=_0x442cc3[_0x3e4095(0x1ff)]['id'],_0x1fe4ae[_0x3e4095(0x189)]?.({'type':'segment_updated','name':_0x442cc3['yamlConfig'][_0x3e4095(0x1ef)]}),_0x1fe4ae[_0x3e4095(0x200)]?.('Updated\x20segment\x20\x27'+_0x442cc3[_0x3e4095(0x1d0)][_0x3e4095(0x1ef)]+'\x27'),_0x550769['updated']=0x1;}else _0x8ead2e=_0x442cc3[_0x3e4095(0x1ff)]['id'];}}catch(_0x592432){const _0x5bc36a=isHttp400Error(_0x592432),_0x1e7f2a=_0x5bc36a?ErrorCode['SEGMENT_SYNTAX_ERROR']:ErrorCode['SEGMENT_UPDATE_ERROR'],_0x5353b4=getErrorMessage(_0x592432);throw new SDKError(_0x1e7f2a,_0x3e4095(0x101)+(_0x442cc3[_0x3e4095(0x1c1)]?'create':_0x3e4095(0x141))+_0x3e4095(0x1c0)+_0x442cc3['absolutePath']+_0x3e4095(0x1fe)+_0x5353b4,_0x592432);}try{const _0x31d502=await syncActivationsForSegment(_0x4aff8c,_0x55f204[_0x3e4095(0x1f9)],_0x8ead2e,_0x442cc3[_0x3e4095(0x1d0)]['name'],_0x442cc3['activationActions'],_0x1fe4ae,_0x442cc3[_0x3e4095(0x1db)]);_0x550769[_0x3e4095(0x186)]=_0x31d502;}catch(_0x2275b3){if(_0x2275b3 instanceof SDKError)throw _0x2275b3;throw new SDKError(ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x3e4095(0x1e8)+_0x442cc3[_0x3e4095(0x1d0)][_0x3e4095(0x1ef)]+'\x27\x20from\x20file:\x20'+_0x442cc3[_0x3e4095(0x1db)]+'\x0a\x20\x20'+getErrorMessage(_0x2275b3),_0x2275b3);}return _0x550769;},_0x51fdf4=await batchAsync(_0xcfd4fb,_0x4085ea,_0x4abdd2),_0x224be5={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x4c5b12 of _0x51fdf4){_0x224be5[_0x7630ab(0x199)]+=_0x4c5b12['created'],_0x224be5[_0x7630ab(0xfc)]+=_0x4c5b12[_0x7630ab(0xfc)],_0x4c5b12[_0x7630ab(0x16c)]&&_0x224be5['createdSegmentIds'][_0x7630ab(0x137)](_0x4c5b12['createdSegmentId']['name'],_0x4c5b12[_0x7630ab(0x16c)]['id']),_0x224be5[_0x7630ab(0x186)][_0x7630ab(0x199)]+=_0x4c5b12[_0x7630ab(0x186)][_0x7630ab(0x199)],_0x224be5[_0x7630ab(0x186)][_0x7630ab(0xfc)]+=_0x4c5b12[_0x7630ab(0x186)][_0x7630ab(0xfc)],_0x224be5['activations'][_0x7630ab(0x18d)]+=_0x4c5b12['activations'][_0x7630ab(0x18d)];}return _0x224be5;}async function syncActivationsForSegment(_0x14244c,_0x599c69,_0x59668c,_0x5b04e3,_0x174fe7,_0x5be1a4,_0x4cf5b0){const _0x2005e1=a127_0x6d6e99,_0x1548b1={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x103246 of _0x174fe7){try{if(_0x103246[_0x2005e1(0x1f6)]===_0x2005e1(0x1ea)&&_0x103246[_0x2005e1(0x14e)])_0x5be1a4[_0x2005e1(0x189)]?.({'type':_0x2005e1(0x188),'segmentName':_0x5b04e3,'activationName':_0x103246['name']}),await _0x5be1a4[_0x2005e1(0x178)](_0x2005e1(0x202)+_0x103246['name']+'\x27...',()=>_0x14244c['segment'][_0x2005e1(0x146)](_0x599c69,_0x59668c,_0x103246[_0x2005e1(0x14e)])),_0x5be1a4['onProgress']?.({'type':_0x2005e1(0x1d8),'segmentName':_0x5b04e3,'activationName':_0x103246[_0x2005e1(0x1ef)]}),_0x5be1a4['logSuccess']?.(_0x2005e1(0x173)+_0x103246[_0x2005e1(0x1ef)]+'\x27'),_0x1548b1['created']++;else{if(_0x103246['type']==='update'&&_0x103246[_0x2005e1(0x14e)]&&_0x103246[_0x2005e1(0x10c)])_0x5be1a4[_0x2005e1(0x189)]?.({'type':_0x2005e1(0x17c),'segmentName':_0x5b04e3,'activationName':_0x103246['name']}),await _0x5be1a4[_0x2005e1(0x178)](_0x2005e1(0x135)+_0x103246[_0x2005e1(0x1ef)]+_0x2005e1(0x1ab),()=>_0x14244c[_0x2005e1(0x13a)][_0x2005e1(0x1b4)](_0x599c69,_0x59668c,_0x103246[_0x2005e1(0x10c)]['id'],_0x103246[_0x2005e1(0x14e)])),_0x5be1a4['onProgress']?.({'type':_0x2005e1(0x19c),'segmentName':_0x5b04e3,'activationName':_0x103246[_0x2005e1(0x1ef)]}),_0x5be1a4[_0x2005e1(0x200)]?.('Updated\x20activation\x20\x27'+_0x103246[_0x2005e1(0x1ef)]+'\x27'),_0x1548b1['updated']++;else _0x103246[_0x2005e1(0x1f6)]===_0x2005e1(0x168)&&_0x103246['existingActivation']&&(_0x5be1a4[_0x2005e1(0x189)]?.({'type':_0x2005e1(0x1c5),'segmentName':_0x5b04e3,'activationName':_0x103246[_0x2005e1(0x1ef)]}),await _0x5be1a4[_0x2005e1(0x178)](_0x2005e1(0x1d7)+_0x103246[_0x2005e1(0x1ef)]+'\x27...',()=>_0x14244c[_0x2005e1(0x13a)][_0x2005e1(0x1ae)](_0x599c69,_0x59668c,_0x103246[_0x2005e1(0x10c)]['id'])),_0x5be1a4[_0x2005e1(0x189)]?.({'type':_0x2005e1(0x1a4),'segmentName':_0x5b04e3,'activationName':_0x103246[_0x2005e1(0x1ef)]}),_0x5be1a4[_0x2005e1(0x1e4)]?.(_0x2005e1(0x16d)+_0x103246[_0x2005e1(0x1ef)]+'\x27'),_0x1548b1['deleted']++);}}catch(_0x5e8cad){const _0x8f1cc=isHttp400Error(_0x5e8cad),_0x235f39=_0x8f1cc?ErrorCode[_0x2005e1(0x12c)]:ErrorCode[_0x2005e1(0x14a)],_0x1ecaea=getErrorMessage(_0x5e8cad);throw new SDKError(_0x235f39,_0x2005e1(0x101)+_0x103246[_0x2005e1(0x1f6)]+_0x2005e1(0x196)+_0x103246[_0x2005e1(0x1ef)]+_0x2005e1(0x1de)+_0x4cf5b0+_0x2005e1(0x1fe)+_0x1ecaea,_0x5e8cad);}}return _0x1548b1;}export async function executePushFolders(_0x12c521,_0x4907de,_0x2d0dda,_0x5ce38c,_0x41e592){const _0x1e9ab2=a127_0x6d6e99,_0x1374ba=new Map(_0x2d0dda),_0x4a07c0=sortFoldersByDepth(_0x4907de);for(const _0x202da1 of _0x4a07c0){const _0x27012e=_0x202da1[_0x1e9ab2(0x19a)]('/'),_0x4c364e=_0x27012e[_0x27012e[_0x1e9ab2(0x105)]-0x1],_0x445aa3=_0x27012e[_0x1e9ab2(0x108)](0x0,-0x1)[_0x1e9ab2(0x14d)]('/'),_0x393fe2=_0x1374ba['get'](_0x445aa3);_0x41e592[_0x1e9ab2(0x189)]?.({'type':_0x1e9ab2(0x1eb),'folder':_0x202da1});const _0x394fa1={'name':_0x4c364e,'parentFolderId':_0x393fe2},_0x56ccec=await _0x41e592[_0x1e9ab2(0x178)](_0x1e9ab2(0x109)+_0x202da1+_0x1e9ab2(0x1ab),()=>_0x12c521[_0x1e9ab2(0x13a)][_0x1e9ab2(0xff)](_0x5ce38c[_0x1e9ab2(0x1f9)],_0x394fa1));_0x1374ba[_0x1e9ab2(0x137)](_0x202da1,_0x56ccec['data']['id']),_0x41e592[_0x1e9ab2(0x189)]?.({'type':_0x1e9ab2(0x12d),'folder':_0x202da1,'folderId':_0x56ccec[_0x1e9ab2(0x1bd)]['id']}),_0x41e592[_0x1e9ab2(0x147)]?.(_0x1e9ab2(0x203)+_0x202da1+'\x27');}return _0x1374ba;}export async function executePushSegmentDeletions(_0x553afc,_0x35db01,_0x120b73){const _0x340263=a127_0x6d6e99;if(_0x35db01[_0x340263(0x105)]===0x0)return 0x0;const {batchAsync:_0xac9fdc}=await import(_0x340263(0x195)),_0x16ee0e=0x5,_0x2a6063=await _0xac9fdc(_0x35db01,async _0x4fa77b=>{const _0x435726=_0x340263;return _0x120b73[_0x435726(0x189)]?.({'type':_0x435726(0x205),'name':_0x4fa77b[_0x435726(0x1ef)]}),await _0x553afc['segment'][_0x435726(0x17e)](_0x4fa77b['id']),_0x120b73[_0x435726(0x189)]?.({'type':_0x435726(0x1fd),'name':_0x4fa77b[_0x435726(0x1ef)]}),_0x120b73['logDeleted']?.(_0x435726(0x1b2)+_0x4fa77b['name']+'\x27'),0x1;},_0x16ee0e);return _0x2a6063[_0x340263(0x1b7)]((_0x1243d6,_0xf4bfde)=>_0x1243d6+_0xf4bfde,0x0);}export async function executePushJourneys(_0xd2bb5a,_0x56c1b2,_0x448289,_0x253c6b,_0x214925){const _0x2e3fe5=a127_0x6d6e99,{journeyDefToRequest:_0x2491c5}=await import('./journey-yaml.js'),{activationDefToCreateRequest:_0x3fd931,yamlRuleToApi:_0x1f89a4,validateSegmentRule:_0x502cda}=await import(_0x2e3fe5(0x103)),_0x579821={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0xd81112=new Map(_0x448289[_0x2e3fe5(0x1b8)]),_0x386e50=0x5;for(let _0x55a762=0x0;_0x55a762<_0x56c1b2['length'];_0x55a762+=_0x386e50){const _0x3ff206=_0x56c1b2[_0x2e3fe5(0x108)](_0x55a762,_0x55a762+_0x386e50),_0x385954=await Promise[_0x2e3fe5(0x12f)](_0x3ff206[_0x2e3fe5(0x1b3)](async _0x5220b7=>{const _0x4bb475=_0x2e3fe5;if(!_0x5220b7[_0x4bb475(0x1c1)]&&!_0x5220b7[_0x4bb475(0x1ca)])return{'action':'unchanged','name':_0x5220b7[_0x4bb475(0x1d0)][_0x4bb475(0x1ef)],'journeyId':_0x5220b7[_0x4bb475(0x100)]?.['id']};const _0x3aa3fb=_0x5220b7[_0x4bb475(0x1ac)]?_0x448289[_0x4bb475(0x1e3)]['get'](_0x5220b7['folderPath']):undefined;_0x214925['onProgress']?.({'type':_0x5220b7[_0x4bb475(0x1c1)]?_0x4bb475(0x14c):_0x4bb475(0x204),'name':_0x5220b7['yamlConfig'][_0x4bb475(0x1ef)]});try{const _0x532948=await executeSingleJourneyPush(_0xd2bb5a,_0x5220b7,{..._0x448289,'segmentNameToId':_0xd81112},{'parentId':_0x253c6b[_0x4bb475(0x1f9)],'rootFolderId':_0x253c6b[_0x4bb475(0x131)],'folderId':_0x3aa3fb,'verbose':_0x253c6b['verbose']},_0x214925,{'journeyDefToRequest':_0x2491c5,'activationDefToCreateRequest':_0x3fd931,'yamlRuleToApi':_0x1f89a4,'validateSegmentRule':_0x502cda});for(const [_0xe43c00,_0x437a74]of _0x532948[_0x4bb475(0x122)]){_0xd81112[_0x4bb475(0x137)](_0xe43c00,_0x437a74),_0x579821['embeddedSegmentNameToId'][_0x4bb475(0x137)](_0xe43c00,_0x437a74);}if(_0x532948['action']===_0x4bb475(0x199))_0x214925[_0x4bb475(0x189)]?.({'type':_0x4bb475(0x198),'name':_0x5220b7[_0x4bb475(0x1d0)][_0x4bb475(0x1ef)],'journeyId':_0x532948[_0x4bb475(0x1fb)]}),_0x214925['logSuccess']?.(_0x4bb475(0x1a7)+_0x5220b7[_0x4bb475(0x1d0)][_0x4bb475(0x1ef)]+'\x27'),_0x579821[_0x4bb475(0x199)]++;else _0x532948['action']===_0x4bb475(0xfc)&&(_0x214925[_0x4bb475(0x189)]?.({'type':'journey_updated','name':_0x5220b7['yamlConfig']['name']}),_0x214925[_0x4bb475(0x200)]?.(_0x4bb475(0x1f4)+_0x5220b7[_0x4bb475(0x1d0)][_0x4bb475(0x1ef)]+'\x27'),_0x579821[_0x4bb475(0xfc)]++);return{'action':_0x532948['action'],'name':_0x5220b7[_0x4bb475(0x1d0)][_0x4bb475(0x1ef)],'journeyId':_0x532948['journeyId']};}catch(_0x27d95b){const _0xf7f3e9=isHttp400Error(_0x27d95b),_0xd9d369=_0xf7f3e9?ErrorCode[_0x4bb475(0x19b)]:ErrorCode['JOURNEY_UPDATE_ERROR'],_0x51ec4c=getErrorMessage(_0x27d95b);throw new SDKError(_0xd9d369,'Failed\x20to\x20'+(_0x5220b7[_0x4bb475(0x1c1)]?_0x4bb475(0x1ea):_0x4bb475(0x141))+_0x4bb475(0x1e1)+_0x5220b7[_0x4bb475(0x1db)]+'\x0a\x20\x20'+_0x51ec4c,_0x27d95b);}}));_0x579821[_0x2e3fe5(0x191)][_0x2e3fe5(0x162)](..._0x385954);}return _0x579821;}async function matchExistingJourneySegments(_0x259bff,_0x5258e0,_0x279b43,_0x187223,_0x1be933){const _0x182c2f=a127_0x6d6e99;if(!_0x5258e0[_0x182c2f(0x100)]||!_0x5258e0[_0x182c2f(0x1d0)][_0x182c2f(0x1c3)])return;const _0x1d5aa1=new Map(),_0x49eb6a=new Set();for(const _0x306ff9 of Object[_0x182c2f(0x16f)](_0x5258e0[_0x182c2f(0x1d0)][_0x182c2f(0x1c3)])){const _0x17ae24=generateDeterministicJourneySegmentName(_0x5258e0[_0x182c2f(0x1d0)]['name'],_0x306ff9);_0x1d5aa1[_0x182c2f(0x137)](_0x17ae24,_0x306ff9),_0x49eb6a[_0x182c2f(0x13f)](_0x306ff9);}const _0x460e1e=[],_0x371b6f=collectSegmentIdsFromJourneyApi(_0x5258e0[_0x182c2f(0x100)]);for(const _0x5deee2 of _0x371b6f){const _0x45bd11=await fetchSegment(_0x259bff,_0x279b43,_0x5deee2,_0x187223);if(!_0x45bd11?.[_0x182c2f(0x1ef)])continue;const _0x225707=_0x1d5aa1[_0x182c2f(0x11b)](_0x45bd11['name']);_0x225707?(_0x1be933[_0x182c2f(0x137)](_0x225707,_0x5deee2),_0x49eb6a['delete'](_0x225707)):_0x460e1e[_0x182c2f(0x162)]({'id':_0x5deee2,'seg':_0x45bd11});}if(_0x49eb6a[_0x182c2f(0x136)]>0x0&&_0x460e1e[_0x182c2f(0x105)]>0x0){const {localExpandedRuleToNames:_0x1db765}=buildLocalExpandedRuleMappings(_0x5258e0[_0x182c2f(0x1d0)]),_0x470d86=new Map();for(const {id:_0xa62ed9,seg:_0x2eb9dd}of _0x460e1e){if(_0x2eb9dd[_0x182c2f(0x177)]){const _0x1ada6b=apiRuleToYaml(_0x2eb9dd['rule']);_0x470d86['set'](_0xa62ed9,_0x1ada6b);}}for(const {id:_0x25ffbc,seg:_0x24a0ab}of _0x460e1e){if(!_0x24a0ab['rule'])continue;const _0x589c6f=_0x470d86[_0x182c2f(0x11b)](_0x25ffbc);if(!_0x589c6f)continue;const _0x5b7ed7=serializeExpandedRule(_0x589c6f,_0x470d86),_0xca552f=_0x1db765['get'](_0x5b7ed7);if(_0xca552f){const _0x3a1da7=_0xca552f[_0x182c2f(0x121)](_0x167881=>_0x49eb6a[_0x182c2f(0x17d)](_0x167881));_0x3a1da7&&(_0x1be933[_0x182c2f(0x137)](_0x3a1da7,_0x25ffbc),_0x49eb6a[_0x182c2f(0x168)](_0x3a1da7),logger['debug'](_0x182c2f(0x1ba)+_0x24a0ab['name']+_0x182c2f(0x130)+_0x3a1da7+_0x182c2f(0x187)));}}}}async function executeSingleJourneyPush(_0x3beeaa,_0x1743f7,_0x5ea95e,_0x1d0148,_0x1a9882,_0x4525d4){const _0x470ae4=a127_0x6d6e99,{journeyDefToRequest:_0x252b75,activationDefToCreateRequest:_0x2ec132,yamlRuleToApi:_0x3323f7,validateSegmentRule:_0x120e0a}=_0x4525d4,_0x5b70c1=new Map(),_0xa1083=new Map();recoverSegmentIdsFromPushRecovery(_0x1743f7,_0x5b70c1,_0x5ea95e['segmentNameToId']);const _0x1f953b=new Map(),_0x45466d=new Map(),_0x1fd167=new Map();let _0x2fcc9b;const _0x3979eb=async()=>{const _0x442c25=a127_0x3b0e;if(_0x2fcc9b)return;_0x2fcc9b=new Map();if(!_0x1743f7[_0x442c25(0x100)])return;const _0x595c6d=await _0x3beeaa['journey'][_0x442c25(0x17b)](_0x1743f7[_0x442c25(0x100)]['id']);for(const _0x43cb68 of _0x595c6d){const _0x15ac5f=journeyActivationStepToYaml(_0x43cb68,_0x5ea95e[_0x442c25(0x160)],_0x5ea95e[_0x442c25(0x163)]),_0x266924=activationSignature(_0x15ac5f);!_0x2fcc9b[_0x442c25(0x17d)](_0x266924)&&_0x2fcc9b[_0x442c25(0x137)](_0x266924,_0x43cb68['id']),_0x15ac5f[_0x442c25(0x1ef)]&&_0xa1083[_0x442c25(0x137)](_0x15ac5f[_0x442c25(0x1ef)],_0x43cb68['id']);}};await matchExistingJourneySegments(_0x3beeaa,_0x1743f7,_0x1d0148[_0x470ae4(0x1f9)],_0x5ea95e['existingSegments'],_0x5ea95e[_0x470ae4(0x1b8)]);const _0x3597bb={'resolveSegmentId':async _0x45c58c=>{const _0x3a81b4=_0x470ae4,_0x3d8067=_0x5ea95e[_0x3a81b4(0x1b8)][_0x3a81b4(0x11b)](_0x45c58c);if(!_0x3d8067)throw new SDKError(ErrorCode[_0x3a81b4(0x1bb)],_0x3a81b4(0x190)+_0x45c58c+_0x3a81b4(0x1d3)+_0x1743f7[_0x3a81b4(0x1d0)][_0x3a81b4(0x1ef)]+')');return _0x3d8067;},'resolveEmbeddedSegmentId':async(_0x3a3e0f,_0x40a068)=>{const _0x1634f9=_0x470ae4,_0xe23ff1=_0x5ea95e['segmentNameToId'][_0x1634f9(0x11b)](_0x3a3e0f);if(_0xe23ff1)return _0xe23ff1;const _0x2a45db=_0x5ea95e[_0x1634f9(0x157)][_0x1634f9(0x121)](_0x59e34d=>_0x59e34d['name']===_0x3a3e0f);if(_0x2a45db)return _0x5ea95e[_0x1634f9(0x1b8)][_0x1634f9(0x137)](_0x3a3e0f,_0x2a45db['id']),_0x2a45db['id'];if(_0x1743f7['isNew']){const {stageName:_0x45ddd8,criteriaName:_0x387c92}=findSegmentCriteriaLocation(_0x1743f7[_0x1634f9(0x1d0)],_0x3a3e0f);return _0x120e0a(_0x3a3e0f,_0x40a068[_0x1634f9(0x177)]),_0x45466d[_0x1634f9(0x137)](_0x3a3e0f,{'definition':_0x40a068,'stageName':_0x45ddd8,'criteriaName':_0x387c92}),createPendingSegmentId(_0x3a3e0f);}const _0x195775=_0x1743f7[_0x1634f9(0x100)]?.['id'];if(!_0x195775)throw new SDKError(ErrorCode[_0x1634f9(0x115)],_0x1634f9(0x10a));const _0x384deb=_0x1f953b['get'](_0x3a3e0f);if(_0x384deb)return _0x384deb;const _0x1f7d0f=((async()=>{const _0x397352=_0x1634f9;_0x120e0a(_0x3a3e0f,_0x40a068[_0x397352(0x177)]);const _0x6410a1=generateDeterministicJourneySegmentName(_0x1743f7[_0x397352(0x1d0)][_0x397352(0x1ef)],_0x3a3e0f),_0x599321=_0x5ea95e[_0x397352(0x157)][_0x397352(0x121)](_0x5e2e6f=>_0x5e2e6f[_0x397352(0x1ef)]===_0x6410a1),_0xd5c2df=createSegmentIdResolver(_0x5ea95e[_0x397352(0x1b8)],_0x3a3e0f),_0x51e056=await resolveRuleSegmentIds(_0x40a068['rule'],_0xd5c2df);let _0x59cffb;return _0x599321?(await _0x3beeaa[_0x397352(0x13a)][_0x397352(0x12a)](_0x1d0148[_0x397352(0x1f9)],_0x599321['id'],{'description':_0x40a068[_0x397352(0x123)]||_0x397352(0x154)+_0x3a3e0f,'rule':_0x3323f7(_0x51e056,!![]),'countPopulation':!![]}),_0x59cffb=_0x599321['id'],saveSegmentToPushRecovery(_0x1743f7[_0x397352(0x1db)],_0x1743f7[_0x397352(0x1d0)][_0x397352(0x1ef)],_0x3a3e0f,{'segmentId':_0x59cffb,'uniqueServerName':_0x6410a1,'createdAt':new Date()[_0x397352(0x156)]()})):_0x59cffb=await createOrRecoverEmbeddedSegment(_0x3beeaa,_0x1743f7,{'localName':_0x3a3e0f,'uniqueSegmentName':_0x6410a1,'description':_0x40a068['description']||_0x397352(0x154)+_0x3a3e0f,'journeyId':_0x195775,'resolvedRule':_0x51e056,'parentId':_0x1d0148[_0x397352(0x1f9)],'folderId':_0x1d0148[_0x397352(0x131)]||''},_0x3323f7),_0x5ea95e[_0x397352(0x1b8)]['set'](_0x3a3e0f,_0x59cffb),_0x5b70c1[_0x397352(0x137)](_0x3a3e0f,_0x59cffb),_0x59cffb;})());_0x1f953b[_0x1634f9(0x137)](_0x3a3e0f,_0x1f7d0f);try{return await _0x1f7d0f;}finally{_0x1f953b['delete'](_0x3a3e0f);}},'resolveActivationId':async _0x3b2937=>{const _0x53900a=_0x470ae4,_0x40294f=_0xa1083[_0x53900a(0x11b)](_0x3b2937);if(_0x40294f)return _0x40294f;if(_0x1743f7[_0x53900a(0x100)]){await _0x3979eb();const _0x29357f=_0xa1083[_0x53900a(0x11b)](_0x3b2937);if(_0x29357f)return _0x29357f;}throw new SDKError(ErrorCode[_0x53900a(0x192)],_0x53900a(0x129)+_0x3b2937+_0x53900a(0x1d3)+_0x1743f7[_0x53900a(0x1d0)][_0x53900a(0x1ef)]+_0x53900a(0x175)+'Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.');},'resolveEmbeddedActivationId':async(_0x3edfc8,_0x307f79)=>{const _0x16cca5=_0x470ae4,_0xc0d3dd=_0xa1083[_0x16cca5(0x11b)](_0x3edfc8);if(_0xc0d3dd)return _0xc0d3dd;if(_0x1743f7[_0x16cca5(0x1c1)])return _0x1fd167[_0x16cca5(0x137)](_0x3edfc8,_0x307f79),createPendingActivationId(_0x3edfc8);if(_0x1743f7['existingJourney']){await _0x3979eb();const _0x3c7d68=_0xa1083[_0x16cca5(0x11b)](_0x307f79[_0x16cca5(0x1ef)]);if(_0x3c7d68)return _0xa1083['set'](_0x3edfc8,_0x3c7d68),_0x3c7d68;const _0x3d0795=activationSignature(_0x307f79),_0x4dfb4f=_0x2fcc9b?.[_0x16cca5(0x11b)](_0x3d0795);if(_0x4dfb4f)return _0xa1083[_0x16cca5(0x137)](_0x3edfc8,_0x4dfb4f),_0x4dfb4f;const _0x47963e=await _0x2ec132(_0x307f79,_0x5ea95e[_0x16cca5(0x1fc)]),_0x2a7892={..._0x47963e,..._0x307f79[_0x16cca5(0x1bf)]!==undefined&&{'runAfterJourneyRefresh':_0x307f79[_0x16cca5(0x1bf)]}},_0x3b0e71=await _0x3beeaa[_0x16cca5(0x1ad)][_0x16cca5(0x146)](_0x1743f7['existingJourney']['id'],_0x2a7892);return _0xa1083[_0x16cca5(0x137)](_0x3edfc8,_0x3b0e71['id']),_0x3b0e71['id'];}throw new SDKError(ErrorCode['INTERNAL'],_0x16cca5(0x1f8));},'resolveJourneyId':async _0x1a8543=>{const _0x52a825=_0x470ae4;try{return await _0x3beeaa[_0x52a825(0x1ad)]['resolveJourneyId'](_0x1d0148[_0x52a825(0x1f9)],_0x1a8543);}catch(_0x5c3708){throw new SDKError(ErrorCode[_0x52a825(0x192)],_0x52a825(0x1ce)+_0x1a8543+_0x52a825(0x1d5)+_0x1743f7['yamlConfig'][_0x52a825(0x1ef)]+'\x27)',_0x5c3708);}},'resolveStageId':async(_0x2d3f54,_0x1dfb2f)=>{const _0x53a7e6=_0x470ae4,_0x3820a0=await _0x3beeaa[_0x53a7e6(0x1ad)][_0x53a7e6(0x1e2)](_0x2d3f54),_0x124a6e=_0x3820a0['attributes'][_0x53a7e6(0x149)][_0x53a7e6(0x121)](_0x2095d3=>_0x2095d3[_0x53a7e6(0x1ef)][_0x53a7e6(0x133)]()===_0x1dfb2f[_0x53a7e6(0x133)]());if(!_0x124a6e?.['id'])throw new SDKError(ErrorCode['NOT_FOUND'],_0x53a7e6(0x15c)+_0x1dfb2f+_0x53a7e6(0x119)+(_0x3820a0[_0x53a7e6(0x1c7)][_0x53a7e6(0x18f)]||_0x3820a0[_0x53a7e6(0x1c7)][_0x53a7e6(0x1ef)])+'\x27');return _0x124a6e['id'];}},_0x4b11c7=await _0x252b75(_0x1743f7[_0x470ae4(0x1d0)],_0x1d0148[_0x470ae4(0x1f9)],_0x3597bb),_0x54019f=_0x1d0148[_0x470ae4(0x110)]||_0x1d0148[_0x470ae4(0x131)];_0x54019f&&(_0x4b11c7[_0x470ae4(0x19d)]={'parentFolder':{'data':{'id':_0x54019f,'type':'folder'}}});if(_0x1743f7['isNew']){if(_0x45466d['size']>0x0||_0x1fd167[_0x470ae4(0x136)]>0x0)return await executeThreeStepJourneyCreate(_0x3beeaa,_0x1743f7,_0x4b11c7,{'pendingEmbeddedSegments':_0x45466d,'pendingEmbeddedActivations':_0x1fd167,'embeddedSegmentNameToId':_0x5b70c1,'journeyActivationNameToId':_0xa1083},{..._0x1d0148,'effectiveFolderId':_0x54019f},_0x5ea95e,_0x1a9882,_0x4525d4);else{ensureJourneyDefaults(_0x4b11c7[_0x470ae4(0x1c7)]);const _0x534700=await _0x3beeaa[_0x470ae4(0x1ad)][_0x470ae4(0x1ea)](_0x4b11c7);return deletePushRecovery(_0x1743f7[_0x470ae4(0x1db)]),{'action':_0x470ae4(0x199),'journeyId':_0x534700['id'],'embeddedSegmentNameToId':_0x5b70c1};}}else{if(_0x1743f7[_0x470ae4(0x1ca)]&&_0x1743f7['existingJourney']){_0x4b11c7['id']=_0x1743f7[_0x470ae4(0x100)]['id'];const _0x5687b8=_0x4b11c7[_0x470ae4(0x1c7)];_0x1743f7['existingJourney'][_0x470ae4(0x1c7)]?.[_0x470ae4(0x18f)]&&(_0x5687b8[_0x470ae4(0x18f)]=_0x1743f7[_0x470ae4(0x100)][_0x470ae4(0x1c7)][_0x470ae4(0x18f)]);const _0x757710=_0x1743f7[_0x470ae4(0x100)][_0x470ae4(0x1c7)]?.[_0x470ae4(0x149)];return _0x757710&&_0x4b11c7[_0x470ae4(0x1c7)]['journeyStages']&&injectExistingStageIds(_0x4b11c7['attributes']['journeyStages'],_0x757710),ensureJourneyDefaults(_0x5687b8),await _0x3beeaa[_0x470ae4(0x1ad)][_0x470ae4(0x141)](_0x1743f7[_0x470ae4(0x100)]['id'],_0x4b11c7),deletePushRecovery(_0x1743f7[_0x470ae4(0x1db)]),{'action':_0x470ae4(0xfc),'journeyId':_0x1743f7[_0x470ae4(0x100)]['id'],'embeddedSegmentNameToId':_0x5b70c1};}}return deletePushRecovery(_0x1743f7[_0x470ae4(0x1db)]),{'action':_0x470ae4(0x1aa),'journeyId':_0x1743f7[_0x470ae4(0x100)]?.['id'],'embeddedSegmentNameToId':_0x5b70c1};}function findSegmentCriteriaLocation(_0x15cf7c,_0x53ab68){const _0x42e9cf=a127_0x6d6e99,_0x5c6173=_0x15cf7c[_0x42e9cf(0x172)]||_0x15cf7c[_0x42e9cf(0x155)]?.[0x0]?.[_0x42e9cf(0x172)]||[];let _0x552bdd='entry',_0x5f55ee=_0x53ab68;const _0x3f32bb=_0x15cf7c['goal']||_0x15cf7c[_0x42e9cf(0x155)]?.[0x0]?.['goal'];if(_0x3f32bb?.[_0x42e9cf(0x13a)]===_0x53ab68)return{'stageName':'goal','criteriaName':_0x3f32bb['name']||_0x53ab68};_0x18c0ca:for(const _0x1312e8 of _0x5c6173){if(_0x1312e8[_0x42e9cf(0x116)]?.[_0x42e9cf(0x13a)]===_0x53ab68){_0x552bdd=_0x1312e8[_0x42e9cf(0x1ef)],_0x5f55ee=_0x1312e8[_0x42e9cf(0x116)]['name']||_0x53ab68;break;}if(_0x1312e8[_0x42e9cf(0x1f7)])for(const _0x56e6b7 of _0x1312e8[_0x42e9cf(0x1f7)]){if(_0x56e6b7[_0x42e9cf(0x1f6)]===_0x42e9cf(0x10e)&&_0x56e6b7[_0x42e9cf(0x1c2)]?.[_0x42e9cf(0x164)])for(const _0xbe5cd3 of _0x56e6b7['with'][_0x42e9cf(0x164)]){if(_0xbe5cd3[_0x42e9cf(0x13a)]===_0x53ab68){_0x552bdd=_0x1312e8[_0x42e9cf(0x1ef)],_0x5f55ee=_0xbe5cd3[_0x42e9cf(0x1ef)]||_0x53ab68;break _0x18c0ca;}}}}return{'stageName':_0x552bdd,'criteriaName':_0x5f55ee};}async function executeThreeStepJourneyCreate(_0x4d950f,_0x3c20b1,_0x5d69b1,_0x455f9a,_0x4705d2,_0x11b5a3,_0x107640,_0x257a9d){const _0x4c8caa=a127_0x6d6e99,{activationDefToCreateRequest:_0x54efc1,yamlRuleToApi:_0x48474a}=_0x257a9d,{pendingEmbeddedSegments:_0x259e78,pendingEmbeddedActivations:_0x24e003,embeddedSegmentNameToId:_0x49999b}=_0x455f9a,_0x47e89e=JSON[_0x4c8caa(0x1f1)](JSON[_0x4c8caa(0x1f2)](_0x5d69b1));ensureJourneyDefaults(_0x47e89e['attributes']),stripPendingIds(_0x47e89e);const _0x6909dc=await _0x4d950f['journey']['create'](_0x47e89e),_0x46064d=_0x6909dc['id'],_0xdf05ef=new Map();for(const _0x3af63e of _0x6909dc['attributes']['journeyStages']){_0xdf05ef[_0x4c8caa(0x137)](_0x3af63e['name'][_0x4c8caa(0x133)](),_0x3af63e['id']);}recoverSegmentIdsFromPushRecovery(_0x3c20b1,_0x49999b,_0x11b5a3[_0x4c8caa(0x1b8)]);for(const [_0x535aa9,{definition:_0x111631}]of _0x259e78){if(_0x49999b['has'](_0x535aa9)){_0x107640['onProgress']?.({'type':_0x4c8caa(0x1c4),'journeyName':_0x3c20b1[_0x4c8caa(0x1d0)][_0x4c8caa(0x1ef)],'segmentName':_0x535aa9});continue;}const _0x3baa7b=generateDeterministicJourneySegmentName(_0x3c20b1[_0x4c8caa(0x1d0)][_0x4c8caa(0x1ef)],_0x535aa9);_0x107640[_0x4c8caa(0x189)]?.({'type':_0x4c8caa(0x159),'journeyName':_0x3c20b1[_0x4c8caa(0x1d0)][_0x4c8caa(0x1ef)],'segmentName':_0x535aa9});const _0x3b1968=createSegmentIdResolver(_0x11b5a3['segmentNameToId'],_0x535aa9),_0x391c91=await resolveRuleSegmentIds(_0x111631['rule'],_0x3b1968),_0x4eef5e=await createOrRecoverEmbeddedSegment(_0x4d950f,_0x3c20b1,{'localName':_0x535aa9,'uniqueSegmentName':_0x3baa7b,'description':_0x111631[_0x4c8caa(0x123)]||_0x4c8caa(0x154)+_0x535aa9,'journeyId':_0x46064d,'resolvedRule':_0x391c91,'parentId':_0x4705d2[_0x4c8caa(0x1f9)],'folderId':_0x4705d2['effectiveFolderId']||''},_0x48474a);_0x49999b[_0x4c8caa(0x137)](_0x535aa9,_0x4eef5e),_0x11b5a3[_0x4c8caa(0x1b8)][_0x4c8caa(0x137)](_0x535aa9,_0x4eef5e),_0x107640[_0x4c8caa(0x189)]?.({'type':'embedded_segment_created','journeyName':_0x3c20b1[_0x4c8caa(0x1d0)][_0x4c8caa(0x1ef)],'segmentName':_0x535aa9});}const _0x228fa8=new Map();for(const [_0x2e3ead,_0x3d0189]of _0x24e003){_0x107640['onProgress']?.({'type':_0x4c8caa(0x14b),'journeyName':_0x3c20b1['yamlConfig'][_0x4c8caa(0x1ef)],'activationName':_0x2e3ead});const _0x4a899a=await _0x54efc1(_0x3d0189,_0x11b5a3[_0x4c8caa(0x1fc)]),_0x57ef30={..._0x4a899a,..._0x3d0189[_0x4c8caa(0x1bf)]!==undefined&&{'runAfterJourneyRefresh':_0x3d0189[_0x4c8caa(0x1bf)]}},_0x4205ef=await _0x4d950f[_0x4c8caa(0x1ad)][_0x4c8caa(0x146)](_0x46064d,_0x57ef30);_0x228fa8[_0x4c8caa(0x137)](_0x2e3ead,_0x4205ef['id']),_0x455f9a[_0x4c8caa(0x1c9)][_0x4c8caa(0x137)](_0x2e3ead,_0x4205ef['id']),_0x107640[_0x4c8caa(0x189)]?.({'type':'embedded_activation_created','journeyName':_0x3c20b1[_0x4c8caa(0x1d0)][_0x4c8caa(0x1ef)],'activationName':_0x2e3ead});}const _0x30d476=JSON['parse'](JSON[_0x4c8caa(0x1f2)](_0x5d69b1));return _0x30d476['id']=_0x46064d,ensureJourneyDefaults(_0x30d476[_0x4c8caa(0x1c7)]),resolvePendingIdsInRequest(_0x30d476,_0x5d69b1,_0xdf05ef,_0x49999b,_0x228fa8,_0x107640),await _0x4d950f['journey'][_0x4c8caa(0x141)](_0x46064d,_0x30d476),deletePushRecovery(_0x3c20b1[_0x4c8caa(0x1db)]),{'action':_0x4c8caa(0x199),'journeyId':_0x46064d,'embeddedSegmentNameToId':_0x49999b};}export function stripWaitStepPendingIds(_0x27c736){const _0xc774b6=a127_0x6d6e99,_0x3a65c4=_0x27c736[_0xc774b6(0x151)]&&isPendingSegmentId(_0x27c736[_0xc774b6(0x151)]),_0xaa8fae=_0x27c736['conditions']?.[_0xc774b6(0x1d1)](_0x1bde54=>_0x1bde54[_0xc774b6(0x1be)]&&isPendingSegmentId(_0x1bde54[_0xc774b6(0x1be)]));(_0x3a65c4||_0xaa8fae)&&(_0x27c736[_0xc774b6(0x184)]=_0xc774b6(0x1d2),_0x27c736[_0xc774b6(0x138)]=0x1,_0x27c736['waitStepUnit']='day',delete _0x27c736['conditionSegmentId'],delete _0x27c736[_0xc774b6(0x1a5)],delete _0x27c736[_0xc774b6(0x1af)],delete _0x27c736[_0xc774b6(0x11e)]);}export function resolveWaitStepPendingIds(_0x3de47f,_0x5ec7c3,_0x1758c2,_0x469617){const _0x22ffda=a127_0x6d6e99;if(_0x5ec7c3[_0x22ffda(0x151)]&&isPendingSegmentId(_0x5ec7c3['conditionSegmentId'])){const _0x2300a0=_0x1758c2(_0x5ec7c3[_0x22ffda(0x151)],_0x22ffda(0x120)+_0x469617+_0x22ffda(0x15d));_0x2300a0&&(_0x3de47f[_0x22ffda(0x184)]=_0x22ffda(0x1b9),_0x3de47f[_0x22ffda(0x151)]=_0x2300a0,delete _0x3de47f[_0x22ffda(0x138)],delete _0x3de47f[_0x22ffda(0x106)],_0x5ec7c3[_0x22ffda(0x1a5)]!==undefined&&(_0x3de47f['conditionTimeoutDuration']=_0x5ec7c3[_0x22ffda(0x1a5)]),_0x5ec7c3[_0x22ffda(0x1af)]&&(_0x3de47f[_0x22ffda(0x1af)]=_0x5ec7c3[_0x22ffda(0x1af)]));}if(_0x5ec7c3[_0x22ffda(0x11e)]){const _0x58eb04=_0x5ec7c3['conditions']['some'](_0x1ca6c1=>_0x1ca6c1[_0x22ffda(0x1be)]&&isPendingSegmentId(_0x1ca6c1[_0x22ffda(0x1be)]));if(_0x58eb04){const _0x26c99f=_0x5ec7c3[_0x22ffda(0x11e)][_0x22ffda(0x1b3)](_0x5c33f7=>{const _0x19ad51=_0x22ffda;if(_0x5c33f7[_0x19ad51(0x1be)]&&isPendingSegmentId(_0x5c33f7[_0x19ad51(0x1be)])){const _0x168d35=_0x1758c2(_0x5c33f7[_0x19ad51(0x1be)],_0x19ad51(0x120)+_0x469617+_0x19ad51(0x15d));return{..._0x5c33f7,'segmentId':_0x168d35||_0x5c33f7[_0x19ad51(0x1be)]};}return{..._0x5c33f7};});_0x3de47f['waitStepType']='Condition',_0x3de47f[_0x22ffda(0x11e)]=_0x26c99f,delete _0x3de47f['waitStep'],delete _0x3de47f[_0x22ffda(0x106)],delete _0x3de47f[_0x22ffda(0x151)],delete _0x3de47f[_0x22ffda(0x1a5)],delete _0x3de47f[_0x22ffda(0x1af)];}}}function stripPendingIds(_0x372dfd){const _0x4d6e75=a127_0x6d6e99;_0x372dfd[_0x4d6e75(0x1c7)][_0x4d6e75(0x1e5)]?.['segmentId']&&isPendingSegmentId(_0x372dfd[_0x4d6e75(0x1c7)][_0x4d6e75(0x1e5)][_0x4d6e75(0x1be)])&&delete _0x372dfd['attributes'][_0x4d6e75(0x1e5)];for(const _0x13365d of _0x372dfd['attributes'][_0x4d6e75(0x149)]||[]){_0x13365d[_0x4d6e75(0x1f5)]?.[_0x4d6e75(0x1be)]&&isPendingSegmentId(_0x13365d[_0x4d6e75(0x1f5)][_0x4d6e75(0x1be)])&&delete _0x13365d[_0x4d6e75(0x1f5)];_0x13365d[_0x4d6e75(0x1a9)]?.[_0x4d6e75(0x1be)]&&isPendingSegmentId(_0x13365d[_0x4d6e75(0x1a9)][_0x4d6e75(0x1be)])&&delete _0x13365d[_0x4d6e75(0x1a9)];_0x13365d['exitCriterias']&&(_0x13365d[_0x4d6e75(0x17a)]=_0x13365d[_0x4d6e75(0x17a)][_0x4d6e75(0x148)](_0x363ed6=>!_0x363ed6[_0x4d6e75(0x1be)]||!isPendingSegmentId(_0x363ed6['segmentId'])));if(_0x13365d[_0x4d6e75(0x1f7)])for(const _0x249279 of Object['keys'](_0x13365d[_0x4d6e75(0x1f7)])){const _0x3c235a=_0x13365d[_0x4d6e75(0x1f7)][_0x249279];_0x3c235a[_0x4d6e75(0x1f6)]===_0x4d6e75(0x1a1)&&_0x3c235a[_0x4d6e75(0x1b6)]&&isPendingActivationId(_0x3c235a[_0x4d6e75(0x1b6)])&&(_0x3c235a[_0x4d6e75(0x1b6)]='');if(_0x3c235a[_0x4d6e75(0x1f6)]===_0x4d6e75(0x13d)&&_0x3c235a[_0x4d6e75(0x164)])for(const _0x43634e of _0x3c235a[_0x4d6e75(0x164)]){_0x43634e[_0x4d6e75(0x1be)]&&isPendingSegmentId(_0x43634e[_0x4d6e75(0x1be)])&&(_0x43634e[_0x4d6e75(0x1be)]='');}_0x3c235a[_0x4d6e75(0x1f6)]===_0x4d6e75(0x111)&&stripWaitStepPendingIds(_0x3c235a);}}}function resolvePendingIdsInRequest(_0x3615bc,_0x378311,_0x469f7e,_0x434b62,_0xe37e40,_0x29bd52){const _0x4ab2fb=a127_0x6d6e99,_0x21b83c=(_0x56bb8b,_0x1831bd)=>{const _0x200ecd=a127_0x3b0e;if(!isPendingSegmentId(_0x56bb8b))return _0x56bb8b;const _0x2a76d2=extractPendingSegmentName(_0x56bb8b),_0x667469=_0x434b62[_0x200ecd(0x11b)](_0x2a76d2);return!_0x667469&&_0x29bd52[_0x200ecd(0x114)]?.(_0x200ecd(0x1d4)+_0x2a76d2+'\x27\x20for\x20'+_0x1831bd),_0x667469;};if(_0x3615bc[_0x4ab2fb(0x1c7)]['goal']?.['segmentId']&&isPendingSegmentId(_0x3615bc['attributes'][_0x4ab2fb(0x1e5)][_0x4ab2fb(0x1be)])){const _0x4d87fa=_0x21b83c(_0x3615bc[_0x4ab2fb(0x1c7)][_0x4ab2fb(0x1e5)][_0x4ab2fb(0x1be)],'goal\x20criteria');_0x4d87fa&&(_0x3615bc[_0x4ab2fb(0x1c7)][_0x4ab2fb(0x1e5)][_0x4ab2fb(0x1be)]=_0x4d87fa);}for(const _0x45deb0 of _0x3615bc[_0x4ab2fb(0x1c7)][_0x4ab2fb(0x149)]||[]){const _0x41c4c1=_0x469f7e['get'](_0x45deb0[_0x4ab2fb(0x1ef)][_0x4ab2fb(0x133)]());_0x41c4c1&&(_0x45deb0['id']=_0x41c4c1);if(_0x45deb0[_0x4ab2fb(0x1f5)]?.[_0x4ab2fb(0x1be)]&&isPendingSegmentId(_0x45deb0[_0x4ab2fb(0x1f5)]['segmentId'])){const _0x166b4a=_0x21b83c(_0x45deb0['entryCriteria'][_0x4ab2fb(0x1be)],_0x4ab2fb(0x120)+_0x45deb0[_0x4ab2fb(0x1ef)]+_0x4ab2fb(0x11d));_0x166b4a&&(_0x45deb0[_0x4ab2fb(0x1f5)][_0x4ab2fb(0x1be)]=_0x166b4a);}if(_0x45deb0[_0x4ab2fb(0x17a)])for(const _0x2b15d7 of _0x45deb0[_0x4ab2fb(0x17a)]){if(_0x2b15d7[_0x4ab2fb(0x1be)]&&isPendingSegmentId(_0x2b15d7['segmentId'])){const _0x1a4e85=_0x21b83c(_0x2b15d7[_0x4ab2fb(0x1be)],_0x4ab2fb(0x120)+_0x45deb0[_0x4ab2fb(0x1ef)]+_0x4ab2fb(0x11c));_0x1a4e85&&(_0x2b15d7[_0x4ab2fb(0x1be)]=_0x1a4e85);}}if(_0x45deb0[_0x4ab2fb(0x1a9)]?.[_0x4ab2fb(0x1be)]&&isPendingSegmentId(_0x45deb0[_0x4ab2fb(0x1a9)][_0x4ab2fb(0x1be)])){const _0x1e91b0=_0x21b83c(_0x45deb0[_0x4ab2fb(0x1a9)][_0x4ab2fb(0x1be)],_0x4ab2fb(0x120)+_0x45deb0[_0x4ab2fb(0x1ef)]+_0x4ab2fb(0x19e));_0x1e91b0&&(_0x45deb0[_0x4ab2fb(0x1a9)][_0x4ab2fb(0x1be)]=_0x1e91b0);}if(_0x45deb0[_0x4ab2fb(0x1f7)]){const _0x239ac8=_0x442319=>_0x378311[_0x4ab2fb(0x1c7)][_0x4ab2fb(0x149)]?.[_0x4ab2fb(0x121)](_0x141f0e=>_0x141f0e['name'][_0x4ab2fb(0x133)]()===_0x45deb0['name']['toLowerCase']())?.['steps']?.[_0x442319];for(const _0x5117f4 of Object[_0x4ab2fb(0x16f)](_0x45deb0[_0x4ab2fb(0x1f7)])){const _0x2d969b=_0x45deb0[_0x4ab2fb(0x1f7)][_0x5117f4],_0x17c6a9=_0x239ac8(_0x5117f4);if(_0x2d969b[_0x4ab2fb(0x1f6)]===_0x4ab2fb(0x1a1)&&_0x2d969b[_0x4ab2fb(0x1b6)]&&(isPendingActivationId(_0x2d969b[_0x4ab2fb(0x1b6)])||_0x2d969b[_0x4ab2fb(0x1b6)]==='')){if(_0x17c6a9?.[_0x4ab2fb(0x1b6)]&&isPendingActivationId(_0x17c6a9[_0x4ab2fb(0x1b6)])){const _0x99ff02=extractPendingActivationName(_0x17c6a9[_0x4ab2fb(0x1b6)]),_0xea976f=_0xe37e40['get'](_0x99ff02);_0xea976f&&(_0x2d969b[_0x4ab2fb(0x1b6)]=_0xea976f);}}if(_0x2d969b[_0x4ab2fb(0x1f6)]===_0x4ab2fb(0x13d)&&_0x2d969b[_0x4ab2fb(0x164)]&&_0x17c6a9?.['branches'])for(let _0x31b3c8=0x0;_0x31b3c8<_0x2d969b['branches'][_0x4ab2fb(0x105)];_0x31b3c8++){const _0x595135=_0x2d969b['branches'][_0x31b3c8],_0x1643c8=_0x17c6a9[_0x4ab2fb(0x164)][_0x31b3c8];if(_0x1643c8?.[_0x4ab2fb(0x1be)]&&isPendingSegmentId(_0x1643c8[_0x4ab2fb(0x1be)])){const _0x37d74f=_0x21b83c(_0x1643c8[_0x4ab2fb(0x1be)],_0x4ab2fb(0x120)+_0x45deb0[_0x4ab2fb(0x1ef)]+_0x4ab2fb(0x1cf)+(_0x595135[_0x4ab2fb(0x1ef)]||_0x31b3c8)+'\x27');_0x37d74f&&(_0x595135[_0x4ab2fb(0x1be)]=_0x37d74f);}}_0x2d969b[_0x4ab2fb(0x1f6)]===_0x4ab2fb(0x111)&&_0x17c6a9?.[_0x4ab2fb(0x1f6)]===_0x4ab2fb(0x111)&&resolveWaitStepPendingIds(_0x2d969b,_0x17c6a9,_0x21b83c,_0x45deb0[_0x4ab2fb(0x1ef)]);}}}}
1
+ const a127_0x1b45a8=a127_0x9b56;(function(_0xfef6e5,_0x5ddaf7){const _0x367d68=a127_0x9b56,_0x45a6cf=_0xfef6e5();while(!![]){try{const _0x276418=-parseInt(_0x367d68(0x2b7))/0x1+parseInt(_0x367d68(0x218))/0x2+-parseInt(_0x367d68(0x2d0))/0x3+parseInt(_0x367d68(0x2a0))/0x4+-parseInt(_0x367d68(0x1ff))/0x5*(parseInt(_0x367d68(0x287))/0x6)+parseInt(_0x367d68(0x238))/0x7+parseInt(_0x367d68(0x27e))/0x8*(parseInt(_0x367d68(0x28b))/0x9);if(_0x276418===_0x5ddaf7)break;else _0x45a6cf['push'](_0x45a6cf['shift']());}catch(_0x5e0981){_0x45a6cf['push'](_0x45a6cf['shift']());}}}(a127_0x23ef,0xe2350));import{createHash}from'crypto';function a127_0x23ef(){const _0x4ca7d8=['Updating\x20activation\x20\x27','length','buildUserMaps','Duration','920692QfvvbR','updateSegmentById','segmentNameToId','user','hasChanges','folderPathToId','journeyName','Entry\x20criteria:\x20','idToName','createActivation','steps','day','with','segments','state','\x20activation\x20\x27','get','\x27\x20for\x20','waitStep','create','journey_creating','size','journey','includes','all_columns','all','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','\x27\x20wait\x20condition','uniqueSegmentName','\x27\x20exit\x20criteria','decision_point','Matched\x20server\x20segment\x20\x27','2294292LvppAV','embedded_segment_created','\x20journey\x20from\x20file:\x20','schedule','replace','name','push','parentSegmentFolder','validatedRequest','journey_updated','\x27\x20entry\x20criteria','activation_updating','notification','activation_template_id','\x27\x20by\x20rule\x20content','isArray','stages','conditionTimeoutDuration','journey_entry_criteria_','branches','activations','DecisionPoint','stringify','data','toLowerCase','activation_','message','\x20segment\x20from\x20file:\x20','activation_deleted','folder_created','item','SEGMENT_NOT_FOUND','set','journeyById','sort','getSegment','slice','segmentFolderId','find','segment_updated','\x20error(s)','rootFolderId','created','conditionSegmentId','Journey\x20\x27','join','createSegment','createFolder','conditionTimeoutUnit','fetchJourney','journeyBundleName','connection','deps','getSegmentEntity','attributes','description','from','reduce','segmentByFolderAndName','../../utils/async.js','\x20(referenced\x20in\x20journey\x20','resolvedRule','trim','nameToId','journeyBundlesByFolderAndName','onProgress','activation_created','debug','./child-segment-yaml.js','SEGMENT_SYNTAX_ERROR','119648NwnjtK','idToEmailMap','journeyActivationNameToId','getSegment\x20failed\x20for\x20','createdSegmentIds','waitStepType','JOURNEY_SYNTAX_ERROR','activationStepsById','logInfo','282MhjVZg','segment_deleting','segment','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','252wWeqdD','embedded_segment_creating','has','.$1.push-recovery.json','toString','activation_deleting','toISOString','activationActions','errors','filter','conditions','getJourney','relationships','):\x20','Updating\x20segment\x20\x27','verbose','draft','digest','uniqueServerName','journeyId','\x27\x20milestone','644336SwQVTS','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','Delete\x20the\x20push\x20recovery\x20file\x20(','startsWith','existingJourney','Failed\x20to\x20fetch\x20referenced\x20segment\x20','null','embeddedSegmentNameToId','parse','segment_deleted','map','yamlConfig','absolutePath','__pending_act_','localName','connector_config','journey_created','\x27\x20from\x20file:\x20','yamlActivation','isNew','entryCriteria','waitStepUnit','Failed\x20to\x20','54924UkiLlW','listActivations','existingSegments','results','entry','utf-8','\x0a\x20\x20','goal\x20criteria','existingActivation','hex','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','logSuccess','milestone','NOT_FOUND','\x27\x20decision\x20point\x20branch\x20\x27','add','Embedded\x20segment\x20\x27','__pending_','rule','nameToType','createJourneySegment','Name\x20has\x20already\x20been\x20taken','behavior','effectiveFolderId',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','453048SFsSBA','folder_creating','folderId','some','WaitStep','getActivation','Activation\x20not\x20found:\x20','Deleting\x20activation\x20\x27','object','activationParams','updated','and\x20the\x20server\x20segment,\x20then\x20retry.','segment_creating','./journey-yaml.js','tdx.sdk.push-workflow','versionNumber','match','folder','Failed\x20to\x20resolve\x20segment\x20','getSegmentEntity\x20also\x20failed\x20for\x20','exitCriterias','dirname','type','unchanged','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','stage\x20\x27','Created\x20activation\x20\x27','existingSegment','diff','journey_updating','createdSegmentId','index','Segment\x20not\x20found:\x20','entry_criteria','deleted','journeys','\x27...','logWarning','Fetching\x20','Creating\x20folder\x20\x27','keys','INTERNAL','goal','resolveJourneyId','run_after_journey_refresh','activationContext','Creating\x20segment\x20\x27','journeyStages','25050ZMHlwH','Condition','journeyActivationStepId','embedded_activation_created','parentId','segment_created','JOURNEY_UPDATE_ERROR','SEGMENT_UPDATE_ERROR','connectionIdToNameMap','split','segmentId','parseDocument','valid','withProgress','progress','columns','action','update','relative','list','delete'];a127_0x23ef=function(){return _0x4ca7d8;};return a127_0x23ef();}import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a127_0x1b45a8(0x2de));export const PENDING_SEGMENT_PREFIX=a127_0x1b45a8(0x2c8);export const PENDING_ACTIVATION_PREFIX=a127_0x1b45a8(0x2ad);export function createPendingSegmentId(_0x36c7cb){return''+PENDING_SEGMENT_PREFIX+_0x36c7cb+'__';}export function isPendingSegmentId(_0xaf84f7){const _0x4dfd8a=a127_0x1b45a8;return _0xaf84f7['startsWith'](PENDING_SEGMENT_PREFIX)&&!_0xaf84f7[_0x4dfd8a(0x2a3)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x414548){return _0x414548['replace'](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x53c4c7){return''+PENDING_ACTIVATION_PREFIX+_0x53c4c7+'__';}export function isPendingActivationId(_0x25b419){return _0x25b419['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x33240a){const _0x5e4e15=a127_0x1b45a8;return _0x33240a[_0x5e4e15(0x23c)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x1dff07,_0xfc98a8){const _0x51feed=a127_0x1b45a8,_0x4e7b68=_0x1dff07+'::'+(_0xfc98a8[_0x51feed(0x276)]()||_0x51feed(0x289)),_0x24c4d7=createHash('sha1')[_0x51feed(0x210)](_0x4e7b68)[_0x51feed(0x29c)](_0x51feed(0x2c0))[_0x51feed(0x25c)](0x0,0xc);return _0x51feed(0x24a)+_0x24c4d7;}export function ensureJourneyDefaults(_0x4941ba){const _0xe05203=a127_0x1b45a8;!_0x4941ba[_0xe05203(0x26f)]&&(_0x4941ba[_0xe05203(0x26f)]=''),!_0x4941ba['state']&&(_0x4941ba[_0xe05203(0x226)]=_0xe05203(0x29b));}export function injectExistingStageIds(_0x55a4f0,_0x346fc6){const _0x16c13c=a127_0x1b45a8,_0x28f335=new Map(_0x346fc6[_0x16c13c(0x2aa)](_0x5bb214=>[_0x5bb214[_0x16c13c(0x23d)],_0x5bb214['id']]));for(const _0x42b5aa of _0x55a4f0){if(!_0x42b5aa['id']){const _0x20ec3f=_0x28f335[_0x16c13c(0x228)](_0x42b5aa[_0x16c13c(0x23d)]);_0x20ec3f&&(_0x42b5aa['id']=_0x20ec3f);}}}export function resolveTDFolderPath(_0x271d69,_0x18f3f3,_0x4c0749){const _0x39b178=a127_0x1b45a8;if(!_0x18f3f3)return _0x271d69;if(_0x271d69===_0x4c0749||_0x271d69[_0x39b178(0x2a3)](_0x4c0749+'/'))return _0x271d69;return _0x271d69?_0x4c0749+'/'+_0x271d69:_0x4c0749;}export function addFoldersToCreate(_0x21899e,_0x462fbe,_0x21d01e){const _0x3803b3=a127_0x1b45a8;if(!_0x21899e)return;if(_0x462fbe[_0x3803b3(0x28d)](_0x21899e))return;const _0x367440=_0x21899e['split']('/');let _0x210355='';for(const _0x1614ec of _0x367440){_0x210355=_0x210355?_0x210355+'/'+_0x1614ec:_0x1614ec,!_0x462fbe[_0x3803b3(0x28d)](_0x210355)&&_0x21d01e[_0x3803b3(0x2c6)](_0x210355);}}export function sortFoldersByDepth(_0x426953){const _0x51163a=a127_0x1b45a8;return[..._0x426953][_0x51163a(0x25a)]((_0x40cea0,_0x1d7783)=>{const _0x6fd841=_0x51163a,_0x568405=(_0x40cea0[_0x6fd841(0x2e0)](/\//g)||[])[_0x6fd841(0x215)],_0x5706bf=(_0x1d7783[_0x6fd841(0x2e0)](/\//g)||[])[_0x6fd841(0x215)];return _0x568405-_0x5706bf;});}import*as a127_0x32516f from'yaml';import{readFileSync}from'fs';import a127_0x2db84c from'path';import{isJourneyDef,parseYamlString as a127_0x46b0f9,toYamlString as a127_0x5494c4,normalizeJourneyDef,hasMultipleVersions,journeyResponseToDef,collectSegmentIdsFromJourneyApi}from'./journey-yaml.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,createJumpTargetCache,resolveJumpTarget,buildMergedJourneyDef,buildLocalRuleToNameMappingFromJourney,collectSegmentUsageCounts}from'./journey-utils.js';import{activationResponseToDef,segmentToYamlString,segmentWithActivationsToYaml,parseSegmentYamlFile,normalizeChildSegmentYaml,apiRuleToYaml,yamlRuleToApi,serializeExpandedRule,collectSegmentRefsFromRule,resolveRuleSegmentRefs,resolveRuleSegmentIds,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{batchAsync}from'../../utils/async.js';import{buildFolderMaps}from'./resolution-context.js';import{SDKError,ErrorCode,isHttp400Error,getErrorMessage}from'../errors.js';import{readPushRecovery,saveSegmentToPushRecovery,deletePushRecovery}from'./push-recovery.js';import{validateSegmentDef,formatValidationResult}from'./yaml-validator.js';import{validateJourneyDef}from'./journey-validator.js';function stableStringify(_0x469674){const _0x12c6f9=a127_0x1b45a8;if(Array[_0x12c6f9(0x247)](_0x469674))return'['+_0x469674[_0x12c6f9(0x2aa)](_0x56f96b=>stableStringify(_0x56f96b))[_0x12c6f9(0x265)](',')+']';if(_0x469674&&typeof _0x469674===_0x12c6f9(0x2d8)){const _0x2e4f8f=_0x469674,_0x5e1c6c=Object['keys'](_0x2e4f8f)['sort'](),_0x36c5bd=_0x5e1c6c[_0x12c6f9(0x2aa)](_0x4c100d=>'\x22'+_0x4c100d+'\x22:'+stableStringify(_0x2e4f8f[_0x4c100d]));return'{'+_0x36c5bd[_0x12c6f9(0x265)](',')+'}';}const _0x494463=JSON[_0x12c6f9(0x24e)](_0x469674);return _0x494463===undefined?_0x12c6f9(0x2a6):_0x494463;}function activationSignature(_0x5aeea9){const _0x3e14b1=a127_0x1b45a8,_0x48c77c={'connection':_0x5aeea9[_0x3e14b1(0x26b)],..._0x5aeea9[_0x3e14b1(0x230)]!==undefined&&{'all_columns':_0x5aeea9[_0x3e14b1(0x230)]},..._0x5aeea9[_0x3e14b1(0x20e)]!==undefined&&{'columns':_0x5aeea9[_0x3e14b1(0x20e)]},..._0x5aeea9[_0x3e14b1(0x2cd)]!==undefined&&{'behavior':_0x5aeea9['behavior']},..._0x5aeea9[_0x3e14b1(0x23b)]!==undefined&&{'schedule':_0x5aeea9['schedule']},..._0x5aeea9[_0x3e14b1(0x244)]!==undefined&&{'notification':_0x5aeea9[_0x3e14b1(0x244)]},..._0x5aeea9['connector_config']!==undefined&&{'connector_config':_0x5aeea9[_0x3e14b1(0x2af)]},..._0x5aeea9[_0x3e14b1(0x245)]!==undefined&&{'activation_template_id':_0x5aeea9[_0x3e14b1(0x245)]}};return stableStringify(_0x48c77c);}async function fetchSegment(_0x5a7a67,_0x4404fd,_0x2d2523,_0x4a08f2){const _0x4661c3=a127_0x1b45a8,_0xf7f6d5=_0x4a08f2?.[_0x4661c3(0x25e)](_0x20d24a=>_0x20d24a['id']===_0x2d2523);if(_0xf7f6d5)return _0xf7f6d5;try{return await _0x5a7a67[_0x4661c3(0x289)][_0x4661c3(0x25b)](_0x4404fd,_0x2d2523);}catch(_0x32f859){logger['debug'](_0x4661c3(0x281)+_0x2d2523+_0x4661c3(0x2cf)+_0x32f859);try{return await _0x5a7a67[_0x4661c3(0x289)][_0x4661c3(0x26d)](_0x2d2523);}catch(_0xdbb09a){return logger['debug'](_0x4661c3(0x2e3)+_0x2d2523+':\x20'+_0xdbb09a),null;}}}function recoverSegmentIdsFromPushRecovery(_0x14f0c8,_0x115663,_0x582fe0){const _0x23e560=a127_0x1b45a8,_0x2214ac=readPushRecovery(_0x14f0c8[_0x23e560(0x2ac)]);if(_0x2214ac?.['journeyName']===_0x14f0c8[_0x23e560(0x2ab)][_0x23e560(0x23d)])for(const [_0x356b6c,_0x27eaf3]of Object['entries'](_0x2214ac[_0x23e560(0x225)])){const _0x39f479=generateDeterministicJourneySegmentName(_0x14f0c8[_0x23e560(0x2ab)][_0x23e560(0x23d)],_0x356b6c);_0x27eaf3[_0x23e560(0x29d)]===_0x39f479&&(_0x115663[_0x23e560(0x258)](_0x356b6c,_0x27eaf3[_0x23e560(0x209)]),_0x582fe0[_0x23e560(0x258)](_0x356b6c,_0x27eaf3[_0x23e560(0x209)]));}}async function createOrRecoverEmbeddedSegment(_0x312171,_0x209b25,_0x4c1ff0,_0x1a1c04){const _0x221d05=a127_0x1b45a8;let _0x1ea0be;try{_0x1ea0be=await _0x312171[_0x221d05(0x289)][_0x221d05(0x2cb)]({'name':_0x4c1ff0[_0x221d05(0x234)],'description':_0x4c1ff0['description'],'journeyId':_0x4c1ff0[_0x221d05(0x29e)],'rule':_0x1a1c04(_0x4c1ff0[_0x221d05(0x275)],!![]),'countPopulation':!![],'parentFolderId':_0x4c1ff0[_0x221d05(0x2d2)],'audienceId':_0x4c1ff0[_0x221d05(0x203)]});}catch(_0x5296c7){const _0x173b2e=_0x5296c7 instanceof Error&&_0x5296c7[_0x221d05(0x252)][_0x221d05(0x22f)](_0x221d05(0x2cc));if(_0x173b2e){const _0x301bff=readPushRecovery(_0x209b25['absolutePath']),_0x5a869f=_0x301bff?.[_0x221d05(0x21e)]===_0x209b25[_0x221d05(0x2ab)][_0x221d05(0x23d)]?_0x301bff['segments'][_0x4c1ff0['localName']]:undefined;if(_0x5a869f?.[_0x221d05(0x29d)]===_0x4c1ff0['uniqueSegmentName'])await _0x312171[_0x221d05(0x289)][_0x221d05(0x219)](_0x4c1ff0[_0x221d05(0x203)],_0x5a869f[_0x221d05(0x209)],{'description':_0x4c1ff0['description'],'rule':_0x1a1c04(_0x4c1ff0[_0x221d05(0x275)],!![]),'countPopulation':!![]}),_0x1ea0be=_0x5a869f[_0x221d05(0x209)];else throw new SDKError(ErrorCode[_0x221d05(0x206)],_0x221d05(0x2c7)+_0x4c1ff0[_0x221d05(0x2ae)]+'\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20'+(_0x221d05(0x2a2)+_0x209b25['absolutePath']['replace'](/([^/]+)$/,_0x221d05(0x28e))+')\x20')+_0x221d05(0x2db),_0x5296c7);}else throw _0x5296c7;}return saveSegmentToPushRecovery(_0x209b25[_0x221d05(0x2ac)],_0x209b25[_0x221d05(0x2ab)][_0x221d05(0x23d)],_0x4c1ff0[_0x221d05(0x2ae)],{'segmentId':_0x1ea0be,'uniqueServerName':_0x4c1ff0['uniqueSegmentName'],'createdAt':new Date()['toISOString']()}),_0x1ea0be;}export async function prepareSegmentFiles(_0x2746cb,_0x4e0e43,_0x2c8bb2,_0x34973e,_0x33cd5e){const _0x406f0f=a127_0x1b45a8,{activationDefToCreateRequest:_0x29a686}=await import(_0x406f0f(0x27c)),_0x35b82f=[],_0x310fd1=new Set();for(const {yamlConfig:_0x4af37e,folderPath:_0x28d59d,sourcePath:_0x251e71}of _0x2746cb){const _0x1df4be=resolveTDFolderPath(_0x28d59d,_0x34973e,_0x33cd5e),_0x541b64=_0x1df4be+':'+_0x4af37e[_0x406f0f(0x23d)],_0x5af748=_0x4e0e43[_0x406f0f(0x272)]['get'](_0x541b64),_0x512001=_0x5af748?_0x4e0e43['activationsBySegmentId'][_0x406f0f(0x228)](_0x5af748['id'])||[]:[];addFoldersToCreate(_0x1df4be,_0x4e0e43[_0x406f0f(0x21d)],_0x310fd1);const _0x3182cb=calculateActivationActions(_0x4af37e[_0x406f0f(0x24c)]||[],_0x512001,_0x4e0e43['idToEmailMap'],_0x4e0e43[_0x406f0f(0x207)]);for(const _0x27d31a of _0x3182cb){(_0x27d31a[_0x406f0f(0x2e6)]==='create'||_0x27d31a['type']===_0x406f0f(0x210))&&_0x27d31a['yamlActivation']&&(_0x27d31a[_0x406f0f(0x240)]=await _0x29a686(_0x27d31a[_0x406f0f(0x2b2)],_0x2c8bb2));}const _0x3bd6ff=calculateSegmentDiff(_0x4af37e,_0x5af748,_0x512001,_0x4e0e43[_0x406f0f(0x27f)],_0x4e0e43['connectionIdToNameMap']);_0x35b82f[_0x406f0f(0x23e)]({'relativePath':_0x4af37e[_0x406f0f(0x23d)],'absolutePath':_0x251e71,'yamlConfig':_0x4af37e,'folderPath':_0x1df4be,'existingSegment':_0x5af748,'existingActivations':_0x512001,'isNew':_0x3bd6ff[_0x406f0f(0x2b3)],'hasChanges':_0x3bd6ff[_0x406f0f(0x21c)],'diff':_0x3bd6ff[_0x406f0f(0x1eb)],'activationActions':_0x3182cb});}return{'segmentFiles':_0x35b82f,'foldersToCreate':_0x310fd1};}export async function prepareJourneyFiles(_0x15dce1,_0x354f0b,_0x2c8cc5,_0x4695cd){const _0x3a9192=a127_0x1b45a8,_0x56a6d4=[],_0x1b4ca2=new Set();for(const {yamlConfig:_0x14c3a5,folderPath:_0x4f8650,sourcePath:_0x46a450}of _0x15dce1){const _0x46368a=resolveTDFolderPath(_0x4f8650,_0x2c8cc5,_0x4695cd),_0x7415bd=_0x46368a+':'+_0x14c3a5[_0x3a9192(0x23d)],_0x247cb7=_0x354f0b[_0x3a9192(0x278)][_0x3a9192(0x228)](_0x7415bd);let _0x50e3dc,_0x3663da;if(_0x247cb7&&_0x247cb7[_0x3a9192(0x215)]>0x0){const _0x239bcf=buildLocalExpandedRuleMappings(_0x14c3a5),{createYamlContext:_0x276cc7,prefetchJourneySegments:_0x15a43a}=createPushYamlContextForBundle(_0x354f0b[_0x3a9192(0x26c)],_0x354f0b[_0x3a9192(0x203)],_0x354f0b[_0x3a9192(0x2b9)],_0x239bcf,_0x354f0b[_0x3a9192(0x27f)],_0x354f0b['connectionIdToNameMap'],_0x354f0b[_0x3a9192(0x285)],_0x354f0b[_0x3a9192(0x259)]);await _0x15a43a(_0x247cb7[_0x3a9192(0x2aa)](_0x9bf0c6=>_0x9bf0c6['id']));const _0x23f61c=hasMultipleVersions(_0x14c3a5),_0x21e249=async _0x3efbee=>{const _0x487805=_0x3a9192,_0x1b7459=_0x354f0b[_0x487805(0x259)]?.[_0x487805(0x228)](_0x3efbee);if(_0x1b7459)return _0x1b7459;return _0x354f0b[_0x487805(0x269)]({'journeyId':_0x3efbee,'journeyName':_0x14c3a5[_0x487805(0x23d)],'isMultiVersion':_0x247cb7[_0x487805(0x215)]>0x1});};if(_0x23f61c&&_0x247cb7[_0x3a9192(0x215)]>0x1){const _0x421306=[];for(const _0x28fa57 of _0x247cb7){const _0x10c70f=_0x28fa57[_0x3a9192(0x2df)]||0x1;_0x354f0b[_0x3a9192(0x20d)]?.['update'](_0x3a9192(0x1f5)+_0x14c3a5[_0x3a9192(0x23d)]+'\x20v'+_0x10c70f);const _0x27c2c8=await _0x21e249(_0x28fa57['id']),_0x33d0c0=_0x276cc7(_0x28fa57['id']),_0xc25d22=await journeyResponseToDef(_0x27c2c8,_0x33d0c0);_0x421306[_0x3a9192(0x23e)]({'item':_0x28fa57,'yaml':_0xc25d22});}const _0x11e90c=buildLocalRuleToNameMappingFromJourney(_0x14c3a5);_0x3663da=buildMergedJourneyDef(_0x421306,_0x11e90c);const _0x199980=Math['max'](..._0x421306[_0x3a9192(0x2aa)](_0x2e33f4=>_0x2e33f4[_0x3a9192(0x256)][_0x3a9192(0x2df)]||0x0)),_0x334c04=_0x247cb7[_0x3a9192(0x25e)](_0x3927c1=>(_0x3927c1[_0x3a9192(0x2df)]||0x0)===_0x199980);_0x334c04&&(_0x354f0b['progress']?.['update'](_0x3a9192(0x1f5)+_0x14c3a5[_0x3a9192(0x23d)]+'\x20v'+_0x199980),_0x50e3dc=await _0x21e249(_0x334c04['id']));}else{const _0x3e6a64=_0x247cb7[_0x247cb7[_0x3a9192(0x215)]-0x1];_0x354f0b[_0x3a9192(0x20d)]?.[_0x3a9192(0x210)](_0x3a9192(0x1f5)+_0x14c3a5[_0x3a9192(0x23d)]),_0x50e3dc=await _0x21e249(_0x3e6a64['id']);const _0x4c66a7=_0x276cc7(_0x3e6a64['id']),_0x1ce3cf=await journeyResponseToDef(_0x50e3dc,_0x4c66a7),_0x8c3768=buildLocalRuleToNameMappingFromJourney(_0x14c3a5);_0x3663da=buildMergedJourneyDef([{'item':_0x3e6a64,'yaml':_0x1ce3cf}],_0x8c3768);}}addFoldersToCreate(_0x46368a,_0x354f0b['folderPathToId'],_0x1b4ca2);const _0x4f3f24=calculateJourneyDiff(_0x14c3a5,_0x3663da);_0x56a6d4[_0x3a9192(0x23e)]({'relativePath':_0x14c3a5[_0x3a9192(0x23d)],'absolutePath':_0x46a450,'yamlConfig':_0x14c3a5,'folderPath':_0x46368a,'existingJourney':_0x50e3dc,'isNew':_0x4f3f24['isNew'],'hasChanges':_0x4f3f24[_0x3a9192(0x21c)],'diff':_0x4f3f24[_0x3a9192(0x1eb)]});}return{'journeyFiles':_0x56a6d4,'foldersToCreate':_0x1b4ca2};}export function calculateActivationActions(_0x1dc46e,_0x1c8f92,_0x34f95d,_0x5e594c){const _0x140caf=a127_0x1b45a8,_0x1db720=[],_0x2012f6=new Map();for(const _0x658d68 of _0x1c8f92){_0x2012f6['set'](_0x658d68[_0x140caf(0x23d)],_0x658d68);}const _0x2a4911=new Map();for(const _0x5656c9 of _0x1dc46e){_0x2a4911[_0x140caf(0x258)](_0x5656c9[_0x140caf(0x23d)],_0x5656c9);}for(const _0x46b91f of _0x1dc46e){const _0x25496e=_0x2012f6[_0x140caf(0x228)](_0x46b91f[_0x140caf(0x23d)]);if(!_0x25496e)_0x1db720[_0x140caf(0x23e)]({'type':_0x140caf(0x22b),'name':_0x46b91f['name'],'yamlActivation':_0x46b91f});else{const _0x4b612d=activationResponseToDef(_0x25496e,_0x34f95d,_0x5e594c),_0x6d2abf=a127_0x32516f[_0x140caf(0x24e)](_0x4b612d),_0x2cfcac=a127_0x32516f[_0x140caf(0x24e)](_0x46b91f);_0x6d2abf!==_0x2cfcac&&_0x1db720[_0x140caf(0x23e)]({'type':_0x140caf(0x210),'name':_0x46b91f['name'],'yamlActivation':_0x46b91f,'existingActivation':_0x25496e});}}for(const _0x543a24 of _0x1c8f92){!_0x2a4911[_0x140caf(0x28d)](_0x543a24[_0x140caf(0x23d)])&&_0x1db720[_0x140caf(0x23e)]({'type':_0x140caf(0x213),'name':_0x543a24[_0x140caf(0x23d)],'existingActivation':_0x543a24});}return _0x1db720;}function calculateYamlDiff(_0x4c42e9,_0x50ea35){if(_0x50ea35){const _0x2b38e3=generateDiff(_0x50ea35,_0x4c42e9),_0x5cbafd=hasChanges(_0x2b38e3);return{'isNew':![],'hasChanges':_0x5cbafd,'diff':_0x5cbafd?formatDiffWithColors(_0x2b38e3):undefined};}const _0x52c390=generateDiff('',_0x4c42e9);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x52c390)};}export function calculateSegmentDiff(_0x386f91,_0x132b10,_0x22abdc,_0x286499,_0x4c01ed){const _0x439407=segmentToYamlString(_0x386f91),_0x2b529d=_0x132b10?segmentToYamlString(segmentWithActivationsToYaml(_0x132b10,_0x22abdc,undefined,_0x286499,_0x4c01ed)):undefined;return calculateYamlDiff(_0x439407,_0x2b529d);}export function calculateJourneyDiff(_0x5d5e3a,_0x160d83){const _0x55fc2c=normalizeJourneyDef(_0x5d5e3a,_0x5d5e3a),_0x1894de=a127_0x5494c4(_0x55fc2c),_0x10e1ff=_0x160d83?a127_0x5494c4(normalizeJourneyDef(_0x160d83,_0x5d5e3a)):undefined;return calculateYamlDiff(_0x1894de,_0x10e1ff);}export function findSegmentsToDelete(_0x2f5a3d,_0x4b85f5,_0x14aa77,_0x442890,_0x534fab){const _0x5bc967=a127_0x1b45a8,_0x36c5fe=new Set();for(const {yamlConfig:_0x46a214,folderPath:_0x353e18}of _0x4b85f5){_0x36c5fe[_0x5bc967(0x2c6)](_0x353e18+':'+_0x46a214[_0x5bc967(0x23d)]);}return _0x2f5a3d[_0x5bc967(0x294)](_0x542180=>{const _0x1ac234=_0x5bc967,_0xc1a607=_0x542180['segmentFolderId']?_0x14aa77[_0x1ac234(0x228)](_0x542180['segmentFolderId'][_0x1ac234(0x28f)]())||'':'',_0x1d7479=_0xc1a607+':'+_0x542180[_0x1ac234(0x23d)];if(_0x36c5fe[_0x1ac234(0x28d)](_0x1d7479))return![];if(_0x534fab)return _0xc1a607===_0x442890||_0xc1a607[_0x1ac234(0x2a3)](_0x442890+'/');return!![];});}export function findJourneysToDelete(_0x450133,_0x2e96e4,_0x21b36e,_0x306675,_0x411bcf){const _0x3fa4a2=a127_0x1b45a8,_0x235f21=new Set();for(const {yamlConfig:_0x552e73,folderPath:_0x18617a}of _0x2e96e4){_0x235f21[_0x3fa4a2(0x2c6)](_0x18617a+':'+_0x552e73[_0x3fa4a2(0x23d)]);}return _0x450133[_0x3fa4a2(0x294)](_0x4f251a=>{const _0x34dff9=_0x3fa4a2,_0x1fb1f5=_0x4f251a[_0x34dff9(0x2d2)]?_0x21b36e[_0x34dff9(0x228)](_0x4f251a[_0x34dff9(0x2d2)])||'':'',_0x42b751=_0x1fb1f5+':'+_0x4f251a[_0x34dff9(0x26a)];if(_0x235f21['has'](_0x42b751))return![];if(_0x411bcf)return _0x1fb1f5===_0x306675||_0x1fb1f5[_0x34dff9(0x2a3)](_0x306675+'/');return!![];});}export function buildSegmentLookupMap(_0x1330e6,_0x451a95){const _0x3ef724=a127_0x1b45a8,_0x1b5867=new Map();for(const _0x1f2108 of _0x1330e6){const _0x1ee511=_0x1f2108['segmentFolderId']?_0x451a95['get'](_0x1f2108['segmentFolderId'][_0x3ef724(0x28f)]())||'':'',_0x561f65=_0x1ee511+':'+_0x1f2108[_0x3ef724(0x23d)];_0x1b5867[_0x3ef724(0x258)](_0x561f65,_0x1f2108);}return _0x1b5867;}export function buildSegmentNameToIdMap(_0x349108){const _0x2db01c=a127_0x1b45a8,_0x516d87=new Map();for(const _0x28ea1f of _0x349108){_0x516d87[_0x2db01c(0x258)](_0x28ea1f[_0x2db01c(0x23d)],_0x28ea1f['id']);}return _0x516d87;}export function buildJourneyBundleLookupMap(_0x5e7b3d,_0x296d26){const _0xb4968b=a127_0x1b45a8,_0x176c6c=new Map();for(const _0xa6e41e of _0x5e7b3d){const _0x318833=_0xa6e41e['folderId']?_0x296d26[_0xb4968b(0x228)](_0xa6e41e[_0xb4968b(0x2d2)])||'':'',_0x4f03b1=_0x318833+':'+_0xa6e41e[_0xb4968b(0x26a)];!_0x176c6c[_0xb4968b(0x28d)](_0x4f03b1)&&_0x176c6c['set'](_0x4f03b1,[]),_0x176c6c[_0xb4968b(0x228)](_0x4f03b1)[_0xb4968b(0x23e)](_0xa6e41e);}for(const _0x53e18c of _0x176c6c['values']()){_0x53e18c[_0xb4968b(0x25a)]((_0x24eddb,_0x2370f7)=>(_0x24eddb['versionNumber']||0x0)-(_0x2370f7[_0xb4968b(0x2df)]||0x0));}return _0x176c6c;}export function collectFoldersToCreate(_0x4549f7,_0x65a8ac){const _0x38c3e7=a127_0x1b45a8,_0x3ae9df=new Set();for(const _0x3a81bb of _0x4549f7){if(!_0x3a81bb)continue;if(_0x65a8ac[_0x38c3e7(0x28d)](_0x3a81bb))continue;const _0x322b80=_0x3a81bb[_0x38c3e7(0x208)]('/');let _0x1f064b='';for(const _0x68b10b of _0x322b80){_0x1f064b=_0x1f064b?_0x1f064b+'/'+_0x68b10b:_0x68b10b,!_0x65a8ac[_0x38c3e7(0x28d)](_0x1f064b)&&_0x3ae9df[_0x38c3e7(0x2c6)](_0x1f064b);}}return _0x3ae9df;}export function parseAndClassifyYamlFiles(_0x2ce8f7,_0x335edb,_0x35ab88){const _0x4fe319=a127_0x1b45a8,_0x2f808a=[],_0x2be0b3=[];for(const _0x3700fa of _0x2ce8f7){const _0x4259b4=a127_0x2db84c[_0x4fe319(0x211)](_0x335edb,a127_0x2db84c[_0x4fe319(0x2e5)](_0x3700fa)),_0x2e1d3e=_0x4259b4==='.'?'':_0x4259b4,_0x247e5b=readFileSync(_0x3700fa,'utf-8'),_0x439158=a127_0x32516f[_0x4fe319(0x2a8)](_0x247e5b);if(isJourneyDef(_0x439158)){const _0x8f8603=a127_0x46b0f9(_0x247e5b);_0x2be0b3[_0x4fe319(0x23e)]({'yamlConfig':_0x8f8603,'folderPath':_0x2e1d3e,'sourcePath':_0x3700fa});}else{if(!_0x35ab88?.['skipSegments']){const _0x53b68a=parseSegmentYamlFile(_0x247e5b),_0x14a321=normalizeChildSegmentYaml(_0x53b68a);_0x2f808a[_0x4fe319(0x23e)]({'yamlConfig':_0x14a321,'folderPath':_0x2e1d3e,'sourcePath':_0x3700fa});}}}return{'segments':_0x2f808a,'journeys':_0x2be0b3};}export function validateParsedFiles(_0xc062ea,_0x2a76b2){const _0x1756dc=a127_0x1b45a8,_0x15ed10=[];for(const {yamlConfig:_0x10e843,sourcePath:_0x4f3412}of _0xc062ea[_0x1756dc(0x225)]){const _0x47fc52=readFileSync(_0x4f3412,'utf-8'),_0x28da6b=a127_0x32516f[_0x1756dc(0x20a)](_0x47fc52),_0x125414=validateSegmentDef(_0x10e843,{'source':_0x47fc52,'document':_0x28da6b});if(!_0x125414['valid']){const _0x5b0e90=a127_0x2db84c[_0x1756dc(0x211)](_0x2a76b2,_0x4f3412);_0x15ed10['push']({'filePath':_0x5b0e90,'source':_0x47fc52,'result':_0x125414,'isJourney':![]});}}for(const {yamlConfig:_0x1aeb3c,sourcePath:_0x212f72}of _0xc062ea['journeys']){const _0x583b6f=readFileSync(_0x212f72,_0x1756dc(0x2bc)),_0x36b2ff=a127_0x32516f['parseDocument'](_0x583b6f),_0x804cf5=validateJourneyDef(_0x1aeb3c,{'source':_0x583b6f,'document':_0x36b2ff});if(!_0x804cf5[_0x1756dc(0x20b)]){const _0x128a4c=a127_0x2db84c['relative'](_0x2a76b2,_0x212f72);_0x15ed10['push']({'filePath':_0x128a4c,'source':_0x583b6f,'result':_0x804cf5,'isJourney':!![]});}}return _0x15ed10;}export function formatValidationErrors(_0x81c6af){const _0x1cf216=a127_0x1b45a8,_0xaa5c26=[];for(const {filePath:_0x1d3e66,source:_0x321a22,result:_0x1ad204,isJourney:_0x38ff17}of _0x81c6af){const _0x5ee908=_0x38ff17?_0x1cf216(0x22e):_0x1cf216(0x289);_0xaa5c26[_0x1cf216(0x23e)]('\x0a'+_0x1d3e66+'\x20('+_0x5ee908+_0x1cf216(0x298)+_0x1ad204[_0x1cf216(0x293)]['length']+_0x1cf216(0x260)),_0xaa5c26[_0x1cf216(0x23e)](formatValidationResult(_0x1ad204,_0x321a22,_0x1d3e66));}return _0xaa5c26[_0x1cf216(0x265)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x3963c6){const _0x7d650c=a127_0x1b45a8,_0x25e126=new Set(),_0x3e30e8=new Map(),_0x2d5e85=collectSegmentUsageCounts(_0x3963c6);if(_0x3963c6['segments'])for(const [_0x2e4826,_0x166969]of Object['entries'](_0x3963c6['segments'])){_0x25e126['add'](_0x2e4826);if(_0x166969[_0x7d650c(0x2c9)]){const _0x19c807=yamlRuleToApi(_0x166969['rule']),_0x4fa8e5=apiRuleToYaml(_0x19c807);_0x3e30e8['set'](_0x2e4826,_0x4fa8e5);}}const _0x1045c1=new Map();let _0x40f18a=0x0;for(const [_0x49b3d2,_0x6637e1]of _0x3e30e8){const _0xccc2fa=serializeExpandedRule(_0x6637e1,_0x3e30e8),_0x27e865=_0x1045c1[_0x7d650c(0x228)](_0xccc2fa)||[];_0x27e865[_0x7d650c(0x23e)]({'name':_0x49b3d2,'index':_0x40f18a}),_0x1045c1[_0x7d650c(0x258)](_0xccc2fa,_0x27e865),_0x40f18a++;}const _0x541eb4=new Map();for(const [_0x3a761f,_0x4e3b50]of _0x1045c1){const _0x195af3=_0x4e3b50[_0x7d650c(0x25c)]()['sort']((_0x2e877d,_0x3df635)=>{const _0x267a40=_0x7d650c,_0x24e77c=_0x2d5e85[_0x267a40(0x228)](_0x2e877d[_0x267a40(0x23d)])||0x0,_0x4efef3=_0x2d5e85['get'](_0x3df635[_0x267a40(0x23d)])||0x0;if(_0x24e77c!==_0x4efef3)return _0x4efef3-_0x24e77c;return _0x2e877d[_0x267a40(0x1ee)]-_0x3df635['index'];})['map'](_0x54d402=>_0x54d402['name']),_0x39a6ca=[];for(const _0x2fe2e4 of _0x195af3){const _0x1efad3=_0x2d5e85['get'](_0x2fe2e4)||0x0,_0x111ae5=Math['max'](_0x1efad3,0x1);for(let _0x2dd7ea=0x0;_0x2dd7ea<_0x111ae5;_0x2dd7ea++){_0x39a6ca['push'](_0x2fe2e4);}}_0x541eb4[_0x7d650c(0x258)](_0x3a761f,_0x39a6ca);}return{'existingLocalSegmentNames':_0x25e126,'localSegmentRules':_0x3e30e8,'localExpandedRuleToNames':_0x541eb4};}export function createSegmentIdResolver(_0x17c4fb,_0x3d9336){return async _0x14cb39=>{const _0x2436cf=a127_0x9b56,_0x4e9c65=_0x17c4fb[_0x2436cf(0x228)](_0x14cb39);if(!_0x4e9c65)throw new SDKError(ErrorCode[_0x2436cf(0x257)],_0x2436cf(0x1ef)+_0x14cb39+_0x2436cf(0x28a)+_0x3d9336+'\x27)');return _0x4e9c65;};}export function extractRootFolderId(_0x9bab57){const _0x10fa34=a127_0x1b45a8;return _0x9bab57[_0x10fa34(0x297)]?.[_0x10fa34(0x23f)]?.[_0x10fa34(0x24f)]?.['id']||_0x9bab57[_0x10fa34(0x297)]?.['parentFolder']?.[_0x10fa34(0x24f)]?.['id'];}export function buildConnectionMaps(_0x1e716d){const _0x1c9e16=a127_0x1b45a8,_0x394c1d=new Map(),_0x1bb630=new Map(),_0x2a69b8=new Map();for(const _0x1d0886 of _0x1e716d){_0x394c1d['set'](_0x1d0886[_0x1c9e16(0x23d)],parseInt(_0x1d0886['id'],0xa)),_0x1bb630['set'](_0x1d0886['id'],_0x1d0886['name']),_0x2a69b8[_0x1c9e16(0x258)](_0x1d0886[_0x1c9e16(0x23d)],_0x1d0886[_0x1c9e16(0x2e6)]);}return{'nameToId':_0x394c1d,'idToName':_0x1bb630,'nameToType':_0x2a69b8};}export function calculatePushStats(_0x15d02f,_0x3fee75,_0x186292,_0x435395,_0x3d8bc0,_0x22439f,_0x33b9ea){const _0x26fdc6=a127_0x1b45a8,_0x5d8cc8=_0x15d02f[_0x26fdc6(0x294)](_0xe96fcd=>_0xe96fcd[_0x26fdc6(0x2b3)]),_0x213993=_0x15d02f['filter'](_0x34205e=>!_0x34205e['isNew']&&_0x34205e[_0x26fdc6(0x21c)]),_0x48742d=_0x15d02f[_0x26fdc6(0x294)](_0x20cafc=>!_0x20cafc[_0x26fdc6(0x2b3)]&&!_0x20cafc[_0x26fdc6(0x21c)]),_0x37320b=_0x22439f?_0x435395:[],_0x4bb691=_0x3fee75['filter'](_0x3e604e=>_0x3e604e['isNew']),_0x227bbf=_0x3fee75[_0x26fdc6(0x294)](_0x8e5978=>!_0x8e5978[_0x26fdc6(0x2b3)]&&_0x8e5978['hasChanges']),_0x43cf3c=_0x3fee75['filter'](_0x1c83e1=>!_0x1c83e1[_0x26fdc6(0x2b3)]&&!_0x1c83e1['hasChanges']),_0x26a536=_0x22439f?_0x3d8bc0:[],_0x28ad88=_0x15d02f['flatMap'](_0x3fb1bb=>_0x3fb1bb['activationActions']),_0x3d391a=_0x28ad88['filter'](_0x1203f6=>_0x1203f6[_0x26fdc6(0x2e6)]===_0x26fdc6(0x22b)),_0x352b89=_0x28ad88[_0x26fdc6(0x294)](_0x5464eb=>_0x5464eb[_0x26fdc6(0x2e6)]===_0x26fdc6(0x210)),_0x4aed9f=_0x28ad88[_0x26fdc6(0x294)](_0x306f91=>_0x306f91[_0x26fdc6(0x2e6)]==='delete'),_0x14505f=Array[_0x26fdc6(0x270)](_0x186292)[_0x26fdc6(0x25a)](),_0x474ba6=_0x33b9ea?![]:_0x5d8cc8['length']>0x0||_0x213993[_0x26fdc6(0x215)]>0x0||_0x37320b[_0x26fdc6(0x215)]>0x0,_0x5a408d=_0x4bb691[_0x26fdc6(0x215)]>0x0||_0x227bbf[_0x26fdc6(0x215)]>0x0||_0x26a536[_0x26fdc6(0x215)]>0x0,_0x5f080b=_0x33b9ea?![]:_0x28ad88[_0x26fdc6(0x215)]>0x0,_0x1fb19d=_0x14505f[_0x26fdc6(0x215)]>0x0;return{'segments':{'new':_0x5d8cc8,'changed':_0x213993,'unchanged':_0x48742d,'toDelete':_0x37320b},'journeys':{'new':_0x4bb691,'changed':_0x227bbf,'unchanged':_0x43cf3c,'toDelete':_0x26a536},'activations':{'all':_0x28ad88,'toCreate':_0x3d391a,'toUpdate':_0x352b89,'toDelete':_0x4aed9f},'folders':{'toCreate':_0x14505f},'counts':{'segments':{'new':_0x5d8cc8['length'],'changed':_0x213993[_0x26fdc6(0x215)],'unchanged':_0x48742d[_0x26fdc6(0x215)],'toDelete':_0x37320b[_0x26fdc6(0x215)]},'journeys':{'new':_0x4bb691[_0x26fdc6(0x215)],'changed':_0x227bbf[_0x26fdc6(0x215)],'unchanged':_0x43cf3c[_0x26fdc6(0x215)],'toDelete':_0x26a536[_0x26fdc6(0x215)]},'activations':{'create':_0x3d391a[_0x26fdc6(0x215)],'update':_0x352b89[_0x26fdc6(0x215)],'delete':_0x4aed9f[_0x26fdc6(0x215)]},'folders':_0x14505f['length']},'hasChanges':_0x474ba6||_0x5a408d||_0x5f080b||_0x1fb19d};}export async function buildPushExecutionContext(_0x5b45b3,_0x4c0057,_0x4c746e,_0x4b6a39,_0x2a0553,_0x36ebbb){const _0x5c0bcb=a127_0x1b45a8,_0x571cfa=extractRootFolderId(_0x4c746e),{pathToId:_0x5e7408,idToPath:_0x4945b9}=buildFolderMaps(_0x2a0553),_0xfbd8e3=buildSegmentNameToIdMap(_0x4b6a39),_0x5c97ed=new Map(),{batchAsync:_0x2de439}=await import(_0x5c0bcb(0x273)),[_0x6efb66,_0x18361b]=await Promise[_0x5c0bcb(0x231)]([_0x5b45b3[_0x5c0bcb(0x21b)][_0x5c0bcb(0x216)](),_0x5b45b3[_0x5c0bcb(0x26b)][_0x5c0bcb(0x212)](),((async()=>{const _0x10fed7=_0x5c0bcb;!_0x36ebbb&&_0x4b6a39[_0x10fed7(0x215)]>0x0&&await _0x2de439(_0x4b6a39,async _0x6cb399=>{const _0x42dd51=_0x10fed7,_0x3fc1a0=await _0x5b45b3[_0x42dd51(0x289)][_0x42dd51(0x2b8)](_0x4c0057,_0x6cb399['id']);_0x5c97ed['set'](_0x6cb399['id'],_0x3fc1a0);});})())]),{emailToId:_0x3bf266,idToEmail:_0x8f756e}=_0x6efb66,_0x40442d=buildConnectionMaps(_0x18361b);return{'rootFolderId':_0x571cfa,'folderPathToId':_0x5e7408,'folderIdToPath':_0x4945b9,'segmentNameToId':_0xfbd8e3,'activationsBySegmentId':_0x5c97ed,'emailToIdMap':_0x3bf266,'idToEmailMap':_0x8f756e,'connectionNameToIdMap':_0x40442d[_0x5c0bcb(0x277)],'connectionIdToNameMap':_0x40442d[_0x5c0bcb(0x220)],'connectionNameToTypeMap':_0x40442d[_0x5c0bcb(0x2ca)]};}export function createPushYamlContextForBundle(_0x3b605f,_0x550521,_0x105c68,_0x23c940,_0x4126c2,_0x497df1,_0x10ccc8,_0x309990){const {existingLocalSegmentNames:_0x119dbf,localExpandedRuleToNames:_0xda143c}=_0x23c940,_0x21ab0d=new Set(),_0x30de2f=new Map(),_0x95c53b=new Map(),_0x4573f3=new Map(),_0x332ace=createJumpTargetCache(),_0x50600f=new Map(),_0x4d4dd8=new Map(),_0x3817f2=new Set();let _0x37bd85;const _0x37765f=_0x16bbc6=>{const _0x3e8417={'resolveSegment':async _0x35cdf5=>{const _0x3e2f5d=a127_0x9b56,_0x1eebf7=_0x4573f3[_0x3e2f5d(0x228)](_0x35cdf5);if(_0x1eebf7!==undefined)return{'name':_0x1eebf7,'isJourneyLocal':!![]};try{const _0x427530=await fetchSegment(_0x3b605f,_0x550521,_0x35cdf5,_0x105c68);if(!_0x427530)throw new Error('Segment\x20not\x20found');const _0x2d54d9=generateJourneyLocalName(_0x427530['name']),_0x543726=_0x427530['kind']===SEGMENT_KIND_JOURNEY&&_0x2d54d9!==undefined;let _0x4e8f95=_0x427530[_0x3e2f5d(0x23d)],_0x12b4a6;if(_0x543726&&_0x427530['rule']){const _0x303047=apiRuleToYaml(_0x427530[_0x3e2f5d(0x2c9)]);_0x4d4dd8[_0x3e2f5d(0x258)](_0x35cdf5,_0x303047);const _0x183b25=async _0x4886ae=>{const _0x3fa834=_0x3e2f5d,_0x50311b=collectSegmentRefsFromRule(_0x4886ae);for(const _0x2f4e8c of _0x50311b){if(!_0x4d4dd8[_0x3fa834(0x28d)](_0x2f4e8c))try{const _0x46f73e=await fetchSegment(_0x3b605f,_0x550521,_0x2f4e8c,_0x105c68);if(_0x46f73e?.['rule']){const _0x2590e6=apiRuleToYaml(_0x46f73e[_0x3fa834(0x2c9)]);_0x4d4dd8[_0x3fa834(0x258)](_0x2f4e8c,_0x2590e6),await _0x183b25(_0x2590e6);}}catch(_0x4d09ce){logger[_0x3fa834(0x27b)](_0x3fa834(0x2a5)+_0x2f4e8c+':\x20'+_0x4d09ce);}}};await _0x183b25(_0x303047);const _0x34033a=serializeExpandedRule(_0x303047,_0x4d4dd8),_0x31935a=_0xda143c[_0x3e2f5d(0x228)](_0x34033a);if(_0x31935a&&_0x31935a[_0x3e2f5d(0x215)]>0x0){const _0x304748=_0x30de2f[_0x3e2f5d(0x228)](_0x34033a)||0x0,_0x590bde=_0x31935a[_0x304748]||_0x31935a[_0x31935a[_0x3e2f5d(0x215)]-0x1];_0x30de2f[_0x3e2f5d(0x258)](_0x34033a,_0x304748+0x1),_0x4e8f95=_0x590bde,_0x21ab0d['add'](_0x4e8f95),_0x4573f3[_0x3e2f5d(0x258)](_0x35cdf5,_0x4e8f95);const _0x2781b0=await resolveRuleSegmentRefs(_0x303047,async _0x40087c=>{const _0x357f43=_0x4573f3['get'](_0x40087c);if(_0x357f43)return _0x357f43;const _0x23e4f7=await _0x37bd85['resolveSegment'](_0x40087c);return _0x23e4f7['name'];});_0x12b4a6={'description':_0x427530[_0x3e2f5d(0x26f)],'rule':_0x2781b0};}else{const _0x4f3efc=_0x50600f[_0x3e2f5d(0x228)](_0x34033a);if(_0x4f3efc)_0x4e8f95=_0x4f3efc,_0x4573f3[_0x3e2f5d(0x258)](_0x35cdf5,_0x4e8f95);else{if(_0x2d54d9){let _0x7d239d=_0x2d54d9,_0x4118f7=0x2;while(_0x21ab0d['has'](_0x7d239d)||_0x119dbf[_0x3e2f5d(0x28d)](_0x7d239d)){_0x7d239d=_0x2d54d9+'_'+_0x4118f7,_0x4118f7++;}_0x21ab0d['add'](_0x7d239d),_0x4e8f95=_0x7d239d;}_0x4573f3[_0x3e2f5d(0x258)](_0x35cdf5,_0x4e8f95),_0x50600f['set'](_0x34033a,_0x4e8f95);const _0x566d1e=await resolveRuleSegmentRefs(_0x303047,async _0x40b156=>{const _0x10096a=_0x3e2f5d,_0x1ffa18=_0x4573f3['get'](_0x40b156);if(_0x1ffa18)return _0x1ffa18;const _0x517717=await _0x37bd85['resolveSegment'](_0x40b156);return _0x517717[_0x10096a(0x23d)];});_0x12b4a6={'description':_0x427530[_0x3e2f5d(0x26f)],'rule':_0x566d1e};}}}return{'name':_0x4e8f95,'isJourneyLocal':_0x543726,'definition':_0x12b4a6};}catch(_0x4ad834){return logger[_0x3e2f5d(0x27b)](_0x3e2f5d(0x2e2)+_0x35cdf5+':\x20'+_0x4ad834),{'name':_0x35cdf5,'isJourneyLocal':![]};}},'resolveActivation':async _0x221ace=>{const _0x1359e0=a127_0x9b56,_0x384700=_0x95c53b[_0x1359e0(0x228)](_0x221ace);if(_0x384700!==undefined)return{'name':_0x384700,'isJourneyLocal':!![]};try{let _0x1fa593=_0x10ccc8?.[_0x1359e0(0x228)](_0x221ace);!_0x1fa593&&(_0x1fa593=await _0x3b605f[_0x1359e0(0x22e)][_0x1359e0(0x2d5)](_0x16bbc6,_0x221ace));const _0x362078=_0x1fa593[_0x1359e0(0x26e)][_0x1359e0(0x2d9)][_0x1359e0(0x23d)]||_0x221ace,_0x1077f7=sanitizeYamlKey(_0x362078)||_0x1359e0(0x251)+_0x221ace,_0x2a6909=_0x1077f7;_0x95c53b['set'](_0x221ace,_0x2a6909);const _0x42db20=journeyActivationStepToYaml(_0x1fa593,_0x4126c2,_0x497df1);return{'name':_0x2a6909,'isJourneyLocal':!![],'definition':_0x42db20};}catch(_0x46628d){return logger['debug']('Failed\x20to\x20resolve\x20activation\x20'+_0x221ace+':\x20'+_0x46628d),{'name':_0x221ace,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x281bec,_0x288ecd)=>resolveJumpTarget(_0x281bec,_0x288ecd,_0x332ace,async _0x6c4838=>{const _0x349476=a127_0x9b56,_0x54058a=_0x309990?.[_0x349476(0x228)](_0x6c4838);if(_0x54058a)return _0x54058a;return _0x3b605f[_0x349476(0x22e)]['getJourney'](_0x6c4838);})};return _0x37bd85=_0x3e8417,_0x3e8417;},_0xd7dc3c=async _0x3e116d=>{const _0x37ec83=a127_0x9b56,{collectSegmentIdsFromJourneyApi:_0x3966ff}=await import(_0x37ec83(0x2dd)),{batchAsync:_0x43bd63}=await import(_0x37ec83(0x273)),_0x2c3f45=new Set();for(const _0x3e50d2 of _0x3e116d){let _0x4aa5a3=_0x309990?.[_0x37ec83(0x228)](_0x3e50d2);!_0x4aa5a3&&(_0x4aa5a3=await _0x3b605f['journey'][_0x37ec83(0x296)](_0x3e50d2));const _0x1e119d=_0x3966ff(_0x4aa5a3);for(const _0xf588b5 of _0x1e119d){_0x2c3f45[_0x37ec83(0x2c6)](_0xf588b5);}}let _0x4e3f3a=Array[_0x37ec83(0x270)](_0x2c3f45);while(_0x4e3f3a[_0x37ec83(0x215)]>0x0){const _0x38a3a2=_0x4e3f3a['filter'](_0x24d767=>!_0x3817f2[_0x37ec83(0x28d)](_0x24d767));if(_0x38a3a2[_0x37ec83(0x215)]===0x0)break;const _0x5ab76e=await _0x43bd63(_0x38a3a2,async _0x2c4481=>{const _0x30425f=_0x37ec83;_0x3817f2[_0x30425f(0x2c6)](_0x2c4481);const _0x37bccc=await fetchSegment(_0x3b605f,_0x550521,_0x2c4481,_0x105c68);if(!_0x37bccc)return null;return{'segmentId':_0x2c4481,'segment':_0x37bccc};},0xa),_0x4566e1=new Set();for(const _0x5b0664 of _0x5ab76e){if(!_0x5b0664?.[_0x37ec83(0x289)]?.[_0x37ec83(0x2c9)])continue;const _0x482aa8=apiRuleToYaml(_0x5b0664['segment'][_0x37ec83(0x2c9)]);_0x4d4dd8[_0x37ec83(0x258)](_0x5b0664[_0x37ec83(0x209)],_0x482aa8);const _0x5acc17=collectSegmentRefsFromRule(_0x482aa8);for(const _0xe948d8 of _0x5acc17){!_0x3817f2[_0x37ec83(0x28d)](_0xe948d8)&&_0x4566e1[_0x37ec83(0x2c6)](_0xe948d8);}}_0x4e3f3a=Array[_0x37ec83(0x270)](_0x4566e1);}};return{'createYamlContext':_0x37765f,'prefetchJourneySegments':_0xd7dc3c};}export async function executePushSegments(_0x19a34e,_0x191957,_0x217fb1,_0x3e432b,_0x461333){const _0x2176ee=a127_0x1b45a8,{segmentDefToCreateRequest:_0x32b6ea,segmentDefToUpdateRequest:_0x621442}=await import(_0x2176ee(0x27c)),_0x557066=_0x217fb1[_0x2176ee(0x21d)],_0x247c6a=0x5,_0x3f8ab0=async _0x30bd96=>{const _0x5076e2=_0x2176ee,_0x369a85=_0x30bd96['folderPath']?_0x557066['get'](_0x30bd96['folderPath']):undefined;let _0x20f47c;const _0x12d3eb={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x30bd96[_0x5076e2(0x2b3)]){_0x461333['onProgress']?.({'type':_0x5076e2(0x2dc),'name':_0x30bd96['yamlConfig'][_0x5076e2(0x23d)]});const _0x389970=_0x32b6ea(_0x30bd96[_0x5076e2(0x2ab)],_0x369a85),_0x3feb6a=await _0x461333['withProgress'](_0x5076e2(0x1fd)+_0x30bd96['yamlConfig']['name']+'\x27...',()=>_0x19a34e[_0x5076e2(0x289)][_0x5076e2(0x266)](_0x3e432b[_0x5076e2(0x203)],_0x389970));_0x20f47c=_0x3feb6a[_0x5076e2(0x24f)]['id'],_0x12d3eb[_0x5076e2(0x1ed)]={'name':_0x30bd96['yamlConfig'][_0x5076e2(0x23d)],'id':_0x20f47c},_0x461333[_0x5076e2(0x279)]?.({'type':_0x5076e2(0x204),'name':_0x30bd96[_0x5076e2(0x2ab)][_0x5076e2(0x23d)],'segmentId':_0x20f47c}),_0x461333[_0x5076e2(0x2c2)]?.('Created\x20segment\x20\x27'+_0x30bd96[_0x5076e2(0x2ab)][_0x5076e2(0x23d)]+'\x27'),_0x12d3eb['created']=0x1;}else{if(_0x30bd96[_0x5076e2(0x21c)]){_0x461333[_0x5076e2(0x279)]?.({'type':'segment_updating','name':_0x30bd96[_0x5076e2(0x2ab)][_0x5076e2(0x23d)]});const _0x1bb95b=_0x621442(_0x30bd96[_0x5076e2(0x2ab)]);_0x369a85!==_0x30bd96[_0x5076e2(0x1ea)]?.['segmentFolderId']&&(_0x1bb95b[_0x5076e2(0x25d)]=_0x369a85?parseInt(_0x369a85,0xa):undefined),await _0x461333[_0x5076e2(0x20c)](_0x5076e2(0x299)+_0x30bd96[_0x5076e2(0x2ab)][_0x5076e2(0x23d)]+_0x5076e2(0x1f3),()=>_0x19a34e[_0x5076e2(0x289)][_0x5076e2(0x219)](_0x3e432b['parentId'],_0x30bd96[_0x5076e2(0x1ea)]['id'],_0x1bb95b)),_0x20f47c=_0x30bd96[_0x5076e2(0x1ea)]['id'],_0x461333[_0x5076e2(0x279)]?.({'type':_0x5076e2(0x25f),'name':_0x30bd96[_0x5076e2(0x2ab)][_0x5076e2(0x23d)]}),_0x461333[_0x5076e2(0x2c2)]?.('Updated\x20segment\x20\x27'+_0x30bd96[_0x5076e2(0x2ab)][_0x5076e2(0x23d)]+'\x27'),_0x12d3eb[_0x5076e2(0x2da)]=0x1;}else _0x20f47c=_0x30bd96[_0x5076e2(0x1ea)]['id'];}}catch(_0x186c11){const _0x11e783=isHttp400Error(_0x186c11),_0x545c54=_0x11e783?ErrorCode[_0x5076e2(0x27d)]:ErrorCode[_0x5076e2(0x206)],_0x2265b5=getErrorMessage(_0x186c11);throw new SDKError(_0x545c54,_0x5076e2(0x2b6)+(_0x30bd96[_0x5076e2(0x2b3)]?_0x5076e2(0x22b):_0x5076e2(0x210))+_0x5076e2(0x253)+_0x30bd96[_0x5076e2(0x2ac)]+'\x0a\x20\x20'+_0x2265b5,_0x186c11);}try{const _0x3f274d=await syncActivationsForSegment(_0x19a34e,_0x3e432b[_0x5076e2(0x203)],_0x20f47c,_0x30bd96[_0x5076e2(0x2ab)][_0x5076e2(0x23d)],_0x30bd96[_0x5076e2(0x292)],_0x461333,_0x30bd96[_0x5076e2(0x2ac)]);_0x12d3eb['activations']=_0x3f274d;}catch(_0x245424){if(_0x245424 instanceof SDKError)throw _0x245424;throw new SDKError(ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x5076e2(0x232)+_0x30bd96['yamlConfig']['name']+_0x5076e2(0x2b1)+_0x30bd96[_0x5076e2(0x2ac)]+'\x0a\x20\x20'+getErrorMessage(_0x245424),_0x245424);}return _0x12d3eb;},_0x5e9b4e=await batchAsync(_0x191957,_0x3f8ab0,_0x247c6a),_0x175f64={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x2535ec of _0x5e9b4e){_0x175f64['created']+=_0x2535ec[_0x2176ee(0x262)],_0x175f64[_0x2176ee(0x2da)]+=_0x2535ec[_0x2176ee(0x2da)],_0x2535ec['createdSegmentId']&&_0x175f64[_0x2176ee(0x282)]['set'](_0x2535ec['createdSegmentId'][_0x2176ee(0x23d)],_0x2535ec[_0x2176ee(0x1ed)]['id']),_0x175f64['activations']['created']+=_0x2535ec[_0x2176ee(0x24c)]['created'],_0x175f64[_0x2176ee(0x24c)][_0x2176ee(0x2da)]+=_0x2535ec[_0x2176ee(0x24c)][_0x2176ee(0x2da)],_0x175f64['activations'][_0x2176ee(0x1f1)]+=_0x2535ec['activations'][_0x2176ee(0x1f1)];}return _0x175f64;}async function syncActivationsForSegment(_0x15fa00,_0x28c2d9,_0x39fc48,_0xe4117a,_0xb1f411,_0xf5f9d3,_0x1910af){const _0x4336e8=a127_0x1b45a8,_0x51a7ec={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x19687c of _0xb1f411){try{if(_0x19687c[_0x4336e8(0x2e6)]===_0x4336e8(0x22b)&&_0x19687c[_0x4336e8(0x240)])_0xf5f9d3[_0x4336e8(0x279)]?.({'type':'activation_creating','segmentName':_0xe4117a,'activationName':_0x19687c[_0x4336e8(0x23d)]}),await _0xf5f9d3[_0x4336e8(0x20c)]('Creating\x20activation\x20\x27'+_0x19687c[_0x4336e8(0x23d)]+_0x4336e8(0x1f3),()=>_0x15fa00[_0x4336e8(0x289)]['createActivation'](_0x28c2d9,_0x39fc48,_0x19687c['validatedRequest'])),_0xf5f9d3[_0x4336e8(0x279)]?.({'type':_0x4336e8(0x27a),'segmentName':_0xe4117a,'activationName':_0x19687c['name']}),_0xf5f9d3[_0x4336e8(0x2c2)]?.(_0x4336e8(0x2ea)+_0x19687c[_0x4336e8(0x23d)]+'\x27'),_0x51a7ec[_0x4336e8(0x262)]++;else{if(_0x19687c[_0x4336e8(0x2e6)]===_0x4336e8(0x210)&&_0x19687c['validatedRequest']&&_0x19687c[_0x4336e8(0x2bf)])_0xf5f9d3[_0x4336e8(0x279)]?.({'type':_0x4336e8(0x243),'segmentName':_0xe4117a,'activationName':_0x19687c[_0x4336e8(0x23d)]}),await _0xf5f9d3[_0x4336e8(0x20c)](_0x4336e8(0x214)+_0x19687c[_0x4336e8(0x23d)]+'\x27...',()=>_0x15fa00['segment']['updateActivation'](_0x28c2d9,_0x39fc48,_0x19687c[_0x4336e8(0x2bf)]['id'],_0x19687c['validatedRequest'])),_0xf5f9d3['onProgress']?.({'type':'activation_updated','segmentName':_0xe4117a,'activationName':_0x19687c['name']}),_0xf5f9d3['logSuccess']?.('Updated\x20activation\x20\x27'+_0x19687c['name']+'\x27'),_0x51a7ec[_0x4336e8(0x2da)]++;else _0x19687c[_0x4336e8(0x2e6)]==='delete'&&_0x19687c[_0x4336e8(0x2bf)]&&(_0xf5f9d3[_0x4336e8(0x279)]?.({'type':_0x4336e8(0x290),'segmentName':_0xe4117a,'activationName':_0x19687c['name']}),await _0xf5f9d3[_0x4336e8(0x20c)](_0x4336e8(0x2d7)+_0x19687c[_0x4336e8(0x23d)]+'\x27...',()=>_0x15fa00['segment']['deleteActivation'](_0x28c2d9,_0x39fc48,_0x19687c['existingActivation']['id'])),_0xf5f9d3['onProgress']?.({'type':_0x4336e8(0x254),'segmentName':_0xe4117a,'activationName':_0x19687c[_0x4336e8(0x23d)]}),_0xf5f9d3['logDeleted']?.('Deleted\x20activation\x20\x27'+_0x19687c[_0x4336e8(0x23d)]+'\x27'),_0x51a7ec[_0x4336e8(0x1f1)]++);}}catch(_0x30c981){const _0x43b348=isHttp400Error(_0x30c981),_0x411e1e=_0x43b348?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x85f62=getErrorMessage(_0x30c981);throw new SDKError(_0x411e1e,_0x4336e8(0x2b6)+_0x19687c[_0x4336e8(0x2e6)]+_0x4336e8(0x227)+_0x19687c[_0x4336e8(0x23d)]+_0x4336e8(0x2b1)+_0x1910af+_0x4336e8(0x2bd)+_0x85f62,_0x30c981);}}return _0x51a7ec;}export async function executePushFolders(_0x30133d,_0x437f42,_0x2c4add,_0x1c7c53,_0x1284ed){const _0x407d8f=a127_0x1b45a8,_0x1f3831=new Map(_0x2c4add),_0x3141c6=sortFoldersByDepth(_0x437f42);for(const _0x36f06b of _0x3141c6){const _0x35b4d3=_0x36f06b[_0x407d8f(0x208)]('/'),_0x53717e=_0x35b4d3[_0x35b4d3[_0x407d8f(0x215)]-0x1],_0xdadd1d=_0x35b4d3[_0x407d8f(0x25c)](0x0,-0x1)[_0x407d8f(0x265)]('/'),_0x4b8cbf=_0x1f3831[_0x407d8f(0x228)](_0xdadd1d);_0x1284ed['onProgress']?.({'type':_0x407d8f(0x2d1),'folder':_0x36f06b});const _0x56bf12={'name':_0x53717e,'parentFolderId':_0x4b8cbf},_0x5426d1=await _0x1284ed[_0x407d8f(0x20c)](_0x407d8f(0x1f6)+_0x36f06b+_0x407d8f(0x1f3),()=>_0x30133d[_0x407d8f(0x289)][_0x407d8f(0x267)](_0x1c7c53[_0x407d8f(0x203)],_0x56bf12));_0x1f3831[_0x407d8f(0x258)](_0x36f06b,_0x5426d1[_0x407d8f(0x24f)]['id']),_0x1284ed[_0x407d8f(0x279)]?.({'type':_0x407d8f(0x255),'folder':_0x36f06b,'folderId':_0x5426d1['data']['id']}),_0x1284ed[_0x407d8f(0x286)]?.('Created\x20folder\x20\x27'+_0x36f06b+'\x27');}return _0x1f3831;}function a127_0x9b56(_0x2bba07,_0x478d94){_0x2bba07=_0x2bba07-0x1ea;const _0x23ef84=a127_0x23ef();let _0x9b561e=_0x23ef84[_0x2bba07];return _0x9b561e;}export async function executePushSegmentDeletions(_0x340526,_0x4535f5,_0x17cad1){const _0x43fbcf=a127_0x1b45a8;if(_0x4535f5[_0x43fbcf(0x215)]===0x0)return 0x0;const {batchAsync:_0x21c689}=await import(_0x43fbcf(0x273)),_0x60f33c=0x5,_0x112f74=await _0x21c689(_0x4535f5,async _0x15f45b=>{const _0x19d990=_0x43fbcf;return _0x17cad1['onProgress']?.({'type':_0x19d990(0x288),'name':_0x15f45b[_0x19d990(0x23d)]}),await _0x340526['segment']['deleteSegment'](_0x15f45b['id']),_0x17cad1['onProgress']?.({'type':_0x19d990(0x2a9),'name':_0x15f45b[_0x19d990(0x23d)]}),_0x17cad1['logDeleted']?.('Deleted\x20segment\x20\x27'+_0x15f45b[_0x19d990(0x23d)]+'\x27'),0x1;},_0x60f33c);return _0x112f74[_0x43fbcf(0x271)]((_0x2d1521,_0x1c362d)=>_0x2d1521+_0x1c362d,0x0);}export async function executePushJourneys(_0x56c716,_0x9fb81c,_0x594ce5,_0x354178,_0x528503){const _0x5d9406=a127_0x1b45a8,{journeyDefToRequest:_0x1b9dc2}=await import('./journey-yaml.js'),{activationDefToCreateRequest:_0x3b8545,yamlRuleToApi:_0x41f335,validateSegmentRule:_0x18e880}=await import(_0x5d9406(0x27c)),_0x390553={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x5f36e7=new Map(_0x594ce5[_0x5d9406(0x21a)]),_0x2416e0=0x5;for(let _0x1aee6c=0x0;_0x1aee6c<_0x9fb81c['length'];_0x1aee6c+=_0x2416e0){const _0x5cc192=_0x9fb81c['slice'](_0x1aee6c,_0x1aee6c+_0x2416e0),_0x52df58=await Promise[_0x5d9406(0x231)](_0x5cc192[_0x5d9406(0x2aa)](async _0xb2fe5e=>{const _0x461b9e=_0x5d9406;if(!_0xb2fe5e['isNew']&&!_0xb2fe5e[_0x461b9e(0x21c)])return{'action':_0x461b9e(0x2e7),'name':_0xb2fe5e['yamlConfig'][_0x461b9e(0x23d)],'journeyId':_0xb2fe5e['existingJourney']?.['id']};const _0x328d54=_0xb2fe5e['folderPath']?_0x594ce5[_0x461b9e(0x21d)][_0x461b9e(0x228)](_0xb2fe5e['folderPath']):undefined;_0x528503[_0x461b9e(0x279)]?.({'type':_0xb2fe5e['isNew']?_0x461b9e(0x22c):_0x461b9e(0x1ec),'name':_0xb2fe5e['yamlConfig'][_0x461b9e(0x23d)]});try{const _0x5003de=await executeSingleJourneyPush(_0x56c716,_0xb2fe5e,{..._0x594ce5,'segmentNameToId':_0x5f36e7},{'parentId':_0x354178[_0x461b9e(0x203)],'rootFolderId':_0x354178[_0x461b9e(0x261)],'folderId':_0x328d54,'verbose':_0x354178[_0x461b9e(0x29a)]},_0x528503,{'journeyDefToRequest':_0x1b9dc2,'activationDefToCreateRequest':_0x3b8545,'yamlRuleToApi':_0x41f335,'validateSegmentRule':_0x18e880});for(const [_0x19c8e3,_0x28a0eb]of _0x5003de['embeddedSegmentNameToId']){_0x5f36e7[_0x461b9e(0x258)](_0x19c8e3,_0x28a0eb),_0x390553[_0x461b9e(0x2a7)][_0x461b9e(0x258)](_0x19c8e3,_0x28a0eb);}if(_0x5003de[_0x461b9e(0x20f)]==='created')_0x528503[_0x461b9e(0x279)]?.({'type':_0x461b9e(0x2b0),'name':_0xb2fe5e['yamlConfig'][_0x461b9e(0x23d)],'journeyId':_0x5003de[_0x461b9e(0x29e)]}),_0x528503[_0x461b9e(0x2c2)]?.('Created\x20journey\x20\x27'+_0xb2fe5e['yamlConfig'][_0x461b9e(0x23d)]+'\x27'),_0x390553[_0x461b9e(0x262)]++;else _0x5003de[_0x461b9e(0x20f)]===_0x461b9e(0x2da)&&(_0x528503['onProgress']?.({'type':_0x461b9e(0x241),'name':_0xb2fe5e['yamlConfig'][_0x461b9e(0x23d)]}),_0x528503[_0x461b9e(0x2c2)]?.('Updated\x20journey\x20\x27'+_0xb2fe5e[_0x461b9e(0x2ab)]['name']+'\x27'),_0x390553[_0x461b9e(0x2da)]++);return{'action':_0x5003de[_0x461b9e(0x20f)],'name':_0xb2fe5e[_0x461b9e(0x2ab)]['name'],'journeyId':_0x5003de[_0x461b9e(0x29e)]};}catch(_0x5ee379){const _0x52aed2=isHttp400Error(_0x5ee379),_0x2c5b42=_0x52aed2?ErrorCode[_0x461b9e(0x284)]:ErrorCode[_0x461b9e(0x205)],_0x3f9516=getErrorMessage(_0x5ee379);throw new SDKError(_0x2c5b42,_0x461b9e(0x2b6)+(_0xb2fe5e[_0x461b9e(0x2b3)]?_0x461b9e(0x22b):_0x461b9e(0x210))+_0x461b9e(0x23a)+_0xb2fe5e[_0x461b9e(0x2ac)]+_0x461b9e(0x2bd)+_0x3f9516,_0x5ee379);}}));_0x390553[_0x5d9406(0x2ba)][_0x5d9406(0x23e)](..._0x52df58);}return _0x390553;}async function matchExistingJourneySegments(_0x2e4259,_0x4404a5,_0x40eb51,_0x2b3dc4,_0x54da99){const _0xa4a488=a127_0x1b45a8;if(!_0x4404a5[_0xa4a488(0x2a4)]||!_0x4404a5[_0xa4a488(0x2ab)][_0xa4a488(0x225)])return;const _0x258b88=new Map(),_0x3c2c67=new Set();for(const _0x318a5c of Object[_0xa4a488(0x1f7)](_0x4404a5[_0xa4a488(0x2ab)][_0xa4a488(0x225)])){const _0x146e31=generateDeterministicJourneySegmentName(_0x4404a5[_0xa4a488(0x2ab)][_0xa4a488(0x23d)],_0x318a5c);_0x258b88[_0xa4a488(0x258)](_0x146e31,_0x318a5c),_0x3c2c67[_0xa4a488(0x2c6)](_0x318a5c);}const _0x431140=[],_0x2d994f=collectSegmentIdsFromJourneyApi(_0x4404a5[_0xa4a488(0x2a4)]);for(const _0x180fa5 of _0x2d994f){const _0x2b0a7d=await fetchSegment(_0x2e4259,_0x40eb51,_0x180fa5,_0x2b3dc4);if(!_0x2b0a7d?.[_0xa4a488(0x23d)])continue;const _0xee5dcf=_0x258b88['get'](_0x2b0a7d['name']);_0xee5dcf?(_0x54da99[_0xa4a488(0x258)](_0xee5dcf,_0x180fa5),_0x3c2c67[_0xa4a488(0x213)](_0xee5dcf)):_0x431140[_0xa4a488(0x23e)]({'id':_0x180fa5,'seg':_0x2b0a7d});}if(_0x3c2c67[_0xa4a488(0x22d)]>0x0&&_0x431140[_0xa4a488(0x215)]>0x0){const {localExpandedRuleToNames:_0x578b6f}=buildLocalExpandedRuleMappings(_0x4404a5['yamlConfig']),_0xd3c7a3=new Map();for(const {id:_0xc40e2e,seg:_0xed8e15}of _0x431140){if(_0xed8e15['rule']){const _0x1a4f2a=apiRuleToYaml(_0xed8e15['rule']);_0xd3c7a3[_0xa4a488(0x258)](_0xc40e2e,_0x1a4f2a);}}for(const {id:_0x497179,seg:_0x56ea33}of _0x431140){if(!_0x56ea33['rule'])continue;const _0x5b131b=_0xd3c7a3[_0xa4a488(0x228)](_0x497179);if(!_0x5b131b)continue;const _0x265caa=serializeExpandedRule(_0x5b131b,_0xd3c7a3),_0x25a03c=_0x578b6f[_0xa4a488(0x228)](_0x265caa);if(_0x25a03c){const _0x30ff99=_0x25a03c['find'](_0x3d51be=>_0x3c2c67[_0xa4a488(0x28d)](_0x3d51be));_0x30ff99&&(_0x54da99[_0xa4a488(0x258)](_0x30ff99,_0x497179),_0x3c2c67['delete'](_0x30ff99),logger[_0xa4a488(0x27b)](_0xa4a488(0x237)+_0x56ea33[_0xa4a488(0x23d)]+'\x27\x20to\x20local\x20\x27'+_0x30ff99+_0xa4a488(0x246)));}}}}async function executeSingleJourneyPush(_0x5d9332,_0x23bc2e,_0x250930,_0x12613c,_0x160a6d,_0x10de19){const _0x14b659=a127_0x1b45a8,{journeyDefToRequest:_0x303618,activationDefToCreateRequest:_0x44fc54,yamlRuleToApi:_0x3f9b88,validateSegmentRule:_0x42bd83}=_0x10de19,_0x5e7ee4=new Map(),_0x516720=new Map();recoverSegmentIdsFromPushRecovery(_0x23bc2e,_0x5e7ee4,_0x250930[_0x14b659(0x21a)]);const _0xf122a4=new Map(),_0x4d7986=new Map(),_0x15349c=new Map();let _0x2eab80;const _0x8dcb38=async()=>{const _0x368416=_0x14b659;if(_0x2eab80)return;_0x2eab80=new Map();if(!_0x23bc2e[_0x368416(0x2a4)])return;const _0x4815d4=await _0x5d9332['journey'][_0x368416(0x2b8)](_0x23bc2e['existingJourney']['id']);for(const _0x1141b1 of _0x4815d4){const _0x4ea75a=journeyActivationStepToYaml(_0x1141b1,_0x250930[_0x368416(0x27f)],_0x250930['connectionIdToNameMap']),_0x2dba25=activationSignature(_0x4ea75a);!_0x2eab80[_0x368416(0x28d)](_0x2dba25)&&_0x2eab80[_0x368416(0x258)](_0x2dba25,_0x1141b1['id']),_0x4ea75a[_0x368416(0x23d)]&&_0x516720[_0x368416(0x258)](_0x4ea75a[_0x368416(0x23d)],_0x1141b1['id']);}};await matchExistingJourneySegments(_0x5d9332,_0x23bc2e,_0x12613c[_0x14b659(0x203)],_0x250930['existingSegments'],_0x250930['segmentNameToId']);const _0x197b62={'resolveSegmentId':async _0x1c57f7=>{const _0x390156=_0x14b659,_0x2df49f=_0x250930[_0x390156(0x21a)]['get'](_0x1c57f7);if(!_0x2df49f)throw new SDKError(ErrorCode[_0x390156(0x257)],_0x390156(0x1ef)+_0x1c57f7+_0x390156(0x274)+_0x23bc2e['yamlConfig'][_0x390156(0x23d)]+')');return _0x2df49f;},'resolveEmbeddedSegmentId':async(_0x2be8e6,_0x58c2fe)=>{const _0x3cf392=_0x14b659,_0xcba600=_0x250930[_0x3cf392(0x21a)][_0x3cf392(0x228)](_0x2be8e6);if(_0xcba600)return _0xcba600;const _0x3568f4=_0x250930[_0x3cf392(0x2b9)][_0x3cf392(0x25e)](_0x529fd7=>_0x529fd7[_0x3cf392(0x23d)]===_0x2be8e6);if(_0x3568f4)return _0x250930[_0x3cf392(0x21a)]['set'](_0x2be8e6,_0x3568f4['id']),_0x3568f4['id'];if(_0x23bc2e[_0x3cf392(0x2b3)]){const {stageName:_0x3c6a14,criteriaName:_0x530226}=findSegmentCriteriaLocation(_0x23bc2e['yamlConfig'],_0x2be8e6);return _0x42bd83(_0x2be8e6,_0x58c2fe[_0x3cf392(0x2c9)]),_0x4d7986[_0x3cf392(0x258)](_0x2be8e6,{'definition':_0x58c2fe,'stageName':_0x3c6a14,'criteriaName':_0x530226}),createPendingSegmentId(_0x2be8e6);}const _0x3b86c6=_0x23bc2e['existingJourney']?.['id'];if(!_0x3b86c6)throw new SDKError(ErrorCode[_0x3cf392(0x1f8)],_0x3cf392(0x2a1));const _0xbc60d0=_0xf122a4['get'](_0x2be8e6);if(_0xbc60d0)return _0xbc60d0;const _0x1d1a20=((async()=>{const _0x26062f=_0x3cf392;_0x42bd83(_0x2be8e6,_0x58c2fe[_0x26062f(0x2c9)]);const _0x5aa96b=generateDeterministicJourneySegmentName(_0x23bc2e['yamlConfig'][_0x26062f(0x23d)],_0x2be8e6),_0x1f736d=_0x250930['existingSegments'][_0x26062f(0x25e)](_0x363f2a=>_0x363f2a['name']===_0x5aa96b),_0x56fd53=createSegmentIdResolver(_0x250930[_0x26062f(0x21a)],_0x2be8e6),_0x30d489=await resolveRuleSegmentIds(_0x58c2fe[_0x26062f(0x2c9)],_0x56fd53);let _0xf7c424;return _0x1f736d?(await _0x5d9332[_0x26062f(0x289)][_0x26062f(0x219)](_0x12613c['parentId'],_0x1f736d['id'],{'description':_0x58c2fe[_0x26062f(0x26f)]||'Entry\x20criteria:\x20'+_0x2be8e6,'rule':_0x3f9b88(_0x30d489,!![]),'countPopulation':!![]}),_0xf7c424=_0x1f736d['id'],saveSegmentToPushRecovery(_0x23bc2e['absolutePath'],_0x23bc2e[_0x26062f(0x2ab)][_0x26062f(0x23d)],_0x2be8e6,{'segmentId':_0xf7c424,'uniqueServerName':_0x5aa96b,'createdAt':new Date()[_0x26062f(0x291)]()})):_0xf7c424=await createOrRecoverEmbeddedSegment(_0x5d9332,_0x23bc2e,{'localName':_0x2be8e6,'uniqueSegmentName':_0x5aa96b,'description':_0x58c2fe['description']||_0x26062f(0x21f)+_0x2be8e6,'journeyId':_0x3b86c6,'resolvedRule':_0x30d489,'parentId':_0x12613c['parentId'],'folderId':_0x12613c['rootFolderId']||''},_0x3f9b88),_0x250930['segmentNameToId'][_0x26062f(0x258)](_0x2be8e6,_0xf7c424),_0x5e7ee4[_0x26062f(0x258)](_0x2be8e6,_0xf7c424),_0xf7c424;})());_0xf122a4['set'](_0x2be8e6,_0x1d1a20);try{return await _0x1d1a20;}finally{_0xf122a4[_0x3cf392(0x213)](_0x2be8e6);}},'resolveActivationId':async _0x431d0e=>{const _0x242f63=_0x14b659,_0x393bbe=_0x516720[_0x242f63(0x228)](_0x431d0e);if(_0x393bbe)return _0x393bbe;if(_0x23bc2e[_0x242f63(0x2a4)]){await _0x8dcb38();const _0x2b4924=_0x516720['get'](_0x431d0e);if(_0x2b4924)return _0x2b4924;}throw new SDKError(ErrorCode[_0x242f63(0x2c4)],_0x242f63(0x2d6)+_0x431d0e+_0x242f63(0x274)+_0x23bc2e['yamlConfig'][_0x242f63(0x23d)]+').\x20'+'Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.');},'resolveEmbeddedActivationId':async(_0x21b9af,_0x2d0fee)=>{const _0x5324e5=_0x14b659,_0x500279=_0x516720[_0x5324e5(0x228)](_0x21b9af);if(_0x500279)return _0x500279;if(_0x23bc2e[_0x5324e5(0x2b3)])return _0x15349c['set'](_0x21b9af,_0x2d0fee),createPendingActivationId(_0x21b9af);if(_0x23bc2e['existingJourney']){await _0x8dcb38();const _0x2abff7=_0x516720[_0x5324e5(0x228)](_0x2d0fee['name']);if(_0x2abff7)return _0x516720['set'](_0x21b9af,_0x2abff7),_0x2abff7;const _0x15fe8c=activationSignature(_0x2d0fee),_0x4f8806=_0x2eab80?.['get'](_0x15fe8c);if(_0x4f8806)return _0x516720[_0x5324e5(0x258)](_0x21b9af,_0x4f8806),_0x4f8806;const _0x2bdc00=await _0x44fc54(_0x2d0fee,_0x250930[_0x5324e5(0x1fc)]),_0x5bc9c7={..._0x2bdc00,..._0x2d0fee[_0x5324e5(0x1fb)]!==undefined&&{'runAfterJourneyRefresh':_0x2d0fee[_0x5324e5(0x1fb)]}},_0x2a6641=await _0x5d9332[_0x5324e5(0x22e)]['createActivation'](_0x23bc2e[_0x5324e5(0x2a4)]['id'],_0x5bc9c7);return _0x516720[_0x5324e5(0x258)](_0x21b9af,_0x2a6641['id']),_0x2a6641['id'];}throw new SDKError(ErrorCode['INTERNAL'],_0x5324e5(0x2e8));},'resolveJourneyId':async _0x21f4f8=>{const _0x1e9839=_0x14b659;try{return await _0x5d9332[_0x1e9839(0x22e)][_0x1e9839(0x1fa)](_0x12613c[_0x1e9839(0x203)],_0x21f4f8);}catch(_0x268d27){throw new SDKError(ErrorCode[_0x1e9839(0x2c4)],_0x1e9839(0x264)+_0x21f4f8+'\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27'+_0x23bc2e['yamlConfig']['name']+'\x27)',_0x268d27);}},'resolveStageId':async(_0x12f058,_0x5d316f)=>{const _0x449a9c=_0x14b659,_0x3c9407=await _0x5d9332['journey'][_0x449a9c(0x296)](_0x12f058),_0x3fac21=_0x3c9407[_0x449a9c(0x26e)]['journeyStages'][_0x449a9c(0x25e)](_0x295100=>_0x295100[_0x449a9c(0x23d)]['toLowerCase']()===_0x5d316f[_0x449a9c(0x250)]());if(!_0x3fac21?.['id'])throw new SDKError(ErrorCode['NOT_FOUND'],'Stage\x20\x27'+_0x5d316f+'\x27\x20not\x20found\x20in\x20journey\x20\x27'+(_0x3c9407[_0x449a9c(0x26e)][_0x449a9c(0x26a)]||_0x3c9407[_0x449a9c(0x26e)][_0x449a9c(0x23d)])+'\x27');return _0x3fac21['id'];}},_0x5d3ad3=await _0x303618(_0x23bc2e[_0x14b659(0x2ab)],_0x12613c[_0x14b659(0x203)],_0x197b62),_0x1820d2=_0x12613c['folderId']||_0x12613c[_0x14b659(0x261)];_0x1820d2&&(_0x5d3ad3[_0x14b659(0x297)]={'parentFolder':{'data':{'id':_0x1820d2,'type':_0x14b659(0x2e1)}}});if(_0x23bc2e['isNew']){if(_0x4d7986[_0x14b659(0x22d)]>0x0||_0x15349c[_0x14b659(0x22d)]>0x0)return await executeThreeStepJourneyCreate(_0x5d9332,_0x23bc2e,_0x5d3ad3,{'pendingEmbeddedSegments':_0x4d7986,'pendingEmbeddedActivations':_0x15349c,'embeddedSegmentNameToId':_0x5e7ee4,'journeyActivationNameToId':_0x516720},{..._0x12613c,'effectiveFolderId':_0x1820d2},_0x250930,_0x160a6d,_0x10de19);else{ensureJourneyDefaults(_0x5d3ad3[_0x14b659(0x26e)]);const _0x6d5c75=await _0x5d9332[_0x14b659(0x22e)]['create'](_0x5d3ad3);return deletePushRecovery(_0x23bc2e[_0x14b659(0x2ac)]),{'action':_0x14b659(0x262),'journeyId':_0x6d5c75['id'],'embeddedSegmentNameToId':_0x5e7ee4};}}else{if(_0x23bc2e[_0x14b659(0x21c)]&&_0x23bc2e[_0x14b659(0x2a4)]){_0x5d3ad3['id']=_0x23bc2e['existingJourney']['id'];const _0x48fe02=_0x5d3ad3['attributes'];_0x23bc2e[_0x14b659(0x2a4)]['attributes']?.[_0x14b659(0x26a)]&&(_0x48fe02[_0x14b659(0x26a)]=_0x23bc2e['existingJourney'][_0x14b659(0x26e)][_0x14b659(0x26a)]);const _0x3c0140=_0x23bc2e[_0x14b659(0x2a4)][_0x14b659(0x26e)]?.['journeyStages'];return _0x3c0140&&_0x5d3ad3[_0x14b659(0x26e)][_0x14b659(0x1fe)]&&injectExistingStageIds(_0x5d3ad3['attributes']['journeyStages'],_0x3c0140),ensureJourneyDefaults(_0x48fe02),await _0x5d9332[_0x14b659(0x22e)][_0x14b659(0x210)](_0x23bc2e['existingJourney']['id'],_0x5d3ad3),deletePushRecovery(_0x23bc2e['absolutePath']),{'action':_0x14b659(0x2da),'journeyId':_0x23bc2e[_0x14b659(0x2a4)]['id'],'embeddedSegmentNameToId':_0x5e7ee4};}}return deletePushRecovery(_0x23bc2e[_0x14b659(0x2ac)]),{'action':_0x14b659(0x2e7),'journeyId':_0x23bc2e[_0x14b659(0x2a4)]?.['id'],'embeddedSegmentNameToId':_0x5e7ee4};}function findSegmentCriteriaLocation(_0x1b3c37,_0xb95965){const _0x257e7b=a127_0x1b45a8,_0xa6e33f=_0x1b3c37[_0x257e7b(0x248)]||_0x1b3c37[_0x257e7b(0x1f2)]?.[0x0]?.['stages']||[];let _0x2aa96e=_0x257e7b(0x2bb),_0x1c327c=_0xb95965;const _0x2b3bda=_0x1b3c37['goal']||_0x1b3c37[_0x257e7b(0x1f2)]?.[0x0]?.['goal'];if(_0x2b3bda?.[_0x257e7b(0x289)]===_0xb95965)return{'stageName':'goal','criteriaName':_0x2b3bda[_0x257e7b(0x23d)]||_0xb95965};_0x1a56ab:for(const _0x2079d4 of _0xa6e33f){if(_0x2079d4[_0x257e7b(0x1f0)]?.[_0x257e7b(0x289)]===_0xb95965){_0x2aa96e=_0x2079d4[_0x257e7b(0x23d)],_0x1c327c=_0x2079d4[_0x257e7b(0x1f0)]['name']||_0xb95965;break;}if(_0x2079d4['steps'])for(const _0x81f77b of _0x2079d4[_0x257e7b(0x222)]){if(_0x81f77b[_0x257e7b(0x2e6)]===_0x257e7b(0x236)&&_0x81f77b['with']?.[_0x257e7b(0x24b)])for(const _0x14851e of _0x81f77b[_0x257e7b(0x224)][_0x257e7b(0x24b)]){if(_0x14851e[_0x257e7b(0x289)]===_0xb95965){_0x2aa96e=_0x2079d4[_0x257e7b(0x23d)],_0x1c327c=_0x14851e[_0x257e7b(0x23d)]||_0xb95965;break _0x1a56ab;}}}}return{'stageName':_0x2aa96e,'criteriaName':_0x1c327c};}async function executeThreeStepJourneyCreate(_0x38f871,_0x36f468,_0x3451a0,_0x4aa164,_0x28b29f,_0x4cc9e2,_0x265aed,_0x205216){const _0x35880c=a127_0x1b45a8,{activationDefToCreateRequest:_0x1b93da,yamlRuleToApi:_0x43134b}=_0x205216,{pendingEmbeddedSegments:_0x5681bb,pendingEmbeddedActivations:_0x40468b,embeddedSegmentNameToId:_0x12af12}=_0x4aa164,_0x31b52e=JSON[_0x35880c(0x2a8)](JSON[_0x35880c(0x24e)](_0x3451a0));ensureJourneyDefaults(_0x31b52e[_0x35880c(0x26e)]),stripPendingIds(_0x31b52e);const _0x46a10d=await _0x38f871[_0x35880c(0x22e)][_0x35880c(0x22b)](_0x31b52e),_0x5bb3ca=_0x46a10d['id'],_0xd03403=new Map();for(const _0x572d75 of _0x46a10d[_0x35880c(0x26e)][_0x35880c(0x1fe)]){_0xd03403[_0x35880c(0x258)](_0x572d75[_0x35880c(0x23d)][_0x35880c(0x250)](),_0x572d75['id']);}recoverSegmentIdsFromPushRecovery(_0x36f468,_0x12af12,_0x4cc9e2[_0x35880c(0x21a)]);for(const [_0x4a29ea,{definition:_0x4165f8}]of _0x5681bb){if(_0x12af12['has'](_0x4a29ea)){_0x265aed[_0x35880c(0x279)]?.({'type':_0x35880c(0x239),'journeyName':_0x36f468[_0x35880c(0x2ab)]['name'],'segmentName':_0x4a29ea});continue;}const _0x48bb96=generateDeterministicJourneySegmentName(_0x36f468[_0x35880c(0x2ab)][_0x35880c(0x23d)],_0x4a29ea);_0x265aed['onProgress']?.({'type':_0x35880c(0x28c),'journeyName':_0x36f468[_0x35880c(0x2ab)][_0x35880c(0x23d)],'segmentName':_0x4a29ea});const _0x244886=createSegmentIdResolver(_0x4cc9e2['segmentNameToId'],_0x4a29ea),_0x468a95=await resolveRuleSegmentIds(_0x4165f8['rule'],_0x244886),_0x1cf535=await createOrRecoverEmbeddedSegment(_0x38f871,_0x36f468,{'localName':_0x4a29ea,'uniqueSegmentName':_0x48bb96,'description':_0x4165f8[_0x35880c(0x26f)]||_0x35880c(0x21f)+_0x4a29ea,'journeyId':_0x5bb3ca,'resolvedRule':_0x468a95,'parentId':_0x28b29f[_0x35880c(0x203)],'folderId':_0x28b29f[_0x35880c(0x2ce)]||''},_0x43134b);_0x12af12['set'](_0x4a29ea,_0x1cf535),_0x4cc9e2[_0x35880c(0x21a)][_0x35880c(0x258)](_0x4a29ea,_0x1cf535),_0x265aed[_0x35880c(0x279)]?.({'type':_0x35880c(0x239),'journeyName':_0x36f468['yamlConfig'][_0x35880c(0x23d)],'segmentName':_0x4a29ea});}const _0x23e83e=new Map();for(const [_0x1f2bfa,_0x38025f]of _0x40468b){_0x265aed['onProgress']?.({'type':'embedded_activation_creating','journeyName':_0x36f468[_0x35880c(0x2ab)][_0x35880c(0x23d)],'activationName':_0x1f2bfa});const _0x599adc=await _0x1b93da(_0x38025f,_0x4cc9e2[_0x35880c(0x1fc)]),_0x12b774={..._0x599adc,..._0x38025f[_0x35880c(0x1fb)]!==undefined&&{'runAfterJourneyRefresh':_0x38025f[_0x35880c(0x1fb)]}},_0x35c1f0=await _0x38f871['journey'][_0x35880c(0x221)](_0x5bb3ca,_0x12b774);_0x23e83e[_0x35880c(0x258)](_0x1f2bfa,_0x35c1f0['id']),_0x4aa164[_0x35880c(0x280)][_0x35880c(0x258)](_0x1f2bfa,_0x35c1f0['id']),_0x265aed[_0x35880c(0x279)]?.({'type':_0x35880c(0x202),'journeyName':_0x36f468[_0x35880c(0x2ab)][_0x35880c(0x23d)],'activationName':_0x1f2bfa});}const _0x54891f=JSON[_0x35880c(0x2a8)](JSON[_0x35880c(0x24e)](_0x3451a0));return _0x54891f['id']=_0x5bb3ca,ensureJourneyDefaults(_0x54891f[_0x35880c(0x26e)]),resolvePendingIdsInRequest(_0x54891f,_0x3451a0,_0xd03403,_0x12af12,_0x23e83e,_0x265aed),await _0x38f871['journey']['update'](_0x5bb3ca,_0x54891f),deletePushRecovery(_0x36f468[_0x35880c(0x2ac)]),{'action':'created','journeyId':_0x5bb3ca,'embeddedSegmentNameToId':_0x12af12};}export function stripWaitStepPendingIds(_0x2ae787){const _0x191387=a127_0x1b45a8,_0x16c721=_0x2ae787[_0x191387(0x263)]&&isPendingSegmentId(_0x2ae787[_0x191387(0x263)]),_0x1e2d39=_0x2ae787[_0x191387(0x295)]?.[_0x191387(0x2d3)](_0x133159=>_0x133159['segmentId']&&isPendingSegmentId(_0x133159[_0x191387(0x209)]));(_0x16c721||_0x1e2d39)&&(_0x2ae787['waitStepType']=_0x191387(0x217),_0x2ae787[_0x191387(0x22a)]=0x1,_0x2ae787[_0x191387(0x2b5)]=_0x191387(0x223),delete _0x2ae787[_0x191387(0x263)],delete _0x2ae787[_0x191387(0x249)],delete _0x2ae787[_0x191387(0x268)],delete _0x2ae787[_0x191387(0x295)]);}export function resolveWaitStepPendingIds(_0x548e39,_0x5ca2c7,_0x2f201c,_0x5c34e8){const _0x176ad3=a127_0x1b45a8;if(_0x5ca2c7[_0x176ad3(0x263)]&&isPendingSegmentId(_0x5ca2c7[_0x176ad3(0x263)])){const _0x506588=_0x2f201c(_0x5ca2c7[_0x176ad3(0x263)],_0x176ad3(0x2e9)+_0x5c34e8+_0x176ad3(0x233));_0x506588&&(_0x548e39['waitStepType']=_0x176ad3(0x200),_0x548e39[_0x176ad3(0x263)]=_0x506588,delete _0x548e39[_0x176ad3(0x22a)],delete _0x548e39[_0x176ad3(0x2b5)],_0x5ca2c7[_0x176ad3(0x249)]!==undefined&&(_0x548e39['conditionTimeoutDuration']=_0x5ca2c7['conditionTimeoutDuration']),_0x5ca2c7[_0x176ad3(0x268)]&&(_0x548e39[_0x176ad3(0x268)]=_0x5ca2c7[_0x176ad3(0x268)]));}if(_0x5ca2c7[_0x176ad3(0x295)]){const _0x9edeac=_0x5ca2c7[_0x176ad3(0x295)][_0x176ad3(0x2d3)](_0x33ada7=>_0x33ada7['segmentId']&&isPendingSegmentId(_0x33ada7[_0x176ad3(0x209)]));if(_0x9edeac){const _0x37a690=_0x5ca2c7[_0x176ad3(0x295)][_0x176ad3(0x2aa)](_0x3114ad=>{const _0x913cf0=_0x176ad3;if(_0x3114ad[_0x913cf0(0x209)]&&isPendingSegmentId(_0x3114ad[_0x913cf0(0x209)])){const _0x5321f5=_0x2f201c(_0x3114ad[_0x913cf0(0x209)],_0x913cf0(0x2e9)+_0x5c34e8+'\x27\x20wait\x20condition');return{..._0x3114ad,'segmentId':_0x5321f5||_0x3114ad[_0x913cf0(0x209)]};}return{..._0x3114ad};});_0x548e39[_0x176ad3(0x283)]='Condition',_0x548e39[_0x176ad3(0x295)]=_0x37a690,delete _0x548e39[_0x176ad3(0x22a)],delete _0x548e39['waitStepUnit'],delete _0x548e39[_0x176ad3(0x263)],delete _0x548e39['conditionTimeoutDuration'],delete _0x548e39[_0x176ad3(0x268)];}}}function stripPendingIds(_0x1e1bf6){const _0x468588=a127_0x1b45a8;_0x1e1bf6[_0x468588(0x26e)]['goal']?.[_0x468588(0x209)]&&isPendingSegmentId(_0x1e1bf6['attributes']['goal'][_0x468588(0x209)])&&delete _0x1e1bf6[_0x468588(0x26e)][_0x468588(0x1f9)];for(const _0x5e586a of _0x1e1bf6[_0x468588(0x26e)]['journeyStages']||[]){_0x5e586a[_0x468588(0x2b4)]?.[_0x468588(0x209)]&&isPendingSegmentId(_0x5e586a[_0x468588(0x2b4)]['segmentId'])&&delete _0x5e586a['entryCriteria'];_0x5e586a['milestone']?.[_0x468588(0x209)]&&isPendingSegmentId(_0x5e586a[_0x468588(0x2c3)][_0x468588(0x209)])&&delete _0x5e586a['milestone'];_0x5e586a[_0x468588(0x2e4)]&&(_0x5e586a['exitCriterias']=_0x5e586a[_0x468588(0x2e4)][_0x468588(0x294)](_0x19aa7b=>!_0x19aa7b[_0x468588(0x209)]||!isPendingSegmentId(_0x19aa7b[_0x468588(0x209)])));if(_0x5e586a['steps'])for(const _0x54fab0 of Object[_0x468588(0x1f7)](_0x5e586a[_0x468588(0x222)])){const _0x102b86=_0x5e586a[_0x468588(0x222)][_0x54fab0];_0x102b86[_0x468588(0x2e6)]==='Activation'&&_0x102b86['journeyActivationStepId']&&isPendingActivationId(_0x102b86[_0x468588(0x201)])&&(_0x102b86[_0x468588(0x201)]='');if(_0x102b86['type']==='DecisionPoint'&&_0x102b86[_0x468588(0x24b)])for(const _0xfabce8 of _0x102b86[_0x468588(0x24b)]){_0xfabce8[_0x468588(0x209)]&&isPendingSegmentId(_0xfabce8['segmentId'])&&(_0xfabce8[_0x468588(0x209)]='');}_0x102b86[_0x468588(0x2e6)]==='WaitStep'&&stripWaitStepPendingIds(_0x102b86);}}}function resolvePendingIdsInRequest(_0x2278dc,_0x14a90e,_0x1ca4cb,_0x3c0b07,_0x339370,_0x1933f3){const _0x16dbc2=a127_0x1b45a8,_0x5bba9c=(_0x5d6441,_0x1a9fe5)=>{const _0x152ac9=a127_0x9b56;if(!isPendingSegmentId(_0x5d6441))return _0x5d6441;const _0x12fbd7=extractPendingSegmentName(_0x5d6441),_0x20dc11=_0x3c0b07['get'](_0x12fbd7);return!_0x20dc11&&_0x1933f3[_0x152ac9(0x1f4)]?.(_0x152ac9(0x2c1)+_0x12fbd7+_0x152ac9(0x229)+_0x1a9fe5),_0x20dc11;};if(_0x2278dc[_0x16dbc2(0x26e)][_0x16dbc2(0x1f9)]?.[_0x16dbc2(0x209)]&&isPendingSegmentId(_0x2278dc[_0x16dbc2(0x26e)]['goal'][_0x16dbc2(0x209)])){const _0x108a15=_0x5bba9c(_0x2278dc[_0x16dbc2(0x26e)][_0x16dbc2(0x1f9)]['segmentId'],_0x16dbc2(0x2be));_0x108a15&&(_0x2278dc['attributes']['goal'][_0x16dbc2(0x209)]=_0x108a15);}for(const _0x43d5ff of _0x2278dc[_0x16dbc2(0x26e)][_0x16dbc2(0x1fe)]||[]){const _0x4f422d=_0x1ca4cb['get'](_0x43d5ff[_0x16dbc2(0x23d)]['toLowerCase']());_0x4f422d&&(_0x43d5ff['id']=_0x4f422d);if(_0x43d5ff[_0x16dbc2(0x2b4)]?.[_0x16dbc2(0x209)]&&isPendingSegmentId(_0x43d5ff['entryCriteria'][_0x16dbc2(0x209)])){const _0x440d82=_0x5bba9c(_0x43d5ff[_0x16dbc2(0x2b4)][_0x16dbc2(0x209)],'stage\x20\x27'+_0x43d5ff[_0x16dbc2(0x23d)]+_0x16dbc2(0x242));_0x440d82&&(_0x43d5ff['entryCriteria']['segmentId']=_0x440d82);}if(_0x43d5ff['exitCriterias'])for(const _0x4a47c1 of _0x43d5ff[_0x16dbc2(0x2e4)]){if(_0x4a47c1[_0x16dbc2(0x209)]&&isPendingSegmentId(_0x4a47c1[_0x16dbc2(0x209)])){const _0x1f509f=_0x5bba9c(_0x4a47c1[_0x16dbc2(0x209)],_0x16dbc2(0x2e9)+_0x43d5ff[_0x16dbc2(0x23d)]+_0x16dbc2(0x235));_0x1f509f&&(_0x4a47c1[_0x16dbc2(0x209)]=_0x1f509f);}}if(_0x43d5ff[_0x16dbc2(0x2c3)]?.[_0x16dbc2(0x209)]&&isPendingSegmentId(_0x43d5ff[_0x16dbc2(0x2c3)][_0x16dbc2(0x209)])){const _0x540bd4=_0x5bba9c(_0x43d5ff[_0x16dbc2(0x2c3)]['segmentId'],_0x16dbc2(0x2e9)+_0x43d5ff[_0x16dbc2(0x23d)]+_0x16dbc2(0x29f));_0x540bd4&&(_0x43d5ff[_0x16dbc2(0x2c3)]['segmentId']=_0x540bd4);}if(_0x43d5ff[_0x16dbc2(0x222)]){const _0x1b0e29=_0x1764e2=>_0x14a90e['attributes'][_0x16dbc2(0x1fe)]?.[_0x16dbc2(0x25e)](_0x50e664=>_0x50e664[_0x16dbc2(0x23d)][_0x16dbc2(0x250)]()===_0x43d5ff[_0x16dbc2(0x23d)][_0x16dbc2(0x250)]())?.[_0x16dbc2(0x222)]?.[_0x1764e2];for(const _0x1449f8 of Object[_0x16dbc2(0x1f7)](_0x43d5ff[_0x16dbc2(0x222)])){const _0x28729a=_0x43d5ff[_0x16dbc2(0x222)][_0x1449f8],_0x2142a4=_0x1b0e29(_0x1449f8);if(_0x28729a[_0x16dbc2(0x2e6)]==='Activation'&&_0x28729a[_0x16dbc2(0x201)]&&(isPendingActivationId(_0x28729a[_0x16dbc2(0x201)])||_0x28729a[_0x16dbc2(0x201)]==='')){if(_0x2142a4?.['journeyActivationStepId']&&isPendingActivationId(_0x2142a4[_0x16dbc2(0x201)])){const _0x329cca=extractPendingActivationName(_0x2142a4[_0x16dbc2(0x201)]),_0x3d00ff=_0x339370[_0x16dbc2(0x228)](_0x329cca);_0x3d00ff&&(_0x28729a['journeyActivationStepId']=_0x3d00ff);}}if(_0x28729a[_0x16dbc2(0x2e6)]===_0x16dbc2(0x24d)&&_0x28729a[_0x16dbc2(0x24b)]&&_0x2142a4?.[_0x16dbc2(0x24b)])for(let _0x5e7cee=0x0;_0x5e7cee<_0x28729a[_0x16dbc2(0x24b)][_0x16dbc2(0x215)];_0x5e7cee++){const _0x1e49ab=_0x28729a[_0x16dbc2(0x24b)][_0x5e7cee],_0x18d375=_0x2142a4[_0x16dbc2(0x24b)][_0x5e7cee];if(_0x18d375?.[_0x16dbc2(0x209)]&&isPendingSegmentId(_0x18d375[_0x16dbc2(0x209)])){const _0x545dcc=_0x5bba9c(_0x18d375[_0x16dbc2(0x209)],'stage\x20\x27'+_0x43d5ff[_0x16dbc2(0x23d)]+_0x16dbc2(0x2c5)+(_0x1e49ab[_0x16dbc2(0x23d)]||_0x5e7cee)+'\x27');_0x545dcc&&(_0x1e49ab['segmentId']=_0x545dcc);}}_0x28729a['type']===_0x16dbc2(0x2d4)&&_0x2142a4?.[_0x16dbc2(0x2e6)]===_0x16dbc2(0x2d4)&&resolveWaitStepPendingIds(_0x28729a,_0x2142a4,_0x5bba9c,_0x43d5ff[_0x16dbc2(0x23d)]);}}}}
@@ -1 +1 @@
1
- (function(_0x132625,_0x102914){const _0x4ddedf=a128_0x189b,_0x1c8e75=_0x132625();while(!![]){try{const _0x38f550=-parseInt(_0x4ddedf(0x1a3))/0x1+-parseInt(_0x4ddedf(0x1a0))/0x2+parseInt(_0x4ddedf(0x19d))/0x3*(parseInt(_0x4ddedf(0x1a6))/0x4)+parseInt(_0x4ddedf(0x1a5))/0x5*(-parseInt(_0x4ddedf(0x1a8))/0x6)+-parseInt(_0x4ddedf(0x1a4))/0x7*(-parseInt(_0x4ddedf(0x19c))/0x8)+-parseInt(_0x4ddedf(0x199))/0x9+parseInt(_0x4ddedf(0x19e))/0xa*(parseInt(_0x4ddedf(0x1a7))/0xb);if(_0x38f550===_0x102914)break;else _0x1c8e75['push'](_0x1c8e75['shift']());}catch(_0x129ba9){_0x1c8e75['push'](_0x1c8e75['shift']());}}}(a128_0x377a,0x8c8b9));function a128_0x377a(){const _0x5f3ed4=['14fMoSWp','20aYffIC','1572vGTwfT','3025qFUsDJ','78522zHPEja','get','1786788cpAWvn','set','add','3372824ZzcsYf','6921bJZFkE','27170MvbvCK','parentFolderId','1431924DSDjzC','has','name','954517dSGigY'];a128_0x377a=function(){return _0x5f3ed4;};return a128_0x377a();}function a128_0x189b(_0x37f762,_0x23af2d){_0x37f762=_0x37f762-0x199;const _0x377aac=a128_0x377a();let _0x189ba1=_0x377aac[_0x37f762];return _0x189ba1;}export function buildFolderIdToPathMap(_0x1d5b10){const _0xd97693=a128_0x189b,_0x20319a=new Map(),_0x202123=new Map();for(const _0x141d3b of _0x1d5b10){_0x202123[_0xd97693(0x19a)](_0x141d3b['id'],_0x141d3b);}const _0x266318=new Set();for(const _0x242a7b of _0x1d5b10){!_0x242a7b[_0xd97693(0x19f)]&&_0x266318[_0xd97693(0x19b)](_0x242a7b['id']);}function _0x202e38(_0x4be8cd){const _0x100a53=_0xd97693;if(_0x20319a['has'](_0x4be8cd['id']))return _0x20319a[_0x100a53(0x1a9)](_0x4be8cd['id']);if(_0x266318[_0x100a53(0x1a1)](_0x4be8cd['id']))return _0x20319a[_0x100a53(0x19a)](_0x4be8cd['id'],''),'';if(_0x4be8cd[_0x100a53(0x19f)]){const _0x4e580f=_0x202123[_0x100a53(0x1a9)](_0x4be8cd[_0x100a53(0x19f)]);if(_0x4e580f){const _0x9eba34=_0x202e38(_0x4e580f),_0x1b2243=_0x9eba34?_0x9eba34+'/'+_0x4be8cd['name']:_0x4be8cd['name'];return _0x20319a[_0x100a53(0x19a)](_0x4be8cd['id'],_0x1b2243),_0x1b2243;}}const _0x1dde89=_0x4be8cd[_0x100a53(0x1a2)];return _0x20319a['set'](_0x4be8cd['id'],_0x1dde89),_0x1dde89;}for(const _0x1a8c51 of _0x1d5b10){_0x202e38(_0x1a8c51);}return _0x20319a;}export function buildFolderPathToIdMap(_0x11c936){const _0x3e26a6=a128_0x189b,_0x4bf347=new Map(),_0x72b52d=new Map();for(const _0x42d3f8 of _0x11c936){_0x72b52d[_0x3e26a6(0x19a)](_0x42d3f8['id'],_0x42d3f8);}const _0x2abff3=new Set();for(const _0x5c875a of _0x11c936){!_0x5c875a[_0x3e26a6(0x19f)]&&_0x2abff3['add'](_0x5c875a['id']);}function _0x3ebb3f(_0x2652af){const _0x5c69a0=_0x3e26a6;if(_0x2abff3[_0x5c69a0(0x1a1)](_0x2652af['id']))return'';if(_0x2652af[_0x5c69a0(0x19f)]){const _0x341e0b=_0x72b52d[_0x5c69a0(0x1a9)](_0x2652af[_0x5c69a0(0x19f)]);if(_0x341e0b){const _0x3a8206=_0x3ebb3f(_0x341e0b);return _0x3a8206?_0x3a8206+'/'+_0x2652af[_0x5c69a0(0x1a2)]:_0x2652af[_0x5c69a0(0x1a2)];}}return _0x2652af[_0x5c69a0(0x1a2)];}for(const _0xf05ccf of _0x11c936){const _0x3effd2=_0x3ebb3f(_0xf05ccf);_0x4bf347[_0x3e26a6(0x19a)](_0x3effd2,_0xf05ccf['id']);}return _0x4bf347;}export function buildFolderMaps(_0x33a086){const _0x357113=a128_0x189b,_0x3c2c16=buildFolderIdToPathMap(_0x33a086),_0x572dc4=new Map();for(const [_0x255a75,_0x5eb2ad]of _0x3c2c16){_0x572dc4[_0x357113(0x19a)](_0x5eb2ad,_0x255a75);}return{'idToPath':_0x3c2c16,'pathToId':_0x572dc4};}export function getFolderPath(_0x56fe6b,_0x4cb920){const _0x1da570=a128_0x189b;if(!_0x56fe6b)return'';return _0x4cb920[_0x1da570(0x1a9)](_0x56fe6b)??'';}
1
+ function a128_0x4fcc(){const _0x35ba89=['22244oSBjOd','58FMqlnJ','10466jEALER','set','10PDeQgq','53874sekpaL','3697488kcWbtN','261350DFVkxJ','111WNUJMl','get','name','has','2903659oeZhWG','parentFolderId','88wKTLEM','373513zywrMr'];a128_0x4fcc=function(){return _0x35ba89;};return a128_0x4fcc();}(function(_0x3adaee,_0x237d12){const _0x53c1be=a128_0x3e9e,_0x24bff1=_0x3adaee();while(!![]){try{const _0x51ff19=-parseInt(_0x53c1be(0x148))/0x1*(parseInt(_0x53c1be(0x147))/0x2)+-parseInt(_0x53c1be(0x13e))/0x3*(-parseInt(_0x53c1be(0x146))/0x4)+parseInt(_0x53c1be(0x14a))/0x5*(parseInt(_0x53c1be(0x14b))/0x6)+-parseInt(_0x53c1be(0x145))/0x7*(-parseInt(_0x53c1be(0x144))/0x8)+-parseInt(_0x53c1be(0x13c))/0x9+-parseInt(_0x53c1be(0x13d))/0xa+parseInt(_0x53c1be(0x142))/0xb;if(_0x51ff19===_0x237d12)break;else _0x24bff1['push'](_0x24bff1['shift']());}catch(_0x17494d){_0x24bff1['push'](_0x24bff1['shift']());}}}(a128_0x4fcc,0x51948));export function buildFolderIdToPathMap(_0x596fa1){const _0xa299b3=a128_0x3e9e,_0x48c140=new Map(),_0x1dec5f=new Map();for(const _0xa8040f of _0x596fa1){_0x1dec5f[_0xa299b3(0x149)](_0xa8040f['id'],_0xa8040f);}const _0xe3eb65=new Set();for(const _0x37336a of _0x596fa1){!_0x37336a[_0xa299b3(0x143)]&&_0xe3eb65['add'](_0x37336a['id']);}function _0x48936e(_0x29caef){const _0x2daf1b=_0xa299b3;if(_0x48c140[_0x2daf1b(0x141)](_0x29caef['id']))return _0x48c140[_0x2daf1b(0x13f)](_0x29caef['id']);if(_0xe3eb65[_0x2daf1b(0x141)](_0x29caef['id']))return _0x48c140['set'](_0x29caef['id'],''),'';if(_0x29caef[_0x2daf1b(0x143)]){const _0x58d9d5=_0x1dec5f[_0x2daf1b(0x13f)](_0x29caef[_0x2daf1b(0x143)]);if(_0x58d9d5){const _0x2dfe75=_0x48936e(_0x58d9d5),_0x1c8f46=_0x2dfe75?_0x2dfe75+'/'+_0x29caef[_0x2daf1b(0x140)]:_0x29caef[_0x2daf1b(0x140)];return _0x48c140[_0x2daf1b(0x149)](_0x29caef['id'],_0x1c8f46),_0x1c8f46;}}const _0x3a0fb3=_0x29caef[_0x2daf1b(0x140)];return _0x48c140[_0x2daf1b(0x149)](_0x29caef['id'],_0x3a0fb3),_0x3a0fb3;}for(const _0x53846a of _0x596fa1){_0x48936e(_0x53846a);}return _0x48c140;}export function buildFolderPathToIdMap(_0x26cbcd){const _0x291c63=a128_0x3e9e,_0x5d772e=new Map(),_0x3cbeea=new Map();for(const _0xcf2c14 of _0x26cbcd){_0x3cbeea[_0x291c63(0x149)](_0xcf2c14['id'],_0xcf2c14);}const _0x39d902=new Set();for(const _0x5702f1 of _0x26cbcd){!_0x5702f1[_0x291c63(0x143)]&&_0x39d902['add'](_0x5702f1['id']);}function _0x4e16e3(_0x419b98){const _0x581a2a=_0x291c63;if(_0x39d902[_0x581a2a(0x141)](_0x419b98['id']))return'';if(_0x419b98[_0x581a2a(0x143)]){const _0x2e7b01=_0x3cbeea[_0x581a2a(0x13f)](_0x419b98['parentFolderId']);if(_0x2e7b01){const _0x41bff1=_0x4e16e3(_0x2e7b01);return _0x41bff1?_0x41bff1+'/'+_0x419b98[_0x581a2a(0x140)]:_0x419b98['name'];}}return _0x419b98[_0x581a2a(0x140)];}for(const _0x1c3d50 of _0x26cbcd){const _0x22df3f=_0x4e16e3(_0x1c3d50);_0x5d772e['set'](_0x22df3f,_0x1c3d50['id']);}return _0x5d772e;}function a128_0x3e9e(_0x40faed,_0x301c89){_0x40faed=_0x40faed-0x13c;const _0x4fccb4=a128_0x4fcc();let _0x3e9ea7=_0x4fccb4[_0x40faed];return _0x3e9ea7;}export function buildFolderMaps(_0x36a1db){const _0x46d034=a128_0x3e9e,_0x3b5385=buildFolderIdToPathMap(_0x36a1db),_0x2e35b3=new Map();for(const [_0x5f3685,_0x2873a7]of _0x3b5385){_0x2e35b3[_0x46d034(0x149)](_0x2873a7,_0x5f3685);}return{'idToPath':_0x3b5385,'pathToId':_0x2e35b3};}export function getFolderPath(_0x3d1314,_0x372f85){const _0x407161=a128_0x3e9e;if(!_0x3d1314)return'';return _0x372f85[_0x407161(0x13f)](_0x3d1314)??'';}
@@ -1 +1 @@
1
- (function(_0x29aafc,_0x107ce4){const _0x4b9e2d=a129_0x4cc6,_0x26e703=_0x29aafc();while(!![]){try{const _0x67e118=parseInt(_0x4b9e2d(0x154))/0x1*(-parseInt(_0x4b9e2d(0x165))/0x2)+-parseInt(_0x4b9e2d(0x168))/0x3*(-parseInt(_0x4b9e2d(0x155))/0x4)+-parseInt(_0x4b9e2d(0x14c))/0x5+parseInt(_0x4b9e2d(0x172))/0x6*(parseInt(_0x4b9e2d(0x164))/0x7)+parseInt(_0x4b9e2d(0x153))/0x8+parseInt(_0x4b9e2d(0x16c))/0x9*(-parseInt(_0x4b9e2d(0x150))/0xa)+parseInt(_0x4b9e2d(0x149))/0xb;if(_0x67e118===_0x107ce4)break;else _0x26e703['push'](_0x26e703['shift']());}catch(_0x56a8ab){_0x26e703['push'](_0x26e703['shift']());}}}(a129_0x278d,0x888d3));import a129_0x153fa9 from'path';import{parse as a129_0x4e13a3}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x172941){const _0x54ddac=a129_0x4cc6;if(!_0x172941||_0x172941[_0x54ddac(0x14b)]()==='')throw new Error(_0x54ddac(0x14f));const _0x135add=_0x172941[_0x54ddac(0x14b)]();if(_0x135add==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x172941};const _0xdf5ea9=_0x135add['startsWith']('/')?_0x135add[_0x54ddac(0x160)](0x1):_0x135add,_0x184aaf=_0xdf5ea9[_0x54ddac(0x16b)]('/')[_0x54ddac(0x16f)](_0x5b7e36=>_0x5b7e36!=='');if(_0x184aaf[_0x54ddac(0x16d)]===0x0)throw new Error('Path\x20must\x20contain\x20at\x20least\x20one\x20segment');const _0x2b715c=_0x135add['startsWith']('/')||!isRelativePathSegment(_0x184aaf[0x0]);for(const _0x1813a1 of _0x184aaf){validatePathSegment(_0x1813a1);}return{'segments':_0x184aaf,'isAbsolute':_0x2b715c,'raw':_0x172941};}function isRelativePathSegment(_0xb00da9){return _0xb00da9==='.'||_0xb00da9==='..';}function validatePathSegment(_0x3577b6){const _0x23c944=a129_0x4cc6;if(_0x3577b6==='')throw new Error(_0x23c944(0x158));if(_0x3577b6==='.'||_0x3577b6==='..')return;if(/[\x00-\x1F\x7F]/[_0x23c944(0x173)](_0x3577b6))throw new Error(_0x23c944(0x16e)+_0x3577b6);if(_0x3577b6!==_0x3577b6[_0x23c944(0x14b)]()){}}function a129_0x4cc6(_0x3ebb4e,_0xf31490){_0x3ebb4e=_0x3ebb4e-0x147;const _0x278d72=a129_0x278d();let _0x4cc6f4=_0x278d72[_0x3ebb4e];return _0x4cc6f4;}function a129_0x278d(){const _0x4abd51=['Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','21003jFRcQI','replace','push','split','30591PzakBh','length','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','filter','Cannot\x20split\x20empty\x20path','.yml','696twCENR','test','Path\x20attempts\x20to\x20navigate\x20above\x20root','slice','isAbsolute','relative','segment','readFile','13201331rOiOAk','root','trim','1976055OlJFlp','journey','Cannot\x20navigate\x20above\x20root','Path\x20cannot\x20be\x20empty','1780gDacyw','segments','raw','620232nmRANy','213335FaZvAV','324JjSZnr','dirname','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','Path\x20segment\x20cannot\x20be\x20empty','startsWith','endsWith','resolve','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','File\x20not\x20found:\x20','name','parse','substring','exists','Relative\x20path\x20cannot\x20be\x20empty','join','47159llTTAa','10PMQgfW','pop'];a129_0x278d=function(){return _0x4abd51;};return a129_0x278d();}export function validatePath(_0x41b5aa){const _0x53dc00=a129_0x4cc6;if(_0x41b5aa[_0x53dc00(0x151)][_0x53dc00(0x16d)]===0x0&&!_0x41b5aa[_0x53dc00(0x176)])throw new Error(_0x53dc00(0x162));if(_0x41b5aa[_0x53dc00(0x176)]){if(_0x41b5aa['segments'][0x0]==='..')throw new Error(_0x53dc00(0x167));let _0x5ec54b=0x0;for(const _0x2ddc0b of _0x41b5aa[_0x53dc00(0x151)]){if(_0x2ddc0b==='..'){if(_0x5ec54b===0x0)throw new Error(_0x53dc00(0x174));_0x5ec54b--;}else _0x2ddc0b!=='.'&&_0x5ec54b++;}}}export function joinPaths(_0x35bbea,_0x12ea1d){const _0x5a794e=a129_0x4cc6;if(!_0x35bbea||_0x35bbea==='/')return _0x12ea1d;if(!_0x12ea1d||_0x12ea1d==='.')return _0x35bbea;if(_0x12ea1d['startsWith']('/'))return _0x12ea1d;const _0x63dc39=parsePath(_0x35bbea),_0x39e8a2=parsePath(_0x12ea1d),_0xfaccf4=[..._0x63dc39[_0x5a794e(0x151)]];for(const _0x1192de of _0x39e8a2[_0x5a794e(0x151)]){if(_0x1192de==='.')continue;else{if(_0x1192de==='..'){if(_0xfaccf4[_0x5a794e(0x16d)]===0x0)throw new Error(_0x5a794e(0x14e));_0xfaccf4[_0x5a794e(0x166)]();}else _0xfaccf4[_0x5a794e(0x16a)](_0x1192de);}}const _0x393b1d=_0xfaccf4[_0x5a794e(0x163)]('/');return _0x63dc39[_0x5a794e(0x152)][_0x5a794e(0x159)]('/')?'/'+_0x393b1d:_0x393b1d;}export function normalizePath(_0x964d7f){const _0x332166=a129_0x4cc6,_0x469915=parsePath(_0x964d7f),_0x1a132b=[];for(const _0x1ccecd of _0x469915['segments']){if(_0x1ccecd==='.')continue;else{if(_0x1ccecd==='..'){if(_0x1a132b[_0x332166(0x16d)]===0x0){if(_0x469915[_0x332166(0x176)])throw new Error(_0x332166(0x14e));_0x1a132b[_0x332166(0x16a)]('..');}else _0x1a132b[_0x1a132b['length']-0x1]==='..'?_0x1a132b['push']('..'):_0x1a132b[_0x332166(0x166)]();}else _0x1a132b[_0x332166(0x16a)](_0x1ccecd);}}if(_0x1a132b[_0x332166(0x16d)]===0x0)return _0x469915['isAbsolute']?'/':'.';const _0x55a50b=_0x1a132b[_0x332166(0x163)]('/');return _0x469915[_0x332166(0x152)][_0x332166(0x159)]('/')?'/'+_0x55a50b:_0x55a50b;}export function getParentPath(_0x365bde){const _0x455079=a129_0x4cc6,_0x191085=parsePath(_0x365bde);if(_0x191085['segments'][_0x455079(0x16d)]<=0x1)return'/';const _0x2cc0fc=_0x191085[_0x455079(0x151)][_0x455079(0x175)](0x0,-0x1)[_0x455079(0x163)]('/');return _0x191085['raw']['startsWith']('/')?'/'+_0x2cc0fc:_0x2cc0fc;}export function getBaseName(_0x3f1868){const _0x291ced=a129_0x4cc6,_0x40032d=parsePath(_0x3f1868);return _0x40032d[_0x291ced(0x151)][_0x40032d[_0x291ced(0x151)][_0x291ced(0x16d)]-0x1]||'';}export function isChildPath(_0x5ee87a,_0xf136ba){const _0x3a2010=a129_0x4cc6,_0x2c74a2=parsePath(_0x5ee87a),_0x47d9a9=parsePath(_0xf136ba);if(_0x2c74a2[_0x3a2010(0x151)][_0x3a2010(0x16d)]<=_0x47d9a9[_0x3a2010(0x151)]['length'])return![];for(let _0x21c7c3=0x0;_0x21c7c3<_0x47d9a9[_0x3a2010(0x151)][_0x3a2010(0x16d)];_0x21c7c3++){if(_0x2c74a2[_0x3a2010(0x151)][_0x21c7c3]!==_0x47d9a9[_0x3a2010(0x151)][_0x21c7c3])return![];}return!![];}export function splitPath(_0x359539){const _0x54efca=a129_0x4cc6,_0x4554bc=parsePath(_0x359539);if(_0x4554bc[_0x54efca(0x151)][_0x54efca(0x16d)]===0x0)throw new Error(_0x54efca(0x170));if(_0x4554bc[_0x54efca(0x151)][_0x54efca(0x16d)]===0x1)return{'parent':_0x4554bc[_0x54efca(0x151)][0x0]};return{'parent':_0x4554bc[_0x54efca(0x151)][0x0],'child':_0x4554bc['segments']['slice'](0x1)[_0x54efca(0x163)]('/')};}export function isYamlFilePath(_0x1079cc){const _0x4e7065=a129_0x4cc6;return _0x1079cc['endsWith'](_0x4e7065(0x171))||_0x1079cc[_0x4e7065(0x15a)]('.yaml');}export async function resolveYamlFilePath(_0x31564b,_0x4147d9=nodeFileSystem){const _0x3c2704=a129_0x4cc6,_0x362f42=a129_0x153fa9[_0x3c2704(0x15b)](_0x31564b);if(!await _0x4147d9['exists'](_0x362f42))throw new Error(_0x3c2704(0x15d)+_0x31564b);let _0x519c1b=a129_0x153fa9[_0x3c2704(0x156)](_0x362f42),_0x164c9d=null,_0x49f1a1=null;const _0x587f32=a129_0x153fa9[_0x3c2704(0x15f)](_0x519c1b)[_0x3c2704(0x14a)];while(_0x519c1b!==_0x587f32){const _0x5573bf=a129_0x153fa9['join'](_0x519c1b,'tdx.json');if(await _0x4147d9[_0x3c2704(0x161)](_0x5573bf)){_0x164c9d=_0x5573bf,_0x49f1a1=_0x519c1b;break;}_0x519c1b=a129_0x153fa9[_0x3c2704(0x156)](_0x519c1b);}if(!_0x164c9d||!_0x49f1a1)throw new Error('No\x20tdx.json\x20found\x20for\x20file:\x20'+_0x31564b);const _0x114f7f=await _0x4147d9['readFile'](_0x164c9d),_0x2ea879=JSON[_0x3c2704(0x15f)](_0x114f7f),_0x585ca5=_0x2ea879['parent_segment'];if(!_0x585ca5)throw new Error(_0x3c2704(0x15c));const _0x54c540=await _0x4147d9[_0x3c2704(0x148)](_0x362f42),_0x4c7bcc=a129_0x4e13a3(_0x54c540),_0x3a847a=_0x4c7bcc[_0x3c2704(0x15e)];if(!_0x3a847a)throw new Error(_0x3c2704(0x157)+_0x31564b);const _0x1daca0=_0x4c7bcc['type']===_0x3c2704(0x14d)?'journey':_0x3c2704(0x147),_0xa4edc0=a129_0x153fa9[_0x3c2704(0x177)](_0x49f1a1,_0x362f42),_0x2fbdde=a129_0x153fa9[_0x3c2704(0x156)](_0xa4edc0),_0x44315c=_0x2fbdde==='.'?'':_0x2fbdde[_0x3c2704(0x169)](/\\/g,'/'),_0x173266=_0x44315c?_0x585ca5+'/'+_0x44315c+'/'+_0x3a847a:_0x585ca5+'/'+_0x3a847a;return{'parentSegment':_0x585ca5,'segmentName':_0x3a847a,'folderPath':_0x44315c,'fullPath':_0x173266,'resourceType':_0x1daca0};}
1
+ (function(_0x31182e,_0x37efa4){const _0x39952d=a129_0x1a6b,_0x29541a=_0x31182e();while(!![]){try{const _0x5d7246=parseInt(_0x39952d(0xe9))/0x1+-parseInt(_0x39952d(0xe5))/0x2+-parseInt(_0x39952d(0xea))/0x3+-parseInt(_0x39952d(0xf5))/0x4*(parseInt(_0x39952d(0xf8))/0x5)+parseInt(_0x39952d(0xe7))/0x6*(parseInt(_0x39952d(0xd2))/0x7)+parseInt(_0x39952d(0xe8))/0x8+-parseInt(_0x39952d(0xd1))/0x9*(parseInt(_0x39952d(0xec))/0xa);if(_0x5d7246===_0x37efa4)break;else _0x29541a['push'](_0x29541a['shift']());}catch(_0x5a10e0){_0x29541a['push'](_0x29541a['shift']());}}}(a129_0xd449,0xdf764));import a129_0x3bf6d1 from'path';import{parse as a129_0x4d6446}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x131ccb){const _0x4fb474=a129_0x1a6b;if(!_0x131ccb||_0x131ccb[_0x4fb474(0xda)]()==='')throw new Error('Path\x20cannot\x20be\x20empty');const _0x433f84=_0x131ccb[_0x4fb474(0xda)]();if(_0x433f84==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x131ccb};const _0x53f566=_0x433f84['startsWith']('/')?_0x433f84[_0x4fb474(0xeb)](0x1):_0x433f84,_0x203ad9=_0x53f566[_0x4fb474(0xd3)]('/')[_0x4fb474(0xd5)](_0x42d4ff=>_0x42d4ff!=='');if(_0x203ad9[_0x4fb474(0xdc)]===0x0)throw new Error(_0x4fb474(0xed));const _0x34c29e=_0x433f84[_0x4fb474(0xcf)]('/')||!isRelativePathSegment(_0x203ad9[0x0]);for(const _0x216945 of _0x203ad9){validatePathSegment(_0x216945);}return{'segments':_0x203ad9,'isAbsolute':_0x34c29e,'raw':_0x131ccb};}function isRelativePathSegment(_0x4398f2){return _0x4398f2==='.'||_0x4398f2==='..';}function validatePathSegment(_0x519df1){const _0x110a3c=a129_0x1a6b;if(_0x519df1==='')throw new Error(_0x110a3c(0xe3));if(_0x519df1==='.'||_0x519df1==='..')return;if(/[\x00-\x1F\x7F]/[_0x110a3c(0xd8)](_0x519df1))throw new Error(_0x110a3c(0xf3)+_0x519df1);if(_0x519df1!==_0x519df1[_0x110a3c(0xda)]()){}}export function validatePath(_0x83ec2c){const _0x309d5c=a129_0x1a6b;if(_0x83ec2c[_0x309d5c(0xe0)][_0x309d5c(0xdc)]===0x0&&!_0x83ec2c['isAbsolute'])throw new Error('Relative\x20path\x20cannot\x20be\x20empty');if(_0x83ec2c['isAbsolute']){if(_0x83ec2c['segments'][0x0]==='..')throw new Error(_0x309d5c(0xef));let _0x50cc78=0x0;for(const _0x59c514 of _0x83ec2c['segments']){if(_0x59c514==='..'){if(_0x50cc78===0x0)throw new Error(_0x309d5c(0xf4));_0x50cc78--;}else _0x59c514!=='.'&&_0x50cc78++;}}}export function joinPaths(_0x59890f,_0x183794){const _0x2e5689=a129_0x1a6b;if(!_0x59890f||_0x59890f==='/')return _0x183794;if(!_0x183794||_0x183794==='.')return _0x59890f;if(_0x183794[_0x2e5689(0xcf)]('/'))return _0x183794;const _0x5b3d1c=parsePath(_0x59890f),_0x383249=parsePath(_0x183794),_0x5d79ae=[..._0x5b3d1c['segments']];for(const _0x2c427a of _0x383249[_0x2e5689(0xe0)]){if(_0x2c427a==='.')continue;else{if(_0x2c427a==='..'){if(_0x5d79ae[_0x2e5689(0xdc)]===0x0)throw new Error(_0x2e5689(0xdf));_0x5d79ae[_0x2e5689(0xdb)]();}else _0x5d79ae[_0x2e5689(0xe6)](_0x2c427a);}}const _0x4aa030=_0x5d79ae[_0x2e5689(0xf1)]('/');return _0x5b3d1c[_0x2e5689(0xf7)]['startsWith']('/')?'/'+_0x4aa030:_0x4aa030;}export function normalizePath(_0x4fb9d3){const _0x12d0dc=a129_0x1a6b,_0x2f6867=parsePath(_0x4fb9d3),_0x1ca273=[];for(const _0xf2932d of _0x2f6867['segments']){if(_0xf2932d==='.')continue;else{if(_0xf2932d==='..'){if(_0x1ca273[_0x12d0dc(0xdc)]===0x0){if(_0x2f6867[_0x12d0dc(0xe4)])throw new Error(_0x12d0dc(0xdf));_0x1ca273['push']('..');}else _0x1ca273[_0x1ca273['length']-0x1]==='..'?_0x1ca273[_0x12d0dc(0xe6)]('..'):_0x1ca273[_0x12d0dc(0xdb)]();}else _0x1ca273[_0x12d0dc(0xe6)](_0xf2932d);}}if(_0x1ca273['length']===0x0)return _0x2f6867['isAbsolute']?'/':'.';const _0x79aeb5=_0x1ca273[_0x12d0dc(0xf1)]('/');return _0x2f6867['raw'][_0x12d0dc(0xcf)]('/')?'/'+_0x79aeb5:_0x79aeb5;}export function getParentPath(_0x50cf5b){const _0x429723=a129_0x1a6b,_0x5166a7=parsePath(_0x50cf5b);if(_0x5166a7[_0x429723(0xe0)][_0x429723(0xdc)]<=0x1)return'/';const _0x5e337a=_0x5166a7[_0x429723(0xe0)]['slice'](0x0,-0x1)[_0x429723(0xf1)]('/');return _0x5166a7['raw'][_0x429723(0xcf)]('/')?'/'+_0x5e337a:_0x5e337a;}export function getBaseName(_0x28f269){const _0x176e8f=a129_0x1a6b,_0x2dc63d=parsePath(_0x28f269);return _0x2dc63d[_0x176e8f(0xe0)][_0x2dc63d[_0x176e8f(0xe0)][_0x176e8f(0xdc)]-0x1]||'';}export function isChildPath(_0x77ee73,_0x4c0e24){const _0x5bc0f4=a129_0x1a6b,_0x378002=parsePath(_0x77ee73),_0x5791c6=parsePath(_0x4c0e24);if(_0x378002['segments'][_0x5bc0f4(0xdc)]<=_0x5791c6[_0x5bc0f4(0xe0)][_0x5bc0f4(0xdc)])return![];for(let _0x301be1=0x0;_0x301be1<_0x5791c6[_0x5bc0f4(0xe0)]['length'];_0x301be1++){if(_0x378002[_0x5bc0f4(0xe0)][_0x301be1]!==_0x5791c6[_0x5bc0f4(0xe0)][_0x301be1])return![];}return!![];}export function splitPath(_0x2faea4){const _0x5dbcd4=a129_0x1a6b,_0x54a7d7=parsePath(_0x2faea4);if(_0x54a7d7[_0x5dbcd4(0xe0)][_0x5dbcd4(0xdc)]===0x0)throw new Error('Cannot\x20split\x20empty\x20path');if(_0x54a7d7[_0x5dbcd4(0xe0)][_0x5dbcd4(0xdc)]===0x1)return{'parent':_0x54a7d7[_0x5dbcd4(0xe0)][0x0]};return{'parent':_0x54a7d7[_0x5dbcd4(0xe0)][0x0],'child':_0x54a7d7[_0x5dbcd4(0xe0)][_0x5dbcd4(0xe2)](0x1)[_0x5dbcd4(0xf1)]('/')};}export function isYamlFilePath(_0x27eca5){const _0x197477=a129_0x1a6b;return _0x27eca5[_0x197477(0xee)]('.yml')||_0x27eca5[_0x197477(0xee)](_0x197477(0xe1));}function a129_0x1a6b(_0x231ec4,_0x5ccf34){_0x231ec4=_0x231ec4-0xcc;const _0xd44907=a129_0xd449();let _0x1a6b03=_0xd44907[_0x231ec4];return _0x1a6b03;}export async function resolveYamlFilePath(_0x48c83b,_0x164919=nodeFileSystem){const _0x4804f5=a129_0x1a6b,_0x183d20=a129_0x3bf6d1[_0x4804f5(0xcd)](_0x48c83b);if(!await _0x164919[_0x4804f5(0xcc)](_0x183d20))throw new Error(_0x4804f5(0xde)+_0x48c83b);let _0x221232=a129_0x3bf6d1[_0x4804f5(0xdd)](_0x183d20),_0x340f74=null,_0x36e0bc=null;const _0x29c6a2=a129_0x3bf6d1[_0x4804f5(0xd7)](_0x221232)[_0x4804f5(0xd9)];while(_0x221232!==_0x29c6a2){const _0x17ba49=a129_0x3bf6d1['join'](_0x221232,_0x4804f5(0xf6));if(await _0x164919['exists'](_0x17ba49)){_0x340f74=_0x17ba49,_0x36e0bc=_0x221232;break;}_0x221232=a129_0x3bf6d1['dirname'](_0x221232);}if(!_0x340f74||!_0x36e0bc)throw new Error(_0x4804f5(0xf2)+_0x48c83b);const _0x59cb33=await _0x164919[_0x4804f5(0xd6)](_0x340f74),_0x388ddd=JSON[_0x4804f5(0xd7)](_0x59cb33),_0x4d531c=_0x388ddd['parent_segment'];if(!_0x4d531c)throw new Error(_0x4804f5(0xce));const _0x2941ee=await _0x164919[_0x4804f5(0xd6)](_0x183d20),_0x2f73cd=a129_0x4d6446(_0x2941ee),_0x11b0d9=_0x2f73cd[_0x4804f5(0xf0)];if(!_0x11b0d9)throw new Error('Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20'+_0x48c83b);const _0x49e8bf=_0x2f73cd[_0x4804f5(0xd4)]==='journey'?'journey':'segment',_0xcb7fa=a129_0x3bf6d1[_0x4804f5(0xd0)](_0x36e0bc,_0x183d20),_0x16c692=a129_0x3bf6d1[_0x4804f5(0xdd)](_0xcb7fa),_0x4dff80=_0x16c692==='.'?'':_0x16c692['replace'](/\\/g,'/'),_0x12a575=_0x4dff80?_0x4d531c+'/'+_0x4dff80+'/'+_0x11b0d9:_0x4d531c+'/'+_0x11b0d9;return{'parentSegment':_0x4d531c,'segmentName':_0x11b0d9,'folderPath':_0x4dff80,'fullPath':_0x12a575,'resourceType':_0x49e8bf};}function a129_0xd449(){const _0xa72f88=['split','type','filter','readFile','parse','test','root','trim','pop','length','dirname','File\x20not\x20found:\x20','Cannot\x20navigate\x20above\x20root','segments','.yaml','slice','Path\x20segment\x20cannot\x20be\x20empty','isAbsolute','1935050kFIKOL','push','834XoVxYN','10985840WFKXkA','867031wldldW','3727812bABdah','substring','17350plmdrj','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','endsWith','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','name','join','No\x20tdx.json\x20found\x20for\x20file:\x20','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','Path\x20attempts\x20to\x20navigate\x20above\x20root','232484JmmyvB','tdx.json','raw','5KsHhfG','exists','resolve','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','startsWith','relative','1377vqpOuO','60872XMBzCX'];a129_0xd449=function(){return _0xa72f88;};return a129_0xd449();}
@@ -1 +1 @@
1
- (function(_0x48c66b,_0x1b6b42){const _0xb7625=a130_0x2274,_0x2a42c5=_0x48c66b();while(!![]){try{const _0x56db3b=parseInt(_0xb7625(0x155))/0x1*(parseInt(_0xb7625(0x152))/0x2)+-parseInt(_0xb7625(0x156))/0x3+parseInt(_0xb7625(0x14a))/0x4+parseInt(_0xb7625(0x154))/0x5*(-parseInt(_0xb7625(0x14e))/0x6)+-parseInt(_0xb7625(0x157))/0x7+-parseInt(_0xb7625(0x149))/0x8*(-parseInt(_0xb7625(0x14b))/0x9)+parseInt(_0xb7625(0x14c))/0xa*(-parseInt(_0xb7625(0x153))/0xb);if(_0x56db3b===_0x1b6b42)break;else _0x2a42c5['push'](_0x2a42c5['shift']());}catch(_0x2082a5){_0x2a42c5['push'](_0x2a42c5['shift']());}}}(a130_0x31f8,0x69544));function a130_0x31f8(){const _0x57eb2a=['29720lBpsMT','595772MKhlYl','653865BOGaeA','1820119Nsbojd','759456VpnHBF','2220848xSAdZy','27CgYsGG','4609960MCbEzK','.\x20Parent\x20name\x20cannot\x20be\x20empty','66OXqfLZ','indexOf','substring','Invalid\x20segment\x20reference\x20format:\x20','2YQCTGk','11zZFbkd'];a130_0x31f8=function(){return _0x57eb2a;};return a130_0x31f8();}function a130_0x2274(_0x39d2a5,_0x43d532){_0x39d2a5=_0x39d2a5-0x149;const _0x31f8ce=a130_0x31f8();let _0x2274cd=_0x31f8ce[_0x39d2a5];return _0x2274cd;}export function parseSegmentRef(_0x444065){const _0x4cd69=a130_0x2274,_0x1c3c3d=_0x444065[_0x4cd69(0x14f)]('/');if(_0x1c3c3d===-0x1)return{'parentId':_0x444065};if(_0x1c3c3d===0x0)throw new Error(_0x4cd69(0x151)+_0x444065+_0x4cd69(0x14d));const _0x25670c=_0x444065[_0x4cd69(0x150)](0x0,_0x1c3c3d),_0x412361=_0x444065[_0x4cd69(0x150)](_0x1c3c3d+0x1);if(_0x412361==='')throw new Error(_0x4cd69(0x151)+_0x444065+'.\x20Child\x20name\x20cannot\x20be\x20empty');return{'parentId':_0x25670c,'childId':_0x412361};}
1
+ function a130_0x341f(){const _0x1e5883=['.\x20Parent\x20name\x20cannot\x20be\x20empty','indexOf','275422mTZoRe','20xCwCqb','Invalid\x20segment\x20reference\x20format:\x20','296CyLtxz','290pSDdWf','61496ZmWDyP','3562284eHtapU','118qoHOix','204epccbI','769086rooGjK','8287896MWUMOt','7179ccoNRk','substring','3720525zUotFj'];a130_0x341f=function(){return _0x1e5883;};return a130_0x341f();}(function(_0x41f4f6,_0x164033){const _0x56f93f=a130_0x19c4,_0x177735=_0x41f4f6();while(!![]){try{const _0x3d691f=-parseInt(_0x56f93f(0x1df))/0x1*(-parseInt(_0x56f93f(0x1eb))/0x2)+-parseInt(_0x56f93f(0x1e1))/0x3+parseInt(_0x56f93f(0x1e9))/0x4*(-parseInt(_0x56f93f(0x1e8))/0x5)+-parseInt(_0x56f93f(0x1de))/0x6+parseInt(_0x56f93f(0x1e4))/0x7*(-parseInt(_0x56f93f(0x1e7))/0x8)+-parseInt(_0x56f93f(0x1ed))/0x9*(parseInt(_0x56f93f(0x1e5))/0xa)+-parseInt(_0x56f93f(0x1ea))/0xb*(-parseInt(_0x56f93f(0x1ec))/0xc);if(_0x3d691f===_0x164033)break;else _0x177735['push'](_0x177735['shift']());}catch(_0x2c1fa6){_0x177735['push'](_0x177735['shift']());}}}(a130_0x341f,0xc0a18));function a130_0x19c4(_0x31461e,_0x3f322d){_0x31461e=_0x31461e-0x1de;const _0x341f00=a130_0x341f();let _0x19c479=_0x341f00[_0x31461e];return _0x19c479;}export function parseSegmentRef(_0x55c0){const _0x2b39ac=a130_0x19c4,_0x2fba34=_0x55c0[_0x2b39ac(0x1e3)]('/');if(_0x2fba34===-0x1)return{'parentId':_0x55c0};if(_0x2fba34===0x0)throw new Error(_0x2b39ac(0x1e6)+_0x55c0+_0x2b39ac(0x1e2));const _0x1a2e8c=_0x55c0['substring'](0x0,_0x2fba34),_0x4f433f=_0x55c0[_0x2b39ac(0x1e0)](_0x2fba34+0x1);if(_0x4f433f==='')throw new Error(_0x2b39ac(0x1e6)+_0x55c0+'.\x20Child\x20name\x20cannot\x20be\x20empty');return{'parentId':_0x1a2e8c,'childId':_0x4f433f};}