@treasuredata/tdx 0.28.2 → 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
- function a126_0x3236(_0x23d280,_0xbd4b5a){_0x23d280=_0x23d280-0x104;const _0x300e32=a126_0x300e();let _0x323621=_0x300e32[_0x23d280];return _0x323621;}const a126_0x18539b=a126_0x3236;(function(_0x2913aa,_0x164838){const _0x2894a5=a126_0x3236,_0x478f2f=_0x2913aa();while(!![]){try{const _0x49fc83=-parseInt(_0x2894a5(0x111))/0x1+parseInt(_0x2894a5(0x11c))/0x2+parseInt(_0x2894a5(0x10a))/0x3+parseInt(_0x2894a5(0x108))/0x4*(parseInt(_0x2894a5(0x10d))/0x5)+parseInt(_0x2894a5(0x114))/0x6+-parseInt(_0x2894a5(0x110))/0x7*(-parseInt(_0x2894a5(0x115))/0x8)+parseInt(_0x2894a5(0x116))/0x9*(-parseInt(_0x2894a5(0x105))/0xa);if(_0x49fc83===_0x164838)break;else _0x478f2f['push'](_0x478f2f['shift']());}catch(_0x1dbe07){_0x478f2f['push'](_0x478f2f['shift']());}}}(a126_0x300e,0x7c5d5));import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';import a126_0x20c626 from'path';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a126_0x18539b(0x10f));export function getPushRecoveryPath(_0x1b5f82){const _0x154429=a126_0x18539b,_0x49b345=a126_0x20c626[_0x154429(0x118)](_0x1b5f82),_0x2f9b66=a126_0x20c626['basename'](_0x1b5f82);return a126_0x20c626[_0x154429(0x10b)](_0x49b345,'.'+_0x2f9b66+_0x154429(0x113));}export function readPushRecovery(_0x29e660){const _0x43f1a8=a126_0x18539b,_0x49a200=getPushRecoveryPath(_0x29e660);if(!existsSync(_0x49a200))return undefined;try{const _0xfc4cc0=readFileSync(_0x49a200,_0x43f1a8(0x10e)),_0x557799=JSON[_0x43f1a8(0x119)](_0xfc4cc0);if(_0x557799?.[_0x43f1a8(0x106)]!==0x1||typeof _0x557799['journeyName']!==_0x43f1a8(0x11a))return undefined;return _0x557799;}catch(_0x3ace2a){return _0x3ace2a instanceof SyntaxError?logger['debug'](_0x43f1a8(0x112)+_0x3ace2a):logger[_0x43f1a8(0x109)](_0x43f1a8(0x107)+_0x3ace2a),undefined;}}export function writePushRecovery(_0x4d9596,_0x5690ac){const _0x234818=a126_0x18539b,_0x9ce7c7=getPushRecoveryPath(_0x4d9596),_0xf15f8f=_0x9ce7c7+_0x234818(0x104);writeFileSync(_0xf15f8f,JSON['stringify'](_0x5690ac,null,0x2)+'\x0a','utf-8'),renameSync(_0xf15f8f,_0x9ce7c7);}export function deletePushRecovery(_0x5656b5){const _0x18845c=a126_0x18539b,_0x39b9f2=getPushRecoveryPath(_0x5656b5);try{unlinkSync(_0x39b9f2);}catch(_0x34f6f5){_0x34f6f5[_0x18845c(0x11b)]!=='ENOENT'&&logger[_0x18845c(0x117)](_0x18845c(0x10c)+_0x34f6f5);}}function a126_0x300e(){const _0x2d0702=['1551894aiWRLu','986216TcWNMD','15601833boaKWG','debug','dirname','parse','string','code','340008esDjLg','.tmp','10GGvlWv','version','Failed\x20to\x20read\x20push\x20recovery\x20file:\x20','24ogBsIE','warn','1854489sNzUrb','join','Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20','524665OJRMUY','utf-8','tdx.sdk.push-recovery','35dFuDIq','49865rPnprv','Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20','.push-recovery.json'];a126_0x300e=function(){return _0x2d0702;};return a126_0x300e();}export function saveSegmentToPushRecovery(_0x2ae639,_0x43079b,_0x15486d,_0xbe197e){const _0x1d6fb5=readPushRecovery(_0x2ae639),_0x4c5a90=_0x1d6fb5?.['journeyName']===_0x43079b?{..._0x1d6fb5,'updatedAt':new Date()['toISOString']()}:{'version':0x1,'journeyName':_0x43079b,'updatedAt':new Date()['toISOString'](),'segments':{}};_0x4c5a90['segments'][_0x15486d]=_0xbe197e,writePushRecovery(_0x2ae639,_0x4c5a90);}
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_0x2ef8be=a127_0x5dc7;(function(_0x5301c7,_0x20bf0d){const _0x1f4bdd=a127_0x5dc7,_0x1d3ac4=_0x5301c7();while(!![]){try{const _0x27c1cf=-parseInt(_0x1f4bdd(0x1e3))/0x1*(-parseInt(_0x1f4bdd(0x1a4))/0x2)+-parseInt(_0x1f4bdd(0x1d9))/0x3*(-parseInt(_0x1f4bdd(0x196))/0x4)+-parseInt(_0x1f4bdd(0x1c3))/0x5*(parseInt(_0x1f4bdd(0x16d))/0x6)+-parseInt(_0x1f4bdd(0x1dc))/0x7+-parseInt(_0x1f4bdd(0x1ad))/0x8+parseInt(_0x1f4bdd(0x13a))/0x9*(parseInt(_0x1f4bdd(0x170))/0xa)+parseInt(_0x1f4bdd(0x1bc))/0xb*(parseInt(_0x1f4bdd(0xee))/0xc);if(_0x27c1cf===_0x20bf0d)break;else _0x1d3ac4['push'](_0x1d3ac4['shift']());}catch(_0x1d5a26){_0x1d3ac4['push'](_0x1d3ac4['shift']());}}}(a127_0x3fb0,0x4c313));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';function a127_0x5dc7(_0x1c6e0e,_0x18cf4b){_0x1c6e0e=_0x1c6e0e-0xe7;const _0x3fb04a=a127_0x3fb0();let _0x5dc765=_0x3fb04a[_0x1c6e0e];return _0x5dc765;}const logger=Logger['of'](a127_0x2ef8be(0x10f));export const PENDING_SEGMENT_PREFIX='__pending_';export const PENDING_ACTIVATION_PREFIX=a127_0x2ef8be(0x165);export function createPendingSegmentId(_0x54ceae){return''+PENDING_SEGMENT_PREFIX+_0x54ceae+'__';}export function isPendingSegmentId(_0x3249b6){const _0x3c3fd7=a127_0x2ef8be;return _0x3249b6[_0x3c3fd7(0x107)](PENDING_SEGMENT_PREFIX)&&!_0x3249b6[_0x3c3fd7(0x107)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x1578bb){const _0x38692e=a127_0x2ef8be;return _0x1578bb[_0x38692e(0x10e)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x2cb54e){return''+PENDING_ACTIVATION_PREFIX+_0x2cb54e+'__';}export function isPendingActivationId(_0x13648e){const _0x4d7f36=a127_0x2ef8be;return _0x13648e[_0x4d7f36(0x107)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x9bd3f9){const _0x3a7ba6=a127_0x2ef8be;return _0x9bd3f9[_0x3a7ba6(0x10e)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x38bcc5,_0x2f7209){const _0x124181=a127_0x2ef8be,_0x190bd4=_0x38bcc5+'::'+(_0x2f7209['trim']()||_0x124181(0xfe)),_0x38f8c8=createHash(_0x124181(0x126))[_0x124181(0x16a)](_0x190bd4)[_0x124181(0x19e)](_0x124181(0x1b3))[_0x124181(0x132)](0x0,0xc);return'journey_entry_criteria_'+_0x38f8c8;}export function ensureJourneyDefaults(_0x11472e){const _0x55834b=a127_0x2ef8be;!_0x11472e[_0x55834b(0x192)]&&(_0x11472e[_0x55834b(0x192)]=''),!_0x11472e[_0x55834b(0x106)]&&(_0x11472e['state']='draft');}export function injectExistingStageIds(_0x3ec4b2,_0x4f3483){const _0x152db6=a127_0x2ef8be,_0x3c920a=new Map(_0x4f3483[_0x152db6(0x122)](_0x3ab3c3=>[_0x3ab3c3[_0x152db6(0x1a0)],_0x3ab3c3['id']]));for(const _0xca662f of _0x3ec4b2){if(!_0xca662f['id']){const _0x3c2a29=_0x3c920a[_0x152db6(0x182)](_0xca662f[_0x152db6(0x1a0)]);_0x3c2a29&&(_0xca662f['id']=_0x3c2a29);}}}export function resolveTDFolderPath(_0x543404,_0x4cfcd5,_0xfeb1f0){const _0x1b7e1c=a127_0x2ef8be;if(!_0x4cfcd5)return _0x543404;if(_0x543404===_0xfeb1f0||_0x543404[_0x1b7e1c(0x107)](_0xfeb1f0+'/'))return _0x543404;return _0x543404?_0xfeb1f0+'/'+_0x543404:_0xfeb1f0;}export function addFoldersToCreate(_0x1e4421,_0x38a71e,_0xddac67){const _0x16774a=a127_0x2ef8be;if(!_0x1e4421)return;if(_0x38a71e['has'](_0x1e4421))return;const _0x4c9e68=_0x1e4421[_0x16774a(0x148)]('/');let _0x39916d='';for(const _0x520dc2 of _0x4c9e68){_0x39916d=_0x39916d?_0x39916d+'/'+_0x520dc2:_0x520dc2,!_0x38a71e['has'](_0x39916d)&&_0xddac67[_0x16774a(0x1e6)](_0x39916d);}}export function sortFoldersByDepth(_0x4304b3){const _0x5c0b94=a127_0x2ef8be;return[..._0x4304b3][_0x5c0b94(0x114)]((_0x1265f7,_0x5869f3)=>{const _0x41ade5=_0x5c0b94,_0x39a203=(_0x1265f7[_0x41ade5(0xfc)](/\//g)||[])[_0x41ade5(0x1b1)],_0x1b7574=(_0x5869f3[_0x41ade5(0xfc)](/\//g)||[])[_0x41ade5(0x1b1)];return _0x39a203-_0x1b7574;});}import*as a127_0x27e8c7 from'yaml';import{readFileSync}from'fs';import a127_0x24bb8b from'path';import{isJourneyDef,parseYamlString as a127_0x584c1a,toYamlString as a127_0x50010e,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(_0x4fa1c0){const _0x442020=a127_0x2ef8be;if(Array[_0x442020(0x144)](_0x4fa1c0))return'['+_0x4fa1c0[_0x442020(0x122)](_0x41833d=>stableStringify(_0x41833d))[_0x442020(0x1ae)](',')+']';if(_0x4fa1c0&&typeof _0x4fa1c0==='object'){const _0x1e980b=_0x4fa1c0,_0x5182e2=Object[_0x442020(0x185)](_0x1e980b)[_0x442020(0x114)](),_0x8e73d3=_0x5182e2[_0x442020(0x122)](_0x577d1d=>'\x22'+_0x577d1d+'\x22:'+stableStringify(_0x1e980b[_0x577d1d]));return'{'+_0x8e73d3['join'](',')+'}';}const _0x58e536=JSON['stringify'](_0x4fa1c0);return _0x58e536===undefined?'null':_0x58e536;}function activationSignature(_0x5a1fe2){const _0x4ddc75=a127_0x2ef8be,_0x46ad6e={'connection':_0x5a1fe2[_0x4ddc75(0x1d4)],..._0x5a1fe2[_0x4ddc75(0x197)]!==undefined&&{'all_columns':_0x5a1fe2[_0x4ddc75(0x197)]},..._0x5a1fe2['columns']!==undefined&&{'columns':_0x5a1fe2['columns']},..._0x5a1fe2[_0x4ddc75(0x1d7)]!==undefined&&{'behavior':_0x5a1fe2[_0x4ddc75(0x1d7)]},..._0x5a1fe2[_0x4ddc75(0xf9)]!==undefined&&{'schedule':_0x5a1fe2[_0x4ddc75(0xf9)]},..._0x5a1fe2[_0x4ddc75(0x1e4)]!==undefined&&{'notification':_0x5a1fe2[_0x4ddc75(0x1e4)]},..._0x5a1fe2['connector_config']!==undefined&&{'connector_config':_0x5a1fe2[_0x4ddc75(0x164)]},..._0x5a1fe2['activation_template_id']!==undefined&&{'activation_template_id':_0x5a1fe2['activation_template_id']}};return stableStringify(_0x46ad6e);}async function fetchSegment(_0x30b61b,_0x2cffac,_0x424dce,_0x5e5aed){const _0x36e031=a127_0x2ef8be,_0x225f7d=_0x5e5aed?.[_0x36e031(0x190)](_0x577182=>_0x577182['id']===_0x424dce);if(_0x225f7d)return _0x225f7d;try{return await _0x30b61b[_0x36e031(0xfe)]['getSegment'](_0x2cffac,_0x424dce);}catch(_0x2cb8f5){logger['debug'](_0x36e031(0x143)+_0x424dce+',\x20falling\x20back\x20to\x20getSegmentEntity:\x20'+_0x2cb8f5);try{return await _0x30b61b[_0x36e031(0xfe)][_0x36e031(0x173)](_0x424dce);}catch(_0x3b4f5c){return logger[_0x36e031(0x1d3)](_0x36e031(0x1d1)+_0x424dce+':\x20'+_0x3b4f5c),null;}}}function recoverSegmentIdsFromPushRecovery(_0x6d2f4,_0x25abdd,_0x496db7){const _0x1e3487=a127_0x2ef8be,_0xfc8568=readPushRecovery(_0x6d2f4[_0x1e3487(0x167)]);if(_0xfc8568?.[_0x1e3487(0xf4)]===_0x6d2f4[_0x1e3487(0x12d)]['name'])for(const [_0x13670a,_0x3dcfb0]of Object[_0x1e3487(0xec)](_0xfc8568[_0x1e3487(0x1cb)])){const _0x2c617a=generateDeterministicJourneySegmentName(_0x6d2f4[_0x1e3487(0x12d)]['name'],_0x13670a);_0x3dcfb0[_0x1e3487(0xef)]===_0x2c617a&&(_0x25abdd[_0x1e3487(0x1bd)](_0x13670a,_0x3dcfb0[_0x1e3487(0x105)]),_0x496db7[_0x1e3487(0x1bd)](_0x13670a,_0x3dcfb0[_0x1e3487(0x105)]));}}async function createOrRecoverEmbeddedSegment(_0x2a18ca,_0x11ab8c,_0x5d070e,_0x40783f){const _0x4ced5a=a127_0x2ef8be;let _0x329a02;try{_0x329a02=await _0x2a18ca['segment'][_0x4ced5a(0x1a3)]({'name':_0x5d070e['uniqueSegmentName'],'description':_0x5d070e[_0x4ced5a(0x192)],'journeyId':_0x5d070e[_0x4ced5a(0x1c2)],'rule':_0x40783f(_0x5d070e['resolvedRule'],!![]),'countPopulation':!![],'parentFolderId':_0x5d070e[_0x4ced5a(0x191)],'audienceId':_0x5d070e['parentId']});}catch(_0x2a6494){const _0x3b88d1=_0x2a6494 instanceof Error&&_0x2a6494[_0x4ced5a(0x1b7)][_0x4ced5a(0x158)]('Name\x20has\x20already\x20been\x20taken');if(_0x3b88d1){const _0x35775f=readPushRecovery(_0x11ab8c[_0x4ced5a(0x167)]),_0x973f9d=_0x35775f?.[_0x4ced5a(0xf4)]===_0x11ab8c[_0x4ced5a(0x12d)][_0x4ced5a(0x1a0)]?_0x35775f[_0x4ced5a(0x1cb)][_0x5d070e[_0x4ced5a(0x11e)]]:undefined;if(_0x973f9d?.[_0x4ced5a(0xef)]===_0x5d070e[_0x4ced5a(0x140)])await _0x2a18ca[_0x4ced5a(0xfe)][_0x4ced5a(0x16e)](_0x5d070e[_0x4ced5a(0x166)],_0x973f9d[_0x4ced5a(0x105)],{'description':_0x5d070e[_0x4ced5a(0x192)],'rule':_0x40783f(_0x5d070e['resolvedRule'],!![]),'countPopulation':!![]}),_0x329a02=_0x973f9d[_0x4ced5a(0x105)];else throw new SDKError(ErrorCode['SEGMENT_UPDATE_ERROR'],_0x4ced5a(0x177)+_0x5d070e[_0x4ced5a(0x11e)]+_0x4ced5a(0xf8)+('Delete\x20the\x20push\x20recovery\x20file\x20('+_0x11ab8c[_0x4ced5a(0x167)]['replace'](/([^/]+)$/,_0x4ced5a(0x18b))+')\x20')+_0x4ced5a(0x15b),_0x2a6494);}else throw _0x2a6494;}return saveSegmentToPushRecovery(_0x11ab8c['absolutePath'],_0x11ab8c[_0x4ced5a(0x12d)][_0x4ced5a(0x1a0)],_0x5d070e[_0x4ced5a(0x11e)],{'segmentId':_0x329a02,'uniqueServerName':_0x5d070e[_0x4ced5a(0x140)],'createdAt':new Date()[_0x4ced5a(0x11f)]()}),_0x329a02;}export async function prepareSegmentFiles(_0xc395aa,_0x1256eb,_0x2876f1,_0x4cd378,_0x120599){const _0x1827b2=a127_0x2ef8be,{activationDefToCreateRequest:_0x1c6c3d}=await import(_0x1827b2(0x1e5)),_0x4d51f1=[],_0xde25a6=new Set();for(const {yamlConfig:_0x5b147a,folderPath:_0x1bbfa0,sourcePath:_0x3ec9e1}of _0xc395aa){const _0x30ddfd=resolveTDFolderPath(_0x1bbfa0,_0x4cd378,_0x120599),_0x398f20=_0x30ddfd+':'+_0x5b147a[_0x1827b2(0x1a0)],_0x132b44=_0x1256eb[_0x1827b2(0x134)]['get'](_0x398f20),_0x2b5eae=_0x132b44?_0x1256eb['activationsBySegmentId'][_0x1827b2(0x182)](_0x132b44['id'])||[]:[];addFoldersToCreate(_0x30ddfd,_0x1256eb['folderPathToId'],_0xde25a6);const _0x4bc343=calculateActivationActions(_0x5b147a[_0x1827b2(0x176)]||[],_0x2b5eae,_0x1256eb[_0x1827b2(0x14c)],_0x1256eb['connectionIdToNameMap']);for(const _0x1cfc67 of _0x4bc343){(_0x1cfc67['type']===_0x1827b2(0xf5)||_0x1cfc67[_0x1827b2(0x1c9)]===_0x1827b2(0x16a))&&_0x1cfc67['yamlActivation']&&(_0x1cfc67[_0x1827b2(0x100)]=await _0x1c6c3d(_0x1cfc67['yamlActivation'],_0x2876f1));}const _0x19876f=calculateSegmentDiff(_0x5b147a,_0x132b44,_0x2b5eae,_0x1256eb[_0x1827b2(0x14c)],_0x1256eb[_0x1827b2(0x13e)]);_0x4d51f1[_0x1827b2(0x169)]({'relativePath':_0x5b147a[_0x1827b2(0x1a0)],'absolutePath':_0x3ec9e1,'yamlConfig':_0x5b147a,'folderPath':_0x30ddfd,'existingSegment':_0x132b44,'existingActivations':_0x2b5eae,'isNew':_0x19876f[_0x1827b2(0x1df)],'hasChanges':_0x19876f['hasChanges'],'diff':_0x19876f[_0x1827b2(0x1d6)],'activationActions':_0x4bc343});}return{'segmentFiles':_0x4d51f1,'foldersToCreate':_0xde25a6};}export async function prepareJourneyFiles(_0x55a976,_0x17301a,_0x5e6c22,_0x1b1aad){const _0xc2f93b=a127_0x2ef8be,_0x5340f0=[],_0x58be5e=new Set();for(const {yamlConfig:_0x5ca18c,folderPath:_0x25dcd1,sourcePath:_0x11ee18}of _0x55a976){const _0x39a239=resolveTDFolderPath(_0x25dcd1,_0x5e6c22,_0x1b1aad),_0x2952e7=_0x39a239+':'+_0x5ca18c[_0xc2f93b(0x1a0)],_0x265a57=_0x17301a[_0xc2f93b(0x1a9)][_0xc2f93b(0x182)](_0x2952e7);let _0x2afb2a,_0x2580c2;if(_0x265a57&&_0x265a57[_0xc2f93b(0x1b1)]>0x0){const _0x1ca760=buildLocalExpandedRuleMappings(_0x5ca18c),{createYamlContext:_0x99044c,prefetchJourneySegments:_0x51d657}=createPushYamlContextForBundle(_0x17301a['deps'],_0x17301a[_0xc2f93b(0x166)],_0x17301a[_0xc2f93b(0x12e)],_0x1ca760,_0x17301a[_0xc2f93b(0x14c)],_0x17301a['connectionIdToNameMap'],_0x17301a[_0xc2f93b(0x1a1)],_0x17301a[_0xc2f93b(0x17a)]);await _0x51d657(_0x265a57['map'](_0x187def=>_0x187def['id']));const _0x13839a=hasMultipleVersions(_0x5ca18c),_0x515c40=async _0x3661de=>{const _0x435cb6=_0xc2f93b,_0x80ca2d=_0x17301a[_0x435cb6(0x17a)]?.['get'](_0x3661de);if(_0x80ca2d)return _0x80ca2d;return _0x17301a[_0x435cb6(0x174)]({'journeyId':_0x3661de,'journeyName':_0x5ca18c[_0x435cb6(0x1a0)],'isMultiVersion':_0x265a57['length']>0x1});};if(_0x13839a&&_0x265a57['length']>0x1){const _0x211c08=[];for(const _0x14b26e of _0x265a57){const _0x16a42c=_0x14b26e[_0xc2f93b(0x195)]||0x1;_0x17301a[_0xc2f93b(0x17e)]?.[_0xc2f93b(0x16a)](_0xc2f93b(0x131)+_0x5ca18c['name']+'\x20v'+_0x16a42c);const _0x10bf83=await _0x515c40(_0x14b26e['id']),_0x94c129=_0x99044c(_0x14b26e['id']),_0x3878a8=await journeyResponseToDef(_0x10bf83,_0x94c129);_0x211c08[_0xc2f93b(0x169)]({'item':_0x14b26e,'yaml':_0x3878a8});}const _0x5adc6c=buildLocalRuleToNameMappingFromJourney(_0x5ca18c);_0x2580c2=buildMergedJourneyDef(_0x211c08,_0x5adc6c);const _0x15f0da=Math[_0xc2f93b(0x179)](..._0x211c08[_0xc2f93b(0x122)](_0x2d1af6=>_0x2d1af6[_0xc2f93b(0x130)]['versionNumber']||0x0)),_0x4b2d96=_0x265a57[_0xc2f93b(0x190)](_0x221a5c=>(_0x221a5c['versionNumber']||0x0)===_0x15f0da);_0x4b2d96&&(_0x17301a['progress']?.[_0xc2f93b(0x16a)](_0xc2f93b(0x131)+_0x5ca18c[_0xc2f93b(0x1a0)]+'\x20v'+_0x15f0da),_0x2afb2a=await _0x515c40(_0x4b2d96['id']));}else{const _0x3bb231=_0x265a57[_0x265a57[_0xc2f93b(0x1b1)]-0x1];_0x17301a[_0xc2f93b(0x17e)]?.['update'](_0xc2f93b(0x131)+_0x5ca18c[_0xc2f93b(0x1a0)]),_0x2afb2a=await _0x515c40(_0x3bb231['id']);const _0x41d5b2=_0x99044c(_0x3bb231['id']),_0x5aa811=await journeyResponseToDef(_0x2afb2a,_0x41d5b2),_0x1d454c=buildLocalRuleToNameMappingFromJourney(_0x5ca18c);_0x2580c2=buildMergedJourneyDef([{'item':_0x3bb231,'yaml':_0x5aa811}],_0x1d454c);}}addFoldersToCreate(_0x39a239,_0x17301a[_0xc2f93b(0x11d)],_0x58be5e);const _0x337571=calculateJourneyDiff(_0x5ca18c,_0x2580c2);_0x5340f0[_0xc2f93b(0x169)]({'relativePath':_0x5ca18c[_0xc2f93b(0x1a0)],'absolutePath':_0x11ee18,'yamlConfig':_0x5ca18c,'folderPath':_0x39a239,'existingJourney':_0x2afb2a,'isNew':_0x337571[_0xc2f93b(0x1df)],'hasChanges':_0x337571['hasChanges'],'diff':_0x337571[_0xc2f93b(0x1d6)]});}return{'journeyFiles':_0x5340f0,'foldersToCreate':_0x58be5e};}export function calculateActivationActions(_0x28bfab,_0x4042ee,_0xd63b52,_0x489b27){const _0x27d121=a127_0x2ef8be,_0x2ab36d=[],_0x59b7da=new Map();for(const _0x45b7f9 of _0x4042ee){_0x59b7da[_0x27d121(0x1bd)](_0x45b7f9[_0x27d121(0x1a0)],_0x45b7f9);}const _0xfafb07=new Map();for(const _0xd119c0 of _0x28bfab){_0xfafb07[_0x27d121(0x1bd)](_0xd119c0[_0x27d121(0x1a0)],_0xd119c0);}for(const _0x964b58 of _0x28bfab){const _0x1e0e97=_0x59b7da[_0x27d121(0x182)](_0x964b58[_0x27d121(0x1a0)]);if(!_0x1e0e97)_0x2ab36d[_0x27d121(0x169)]({'type':_0x27d121(0xf5),'name':_0x964b58['name'],'yamlActivation':_0x964b58});else{const _0xbff981=activationResponseToDef(_0x1e0e97,_0xd63b52,_0x489b27),_0x44552a=a127_0x27e8c7[_0x27d121(0x1ba)](_0xbff981),_0x25651d=a127_0x27e8c7[_0x27d121(0x1ba)](_0x964b58);_0x44552a!==_0x25651d&&_0x2ab36d[_0x27d121(0x169)]({'type':_0x27d121(0x16a),'name':_0x964b58[_0x27d121(0x1a0)],'yamlActivation':_0x964b58,'existingActivation':_0x1e0e97});}}for(const _0x93a09b of _0x4042ee){!_0xfafb07['has'](_0x93a09b[_0x27d121(0x1a0)])&&_0x2ab36d[_0x27d121(0x169)]({'type':'delete','name':_0x93a09b[_0x27d121(0x1a0)],'existingActivation':_0x93a09b});}return _0x2ab36d;}function calculateYamlDiff(_0x2fdb4c,_0x4f8a80){if(_0x4f8a80){const _0x287a23=generateDiff(_0x4f8a80,_0x2fdb4c),_0x37b362=hasChanges(_0x287a23);return{'isNew':![],'hasChanges':_0x37b362,'diff':_0x37b362?formatDiffWithColors(_0x287a23):undefined};}const _0x7bab67=generateDiff('',_0x2fdb4c);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x7bab67)};}function a127_0x3fb0(){const _0x4a06f4=['some','user','logWarning','activationContext','journey','created','includes','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','journeys','and\x20the\x20server\x20segment,\x20then\x20retry.','withProgress','JOURNEY_UPDATE_ERROR','onProgress','./journey-yaml.js','parse','Created\x20segment\x20\x27','activationParams','Duration','connector_config','__pending_act_','parentId','absolutePath','SEGMENT_UPDATE_ERROR','push','update','\x27...','Condition','1755966KulnMR','updateSegmentById','Creating\x20folder\x20\x27','579320QcCwWK','folder_creating','conditions','getSegmentEntity','fetchJourney','toString','activations','Embedded\x20segment\x20\x27','waitStep','max','journeyById','journey_updated','hasChanges','conditionTimeoutDuration','progress','createFolder','with','delete','get','toLowerCase','folder_created','keys','dirname','getJourney','createdSegmentId','goal\x20criteria','getActivation','.$1.push-recovery.json','activation_created','DecisionPoint','updateActivation','listActivations','find','folderId','description','Updating\x20activation\x20\x27','activation_deleted','versionNumber','8dgFyuA','all_columns','Activation','segment_created','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','valid','Segment\x20not\x20found:\x20','resolveSegment','digest','from','name','activationStepsById','existingSegment','createJourneySegment','40dkgEAg','relationships','effectiveFolderId','journeyStages','WaitStep','journeyBundlesByFolderAndName','exitCriterias','journey_creating','segment_updating','2763168zZfdxn','join',').\x20','deleteActivation','length','Journey\x20\x27','hex','../../utils/async.js','activationActions','Creating\x20segment\x20\x27','message','parentFolder','embedded_segment_created','stringify','utf-8','9444347UlvoZs','set','conditionSegmentId','Deleted\x20activation\x20\x27','run_after_journey_refresh','createActivation','journeyId','10uiGgyV','existingJourney','entry','journeyActivationNameToId','Creating\x20activation\x20\x27','goal','type','\x27\x20milestone','segments','errors','action','\x27\x20not\x20found\x20in\x20journey\x20\x27','\x0a\x20\x20','all','getSegmentEntity\x20also\x20failed\x20for\x20','segment_deleting','debug','connection','createSegment','diff','behavior','branches','220839EAmRlp','parseDocument','embedded_activation_created','2619358BMocDS','NOT_FOUND','stages','isNew','journeyBundleName','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','Stage\x20\x27','13180rKgjOI','notification','./child-segment-yaml.js','add','\x27\x20from\x20file:\x20','\x20activation\x20\x27','Entry\x20criteria:\x20','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','Failed\x20to\x20fetch\x20referenced\x20segment\x20','journey_updating','entries','steps','12lZHOPw','uniqueServerName','index','Segment\x20not\x20found','Created\x20folder\x20\x27','relative','journeyName','create','filter','Deleting\x20activation\x20\x27','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','schedule','logInfo','embeddedSegmentNameToId','match','conditionTimeoutUnit','segment','ACTIVATION_UPDATE_ERROR','validatedRequest','resolveJourneyId','Created\x20journey\x20\x27','activation_','buildUserMaps','segmentId','state','startsWith','\x27\x20for\x20','existingActivation','waitStepType','logSuccess','embedded_activation_creating','\x27\x20wait\x20condition','replace','tdx.sdk.push-workflow','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','attributes','INTERNAL','data','sort','Failed\x20to\x20','logDeleted','has','Updated\x20segment\x20\x27','entry_criteria','milestone','size','Activation\x20not\x20found:\x20','folderPathToId','localName','toISOString','journey_created','ACTIVATION_SYNTAX_ERROR','map','verbose','deleted','folderPath','sha1','nameToType','\x27\x20decision\x20point\x20branch\x20\x27','SEGMENT_SYNTAX_ERROR','values','results','\x27\x20exit\x20criteria','yamlConfig','existingSegments','activation_updated','item','Fetching\x20','slice','reduce','segmentByFolderAndName','unchanged','\x27\x20to\x20local\x20\x27','segment_creating','journeyActivationStepId','SEGMENT_NOT_FOUND','54CUpupR','\x20(referenced\x20in\x20journey\x20','segmentFolderId','day','connectionIdToNameMap','rootFolderId','uniqueSegmentName','kind','updated','getSegment\x20failed\x20for\x20','isArray','nameToId','\x27\x20entry\x20criteria','Updated\x20activation\x20\x27','split','\x20journey\x20from\x20file:\x20','rule','waitStepUnit','idToEmailMap','stage\x20\x27','segmentNameToId','idToName','Created\x20activation\x20\x27','entryCriteria'];a127_0x3fb0=function(){return _0x4a06f4;};return a127_0x3fb0();}export function calculateSegmentDiff(_0x4c9359,_0x3e5e32,_0x3f3426,_0x39ec5c,_0x5cc411){const _0x378e8b=segmentToYamlString(_0x4c9359),_0xf73162=_0x3e5e32?segmentToYamlString(segmentWithActivationsToYaml(_0x3e5e32,_0x3f3426,undefined,_0x39ec5c,_0x5cc411)):undefined;return calculateYamlDiff(_0x378e8b,_0xf73162);}export function calculateJourneyDiff(_0x1a03dd,_0x3f9edb){const _0x564761=normalizeJourneyDef(_0x1a03dd,_0x1a03dd),_0x56d665=a127_0x50010e(_0x564761),_0x3e987a=_0x3f9edb?a127_0x50010e(normalizeJourneyDef(_0x3f9edb,_0x1a03dd)):undefined;return calculateYamlDiff(_0x56d665,_0x3e987a);}export function findSegmentsToDelete(_0x301668,_0x28f18c,_0x4daf5d,_0x1681e2,_0x2680ac){const _0x221d18=a127_0x2ef8be,_0x524ec7=new Set();for(const {yamlConfig:_0xb2221c,folderPath:_0x1b0c54}of _0x28f18c){_0x524ec7[_0x221d18(0x1e6)](_0x1b0c54+':'+_0xb2221c[_0x221d18(0x1a0)]);}return _0x301668[_0x221d18(0xf6)](_0x2e6910=>{const _0x500277=_0x221d18,_0x3dc235=_0x2e6910[_0x500277(0x13c)]?_0x4daf5d[_0x500277(0x182)](_0x2e6910[_0x500277(0x13c)][_0x500277(0x175)]())||'':'',_0x188761=_0x3dc235+':'+_0x2e6910[_0x500277(0x1a0)];if(_0x524ec7[_0x500277(0x117)](_0x188761))return![];if(_0x2680ac)return _0x3dc235===_0x1681e2||_0x3dc235[_0x500277(0x107)](_0x1681e2+'/');return!![];});}export function findJourneysToDelete(_0x12ab20,_0x40acb3,_0x12c1f2,_0x563124,_0x2ddbfc){const _0x30c923=a127_0x2ef8be,_0x41b9f3=new Set();for(const {yamlConfig:_0x5e2e98,folderPath:_0x26492a}of _0x40acb3){_0x41b9f3[_0x30c923(0x1e6)](_0x26492a+':'+_0x5e2e98[_0x30c923(0x1a0)]);}return _0x12ab20[_0x30c923(0xf6)](_0x2a6948=>{const _0x45df99=_0x30c923,_0x3e2041=_0x2a6948[_0x45df99(0x191)]?_0x12c1f2['get'](_0x2a6948[_0x45df99(0x191)])||'':'',_0x2d1574=_0x3e2041+':'+_0x2a6948[_0x45df99(0x1e0)];if(_0x41b9f3[_0x45df99(0x117)](_0x2d1574))return![];if(_0x2ddbfc)return _0x3e2041===_0x563124||_0x3e2041[_0x45df99(0x107)](_0x563124+'/');return!![];});}export function buildSegmentLookupMap(_0x3ceb5c,_0x3c09e1){const _0xed4f6b=a127_0x2ef8be,_0xe1ec13=new Map();for(const _0x8d8113 of _0x3ceb5c){const _0x48a8d1=_0x8d8113[_0xed4f6b(0x13c)]?_0x3c09e1['get'](_0x8d8113['segmentFolderId'][_0xed4f6b(0x175)]())||'':'',_0x2b627d=_0x48a8d1+':'+_0x8d8113[_0xed4f6b(0x1a0)];_0xe1ec13[_0xed4f6b(0x1bd)](_0x2b627d,_0x8d8113);}return _0xe1ec13;}export function buildSegmentNameToIdMap(_0x3b1450){const _0x14ec21=a127_0x2ef8be,_0xec06e7=new Map();for(const _0x5c1ba7 of _0x3b1450){_0xec06e7[_0x14ec21(0x1bd)](_0x5c1ba7[_0x14ec21(0x1a0)],_0x5c1ba7['id']);}return _0xec06e7;}export function buildJourneyBundleLookupMap(_0x3568d4,_0x13d203){const _0x6ed4a9=a127_0x2ef8be,_0x272f6c=new Map();for(const _0x23cdd1 of _0x3568d4){const _0x2f46b4=_0x23cdd1[_0x6ed4a9(0x191)]?_0x13d203[_0x6ed4a9(0x182)](_0x23cdd1[_0x6ed4a9(0x191)])||'':'',_0x145e3a=_0x2f46b4+':'+_0x23cdd1[_0x6ed4a9(0x1e0)];!_0x272f6c[_0x6ed4a9(0x117)](_0x145e3a)&&_0x272f6c[_0x6ed4a9(0x1bd)](_0x145e3a,[]),_0x272f6c[_0x6ed4a9(0x182)](_0x145e3a)[_0x6ed4a9(0x169)](_0x23cdd1);}for(const _0x5318f7 of _0x272f6c[_0x6ed4a9(0x12a)]()){_0x5318f7[_0x6ed4a9(0x114)]((_0xecdafd,_0x22e756)=>(_0xecdafd[_0x6ed4a9(0x195)]||0x0)-(_0x22e756[_0x6ed4a9(0x195)]||0x0));}return _0x272f6c;}export function collectFoldersToCreate(_0x3a1ec8,_0x448434){const _0x63eb37=a127_0x2ef8be,_0x33150a=new Set();for(const _0x27f2cd of _0x3a1ec8){if(!_0x27f2cd)continue;if(_0x448434[_0x63eb37(0x117)](_0x27f2cd))continue;const _0x57d5b5=_0x27f2cd[_0x63eb37(0x148)]('/');let _0x5e6654='';for(const _0x306b93 of _0x57d5b5){_0x5e6654=_0x5e6654?_0x5e6654+'/'+_0x306b93:_0x306b93,!_0x448434[_0x63eb37(0x117)](_0x5e6654)&&_0x33150a[_0x63eb37(0x1e6)](_0x5e6654);}}return _0x33150a;}export function parseAndClassifyYamlFiles(_0x3c1559,_0xc9a087,_0x43c365){const _0x405379=a127_0x2ef8be,_0x46331f=[],_0x40f464=[];for(const _0x602c2b of _0x3c1559){const _0x44ad96=a127_0x24bb8b['relative'](_0xc9a087,a127_0x24bb8b[_0x405379(0x186)](_0x602c2b)),_0x12c0b2=_0x44ad96==='.'?'':_0x44ad96,_0x32adde=readFileSync(_0x602c2b,_0x405379(0x1bb)),_0x39164e=a127_0x27e8c7[_0x405379(0x160)](_0x32adde);if(isJourneyDef(_0x39164e)){const _0x258f30=a127_0x584c1a(_0x32adde);_0x40f464['push']({'yamlConfig':_0x258f30,'folderPath':_0x12c0b2,'sourcePath':_0x602c2b});}else{if(!_0x43c365?.['skipSegments']){const _0x3c62e9=parseSegmentYamlFile(_0x32adde),_0x2c8de6=normalizeChildSegmentYaml(_0x3c62e9);_0x46331f['push']({'yamlConfig':_0x2c8de6,'folderPath':_0x12c0b2,'sourcePath':_0x602c2b});}}}return{'segments':_0x46331f,'journeys':_0x40f464};}export function validateParsedFiles(_0x2cd8ed,_0x1dca65){const _0xe2c794=a127_0x2ef8be,_0x7b4762=[];for(const {yamlConfig:_0x2dcd21,sourcePath:_0x525714}of _0x2cd8ed[_0xe2c794(0x1cb)]){const _0x142023=readFileSync(_0x525714,_0xe2c794(0x1bb)),_0xddbc0d=a127_0x27e8c7[_0xe2c794(0x1da)](_0x142023),_0x349702=validateSegmentDef(_0x2dcd21,{'source':_0x142023,'document':_0xddbc0d});if(!_0x349702[_0xe2c794(0x19b)]){const _0x102f69=a127_0x24bb8b[_0xe2c794(0xf3)](_0x1dca65,_0x525714);_0x7b4762[_0xe2c794(0x169)]({'filePath':_0x102f69,'source':_0x142023,'result':_0x349702,'isJourney':![]});}}for(const {yamlConfig:_0x3cf8fc,sourcePath:_0x15aa4e}of _0x2cd8ed[_0xe2c794(0x15a)]){const _0x57945f=readFileSync(_0x15aa4e,_0xe2c794(0x1bb)),_0x30cb62=a127_0x27e8c7[_0xe2c794(0x1da)](_0x57945f),_0x35aa40=validateJourneyDef(_0x3cf8fc,{'source':_0x57945f,'document':_0x30cb62});if(!_0x35aa40['valid']){const _0x3ab1b0=a127_0x24bb8b[_0xe2c794(0xf3)](_0x1dca65,_0x15aa4e);_0x7b4762[_0xe2c794(0x169)]({'filePath':_0x3ab1b0,'source':_0x57945f,'result':_0x35aa40,'isJourney':!![]});}}return _0x7b4762;}export function formatValidationErrors(_0x46310f){const _0x53d753=a127_0x2ef8be,_0x4260c9=[];for(const {filePath:_0x4c1acc,source:_0x177984,result:_0x2e2068,isJourney:_0x45e18e}of _0x46310f){const _0x2e0a7a=_0x45e18e?_0x53d753(0x156):'segment';_0x4260c9[_0x53d753(0x169)]('\x0a'+_0x4c1acc+'\x20('+_0x2e0a7a+'):\x20'+_0x2e2068[_0x53d753(0x1cc)][_0x53d753(0x1b1)]+'\x20error(s)'),_0x4260c9[_0x53d753(0x169)](formatValidationResult(_0x2e2068,_0x177984,_0x4c1acc));}return _0x4260c9[_0x53d753(0x1ae)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x2d4ce6){const _0x1574aa=a127_0x2ef8be,_0x4a78ed=new Set(),_0x4b1ca7=new Map(),_0x27ded2=collectSegmentUsageCounts(_0x2d4ce6);if(_0x2d4ce6['segments'])for(const [_0x4005d4,_0xab76db]of Object['entries'](_0x2d4ce6[_0x1574aa(0x1cb)])){_0x4a78ed[_0x1574aa(0x1e6)](_0x4005d4);if(_0xab76db[_0x1574aa(0x14a)]){const _0x1f01f6=yamlRuleToApi(_0xab76db[_0x1574aa(0x14a)]),_0x34abcd=apiRuleToYaml(_0x1f01f6);_0x4b1ca7[_0x1574aa(0x1bd)](_0x4005d4,_0x34abcd);}}const _0x6bcbdc=new Map();let _0x2c3cc8=0x0;for(const [_0x152a13,_0x312cda]of _0x4b1ca7){const _0x58bff8=serializeExpandedRule(_0x312cda,_0x4b1ca7),_0x3b3154=_0x6bcbdc[_0x1574aa(0x182)](_0x58bff8)||[];_0x3b3154[_0x1574aa(0x169)]({'name':_0x152a13,'index':_0x2c3cc8}),_0x6bcbdc[_0x1574aa(0x1bd)](_0x58bff8,_0x3b3154),_0x2c3cc8++;}const _0x361718=new Map();for(const [_0x2f08ee,_0x20614e]of _0x6bcbdc){const _0x3e3dce=_0x20614e[_0x1574aa(0x132)]()[_0x1574aa(0x114)]((_0x53257e,_0x5135e2)=>{const _0x28005b=_0x1574aa,_0x4acdee=_0x27ded2[_0x28005b(0x182)](_0x53257e[_0x28005b(0x1a0)])||0x0,_0x9d3f84=_0x27ded2[_0x28005b(0x182)](_0x5135e2[_0x28005b(0x1a0)])||0x0;if(_0x4acdee!==_0x9d3f84)return _0x9d3f84-_0x4acdee;return _0x53257e[_0x28005b(0xf0)]-_0x5135e2['index'];})[_0x1574aa(0x122)](_0x4c52f3=>_0x4c52f3[_0x1574aa(0x1a0)]),_0x1d7cf0=[];for(const _0x3049ed of _0x3e3dce){const _0x49d64f=_0x27ded2[_0x1574aa(0x182)](_0x3049ed)||0x0,_0x1f1df0=Math['max'](_0x49d64f,0x1);for(let _0x374ff9=0x0;_0x374ff9<_0x1f1df0;_0x374ff9++){_0x1d7cf0[_0x1574aa(0x169)](_0x3049ed);}}_0x361718[_0x1574aa(0x1bd)](_0x2f08ee,_0x1d7cf0);}return{'existingLocalSegmentNames':_0x4a78ed,'localSegmentRules':_0x4b1ca7,'localExpandedRuleToNames':_0x361718};}export function createSegmentIdResolver(_0x2e1a66,_0x2ebd7e){return async _0x1ead28=>{const _0x506b4d=a127_0x5dc7,_0x127399=_0x2e1a66[_0x506b4d(0x182)](_0x1ead28);if(!_0x127399)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x506b4d(0x19c)+_0x1ead28+_0x506b4d(0xe9)+_0x2ebd7e+'\x27)');return _0x127399;};}export function extractRootFolderId(_0x249f91){const _0x4345a4=a127_0x2ef8be;return _0x249f91[_0x4345a4(0x1a5)]?.['parentSegmentFolder']?.[_0x4345a4(0x113)]?.['id']||_0x249f91['relationships']?.[_0x4345a4(0x1b8)]?.[_0x4345a4(0x113)]?.['id'];}export function buildConnectionMaps(_0xd4682f){const _0x369bb8=a127_0x2ef8be,_0x45098c=new Map(),_0x16ad40=new Map(),_0x33ac4a=new Map();for(const _0x479aa1 of _0xd4682f){_0x45098c[_0x369bb8(0x1bd)](_0x479aa1[_0x369bb8(0x1a0)],parseInt(_0x479aa1['id'],0xa)),_0x16ad40[_0x369bb8(0x1bd)](_0x479aa1['id'],_0x479aa1[_0x369bb8(0x1a0)]),_0x33ac4a[_0x369bb8(0x1bd)](_0x479aa1['name'],_0x479aa1[_0x369bb8(0x1c9)]);}return{'nameToId':_0x45098c,'idToName':_0x16ad40,'nameToType':_0x33ac4a};}export function calculatePushStats(_0x3b4f59,_0x384758,_0x1edbde,_0x26bb12,_0x166a72,_0x376c11,_0x15de70){const _0xd0bc6e=a127_0x2ef8be,_0x4c0e5a=_0x3b4f59['filter'](_0x7a35ad=>_0x7a35ad['isNew']),_0x18414a=_0x3b4f59[_0xd0bc6e(0xf6)](_0x327f9e=>!_0x327f9e[_0xd0bc6e(0x1df)]&&_0x327f9e['hasChanges']),_0x52eff0=_0x3b4f59['filter'](_0x551f16=>!_0x551f16[_0xd0bc6e(0x1df)]&&!_0x551f16[_0xd0bc6e(0x17c)]),_0x376739=_0x376c11?_0x26bb12:[],_0x5cf8e8=_0x384758[_0xd0bc6e(0xf6)](_0x4e95f6=>_0x4e95f6[_0xd0bc6e(0x1df)]),_0x3a7715=_0x384758[_0xd0bc6e(0xf6)](_0x4f0aa2=>!_0x4f0aa2[_0xd0bc6e(0x1df)]&&_0x4f0aa2[_0xd0bc6e(0x17c)]),_0x20de73=_0x384758[_0xd0bc6e(0xf6)](_0x4d313d=>!_0x4d313d['isNew']&&!_0x4d313d[_0xd0bc6e(0x17c)]),_0x32eed0=_0x376c11?_0x166a72:[],_0x4c438a=_0x3b4f59['flatMap'](_0x29999b=>_0x29999b[_0xd0bc6e(0x1b5)]),_0x49980b=_0x4c438a['filter'](_0x50158c=>_0x50158c[_0xd0bc6e(0x1c9)]===_0xd0bc6e(0xf5)),_0x44308f=_0x4c438a[_0xd0bc6e(0xf6)](_0x54cecd=>_0x54cecd[_0xd0bc6e(0x1c9)]===_0xd0bc6e(0x16a)),_0x131237=_0x4c438a[_0xd0bc6e(0xf6)](_0x18dfb4=>_0x18dfb4[_0xd0bc6e(0x1c9)]===_0xd0bc6e(0x181)),_0x1cb609=Array[_0xd0bc6e(0x19f)](_0x1edbde)['sort'](),_0x437282=_0x15de70?![]:_0x4c0e5a[_0xd0bc6e(0x1b1)]>0x0||_0x18414a['length']>0x0||_0x376739[_0xd0bc6e(0x1b1)]>0x0,_0x23f33c=_0x5cf8e8['length']>0x0||_0x3a7715['length']>0x0||_0x32eed0[_0xd0bc6e(0x1b1)]>0x0,_0x43a51b=_0x15de70?![]:_0x4c438a[_0xd0bc6e(0x1b1)]>0x0,_0x37250c=_0x1cb609[_0xd0bc6e(0x1b1)]>0x0;return{'segments':{'new':_0x4c0e5a,'changed':_0x18414a,'unchanged':_0x52eff0,'toDelete':_0x376739},'journeys':{'new':_0x5cf8e8,'changed':_0x3a7715,'unchanged':_0x20de73,'toDelete':_0x32eed0},'activations':{'all':_0x4c438a,'toCreate':_0x49980b,'toUpdate':_0x44308f,'toDelete':_0x131237},'folders':{'toCreate':_0x1cb609},'counts':{'segments':{'new':_0x4c0e5a[_0xd0bc6e(0x1b1)],'changed':_0x18414a[_0xd0bc6e(0x1b1)],'unchanged':_0x52eff0[_0xd0bc6e(0x1b1)],'toDelete':_0x376739[_0xd0bc6e(0x1b1)]},'journeys':{'new':_0x5cf8e8[_0xd0bc6e(0x1b1)],'changed':_0x3a7715[_0xd0bc6e(0x1b1)],'unchanged':_0x20de73[_0xd0bc6e(0x1b1)],'toDelete':_0x32eed0[_0xd0bc6e(0x1b1)]},'activations':{'create':_0x49980b[_0xd0bc6e(0x1b1)],'update':_0x44308f[_0xd0bc6e(0x1b1)],'delete':_0x131237['length']},'folders':_0x1cb609[_0xd0bc6e(0x1b1)]},'hasChanges':_0x437282||_0x23f33c||_0x43a51b||_0x37250c};}export async function buildPushExecutionContext(_0x4976ae,_0x4a0dbb,_0x3209fc,_0x21fe6a,_0x154269,_0x44a925){const _0x259c05=a127_0x2ef8be,_0x37b2e6=extractRootFolderId(_0x3209fc),{pathToId:_0x154c34,idToPath:_0x29dc61}=buildFolderMaps(_0x154269),_0x2f943c=buildSegmentNameToIdMap(_0x21fe6a),_0x2c5245=new Map(),{batchAsync:_0x5d4d5c}=await import(_0x259c05(0x1b4)),[_0x76e995,_0x45f19e]=await Promise[_0x259c05(0x1d0)]([_0x4976ae[_0x259c05(0x153)][_0x259c05(0x104)](),_0x4976ae[_0x259c05(0x1d4)]['list'](),((async()=>{const _0x333c70=_0x259c05;!_0x44a925&&_0x21fe6a[_0x333c70(0x1b1)]>0x0&&await _0x5d4d5c(_0x21fe6a,async _0x2c3baa=>{const _0x5122ac=_0x333c70,_0x5cee4a=await _0x4976ae[_0x5122ac(0xfe)]['listActivations'](_0x4a0dbb,_0x2c3baa['id']);_0x2c5245['set'](_0x2c3baa['id'],_0x5cee4a);});})())]),{emailToId:_0x3857b9,idToEmail:_0x2cf8df}=_0x76e995,_0x2c9f26=buildConnectionMaps(_0x45f19e);return{'rootFolderId':_0x37b2e6,'folderPathToId':_0x154c34,'folderIdToPath':_0x29dc61,'segmentNameToId':_0x2f943c,'activationsBySegmentId':_0x2c5245,'emailToIdMap':_0x3857b9,'idToEmailMap':_0x2cf8df,'connectionNameToIdMap':_0x2c9f26[_0x259c05(0x145)],'connectionIdToNameMap':_0x2c9f26[_0x259c05(0x14f)],'connectionNameToTypeMap':_0x2c9f26[_0x259c05(0x127)]};}export function createPushYamlContextForBundle(_0x2e9160,_0xbcbcbc,_0xa26a0b,_0x111d7a,_0x1d95ce,_0x5b8288,_0xed6ee,_0x18e9ea){const {existingLocalSegmentNames:_0x53732c,localExpandedRuleToNames:_0x1a83e2}=_0x111d7a,_0x4d3a6a=new Set(),_0xe773f4=new Map(),_0x183aa1=new Map(),_0x4aff88=new Map(),_0x4a14c3=createJumpTargetCache(),_0x4d87e2=new Map(),_0x39d596=new Map(),_0x32aa38=new Set();let _0x2ffb83;const _0x2f6bde=_0x1c69ed=>{const _0x24efed={'resolveSegment':async _0x34507c=>{const _0x130998=a127_0x5dc7,_0x5057bf=_0x4aff88[_0x130998(0x182)](_0x34507c);if(_0x5057bf!==undefined)return{'name':_0x5057bf,'isJourneyLocal':!![]};try{const _0x4e0fe1=await fetchSegment(_0x2e9160,_0xbcbcbc,_0x34507c,_0xa26a0b);if(!_0x4e0fe1)throw new Error(_0x130998(0xf1));const _0x3e9e30=generateJourneyLocalName(_0x4e0fe1['name']),_0x28f0be=_0x4e0fe1[_0x130998(0x141)]===SEGMENT_KIND_JOURNEY&&_0x3e9e30!==undefined;let _0x749fef=_0x4e0fe1['name'],_0x3c2849;if(_0x28f0be&&_0x4e0fe1[_0x130998(0x14a)]){const _0x39c0fa=apiRuleToYaml(_0x4e0fe1[_0x130998(0x14a)]);_0x39d596['set'](_0x34507c,_0x39c0fa);const _0x360a5a=async _0x20446c=>{const _0x4b5ffc=_0x130998,_0x190656=collectSegmentRefsFromRule(_0x20446c);for(const _0x17e9f3 of _0x190656){if(!_0x39d596[_0x4b5ffc(0x117)](_0x17e9f3))try{const _0xa2c57b=await fetchSegment(_0x2e9160,_0xbcbcbc,_0x17e9f3,_0xa26a0b);if(_0xa2c57b?.[_0x4b5ffc(0x14a)]){const _0x5f067f=apiRuleToYaml(_0xa2c57b[_0x4b5ffc(0x14a)]);_0x39d596[_0x4b5ffc(0x1bd)](_0x17e9f3,_0x5f067f),await _0x360a5a(_0x5f067f);}}catch(_0x1e9ff9){logger[_0x4b5ffc(0x1d3)](_0x4b5ffc(0xea)+_0x17e9f3+':\x20'+_0x1e9ff9);}}};await _0x360a5a(_0x39c0fa);const _0x1a5c52=serializeExpandedRule(_0x39c0fa,_0x39d596),_0xdea11c=_0x1a83e2[_0x130998(0x182)](_0x1a5c52);if(_0xdea11c&&_0xdea11c['length']>0x0){const _0x57b0f2=_0xe773f4[_0x130998(0x182)](_0x1a5c52)||0x0,_0x527891=_0xdea11c[_0x57b0f2]||_0xdea11c[_0xdea11c[_0x130998(0x1b1)]-0x1];_0xe773f4[_0x130998(0x1bd)](_0x1a5c52,_0x57b0f2+0x1),_0x749fef=_0x527891,_0x4d3a6a[_0x130998(0x1e6)](_0x749fef),_0x4aff88[_0x130998(0x1bd)](_0x34507c,_0x749fef);const _0x19c1ed=await resolveRuleSegmentRefs(_0x39c0fa,async _0x5b1532=>{const _0x291197=_0x130998,_0x58e258=_0x4aff88[_0x291197(0x182)](_0x5b1532);if(_0x58e258)return _0x58e258;const _0x45775c=await _0x2ffb83[_0x291197(0x19d)](_0x5b1532);return _0x45775c[_0x291197(0x1a0)];});_0x3c2849={'description':_0x4e0fe1['description'],'rule':_0x19c1ed};}else{const _0x217850=_0x4d87e2[_0x130998(0x182)](_0x1a5c52);if(_0x217850)_0x749fef=_0x217850,_0x4aff88[_0x130998(0x1bd)](_0x34507c,_0x749fef);else{if(_0x3e9e30){let _0x2fcc76=_0x3e9e30,_0x3e9f3a=0x2;while(_0x4d3a6a[_0x130998(0x117)](_0x2fcc76)||_0x53732c[_0x130998(0x117)](_0x2fcc76)){_0x2fcc76=_0x3e9e30+'_'+_0x3e9f3a,_0x3e9f3a++;}_0x4d3a6a[_0x130998(0x1e6)](_0x2fcc76),_0x749fef=_0x2fcc76;}_0x4aff88[_0x130998(0x1bd)](_0x34507c,_0x749fef),_0x4d87e2[_0x130998(0x1bd)](_0x1a5c52,_0x749fef);const _0x9c5a25=await resolveRuleSegmentRefs(_0x39c0fa,async _0x50c33f=>{const _0x302159=_0x130998,_0x5237dc=_0x4aff88['get'](_0x50c33f);if(_0x5237dc)return _0x5237dc;const _0x3d5345=await _0x2ffb83[_0x302159(0x19d)](_0x50c33f);return _0x3d5345['name'];});_0x3c2849={'description':_0x4e0fe1['description'],'rule':_0x9c5a25};}}}return{'name':_0x749fef,'isJourneyLocal':_0x28f0be,'definition':_0x3c2849};}catch(_0x7cbff0){return logger['debug']('Failed\x20to\x20resolve\x20segment\x20'+_0x34507c+':\x20'+_0x7cbff0),{'name':_0x34507c,'isJourneyLocal':![]};}},'resolveActivation':async _0x215111=>{const _0x454f4e=a127_0x5dc7,_0x2c9a6e=_0x183aa1[_0x454f4e(0x182)](_0x215111);if(_0x2c9a6e!==undefined)return{'name':_0x2c9a6e,'isJourneyLocal':!![]};try{let _0x5d4313=_0xed6ee?.[_0x454f4e(0x182)](_0x215111);!_0x5d4313&&(_0x5d4313=await _0x2e9160[_0x454f4e(0x156)][_0x454f4e(0x18a)](_0x1c69ed,_0x215111));const _0x5e849b=_0x5d4313[_0x454f4e(0x111)][_0x454f4e(0x162)][_0x454f4e(0x1a0)]||_0x215111,_0x713760=sanitizeYamlKey(_0x5e849b)||_0x454f4e(0x103)+_0x215111,_0x5130ad=_0x713760;_0x183aa1['set'](_0x215111,_0x5130ad);const _0x1459c8=journeyActivationStepToYaml(_0x5d4313,_0x1d95ce,_0x5b8288);return{'name':_0x5130ad,'isJourneyLocal':!![],'definition':_0x1459c8};}catch(_0x104ae0){return logger[_0x454f4e(0x1d3)]('Failed\x20to\x20resolve\x20activation\x20'+_0x215111+':\x20'+_0x104ae0),{'name':_0x215111,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x501148,_0x2e7f64)=>resolveJumpTarget(_0x501148,_0x2e7f64,_0x4a14c3,async _0x12e7b7=>{const _0x4f722b=a127_0x5dc7,_0x68ca70=_0x18e9ea?.['get'](_0x12e7b7);if(_0x68ca70)return _0x68ca70;return _0x2e9160[_0x4f722b(0x156)][_0x4f722b(0x187)](_0x12e7b7);})};return _0x2ffb83=_0x24efed,_0x24efed;},_0x521566=async _0x50f8f7=>{const _0x47bcd2=a127_0x5dc7,{collectSegmentIdsFromJourneyApi:_0x3809dc}=await import(_0x47bcd2(0x15f)),{batchAsync:_0x1b0b07}=await import(_0x47bcd2(0x1b4)),_0x2b2d3f=new Set();for(const _0x21f9a5 of _0x50f8f7){let _0x5b4226=_0x18e9ea?.[_0x47bcd2(0x182)](_0x21f9a5);!_0x5b4226&&(_0x5b4226=await _0x2e9160['journey'][_0x47bcd2(0x187)](_0x21f9a5));const _0x4b513f=_0x3809dc(_0x5b4226);for(const _0xa6171e of _0x4b513f){_0x2b2d3f[_0x47bcd2(0x1e6)](_0xa6171e);}}let _0xcaeced=Array[_0x47bcd2(0x19f)](_0x2b2d3f);while(_0xcaeced[_0x47bcd2(0x1b1)]>0x0){const _0x58eeb=_0xcaeced[_0x47bcd2(0xf6)](_0x39f175=>!_0x32aa38[_0x47bcd2(0x117)](_0x39f175));if(_0x58eeb[_0x47bcd2(0x1b1)]===0x0)break;const _0x18169a=await _0x1b0b07(_0x58eeb,async _0x24f66a=>{const _0x3cf7de=_0x47bcd2;_0x32aa38[_0x3cf7de(0x1e6)](_0x24f66a);const _0x2031b1=await fetchSegment(_0x2e9160,_0xbcbcbc,_0x24f66a,_0xa26a0b);if(!_0x2031b1)return null;return{'segmentId':_0x24f66a,'segment':_0x2031b1};},0xa),_0x5eebff=new Set();for(const _0xf88744 of _0x18169a){if(!_0xf88744?.[_0x47bcd2(0xfe)]?.['rule'])continue;const _0x3f7e83=apiRuleToYaml(_0xf88744[_0x47bcd2(0xfe)][_0x47bcd2(0x14a)]);_0x39d596[_0x47bcd2(0x1bd)](_0xf88744[_0x47bcd2(0x105)],_0x3f7e83);const _0x2ae3ba=collectSegmentRefsFromRule(_0x3f7e83);for(const _0x501b86 of _0x2ae3ba){!_0x32aa38[_0x47bcd2(0x117)](_0x501b86)&&_0x5eebff[_0x47bcd2(0x1e6)](_0x501b86);}}_0xcaeced=Array[_0x47bcd2(0x19f)](_0x5eebff);}};return{'createYamlContext':_0x2f6bde,'prefetchJourneySegments':_0x521566};}export async function executePushSegments(_0x1fb5c2,_0x3a0bb5,_0x2f7e9f,_0x45c003,_0x1a292e){const _0x357f36=a127_0x2ef8be,{segmentDefToCreateRequest:_0x2ceb91,segmentDefToUpdateRequest:_0x432dfc}=await import('./child-segment-yaml.js'),_0x20c44a=_0x2f7e9f[_0x357f36(0x11d)],_0x41b799=0x5,_0x2c082c=async _0x5db9a2=>{const _0x21d0a1=_0x357f36,_0x580c25=_0x5db9a2[_0x21d0a1(0x125)]?_0x20c44a[_0x21d0a1(0x182)](_0x5db9a2[_0x21d0a1(0x125)]):undefined;let _0x18fa65;const _0x330ea0={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x5db9a2[_0x21d0a1(0x1df)]){_0x1a292e['onProgress']?.({'type':_0x21d0a1(0x137),'name':_0x5db9a2[_0x21d0a1(0x12d)]['name']});const _0x5cd173=_0x2ceb91(_0x5db9a2['yamlConfig'],_0x580c25),_0x18d96a=await _0x1a292e[_0x21d0a1(0x15c)](_0x21d0a1(0x1b6)+_0x5db9a2[_0x21d0a1(0x12d)][_0x21d0a1(0x1a0)]+_0x21d0a1(0x16b),()=>_0x1fb5c2[_0x21d0a1(0xfe)][_0x21d0a1(0x1d5)](_0x45c003[_0x21d0a1(0x166)],_0x5cd173));_0x18fa65=_0x18d96a['data']['id'],_0x330ea0['createdSegmentId']={'name':_0x5db9a2[_0x21d0a1(0x12d)]['name'],'id':_0x18fa65},_0x1a292e[_0x21d0a1(0x15e)]?.({'type':_0x21d0a1(0x199),'name':_0x5db9a2[_0x21d0a1(0x12d)][_0x21d0a1(0x1a0)],'segmentId':_0x18fa65}),_0x1a292e['logSuccess']?.(_0x21d0a1(0x161)+_0x5db9a2[_0x21d0a1(0x12d)][_0x21d0a1(0x1a0)]+'\x27'),_0x330ea0[_0x21d0a1(0x157)]=0x1;}else{if(_0x5db9a2['hasChanges']){_0x1a292e[_0x21d0a1(0x15e)]?.({'type':_0x21d0a1(0x1ac),'name':_0x5db9a2[_0x21d0a1(0x12d)][_0x21d0a1(0x1a0)]});const _0x224acd=_0x432dfc(_0x5db9a2[_0x21d0a1(0x12d)]);_0x580c25!==_0x5db9a2[_0x21d0a1(0x1a2)]?.['segmentFolderId']&&(_0x224acd[_0x21d0a1(0x13c)]=_0x580c25?parseInt(_0x580c25,0xa):undefined),await _0x1a292e['withProgress']('Updating\x20segment\x20\x27'+_0x5db9a2[_0x21d0a1(0x12d)][_0x21d0a1(0x1a0)]+_0x21d0a1(0x16b),()=>_0x1fb5c2[_0x21d0a1(0xfe)][_0x21d0a1(0x16e)](_0x45c003[_0x21d0a1(0x166)],_0x5db9a2['existingSegment']['id'],_0x224acd)),_0x18fa65=_0x5db9a2['existingSegment']['id'],_0x1a292e[_0x21d0a1(0x15e)]?.({'type':'segment_updated','name':_0x5db9a2[_0x21d0a1(0x12d)][_0x21d0a1(0x1a0)]}),_0x1a292e[_0x21d0a1(0x10b)]?.(_0x21d0a1(0x118)+_0x5db9a2[_0x21d0a1(0x12d)][_0x21d0a1(0x1a0)]+'\x27'),_0x330ea0[_0x21d0a1(0x142)]=0x1;}else _0x18fa65=_0x5db9a2['existingSegment']['id'];}}catch(_0x1df6c9){const _0x3fb4b6=isHttp400Error(_0x1df6c9),_0xb0a81f=_0x3fb4b6?ErrorCode[_0x21d0a1(0x129)]:ErrorCode[_0x21d0a1(0x168)],_0x221b0b=getErrorMessage(_0x1df6c9);throw new SDKError(_0xb0a81f,'Failed\x20to\x20'+(_0x5db9a2['isNew']?_0x21d0a1(0xf5):_0x21d0a1(0x16a))+'\x20segment\x20from\x20file:\x20'+_0x5db9a2[_0x21d0a1(0x167)]+'\x0a\x20\x20'+_0x221b0b,_0x1df6c9);}try{const _0x4bbe35=await syncActivationsForSegment(_0x1fb5c2,_0x45c003['parentId'],_0x18fa65,_0x5db9a2['yamlConfig'][_0x21d0a1(0x1a0)],_0x5db9a2[_0x21d0a1(0x1b5)],_0x1a292e,_0x5db9a2[_0x21d0a1(0x167)]);_0x330ea0[_0x21d0a1(0x176)]=_0x4bbe35;}catch(_0x22f66c){if(_0x22f66c instanceof SDKError)throw _0x22f66c;throw new SDKError(ErrorCode[_0x21d0a1(0xff)],_0x21d0a1(0x159)+_0x5db9a2[_0x21d0a1(0x12d)]['name']+_0x21d0a1(0x1e7)+_0x5db9a2['absolutePath']+_0x21d0a1(0x1cf)+getErrorMessage(_0x22f66c),_0x22f66c);}return _0x330ea0;},_0x2eff3d=await batchAsync(_0x3a0bb5,_0x2c082c,_0x41b799),_0xa8f51e={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x1cf7af of _0x2eff3d){_0xa8f51e[_0x357f36(0x157)]+=_0x1cf7af['created'],_0xa8f51e[_0x357f36(0x142)]+=_0x1cf7af[_0x357f36(0x142)],_0x1cf7af['createdSegmentId']&&_0xa8f51e['createdSegmentIds'][_0x357f36(0x1bd)](_0x1cf7af[_0x357f36(0x188)][_0x357f36(0x1a0)],_0x1cf7af[_0x357f36(0x188)]['id']),_0xa8f51e[_0x357f36(0x176)]['created']+=_0x1cf7af[_0x357f36(0x176)][_0x357f36(0x157)],_0xa8f51e[_0x357f36(0x176)]['updated']+=_0x1cf7af['activations'][_0x357f36(0x142)],_0xa8f51e['activations']['deleted']+=_0x1cf7af['activations'][_0x357f36(0x124)];}return _0xa8f51e;}async function syncActivationsForSegment(_0x4c0ef5,_0x5b6ccd,_0x1df4b0,_0x1e5988,_0x307af3,_0x48c6d8,_0x50c9e7){const _0x7a3575=a127_0x2ef8be,_0x2795e8={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x1b8984 of _0x307af3){try{if(_0x1b8984['type']===_0x7a3575(0xf5)&&_0x1b8984[_0x7a3575(0x100)])_0x48c6d8[_0x7a3575(0x15e)]?.({'type':'activation_creating','segmentName':_0x1e5988,'activationName':_0x1b8984[_0x7a3575(0x1a0)]}),await _0x48c6d8[_0x7a3575(0x15c)](_0x7a3575(0x1c7)+_0x1b8984['name']+'\x27...',()=>_0x4c0ef5['segment'][_0x7a3575(0x1c1)](_0x5b6ccd,_0x1df4b0,_0x1b8984[_0x7a3575(0x100)])),_0x48c6d8[_0x7a3575(0x15e)]?.({'type':_0x7a3575(0x18c),'segmentName':_0x1e5988,'activationName':_0x1b8984[_0x7a3575(0x1a0)]}),_0x48c6d8[_0x7a3575(0x10b)]?.(_0x7a3575(0x150)+_0x1b8984[_0x7a3575(0x1a0)]+'\x27'),_0x2795e8[_0x7a3575(0x157)]++;else{if(_0x1b8984['type']===_0x7a3575(0x16a)&&_0x1b8984[_0x7a3575(0x100)]&&_0x1b8984[_0x7a3575(0x109)])_0x48c6d8[_0x7a3575(0x15e)]?.({'type':'activation_updating','segmentName':_0x1e5988,'activationName':_0x1b8984[_0x7a3575(0x1a0)]}),await _0x48c6d8[_0x7a3575(0x15c)](_0x7a3575(0x193)+_0x1b8984[_0x7a3575(0x1a0)]+_0x7a3575(0x16b),()=>_0x4c0ef5[_0x7a3575(0xfe)][_0x7a3575(0x18e)](_0x5b6ccd,_0x1df4b0,_0x1b8984[_0x7a3575(0x109)]['id'],_0x1b8984[_0x7a3575(0x100)])),_0x48c6d8[_0x7a3575(0x15e)]?.({'type':_0x7a3575(0x12f),'segmentName':_0x1e5988,'activationName':_0x1b8984[_0x7a3575(0x1a0)]}),_0x48c6d8[_0x7a3575(0x10b)]?.(_0x7a3575(0x147)+_0x1b8984['name']+'\x27'),_0x2795e8[_0x7a3575(0x142)]++;else _0x1b8984[_0x7a3575(0x1c9)]===_0x7a3575(0x181)&&_0x1b8984[_0x7a3575(0x109)]&&(_0x48c6d8[_0x7a3575(0x15e)]?.({'type':'activation_deleting','segmentName':_0x1e5988,'activationName':_0x1b8984['name']}),await _0x48c6d8[_0x7a3575(0x15c)](_0x7a3575(0xf7)+_0x1b8984[_0x7a3575(0x1a0)]+'\x27...',()=>_0x4c0ef5['segment'][_0x7a3575(0x1b0)](_0x5b6ccd,_0x1df4b0,_0x1b8984[_0x7a3575(0x109)]['id'])),_0x48c6d8['onProgress']?.({'type':_0x7a3575(0x194),'segmentName':_0x1e5988,'activationName':_0x1b8984['name']}),_0x48c6d8['logDeleted']?.(_0x7a3575(0x1bf)+_0x1b8984[_0x7a3575(0x1a0)]+'\x27'),_0x2795e8[_0x7a3575(0x124)]++);}}catch(_0x567773){const _0x2ddea1=isHttp400Error(_0x567773),_0x229aba=_0x2ddea1?ErrorCode[_0x7a3575(0x121)]:ErrorCode[_0x7a3575(0xff)],_0x26b84b=getErrorMessage(_0x567773);throw new SDKError(_0x229aba,_0x7a3575(0x115)+_0x1b8984[_0x7a3575(0x1c9)]+_0x7a3575(0xe7)+_0x1b8984['name']+'\x27\x20from\x20file:\x20'+_0x50c9e7+_0x7a3575(0x1cf)+_0x26b84b,_0x567773);}}return _0x2795e8;}export async function executePushFolders(_0x5d41dd,_0x257dbe,_0x373af7,_0x58f5f2,_0x4e79c3){const _0x14f7e4=a127_0x2ef8be,_0x395c0d=new Map(_0x373af7),_0x16ac97=sortFoldersByDepth(_0x257dbe);for(const _0xdbbf14 of _0x16ac97){const _0x5a8d31=_0xdbbf14['split']('/'),_0x2565a2=_0x5a8d31[_0x5a8d31[_0x14f7e4(0x1b1)]-0x1],_0x2594be=_0x5a8d31['slice'](0x0,-0x1)[_0x14f7e4(0x1ae)]('/'),_0x323071=_0x395c0d[_0x14f7e4(0x182)](_0x2594be);_0x4e79c3[_0x14f7e4(0x15e)]?.({'type':_0x14f7e4(0x171),'folder':_0xdbbf14});const _0x3d1316={'name':_0x2565a2,'parentFolderId':_0x323071},_0x197d38=await _0x4e79c3[_0x14f7e4(0x15c)](_0x14f7e4(0x16f)+_0xdbbf14+_0x14f7e4(0x16b),()=>_0x5d41dd[_0x14f7e4(0xfe)][_0x14f7e4(0x17f)](_0x58f5f2[_0x14f7e4(0x166)],_0x3d1316));_0x395c0d[_0x14f7e4(0x1bd)](_0xdbbf14,_0x197d38[_0x14f7e4(0x113)]['id']),_0x4e79c3[_0x14f7e4(0x15e)]?.({'type':_0x14f7e4(0x184),'folder':_0xdbbf14,'folderId':_0x197d38[_0x14f7e4(0x113)]['id']}),_0x4e79c3[_0x14f7e4(0xfa)]?.(_0x14f7e4(0xf2)+_0xdbbf14+'\x27');}return _0x395c0d;}export async function executePushSegmentDeletions(_0x412c42,_0x4cbba0,_0x5b12e2){const _0x25482a=a127_0x2ef8be;if(_0x4cbba0[_0x25482a(0x1b1)]===0x0)return 0x0;const {batchAsync:_0x493e36}=await import(_0x25482a(0x1b4)),_0x4ea525=0x5,_0x28a562=await _0x493e36(_0x4cbba0,async _0x26f293=>{const _0x4c9672=_0x25482a;return _0x5b12e2[_0x4c9672(0x15e)]?.({'type':_0x4c9672(0x1d2),'name':_0x26f293['name']}),await _0x412c42[_0x4c9672(0xfe)]['deleteSegment'](_0x26f293['id']),_0x5b12e2['onProgress']?.({'type':'segment_deleted','name':_0x26f293[_0x4c9672(0x1a0)]}),_0x5b12e2[_0x4c9672(0x116)]?.('Deleted\x20segment\x20\x27'+_0x26f293[_0x4c9672(0x1a0)]+'\x27'),0x1;},_0x4ea525);return _0x28a562[_0x25482a(0x133)]((_0x503c22,_0x1f4a68)=>_0x503c22+_0x1f4a68,0x0);}export async function executePushJourneys(_0x165619,_0x201dd1,_0x4625b0,_0x42dd9f,_0x2835a9){const _0x5b0baa=a127_0x2ef8be,{journeyDefToRequest:_0x3b200b}=await import(_0x5b0baa(0x15f)),{activationDefToCreateRequest:_0x151a1b,yamlRuleToApi:_0x22a869,validateSegmentRule:_0x414547}=await import(_0x5b0baa(0x1e5)),_0x39a11e={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x4357cf=new Map(_0x4625b0[_0x5b0baa(0x14e)]),_0x4f8065=0x5;for(let _0x3bd9d1=0x0;_0x3bd9d1<_0x201dd1[_0x5b0baa(0x1b1)];_0x3bd9d1+=_0x4f8065){const _0x212679=_0x201dd1[_0x5b0baa(0x132)](_0x3bd9d1,_0x3bd9d1+_0x4f8065),_0x55f00e=await Promise[_0x5b0baa(0x1d0)](_0x212679['map'](async _0x297e09=>{const _0x3a71dd=_0x5b0baa;if(!_0x297e09['isNew']&&!_0x297e09[_0x3a71dd(0x17c)])return{'action':'unchanged','name':_0x297e09[_0x3a71dd(0x12d)][_0x3a71dd(0x1a0)],'journeyId':_0x297e09[_0x3a71dd(0x1c4)]?.['id']};const _0x2556ca=_0x297e09[_0x3a71dd(0x125)]?_0x4625b0[_0x3a71dd(0x11d)]['get'](_0x297e09[_0x3a71dd(0x125)]):undefined;_0x2835a9[_0x3a71dd(0x15e)]?.({'type':_0x297e09[_0x3a71dd(0x1df)]?_0x3a71dd(0x1ab):_0x3a71dd(0xeb),'name':_0x297e09['yamlConfig'][_0x3a71dd(0x1a0)]});try{const _0x42f069=await executeSingleJourneyPush(_0x165619,_0x297e09,{..._0x4625b0,'segmentNameToId':_0x4357cf},{'parentId':_0x42dd9f[_0x3a71dd(0x166)],'rootFolderId':_0x42dd9f['rootFolderId'],'folderId':_0x2556ca,'verbose':_0x42dd9f[_0x3a71dd(0x123)]},_0x2835a9,{'journeyDefToRequest':_0x3b200b,'activationDefToCreateRequest':_0x151a1b,'yamlRuleToApi':_0x22a869,'validateSegmentRule':_0x414547});for(const [_0x70cfc6,_0x4533a3]of _0x42f069[_0x3a71dd(0xfb)]){_0x4357cf[_0x3a71dd(0x1bd)](_0x70cfc6,_0x4533a3),_0x39a11e[_0x3a71dd(0xfb)][_0x3a71dd(0x1bd)](_0x70cfc6,_0x4533a3);}if(_0x42f069[_0x3a71dd(0x1cd)]===_0x3a71dd(0x157))_0x2835a9[_0x3a71dd(0x15e)]?.({'type':_0x3a71dd(0x120),'name':_0x297e09[_0x3a71dd(0x12d)][_0x3a71dd(0x1a0)],'journeyId':_0x42f069[_0x3a71dd(0x1c2)]}),_0x2835a9[_0x3a71dd(0x10b)]?.(_0x3a71dd(0x102)+_0x297e09[_0x3a71dd(0x12d)][_0x3a71dd(0x1a0)]+'\x27'),_0x39a11e[_0x3a71dd(0x157)]++;else _0x42f069['action']===_0x3a71dd(0x142)&&(_0x2835a9[_0x3a71dd(0x15e)]?.({'type':_0x3a71dd(0x17b),'name':_0x297e09[_0x3a71dd(0x12d)][_0x3a71dd(0x1a0)]}),_0x2835a9['logSuccess']?.('Updated\x20journey\x20\x27'+_0x297e09[_0x3a71dd(0x12d)][_0x3a71dd(0x1a0)]+'\x27'),_0x39a11e[_0x3a71dd(0x142)]++);return{'action':_0x42f069[_0x3a71dd(0x1cd)],'name':_0x297e09['yamlConfig'][_0x3a71dd(0x1a0)],'journeyId':_0x42f069[_0x3a71dd(0x1c2)]};}catch(_0x262da0){const _0x672453=isHttp400Error(_0x262da0),_0xa4cf4b=_0x672453?ErrorCode['JOURNEY_SYNTAX_ERROR']:ErrorCode[_0x3a71dd(0x15d)],_0x5a846c=getErrorMessage(_0x262da0);throw new SDKError(_0xa4cf4b,_0x3a71dd(0x115)+(_0x297e09[_0x3a71dd(0x1df)]?_0x3a71dd(0xf5):_0x3a71dd(0x16a))+_0x3a71dd(0x149)+_0x297e09['absolutePath']+_0x3a71dd(0x1cf)+_0x5a846c,_0x262da0);}}));_0x39a11e[_0x5b0baa(0x12b)]['push'](..._0x55f00e);}return _0x39a11e;}async function matchExistingJourneySegments(_0x3f8e81,_0xb3a02a,_0x111244,_0x4314ab,_0x26a11a){const _0x135f39=a127_0x2ef8be;if(!_0xb3a02a[_0x135f39(0x1c4)]||!_0xb3a02a[_0x135f39(0x12d)]['segments'])return;const _0x3a0031=new Map(),_0x27d511=new Set();for(const _0x4f2e03 of Object[_0x135f39(0x185)](_0xb3a02a[_0x135f39(0x12d)]['segments'])){const _0x3186f0=generateDeterministicJourneySegmentName(_0xb3a02a[_0x135f39(0x12d)]['name'],_0x4f2e03);_0x3a0031['set'](_0x3186f0,_0x4f2e03),_0x27d511[_0x135f39(0x1e6)](_0x4f2e03);}const _0x3473fa=[],_0x2cc500=collectSegmentIdsFromJourneyApi(_0xb3a02a[_0x135f39(0x1c4)]);for(const _0x3ae986 of _0x2cc500){const _0x4ad707=await fetchSegment(_0x3f8e81,_0x111244,_0x3ae986,_0x4314ab);if(!_0x4ad707?.['name'])continue;const _0x220970=_0x3a0031[_0x135f39(0x182)](_0x4ad707[_0x135f39(0x1a0)]);_0x220970?(_0x26a11a[_0x135f39(0x1bd)](_0x220970,_0x3ae986),_0x27d511[_0x135f39(0x181)](_0x220970)):_0x3473fa['push']({'id':_0x3ae986,'seg':_0x4ad707});}if(_0x27d511[_0x135f39(0x11b)]>0x0&&_0x3473fa[_0x135f39(0x1b1)]>0x0){const {localExpandedRuleToNames:_0x272811}=buildLocalExpandedRuleMappings(_0xb3a02a[_0x135f39(0x12d)]),_0x1713b6=new Map();for(const {id:_0x432303,seg:_0x40795e}of _0x3473fa){if(_0x40795e[_0x135f39(0x14a)]){const _0x3a1835=apiRuleToYaml(_0x40795e[_0x135f39(0x14a)]);_0x1713b6[_0x135f39(0x1bd)](_0x432303,_0x3a1835);}}for(const {id:_0x346ae8,seg:_0x382227}of _0x3473fa){if(!_0x382227[_0x135f39(0x14a)])continue;const _0x5ddead=_0x1713b6[_0x135f39(0x182)](_0x346ae8);if(!_0x5ddead)continue;const _0x373053=serializeExpandedRule(_0x5ddead,_0x1713b6),_0x5dd561=_0x272811[_0x135f39(0x182)](_0x373053);if(_0x5dd561){const _0x3d9e7b=_0x5dd561['find'](_0x108338=>_0x27d511[_0x135f39(0x117)](_0x108338));_0x3d9e7b&&(_0x26a11a['set'](_0x3d9e7b,_0x346ae8),_0x27d511[_0x135f39(0x181)](_0x3d9e7b),logger[_0x135f39(0x1d3)]('Matched\x20server\x20segment\x20\x27'+_0x382227[_0x135f39(0x1a0)]+_0x135f39(0x136)+_0x3d9e7b+'\x27\x20by\x20rule\x20content'));}}}}async function executeSingleJourneyPush(_0x1cad51,_0x34efd8,_0x5617b4,_0x564398,_0x408d89,_0x40ea1a){const _0x51b3ae=a127_0x2ef8be,{journeyDefToRequest:_0x315e0c,activationDefToCreateRequest:_0x2953cb,yamlRuleToApi:_0x239bb1,validateSegmentRule:_0x16f168}=_0x40ea1a,_0x384ff5=new Map(),_0x5717f8=new Map();recoverSegmentIdsFromPushRecovery(_0x34efd8,_0x384ff5,_0x5617b4[_0x51b3ae(0x14e)]);const _0x25a34f=new Map(),_0x3adc53=new Map(),_0x1210f8=new Map();let _0x58af4b;const _0xfe105=async()=>{const _0x59db7e=_0x51b3ae;if(_0x58af4b)return;_0x58af4b=new Map();if(!_0x34efd8[_0x59db7e(0x1c4)])return;const _0x531131=await _0x1cad51[_0x59db7e(0x156)][_0x59db7e(0x18f)](_0x34efd8[_0x59db7e(0x1c4)]['id']);for(const _0x168d76 of _0x531131){const _0x4680b0=journeyActivationStepToYaml(_0x168d76,_0x5617b4['idToEmailMap'],_0x5617b4[_0x59db7e(0x13e)]),_0x59d68d=activationSignature(_0x4680b0);!_0x58af4b[_0x59db7e(0x117)](_0x59d68d)&&_0x58af4b[_0x59db7e(0x1bd)](_0x59d68d,_0x168d76['id']),_0x4680b0[_0x59db7e(0x1a0)]&&_0x5717f8['set'](_0x4680b0[_0x59db7e(0x1a0)],_0x168d76['id']);}};await matchExistingJourneySegments(_0x1cad51,_0x34efd8,_0x564398[_0x51b3ae(0x166)],_0x5617b4[_0x51b3ae(0x12e)],_0x5617b4['segmentNameToId']);const _0x4971e3={'resolveSegmentId':async _0x573d27=>{const _0x31f71a=_0x51b3ae,_0x92ff79=_0x5617b4[_0x31f71a(0x14e)][_0x31f71a(0x182)](_0x573d27);if(!_0x92ff79)throw new SDKError(ErrorCode[_0x31f71a(0x139)],_0x31f71a(0x19c)+_0x573d27+_0x31f71a(0x13b)+_0x34efd8[_0x31f71a(0x12d)][_0x31f71a(0x1a0)]+')');return _0x92ff79;},'resolveEmbeddedSegmentId':async(_0xb3ca6e,_0x462768)=>{const _0x46c03d=_0x51b3ae,_0x270a46=_0x5617b4['segmentNameToId'][_0x46c03d(0x182)](_0xb3ca6e);if(_0x270a46)return _0x270a46;const _0x54bd66=_0x5617b4[_0x46c03d(0x12e)][_0x46c03d(0x190)](_0x35f08d=>_0x35f08d[_0x46c03d(0x1a0)]===_0xb3ca6e);if(_0x54bd66)return _0x5617b4[_0x46c03d(0x14e)][_0x46c03d(0x1bd)](_0xb3ca6e,_0x54bd66['id']),_0x54bd66['id'];if(_0x34efd8[_0x46c03d(0x1df)]){const {stageName:_0x278d6a,criteriaName:_0x294d4f}=findSegmentCriteriaLocation(_0x34efd8['yamlConfig'],_0xb3ca6e);return _0x16f168(_0xb3ca6e,_0x462768[_0x46c03d(0x14a)]),_0x3adc53[_0x46c03d(0x1bd)](_0xb3ca6e,{'definition':_0x462768,'stageName':_0x278d6a,'criteriaName':_0x294d4f}),createPendingSegmentId(_0xb3ca6e);}const _0x376bbb=_0x34efd8[_0x46c03d(0x1c4)]?.['id'];if(!_0x376bbb)throw new SDKError(ErrorCode[_0x46c03d(0x112)],_0x46c03d(0x110));const _0x310cf2=_0x25a34f[_0x46c03d(0x182)](_0xb3ca6e);if(_0x310cf2)return _0x310cf2;const _0x222ee3=((async()=>{const _0xa3fd89=_0x46c03d;_0x16f168(_0xb3ca6e,_0x462768[_0xa3fd89(0x14a)]);const _0x546a2e=generateDeterministicJourneySegmentName(_0x34efd8['yamlConfig'][_0xa3fd89(0x1a0)],_0xb3ca6e),_0x2ad0ec=_0x5617b4['existingSegments']['find'](_0x27c3c4=>_0x27c3c4[_0xa3fd89(0x1a0)]===_0x546a2e),_0x2f8d15=createSegmentIdResolver(_0x5617b4[_0xa3fd89(0x14e)],_0xb3ca6e),_0x73bb13=await resolveRuleSegmentIds(_0x462768[_0xa3fd89(0x14a)],_0x2f8d15);let _0x2162fa;return _0x2ad0ec?(await _0x1cad51[_0xa3fd89(0xfe)][_0xa3fd89(0x16e)](_0x564398['parentId'],_0x2ad0ec['id'],{'description':_0x462768[_0xa3fd89(0x192)]||'Entry\x20criteria:\x20'+_0xb3ca6e,'rule':_0x239bb1(_0x73bb13,!![]),'countPopulation':!![]}),_0x2162fa=_0x2ad0ec['id'],saveSegmentToPushRecovery(_0x34efd8[_0xa3fd89(0x167)],_0x34efd8[_0xa3fd89(0x12d)][_0xa3fd89(0x1a0)],_0xb3ca6e,{'segmentId':_0x2162fa,'uniqueServerName':_0x546a2e,'createdAt':new Date()[_0xa3fd89(0x11f)]()})):_0x2162fa=await createOrRecoverEmbeddedSegment(_0x1cad51,_0x34efd8,{'localName':_0xb3ca6e,'uniqueSegmentName':_0x546a2e,'description':_0x462768[_0xa3fd89(0x192)]||_0xa3fd89(0xe8)+_0xb3ca6e,'journeyId':_0x376bbb,'resolvedRule':_0x73bb13,'parentId':_0x564398[_0xa3fd89(0x166)],'folderId':_0x564398[_0xa3fd89(0x13f)]||''},_0x239bb1),_0x5617b4[_0xa3fd89(0x14e)][_0xa3fd89(0x1bd)](_0xb3ca6e,_0x2162fa),_0x384ff5[_0xa3fd89(0x1bd)](_0xb3ca6e,_0x2162fa),_0x2162fa;})());_0x25a34f[_0x46c03d(0x1bd)](_0xb3ca6e,_0x222ee3);try{return await _0x222ee3;}finally{_0x25a34f['delete'](_0xb3ca6e);}},'resolveActivationId':async _0x1737a4=>{const _0x17ca1d=_0x51b3ae,_0x55abc9=_0x5717f8[_0x17ca1d(0x182)](_0x1737a4);if(_0x55abc9)return _0x55abc9;if(_0x34efd8['existingJourney']){await _0xfe105();const _0x38d236=_0x5717f8[_0x17ca1d(0x182)](_0x1737a4);if(_0x38d236)return _0x38d236;}throw new SDKError(ErrorCode[_0x17ca1d(0x1dd)],_0x17ca1d(0x11c)+_0x1737a4+'\x20(referenced\x20in\x20journey\x20'+_0x34efd8[_0x17ca1d(0x12d)]['name']+_0x17ca1d(0x1af)+'Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.');},'resolveEmbeddedActivationId':async(_0x482410,_0x2265aa)=>{const _0x3a9366=_0x51b3ae,_0x57d7b1=_0x5717f8[_0x3a9366(0x182)](_0x482410);if(_0x57d7b1)return _0x57d7b1;if(_0x34efd8[_0x3a9366(0x1df)])return _0x1210f8['set'](_0x482410,_0x2265aa),createPendingActivationId(_0x482410);if(_0x34efd8[_0x3a9366(0x1c4)]){await _0xfe105();const _0x116df0=_0x5717f8[_0x3a9366(0x182)](_0x2265aa['name']);if(_0x116df0)return _0x5717f8[_0x3a9366(0x1bd)](_0x482410,_0x116df0),_0x116df0;const _0x138b2a=activationSignature(_0x2265aa),_0x360e7d=_0x58af4b?.['get'](_0x138b2a);if(_0x360e7d)return _0x5717f8[_0x3a9366(0x1bd)](_0x482410,_0x360e7d),_0x360e7d;const _0x2dd58f=await _0x2953cb(_0x2265aa,_0x5617b4['activationContext']),_0x3978d5={..._0x2dd58f,..._0x2265aa[_0x3a9366(0x1c0)]!==undefined&&{'runAfterJourneyRefresh':_0x2265aa[_0x3a9366(0x1c0)]}},_0x1c66c8=await _0x1cad51['journey']['createActivation'](_0x34efd8[_0x3a9366(0x1c4)]['id'],_0x3978d5);return _0x5717f8[_0x3a9366(0x1bd)](_0x482410,_0x1c66c8['id']),_0x1c66c8['id'];}throw new SDKError(ErrorCode[_0x3a9366(0x112)],'Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context');},'resolveJourneyId':async _0x2f77a8=>{const _0x3b6792=_0x51b3ae;try{return await _0x1cad51[_0x3b6792(0x156)][_0x3b6792(0x101)](_0x564398[_0x3b6792(0x166)],_0x2f77a8);}catch(_0x331514){throw new SDKError(ErrorCode[_0x3b6792(0x1dd)],_0x3b6792(0x1b2)+_0x2f77a8+_0x3b6792(0x1e1)+_0x34efd8[_0x3b6792(0x12d)][_0x3b6792(0x1a0)]+'\x27)',_0x331514);}},'resolveStageId':async(_0x252ab8,_0x2a70f8)=>{const _0x425583=_0x51b3ae,_0x11b64f=await _0x1cad51[_0x425583(0x156)][_0x425583(0x187)](_0x252ab8),_0x1685b5=_0x11b64f['attributes']['journeyStages'][_0x425583(0x190)](_0x4f6d5b=>_0x4f6d5b[_0x425583(0x1a0)][_0x425583(0x183)]()===_0x2a70f8['toLowerCase']());if(!_0x1685b5?.['id'])throw new SDKError(ErrorCode[_0x425583(0x1dd)],_0x425583(0x1e2)+_0x2a70f8+_0x425583(0x1ce)+(_0x11b64f[_0x425583(0x111)]['journeyBundleName']||_0x11b64f[_0x425583(0x111)][_0x425583(0x1a0)])+'\x27');return _0x1685b5['id'];}},_0x30ef96=await _0x315e0c(_0x34efd8[_0x51b3ae(0x12d)],_0x564398[_0x51b3ae(0x166)],_0x4971e3),_0xc223c4=_0x564398[_0x51b3ae(0x191)]||_0x564398[_0x51b3ae(0x13f)];_0xc223c4&&(_0x30ef96['relationships']={'parentFolder':{'data':{'id':_0xc223c4,'type':'folder'}}});if(_0x34efd8[_0x51b3ae(0x1df)]){if(_0x3adc53[_0x51b3ae(0x11b)]>0x0||_0x1210f8[_0x51b3ae(0x11b)]>0x0)return await executeThreeStepJourneyCreate(_0x1cad51,_0x34efd8,_0x30ef96,{'pendingEmbeddedSegments':_0x3adc53,'pendingEmbeddedActivations':_0x1210f8,'embeddedSegmentNameToId':_0x384ff5,'journeyActivationNameToId':_0x5717f8},{..._0x564398,'effectiveFolderId':_0xc223c4},_0x5617b4,_0x408d89,_0x40ea1a);else{ensureJourneyDefaults(_0x30ef96['attributes']);const _0x43e4f1=await _0x1cad51[_0x51b3ae(0x156)]['create'](_0x30ef96);return deletePushRecovery(_0x34efd8[_0x51b3ae(0x167)]),{'action':_0x51b3ae(0x157),'journeyId':_0x43e4f1['id'],'embeddedSegmentNameToId':_0x384ff5};}}else{if(_0x34efd8[_0x51b3ae(0x17c)]&&_0x34efd8[_0x51b3ae(0x1c4)]){_0x30ef96['id']=_0x34efd8['existingJourney']['id'];const _0x3f4e0f=_0x30ef96[_0x51b3ae(0x111)];_0x34efd8['existingJourney'][_0x51b3ae(0x111)]?.[_0x51b3ae(0x1e0)]&&(_0x3f4e0f[_0x51b3ae(0x1e0)]=_0x34efd8[_0x51b3ae(0x1c4)][_0x51b3ae(0x111)][_0x51b3ae(0x1e0)]);const _0x1086fa=_0x34efd8[_0x51b3ae(0x1c4)][_0x51b3ae(0x111)]?.[_0x51b3ae(0x1a7)];return _0x1086fa&&_0x30ef96[_0x51b3ae(0x111)]['journeyStages']&&injectExistingStageIds(_0x30ef96[_0x51b3ae(0x111)][_0x51b3ae(0x1a7)],_0x1086fa),ensureJourneyDefaults(_0x3f4e0f),await _0x1cad51[_0x51b3ae(0x156)][_0x51b3ae(0x16a)](_0x34efd8[_0x51b3ae(0x1c4)]['id'],_0x30ef96),deletePushRecovery(_0x34efd8[_0x51b3ae(0x167)]),{'action':_0x51b3ae(0x142),'journeyId':_0x34efd8[_0x51b3ae(0x1c4)]['id'],'embeddedSegmentNameToId':_0x384ff5};}}return deletePushRecovery(_0x34efd8[_0x51b3ae(0x167)]),{'action':_0x51b3ae(0x135),'journeyId':_0x34efd8[_0x51b3ae(0x1c4)]?.['id'],'embeddedSegmentNameToId':_0x384ff5};}function findSegmentCriteriaLocation(_0x430b7c,_0xa2e403){const _0x545586=a127_0x2ef8be,_0x42cfb9=_0x430b7c[_0x545586(0x1de)]||_0x430b7c['journeys']?.[0x0]?.[_0x545586(0x1de)]||[];let _0x3cd8cb=_0x545586(0x1c5),_0x4e5ef3=_0xa2e403;const _0x1e4ed8=_0x430b7c['goal']||_0x430b7c[_0x545586(0x15a)]?.[0x0]?.[_0x545586(0x1c8)];if(_0x1e4ed8?.[_0x545586(0xfe)]===_0xa2e403)return{'stageName':_0x545586(0x1c8),'criteriaName':_0x1e4ed8[_0x545586(0x1a0)]||_0xa2e403};_0x16ee6f:for(const _0x1a7c6e of _0x42cfb9){if(_0x1a7c6e[_0x545586(0x119)]?.[_0x545586(0xfe)]===_0xa2e403){_0x3cd8cb=_0x1a7c6e[_0x545586(0x1a0)],_0x4e5ef3=_0x1a7c6e[_0x545586(0x119)][_0x545586(0x1a0)]||_0xa2e403;break;}if(_0x1a7c6e[_0x545586(0xed)])for(const _0x53fb3c of _0x1a7c6e[_0x545586(0xed)]){if(_0x53fb3c[_0x545586(0x1c9)]==='decision_point'&&_0x53fb3c[_0x545586(0x180)]?.['branches'])for(const _0x225dbb of _0x53fb3c['with'][_0x545586(0x1d8)]){if(_0x225dbb[_0x545586(0xfe)]===_0xa2e403){_0x3cd8cb=_0x1a7c6e[_0x545586(0x1a0)],_0x4e5ef3=_0x225dbb['name']||_0xa2e403;break _0x16ee6f;}}}}return{'stageName':_0x3cd8cb,'criteriaName':_0x4e5ef3};}async function executeThreeStepJourneyCreate(_0x495e7b,_0x491f70,_0x7e5720,_0x29cc7e,_0x5112cc,_0x48573d,_0x492f66,_0x127db0){const _0x3bdfab=a127_0x2ef8be,{activationDefToCreateRequest:_0xb6459c,yamlRuleToApi:_0x569434}=_0x127db0,{pendingEmbeddedSegments:_0x3a7ed7,pendingEmbeddedActivations:_0x43311d,embeddedSegmentNameToId:_0x2e9be0}=_0x29cc7e,_0x5d7bdb=JSON['parse'](JSON[_0x3bdfab(0x1ba)](_0x7e5720));ensureJourneyDefaults(_0x5d7bdb[_0x3bdfab(0x111)]),stripPendingIds(_0x5d7bdb);const _0x281e57=await _0x495e7b[_0x3bdfab(0x156)]['create'](_0x5d7bdb),_0x175556=_0x281e57['id'],_0x26cfe9=new Map();for(const _0x187e3c of _0x281e57[_0x3bdfab(0x111)]['journeyStages']){_0x26cfe9[_0x3bdfab(0x1bd)](_0x187e3c[_0x3bdfab(0x1a0)]['toLowerCase'](),_0x187e3c['id']);}recoverSegmentIdsFromPushRecovery(_0x491f70,_0x2e9be0,_0x48573d[_0x3bdfab(0x14e)]);for(const [_0x2c23a8,{definition:_0xc276da}]of _0x3a7ed7){if(_0x2e9be0[_0x3bdfab(0x117)](_0x2c23a8)){_0x492f66['onProgress']?.({'type':_0x3bdfab(0x1b9),'journeyName':_0x491f70[_0x3bdfab(0x12d)][_0x3bdfab(0x1a0)],'segmentName':_0x2c23a8});continue;}const _0x2e3526=generateDeterministicJourneySegmentName(_0x491f70['yamlConfig'][_0x3bdfab(0x1a0)],_0x2c23a8);_0x492f66[_0x3bdfab(0x15e)]?.({'type':'embedded_segment_creating','journeyName':_0x491f70[_0x3bdfab(0x12d)][_0x3bdfab(0x1a0)],'segmentName':_0x2c23a8});const _0x5a9a97=createSegmentIdResolver(_0x48573d['segmentNameToId'],_0x2c23a8),_0x378bf1=await resolveRuleSegmentIds(_0xc276da[_0x3bdfab(0x14a)],_0x5a9a97),_0x52db27=await createOrRecoverEmbeddedSegment(_0x495e7b,_0x491f70,{'localName':_0x2c23a8,'uniqueSegmentName':_0x2e3526,'description':_0xc276da['description']||_0x3bdfab(0xe8)+_0x2c23a8,'journeyId':_0x175556,'resolvedRule':_0x378bf1,'parentId':_0x5112cc['parentId'],'folderId':_0x5112cc[_0x3bdfab(0x1a6)]||''},_0x569434);_0x2e9be0[_0x3bdfab(0x1bd)](_0x2c23a8,_0x52db27),_0x48573d[_0x3bdfab(0x14e)][_0x3bdfab(0x1bd)](_0x2c23a8,_0x52db27),_0x492f66[_0x3bdfab(0x15e)]?.({'type':_0x3bdfab(0x1b9),'journeyName':_0x491f70[_0x3bdfab(0x12d)][_0x3bdfab(0x1a0)],'segmentName':_0x2c23a8});}const _0x456851=new Map();for(const [_0x436f22,_0x53e719]of _0x43311d){_0x492f66[_0x3bdfab(0x15e)]?.({'type':_0x3bdfab(0x10c),'journeyName':_0x491f70['yamlConfig'][_0x3bdfab(0x1a0)],'activationName':_0x436f22});const _0xa97a48=await _0xb6459c(_0x53e719,_0x48573d[_0x3bdfab(0x155)]),_0x1f4a84={..._0xa97a48,..._0x53e719[_0x3bdfab(0x1c0)]!==undefined&&{'runAfterJourneyRefresh':_0x53e719[_0x3bdfab(0x1c0)]}},_0x59b37a=await _0x495e7b['journey'][_0x3bdfab(0x1c1)](_0x175556,_0x1f4a84);_0x456851['set'](_0x436f22,_0x59b37a['id']),_0x29cc7e[_0x3bdfab(0x1c6)][_0x3bdfab(0x1bd)](_0x436f22,_0x59b37a['id']),_0x492f66[_0x3bdfab(0x15e)]?.({'type':_0x3bdfab(0x1db),'journeyName':_0x491f70[_0x3bdfab(0x12d)]['name'],'activationName':_0x436f22});}const _0x351d40=JSON[_0x3bdfab(0x160)](JSON[_0x3bdfab(0x1ba)](_0x7e5720));return _0x351d40['id']=_0x175556,ensureJourneyDefaults(_0x351d40['attributes']),resolvePendingIdsInRequest(_0x351d40,_0x7e5720,_0x26cfe9,_0x2e9be0,_0x456851,_0x492f66),await _0x495e7b['journey'][_0x3bdfab(0x16a)](_0x175556,_0x351d40),deletePushRecovery(_0x491f70['absolutePath']),{'action':'created','journeyId':_0x175556,'embeddedSegmentNameToId':_0x2e9be0};}export function stripWaitStepPendingIds(_0x1b4246){const _0x908385=a127_0x2ef8be,_0x40b546=_0x1b4246[_0x908385(0x1be)]&&isPendingSegmentId(_0x1b4246[_0x908385(0x1be)]),_0x10daa4=_0x1b4246['conditions']?.[_0x908385(0x152)](_0x5a8405=>_0x5a8405['segmentId']&&isPendingSegmentId(_0x5a8405[_0x908385(0x105)]));(_0x40b546||_0x10daa4)&&(_0x1b4246[_0x908385(0x10a)]=_0x908385(0x163),_0x1b4246[_0x908385(0x178)]=0x1,_0x1b4246['waitStepUnit']=_0x908385(0x13d),delete _0x1b4246['conditionSegmentId'],delete _0x1b4246[_0x908385(0x17d)],delete _0x1b4246['conditionTimeoutUnit'],delete _0x1b4246['conditions']);}export function resolveWaitStepPendingIds(_0x49dc80,_0x1a70d3,_0x5b5ac0,_0x301ccb){const _0x5bca28=a127_0x2ef8be;if(_0x1a70d3[_0x5bca28(0x1be)]&&isPendingSegmentId(_0x1a70d3[_0x5bca28(0x1be)])){const _0x54fee7=_0x5b5ac0(_0x1a70d3['conditionSegmentId'],'stage\x20\x27'+_0x301ccb+_0x5bca28(0x10d));_0x54fee7&&(_0x49dc80[_0x5bca28(0x10a)]=_0x5bca28(0x16c),_0x49dc80['conditionSegmentId']=_0x54fee7,delete _0x49dc80['waitStep'],delete _0x49dc80[_0x5bca28(0x14b)],_0x1a70d3['conditionTimeoutDuration']!==undefined&&(_0x49dc80[_0x5bca28(0x17d)]=_0x1a70d3[_0x5bca28(0x17d)]),_0x1a70d3[_0x5bca28(0xfd)]&&(_0x49dc80[_0x5bca28(0xfd)]=_0x1a70d3[_0x5bca28(0xfd)]));}if(_0x1a70d3['conditions']){const _0x8be50e=_0x1a70d3[_0x5bca28(0x172)][_0x5bca28(0x152)](_0x2f68f3=>_0x2f68f3[_0x5bca28(0x105)]&&isPendingSegmentId(_0x2f68f3[_0x5bca28(0x105)]));if(_0x8be50e){const _0x5636ac=_0x1a70d3[_0x5bca28(0x172)][_0x5bca28(0x122)](_0x542d32=>{const _0x12e60d=_0x5bca28;if(_0x542d32[_0x12e60d(0x105)]&&isPendingSegmentId(_0x542d32['segmentId'])){const _0x2f9e79=_0x5b5ac0(_0x542d32['segmentId'],'stage\x20\x27'+_0x301ccb+_0x12e60d(0x10d));return{..._0x542d32,'segmentId':_0x2f9e79||_0x542d32[_0x12e60d(0x105)]};}return{..._0x542d32};});_0x49dc80['waitStepType']=_0x5bca28(0x16c),_0x49dc80[_0x5bca28(0x172)]=_0x5636ac,delete _0x49dc80[_0x5bca28(0x178)],delete _0x49dc80['waitStepUnit'],delete _0x49dc80[_0x5bca28(0x1be)],delete _0x49dc80[_0x5bca28(0x17d)],delete _0x49dc80['conditionTimeoutUnit'];}}}function stripPendingIds(_0x3588c5){const _0x13dce9=a127_0x2ef8be;_0x3588c5[_0x13dce9(0x111)][_0x13dce9(0x1c8)]?.[_0x13dce9(0x105)]&&isPendingSegmentId(_0x3588c5[_0x13dce9(0x111)]['goal'][_0x13dce9(0x105)])&&delete _0x3588c5['attributes']['goal'];for(const _0x5eac84 of _0x3588c5[_0x13dce9(0x111)][_0x13dce9(0x1a7)]||[]){_0x5eac84[_0x13dce9(0x151)]?.[_0x13dce9(0x105)]&&isPendingSegmentId(_0x5eac84['entryCriteria'][_0x13dce9(0x105)])&&delete _0x5eac84[_0x13dce9(0x151)];_0x5eac84[_0x13dce9(0x11a)]?.[_0x13dce9(0x105)]&&isPendingSegmentId(_0x5eac84['milestone'][_0x13dce9(0x105)])&&delete _0x5eac84[_0x13dce9(0x11a)];_0x5eac84[_0x13dce9(0x1aa)]&&(_0x5eac84[_0x13dce9(0x1aa)]=_0x5eac84['exitCriterias'][_0x13dce9(0xf6)](_0x2da52e=>!_0x2da52e[_0x13dce9(0x105)]||!isPendingSegmentId(_0x2da52e[_0x13dce9(0x105)])));if(_0x5eac84[_0x13dce9(0xed)])for(const _0xde9ec1 of Object[_0x13dce9(0x185)](_0x5eac84['steps'])){const _0x4c7533=_0x5eac84[_0x13dce9(0xed)][_0xde9ec1];_0x4c7533[_0x13dce9(0x1c9)]===_0x13dce9(0x198)&&_0x4c7533[_0x13dce9(0x138)]&&isPendingActivationId(_0x4c7533[_0x13dce9(0x138)])&&(_0x4c7533[_0x13dce9(0x138)]='');if(_0x4c7533[_0x13dce9(0x1c9)]===_0x13dce9(0x18d)&&_0x4c7533[_0x13dce9(0x1d8)])for(const _0x37644d of _0x4c7533['branches']){_0x37644d[_0x13dce9(0x105)]&&isPendingSegmentId(_0x37644d[_0x13dce9(0x105)])&&(_0x37644d[_0x13dce9(0x105)]='');}_0x4c7533[_0x13dce9(0x1c9)]==='WaitStep'&&stripWaitStepPendingIds(_0x4c7533);}}}function resolvePendingIdsInRequest(_0x31c1f1,_0x33d1db,_0x151f80,_0x2653e3,_0x4986a1,_0x48001c){const _0x305442=a127_0x2ef8be,_0x5a552e=(_0x38993c,_0x2fbc26)=>{const _0x37151d=a127_0x5dc7;if(!isPendingSegmentId(_0x38993c))return _0x38993c;const _0x1ce7f8=extractPendingSegmentName(_0x38993c),_0x2353b8=_0x2653e3[_0x37151d(0x182)](_0x1ce7f8);return!_0x2353b8&&_0x48001c[_0x37151d(0x154)]?.(_0x37151d(0x19a)+_0x1ce7f8+_0x37151d(0x108)+_0x2fbc26),_0x2353b8;};if(_0x31c1f1[_0x305442(0x111)][_0x305442(0x1c8)]?.[_0x305442(0x105)]&&isPendingSegmentId(_0x31c1f1['attributes'][_0x305442(0x1c8)][_0x305442(0x105)])){const _0x5f2880=_0x5a552e(_0x31c1f1[_0x305442(0x111)][_0x305442(0x1c8)][_0x305442(0x105)],_0x305442(0x189));_0x5f2880&&(_0x31c1f1[_0x305442(0x111)][_0x305442(0x1c8)][_0x305442(0x105)]=_0x5f2880);}for(const _0x454541 of _0x31c1f1['attributes'][_0x305442(0x1a7)]||[]){const _0x4e0f24=_0x151f80['get'](_0x454541[_0x305442(0x1a0)]['toLowerCase']());_0x4e0f24&&(_0x454541['id']=_0x4e0f24);if(_0x454541[_0x305442(0x151)]?.[_0x305442(0x105)]&&isPendingSegmentId(_0x454541[_0x305442(0x151)][_0x305442(0x105)])){const _0x29e09d=_0x5a552e(_0x454541[_0x305442(0x151)]['segmentId'],_0x305442(0x14d)+_0x454541['name']+_0x305442(0x146));_0x29e09d&&(_0x454541[_0x305442(0x151)][_0x305442(0x105)]=_0x29e09d);}if(_0x454541['exitCriterias'])for(const _0xa85a34 of _0x454541[_0x305442(0x1aa)]){if(_0xa85a34[_0x305442(0x105)]&&isPendingSegmentId(_0xa85a34['segmentId'])){const _0x16107f=_0x5a552e(_0xa85a34[_0x305442(0x105)],_0x305442(0x14d)+_0x454541[_0x305442(0x1a0)]+_0x305442(0x12c));_0x16107f&&(_0xa85a34['segmentId']=_0x16107f);}}if(_0x454541['milestone']?.[_0x305442(0x105)]&&isPendingSegmentId(_0x454541[_0x305442(0x11a)]['segmentId'])){const _0x2668f6=_0x5a552e(_0x454541[_0x305442(0x11a)][_0x305442(0x105)],_0x305442(0x14d)+_0x454541[_0x305442(0x1a0)]+_0x305442(0x1ca));_0x2668f6&&(_0x454541[_0x305442(0x11a)][_0x305442(0x105)]=_0x2668f6);}if(_0x454541[_0x305442(0xed)]){const _0xddfc42=_0x47d8bd=>_0x33d1db[_0x305442(0x111)][_0x305442(0x1a7)]?.[_0x305442(0x190)](_0x3ee1ad=>_0x3ee1ad[_0x305442(0x1a0)][_0x305442(0x183)]()===_0x454541['name'][_0x305442(0x183)]())?.[_0x305442(0xed)]?.[_0x47d8bd];for(const _0x22c195 of Object[_0x305442(0x185)](_0x454541[_0x305442(0xed)])){const _0x59b40a=_0x454541[_0x305442(0xed)][_0x22c195],_0x30077d=_0xddfc42(_0x22c195);if(_0x59b40a[_0x305442(0x1c9)]===_0x305442(0x198)&&_0x59b40a[_0x305442(0x138)]&&(isPendingActivationId(_0x59b40a['journeyActivationStepId'])||_0x59b40a['journeyActivationStepId']==='')){if(_0x30077d?.[_0x305442(0x138)]&&isPendingActivationId(_0x30077d[_0x305442(0x138)])){const _0x2a8591=extractPendingActivationName(_0x30077d['journeyActivationStepId']),_0xa51818=_0x4986a1[_0x305442(0x182)](_0x2a8591);_0xa51818&&(_0x59b40a[_0x305442(0x138)]=_0xa51818);}}if(_0x59b40a[_0x305442(0x1c9)]==='DecisionPoint'&&_0x59b40a[_0x305442(0x1d8)]&&_0x30077d?.[_0x305442(0x1d8)])for(let _0x4e6448=0x0;_0x4e6448<_0x59b40a['branches'][_0x305442(0x1b1)];_0x4e6448++){const _0x4d2d85=_0x59b40a[_0x305442(0x1d8)][_0x4e6448],_0x254fac=_0x30077d[_0x305442(0x1d8)][_0x4e6448];if(_0x254fac?.[_0x305442(0x105)]&&isPendingSegmentId(_0x254fac[_0x305442(0x105)])){const _0x32762c=_0x5a552e(_0x254fac[_0x305442(0x105)],'stage\x20\x27'+_0x454541[_0x305442(0x1a0)]+_0x305442(0x128)+(_0x4d2d85['name']||_0x4e6448)+'\x27');_0x32762c&&(_0x4d2d85[_0x305442(0x105)]=_0x32762c);}}_0x59b40a[_0x305442(0x1c9)]===_0x305442(0x1a8)&&_0x30077d?.[_0x305442(0x1c9)]===_0x305442(0x1a8)&&resolveWaitStepPendingIds(_0x59b40a,_0x30077d,_0x5a552e,_0x454541['name']);}}}}
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(_0x4a2887,_0x41924a){const _0x1becf2=a128_0x20b4,_0x44f5fc=_0x4a2887();while(!![]){try{const _0x55af16=-parseInt(_0x1becf2(0x1da))/0x1+parseInt(_0x1becf2(0x1d5))/0x2*(parseInt(_0x1becf2(0x1d4))/0x3)+parseInt(_0x1becf2(0x1db))/0x4+-parseInt(_0x1becf2(0x1d3))/0x5*(-parseInt(_0x1becf2(0x1d1))/0x6)+-parseInt(_0x1becf2(0x1dc))/0x7+parseInt(_0x1becf2(0x1cf))/0x8+-parseInt(_0x1becf2(0x1d9))/0x9*(-parseInt(_0x1becf2(0x1d0))/0xa);if(_0x55af16===_0x41924a)break;else _0x44f5fc['push'](_0x44f5fc['shift']());}catch(_0xab26a4){_0x44f5fc['push'](_0x44f5fc['shift']());}}}(a128_0x2509,0x8d73a));function a128_0x20b4(_0x5255e0,_0x4ee66b){_0x5255e0=_0x5255e0-0x1ce;const _0x250955=a128_0x2509();let _0x20b496=_0x250955[_0x5255e0];return _0x20b496;}export function buildFolderIdToPathMap(_0x1a678a){const _0x41d548=a128_0x20b4,_0x570745=new Map(),_0x494c14=new Map();for(const _0x42af9f of _0x1a678a){_0x494c14[_0x41d548(0x1d7)](_0x42af9f['id'],_0x42af9f);}const _0x7cf7de=new Set();for(const _0x45d256 of _0x1a678a){!_0x45d256[_0x41d548(0x1ce)]&&_0x7cf7de[_0x41d548(0x1d8)](_0x45d256['id']);}function _0x4c2e8a(_0x39791e){const _0x4721f8=_0x41d548;if(_0x570745[_0x4721f8(0x1d6)](_0x39791e['id']))return _0x570745[_0x4721f8(0x1dd)](_0x39791e['id']);if(_0x7cf7de['has'](_0x39791e['id']))return _0x570745[_0x4721f8(0x1d7)](_0x39791e['id'],''),'';if(_0x39791e[_0x4721f8(0x1ce)]){const _0x5989b1=_0x494c14[_0x4721f8(0x1dd)](_0x39791e['parentFolderId']);if(_0x5989b1){const _0x5048ef=_0x4c2e8a(_0x5989b1),_0x4342de=_0x5048ef?_0x5048ef+'/'+_0x39791e[_0x4721f8(0x1d2)]:_0x39791e[_0x4721f8(0x1d2)];return _0x570745[_0x4721f8(0x1d7)](_0x39791e['id'],_0x4342de),_0x4342de;}}const _0x53c2d3=_0x39791e[_0x4721f8(0x1d2)];return _0x570745['set'](_0x39791e['id'],_0x53c2d3),_0x53c2d3;}for(const _0x5dd90d of _0x1a678a){_0x4c2e8a(_0x5dd90d);}return _0x570745;}function a128_0x2509(){const _0x105fce=['1757384QUyjqk','4920950JsvtuX','173154GKeoeY','name','5PCgdkt','1752oefSyU','186uSAkfQ','has','set','add','9NNLLsF','754149UbVeHS','4053676kfBmbl','3323761MznZXU','get','parentFolderId'];a128_0x2509=function(){return _0x105fce;};return a128_0x2509();}export function buildFolderPathToIdMap(_0x3e4042){const _0x5519bb=a128_0x20b4,_0x445ff9=new Map(),_0x9f554d=new Map();for(const _0x4c5a0b of _0x3e4042){_0x9f554d['set'](_0x4c5a0b['id'],_0x4c5a0b);}const _0x1a4b42=new Set();for(const _0x303cde of _0x3e4042){!_0x303cde['parentFolderId']&&_0x1a4b42[_0x5519bb(0x1d8)](_0x303cde['id']);}function _0xbabdaf(_0x2839b6){const _0x43fde5=_0x5519bb;if(_0x1a4b42['has'](_0x2839b6['id']))return'';if(_0x2839b6['parentFolderId']){const _0xb527ae=_0x9f554d[_0x43fde5(0x1dd)](_0x2839b6[_0x43fde5(0x1ce)]);if(_0xb527ae){const _0x47ea40=_0xbabdaf(_0xb527ae);return _0x47ea40?_0x47ea40+'/'+_0x2839b6['name']:_0x2839b6['name'];}}return _0x2839b6[_0x43fde5(0x1d2)];}for(const _0x5cc71b of _0x3e4042){const _0x23d6de=_0xbabdaf(_0x5cc71b);_0x445ff9[_0x5519bb(0x1d7)](_0x23d6de,_0x5cc71b['id']);}return _0x445ff9;}export function buildFolderMaps(_0x5ea0af){const _0x41a6ff=buildFolderIdToPathMap(_0x5ea0af),_0x37758c=new Map();for(const [_0x168d7f,_0x31e9fd]of _0x41a6ff){_0x37758c['set'](_0x31e9fd,_0x168d7f);}return{'idToPath':_0x41a6ff,'pathToId':_0x37758c};}export function getFolderPath(_0x5a0a06,_0x328131){const _0x3dabd0=a128_0x20b4;if(!_0x5a0a06)return'';return _0x328131[_0x3dabd0(0x1dd)](_0x5a0a06)??'';}
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(_0x17afe6,_0x37f200){const _0x41679a=a129_0x37ab,_0x496fb2=_0x17afe6();while(!![]){try{const _0x49c3ff=parseInt(_0x41679a(0x170))/0x1+-parseInt(_0x41679a(0x18c))/0x2+parseInt(_0x41679a(0x179))/0x3*(parseInt(_0x41679a(0x16d))/0x4)+-parseInt(_0x41679a(0x172))/0x5*(-parseInt(_0x41679a(0x199))/0x6)+parseInt(_0x41679a(0x18a))/0x7*(-parseInt(_0x41679a(0x180))/0x8)+-parseInt(_0x41679a(0x18f))/0x9+parseInt(_0x41679a(0x176))/0xa;if(_0x49c3ff===_0x37f200)break;else _0x496fb2['push'](_0x496fb2['shift']());}catch(_0x297c69){_0x496fb2['push'](_0x496fb2['shift']());}}}(a129_0x5f49,0xe4b8d));import a129_0x48ea83 from'path';import{parse as a129_0x1965a1}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';function a129_0x5f49(){const _0x4faede=['tdx.json','7511103EjnPAP','dirname','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','endsWith','trim','journey','Cannot\x20navigate\x20above\x20root','segment','filter','segments','66aVjgaE','exists','raw','substring','698596apeUnj','join','slice','1387327ztfSwq','Cannot\x20split\x20empty\x20path','371895uTbRel','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','pop','replace','7206030iRXAyl','File\x20not\x20found:\x20','parse','24cGkkwg','Path\x20segment\x20cannot\x20be\x20empty','relative','parent_segment','isAbsolute','root','Path\x20cannot\x20be\x20empty','16pXSFwV','No\x20tdx.json\x20found\x20for\x20file:\x20','Path\x20attempts\x20to\x20navigate\x20above\x20root','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','resolve','length','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','push','readFile','.yaml','2651173oqAgqa','type','3588802GqSxzC','startsWith'];a129_0x5f49=function(){return _0x4faede;};return a129_0x5f49();}export function parsePath(_0x334248){const _0x2dd145=a129_0x37ab;if(!_0x334248||_0x334248[_0x2dd145(0x193)]()==='')throw new Error(_0x2dd145(0x17f));const _0x42e6ee=_0x334248[_0x2dd145(0x193)]();if(_0x42e6ee==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x334248};const _0x51b5b4=_0x42e6ee[_0x2dd145(0x18d)]('/')?_0x42e6ee[_0x2dd145(0x16c)](0x1):_0x42e6ee,_0xb6ba97=_0x51b5b4['split']('/')[_0x2dd145(0x197)](_0x165d90=>_0x165d90!=='');if(_0xb6ba97[_0x2dd145(0x185)]===0x0)throw new Error(_0x2dd145(0x183));const _0x2be474=_0x42e6ee[_0x2dd145(0x18d)]('/')||!isRelativePathSegment(_0xb6ba97[0x0]);for(const _0x4cacd7 of _0xb6ba97){validatePathSegment(_0x4cacd7);}return{'segments':_0xb6ba97,'isAbsolute':_0x2be474,'raw':_0x334248};}function isRelativePathSegment(_0x1f87a6){return _0x1f87a6==='.'||_0x1f87a6==='..';}function validatePathSegment(_0x5c3e4c){const _0x5a280d=a129_0x37ab;if(_0x5c3e4c==='')throw new Error(_0x5a280d(0x17a));if(_0x5c3e4c==='.'||_0x5c3e4c==='..')return;if(/[\x00-\x1F\x7F]/['test'](_0x5c3e4c))throw new Error(_0x5a280d(0x173)+_0x5c3e4c);if(_0x5c3e4c!==_0x5c3e4c[_0x5a280d(0x193)]()){}}export function validatePath(_0x376861){const _0x3f4254=a129_0x37ab;if(_0x376861[_0x3f4254(0x198)][_0x3f4254(0x185)]===0x0&&!_0x376861['isAbsolute'])throw new Error('Relative\x20path\x20cannot\x20be\x20empty');if(_0x376861[_0x3f4254(0x17d)]){if(_0x376861[_0x3f4254(0x198)][0x0]==='..')throw new Error(_0x3f4254(0x191));let _0xf080e9=0x0;for(const _0x5e83db of _0x376861[_0x3f4254(0x198)]){if(_0x5e83db==='..'){if(_0xf080e9===0x0)throw new Error(_0x3f4254(0x182));_0xf080e9--;}else _0x5e83db!=='.'&&_0xf080e9++;}}}export function joinPaths(_0x513443,_0x45f52d){const _0x57b0c8=a129_0x37ab;if(!_0x513443||_0x513443==='/')return _0x45f52d;if(!_0x45f52d||_0x45f52d==='.')return _0x513443;if(_0x45f52d[_0x57b0c8(0x18d)]('/'))return _0x45f52d;const _0x2d1430=parsePath(_0x513443),_0x450191=parsePath(_0x45f52d),_0x22d545=[..._0x2d1430[_0x57b0c8(0x198)]];for(const _0x5dd43e of _0x450191[_0x57b0c8(0x198)]){if(_0x5dd43e==='.')continue;else{if(_0x5dd43e==='..'){if(_0x22d545['length']===0x0)throw new Error(_0x57b0c8(0x195));_0x22d545[_0x57b0c8(0x174)]();}else _0x22d545[_0x57b0c8(0x187)](_0x5dd43e);}}const _0x5e6d34=_0x22d545['join']('/');return _0x2d1430[_0x57b0c8(0x16b)][_0x57b0c8(0x18d)]('/')?'/'+_0x5e6d34:_0x5e6d34;}function a129_0x37ab(_0x459116,_0x4dc46a){_0x459116=_0x459116-0x16b;const _0x5f4994=a129_0x5f49();let _0x37abbb=_0x5f4994[_0x459116];return _0x37abbb;}export function normalizePath(_0x536180){const _0x39be14=a129_0x37ab,_0x340248=parsePath(_0x536180),_0x286151=[];for(const _0x5b3441 of _0x340248[_0x39be14(0x198)]){if(_0x5b3441==='.')continue;else{if(_0x5b3441==='..'){if(_0x286151[_0x39be14(0x185)]===0x0){if(_0x340248['isAbsolute'])throw new Error('Cannot\x20navigate\x20above\x20root');_0x286151['push']('..');}else _0x286151[_0x286151['length']-0x1]==='..'?_0x286151['push']('..'):_0x286151[_0x39be14(0x174)]();}else _0x286151[_0x39be14(0x187)](_0x5b3441);}}if(_0x286151['length']===0x0)return _0x340248[_0x39be14(0x17d)]?'/':'.';const _0x159b21=_0x286151[_0x39be14(0x16e)]('/');return _0x340248[_0x39be14(0x16b)][_0x39be14(0x18d)]('/')?'/'+_0x159b21:_0x159b21;}export function getParentPath(_0x52a7e2){const _0x25f4d9=a129_0x37ab,_0x233e88=parsePath(_0x52a7e2);if(_0x233e88[_0x25f4d9(0x198)][_0x25f4d9(0x185)]<=0x1)return'/';const _0x59ccf1=_0x233e88[_0x25f4d9(0x198)][_0x25f4d9(0x16f)](0x0,-0x1)[_0x25f4d9(0x16e)]('/');return _0x233e88['raw']['startsWith']('/')?'/'+_0x59ccf1:_0x59ccf1;}export function getBaseName(_0x486957){const _0x368ba6=a129_0x37ab,_0x4fed36=parsePath(_0x486957);return _0x4fed36[_0x368ba6(0x198)][_0x4fed36[_0x368ba6(0x198)][_0x368ba6(0x185)]-0x1]||'';}export function isChildPath(_0x19c5ce,_0x465384){const _0x582aa7=a129_0x37ab,_0x436c40=parsePath(_0x19c5ce),_0x2c1e6e=parsePath(_0x465384);if(_0x436c40[_0x582aa7(0x198)][_0x582aa7(0x185)]<=_0x2c1e6e[_0x582aa7(0x198)][_0x582aa7(0x185)])return![];for(let _0x8161f2=0x0;_0x8161f2<_0x2c1e6e[_0x582aa7(0x198)][_0x582aa7(0x185)];_0x8161f2++){if(_0x436c40[_0x582aa7(0x198)][_0x8161f2]!==_0x2c1e6e['segments'][_0x8161f2])return![];}return!![];}export function splitPath(_0x13601f){const _0x159b58=a129_0x37ab,_0x486aeb=parsePath(_0x13601f);if(_0x486aeb[_0x159b58(0x198)][_0x159b58(0x185)]===0x0)throw new Error(_0x159b58(0x171));if(_0x486aeb[_0x159b58(0x198)][_0x159b58(0x185)]===0x1)return{'parent':_0x486aeb[_0x159b58(0x198)][0x0]};return{'parent':_0x486aeb[_0x159b58(0x198)][0x0],'child':_0x486aeb[_0x159b58(0x198)][_0x159b58(0x16f)](0x1)['join']('/')};}export function isYamlFilePath(_0x35e781){const _0x44abf4=a129_0x37ab;return _0x35e781[_0x44abf4(0x192)]('.yml')||_0x35e781['endsWith'](_0x44abf4(0x189));}export async function resolveYamlFilePath(_0x396d12,_0x2a8ddf=nodeFileSystem){const _0x97487e=a129_0x37ab,_0x5855bf=a129_0x48ea83[_0x97487e(0x184)](_0x396d12);if(!await _0x2a8ddf[_0x97487e(0x19a)](_0x5855bf))throw new Error(_0x97487e(0x177)+_0x396d12);let _0x3403b3=a129_0x48ea83[_0x97487e(0x190)](_0x5855bf),_0x4ad9a8=null,_0x23aa60=null;const _0x26a7b4=a129_0x48ea83[_0x97487e(0x178)](_0x3403b3)[_0x97487e(0x17e)];while(_0x3403b3!==_0x26a7b4){const _0x4cfd58=a129_0x48ea83[_0x97487e(0x16e)](_0x3403b3,_0x97487e(0x18e));if(await _0x2a8ddf[_0x97487e(0x19a)](_0x4cfd58)){_0x4ad9a8=_0x4cfd58,_0x23aa60=_0x3403b3;break;}_0x3403b3=a129_0x48ea83[_0x97487e(0x190)](_0x3403b3);}if(!_0x4ad9a8||!_0x23aa60)throw new Error(_0x97487e(0x181)+_0x396d12);const _0x5472a0=await _0x2a8ddf[_0x97487e(0x188)](_0x4ad9a8),_0x3a3027=JSON[_0x97487e(0x178)](_0x5472a0),_0x1f526f=_0x3a3027[_0x97487e(0x17c)];if(!_0x1f526f)throw new Error(_0x97487e(0x186));const _0x5355f5=await _0x2a8ddf[_0x97487e(0x188)](_0x5855bf),_0x37616c=a129_0x1965a1(_0x5355f5),_0x3516be=_0x37616c['name'];if(!_0x3516be)throw new Error('Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20'+_0x396d12);const _0x5342e8=_0x37616c[_0x97487e(0x18b)]===_0x97487e(0x194)?'journey':_0x97487e(0x196),_0x4c8fec=a129_0x48ea83[_0x97487e(0x17b)](_0x23aa60,_0x5855bf),_0x3022b1=a129_0x48ea83[_0x97487e(0x190)](_0x4c8fec),_0x4525b0=_0x3022b1==='.'?'':_0x3022b1[_0x97487e(0x175)](/\\/g,'/'),_0x1960b3=_0x4525b0?_0x1f526f+'/'+_0x4525b0+'/'+_0x3516be:_0x1f526f+'/'+_0x3516be;return{'parentSegment':_0x1f526f,'segmentName':_0x3516be,'folderPath':_0x4525b0,'fullPath':_0x1960b3,'resourceType':_0x5342e8};}
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 a130_0x2adf(){const _0x2ac99a=['887589mvBCgq','.\x20Child\x20name\x20cannot\x20be\x20empty','14884029cRelhT','70768wESSHQ','553UwmtQL','4853064OHyDoP','3038446ObJmUf','1022440BWRAwX','3875152pkutjX','Invalid\x20segment\x20reference\x20format:\x20','1uCgGBH','20DdCrTA','.\x20Parent\x20name\x20cannot\x20be\x20empty','substring'];a130_0x2adf=function(){return _0x2ac99a;};return a130_0x2adf();}function a130_0xae9a(_0x3eb47b,_0x37fec9){_0x3eb47b=_0x3eb47b-0xfd;const _0x2adf40=a130_0x2adf();let _0xae9a2f=_0x2adf40[_0x3eb47b];return _0xae9a2f;}(function(_0x5e6e35,_0x1223e3){const _0x26463c=a130_0xae9a,_0x2fa085=_0x5e6e35();while(!![]){try{const _0x391198=-parseInt(_0x26463c(0x106))/0x1*(-parseInt(_0x26463c(0x102))/0x2)+parseInt(_0x26463c(0x10a))/0x3+parseInt(_0x26463c(0x104))/0x4+-parseInt(_0x26463c(0x103))/0x5+parseInt(_0x26463c(0x101))/0x6+-parseInt(_0x26463c(0x100))/0x7*(-parseInt(_0x26463c(0xff))/0x8)+parseInt(_0x26463c(0xfe))/0x9*(-parseInt(_0x26463c(0x107))/0xa);if(_0x391198===_0x1223e3)break;else _0x2fa085['push'](_0x2fa085['shift']());}catch(_0xf90732){_0x2fa085['push'](_0x2fa085['shift']());}}}(a130_0x2adf,0xbe4ee));export function parseSegmentRef(_0x32bf5e){const _0x2ada89=a130_0xae9a,_0x2dc64a=_0x32bf5e['indexOf']('/');if(_0x2dc64a===-0x1)return{'parentId':_0x32bf5e};if(_0x2dc64a===0x0)throw new Error(_0x2ada89(0x105)+_0x32bf5e+_0x2ada89(0x108));const _0x3d10a7=_0x32bf5e[_0x2ada89(0x109)](0x0,_0x2dc64a),_0x2168d5=_0x32bf5e['substring'](_0x2dc64a+0x1);if(_0x2168d5==='')throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x32bf5e+_0x2ada89(0xfd));return{'parentId':_0x3d10a7,'childId':_0x2168d5};}
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};}