@treasuredata/tdx 2026.3.26 → 2026.3.27

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 (205) 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/auth-login-command.js +1 -1
  11. package/dist/commands/chat-command.js +1 -1
  12. package/dist/commands/claude-command.js +1 -1
  13. package/dist/commands/claude-statusline-command.js +1 -1
  14. package/dist/commands/claude-usage-command.js +1 -1
  15. package/dist/commands/command.js +1 -1
  16. package/dist/commands/connection-command.js +1 -1
  17. package/dist/commands/databases.js +1 -1
  18. package/dist/commands/delivery-command.js +1 -1
  19. package/dist/commands/describe.js +1 -1
  20. package/dist/commands/engage-campaign-pull-command.js +1 -1
  21. package/dist/commands/engage-campaign-push-command.js +1 -1
  22. package/dist/commands/engage-campaign-validate-command.js +1 -1
  23. package/dist/commands/engage-command.js +1 -1
  24. package/dist/commands/engage-template-pull-command.js +1 -1
  25. package/dist/commands/engage-template-push-command.js +1 -1
  26. package/dist/commands/engage-template-validate-command.js +1 -1
  27. package/dist/commands/job-command.js +1 -1
  28. package/dist/commands/journey-command.js +1 -1
  29. package/dist/commands/journey-validate-command.js +1 -1
  30. package/dist/commands/llm-command.js +1 -1
  31. package/dist/commands/mcp-command.js +1 -1
  32. package/dist/commands/parent-segment-command.js +1 -1
  33. package/dist/commands/policy-command.js +1 -1
  34. package/dist/commands/profile-command.js +1 -1
  35. package/dist/commands/profiles-command.js +1 -1
  36. package/dist/commands/query-command.js +1 -1
  37. package/dist/commands/schedule-command.js +1 -1
  38. package/dist/commands/segment-command.js +1 -1
  39. package/dist/commands/segment-create-command.js +1 -1
  40. package/dist/commands/segment-fields-command.js +1 -1
  41. package/dist/commands/segment-pull-command.js +1 -1
  42. package/dist/commands/segment-push-command.js +1 -1
  43. package/dist/commands/segment-update-command.js +1 -1
  44. package/dist/commands/segment-use-command.js +1 -1
  45. package/dist/commands/segment-validate-command.js +1 -1
  46. package/dist/commands/segments.js +1 -1
  47. package/dist/commands/show.js +1 -1
  48. package/dist/commands/status-command.js +1 -1
  49. package/dist/commands/tables.js +1 -1
  50. package/dist/commands/unset-command.js +1 -1
  51. package/dist/commands/upgrade-command.js +1 -1
  52. package/dist/commands/use-command.js +1 -1
  53. package/dist/commands/user-command.js +1 -1
  54. package/dist/commands/workflow-command.js +1 -1
  55. package/dist/core/auth.js +1 -1
  56. package/dist/core/command-output.js +1 -1
  57. package/dist/core/config.js +1 -1
  58. package/dist/core/connection-cache.js +1 -1
  59. package/dist/core/constants.js +1 -1
  60. package/dist/core/credential-cache.js +1 -1
  61. package/dist/core/global-context.js +1 -1
  62. package/dist/core/keychain.js +1 -1
  63. package/dist/core/oauth-keychain.js +1 -1
  64. package/dist/core/oauth.d.ts.map +1 -1
  65. package/dist/core/oauth.js +1 -1
  66. package/dist/core/oauth.js.map +1 -1
  67. package/dist/core/profile.js +1 -1
  68. package/dist/core/project-config.js +1 -1
  69. package/dist/core/session.js +1 -1
  70. package/dist/core/user-cache.js +1 -1
  71. package/dist/core/version.js +1 -1
  72. package/dist/index.js +1 -1
  73. package/dist/mcp/server.js +1 -1
  74. package/dist/mcp/tools/index.js +1 -1
  75. package/dist/mcp/tools/tdx-run.js +1 -1
  76. package/dist/mcp/tools/tdx-search.js +1 -1
  77. package/dist/mcp/utils.js +1 -1
  78. package/dist/proxy/claude-usage-tracker.js +1 -1
  79. package/dist/proxy/passthrough-server.js +1 -1
  80. package/dist/proxy/sse-usage-parser.js +1 -1
  81. package/dist/sdk/agent/agent-config.js +1 -1
  82. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  83. package/dist/sdk/agent/agent-yaml.js +1 -1
  84. package/dist/sdk/agent/test/evaluator.js +1 -1
  85. package/dist/sdk/agent/test/executor.js +1 -1
  86. package/dist/sdk/agent/test/index.js +1 -1
  87. package/dist/sdk/agent/test/output.js +1 -1
  88. package/dist/sdk/agent/test/parser.js +1 -1
  89. package/dist/sdk/agent/tool-target-registry.js +1 -1
  90. package/dist/sdk/api.js +1 -1
  91. package/dist/sdk/client/cdp-api-client.js +1 -1
  92. package/dist/sdk/client/delivery-api-client.js +1 -1
  93. package/dist/sdk/client/endpoints.js +1 -1
  94. package/dist/sdk/client/engage-api-client.js +1 -1
  95. package/dist/sdk/client/http-client.js +1 -1
  96. package/dist/sdk/client/llm-api-client.js +1 -1
  97. package/dist/sdk/client/oauth-refresh.js +1 -1
  98. package/dist/sdk/client/rate-limiter.js +1 -1
  99. package/dist/sdk/client/td-api-client.js +1 -1
  100. package/dist/sdk/client/trino-api-client.js +1 -1
  101. package/dist/sdk/client/workflow-client.js +1 -1
  102. package/dist/sdk/connection-validator.js +1 -1
  103. package/dist/sdk/connection.js +1 -1
  104. package/dist/sdk/delivery.js +1 -1
  105. package/dist/sdk/engage/campaign-pull.js +1 -1
  106. package/dist/sdk/engage/campaign-push.js +1 -1
  107. package/dist/sdk/engage/campaign-validator.js +1 -1
  108. package/dist/sdk/engage/campaign-yaml.js +1 -1
  109. package/dist/sdk/engage/template-pull.js +1 -1
  110. package/dist/sdk/engage/template-push.js +1 -1
  111. package/dist/sdk/engage/template-validator.js +1 -1
  112. package/dist/sdk/engage/template-yaml.js +1 -1
  113. package/dist/sdk/engage/types/campaign-def.js +1 -1
  114. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  115. package/dist/sdk/engage/types/template-schema.js +1 -1
  116. package/dist/sdk/engage.js +1 -1
  117. package/dist/sdk/errors.js +1 -1
  118. package/dist/sdk/index.js +1 -1
  119. package/dist/sdk/io/index.js +1 -1
  120. package/dist/sdk/io/node-filesystem.js +1 -1
  121. package/dist/sdk/job.js +1 -1
  122. package/dist/sdk/journey.js +1 -1
  123. package/dist/sdk/llm/chat-cache.js +1 -1
  124. package/dist/sdk/llm/index.js +1 -1
  125. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  126. package/dist/sdk/llm/model-factors.js +1 -1
  127. package/dist/sdk/personalization.js +1 -1
  128. package/dist/sdk/policy.js +1 -1
  129. package/dist/sdk/query/index.js +1 -1
  130. package/dist/sdk/query/sql-parser.js +1 -1
  131. package/dist/sdk/realtime.js +1 -1
  132. package/dist/sdk/schedule.js +1 -1
  133. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  134. package/dist/sdk/segment/fields-display.js +1 -1
  135. package/dist/sdk/segment/file-discovery.js +1 -1
  136. package/dist/sdk/segment/journey-utils.js +1 -1
  137. package/dist/sdk/segment/journey-validator.js +1 -1
  138. package/dist/sdk/segment/journey-yaml.js +1 -1
  139. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  140. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  141. package/dist/sdk/segment/pull-workflow.js +1 -1
  142. package/dist/sdk/segment/push-recovery.js +1 -1
  143. package/dist/sdk/segment/push-workflow.js +1 -1
  144. package/dist/sdk/segment/resolution-context.js +1 -1
  145. package/dist/sdk/segment/segment-path-parser.js +1 -1
  146. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  147. package/dist/sdk/segment/segment-validator.js +1 -1
  148. package/dist/sdk/segment/target-resolution.js +1 -1
  149. package/dist/sdk/segment/tdx-config.js +1 -1
  150. package/dist/sdk/segment/types/activation-schema.js +1 -1
  151. package/dist/sdk/segment/types/journey-def.js +1 -1
  152. package/dist/sdk/segment/types/journey-schema.js +1 -1
  153. package/dist/sdk/segment/types/segment-def.js +1 -1
  154. package/dist/sdk/segment/types/segment-schema.js +1 -1
  155. package/dist/sdk/segment/validate-files.js +1 -1
  156. package/dist/sdk/segment/yaml-validator.js +1 -1
  157. package/dist/sdk/segment.js +1 -1
  158. package/dist/sdk/types/index.js +1 -1
  159. package/dist/sdk/types/progress.js +1 -1
  160. package/dist/sdk/user.js +1 -1
  161. package/dist/sdk/util/format-detector.js +1 -1
  162. package/dist/sdk/util/formatters.js +1 -1
  163. package/dist/sdk/util/index.js +1 -1
  164. package/dist/sdk/util/paginate.js +1 -1
  165. package/dist/sdk/util/tree-formatter.js +1 -1
  166. package/dist/sdk/workflow/archive-validation.js +1 -1
  167. package/dist/sdk/workflow/clone-workflow.js +1 -1
  168. package/dist/sdk/workflow/index.js +1 -1
  169. package/dist/sdk/workflow/pull-workflow.js +1 -1
  170. package/dist/sdk/workflow/push-workflow.js +1 -1
  171. package/dist/sdk/workflow/tdx-config.js +1 -1
  172. package/dist/sdk/workflow/workflow-utils.js +1 -1
  173. package/dist/test-utils/command-runner.js +1 -1
  174. package/dist/test-utils/factories.js +1 -1
  175. package/dist/test-utils/fixtures.js +1 -1
  176. package/dist/test-utils/http-mock.js +1 -1
  177. package/dist/test-utils/index.js +1 -1
  178. package/dist/utils/async.js +1 -1
  179. package/dist/utils/colors.js +1 -1
  180. package/dist/utils/diff.js +1 -1
  181. package/dist/utils/file-permissions.js +1 -1
  182. package/dist/utils/file-reader.js +1 -1
  183. package/dist/utils/github-releases.js +1 -1
  184. package/dist/utils/global-cache.js +1 -1
  185. package/dist/utils/json-loader.js +1 -1
  186. package/dist/utils/local-cache.js +1 -1
  187. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  188. package/dist/utils/logger/formatters/index.js +1 -1
  189. package/dist/utils/logger/handlers/console-handler.js +1 -1
  190. package/dist/utils/logger/handlers/file-handler.js +1 -1
  191. package/dist/utils/logger/handlers/index.js +1 -1
  192. package/dist/utils/logger/handlers/null-handler.js +1 -1
  193. package/dist/utils/logger/index.js +1 -1
  194. package/dist/utils/logger/logger.js +1 -1
  195. package/dist/utils/logger/types.js +1 -1
  196. package/dist/utils/option-validation.js +1 -1
  197. package/dist/utils/process.js +1 -1
  198. package/dist/utils/prompt.js +1 -1
  199. package/dist/utils/spinner.js +1 -1
  200. package/dist/utils/sse-parser.js +1 -1
  201. package/dist/utils/string-utils.js +1 -1
  202. package/dist/utils/table-ref-parser.js +1 -1
  203. package/dist/utils/tdx-logger.js +1 -1
  204. package/dist/utils/version-check.js +1 -1
  205. package/package.json +1 -1
@@ -1 +1 @@
1
- (function(_0x42ed21,_0x18297c){const _0x1a6a4b=a141_0x4164,_0x22d8f0=_0x42ed21();while(!![]){try{const _0x167d3c=-parseInt(_0x1a6a4b(0x1c6))/0x1+parseInt(_0x1a6a4b(0x1c5))/0x2+-parseInt(_0x1a6a4b(0x1b4))/0x3+parseInt(_0x1a6a4b(0x1bc))/0x4+-parseInt(_0x1a6a4b(0x1b9))/0x5+parseInt(_0x1a6a4b(0x1be))/0x6+parseInt(_0x1a6a4b(0x1bf))/0x7;if(_0x167d3c===_0x18297c)break;else _0x22d8f0['push'](_0x22d8f0['shift']());}catch(_0x5ac051){_0x22d8f0['push'](_0x22d8f0['shift']());}}}(a141_0x74b1,0x80e1d));import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';import a141_0x180a5a from'path';import{Logger}from'../../utils/logger/index.js';function a141_0x4164(_0x5910ff,_0x2d4042){_0x5910ff=_0x5910ff-0x1b2;const _0x74b114=a141_0x74b1();let _0x4164cd=_0x74b114[_0x5910ff];return _0x4164cd;}const logger=Logger['of']('tdx.sdk.push-recovery');export function getPushRecoveryPath(_0x14e127){const _0x503f34=a141_0x4164,_0x4501fb=a141_0x180a5a[_0x503f34(0x1b2)](_0x14e127),_0x1a063f=a141_0x180a5a[_0x503f34(0x1ba)](_0x14e127);return a141_0x180a5a[_0x503f34(0x1c4)](_0x4501fb,'.'+_0x1a063f+_0x503f34(0x1c2));}function a141_0x74b1(){const _0x535369=['stringify','.push-recovery.json','ENOENT','join','2023730dMQgCI','973308DmeSNq','dirname','toISOString','2257083ggcIXr','string','parse','Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20','utf-8','4754945WYSINF','basename','debug','949660aKQOgL','warn','2675424wySamz','10565625VYAiJv','journeyName'];a141_0x74b1=function(){return _0x535369;};return a141_0x74b1();}export function readPushRecovery(_0x3382dc){const _0x32054e=a141_0x4164,_0xc11f9d=getPushRecoveryPath(_0x3382dc);if(!existsSync(_0xc11f9d))return undefined;try{const _0x2b916d=readFileSync(_0xc11f9d,'utf-8'),_0x4beea5=JSON[_0x32054e(0x1b6)](_0x2b916d);if(_0x4beea5?.['version']!==0x1||typeof _0x4beea5['journeyName']!==_0x32054e(0x1b5))return undefined;return _0x4beea5;}catch(_0x95942d){return _0x95942d instanceof SyntaxError?logger[_0x32054e(0x1bb)](_0x32054e(0x1b7)+_0x95942d):logger[_0x32054e(0x1bd)]('Failed\x20to\x20read\x20push\x20recovery\x20file:\x20'+_0x95942d),undefined;}}export function writePushRecovery(_0x13f794,_0x5d4bbc){const _0x136bb2=a141_0x4164,_0x104180=getPushRecoveryPath(_0x13f794),_0x235c3c=_0x104180+'.tmp';writeFileSync(_0x235c3c,JSON[_0x136bb2(0x1c1)](_0x5d4bbc,null,0x2)+'\x0a',_0x136bb2(0x1b8)),renameSync(_0x235c3c,_0x104180);}export function deletePushRecovery(_0x237246){const _0x159a30=a141_0x4164,_0x2b8c0a=getPushRecoveryPath(_0x237246);try{unlinkSync(_0x2b8c0a);}catch(_0x5c7fba){_0x5c7fba['code']!==_0x159a30(0x1c3)&&logger[_0x159a30(0x1bb)]('Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20'+_0x5c7fba);}}export function saveSegmentToPushRecovery(_0x398e9b,_0x308786,_0x5dbb33,_0xee4854){const _0x2b376c=a141_0x4164,_0x4fa474=readPushRecovery(_0x398e9b),_0x2212bc=_0x4fa474?.[_0x2b376c(0x1c0)]===_0x308786?{..._0x4fa474,'updatedAt':new Date()[_0x2b376c(0x1b3)]()}:{'version':0x1,'journeyName':_0x308786,'updatedAt':new Date()[_0x2b376c(0x1b3)](),'segments':{}};_0x2212bc['segments'][_0x5dbb33]=_0xee4854,writePushRecovery(_0x398e9b,_0x2212bc);}
1
+ const a141_0x3683ad=a141_0x4ac3;(function(_0x286379,_0x276a98){const _0xfe100e=a141_0x4ac3,_0x466a25=_0x286379();while(!![]){try{const _0x3bccbe=-parseInt(_0xfe100e(0x19a))/0x1+parseInt(_0xfe100e(0x1a5))/0x2*(parseInt(_0xfe100e(0x1a3))/0x3)+-parseInt(_0xfe100e(0x18d))/0x4*(parseInt(_0xfe100e(0x19d))/0x5)+-parseInt(_0xfe100e(0x192))/0x6+parseInt(_0xfe100e(0x1a2))/0x7*(-parseInt(_0xfe100e(0x19b))/0x8)+parseInt(_0xfe100e(0x1a6))/0x9+-parseInt(_0xfe100e(0x197))/0xa*(-parseInt(_0xfe100e(0x190))/0xb);if(_0x3bccbe===_0x276a98)break;else _0x466a25['push'](_0x466a25['shift']());}catch(_0x3917ac){_0x466a25['push'](_0x466a25['shift']());}}}(a141_0x4119,0x2852c));import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';import a141_0x4df2cc from'path';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a141_0x3683ad(0x19e));export function getPushRecoveryPath(_0x4369ae){const _0x2faf15=a141_0x3683ad,_0x2c9cdf=a141_0x4df2cc['dirname'](_0x4369ae),_0x25767f=a141_0x4df2cc[_0x2faf15(0x1a1)](_0x4369ae);return a141_0x4df2cc[_0x2faf15(0x191)](_0x2c9cdf,'.'+_0x25767f+'.push-recovery.json');}export function readPushRecovery(_0x5f02a6){const _0x1ea89c=a141_0x3683ad,_0x14b071=getPushRecoveryPath(_0x5f02a6);if(!existsSync(_0x14b071))return undefined;try{const _0x27bf1a=readFileSync(_0x14b071,_0x1ea89c(0x1a7)),_0x1c35e9=JSON[_0x1ea89c(0x18e)](_0x27bf1a);if(_0x1c35e9?.[_0x1ea89c(0x196)]!==0x1||typeof _0x1c35e9['journeyName']!==_0x1ea89c(0x1a0))return undefined;return _0x1c35e9;}catch(_0x5f08e5){return _0x5f08e5 instanceof SyntaxError?logger[_0x1ea89c(0x193)](_0x1ea89c(0x195)+_0x5f08e5):logger['warn'](_0x1ea89c(0x198)+_0x5f08e5),undefined;}}export function writePushRecovery(_0x507106,_0x275bae){const _0x468944=a141_0x3683ad,_0x560cee=getPushRecoveryPath(_0x507106),_0x426ddc=_0x560cee+_0x468944(0x18f);writeFileSync(_0x426ddc,JSON[_0x468944(0x19f)](_0x275bae,null,0x2)+'\x0a','utf-8'),renameSync(_0x426ddc,_0x560cee);}function a141_0x4ac3(_0x5792e9,_0x31849a){_0x5792e9=_0x5792e9-0x18d;const _0x4119e8=a141_0x4119();let _0x4ac3d2=_0x4119e8[_0x5792e9];return _0x4ac3d2;}export function deletePushRecovery(_0x572c06){const _0x3f5a4a=a141_0x3683ad,_0xe9de51=getPushRecoveryPath(_0x572c06);try{unlinkSync(_0xe9de51);}catch(_0x511553){_0x511553['code']!==_0x3f5a4a(0x194)&&logger[_0x3f5a4a(0x193)](_0x3f5a4a(0x1a8)+_0x511553);}}function a141_0x4119(){const _0x562103=['parse','.tmp','5575867pqinfO','join','1827012icGUMP','debug','ENOENT','Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20','version','10oVtTnt','Failed\x20to\x20read\x20push\x20recovery\x20file:\x20','toISOString','104188goaxQo','87920mMrNzJ','journeyName','1585630LbrbqW','tdx.sdk.push-recovery','stringify','string','basename','28pJOBeL','3zLXvPv','segments','648682hmCRAh','933318FlmGHN','utf-8','Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20','4RaWXuw'];a141_0x4119=function(){return _0x562103;};return a141_0x4119();}export function saveSegmentToPushRecovery(_0x49206c,_0x277c2e,_0x18dc13,_0x36b2c4){const _0x9b84fc=a141_0x3683ad,_0x5c7748=readPushRecovery(_0x49206c),_0x2b52d0=_0x5c7748?.[_0x9b84fc(0x19c)]===_0x277c2e?{..._0x5c7748,'updatedAt':new Date()['toISOString']()}:{'version':0x1,'journeyName':_0x277c2e,'updatedAt':new Date()[_0x9b84fc(0x199)](),'segments':{}};_0x2b52d0[_0x9b84fc(0x1a4)][_0x18dc13]=_0x36b2c4,writePushRecovery(_0x49206c,_0x2b52d0);}
@@ -1 +1 @@
1
- const a142_0x469651=a142_0x3aac;(function(_0x53595a,_0x4fe9bd){const _0x4e0a4e=a142_0x3aac,_0xb5a311=_0x53595a();while(!![]){try{const _0x39b7dc=-parseInt(_0x4e0a4e(0x1df))/0x1+parseInt(_0x4e0a4e(0x173))/0x2+-parseInt(_0x4e0a4e(0x1fe))/0x3+parseInt(_0x4e0a4e(0x114))/0x4*(parseInt(_0x4e0a4e(0x199))/0x5)+parseInt(_0x4e0a4e(0x202))/0x6*(parseInt(_0x4e0a4e(0x1a4))/0x7)+parseInt(_0x4e0a4e(0x129))/0x8*(-parseInt(_0x4e0a4e(0x1b7))/0x9)+-parseInt(_0x4e0a4e(0x12f))/0xa*(-parseInt(_0x4e0a4e(0x11a))/0xb);if(_0x39b7dc===_0x4fe9bd)break;else _0xb5a311['push'](_0xb5a311['shift']());}catch(_0x4041d1){_0xb5a311['push'](_0xb5a311['shift']());}}}(a142_0x5e0e,0x6534c));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a142_0x469651(0x146));export const PENDING_SEGMENT_PREFIX=a142_0x469651(0x124);export const PENDING_ACTIVATION_PREFIX=a142_0x469651(0x12a);export function createPendingSegmentId(_0x2d1baa){return''+PENDING_SEGMENT_PREFIX+_0x2d1baa+'__';}export function isPendingSegmentId(_0x99468){const _0x1470a2=a142_0x469651;return _0x99468[_0x1470a2(0x1b4)](PENDING_SEGMENT_PREFIX)&&!_0x99468[_0x1470a2(0x1b4)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x457c7e){const _0x3140cc=a142_0x469651;return _0x457c7e[_0x3140cc(0x12c)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0xbff275){return''+PENDING_ACTIVATION_PREFIX+_0xbff275+'__';}export function isPendingActivationId(_0x4299ce){const _0xd4ec53=a142_0x469651;return _0x4299ce[_0xd4ec53(0x1b4)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x55149c){return _0x55149c['replace'](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x9cb6fc,_0x526ada){const _0x526705=a142_0x469651,_0x4aa2f7=_0x9cb6fc+'::'+(_0x526ada['trim']()||'segment'),_0x2c6838=createHash(_0x526705(0x13d))['update'](_0x4aa2f7)[_0x526705(0x1a8)](_0x526705(0x156))['slice'](0x0,0xc);return _0x526705(0x145)+_0x2c6838;}export function ensureJourneyDefaults(_0x52250c){const _0x3435be=a142_0x469651;!_0x52250c[_0x3435be(0x1dc)]&&(_0x52250c[_0x3435be(0x1dc)]=''),!_0x52250c[_0x3435be(0x1f7)]&&(_0x52250c[_0x3435be(0x1f7)]='draft');}export function injectExistingStageIds(_0x87730a,_0x4c119f){const _0x4513d2=a142_0x469651,_0x522e90=new Map(_0x4c119f['map'](_0x401e62=>[_0x401e62['name'],_0x401e62['id']]));for(const _0x24dfec of _0x87730a){if(!_0x24dfec['id']){const _0x5a251b=_0x522e90[_0x4513d2(0x15d)](_0x24dfec[_0x4513d2(0x169)]);_0x5a251b&&(_0x24dfec['id']=_0x5a251b);}}}export function resolveTDFolderPath(_0x201672,_0x4e6d0f,_0x54b0a0){const _0x6e57a4=a142_0x469651;if(!_0x4e6d0f)return _0x201672;if(_0x201672===_0x54b0a0||_0x201672[_0x6e57a4(0x1b4)](_0x54b0a0+'/'))return _0x201672;return _0x201672?_0x54b0a0+'/'+_0x201672:_0x54b0a0;}export function addFoldersToCreate(_0xa103c1,_0x421e89,_0x13cb67){const _0x5439e7=a142_0x469651;if(!_0xa103c1)return;if(_0x421e89[_0x5439e7(0x1b3)](_0xa103c1))return;const _0x3292c7=_0xa103c1['split']('/');let _0x2676cd='';for(const _0x4243fe of _0x3292c7){_0x2676cd=_0x2676cd?_0x2676cd+'/'+_0x4243fe:_0x4243fe,!_0x421e89[_0x5439e7(0x1b3)](_0x2676cd)&&_0x13cb67[_0x5439e7(0x1f4)](_0x2676cd);}}export function sortFoldersByDepth(_0x5a77fc){const _0x23bcdf=a142_0x469651;return[..._0x5a77fc][_0x23bcdf(0x113)]((_0x4601ab,_0x576c21)=>{const _0x277e8d=_0x23bcdf,_0x473a42=(_0x4601ab[_0x277e8d(0x1f8)](/\//g)||[])[_0x277e8d(0x163)],_0xe81cdd=(_0x576c21[_0x277e8d(0x1f8)](/\//g)||[])[_0x277e8d(0x163)];return _0x473a42-_0xe81cdd;});}import*as a142_0x324021 from'yaml';import{readFileSync}from'fs';import a142_0x2c8ea3 from'path';import{isJourneyDef,parseYamlString as a142_0x505a2c,toYamlString as a142_0x334139,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(_0x1e8ec7){const _0x31f81a=a142_0x469651;if(Array[_0x31f81a(0x18f)](_0x1e8ec7))return'['+_0x1e8ec7['map'](_0xb831da=>stableStringify(_0xb831da))['join'](',')+']';if(_0x1e8ec7&&typeof _0x1e8ec7==='object'){const _0x2ddb71=_0x1e8ec7,_0x4c95e8=Object[_0x31f81a(0x11f)](_0x2ddb71)[_0x31f81a(0x113)](),_0x1b85dd=_0x4c95e8[_0x31f81a(0x1a9)](_0x58f209=>'\x22'+_0x58f209+'\x22:'+stableStringify(_0x2ddb71[_0x58f209]));return'{'+_0x1b85dd[_0x31f81a(0x1c0)](',')+'}';}const _0x4a1151=JSON[_0x31f81a(0x11b)](_0x1e8ec7);return _0x4a1151===undefined?_0x31f81a(0x1b5):_0x4a1151;}function activationSignature(_0x3b51a0){const _0x35acec=a142_0x469651,_0x135c79={'connection':_0x3b51a0[_0x35acec(0x120)],..._0x3b51a0[_0x35acec(0x134)]!==undefined&&{'all_columns':_0x3b51a0['all_columns']},..._0x3b51a0[_0x35acec(0x203)]!==undefined&&{'columns':_0x3b51a0['columns']},..._0x3b51a0[_0x35acec(0x192)]!==undefined&&{'behavior':_0x3b51a0[_0x35acec(0x192)]},..._0x3b51a0[_0x35acec(0x1ee)]!==undefined&&{'schedule':_0x3b51a0[_0x35acec(0x1ee)]},..._0x3b51a0[_0x35acec(0x161)]!==undefined&&{'notification':_0x3b51a0[_0x35acec(0x161)]},..._0x3b51a0[_0x35acec(0x16d)]!==undefined&&{'connector_config':_0x3b51a0[_0x35acec(0x16d)]},..._0x3b51a0[_0x35acec(0x153)]!==undefined&&{'activation_template_id':_0x3b51a0[_0x35acec(0x153)]}};return stableStringify(_0x135c79);}async function fetchSegment(_0x2ad254,_0x493897,_0x4a8295,_0x15de74){const _0x53cdcc=a142_0x469651,_0x2a7a5a=_0x15de74?.[_0x53cdcc(0x13c)](_0x211e00=>_0x211e00['id']===_0x4a8295);if(_0x2a7a5a)return _0x2a7a5a;try{return await _0x2ad254[_0x53cdcc(0x1c9)]['getSegment'](_0x493897,_0x4a8295);}catch(_0x2cfcc7){logger[_0x53cdcc(0x140)]('getSegment\x20failed\x20for\x20'+_0x4a8295+_0x53cdcc(0x20a)+_0x2cfcc7);try{return await _0x2ad254['segment'][_0x53cdcc(0x11e)](_0x4a8295);}catch(_0x40890e){return logger[_0x53cdcc(0x140)]('getSegmentEntity\x20also\x20failed\x20for\x20'+_0x4a8295+':\x20'+_0x40890e),null;}}}function recoverSegmentIdsFromPushRecovery(_0x46b289,_0x5121f5,_0x3d4d7c){const _0x2359a5=a142_0x469651,_0x4e13b9=readPushRecovery(_0x46b289[_0x2359a5(0x135)]);if(_0x4e13b9?.['journeyName']===_0x46b289[_0x2359a5(0x1b1)][_0x2359a5(0x169)])for(const [_0x47aa4c,_0x37297d]of Object[_0x2359a5(0x188)](_0x4e13b9[_0x2359a5(0x208)])){const _0x532e45=generateDeterministicJourneySegmentName(_0x46b289[_0x2359a5(0x1b1)][_0x2359a5(0x169)],_0x47aa4c);_0x37297d[_0x2359a5(0x1de)]===_0x532e45&&(_0x5121f5['set'](_0x47aa4c,_0x37297d[_0x2359a5(0x207)]),_0x3d4d7c['set'](_0x47aa4c,_0x37297d[_0x2359a5(0x207)]));}}async function createOrRecoverEmbeddedSegment(_0xf58401,_0x538207,_0x5cb579,_0xbc80db){const _0x4d9aa8=a142_0x469651;let _0x3078b8;try{_0x3078b8=await _0xf58401[_0x4d9aa8(0x1c9)][_0x4d9aa8(0x159)]({'name':_0x5cb579[_0x4d9aa8(0x16c)],'description':_0x5cb579['description'],'journeyId':_0x5cb579[_0x4d9aa8(0x175)],'rule':_0xbc80db(_0x5cb579[_0x4d9aa8(0x1ca)],!![]),'countPopulation':!![],'parentFolderId':_0x5cb579[_0x4d9aa8(0x11d)],'audienceId':_0x5cb579['parentId']});}catch(_0x37e0e7){const _0x4ee024=_0x37e0e7 instanceof Error&&_0x37e0e7[_0x4d9aa8(0x1e1)][_0x4d9aa8(0x171)](_0x4d9aa8(0x1b6));if(_0x4ee024){const _0x4bdd4f=readPushRecovery(_0x538207[_0x4d9aa8(0x135)]),_0xb80682=_0x4bdd4f?.[_0x4d9aa8(0x1bc)]===_0x538207[_0x4d9aa8(0x1b1)][_0x4d9aa8(0x169)]?_0x4bdd4f['segments'][_0x5cb579[_0x4d9aa8(0x1e2)]]:undefined;if(_0xb80682?.['uniqueServerName']===_0x5cb579[_0x4d9aa8(0x16c)])await _0xf58401['segment'][_0x4d9aa8(0x142)](_0x5cb579[_0x4d9aa8(0x1e9)],_0xb80682[_0x4d9aa8(0x207)],{'description':_0x5cb579[_0x4d9aa8(0x1dc)],'rule':_0xbc80db(_0x5cb579[_0x4d9aa8(0x1ca)],!![]),'countPopulation':!![]}),_0x3078b8=_0xb80682[_0x4d9aa8(0x207)];else throw new SDKError(ErrorCode['SEGMENT_UPDATE_ERROR'],_0x4d9aa8(0x182)+_0x5cb579[_0x4d9aa8(0x1e2)]+_0x4d9aa8(0x14a)+(_0x4d9aa8(0x215)+_0x538207['absolutePath']['replace'](/([^/]+)$/,_0x4d9aa8(0x1e6))+')\x20')+_0x4d9aa8(0x138),_0x37e0e7);}else throw _0x37e0e7;}return saveSegmentToPushRecovery(_0x538207['absolutePath'],_0x538207[_0x4d9aa8(0x1b1)][_0x4d9aa8(0x169)],_0x5cb579[_0x4d9aa8(0x1e2)],{'segmentId':_0x3078b8,'uniqueServerName':_0x5cb579[_0x4d9aa8(0x16c)],'createdAt':new Date()[_0x4d9aa8(0x1cc)]()}),_0x3078b8;}export async function prepareSegmentFiles(_0x2d8bd4,_0x45294d,_0x5c0f99,_0x165bce,_0x3b66ef){const _0x452590=a142_0x469651,{activationDefToCreateRequest:_0x5013ce}=await import('./child-segment-yaml.js'),_0x4ee814=[],_0x1254dd=new Set();for(const {yamlConfig:_0x22a55b,folderPath:_0x22ebde,sourcePath:_0x433a7b}of _0x2d8bd4){const _0x4bc02b=resolveTDFolderPath(_0x22ebde,_0x165bce,_0x3b66ef),_0x58a46c=_0x4bc02b+':'+_0x22a55b[_0x452590(0x169)],_0x471731=_0x45294d['segmentByFolderAndName']['get'](_0x58a46c),_0x4c7d1c=_0x471731?_0x45294d[_0x452590(0x1fd)][_0x452590(0x15d)](_0x471731['id'])||[]:[];addFoldersToCreate(_0x4bc02b,_0x45294d[_0x452590(0x168)],_0x1254dd);const _0x5c3994=calculateActivationActions(_0x22a55b[_0x452590(0x116)]||[],_0x4c7d1c,_0x45294d[_0x452590(0x12e)],_0x45294d['connectionIdToNameMap']);for(const _0x585941 of _0x5c3994){(_0x585941[_0x452590(0x17d)]===_0x452590(0x1be)||_0x585941['type']===_0x452590(0x1c7))&&_0x585941[_0x452590(0x1d9)]&&(_0x585941[_0x452590(0x128)]=await _0x5013ce(_0x585941[_0x452590(0x1d9)],_0x5c0f99));}const _0x90ac8=calculateSegmentDiff(_0x22a55b,_0x471731,_0x4c7d1c,_0x45294d['idToEmailMap'],_0x45294d['connectionIdToNameMap']);_0x4ee814[_0x452590(0x1cf)]({'relativePath':_0x22a55b['name'],'absolutePath':_0x433a7b,'yamlConfig':_0x22a55b,'folderPath':_0x4bc02b,'existingSegment':_0x471731,'existingActivations':_0x4c7d1c,'isNew':_0x90ac8[_0x452590(0x213)],'hasChanges':_0x90ac8[_0x452590(0x1c6)],'diff':_0x90ac8[_0x452590(0x12d)],'activationActions':_0x5c3994});}return{'segmentFiles':_0x4ee814,'foldersToCreate':_0x1254dd};}export async function prepareJourneyFiles(_0x3b6c77,_0x5075a6,_0x3958e4,_0x4cc364){const _0x106524=a142_0x469651,_0x2ca9a9=[],_0x5488da=new Set();for(const {yamlConfig:_0x5c5e19,folderPath:_0x24796b,sourcePath:_0x21ca79}of _0x3b6c77){const _0x25889b=resolveTDFolderPath(_0x24796b,_0x3958e4,_0x4cc364),_0xb69cd4=_0x25889b+':'+_0x5c5e19[_0x106524(0x169)],_0x325800=_0x5075a6['journeyBundlesByFolderAndName'][_0x106524(0x15d)](_0xb69cd4);let _0x39c8bc,_0x7deaa;if(_0x325800&&_0x325800['length']>0x0){const _0x4739a0=buildLocalExpandedRuleMappings(_0x5c5e19),{createYamlContext:_0x18e3dc,prefetchJourneySegments:_0x57d5fa}=createPushYamlContextForBundle(_0x5075a6[_0x106524(0x167)],_0x5075a6['parentId'],_0x5075a6[_0x106524(0x127)],_0x4739a0,_0x5075a6[_0x106524(0x12e)],_0x5075a6['connectionIdToNameMap'],_0x5075a6[_0x106524(0x160)],_0x5075a6[_0x106524(0x18e)]);await _0x57d5fa(_0x325800[_0x106524(0x1a9)](_0x2d9ac4=>_0x2d9ac4['id']));const _0x324d8b=await _0x5075a6[_0x106524(0x167)][_0x106524(0x130)][_0x106524(0x148)](_0x325800[0x0][_0x106524(0x1f0)]),_0xc801f2=hasMultipleVersions(_0x5c5e19),_0x544971=async _0x570b6e=>{const _0x340b3c=_0x106524,_0x497fee=_0x5075a6[_0x340b3c(0x18e)]?.[_0x340b3c(0x15d)](_0x570b6e);if(_0x497fee)return _0x497fee;return _0x5075a6[_0x340b3c(0x1f5)]({'journeyId':_0x570b6e,'journeyName':_0x5c5e19['name'],'isMultiVersion':_0x325800[_0x340b3c(0x163)]>0x1});};if(_0xc801f2&&_0x325800[_0x106524(0x163)]>0x1){const _0x2b169e=[];for(const _0x2d17f3 of _0x325800){const _0xc9f8a8=_0x2d17f3['versionNumber']||0x1;_0x5075a6[_0x106524(0x187)]?.[_0x106524(0x1c7)]('Fetching\x20'+_0x5c5e19['name']+'\x20v'+_0xc9f8a8);const _0x1792e9=await _0x544971(_0x2d17f3['id']),_0x3c0584=_0x18e3dc(_0x2d17f3['id']),_0x1d9732=await journeyResponseToDef(_0x1792e9,_0x3c0584);_0x2b169e[_0x106524(0x1cf)]({'item':_0x2d17f3,'yaml':_0x1d9732});}const _0x3834be=buildLocalRuleToNameMappingFromJourney(_0x5c5e19);_0x7deaa=buildMergedJourneyDef(_0x2b169e,_0x3834be,_0x324d8b);const _0x4a8064=Math[_0x106524(0x185)](..._0x2b169e[_0x106524(0x1a9)](_0x3e6061=>_0x3e6061[_0x106524(0x122)][_0x106524(0x166)]||0x0)),_0xd05f73=_0x325800[_0x106524(0x13c)](_0x35ef17=>(_0x35ef17[_0x106524(0x166)]||0x0)===_0x4a8064);_0xd05f73&&(_0x5075a6[_0x106524(0x187)]?.[_0x106524(0x1c7)](_0x106524(0x1a3)+_0x5c5e19[_0x106524(0x169)]+'\x20v'+_0x4a8064),_0x39c8bc=await _0x544971(_0xd05f73['id']));}else{const _0x154689=_0x325800[_0x325800[_0x106524(0x163)]-0x1];_0x5075a6[_0x106524(0x187)]?.[_0x106524(0x1c7)]('Fetching\x20'+_0x5c5e19[_0x106524(0x169)]),_0x39c8bc=await _0x544971(_0x154689['id']);const _0x20f47c=_0x18e3dc(_0x154689['id']),_0x4a5b8e=await journeyResponseToDef(_0x39c8bc,_0x20f47c),_0x2b57b0=buildLocalRuleToNameMappingFromJourney(_0x5c5e19);_0x7deaa=buildMergedJourneyDef([{'item':_0x154689,'yaml':_0x4a5b8e}],_0x2b57b0,_0x324d8b);}}addFoldersToCreate(_0x25889b,_0x5075a6['folderPathToId'],_0x5488da);const _0x52618a=calculateJourneyDiff(_0x5c5e19,_0x7deaa);_0x2ca9a9[_0x106524(0x1cf)]({'relativePath':_0x5c5e19['name'],'absolutePath':_0x21ca79,'yamlConfig':_0x5c5e19,'folderPath':_0x25889b,'existingJourney':_0x39c8bc,'isNew':_0x52618a[_0x106524(0x213)],'hasChanges':_0x52618a[_0x106524(0x1c6)],'diff':_0x52618a[_0x106524(0x12d)]});}return{'journeyFiles':_0x2ca9a9,'foldersToCreate':_0x5488da};}export function calculateActivationActions(_0x4f9d71,_0x462ce2,_0x252036,_0x37055d){const _0x3b6e67=a142_0x469651,_0x598f2d=[],_0x46f5c1=new Map();for(const _0x525988 of _0x462ce2){_0x46f5c1[_0x3b6e67(0x17c)](_0x525988['name'],_0x525988);}const _0x3e0321=new Map();for(const _0x89a0fd of _0x4f9d71){_0x3e0321['set'](_0x89a0fd[_0x3b6e67(0x169)],_0x89a0fd);}for(const _0x48c086 of _0x4f9d71){const _0x23781e=_0x46f5c1[_0x3b6e67(0x15d)](_0x48c086[_0x3b6e67(0x169)]);if(!_0x23781e)_0x598f2d[_0x3b6e67(0x1cf)]({'type':'create','name':_0x48c086[_0x3b6e67(0x169)],'yamlActivation':_0x48c086});else{const _0x34edb3=activationResponseToDef(_0x23781e,_0x252036,_0x37055d),_0x230884=a142_0x324021[_0x3b6e67(0x11b)](_0x34edb3),_0x42b268=a142_0x324021[_0x3b6e67(0x11b)](_0x48c086);_0x230884!==_0x42b268&&_0x598f2d[_0x3b6e67(0x1cf)]({'type':_0x3b6e67(0x1c7),'name':_0x48c086[_0x3b6e67(0x169)],'yamlActivation':_0x48c086,'existingActivation':_0x23781e});}}for(const _0x4e3948 of _0x462ce2){!_0x3e0321[_0x3b6e67(0x1b3)](_0x4e3948[_0x3b6e67(0x169)])&&_0x598f2d['push']({'type':_0x3b6e67(0x1dd),'name':_0x4e3948[_0x3b6e67(0x169)],'existingActivation':_0x4e3948});}return _0x598f2d;}function calculateYamlDiff(_0x20a9e5,_0x1029fe){if(_0x1029fe){const _0x525da6=generateDiff(_0x1029fe,_0x20a9e5),_0x1841e0=hasChanges(_0x525da6);return{'isNew':![],'hasChanges':_0x1841e0,'diff':_0x1841e0?formatDiffWithColors(_0x525da6):undefined};}const _0x29c07c=generateDiff('',_0x20a9e5);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x29c07c)};}export function calculateSegmentDiff(_0x21a487,_0x231fc8,_0x524287,_0x33638a,_0x1d02f0){const _0xadea68=segmentToYamlString(_0x21a487),_0x4aca86=_0x231fc8?segmentToYamlString(segmentWithActivationsToYaml(_0x231fc8,_0x524287,undefined,_0x33638a,_0x1d02f0)):undefined;return calculateYamlDiff(_0xadea68,_0x4aca86);}export function calculateJourneyDiff(_0x44228e,_0x524437){const _0x4b1f49=normalizeJourneyDef(_0x44228e,_0x44228e),_0x42049a=a142_0x334139(_0x4b1f49),_0x123ad1=_0x524437?a142_0x334139(normalizeJourneyDef(_0x524437,_0x44228e)):undefined;return calculateYamlDiff(_0x42049a,_0x123ad1);}export function findSegmentsToDelete(_0x46f04a,_0x1a7a7d,_0x53772a,_0x35a555,_0xd4a685){const _0x20f763=a142_0x469651,_0x3ec932=new Set();for(const {yamlConfig:_0x4b9ad9,folderPath:_0x279c36}of _0x1a7a7d){_0x3ec932['add'](_0x279c36+':'+_0x4b9ad9[_0x20f763(0x169)]);}return _0x46f04a['filter'](_0x5974c8=>{const _0x150ad9=_0x20f763,_0x3e006c=_0x5974c8[_0x150ad9(0x1eb)]?_0x53772a['get'](_0x5974c8[_0x150ad9(0x1eb)]['toString']())||'':'',_0x4205d8=_0x3e006c+':'+_0x5974c8[_0x150ad9(0x169)];if(_0x3ec932[_0x150ad9(0x1b3)](_0x4205d8))return![];if(_0xd4a685)return _0x3e006c===_0x35a555||_0x3e006c[_0x150ad9(0x1b4)](_0x35a555+'/');return!![];});}export function findJourneysToDelete(_0x6af268,_0x52d09f,_0x513c6c,_0x3c9091,_0x3d143f){const _0x3710ef=a142_0x469651,_0xde9ae4=new Set();for(const {yamlConfig:_0x4987a2,folderPath:_0x7f70b1}of _0x52d09f){_0xde9ae4[_0x3710ef(0x1f4)](_0x7f70b1+':'+_0x4987a2['name']);}return _0x6af268[_0x3710ef(0x19c)](_0x13e0da=>{const _0x1f28bc=_0x3710ef,_0x5b1ffb=_0x13e0da[_0x1f28bc(0x11d)]?_0x513c6c[_0x1f28bc(0x15d)](_0x13e0da[_0x1f28bc(0x11d)])||'':'',_0xc042d6=_0x5b1ffb+':'+_0x13e0da[_0x1f28bc(0x17e)];if(_0xde9ae4['has'](_0xc042d6))return![];if(_0x3d143f)return _0x5b1ffb===_0x3c9091||_0x5b1ffb[_0x1f28bc(0x1b4)](_0x3c9091+'/');return!![];});}export function buildSegmentLookupMap(_0x59fc59,_0x5c97f6){const _0x335145=a142_0x469651,_0x11c99b=new Map();for(const _0xf1bbfe of _0x59fc59){const _0x3bff59=_0xf1bbfe[_0x335145(0x1eb)]?_0x5c97f6[_0x335145(0x15d)](_0xf1bbfe[_0x335145(0x1eb)]['toString']())||'':'',_0x4391b6=_0x3bff59+':'+_0xf1bbfe[_0x335145(0x169)];_0x11c99b[_0x335145(0x17c)](_0x4391b6,_0xf1bbfe);}return _0x11c99b;}export function buildSegmentNameToIdMap(_0x54930b){const _0x371868=a142_0x469651,_0x54095e=new Map();for(const _0x4500cb of _0x54930b){_0x54095e[_0x371868(0x17c)](_0x4500cb[_0x371868(0x169)],_0x4500cb['id']);}return _0x54095e;}export function buildJourneyBundleLookupMap(_0x421f9b,_0x1d7d1f){const _0xef661e=a142_0x469651,_0x5d6a08=new Map();for(const _0x46db5f of _0x421f9b){const _0x3c5443=_0x46db5f[_0xef661e(0x11d)]?_0x1d7d1f[_0xef661e(0x15d)](_0x46db5f[_0xef661e(0x11d)])||'':'',_0x4b1859=_0x3c5443+':'+_0x46db5f[_0xef661e(0x17e)];!_0x5d6a08[_0xef661e(0x1b3)](_0x4b1859)&&_0x5d6a08[_0xef661e(0x17c)](_0x4b1859,[]),_0x5d6a08[_0xef661e(0x15d)](_0x4b1859)[_0xef661e(0x1cf)](_0x46db5f);}for(const _0x4db898 of _0x5d6a08[_0xef661e(0x20f)]()){_0x4db898['sort']((_0x2c2d72,_0x2cc121)=>(_0x2c2d72['versionNumber']||0x0)-(_0x2cc121[_0xef661e(0x166)]||0x0));}return _0x5d6a08;}export function collectFoldersToCreate(_0xae2e3e,_0x4afc32){const _0xc3a7c8=a142_0x469651,_0x287181=new Set();for(const _0x1e8bfe of _0xae2e3e){if(!_0x1e8bfe)continue;if(_0x4afc32['has'](_0x1e8bfe))continue;const _0x3cc8a6=_0x1e8bfe[_0xc3a7c8(0x214)]('/');let _0x38b027='';for(const _0x4120c0 of _0x3cc8a6){_0x38b027=_0x38b027?_0x38b027+'/'+_0x4120c0:_0x4120c0,!_0x4afc32[_0xc3a7c8(0x1b3)](_0x38b027)&&_0x287181[_0xc3a7c8(0x1f4)](_0x38b027);}}return _0x287181;}export function parseAndClassifyYamlFiles(_0x326afa,_0x381af3,_0x6fddb8){const _0x5adc3f=a142_0x469651,_0x12a801=[],_0x6ef763=[];for(const _0x2f3bbd of _0x326afa){const _0x362c75=a142_0x2c8ea3[_0x5adc3f(0x1b0)](_0x381af3,a142_0x2c8ea3['dirname'](_0x2f3bbd)),_0x5ebeba=_0x362c75==='.'?'':_0x362c75,_0x558b06=readFileSync(_0x2f3bbd,_0x5adc3f(0x1d8)),_0x39224b=a142_0x324021['parse'](_0x558b06);if(isJourneyDef(_0x39224b)){const _0x13140f=a142_0x505a2c(_0x558b06);_0x6ef763['push']({'yamlConfig':_0x13140f,'folderPath':_0x5ebeba,'sourcePath':_0x2f3bbd});}else{if(!_0x6fddb8?.[_0x5adc3f(0x152)]){const _0x392247=parseSegmentYamlFile(_0x558b06),_0x27ff97=normalizeChildSegmentYaml(_0x392247);_0x12a801[_0x5adc3f(0x1cf)]({'yamlConfig':_0x27ff97,'folderPath':_0x5ebeba,'sourcePath':_0x2f3bbd});}}}return{'segments':_0x12a801,'journeys':_0x6ef763};}export function validateParsedFiles(_0x43e818,_0x7b9ef){const _0x1eba61=a142_0x469651,_0x192146=[];for(const {yamlConfig:_0x5b93df,sourcePath:_0x1b63e8}of _0x43e818[_0x1eba61(0x208)]){const _0x3fe749=readFileSync(_0x1b63e8,_0x1eba61(0x1d8)),_0x2ce464=a142_0x324021[_0x1eba61(0x1c4)](_0x3fe749),_0x1f6ad5=validateSegmentDef(_0x5b93df,{'source':_0x3fe749,'document':_0x2ce464},{'skipSchema':!![]});if(!_0x1f6ad5[_0x1eba61(0x1d2)]){const _0xd0add8=a142_0x2c8ea3['relative'](_0x7b9ef,_0x1b63e8);_0x192146[_0x1eba61(0x1cf)]({'filePath':_0xd0add8,'source':_0x3fe749,'result':_0x1f6ad5,'isJourney':![]});}}for(const {yamlConfig:_0x44cb1e,sourcePath:_0x299f46}of _0x43e818[_0x1eba61(0x1e5)]){const _0x38b827=readFileSync(_0x299f46,_0x1eba61(0x1d8)),_0x410a1f=a142_0x324021[_0x1eba61(0x1c4)](_0x38b827),_0x13e245=validateJourneyDef(_0x44cb1e,{'source':_0x38b827,'document':_0x410a1f},{'skipSchema':!![]});if(!_0x13e245[_0x1eba61(0x1d2)]){const _0x222797=a142_0x2c8ea3['relative'](_0x7b9ef,_0x299f46);_0x192146[_0x1eba61(0x1cf)]({'filePath':_0x222797,'source':_0x38b827,'result':_0x13e245,'isJourney':!![]});}}return _0x192146;}export function formatValidationErrors(_0x2af6fd){const _0x433bc9=a142_0x469651,_0x293541=[];for(const {filePath:_0x157f3d,source:_0x4eb649,result:_0x50f282,isJourney:_0x25b0c5}of _0x2af6fd){const _0x15a52a=_0x25b0c5?_0x433bc9(0x130):_0x433bc9(0x1c9);_0x293541[_0x433bc9(0x1cf)]('\x0a'+_0x157f3d+'\x20('+_0x15a52a+'):\x20'+_0x50f282['errors'][_0x433bc9(0x163)]+'\x20error(s)'),_0x293541[_0x433bc9(0x1cf)](formatValidationResult(_0x50f282,_0x4eb649,_0x157f3d));}return _0x293541[_0x433bc9(0x1c0)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x37f0e7){const _0xed1367=a142_0x469651,_0x46e995=new Set(),_0x444d25=new Map(),_0x53632b=collectSegmentUsageCounts(_0x37f0e7);if(_0x37f0e7[_0xed1367(0x208)])for(const [_0x597538,_0xe0555d]of Object[_0xed1367(0x188)](_0x37f0e7[_0xed1367(0x208)])){_0x46e995[_0xed1367(0x1f4)](_0x597538);if(_0xe0555d[_0xed1367(0x1a0)]){const _0xad3e48=yamlRuleToApi(_0xe0555d['rule']),_0x5a377c=apiRuleToYaml(_0xad3e48);_0x444d25[_0xed1367(0x17c)](_0x597538,_0x5a377c);}}const _0x7b6306=new Map();let _0xf67142=0x0;for(const [_0x509f62,_0x1e4c93]of _0x444d25){const _0xa9ad5c=serializeExpandedRule(_0x1e4c93,_0x444d25),_0x26b8cf=_0x7b6306[_0xed1367(0x15d)](_0xa9ad5c)||[];_0x26b8cf[_0xed1367(0x1cf)]({'name':_0x509f62,'index':_0xf67142}),_0x7b6306['set'](_0xa9ad5c,_0x26b8cf),_0xf67142++;}const _0xcc7199=new Map();for(const [_0x55e698,_0x34b681]of _0x7b6306){const _0x14d6f1=_0x34b681[_0xed1367(0x19b)]()[_0xed1367(0x113)]((_0x5c1483,_0x2f3576)=>{const _0x50e278=_0xed1367,_0x37a616=_0x53632b[_0x50e278(0x15d)](_0x5c1483[_0x50e278(0x169)])||0x0,_0x474aea=_0x53632b['get'](_0x2f3576[_0x50e278(0x169)])||0x0;if(_0x37a616!==_0x474aea)return _0x474aea-_0x37a616;return _0x5c1483['index']-_0x2f3576[_0x50e278(0x123)];})[_0xed1367(0x1a9)](_0x14c017=>_0x14c017['name']),_0x222b82=[];for(const _0x3cf16b of _0x14d6f1){const _0x4147fc=_0x53632b[_0xed1367(0x15d)](_0x3cf16b)||0x0,_0x1427cd=Math[_0xed1367(0x185)](_0x4147fc,0x1);for(let _0x2b4596=0x0;_0x2b4596<_0x1427cd;_0x2b4596++){_0x222b82['push'](_0x3cf16b);}}_0xcc7199['set'](_0x55e698,_0x222b82);}return{'existingLocalSegmentNames':_0x46e995,'localSegmentRules':_0x444d25,'localExpandedRuleToNames':_0xcc7199};}export function createSegmentIdResolver(_0x574a46,_0x3e0d8d){return async _0x28699f=>{const _0x312993=a142_0x3aac,_0x370d22=_0x574a46[_0x312993(0x15d)](_0x28699f);if(!_0x370d22)throw new SDKError(ErrorCode[_0x312993(0x212)],_0x312993(0x1d1)+_0x28699f+'\x20(referenced\x20in\x20embedded\x20segment\x20\x27'+_0x3e0d8d+'\x27)');return _0x370d22;};}export function extractRootFolderId(_0x581a07){const _0xcd6592=a142_0x469651;return _0x581a07['relationships']?.[_0xcd6592(0x1a5)]?.[_0xcd6592(0x143)]?.['id']||_0x581a07['relationships']?.[_0xcd6592(0x1ae)]?.[_0xcd6592(0x143)]?.['id'];}export function buildConnectionMaps(_0x3a1f34){const _0x43a9da=a142_0x469651,_0x2acb0d=new Map(),_0x2b0171=new Map(),_0x2d3ceb=new Map();for(const _0x5260d3 of _0x3a1f34){_0x2acb0d[_0x43a9da(0x17c)](_0x5260d3[_0x43a9da(0x169)],parseInt(_0x5260d3['id'],0xa)),_0x2b0171[_0x43a9da(0x17c)](_0x5260d3['id'],_0x5260d3['name']),_0x2d3ceb[_0x43a9da(0x17c)](_0x5260d3[_0x43a9da(0x169)],_0x5260d3[_0x43a9da(0x17d)]);}return{'nameToId':_0x2acb0d,'idToName':_0x2b0171,'nameToType':_0x2d3ceb};}export function calculatePushStats(_0x26ab9f,_0x4e96cb,_0x34715e,_0x41448f,_0x3f56de,_0x235c62,_0x584868){const _0x3040ff=a142_0x469651,_0x384ec1=_0x26ab9f[_0x3040ff(0x19c)](_0x272fda=>_0x272fda[_0x3040ff(0x213)]),_0x691cf6=_0x26ab9f[_0x3040ff(0x19c)](_0x2197bf=>!_0x2197bf[_0x3040ff(0x213)]&&_0x2197bf[_0x3040ff(0x1c6)]),_0x4ac0ef=_0x26ab9f[_0x3040ff(0x19c)](_0x4d99e2=>!_0x4d99e2[_0x3040ff(0x213)]&&!_0x4d99e2[_0x3040ff(0x1c6)]),_0x547d2f=_0x235c62?_0x41448f:[],_0x39f31a=_0x4e96cb[_0x3040ff(0x19c)](_0x4a5558=>_0x4a5558[_0x3040ff(0x213)]),_0x542821=_0x4e96cb[_0x3040ff(0x19c)](_0x4bc055=>!_0x4bc055[_0x3040ff(0x213)]&&_0x4bc055[_0x3040ff(0x1c6)]),_0x39c178=_0x4e96cb[_0x3040ff(0x19c)](_0xf9e720=>!_0xf9e720[_0x3040ff(0x213)]&&!_0xf9e720['hasChanges']),_0x16c463=_0x235c62?_0x3f56de:[],_0x41f170=_0x26ab9f[_0x3040ff(0x1e7)](_0x5ca6fb=>_0x5ca6fb['activationActions']),_0x5f7727=_0x41f170[_0x3040ff(0x19c)](_0x159048=>_0x159048['type']==='create'),_0x431eb4=_0x41f170[_0x3040ff(0x19c)](_0x321cd6=>_0x321cd6['type']==='update'),_0x6d0d46=_0x41f170['filter'](_0xa7661b=>_0xa7661b[_0x3040ff(0x17d)]===_0x3040ff(0x1dd)),_0x5e7049=Array[_0x3040ff(0x1c2)](_0x34715e)[_0x3040ff(0x113)](),_0x23996f=_0x584868?![]:_0x384ec1[_0x3040ff(0x163)]>0x0||_0x691cf6[_0x3040ff(0x163)]>0x0||_0x547d2f[_0x3040ff(0x163)]>0x0,_0x5188c2=_0x39f31a[_0x3040ff(0x163)]>0x0||_0x542821[_0x3040ff(0x163)]>0x0||_0x16c463[_0x3040ff(0x163)]>0x0,_0x2a1db7=_0x584868?![]:_0x41f170['length']>0x0,_0x45e8dc=_0x5e7049['length']>0x0;return{'segments':{'new':_0x384ec1,'changed':_0x691cf6,'unchanged':_0x4ac0ef,'toDelete':_0x547d2f},'journeys':{'new':_0x39f31a,'changed':_0x542821,'unchanged':_0x39c178,'toDelete':_0x16c463},'activations':{'all':_0x41f170,'toCreate':_0x5f7727,'toUpdate':_0x431eb4,'toDelete':_0x6d0d46},'folders':{'toCreate':_0x5e7049},'counts':{'segments':{'new':_0x384ec1[_0x3040ff(0x163)],'changed':_0x691cf6[_0x3040ff(0x163)],'unchanged':_0x4ac0ef[_0x3040ff(0x163)],'toDelete':_0x547d2f[_0x3040ff(0x163)]},'journeys':{'new':_0x39f31a[_0x3040ff(0x163)],'changed':_0x542821['length'],'unchanged':_0x39c178[_0x3040ff(0x163)],'toDelete':_0x16c463['length']},'activations':{'create':_0x5f7727[_0x3040ff(0x163)],'update':_0x431eb4[_0x3040ff(0x163)],'delete':_0x6d0d46[_0x3040ff(0x163)]},'folders':_0x5e7049[_0x3040ff(0x163)]},'hasChanges':_0x23996f||_0x5188c2||_0x2a1db7||_0x45e8dc};}export async function buildPushExecutionContext(_0x4ff57d,_0x241dc8,_0x3ddbbe,_0x5a029a,_0x558d97,_0xa7a9f9){const _0x4f1539=a142_0x469651,_0x4dacc3=extractRootFolderId(_0x3ddbbe),{pathToId:_0xd0618b,idToPath:_0x213072}=buildFolderMaps(_0x558d97),_0x580208=buildSegmentNameToIdMap(_0x5a029a),_0x2a47f8=new Map(),{batchAsync:_0x10a276}=await import(_0x4f1539(0x162)),[_0x3cf348,_0x585819]=await Promise[_0x4f1539(0x14f)]([_0x4ff57d[_0x4f1539(0x121)]['buildUserMaps'](),_0x4ff57d[_0x4f1539(0x120)][_0x4f1539(0x1d0)](),((async()=>{const _0x26b2f3=_0x4f1539;!_0xa7a9f9&&_0x5a029a[_0x26b2f3(0x163)]>0x0&&await _0x10a276(_0x5a029a,async _0x4a3b28=>{const _0x418baa=_0x26b2f3,_0x5b63cf=await _0x4ff57d[_0x418baa(0x1c9)]['listActivations'](_0x241dc8,_0x4a3b28['id']);_0x2a47f8[_0x418baa(0x17c)](_0x4a3b28['id'],_0x5b63cf);});})())]),{emailToId:_0xc7fe42,idToEmail:_0x36fb6b}=_0x3cf348,_0x57b654=buildConnectionMaps(_0x585819);return{'rootFolderId':_0x4dacc3,'folderPathToId':_0xd0618b,'folderIdToPath':_0x213072,'segmentNameToId':_0x580208,'activationsBySegmentId':_0x2a47f8,'emailToIdMap':_0xc7fe42,'idToEmailMap':_0x36fb6b,'connectionNameToIdMap':_0x57b654[_0x4f1539(0x179)],'connectionIdToNameMap':_0x57b654[_0x4f1539(0x136)],'connectionNameToTypeMap':_0x57b654[_0x4f1539(0x165)]};}export function createPushYamlContextForBundle(_0x52e753,_0x44f456,_0x13a2c9,_0x414b2b,_0x1f3450,_0x4cd951,_0x214826,_0x4d07dc){const {existingLocalSegmentNames:_0x346be9,localExpandedRuleToNames:_0x3f390e}=_0x414b2b,_0x546a05=new Set(),_0x35701f=new Map(),_0xd610d3=new Map(),_0x5b151b=new Map(),_0x336fac=createJumpTargetCache(),_0x399272=new Map(),_0x503a8f=new Map(),_0x2a8c0f=new Set();let _0x37966e;const _0xcf52e6=_0x142f40=>{const _0x473d05={'resolveSegment':async _0x4a9420=>{const _0x594161=a142_0x3aac,_0x12746a=_0x5b151b[_0x594161(0x15d)](_0x4a9420);if(_0x12746a!==undefined)return{'name':_0x12746a,'isJourneyLocal':!![]};try{const _0x2340f4=await fetchSegment(_0x52e753,_0x44f456,_0x4a9420,_0x13a2c9);if(!_0x2340f4)throw new Error(_0x594161(0x20c));const _0x3c5d0c=generateJourneyLocalName(_0x2340f4['name']),_0x12c74d=_0x2340f4['kind']===SEGMENT_KIND_JOURNEY&&_0x3c5d0c!==undefined;let _0x3173cf=_0x2340f4[_0x594161(0x169)],_0x25d86a;if(_0x12c74d&&_0x2340f4[_0x594161(0x1a0)]){const _0x281677=apiRuleToYaml(_0x2340f4[_0x594161(0x1a0)]);_0x503a8f[_0x594161(0x17c)](_0x4a9420,_0x281677);const _0x2a9c2f=async _0x27691e=>{const _0x2179bf=_0x594161,_0x5e5325=collectSegmentRefsFromRule(_0x27691e);for(const _0x10c832 of _0x5e5325){if(!_0x503a8f[_0x2179bf(0x1b3)](_0x10c832))try{const _0x3ed453=await fetchSegment(_0x52e753,_0x44f456,_0x10c832,_0x13a2c9);if(_0x3ed453?.[_0x2179bf(0x1a0)]){const _0xc1dbc0=apiRuleToYaml(_0x3ed453[_0x2179bf(0x1a0)]);_0x503a8f[_0x2179bf(0x17c)](_0x10c832,_0xc1dbc0),await _0x2a9c2f(_0xc1dbc0);}}catch(_0x204b8d){logger[_0x2179bf(0x140)](_0x2179bf(0x201)+_0x10c832+':\x20'+_0x204b8d);}}};await _0x2a9c2f(_0x281677);const _0x157668=serializeExpandedRule(_0x281677,_0x503a8f),_0x2d87a1=_0x3f390e['get'](_0x157668);if(_0x2d87a1&&_0x2d87a1[_0x594161(0x163)]>0x0){const _0x3bcfb1=_0x35701f[_0x594161(0x15d)](_0x157668)||0x0,_0x40d99c=_0x2d87a1[_0x3bcfb1]||_0x2d87a1[_0x2d87a1[_0x594161(0x163)]-0x1];_0x35701f['set'](_0x157668,_0x3bcfb1+0x1),_0x3173cf=_0x40d99c,_0x546a05['add'](_0x3173cf),_0x5b151b[_0x594161(0x17c)](_0x4a9420,_0x3173cf);const _0x2947e7=await resolveRuleSegmentRefs(_0x281677,async _0x26d491=>{const _0x43e65d=_0x594161,_0x3fe8f6=_0x5b151b['get'](_0x26d491);if(_0x3fe8f6)return _0x3fe8f6;const _0x717791=await _0x37966e['resolveSegment'](_0x26d491);return _0x717791[_0x43e65d(0x169)];});_0x25d86a={'description':_0x2340f4[_0x594161(0x1dc)],'rule':_0x2947e7};}else{const _0x2eb804=_0x399272[_0x594161(0x15d)](_0x157668);if(_0x2eb804)_0x3173cf=_0x2eb804,_0x5b151b['set'](_0x4a9420,_0x3173cf);else{if(_0x3c5d0c){let _0x21985c=_0x3c5d0c,_0x9997ba=0x2;while(_0x546a05[_0x594161(0x1b3)](_0x21985c)||_0x346be9[_0x594161(0x1b3)](_0x21985c)){_0x21985c=_0x3c5d0c+'_'+_0x9997ba,_0x9997ba++;}_0x546a05[_0x594161(0x1f4)](_0x21985c),_0x3173cf=_0x21985c;}_0x5b151b[_0x594161(0x17c)](_0x4a9420,_0x3173cf),_0x399272[_0x594161(0x17c)](_0x157668,_0x3173cf);const _0x59ad22=await resolveRuleSegmentRefs(_0x281677,async _0x24bdf=>{const _0x965c41=_0x594161,_0x46c29a=_0x5b151b[_0x965c41(0x15d)](_0x24bdf);if(_0x46c29a)return _0x46c29a;const _0x21c1d8=await _0x37966e[_0x965c41(0x118)](_0x24bdf);return _0x21c1d8['name'];});_0x25d86a={'description':_0x2340f4[_0x594161(0x1dc)],'rule':_0x59ad22};}}}return{'name':_0x3173cf,'isJourneyLocal':_0x12c74d,'definition':_0x25d86a};}catch(_0x5a8361){return logger[_0x594161(0x140)]('Failed\x20to\x20resolve\x20segment\x20'+_0x4a9420+':\x20'+_0x5a8361),{'name':_0x4a9420,'isJourneyLocal':![]};}},'resolveActivation':async _0x40c177=>{const _0x4bf2ad=a142_0x3aac,_0x48ccd3=_0xd610d3[_0x4bf2ad(0x15d)](_0x40c177);if(_0x48ccd3!==undefined)return{'name':_0x48ccd3,'isJourneyLocal':!![]};try{let _0x5a75f9=_0x214826?.[_0x4bf2ad(0x15d)](_0x40c177);!_0x5a75f9&&(_0x5a75f9=await _0x52e753[_0x4bf2ad(0x130)][_0x4bf2ad(0x15f)](_0x142f40,_0x40c177));const _0x5ec464=_0x5a75f9[_0x4bf2ad(0x1ab)][_0x4bf2ad(0x144)][_0x4bf2ad(0x169)]||_0x40c177,_0x118e32=sanitizeYamlKey(_0x5ec464)||_0x4bf2ad(0x1c1)+_0x40c177,_0x2df384=_0x118e32;_0xd610d3[_0x4bf2ad(0x17c)](_0x40c177,_0x2df384);const _0x35e11e=journeyActivationStepToYaml(_0x5a75f9,_0x1f3450,_0x4cd951);return{'name':_0x2df384,'isJourneyLocal':!![],'definition':_0x35e11e};}catch(_0x20f0c4){return logger[_0x4bf2ad(0x140)](_0x4bf2ad(0x18d)+_0x40c177+':\x20'+_0x20f0c4),{'name':_0x40c177,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0xa2fef0,_0x1e1347)=>resolveJumpTarget(_0xa2fef0,_0x1e1347,_0x336fac,async _0x11572d=>{const _0x8ab498=a142_0x3aac,_0xd811be=_0x4d07dc?.[_0x8ab498(0x15d)](_0x11572d);if(_0xd811be)return _0xd811be;return _0x52e753[_0x8ab498(0x130)][_0x8ab498(0x190)](_0x11572d);})};return _0x37966e=_0x473d05,_0x473d05;},_0x79b02=async _0x210c0f=>{const _0x3fbefe=a142_0x3aac,{collectSegmentIdsFromJourneyApi:_0x1f0f74}=await import('./journey-yaml.js'),{batchAsync:_0xdae00b}=await import(_0x3fbefe(0x162)),_0x3e4eef=new Set();for(const _0x57a561 of _0x210c0f){let _0x260a6e=_0x4d07dc?.['get'](_0x57a561);!_0x260a6e&&(_0x260a6e=await _0x52e753[_0x3fbefe(0x130)][_0x3fbefe(0x190)](_0x57a561));const _0x1691a8=_0x1f0f74(_0x260a6e);for(const _0xc6ab13 of _0x1691a8){_0x3e4eef[_0x3fbefe(0x1f4)](_0xc6ab13);}}let _0x45b591=Array[_0x3fbefe(0x1c2)](_0x3e4eef);while(_0x45b591[_0x3fbefe(0x163)]>0x0){const _0x2e227b=_0x45b591[_0x3fbefe(0x19c)](_0x5eb641=>!_0x2a8c0f[_0x3fbefe(0x1b3)](_0x5eb641));if(_0x2e227b['length']===0x0)break;const _0x2a2b42=await _0xdae00b(_0x2e227b,async _0x3a0484=>{const _0x4886e2=_0x3fbefe;_0x2a8c0f[_0x4886e2(0x1f4)](_0x3a0484);const _0x3e3850=await fetchSegment(_0x52e753,_0x44f456,_0x3a0484,_0x13a2c9);if(!_0x3e3850)return null;return{'segmentId':_0x3a0484,'segment':_0x3e3850};},0xa),_0x323a25=new Set();for(const _0x8c1c5f of _0x2a2b42){if(!_0x8c1c5f?.[_0x3fbefe(0x1c9)]?.[_0x3fbefe(0x1a0)])continue;const _0x1adf6e=apiRuleToYaml(_0x8c1c5f[_0x3fbefe(0x1c9)][_0x3fbefe(0x1a0)]);_0x503a8f['set'](_0x8c1c5f[_0x3fbefe(0x207)],_0x1adf6e);const _0x13aefb=collectSegmentRefsFromRule(_0x1adf6e);for(const _0x5f29ee of _0x13aefb){!_0x2a8c0f['has'](_0x5f29ee)&&_0x323a25[_0x3fbefe(0x1f4)](_0x5f29ee);}}_0x45b591=Array['from'](_0x323a25);}};return{'createYamlContext':_0xcf52e6,'prefetchJourneySegments':_0x79b02};}export async function executePushSegments(_0x102277,_0x3b5718,_0x50abbd,_0x527134,_0x58999a){const _0x210b15=a142_0x469651,{segmentDefToCreateRequest:_0x462cb7,segmentDefToUpdateRequest:_0xb84c38}=await import(_0x210b15(0x119)),_0x43f3cf=_0x50abbd[_0x210b15(0x168)],_0x24c29c=0x5,_0x5708eb=async _0x59feb2=>{const _0x3a30b0=_0x210b15,_0x33e088=_0x59feb2['folderPath']?_0x43f3cf[_0x3a30b0(0x15d)](_0x59feb2[_0x3a30b0(0x183)]):undefined;let _0x5b0f72;const _0x39b8f6={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x19415e=_0x59feb2[_0x3a30b0(0x1b1)];if(_0x59feb2[_0x3a30b0(0x1b1)][_0x3a30b0(0x1a0)]){const _0x10c21f=createSegmentIdResolver(_0x50abbd['segmentNameToId'],_0x59feb2['yamlConfig'][_0x3a30b0(0x169)]),_0x24a674=await resolveRuleSegmentIds(_0x59feb2['yamlConfig']['rule'],_0x10c21f);_0x19415e={..._0x59feb2[_0x3a30b0(0x1b1)],'rule':_0x24a674};}try{if(_0x59feb2[_0x3a30b0(0x213)]){_0x58999a[_0x3a30b0(0x189)]?.({'type':_0x3a30b0(0x1ba),'name':_0x59feb2[_0x3a30b0(0x1b1)][_0x3a30b0(0x169)]});const _0x418813=_0x462cb7(_0x19415e,_0x33e088),_0x347d16=await _0x58999a[_0x3a30b0(0x1da)](_0x3a30b0(0x115)+_0x59feb2[_0x3a30b0(0x1b1)][_0x3a30b0(0x169)]+_0x3a30b0(0x15e),()=>_0x102277['segment'][_0x3a30b0(0x1d3)](_0x527134['parentId'],_0x418813));_0x5b0f72=_0x347d16[_0x3a30b0(0x143)]['id'],_0x50abbd[_0x3a30b0(0x176)][_0x3a30b0(0x17c)](_0x59feb2[_0x3a30b0(0x1b1)][_0x3a30b0(0x169)],_0x5b0f72),_0x39b8f6[_0x3a30b0(0x172)]={'name':_0x59feb2[_0x3a30b0(0x1b1)][_0x3a30b0(0x169)],'id':_0x5b0f72},_0x58999a[_0x3a30b0(0x189)]?.({'type':_0x3a30b0(0x11c),'name':_0x59feb2[_0x3a30b0(0x1b1)][_0x3a30b0(0x169)],'segmentId':_0x5b0f72}),_0x58999a['logSuccess']?.(_0x3a30b0(0x197)+_0x59feb2[_0x3a30b0(0x1b1)][_0x3a30b0(0x169)]+'\x27'),_0x39b8f6[_0x3a30b0(0x147)]=0x1;}else{if(_0x59feb2[_0x3a30b0(0x1c6)]){_0x58999a[_0x3a30b0(0x189)]?.({'type':_0x3a30b0(0x1ec),'name':_0x59feb2['yamlConfig'][_0x3a30b0(0x169)]});const _0x17de15=_0xb84c38(_0x19415e);_0x33e088!==_0x59feb2[_0x3a30b0(0x16e)]?.[_0x3a30b0(0x1eb)]&&(_0x17de15['segmentFolderId']=_0x33e088?parseInt(_0x33e088,0xa):undefined),await _0x58999a[_0x3a30b0(0x1da)](_0x3a30b0(0x1bf)+_0x59feb2['yamlConfig'][_0x3a30b0(0x169)]+'\x27...',()=>_0x102277[_0x3a30b0(0x1c9)]['updateSegmentById'](_0x527134[_0x3a30b0(0x1e9)],_0x59feb2[_0x3a30b0(0x16e)]['id'],_0x17de15)),_0x5b0f72=_0x59feb2['existingSegment']['id'],_0x58999a[_0x3a30b0(0x189)]?.({'type':_0x3a30b0(0x14b),'name':_0x59feb2[_0x3a30b0(0x1b1)][_0x3a30b0(0x169)]}),_0x58999a['logSuccess']?.(_0x3a30b0(0x125)+_0x59feb2[_0x3a30b0(0x1b1)][_0x3a30b0(0x169)]+'\x27'),_0x39b8f6[_0x3a30b0(0x1ea)]=0x1;}else _0x5b0f72=_0x59feb2[_0x3a30b0(0x16e)]['id'];}}catch(_0xbf39bb){const _0x5c8039=isHttp400Error(_0xbf39bb),_0x5c7bb=_0x5c8039?ErrorCode[_0x3a30b0(0x211)]:ErrorCode['SEGMENT_UPDATE_ERROR'],_0x117fdd=getErrorMessage(_0xbf39bb);throw new SDKError(_0x5c7bb,_0x3a30b0(0x139)+(_0x59feb2['isNew']?'create':_0x3a30b0(0x1c7))+_0x3a30b0(0x1fa)+_0x59feb2[_0x3a30b0(0x135)]+_0x3a30b0(0x216)+_0x117fdd,_0xbf39bb);}try{const _0x35a56e=await syncActivationsForSegment(_0x102277,_0x527134[_0x3a30b0(0x1e9)],_0x5b0f72,_0x59feb2['yamlConfig'][_0x3a30b0(0x169)],_0x59feb2[_0x3a30b0(0x1f9)],_0x58999a,_0x59feb2[_0x3a30b0(0x135)]);_0x39b8f6[_0x3a30b0(0x116)]=_0x35a56e;}catch(_0x312482){if(_0x312482 instanceof SDKError)throw _0x312482;throw new SDKError(ErrorCode['ACTIVATION_UPDATE_ERROR'],'Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27'+_0x59feb2[_0x3a30b0(0x1b1)][_0x3a30b0(0x169)]+_0x3a30b0(0x158)+_0x59feb2[_0x3a30b0(0x135)]+_0x3a30b0(0x216)+getErrorMessage(_0x312482),_0x312482);}return _0x39b8f6;},_0x141130=await batchAsync(_0x3b5718,_0x5708eb,_0x24c29c),_0x215be9={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x24b0d5 of _0x141130){_0x215be9[_0x210b15(0x147)]+=_0x24b0d5[_0x210b15(0x147)],_0x215be9[_0x210b15(0x1ea)]+=_0x24b0d5[_0x210b15(0x1ea)],_0x24b0d5['createdSegmentId']&&_0x215be9[_0x210b15(0x150)][_0x210b15(0x17c)](_0x24b0d5['createdSegmentId'][_0x210b15(0x169)],_0x24b0d5[_0x210b15(0x172)]['id']),_0x215be9[_0x210b15(0x116)][_0x210b15(0x147)]+=_0x24b0d5['activations'][_0x210b15(0x147)],_0x215be9[_0x210b15(0x116)][_0x210b15(0x1ea)]+=_0x24b0d5[_0x210b15(0x116)][_0x210b15(0x1ea)],_0x215be9[_0x210b15(0x116)][_0x210b15(0x13e)]+=_0x24b0d5[_0x210b15(0x116)]['deleted'];}return _0x215be9;}async function syncActivationsForSegment(_0x41cd76,_0xd63a9f,_0x139df7,_0x2e08a5,_0x343277,_0x31b436,_0x2d600b){const _0x5a3acd=a142_0x469651,_0x56f907={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x403f46 of _0x343277){try{if(_0x403f46[_0x5a3acd(0x17d)]===_0x5a3acd(0x1be)&&_0x403f46[_0x5a3acd(0x128)])_0x31b436['onProgress']?.({'type':_0x5a3acd(0x170),'segmentName':_0x2e08a5,'activationName':_0x403f46[_0x5a3acd(0x169)]}),await _0x31b436[_0x5a3acd(0x1da)](_0x5a3acd(0x1e0)+_0x403f46[_0x5a3acd(0x169)]+_0x5a3acd(0x15e),()=>_0x41cd76[_0x5a3acd(0x1c9)][_0x5a3acd(0x198)](_0xd63a9f,_0x139df7,_0x403f46[_0x5a3acd(0x128)])),_0x31b436[_0x5a3acd(0x189)]?.({'type':_0x5a3acd(0x151),'segmentName':_0x2e08a5,'activationName':_0x403f46['name']}),_0x31b436[_0x5a3acd(0x13f)]?.(_0x5a3acd(0x1f6)+_0x403f46[_0x5a3acd(0x169)]+'\x27'),_0x56f907['created']++;else{if(_0x403f46[_0x5a3acd(0x17d)]===_0x5a3acd(0x1c7)&&_0x403f46[_0x5a3acd(0x128)]&&_0x403f46['existingActivation'])_0x31b436[_0x5a3acd(0x189)]?.({'type':_0x5a3acd(0x141),'segmentName':_0x2e08a5,'activationName':_0x403f46[_0x5a3acd(0x169)]}),await _0x31b436[_0x5a3acd(0x1da)](_0x5a3acd(0x126)+_0x403f46[_0x5a3acd(0x169)]+_0x5a3acd(0x15e),()=>_0x41cd76[_0x5a3acd(0x1c9)]['updateActivation'](_0xd63a9f,_0x139df7,_0x403f46[_0x5a3acd(0x19a)]['id'],_0x403f46[_0x5a3acd(0x128)])),_0x31b436[_0x5a3acd(0x189)]?.({'type':_0x5a3acd(0x16b),'segmentName':_0x2e08a5,'activationName':_0x403f46[_0x5a3acd(0x169)]}),_0x31b436['logSuccess']?.(_0x5a3acd(0x194)+_0x403f46['name']+'\x27'),_0x56f907['updated']++;else _0x403f46[_0x5a3acd(0x17d)]===_0x5a3acd(0x1dd)&&_0x403f46[_0x5a3acd(0x19a)]&&(_0x31b436[_0x5a3acd(0x189)]?.({'type':_0x5a3acd(0x20d),'segmentName':_0x2e08a5,'activationName':_0x403f46[_0x5a3acd(0x169)]}),await _0x31b436[_0x5a3acd(0x1da)](_0x5a3acd(0x1a7)+_0x403f46['name']+_0x5a3acd(0x15e),()=>_0x41cd76['segment'][_0x5a3acd(0x20b)](_0xd63a9f,_0x139df7,_0x403f46[_0x5a3acd(0x19a)]['id'])),_0x31b436[_0x5a3acd(0x189)]?.({'type':_0x5a3acd(0x131),'segmentName':_0x2e08a5,'activationName':_0x403f46[_0x5a3acd(0x169)]}),_0x31b436['logDeleted']?.(_0x5a3acd(0x1d4)+_0x403f46['name']+'\x27'),_0x56f907[_0x5a3acd(0x13e)]++);}}catch(_0xec65ef){const _0x59ebe0=isHttp400Error(_0xec65ef),_0x2dc913=_0x59ebe0?ErrorCode[_0x5a3acd(0x1f3)]:ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x26dc05=getErrorMessage(_0xec65ef);throw new SDKError(_0x2dc913,'Failed\x20to\x20'+_0x403f46[_0x5a3acd(0x17d)]+'\x20activation\x20\x27'+_0x403f46[_0x5a3acd(0x169)]+'\x27\x20from\x20file:\x20'+_0x2d600b+'\x0a\x20\x20'+_0x26dc05,_0xec65ef);}}return _0x56f907;}export async function executePushFolders(_0x78b3ac,_0x5e3c42,_0x2f1e2d,_0x28998e,_0x4874ba){const _0x31fcdb=a142_0x469651,_0x29b49e=new Map(_0x2f1e2d),_0x1bb309=sortFoldersByDepth(_0x5e3c42);for(const _0x2b1c90 of _0x1bb309){const _0x3f15d4=_0x2b1c90[_0x31fcdb(0x214)]('/'),_0x803694=_0x3f15d4[_0x3f15d4['length']-0x1],_0x317a9f=_0x3f15d4[_0x31fcdb(0x19b)](0x0,-0x1)[_0x31fcdb(0x1c0)]('/'),_0x50eda4=_0x29b49e[_0x31fcdb(0x15d)](_0x317a9f);_0x4874ba[_0x31fcdb(0x189)]?.({'type':_0x31fcdb(0x1ef),'folder':_0x2b1c90});const _0x1e1675={'name':_0x803694,'parentFolderId':_0x50eda4},_0x549fb1=await _0x4874ba['withProgress'](_0x31fcdb(0x186)+_0x2b1c90+_0x31fcdb(0x15e),()=>_0x78b3ac[_0x31fcdb(0x1c9)]['createFolder'](_0x28998e[_0x31fcdb(0x1e9)],_0x1e1675));_0x29b49e[_0x31fcdb(0x17c)](_0x2b1c90,_0x549fb1[_0x31fcdb(0x143)]['id']),_0x4874ba[_0x31fcdb(0x189)]?.({'type':_0x31fcdb(0x1ff),'folder':_0x2b1c90,'folderId':_0x549fb1[_0x31fcdb(0x143)]['id']}),_0x4874ba[_0x31fcdb(0x1e3)]?.(_0x31fcdb(0x1fc)+_0x2b1c90+'\x27');}return _0x29b49e;}export async function executePushSegmentDeletions(_0x22170f,_0x15ee79,_0x19ec0b){const _0x2d1ddb=a142_0x469651;if(_0x15ee79[_0x2d1ddb(0x163)]===0x0)return 0x0;const {batchAsync:_0x341c17}=await import('../../utils/async.js'),_0x4b3198=0x5,_0x40dbac=await _0x341c17(_0x15ee79,async _0x13176b=>{const _0x319caf=_0x2d1ddb;return _0x19ec0b[_0x319caf(0x189)]?.({'type':'segment_deleting','name':_0x13176b[_0x319caf(0x169)]}),await _0x22170f[_0x319caf(0x1c9)][_0x319caf(0x1cb)](_0x13176b['id']),_0x19ec0b[_0x319caf(0x189)]?.({'type':_0x319caf(0x1c8),'name':_0x13176b[_0x319caf(0x169)]}),_0x19ec0b[_0x319caf(0x1d7)]?.(_0x319caf(0x19d)+_0x13176b['name']+'\x27'),0x1;},_0x4b3198);return _0x40dbac['reduce']((_0xf9c909,_0xa28a33)=>_0xf9c909+_0xa28a33,0x0);}export async function executePushJourneys(_0x465a1f,_0x3819f2,_0x57f1c5,_0x559fed,_0x22d484){const _0x117db9=a142_0x469651,{journeyDefToRequest:_0x441766}=await import(_0x117db9(0x1a2)),{activationDefToCreateRequest:_0x5c83b0,yamlRuleToApi:_0x2b70c6,validateSegmentRule:_0x476e99}=await import(_0x117db9(0x119)),_0x908a3d={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x2578c0=new Map(_0x57f1c5[_0x117db9(0x176)]),_0x36af2b=0x5;for(let _0x2bc760=0x0;_0x2bc760<_0x3819f2[_0x117db9(0x163)];_0x2bc760+=_0x36af2b){const _0x2310a0=_0x3819f2[_0x117db9(0x19b)](_0x2bc760,_0x2bc760+_0x36af2b),_0x1bb139=await Promise[_0x117db9(0x14f)](_0x2310a0['map'](async _0x940c30=>{const _0x1fc042=_0x117db9;if(!_0x940c30[_0x1fc042(0x213)]&&!_0x940c30[_0x1fc042(0x1c6)])return{'action':_0x1fc042(0x117),'name':_0x940c30[_0x1fc042(0x1b1)]['name'],'journeyId':_0x940c30[_0x1fc042(0x1ce)]?.['id']};const _0x17669e=_0x940c30[_0x1fc042(0x183)]?_0x57f1c5[_0x1fc042(0x168)]['get'](_0x940c30['folderPath']):undefined;_0x22d484[_0x1fc042(0x189)]?.({'type':_0x940c30[_0x1fc042(0x213)]?_0x1fc042(0x1b2):_0x1fc042(0x1a6),'name':_0x940c30[_0x1fc042(0x1b1)][_0x1fc042(0x169)]});try{const _0x55884e=await executeSingleJourneyPush(_0x465a1f,_0x940c30,{..._0x57f1c5,'segmentNameToId':_0x2578c0},{'parentId':_0x559fed[_0x1fc042(0x1e9)],'rootFolderId':_0x559fed[_0x1fc042(0x19e)],'folderId':_0x17669e,'verbose':_0x559fed[_0x1fc042(0x1e8)]},_0x22d484,{'journeyDefToRequest':_0x441766,'activationDefToCreateRequest':_0x5c83b0,'yamlRuleToApi':_0x2b70c6,'validateSegmentRule':_0x476e99});for(const [_0x58d672,_0x4af458]of _0x55884e[_0x1fc042(0x209)]){_0x2578c0['set'](_0x58d672,_0x4af458),_0x908a3d[_0x1fc042(0x209)]['set'](_0x58d672,_0x4af458);}if(_0x55884e[_0x1fc042(0x1d6)]===_0x1fc042(0x147))_0x22d484[_0x1fc042(0x189)]?.({'type':_0x1fc042(0x20e),'name':_0x940c30[_0x1fc042(0x1b1)]['name'],'journeyId':_0x55884e[_0x1fc042(0x175)]}),_0x22d484['logSuccess']?.(_0x1fc042(0x1bd)+_0x940c30['yamlConfig'][_0x1fc042(0x169)]+'\x27'),_0x908a3d[_0x1fc042(0x147)]++;else _0x55884e[_0x1fc042(0x1d6)]===_0x1fc042(0x1ea)&&(_0x22d484[_0x1fc042(0x189)]?.({'type':_0x1fc042(0x18c),'name':_0x940c30[_0x1fc042(0x1b1)][_0x1fc042(0x169)]}),_0x22d484[_0x1fc042(0x13f)]?.('Updated\x20journey\x20\x27'+_0x940c30['yamlConfig'][_0x1fc042(0x169)]+'\x27'),_0x908a3d[_0x1fc042(0x1ea)]++);return{'action':_0x55884e[_0x1fc042(0x1d6)],'name':_0x940c30[_0x1fc042(0x1b1)][_0x1fc042(0x169)],'journeyId':_0x55884e[_0x1fc042(0x175)]};}catch(_0x58f887){const _0x1d697d=isHttp400Error(_0x58f887),_0x1dd67d=_0x1d697d?ErrorCode[_0x1fc042(0x15b)]:ErrorCode[_0x1fc042(0x1fb)],_0x365785=getErrorMessage(_0x58f887);throw new SDKError(_0x1dd67d,_0x1fc042(0x139)+(_0x940c30[_0x1fc042(0x213)]?_0x1fc042(0x1be):'update')+_0x1fc042(0x16f)+_0x940c30[_0x1fc042(0x135)]+_0x1fc042(0x216)+_0x365785,_0x58f887);}}));_0x908a3d[_0x117db9(0x205)]['push'](..._0x1bb139);}return _0x908a3d;}function a142_0x5e0e(){const _0x25158c=['push','list','Segment\x20not\x20found:\x20','valid','createSegment','Deleted\x20activation\x20\x27','toLowerCase','action','logDeleted','utf-8','yamlActivation','withProgress','Activation','description','delete','uniqueServerName','651783QIlbTg','Creating\x20activation\x20\x27','message','localName','logInfo','entry_criteria','journeys','.$1.push-recovery.json','flatMap','verbose','parentId','updated','segmentFolderId','segment_updating','connectionIdToNameMap','schedule','folder_creating','journeyBundleId','relationships','DecisionPoint','ACTIVATION_SYNTAX_ERROR','add','fetchJourney','Created\x20activation\x20\x27','state','match','activationActions','\x20segment\x20from\x20file:\x20','JOURNEY_UPDATE_ERROR','Created\x20folder\x20\x27','activationsBySegmentId','1341150QahPEo','folder_created','run_after_journey_refresh','Failed\x20to\x20fetch\x20referenced\x20segment\x20','36sMAWPn','columns','Matched\x20server\x20segment\x20\x27','results','journeyStages','segmentId','segments','embeddedSegmentNameToId',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','deleteActivation','Segment\x20not\x20found','activation_deleting','journey_created','values','stages','SEGMENT_SYNTAX_ERROR','SEGMENT_NOT_FOUND','isNew','split','Delete\x20the\x20push\x20recovery\x20file\x20(','\x0a\x20\x20','NOT_FOUND','Activation\x20not\x20found:\x20','sort','1173260LSxdtC','Creating\x20segment\x20\x27','activations','unchanged','resolveSegment','./child-segment-yaml.js','3058xuRnuk','stringify','segment_created','folderId','getSegmentEntity','keys','connection','user','item','index','__pending_','Updated\x20segment\x20\x27','Updating\x20activation\x20\x27','existingSegments','validatedRequest','104lCWlXq','__pending_act_','conditionTimeoutDuration','replace','diff','idToEmailMap','26880luKBBE','journey','activation_deleted','parse','\x27\x20decision\x20point\x20branch\x20\x27','all_columns','absolutePath','idToName','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','and\x20the\x20server\x20segment,\x20then\x20retry.','Failed\x20to\x20','INTERNAL','entryCriteria','find','sha1','deleted','logSuccess','debug','activation_updating','updateSegmentById','data','activationParams','journey_entry_criteria_','tdx.sdk.push-workflow','created','getLatestJourneyId','stage\x20\x27','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','segment_updated','\x27\x20milestone','\x27\x20not\x20found\x20in\x20journey\x20\x27','Entry\x20criteria:\x20','all','createdSegmentIds','activation_created','skipSegments','activation_template_id','goal','branches','hex','\x27\x20exit\x20criteria','\x27\x20from\x20file:\x20','createJourneySegment','size','JOURNEY_SYNTAX_ERROR','entry','get','\x27...','getActivation','activationStepsById','notification','../../utils/async.js','length','Condition','nameToType','versionNumber','deps','folderPathToId','name','waitStepType','activation_updated','uniqueSegmentName','connector_config','existingSegment','\x20journey\x20from\x20file:\x20','activation_creating','includes','createdSegmentId','145192eliHSl','milestone','journeyId','segmentNameToId','\x27\x20wait\x20condition','waitStep','nameToId','embedded_segment_created','\x27\x20to\x20local\x20\x27','set','type','journeyBundleName','\x20(referenced\x20in\x20journey\x20','day','\x27\x20for\x20','Embedded\x20segment\x20\x27','folderPath','goal\x20criteria','max','Creating\x20folder\x20\x27','progress','entries','onProgress','embedded_segment_creating','with','journey_updated','Failed\x20to\x20resolve\x20activation\x20','journeyById','isArray','getJourney','Stage\x20\x27','behavior','activationContext','Updated\x20activation\x20\x27','listActivations','journeyActivationStepId','Created\x20segment\x20\x27','createActivation','10iCkJqs','existingActivation','slice','filter','Deleted\x20segment\x20\x27','rootFolderId','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','rule','decision_point','./journey-yaml.js','Fetching\x20','394891pjvbxw','parentSegmentFolder','journey_updating','Deleting\x20activation\x20\x27','digest','map','conditionSegmentId','attributes','conditionTimeoutUnit','conditions','parentFolder','waitStepUnit','relative','yamlConfig','journey_creating','has','startsWith','null','Name\x20has\x20already\x20been\x20taken','160335owsVRQ','WaitStep','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','segment_creating','steps','journeyName','Created\x20journey\x20\x27','create','Updating\x20segment\x20\x27','join','activation_','from','exitCriterias','parseDocument','some','hasChanges','update','segment_deleted','segment','resolvedRule','deleteSegment','toISOString','Journey\x20\x27','existingJourney'];a142_0x5e0e=function(){return _0x25158c;};return a142_0x5e0e();}async function matchExistingJourneySegments(_0xacf75e,_0x5d2b72,_0x3d6e70,_0x1ad67f,_0x551aa4){const _0x20dd8f=a142_0x469651;if(!_0x5d2b72[_0x20dd8f(0x1ce)]||!_0x5d2b72[_0x20dd8f(0x1b1)][_0x20dd8f(0x208)])return;const _0x3e2036=new Map(),_0x4c512f=new Set();for(const _0x2b4555 of Object[_0x20dd8f(0x11f)](_0x5d2b72['yamlConfig']['segments'])){const _0x5659a5=generateDeterministicJourneySegmentName(_0x5d2b72[_0x20dd8f(0x1b1)][_0x20dd8f(0x169)],_0x2b4555);_0x3e2036[_0x20dd8f(0x17c)](_0x5659a5,_0x2b4555),_0x4c512f[_0x20dd8f(0x1f4)](_0x2b4555);}const _0x96a302=[],_0xd2ef4d=collectSegmentIdsFromJourneyApi(_0x5d2b72[_0x20dd8f(0x1ce)]);for(const _0x28d909 of _0xd2ef4d){const _0x503c95=await fetchSegment(_0xacf75e,_0x3d6e70,_0x28d909,_0x1ad67f);if(!_0x503c95?.['name'])continue;const _0x4cccc7=_0x3e2036[_0x20dd8f(0x15d)](_0x503c95[_0x20dd8f(0x169)]);_0x4cccc7?(_0x551aa4[_0x20dd8f(0x17c)](_0x4cccc7,_0x28d909),_0x4c512f[_0x20dd8f(0x1dd)](_0x4cccc7)):_0x96a302['push']({'id':_0x28d909,'seg':_0x503c95});}if(_0x4c512f[_0x20dd8f(0x15a)]>0x0&&_0x96a302['length']>0x0){const {localExpandedRuleToNames:_0x40339d}=buildLocalExpandedRuleMappings(_0x5d2b72['yamlConfig']),_0x3cc84d=new Map();for(const {id:_0x986fa7,seg:_0x420576}of _0x96a302){if(_0x420576[_0x20dd8f(0x1a0)]){const _0x55c860=apiRuleToYaml(_0x420576[_0x20dd8f(0x1a0)]);_0x3cc84d['set'](_0x986fa7,_0x55c860);}}for(const {id:_0x2ca11b,seg:_0xbded35}of _0x96a302){if(!_0xbded35[_0x20dd8f(0x1a0)])continue;const _0x297c62=_0x3cc84d['get'](_0x2ca11b);if(!_0x297c62)continue;const _0x402a2a=serializeExpandedRule(_0x297c62,_0x3cc84d),_0x2aad22=_0x40339d[_0x20dd8f(0x15d)](_0x402a2a);if(_0x2aad22){const _0x54f287=_0x2aad22[_0x20dd8f(0x13c)](_0x338ea2=>_0x4c512f['has'](_0x338ea2));_0x54f287&&(_0x551aa4['set'](_0x54f287,_0x2ca11b),_0x4c512f[_0x20dd8f(0x1dd)](_0x54f287),logger[_0x20dd8f(0x140)](_0x20dd8f(0x204)+_0xbded35['name']+_0x20dd8f(0x17b)+_0x54f287+'\x27\x20by\x20rule\x20content'));}}}}async function executeSingleJourneyPush(_0x5208b1,_0xc79c30,_0x56c4a5,_0x31089b,_0xadf956,_0x89e34){const _0x5c31f1=a142_0x469651,{journeyDefToRequest:_0x80555,activationDefToCreateRequest:_0x2d280b,yamlRuleToApi:_0x3f5555,validateSegmentRule:_0x25cc2a}=_0x89e34,_0x3c572f=new Map(),_0x134d4f=new Map();recoverSegmentIdsFromPushRecovery(_0xc79c30,_0x3c572f,_0x56c4a5[_0x5c31f1(0x176)]);const _0x30a32b=new Map(),_0x588975=new Map(),_0x3d79d1=new Map();let _0x48fadc;const _0x20e9cc=async()=>{const _0x51a6b4=_0x5c31f1;if(_0x48fadc)return;_0x48fadc=new Map();if(!_0xc79c30['existingJourney'])return;const _0x3951b0=await _0x5208b1[_0x51a6b4(0x130)][_0x51a6b4(0x195)](_0xc79c30[_0x51a6b4(0x1ce)]['id']);for(const _0x93e678 of _0x3951b0){const _0x1754ff=journeyActivationStepToYaml(_0x93e678,_0x56c4a5[_0x51a6b4(0x12e)],_0x56c4a5[_0x51a6b4(0x1ed)]),_0x92e7d4=activationSignature(_0x1754ff);!_0x48fadc[_0x51a6b4(0x1b3)](_0x92e7d4)&&_0x48fadc[_0x51a6b4(0x17c)](_0x92e7d4,_0x93e678['id']),_0x1754ff['name']&&_0x134d4f[_0x51a6b4(0x17c)](_0x1754ff['name'],_0x93e678['id']);}};await matchExistingJourneySegments(_0x5208b1,_0xc79c30,_0x31089b[_0x5c31f1(0x1e9)],_0x56c4a5[_0x5c31f1(0x127)],_0x56c4a5[_0x5c31f1(0x176)]);const _0x5ef7b5={'resolveSegmentId':async _0x49f5bb=>{const _0x10be93=_0x5c31f1,_0x46f6fe=_0x56c4a5[_0x10be93(0x176)][_0x10be93(0x15d)](_0x49f5bb);if(!_0x46f6fe)throw new SDKError(ErrorCode[_0x10be93(0x212)],_0x10be93(0x1d1)+_0x49f5bb+_0x10be93(0x17f)+_0xc79c30[_0x10be93(0x1b1)][_0x10be93(0x169)]+')');return _0x46f6fe;},'resolveEmbeddedSegmentId':async(_0x2e684d,_0x4d343c)=>{const _0x2eaaf1=_0x5c31f1,_0x151146=_0x56c4a5[_0x2eaaf1(0x176)][_0x2eaaf1(0x15d)](_0x2e684d);if(_0x151146)return _0x151146;const _0x5b5ef3=_0x56c4a5[_0x2eaaf1(0x127)]['find'](_0x244848=>_0x244848[_0x2eaaf1(0x169)]===_0x2e684d);if(_0x5b5ef3)return _0x56c4a5[_0x2eaaf1(0x176)][_0x2eaaf1(0x17c)](_0x2e684d,_0x5b5ef3['id']),_0x5b5ef3['id'];if(_0xc79c30['isNew']){const {stageName:_0x41f0c5,criteriaName:_0x1748d1}=findSegmentCriteriaLocation(_0xc79c30[_0x2eaaf1(0x1b1)],_0x2e684d);return _0x25cc2a(_0x2e684d,_0x4d343c[_0x2eaaf1(0x1a0)]),_0x588975[_0x2eaaf1(0x17c)](_0x2e684d,{'definition':_0x4d343c,'stageName':_0x41f0c5,'criteriaName':_0x1748d1}),createPendingSegmentId(_0x2e684d);}const _0x3c86b2=_0xc79c30[_0x2eaaf1(0x1ce)]?.['id'];if(!_0x3c86b2)throw new SDKError(ErrorCode[_0x2eaaf1(0x13a)],'Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID');const _0x300292=_0x30a32b[_0x2eaaf1(0x15d)](_0x2e684d);if(_0x300292)return _0x300292;const _0x1a3d4a=((async()=>{const _0x4ad744=_0x2eaaf1;_0x25cc2a(_0x2e684d,_0x4d343c['rule']);const _0x4b4c99=generateDeterministicJourneySegmentName(_0xc79c30[_0x4ad744(0x1b1)][_0x4ad744(0x169)],_0x2e684d),_0xcbca0a=_0x56c4a5[_0x4ad744(0x127)][_0x4ad744(0x13c)](_0x249f59=>_0x249f59[_0x4ad744(0x169)]===_0x4b4c99),_0x24c567=createSegmentIdResolver(_0x56c4a5['segmentNameToId'],_0x2e684d),_0xe3d121=await resolveRuleSegmentIds(_0x4d343c[_0x4ad744(0x1a0)],_0x24c567);let _0x320e40;return _0xcbca0a?(await _0x5208b1['segment'][_0x4ad744(0x142)](_0x31089b[_0x4ad744(0x1e9)],_0xcbca0a['id'],{'description':_0x4d343c[_0x4ad744(0x1dc)]||'Entry\x20criteria:\x20'+_0x2e684d,'rule':_0x3f5555(_0xe3d121,!![]),'countPopulation':!![]}),_0x320e40=_0xcbca0a['id'],saveSegmentToPushRecovery(_0xc79c30['absolutePath'],_0xc79c30[_0x4ad744(0x1b1)][_0x4ad744(0x169)],_0x2e684d,{'segmentId':_0x320e40,'uniqueServerName':_0x4b4c99,'createdAt':new Date()['toISOString']()})):_0x320e40=await createOrRecoverEmbeddedSegment(_0x5208b1,_0xc79c30,{'localName':_0x2e684d,'uniqueSegmentName':_0x4b4c99,'description':_0x4d343c[_0x4ad744(0x1dc)]||_0x4ad744(0x14e)+_0x2e684d,'journeyId':_0x3c86b2,'resolvedRule':_0xe3d121,'parentId':_0x31089b[_0x4ad744(0x1e9)],'folderId':_0x31089b[_0x4ad744(0x19e)]||''},_0x3f5555),_0x56c4a5['segmentNameToId'][_0x4ad744(0x17c)](_0x2e684d,_0x320e40),_0x3c572f[_0x4ad744(0x17c)](_0x2e684d,_0x320e40),_0x320e40;})());_0x30a32b[_0x2eaaf1(0x17c)](_0x2e684d,_0x1a3d4a);try{return await _0x1a3d4a;}finally{_0x30a32b['delete'](_0x2e684d);}},'resolveActivationId':async _0x556c26=>{const _0x440125=_0x5c31f1,_0xd04d3d=_0x134d4f[_0x440125(0x15d)](_0x556c26);if(_0xd04d3d)return _0xd04d3d;if(_0xc79c30[_0x440125(0x1ce)]){await _0x20e9cc();const _0x5c20a9=_0x134d4f[_0x440125(0x15d)](_0x556c26);if(_0x5c20a9)return _0x5c20a9;}throw new SDKError(ErrorCode[_0x440125(0x217)],_0x440125(0x112)+_0x556c26+_0x440125(0x17f)+_0xc79c30['yamlConfig'][_0x440125(0x169)]+').\x20'+'Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.');},'resolveEmbeddedActivationId':async(_0x3f008,_0x3ba41d)=>{const _0x7fc5be=_0x5c31f1,_0x302501=_0x134d4f[_0x7fc5be(0x15d)](_0x3f008);if(_0x302501)return _0x302501;if(_0xc79c30[_0x7fc5be(0x213)])return _0x3d79d1[_0x7fc5be(0x17c)](_0x3f008,_0x3ba41d),createPendingActivationId(_0x3f008);if(_0xc79c30[_0x7fc5be(0x1ce)]){await _0x20e9cc();const _0x4fa23e=_0x134d4f[_0x7fc5be(0x15d)](_0x3ba41d[_0x7fc5be(0x169)]);if(_0x4fa23e)return _0x134d4f[_0x7fc5be(0x17c)](_0x3f008,_0x4fa23e),_0x4fa23e;const _0x170f1d=activationSignature(_0x3ba41d),_0x39cfef=_0x48fadc?.['get'](_0x170f1d);if(_0x39cfef)return _0x134d4f['set'](_0x3f008,_0x39cfef),_0x39cfef;const _0x44e295=await _0x2d280b(_0x3ba41d,_0x56c4a5[_0x7fc5be(0x193)]),_0xbf2f4c={..._0x44e295,..._0x3ba41d[_0x7fc5be(0x200)]!==undefined&&{'runAfterJourneyRefresh':_0x3ba41d[_0x7fc5be(0x200)]}},_0x1efc2a=await _0x5208b1[_0x7fc5be(0x130)][_0x7fc5be(0x198)](_0xc79c30[_0x7fc5be(0x1ce)]['id'],_0xbf2f4c);return _0x134d4f[_0x7fc5be(0x17c)](_0x3f008,_0x1efc2a['id']),_0x1efc2a['id'];}throw new SDKError(ErrorCode[_0x7fc5be(0x13a)],_0x7fc5be(0x137));},'resolveJourneyId':async _0x17928f=>{const _0x8f1720=_0x5c31f1;try{return await _0x5208b1[_0x8f1720(0x130)]['resolveJourneyId'](_0x31089b[_0x8f1720(0x1e9)],_0x17928f);}catch(_0xd1bea){throw new SDKError(ErrorCode[_0x8f1720(0x217)],_0x8f1720(0x1cd)+_0x17928f+_0x8f1720(0x1b9)+_0xc79c30[_0x8f1720(0x1b1)][_0x8f1720(0x169)]+'\x27)',_0xd1bea);}},'resolveStageId':async(_0x61ca62,_0x18509a)=>{const _0x1cef65=_0x5c31f1,_0x5df8b1=await _0x5208b1[_0x1cef65(0x130)]['getJourney'](_0x61ca62),_0x38996f=_0x5df8b1['attributes']['journeyStages'][_0x1cef65(0x13c)](_0x473b11=>_0x473b11['name'][_0x1cef65(0x1d5)]()===_0x18509a[_0x1cef65(0x1d5)]());if(!_0x38996f?.['id'])throw new SDKError(ErrorCode[_0x1cef65(0x217)],_0x1cef65(0x191)+_0x18509a+_0x1cef65(0x14d)+(_0x5df8b1[_0x1cef65(0x1ab)][_0x1cef65(0x17e)]||_0x5df8b1[_0x1cef65(0x1ab)]['name'])+'\x27');return _0x38996f['id'];}},_0x1ef27e=await _0x80555(_0xc79c30[_0x5c31f1(0x1b1)],_0x31089b[_0x5c31f1(0x1e9)],_0x5ef7b5),_0xf53c10=_0x31089b[_0x5c31f1(0x11d)]||_0x31089b[_0x5c31f1(0x19e)];_0xf53c10&&(_0x1ef27e[_0x5c31f1(0x1f1)]={'parentFolder':{'data':{'id':_0xf53c10,'type':'folder'}}});if(_0xc79c30[_0x5c31f1(0x213)]){if(_0x588975[_0x5c31f1(0x15a)]>0x0||_0x3d79d1[_0x5c31f1(0x15a)]>0x0)return await executeThreeStepJourneyCreate(_0x5208b1,_0xc79c30,_0x1ef27e,{'pendingEmbeddedSegments':_0x588975,'pendingEmbeddedActivations':_0x3d79d1,'embeddedSegmentNameToId':_0x3c572f,'journeyActivationNameToId':_0x134d4f},{..._0x31089b,'effectiveFolderId':_0xf53c10},_0x56c4a5,_0xadf956,_0x89e34);else{ensureJourneyDefaults(_0x1ef27e[_0x5c31f1(0x1ab)]);const _0x4c571d=await _0x5208b1[_0x5c31f1(0x130)][_0x5c31f1(0x1be)](_0x1ef27e);return deletePushRecovery(_0xc79c30[_0x5c31f1(0x135)]),{'action':_0x5c31f1(0x147),'journeyId':_0x4c571d['id'],'embeddedSegmentNameToId':_0x3c572f};}}else{if(_0xc79c30[_0x5c31f1(0x1c6)]&&_0xc79c30[_0x5c31f1(0x1ce)]){_0x1ef27e['id']=_0xc79c30['existingJourney']['id'];const _0x128fe6=_0x1ef27e[_0x5c31f1(0x1ab)];_0xc79c30['existingJourney'][_0x5c31f1(0x1ab)]?.[_0x5c31f1(0x17e)]&&(_0x128fe6[_0x5c31f1(0x17e)]=_0xc79c30['existingJourney']['attributes'][_0x5c31f1(0x17e)]);const _0x3e4fac=_0xc79c30[_0x5c31f1(0x1ce)][_0x5c31f1(0x1ab)]?.[_0x5c31f1(0x206)];return _0x3e4fac&&_0x1ef27e[_0x5c31f1(0x1ab)][_0x5c31f1(0x206)]&&injectExistingStageIds(_0x1ef27e[_0x5c31f1(0x1ab)][_0x5c31f1(0x206)],_0x3e4fac),ensureJourneyDefaults(_0x128fe6),await _0x5208b1[_0x5c31f1(0x130)]['update'](_0xc79c30[_0x5c31f1(0x1ce)]['id'],_0x1ef27e),deletePushRecovery(_0xc79c30[_0x5c31f1(0x135)]),{'action':_0x5c31f1(0x1ea),'journeyId':_0xc79c30['existingJourney']['id'],'embeddedSegmentNameToId':_0x3c572f};}}return deletePushRecovery(_0xc79c30['absolutePath']),{'action':_0x5c31f1(0x117),'journeyId':_0xc79c30[_0x5c31f1(0x1ce)]?.['id'],'embeddedSegmentNameToId':_0x3c572f};}function findSegmentCriteriaLocation(_0x43f4e6,_0x134e2c){const _0x391154=a142_0x469651,_0x65b639=_0x43f4e6[_0x391154(0x210)]||_0x43f4e6[_0x391154(0x1e5)]?.[0x0]?.['stages']||[];let _0x474a9a=_0x391154(0x15c),_0x4551bb=_0x134e2c;const _0xd4dc28=_0x43f4e6[_0x391154(0x154)]||_0x43f4e6[_0x391154(0x1e5)]?.[0x0]?.[_0x391154(0x154)];if(_0xd4dc28?.[_0x391154(0x1c9)]===_0x134e2c)return{'stageName':_0x391154(0x154),'criteriaName':_0xd4dc28[_0x391154(0x169)]||_0x134e2c};_0x40ad69:for(const _0x3074f0 of _0x65b639){if(_0x3074f0[_0x391154(0x1e4)]?.[_0x391154(0x1c9)]===_0x134e2c){_0x474a9a=_0x3074f0['name'],_0x4551bb=_0x3074f0['entry_criteria'][_0x391154(0x169)]||_0x134e2c;break;}if(_0x3074f0['steps'])for(const _0x526134 of _0x3074f0[_0x391154(0x1bb)]){if(_0x526134['type']===_0x391154(0x1a1)&&_0x526134['with']?.[_0x391154(0x155)])for(const _0x3b2417 of _0x526134[_0x391154(0x18b)][_0x391154(0x155)]){if(_0x3b2417[_0x391154(0x1c9)]===_0x134e2c){_0x474a9a=_0x3074f0[_0x391154(0x169)],_0x4551bb=_0x3b2417['name']||_0x134e2c;break _0x40ad69;}}}}return{'stageName':_0x474a9a,'criteriaName':_0x4551bb};}async function executeThreeStepJourneyCreate(_0x3dc8e3,_0x1a7c1c,_0x570033,_0x5d5e55,_0x2fea0f,_0x531a4c,_0x34cf38,_0x4ccb75){const _0xd9d129=a142_0x469651,{activationDefToCreateRequest:_0x4de568,yamlRuleToApi:_0x5be04c}=_0x4ccb75,{pendingEmbeddedSegments:_0x4cd59b,pendingEmbeddedActivations:_0x477c39,embeddedSegmentNameToId:_0x4c4771}=_0x5d5e55,_0x42aefa=JSON['parse'](JSON[_0xd9d129(0x11b)](_0x570033));ensureJourneyDefaults(_0x42aefa[_0xd9d129(0x1ab)]),stripPendingIds(_0x42aefa);const _0x56c634=await _0x3dc8e3['journey'][_0xd9d129(0x1be)](_0x42aefa),_0x129956=_0x56c634['id'],_0x373a04=new Map();for(const _0x29e8ae of _0x56c634[_0xd9d129(0x1ab)]['journeyStages']){_0x373a04[_0xd9d129(0x17c)](_0x29e8ae[_0xd9d129(0x169)][_0xd9d129(0x1d5)](),_0x29e8ae['id']);}recoverSegmentIdsFromPushRecovery(_0x1a7c1c,_0x4c4771,_0x531a4c['segmentNameToId']);for(const [_0x37a118,{definition:_0x5de882}]of _0x4cd59b){if(_0x4c4771[_0xd9d129(0x1b3)](_0x37a118)){_0x34cf38['onProgress']?.({'type':_0xd9d129(0x17a),'journeyName':_0x1a7c1c[_0xd9d129(0x1b1)]['name'],'segmentName':_0x37a118});continue;}const _0x5395f4=generateDeterministicJourneySegmentName(_0x1a7c1c['yamlConfig'][_0xd9d129(0x169)],_0x37a118);_0x34cf38[_0xd9d129(0x189)]?.({'type':_0xd9d129(0x18a),'journeyName':_0x1a7c1c['yamlConfig']['name'],'segmentName':_0x37a118});const _0x337c50=createSegmentIdResolver(_0x531a4c[_0xd9d129(0x176)],_0x37a118),_0x2acf27=await resolveRuleSegmentIds(_0x5de882[_0xd9d129(0x1a0)],_0x337c50),_0x581d99=await createOrRecoverEmbeddedSegment(_0x3dc8e3,_0x1a7c1c,{'localName':_0x37a118,'uniqueSegmentName':_0x5395f4,'description':_0x5de882[_0xd9d129(0x1dc)]||'Entry\x20criteria:\x20'+_0x37a118,'journeyId':_0x129956,'resolvedRule':_0x2acf27,'parentId':_0x2fea0f[_0xd9d129(0x1e9)],'folderId':_0x2fea0f['effectiveFolderId']||''},_0x5be04c);_0x4c4771[_0xd9d129(0x17c)](_0x37a118,_0x581d99),_0x531a4c[_0xd9d129(0x176)]['set'](_0x37a118,_0x581d99),_0x34cf38[_0xd9d129(0x189)]?.({'type':_0xd9d129(0x17a),'journeyName':_0x1a7c1c[_0xd9d129(0x1b1)][_0xd9d129(0x169)],'segmentName':_0x37a118});}const _0x216d96=new Map();for(const [_0x5c6194,_0x307c72]of _0x477c39){_0x34cf38[_0xd9d129(0x189)]?.({'type':'embedded_activation_creating','journeyName':_0x1a7c1c[_0xd9d129(0x1b1)]['name'],'activationName':_0x5c6194});const _0x4fccfa=await _0x4de568(_0x307c72,_0x531a4c[_0xd9d129(0x193)]),_0x1b7974={..._0x4fccfa,..._0x307c72[_0xd9d129(0x200)]!==undefined&&{'runAfterJourneyRefresh':_0x307c72[_0xd9d129(0x200)]}},_0xca1eb5=await _0x3dc8e3[_0xd9d129(0x130)][_0xd9d129(0x198)](_0x129956,_0x1b7974);_0x216d96[_0xd9d129(0x17c)](_0x5c6194,_0xca1eb5['id']),_0x5d5e55['journeyActivationNameToId'][_0xd9d129(0x17c)](_0x5c6194,_0xca1eb5['id']),_0x34cf38[_0xd9d129(0x189)]?.({'type':'embedded_activation_created','journeyName':_0x1a7c1c[_0xd9d129(0x1b1)][_0xd9d129(0x169)],'activationName':_0x5c6194});}const _0x7fccc7=JSON[_0xd9d129(0x132)](JSON[_0xd9d129(0x11b)](_0x570033));return _0x7fccc7['id']=_0x129956,ensureJourneyDefaults(_0x7fccc7[_0xd9d129(0x1ab)]),resolvePendingIdsInRequest(_0x7fccc7,_0x570033,_0x373a04,_0x4c4771,_0x216d96,_0x34cf38),await _0x3dc8e3['journey'][_0xd9d129(0x1c7)](_0x129956,_0x7fccc7),deletePushRecovery(_0x1a7c1c[_0xd9d129(0x135)]),{'action':_0xd9d129(0x147),'journeyId':_0x129956,'embeddedSegmentNameToId':_0x4c4771};}export function stripWaitStepPendingIds(_0x3bc1a0){const _0x5202d9=a142_0x469651,_0x1b8348=_0x3bc1a0[_0x5202d9(0x1aa)]&&isPendingSegmentId(_0x3bc1a0[_0x5202d9(0x1aa)]),_0x507871=_0x3bc1a0[_0x5202d9(0x1ad)]?.[_0x5202d9(0x1c5)](_0x58b6a0=>_0x58b6a0[_0x5202d9(0x207)]&&isPendingSegmentId(_0x58b6a0['segmentId']));(_0x1b8348||_0x507871)&&(_0x3bc1a0[_0x5202d9(0x16a)]='Duration',_0x3bc1a0[_0x5202d9(0x178)]=0x1,_0x3bc1a0[_0x5202d9(0x1af)]=_0x5202d9(0x180),delete _0x3bc1a0['conditionSegmentId'],delete _0x3bc1a0['conditionTimeoutDuration'],delete _0x3bc1a0[_0x5202d9(0x1ac)],delete _0x3bc1a0[_0x5202d9(0x1ad)]);}function a142_0x3aac(_0x2b98f2,_0x3c4d93){_0x2b98f2=_0x2b98f2-0x112;const _0x5e0eb0=a142_0x5e0e();let _0x3aac58=_0x5e0eb0[_0x2b98f2];return _0x3aac58;}export function resolveWaitStepPendingIds(_0x314f77,_0x42675c,_0x3e68ad,_0x4266a5){const _0xe8a821=a142_0x469651;if(_0x42675c[_0xe8a821(0x1aa)]&&isPendingSegmentId(_0x42675c[_0xe8a821(0x1aa)])){const _0x267553=_0x3e68ad(_0x42675c['conditionSegmentId'],_0xe8a821(0x149)+_0x4266a5+_0xe8a821(0x177));_0x267553&&(_0x314f77[_0xe8a821(0x16a)]=_0xe8a821(0x164),_0x314f77[_0xe8a821(0x1aa)]=_0x267553,delete _0x314f77[_0xe8a821(0x178)],delete _0x314f77['waitStepUnit'],_0x42675c[_0xe8a821(0x12b)]!==undefined&&(_0x314f77[_0xe8a821(0x12b)]=_0x42675c['conditionTimeoutDuration']),_0x42675c[_0xe8a821(0x1ac)]&&(_0x314f77[_0xe8a821(0x1ac)]=_0x42675c[_0xe8a821(0x1ac)]));}if(_0x42675c[_0xe8a821(0x1ad)]){const _0x59fa05=_0x42675c['conditions'][_0xe8a821(0x1c5)](_0x428f88=>_0x428f88[_0xe8a821(0x207)]&&isPendingSegmentId(_0x428f88[_0xe8a821(0x207)]));if(_0x59fa05){const _0x422f46=_0x42675c['conditions'][_0xe8a821(0x1a9)](_0x5b9ad3=>{const _0x476360=_0xe8a821;if(_0x5b9ad3['segmentId']&&isPendingSegmentId(_0x5b9ad3['segmentId'])){const _0x40a4a=_0x3e68ad(_0x5b9ad3[_0x476360(0x207)],'stage\x20\x27'+_0x4266a5+_0x476360(0x177));return{..._0x5b9ad3,'segmentId':_0x40a4a||_0x5b9ad3[_0x476360(0x207)]};}return{..._0x5b9ad3};});_0x314f77[_0xe8a821(0x16a)]=_0xe8a821(0x164),_0x314f77[_0xe8a821(0x1ad)]=_0x422f46,delete _0x314f77[_0xe8a821(0x178)],delete _0x314f77[_0xe8a821(0x1af)],delete _0x314f77[_0xe8a821(0x1aa)],delete _0x314f77[_0xe8a821(0x12b)],delete _0x314f77[_0xe8a821(0x1ac)];}}}function stripPendingIds(_0x162071){const _0x4ee1a5=a142_0x469651;_0x162071[_0x4ee1a5(0x1ab)][_0x4ee1a5(0x154)]?.[_0x4ee1a5(0x207)]&&isPendingSegmentId(_0x162071[_0x4ee1a5(0x1ab)][_0x4ee1a5(0x154)][_0x4ee1a5(0x207)])&&delete _0x162071[_0x4ee1a5(0x1ab)][_0x4ee1a5(0x154)];for(const _0x1c7d14 of _0x162071['attributes'][_0x4ee1a5(0x206)]||[]){_0x1c7d14[_0x4ee1a5(0x13b)]?.[_0x4ee1a5(0x207)]&&isPendingSegmentId(_0x1c7d14[_0x4ee1a5(0x13b)][_0x4ee1a5(0x207)])&&delete _0x1c7d14[_0x4ee1a5(0x13b)];_0x1c7d14[_0x4ee1a5(0x174)]?.['segmentId']&&isPendingSegmentId(_0x1c7d14[_0x4ee1a5(0x174)][_0x4ee1a5(0x207)])&&delete _0x1c7d14[_0x4ee1a5(0x174)];_0x1c7d14[_0x4ee1a5(0x1c3)]&&(_0x1c7d14['exitCriterias']=_0x1c7d14[_0x4ee1a5(0x1c3)][_0x4ee1a5(0x19c)](_0x18687f=>!_0x18687f['segmentId']||!isPendingSegmentId(_0x18687f[_0x4ee1a5(0x207)])));if(_0x1c7d14[_0x4ee1a5(0x1bb)])for(const _0x25ce59 of Object['keys'](_0x1c7d14[_0x4ee1a5(0x1bb)])){const _0x5e0c80=_0x1c7d14[_0x4ee1a5(0x1bb)][_0x25ce59];_0x5e0c80[_0x4ee1a5(0x17d)]===_0x4ee1a5(0x1db)&&_0x5e0c80['journeyActivationStepId']&&isPendingActivationId(_0x5e0c80[_0x4ee1a5(0x196)])&&(_0x5e0c80[_0x4ee1a5(0x196)]='');if(_0x5e0c80[_0x4ee1a5(0x17d)]===_0x4ee1a5(0x1f2)&&_0x5e0c80['branches'])for(const _0x215704 of _0x5e0c80[_0x4ee1a5(0x155)]){_0x215704['segmentId']&&isPendingSegmentId(_0x215704[_0x4ee1a5(0x207)])&&(_0x215704[_0x4ee1a5(0x207)]='');}_0x5e0c80[_0x4ee1a5(0x17d)]===_0x4ee1a5(0x1b8)&&stripWaitStepPendingIds(_0x5e0c80);}}}function resolvePendingIdsInRequest(_0x59eb7e,_0x72bd,_0x292a9a,_0x826b22,_0x323967,_0x487459){const _0x552240=a142_0x469651,_0x333cfa=(_0x563959,_0x41cdf8)=>{const _0x57e520=a142_0x3aac;if(!isPendingSegmentId(_0x563959))return _0x563959;const _0x452bac=extractPendingSegmentName(_0x563959),_0x46251c=_0x826b22[_0x57e520(0x15d)](_0x452bac);return!_0x46251c&&_0x487459['logWarning']?.(_0x57e520(0x19f)+_0x452bac+_0x57e520(0x181)+_0x41cdf8),_0x46251c;};if(_0x59eb7e[_0x552240(0x1ab)][_0x552240(0x154)]?.['segmentId']&&isPendingSegmentId(_0x59eb7e[_0x552240(0x1ab)]['goal'][_0x552240(0x207)])){const _0x187bc5=_0x333cfa(_0x59eb7e['attributes'][_0x552240(0x154)][_0x552240(0x207)],_0x552240(0x184));_0x187bc5&&(_0x59eb7e[_0x552240(0x1ab)][_0x552240(0x154)][_0x552240(0x207)]=_0x187bc5);}for(const _0x570098 of _0x59eb7e[_0x552240(0x1ab)]['journeyStages']||[]){const _0x5ed57e=_0x292a9a['get'](_0x570098['name'][_0x552240(0x1d5)]());_0x5ed57e&&(_0x570098['id']=_0x5ed57e);if(_0x570098[_0x552240(0x13b)]?.[_0x552240(0x207)]&&isPendingSegmentId(_0x570098[_0x552240(0x13b)][_0x552240(0x207)])){const _0x5e4f10=_0x333cfa(_0x570098['entryCriteria'][_0x552240(0x207)],'stage\x20\x27'+_0x570098['name']+'\x27\x20entry\x20criteria');_0x5e4f10&&(_0x570098[_0x552240(0x13b)][_0x552240(0x207)]=_0x5e4f10);}if(_0x570098['exitCriterias'])for(const _0x410532 of _0x570098['exitCriterias']){if(_0x410532[_0x552240(0x207)]&&isPendingSegmentId(_0x410532[_0x552240(0x207)])){const _0x4c7336=_0x333cfa(_0x410532[_0x552240(0x207)],'stage\x20\x27'+_0x570098[_0x552240(0x169)]+_0x552240(0x157));_0x4c7336&&(_0x410532[_0x552240(0x207)]=_0x4c7336);}}if(_0x570098[_0x552240(0x174)]?.['segmentId']&&isPendingSegmentId(_0x570098['milestone']['segmentId'])){const _0x5beb82=_0x333cfa(_0x570098[_0x552240(0x174)]['segmentId'],_0x552240(0x149)+_0x570098[_0x552240(0x169)]+_0x552240(0x14c));_0x5beb82&&(_0x570098[_0x552240(0x174)]['segmentId']=_0x5beb82);}if(_0x570098[_0x552240(0x1bb)]){const _0x6767cc=_0x550e46=>_0x72bd[_0x552240(0x1ab)][_0x552240(0x206)]?.[_0x552240(0x13c)](_0x1a58c0=>_0x1a58c0[_0x552240(0x169)][_0x552240(0x1d5)]()===_0x570098[_0x552240(0x169)][_0x552240(0x1d5)]())?.[_0x552240(0x1bb)]?.[_0x550e46];for(const _0x164f60 of Object[_0x552240(0x11f)](_0x570098[_0x552240(0x1bb)])){const _0x3cd428=_0x570098[_0x552240(0x1bb)][_0x164f60],_0x32ac7f=_0x6767cc(_0x164f60);if(_0x3cd428['type']==='Activation'&&_0x3cd428['journeyActivationStepId']&&(isPendingActivationId(_0x3cd428[_0x552240(0x196)])||_0x3cd428[_0x552240(0x196)]==='')){if(_0x32ac7f?.[_0x552240(0x196)]&&isPendingActivationId(_0x32ac7f[_0x552240(0x196)])){const _0x23360b=extractPendingActivationName(_0x32ac7f[_0x552240(0x196)]),_0x1ce41c=_0x323967['get'](_0x23360b);_0x1ce41c&&(_0x3cd428[_0x552240(0x196)]=_0x1ce41c);}}if(_0x3cd428[_0x552240(0x17d)]===_0x552240(0x1f2)&&_0x3cd428['branches']&&_0x32ac7f?.[_0x552240(0x155)])for(let _0x6b6d59=0x0;_0x6b6d59<_0x3cd428[_0x552240(0x155)][_0x552240(0x163)];_0x6b6d59++){const _0x1d2b86=_0x3cd428[_0x552240(0x155)][_0x6b6d59],_0x4e23bb=_0x32ac7f['branches'][_0x6b6d59];if(_0x4e23bb?.[_0x552240(0x207)]&&isPendingSegmentId(_0x4e23bb[_0x552240(0x207)])){const _0xd2b383=_0x333cfa(_0x4e23bb[_0x552240(0x207)],_0x552240(0x149)+_0x570098[_0x552240(0x169)]+_0x552240(0x133)+(_0x1d2b86[_0x552240(0x169)]||_0x6b6d59)+'\x27');_0xd2b383&&(_0x1d2b86[_0x552240(0x207)]=_0xd2b383);}}_0x3cd428['type']===_0x552240(0x1b8)&&_0x32ac7f?.[_0x552240(0x17d)]==='WaitStep'&&resolveWaitStepPendingIds(_0x3cd428,_0x32ac7f,_0x333cfa,_0x570098['name']);}}}}
1
+ const a142_0x119b8a=a142_0x3007;(function(_0x1ca649,_0x2dfb32){const _0x30c3e6=a142_0x3007,_0x4b7dee=_0x1ca649();while(!![]){try{const _0x4cabf0=parseInt(_0x30c3e6(0x220))/0x1+-parseInt(_0x30c3e6(0x27a))/0x2+-parseInt(_0x30c3e6(0x264))/0x3+parseInt(_0x30c3e6(0x1c6))/0x4+-parseInt(_0x30c3e6(0x214))/0x5*(-parseInt(_0x30c3e6(0x2b4))/0x6)+-parseInt(_0x30c3e6(0x1c2))/0x7+-parseInt(_0x30c3e6(0x1ef))/0x8*(-parseInt(_0x30c3e6(0x267))/0x9);if(_0x4cabf0===_0x2dfb32)break;else _0x4b7dee['push'](_0x4b7dee['shift']());}catch(_0x551b5e){_0x4b7dee['push'](_0x4b7dee['shift']());}}}(a142_0x2b21,0x2287b));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a142_0x119b8a(0x1fc));export const PENDING_SEGMENT_PREFIX=a142_0x119b8a(0x204);export const PENDING_ACTIVATION_PREFIX=a142_0x119b8a(0x235);export function createPendingSegmentId(_0xaef6a3){return''+PENDING_SEGMENT_PREFIX+_0xaef6a3+'__';}export function isPendingSegmentId(_0x2513ee){const _0x5cef88=a142_0x119b8a;return _0x2513ee[_0x5cef88(0x218)](PENDING_SEGMENT_PREFIX)&&!_0x2513ee[_0x5cef88(0x218)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x282171){return _0x282171['replace'](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x42dde0){return''+PENDING_ACTIVATION_PREFIX+_0x42dde0+'__';}export function isPendingActivationId(_0x3ace21){return _0x3ace21['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x238eca){return _0x238eca['replace'](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x2ae7d0,_0x58486a){const _0x31f91d=a142_0x119b8a,_0x1ed5e3=_0x2ae7d0+'::'+(_0x58486a[_0x31f91d(0x28e)]()||_0x31f91d(0x1ea)),_0x5cf252=createHash(_0x31f91d(0x27c))['update'](_0x1ed5e3)[_0x31f91d(0x1d4)]('hex')['slice'](0x0,0xc);return'journey_entry_criteria_'+_0x5cf252;}export function ensureJourneyDefaults(_0x52c78b){const _0x2233a9=a142_0x119b8a;!_0x52c78b[_0x2233a9(0x243)]&&(_0x52c78b[_0x2233a9(0x243)]=''),!_0x52c78b[_0x2233a9(0x2ae)]&&(_0x52c78b['state']=_0x2233a9(0x27f));}export function injectExistingStageIds(_0x51d2ea,_0x40657a){const _0x42844c=a142_0x119b8a,_0x43fa12=new Map(_0x40657a['map'](_0x138069=>[_0x138069[_0x42844c(0x1d5)],_0x138069['id']]));for(const _0xf97af of _0x51d2ea){if(!_0xf97af['id']){const _0x5b5ad0=_0x43fa12[_0x42844c(0x255)](_0xf97af[_0x42844c(0x1d5)]);_0x5b5ad0&&(_0xf97af['id']=_0x5b5ad0);}}}export function resolveTDFolderPath(_0xdcf848,_0xbf2583,_0x3b9b11){const _0x1da9c8=a142_0x119b8a;if(!_0xbf2583)return _0xdcf848;if(_0xdcf848===_0x3b9b11||_0xdcf848[_0x1da9c8(0x218)](_0x3b9b11+'/'))return _0xdcf848;return _0xdcf848?_0x3b9b11+'/'+_0xdcf848:_0x3b9b11;}export function addFoldersToCreate(_0x1389b1,_0x25a50e,_0x1d95bc){const _0x22af9e=a142_0x119b8a;if(!_0x1389b1)return;if(_0x25a50e[_0x22af9e(0x215)](_0x1389b1))return;const _0x3eb2c5=_0x1389b1[_0x22af9e(0x29e)]('/');let _0x272eca='';for(const _0x3fc1d4 of _0x3eb2c5){_0x272eca=_0x272eca?_0x272eca+'/'+_0x3fc1d4:_0x3fc1d4,!_0x25a50e[_0x22af9e(0x215)](_0x272eca)&&_0x1d95bc[_0x22af9e(0x1e8)](_0x272eca);}}export function sortFoldersByDepth(_0x423ce8){const _0x4a6f62=a142_0x119b8a;return[..._0x423ce8][_0x4a6f62(0x1f4)]((_0x4a11b8,_0x556978)=>{const _0xcfed2e=_0x4a6f62,_0x1a4fd2=(_0x4a11b8[_0xcfed2e(0x2b6)](/\//g)||[])['length'],_0x1312d9=(_0x556978[_0xcfed2e(0x2b6)](/\//g)||[])[_0xcfed2e(0x207)];return _0x1a4fd2-_0x1312d9;});}import*as a142_0x47e672 from'yaml';import{readFileSync}from'fs';import a142_0x23e26b from'path';import{isJourneyDef,parseYamlString as a142_0x1b9769,toYamlString as a142_0x407e51,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(_0x36a6be){const _0xddeddc=a142_0x119b8a;if(Array[_0xddeddc(0x1d9)](_0x36a6be))return'['+_0x36a6be[_0xddeddc(0x2b1)](_0x456f62=>stableStringify(_0x456f62))[_0xddeddc(0x265)](',')+']';if(_0x36a6be&&typeof _0x36a6be===_0xddeddc(0x20c)){const _0x17e111=_0x36a6be,_0xdacedf=Object['keys'](_0x17e111)['sort'](),_0x19cb16=_0xdacedf[_0xddeddc(0x2b1)](_0x5ec1eb=>'\x22'+_0x5ec1eb+'\x22:'+stableStringify(_0x17e111[_0x5ec1eb]));return'{'+_0x19cb16['join'](',')+'}';}const _0x138825=JSON[_0xddeddc(0x2a6)](_0x36a6be);return _0x138825===undefined?_0xddeddc(0x210):_0x138825;}function activationSignature(_0x40b23f){const _0x1ea233=a142_0x119b8a,_0x242109={'connection':_0x40b23f['connection'],..._0x40b23f[_0x1ea233(0x292)]!==undefined&&{'all_columns':_0x40b23f[_0x1ea233(0x292)]},..._0x40b23f[_0x1ea233(0x21d)]!==undefined&&{'columns':_0x40b23f[_0x1ea233(0x21d)]},..._0x40b23f[_0x1ea233(0x25d)]!==undefined&&{'behavior':_0x40b23f[_0x1ea233(0x25d)]},..._0x40b23f[_0x1ea233(0x219)]!==undefined&&{'schedule':_0x40b23f['schedule']},..._0x40b23f[_0x1ea233(0x28f)]!==undefined&&{'notification':_0x40b23f[_0x1ea233(0x28f)]},..._0x40b23f[_0x1ea233(0x1f3)]!==undefined&&{'connector_config':_0x40b23f['connector_config']},..._0x40b23f[_0x1ea233(0x242)]!==undefined&&{'activation_template_id':_0x40b23f['activation_template_id']}};return stableStringify(_0x242109);}async function fetchSegment(_0xac2eba,_0x52ccc9,_0xe9a5de,_0x10074d){const _0x14e59c=a142_0x119b8a,_0x1dc9ae=_0x10074d?.[_0x14e59c(0x240)](_0x1fd81a=>_0x1fd81a['id']===_0xe9a5de);if(_0x1dc9ae)return _0x1dc9ae;try{return await _0xac2eba[_0x14e59c(0x1ea)][_0x14e59c(0x205)](_0x52ccc9,_0xe9a5de);}catch(_0x4eae08){logger['debug']('getSegment\x20failed\x20for\x20'+_0xe9a5de+_0x14e59c(0x1f0)+_0x4eae08);try{return await _0xac2eba[_0x14e59c(0x1ea)][_0x14e59c(0x2a4)](_0xe9a5de);}catch(_0x420dde){return logger[_0x14e59c(0x245)]('getSegmentEntity\x20also\x20failed\x20for\x20'+_0xe9a5de+':\x20'+_0x420dde),null;}}}function recoverSegmentIdsFromPushRecovery(_0x507d5d,_0x1d0f69,_0x298c9b){const _0x146744=a142_0x119b8a,_0xc50950=readPushRecovery(_0x507d5d[_0x146744(0x1c1)]);if(_0xc50950?.[_0x146744(0x25e)]===_0x507d5d[_0x146744(0x257)][_0x146744(0x1d5)])for(const [_0x190ec9,_0x2ad979]of Object['entries'](_0xc50950[_0x146744(0x1f7)])){const _0x35c1f9=generateDeterministicJourneySegmentName(_0x507d5d[_0x146744(0x257)][_0x146744(0x1d5)],_0x190ec9);_0x2ad979['uniqueServerName']===_0x35c1f9&&(_0x1d0f69[_0x146744(0x1e5)](_0x190ec9,_0x2ad979[_0x146744(0x278)]),_0x298c9b[_0x146744(0x1e5)](_0x190ec9,_0x2ad979[_0x146744(0x278)]));}}async function createOrRecoverEmbeddedSegment(_0x3aba1e,_0x5f4f58,_0x463c7a,_0x4d0606){const _0x2462d3=a142_0x119b8a;let _0x3270af;try{_0x3270af=await _0x3aba1e[_0x2462d3(0x1ea)][_0x2462d3(0x2a0)]({'name':_0x463c7a[_0x2462d3(0x1f6)],'description':_0x463c7a[_0x2462d3(0x243)],'journeyId':_0x463c7a[_0x2462d3(0x276)],'rule':_0x4d0606(_0x463c7a[_0x2462d3(0x1d2)],!![]),'countPopulation':!![],'parentFolderId':_0x463c7a[_0x2462d3(0x275)],'audienceId':_0x463c7a[_0x2462d3(0x24a)]});}catch(_0x81f540){const _0x30a9e4=_0x81f540 instanceof Error&&_0x81f540['message'][_0x2462d3(0x228)](_0x2462d3(0x234));if(_0x30a9e4){const _0x3cecee=readPushRecovery(_0x5f4f58[_0x2462d3(0x1c1)]),_0x29e3b1=_0x3cecee?.['journeyName']===_0x5f4f58[_0x2462d3(0x257)][_0x2462d3(0x1d5)]?_0x3cecee[_0x2462d3(0x1f7)][_0x463c7a[_0x2462d3(0x1be)]]:undefined;if(_0x29e3b1?.[_0x2462d3(0x288)]===_0x463c7a[_0x2462d3(0x1f6)])await _0x3aba1e[_0x2462d3(0x1ea)][_0x2462d3(0x25f)](_0x463c7a[_0x2462d3(0x24a)],_0x29e3b1['segmentId'],{'description':_0x463c7a['description'],'rule':_0x4d0606(_0x463c7a[_0x2462d3(0x1d2)],!![]),'countPopulation':!![]}),_0x3270af=_0x29e3b1[_0x2462d3(0x278)];else throw new SDKError(ErrorCode['SEGMENT_UPDATE_ERROR'],_0x2462d3(0x253)+_0x463c7a[_0x2462d3(0x1be)]+_0x2462d3(0x258)+('Delete\x20the\x20push\x20recovery\x20file\x20('+_0x5f4f58['absolutePath'][_0x2462d3(0x26e)](/([^/]+)$/,_0x2462d3(0x29d))+')\x20')+'and\x20the\x20server\x20segment,\x20then\x20retry.',_0x81f540);}else throw _0x81f540;}return saveSegmentToPushRecovery(_0x5f4f58['absolutePath'],_0x5f4f58[_0x2462d3(0x257)][_0x2462d3(0x1d5)],_0x463c7a[_0x2462d3(0x1be)],{'segmentId':_0x3270af,'uniqueServerName':_0x463c7a[_0x2462d3(0x1f6)],'createdAt':new Date()[_0x2462d3(0x1ce)]()}),_0x3270af;}export async function prepareSegmentFiles(_0x56101d,_0x6bcdd8,_0x3412a4,_0x3c71a4,_0x105684){const _0x1aa318=a142_0x119b8a,{activationDefToCreateRequest:_0x29a46a}=await import('./child-segment-yaml.js'),_0x5c0940=[],_0xf9bead=new Set();for(const {yamlConfig:_0x3f6c82,folderPath:_0x370875,sourcePath:_0x50160b}of _0x56101d){const _0x5cda9b=resolveTDFolderPath(_0x370875,_0x3c71a4,_0x105684),_0x1eacfc=_0x5cda9b+':'+_0x3f6c82['name'],_0x1b216b=_0x6bcdd8['segmentByFolderAndName'][_0x1aa318(0x255)](_0x1eacfc),_0x5ba356=_0x1b216b?_0x6bcdd8[_0x1aa318(0x272)][_0x1aa318(0x255)](_0x1b216b['id'])||[]:[];addFoldersToCreate(_0x5cda9b,_0x6bcdd8[_0x1aa318(0x2a2)],_0xf9bead);const _0x21006d=calculateActivationActions(_0x3f6c82[_0x1aa318(0x293)]||[],_0x5ba356,_0x6bcdd8['idToEmailMap'],_0x6bcdd8[_0x1aa318(0x1d1)]);for(const _0x4867b9 of _0x21006d){(_0x4867b9['type']===_0x1aa318(0x1cb)||_0x4867b9[_0x1aa318(0x1e7)]===_0x1aa318(0x1ee))&&_0x4867b9[_0x1aa318(0x287)]&&(_0x4867b9[_0x1aa318(0x1f2)]=await _0x29a46a(_0x4867b9[_0x1aa318(0x287)],_0x3412a4));}const _0x2171b7=calculateSegmentDiff(_0x3f6c82,_0x1b216b,_0x5ba356,_0x6bcdd8[_0x1aa318(0x29b)],_0x6bcdd8[_0x1aa318(0x1d1)]);_0x5c0940[_0x1aa318(0x23a)]({'relativePath':_0x3f6c82[_0x1aa318(0x1d5)],'absolutePath':_0x50160b,'yamlConfig':_0x3f6c82,'folderPath':_0x5cda9b,'existingSegment':_0x1b216b,'existingActivations':_0x5ba356,'isNew':_0x2171b7[_0x1aa318(0x1c0)],'hasChanges':_0x2171b7[_0x1aa318(0x295)],'diff':_0x2171b7['diff'],'activationActions':_0x21006d});}return{'segmentFiles':_0x5c0940,'foldersToCreate':_0xf9bead};}export async function prepareJourneyFiles(_0x1c5802,_0x57f358,_0x3c1597,_0x378126){const _0x47314f=a142_0x119b8a,_0x1956cd=[],_0x19aad1=new Set();for(const {yamlConfig:_0x5ada95,folderPath:_0x1b9ff0,sourcePath:_0x2fc5e5}of _0x1c5802){const _0x3be21f=resolveTDFolderPath(_0x1b9ff0,_0x3c1597,_0x378126),_0x52ed79=_0x3be21f+':'+_0x5ada95[_0x47314f(0x1d5)],_0x529e6f=_0x57f358[_0x47314f(0x290)]['get'](_0x52ed79);let _0x352ce3,_0x302d3a;if(_0x529e6f&&_0x529e6f['length']>0x0){const _0x1a2d1b=buildLocalExpandedRuleMappings(_0x5ada95),{createYamlContext:_0x503e91,prefetchJourneySegments:_0x2b6946}=createPushYamlContextForBundle(_0x57f358[_0x47314f(0x1bf)],_0x57f358[_0x47314f(0x24a)],_0x57f358[_0x47314f(0x281)],_0x1a2d1b,_0x57f358[_0x47314f(0x29b)],_0x57f358['connectionIdToNameMap'],_0x57f358[_0x47314f(0x22a)],_0x57f358[_0x47314f(0x232)]);await _0x2b6946(_0x529e6f[_0x47314f(0x2b1)](_0x9ac62e=>_0x9ac62e['id']));const _0x191ad3=await _0x57f358[_0x47314f(0x1bf)][_0x47314f(0x1fa)]['getLatestJourneyId'](_0x529e6f[0x0][_0x47314f(0x285)]),_0x44f31c=hasMultipleVersions(_0x5ada95),_0x450c2f=async _0x68171e=>{const _0x2c38bb=_0x47314f,_0xdd1270=_0x57f358[_0x2c38bb(0x232)]?.['get'](_0x68171e);if(_0xdd1270)return _0xdd1270;return _0x57f358['fetchJourney']({'journeyId':_0x68171e,'journeyName':_0x5ada95[_0x2c38bb(0x1d5)],'isMultiVersion':_0x529e6f[_0x2c38bb(0x207)]>0x1});};if(_0x44f31c&&_0x529e6f[_0x47314f(0x207)]>0x1){const _0x229b93=[];for(const _0x246627 of _0x529e6f){const _0x5f16c0=_0x246627[_0x47314f(0x20d)]||0x1;_0x57f358[_0x47314f(0x271)]?.[_0x47314f(0x1ee)]('Fetching\x20'+_0x5ada95[_0x47314f(0x1d5)]+'\x20v'+_0x5f16c0);const _0x320395=await _0x450c2f(_0x246627['id']),_0x4a7bed=_0x503e91(_0x246627['id']),_0x588f0b=await journeyResponseToDef(_0x320395,_0x4a7bed);_0x229b93['push']({'item':_0x246627,'yaml':_0x588f0b});}const _0x1f7fe7=buildLocalRuleToNameMappingFromJourney(_0x5ada95);_0x302d3a=buildMergedJourneyDef(_0x229b93,_0x1f7fe7,_0x191ad3);const _0x3e927f=Math[_0x47314f(0x259)](..._0x229b93[_0x47314f(0x2b1)](_0x3ce589=>_0x3ce589['item']['versionNumber']||0x0)),_0x33ad44=_0x529e6f[_0x47314f(0x240)](_0xc5d538=>(_0xc5d538[_0x47314f(0x20d)]||0x0)===_0x3e927f);_0x33ad44&&(_0x57f358[_0x47314f(0x271)]?.[_0x47314f(0x1ee)](_0x47314f(0x1c5)+_0x5ada95[_0x47314f(0x1d5)]+'\x20v'+_0x3e927f),_0x352ce3=await _0x450c2f(_0x33ad44['id']));}else{const _0x1615e2=_0x529e6f[_0x529e6f[_0x47314f(0x207)]-0x1];_0x57f358[_0x47314f(0x271)]?.[_0x47314f(0x1ee)](_0x47314f(0x1c5)+_0x5ada95[_0x47314f(0x1d5)]),_0x352ce3=await _0x450c2f(_0x1615e2['id']);const _0x71b6=_0x503e91(_0x1615e2['id']),_0x1b1af7=await journeyResponseToDef(_0x352ce3,_0x71b6),_0x4989f3=buildLocalRuleToNameMappingFromJourney(_0x5ada95);_0x302d3a=buildMergedJourneyDef([{'item':_0x1615e2,'yaml':_0x1b1af7}],_0x4989f3,_0x191ad3);}}addFoldersToCreate(_0x3be21f,_0x57f358[_0x47314f(0x2a2)],_0x19aad1);const _0x20e165=calculateJourneyDiff(_0x5ada95,_0x302d3a);_0x1956cd[_0x47314f(0x23a)]({'relativePath':_0x5ada95['name'],'absolutePath':_0x2fc5e5,'yamlConfig':_0x5ada95,'folderPath':_0x3be21f,'existingJourney':_0x352ce3,'isNew':_0x20e165[_0x47314f(0x1c0)],'hasChanges':_0x20e165['hasChanges'],'diff':_0x20e165['diff']});}return{'journeyFiles':_0x1956cd,'foldersToCreate':_0x19aad1};}export function calculateActivationActions(_0x29971f,_0x2ab93f,_0x444a06,_0x1e5c03){const _0x55b1e2=a142_0x119b8a,_0xd33262=[],_0x4837f3=new Map();for(const _0xdd6182 of _0x2ab93f){_0x4837f3['set'](_0xdd6182['name'],_0xdd6182);}const _0x51cfb0=new Map();for(const _0x373dd3 of _0x29971f){_0x51cfb0[_0x55b1e2(0x1e5)](_0x373dd3[_0x55b1e2(0x1d5)],_0x373dd3);}for(const _0x339181 of _0x29971f){const _0x2c8c19=_0x4837f3['get'](_0x339181[_0x55b1e2(0x1d5)]);if(!_0x2c8c19)_0xd33262[_0x55b1e2(0x23a)]({'type':_0x55b1e2(0x1cb),'name':_0x339181['name'],'yamlActivation':_0x339181});else{const _0x3739fd=activationResponseToDef(_0x2c8c19,_0x444a06,_0x1e5c03),_0x3dfbd4=a142_0x47e672[_0x55b1e2(0x2a6)](_0x3739fd),_0x50e6c7=a142_0x47e672[_0x55b1e2(0x2a6)](_0x339181);_0x3dfbd4!==_0x50e6c7&&_0xd33262['push']({'type':_0x55b1e2(0x1ee),'name':_0x339181['name'],'yamlActivation':_0x339181,'existingActivation':_0x2c8c19});}}for(const _0x564e00 of _0x2ab93f){!_0x51cfb0[_0x55b1e2(0x215)](_0x564e00[_0x55b1e2(0x1d5)])&&_0xd33262[_0x55b1e2(0x23a)]({'type':_0x55b1e2(0x2bc),'name':_0x564e00['name'],'existingActivation':_0x564e00});}return _0xd33262;}function calculateYamlDiff(_0x2e36c8,_0x5d374f){if(_0x5d374f){const _0xa5836=generateDiff(_0x5d374f,_0x2e36c8),_0x2be849=hasChanges(_0xa5836);return{'isNew':![],'hasChanges':_0x2be849,'diff':_0x2be849?formatDiffWithColors(_0xa5836):undefined};}const _0xb1d3a5=generateDiff('',_0x2e36c8);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0xb1d3a5)};}export function calculateSegmentDiff(_0x10e762,_0x1aeec1,_0x35620f,_0x162fde,_0x2b0891){const _0x30b5ee=segmentToYamlString(_0x10e762),_0x1e1e0b=_0x1aeec1?segmentToYamlString(segmentWithActivationsToYaml(_0x1aeec1,_0x35620f,undefined,_0x162fde,_0x2b0891)):undefined;return calculateYamlDiff(_0x30b5ee,_0x1e1e0b);}export function calculateJourneyDiff(_0x5487a2,_0x5df1ed){const _0x474042=normalizeJourneyDef(_0x5487a2,_0x5487a2),_0xe74bf2=a142_0x407e51(_0x474042),_0x43fc8d=_0x5df1ed?a142_0x407e51(normalizeJourneyDef(_0x5df1ed,_0x5487a2)):undefined;return calculateYamlDiff(_0xe74bf2,_0x43fc8d);}export function findSegmentsToDelete(_0x3a5ec5,_0x555379,_0x4c23f0,_0x4501f8,_0x295a2a){const _0x400828=a142_0x119b8a,_0x2d08fc=new Set();for(const {yamlConfig:_0x46304f,folderPath:_0x4976ca}of _0x555379){_0x2d08fc[_0x400828(0x1e8)](_0x4976ca+':'+_0x46304f[_0x400828(0x1d5)]);}return _0x3a5ec5[_0x400828(0x2be)](_0x112c06=>{const _0x552967=_0x400828,_0x5c8aeb=_0x112c06[_0x552967(0x21a)]?_0x4c23f0['get'](_0x112c06[_0x552967(0x21a)][_0x552967(0x283)]())||'':'',_0x33c524=_0x5c8aeb+':'+_0x112c06[_0x552967(0x1d5)];if(_0x2d08fc[_0x552967(0x215)](_0x33c524))return![];if(_0x295a2a)return _0x5c8aeb===_0x4501f8||_0x5c8aeb[_0x552967(0x218)](_0x4501f8+'/');return!![];});}export function findJourneysToDelete(_0x5cd6a7,_0x1bfc8f,_0x2a856b,_0x366013,_0x433a0d){const _0x4e875f=a142_0x119b8a,_0x39109a=new Set();for(const {yamlConfig:_0x2c847e,folderPath:_0x146572}of _0x1bfc8f){_0x39109a[_0x4e875f(0x1e8)](_0x146572+':'+_0x2c847e['name']);}return _0x5cd6a7['filter'](_0x341d06=>{const _0x24660e=_0x4e875f,_0x34f7d7=_0x341d06[_0x24660e(0x275)]?_0x2a856b['get'](_0x341d06[_0x24660e(0x275)])||'':'',_0x38f7bc=_0x34f7d7+':'+_0x341d06[_0x24660e(0x297)];if(_0x39109a[_0x24660e(0x215)](_0x38f7bc))return![];if(_0x433a0d)return _0x34f7d7===_0x366013||_0x34f7d7[_0x24660e(0x218)](_0x366013+'/');return!![];});}function a142_0x2b21(){const _0x542ca0=['stringify','activationActions','idToName','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','Updating\x20activation\x20\x27','parse','stages','createdSegmentIds','state','branches','Segment\x20not\x20found:\x20','map','Segment\x20not\x20found','conditions','558FoRPTL','conditionTimeoutDuration','match','nameToType','Updating\x20segment\x20\x27','decision_point','parentFolder','stage\x20\x27','delete','Creating\x20folder\x20\x27','filter','listActivations','ACTIVATION_SYNTAX_ERROR','deleteActivation','journeyActivationStepId','SEGMENT_NOT_FOUND','\x27\x20for\x20','localName','deps','isNew','absolutePath','1318849nKYxJx','./child-segment-yaml.js','activation_updated','Fetching\x20','64884Lznxhd','parseDocument','SEGMENT_UPDATE_ERROR','createSegment','journey_created','create','segment_deleting','segment_deleted','toISOString','relationships','Created\x20activation\x20\x27','connectionIdToNameMap','resolvedRule','embedded_activation_creating','digest','name','list','Updated\x20activation\x20\x27','embedded_activation_created','isArray','Creating\x20activation\x20\x27','embeddedSegmentNameToId','results','created','resolveSegment','resolveJourneyId','from','segment_creating','Deleting\x20activation\x20\x27','segmentNameToId','folder_creating','set','\x27\x20entry\x20criteria','type','add','unchanged','segment','goal\x20criteria','createFolder','activation_created','update','87536SJNttT',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','updated','validatedRequest','connector_config','sort','goal','uniqueSegmentName','segments','journeys','folderPath','journey','onProgress','tdx.sdk.push-workflow','Created\x20segment\x20\x27','INTERNAL','Activation\x20not\x20found:\x20','waitStep','journey_creating','toLowerCase','activationContext','__pending_','getSegment','attributes','length','effectiveFolderId','rule','buildUserMaps','Failed\x20to\x20fetch\x20referenced\x20segment\x20','object','versionNumber','reduce','parentSegmentFolder','null','deleted','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','kind','12815cYdYbA','has','Stage\x20\x27','some','startsWith','schedule','segmentFolderId','activation_creating','Failed\x20to\x20resolve\x20segment\x20','columns','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','activation_updating','92217tZmNJl',').\x20','Creating\x20segment\x20\x27','journeyStages','waitStepType','\x0a\x20\x20','segment_updated','\x27\x20from\x20file:\x20','includes','folder_created','activationStepsById','Failed\x20to\x20resolve\x20activation\x20','errors','\x20(referenced\x20in\x20journey\x20','WaitStep','with','run_after_journey_refresh','all','journeyById','rootFolderId','Name\x20has\x20already\x20been\x20taken','__pending_act_','logInfo','milestone','\x27\x20not\x20found\x20in\x20journey\x20\x27','entry_criteria','push','NOT_FOUND','Failed\x20to\x20','getJourney','JOURNEY_UPDATE_ERROR','\x27\x20wait\x20condition','find','withProgress','activation_template_id','description','relative','debug','logWarning','Activation','existingSegment','createActivation','parentId','activationParams','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','waitStepUnit','nameToId','day','\x27\x20milestone','valid','embedded_segment_created','Embedded\x20segment\x20\x27','steps','get','exitCriterias','yamlConfig','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','max','slice','segment_updating','folder','behavior','journeyName','updateSegmentById','SEGMENT_SYNTAX_ERROR','DecisionPoint','embedded_segment_creating','../../utils/async.js','534063zvvXRS','join','flatMap','144UhAKCO','\x27...','logDeleted','entryCriteria','conditionSegmentId','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','updateActivation','replace','journey_updated','Deleted\x20activation\x20\x27','progress','activationsBySegmentId','user','size','folderId','journeyId','\x20activation\x20\x27','segmentId','JOURNEY_SYNTAX_ERROR','28012Mooqtj','ACTIVATION_UPDATE_ERROR','sha1','activation_deleted','entry','draft','dirname','existingSegments','Created\x20journey\x20\x27','toString','data','journeyBundleId','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','yamlActivation','uniqueServerName','conditionTimeoutUnit','index','existingActivation','createdSegmentId','utf-8','trim','notification','journeyBundlesByFolderAndName','Deleted\x20segment\x20\x27','all_columns','activations','\x20journey\x20from\x20file:\x20','hasChanges','logSuccess','journeyBundleName','journey_updating','existingJourney','keys','idToEmailMap','action','.$1.push-recovery.json','split','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','createJourneySegment','Duration','folderPathToId','Journey\x20\x27','getSegmentEntity','Entry\x20criteria:\x20'];a142_0x2b21=function(){return _0x542ca0;};return a142_0x2b21();}export function buildSegmentLookupMap(_0xf7ce32,_0x5297fe){const _0x38abc3=a142_0x119b8a,_0x4ec330=new Map();for(const _0x418250 of _0xf7ce32){const _0x1cf85b=_0x418250[_0x38abc3(0x21a)]?_0x5297fe[_0x38abc3(0x255)](_0x418250[_0x38abc3(0x21a)]['toString']())||'':'',_0x1759b6=_0x1cf85b+':'+_0x418250[_0x38abc3(0x1d5)];_0x4ec330['set'](_0x1759b6,_0x418250);}return _0x4ec330;}export function buildSegmentNameToIdMap(_0x30fad9){const _0x5ab121=a142_0x119b8a,_0x2ec7c3=new Map();for(const _0x31be53 of _0x30fad9){_0x2ec7c3[_0x5ab121(0x1e5)](_0x31be53['name'],_0x31be53['id']);}return _0x2ec7c3;}export function buildJourneyBundleLookupMap(_0x32c2bc,_0x2494a6){const _0x230110=a142_0x119b8a,_0x159457=new Map();for(const _0xf9b338 of _0x32c2bc){const _0x1bb5d3=_0xf9b338[_0x230110(0x275)]?_0x2494a6['get'](_0xf9b338[_0x230110(0x275)])||'':'',_0x369e0d=_0x1bb5d3+':'+_0xf9b338[_0x230110(0x297)];!_0x159457[_0x230110(0x215)](_0x369e0d)&&_0x159457[_0x230110(0x1e5)](_0x369e0d,[]),_0x159457[_0x230110(0x255)](_0x369e0d)[_0x230110(0x23a)](_0xf9b338);}for(const _0x5882d2 of _0x159457['values']()){_0x5882d2[_0x230110(0x1f4)]((_0xd20ce2,_0x14fa7c)=>(_0xd20ce2['versionNumber']||0x0)-(_0x14fa7c[_0x230110(0x20d)]||0x0));}return _0x159457;}export function collectFoldersToCreate(_0x3c8149,_0x360665){const _0x3305a9=a142_0x119b8a,_0x5b6b31=new Set();for(const _0x568e40 of _0x3c8149){if(!_0x568e40)continue;if(_0x360665['has'](_0x568e40))continue;const _0x500454=_0x568e40[_0x3305a9(0x29e)]('/');let _0x4c67c6='';for(const _0x4ce074 of _0x500454){_0x4c67c6=_0x4c67c6?_0x4c67c6+'/'+_0x4ce074:_0x4ce074,!_0x360665['has'](_0x4c67c6)&&_0x5b6b31[_0x3305a9(0x1e8)](_0x4c67c6);}}return _0x5b6b31;}export function parseAndClassifyYamlFiles(_0x4bda26,_0x1fda52,_0x3367fb){const _0x123c37=a142_0x119b8a,_0x1a6f6e=[],_0x388957=[];for(const _0x418257 of _0x4bda26){const _0x24264b=a142_0x23e26b[_0x123c37(0x244)](_0x1fda52,a142_0x23e26b[_0x123c37(0x280)](_0x418257)),_0x148f6e=_0x24264b==='.'?'':_0x24264b,_0x2209d9=readFileSync(_0x418257,'utf-8'),_0x6a6075=a142_0x47e672[_0x123c37(0x2ab)](_0x2209d9);if(isJourneyDef(_0x6a6075)){const _0x33fb42=a142_0x1b9769(_0x2209d9);_0x388957[_0x123c37(0x23a)]({'yamlConfig':_0x33fb42,'folderPath':_0x148f6e,'sourcePath':_0x418257});}else{if(!_0x3367fb?.['skipSegments']){const _0x5b0adf=parseSegmentYamlFile(_0x2209d9),_0x474384=normalizeChildSegmentYaml(_0x5b0adf);_0x1a6f6e[_0x123c37(0x23a)]({'yamlConfig':_0x474384,'folderPath':_0x148f6e,'sourcePath':_0x418257});}}}return{'segments':_0x1a6f6e,'journeys':_0x388957};}export function validateParsedFiles(_0x2cfa90,_0x1bccfa){const _0x29fc8d=a142_0x119b8a,_0x1826d0=[];for(const {yamlConfig:_0xfbe49a,sourcePath:_0x33ffc3}of _0x2cfa90[_0x29fc8d(0x1f7)]){const _0x191712=readFileSync(_0x33ffc3,_0x29fc8d(0x28d)),_0x21eac6=a142_0x47e672[_0x29fc8d(0x1c7)](_0x191712),_0x4900e6=validateSegmentDef(_0xfbe49a,{'source':_0x191712,'document':_0x21eac6},{'skipSchema':!![]});if(!_0x4900e6[_0x29fc8d(0x251)]){const _0x4f8e2c=a142_0x23e26b[_0x29fc8d(0x244)](_0x1bccfa,_0x33ffc3);_0x1826d0[_0x29fc8d(0x23a)]({'filePath':_0x4f8e2c,'source':_0x191712,'result':_0x4900e6,'isJourney':![]});}}for(const {yamlConfig:_0x322424,sourcePath:_0x2aa0af}of _0x2cfa90[_0x29fc8d(0x1f8)]){const _0x2a0d4a=readFileSync(_0x2aa0af,_0x29fc8d(0x28d)),_0x29d38e=a142_0x47e672[_0x29fc8d(0x1c7)](_0x2a0d4a),_0x34e2f0=validateJourneyDef(_0x322424,{'source':_0x2a0d4a,'document':_0x29d38e},{'skipSchema':!![]});if(!_0x34e2f0['valid']){const _0x26ff6f=a142_0x23e26b[_0x29fc8d(0x244)](_0x1bccfa,_0x2aa0af);_0x1826d0['push']({'filePath':_0x26ff6f,'source':_0x2a0d4a,'result':_0x34e2f0,'isJourney':!![]});}}return _0x1826d0;}export function formatValidationErrors(_0x56f13a){const _0x5c4140=a142_0x119b8a,_0x13b9c7=[];for(const {filePath:_0xd2eb,source:_0x2ea80b,result:_0x3898b5,isJourney:_0x5d490f}of _0x56f13a){const _0x4d0091=_0x5d490f?_0x5c4140(0x1fa):_0x5c4140(0x1ea);_0x13b9c7[_0x5c4140(0x23a)]('\x0a'+_0xd2eb+'\x20('+_0x4d0091+'):\x20'+_0x3898b5[_0x5c4140(0x22c)]['length']+'\x20error(s)'),_0x13b9c7[_0x5c4140(0x23a)](formatValidationResult(_0x3898b5,_0x2ea80b,_0xd2eb));}return _0x13b9c7['join']('\x0a');}export function buildLocalExpandedRuleMappings(_0x4a2fe5){const _0x5ace12=a142_0x119b8a,_0x2f38ef=new Set(),_0x4f0685=new Map(),_0x598dc2=collectSegmentUsageCounts(_0x4a2fe5);if(_0x4a2fe5[_0x5ace12(0x1f7)])for(const [_0x22de42,_0x2f7ae9]of Object['entries'](_0x4a2fe5[_0x5ace12(0x1f7)])){_0x2f38ef[_0x5ace12(0x1e8)](_0x22de42);if(_0x2f7ae9[_0x5ace12(0x209)]){const _0x13f0f1=yamlRuleToApi(_0x2f7ae9[_0x5ace12(0x209)]),_0x54f192=apiRuleToYaml(_0x13f0f1);_0x4f0685[_0x5ace12(0x1e5)](_0x22de42,_0x54f192);}}const _0x5d2f08=new Map();let _0x41e366=0x0;for(const [_0x104ac7,_0x46f195]of _0x4f0685){const _0xa0342d=serializeExpandedRule(_0x46f195,_0x4f0685),_0x481a89=_0x5d2f08[_0x5ace12(0x255)](_0xa0342d)||[];_0x481a89[_0x5ace12(0x23a)]({'name':_0x104ac7,'index':_0x41e366}),_0x5d2f08['set'](_0xa0342d,_0x481a89),_0x41e366++;}const _0x5e4d60=new Map();for(const [_0x873fb6,_0x2733ff]of _0x5d2f08){const _0x2d2e35=_0x2733ff[_0x5ace12(0x25a)]()[_0x5ace12(0x1f4)]((_0xfd8502,_0x411eb1)=>{const _0x330c99=_0x5ace12,_0x5e917b=_0x598dc2[_0x330c99(0x255)](_0xfd8502[_0x330c99(0x1d5)])||0x0,_0x4a435a=_0x598dc2[_0x330c99(0x255)](_0x411eb1[_0x330c99(0x1d5)])||0x0;if(_0x5e917b!==_0x4a435a)return _0x4a435a-_0x5e917b;return _0xfd8502[_0x330c99(0x28a)]-_0x411eb1[_0x330c99(0x28a)];})['map'](_0x14b2e1=>_0x14b2e1['name']),_0x26e618=[];for(const _0x22ed73 of _0x2d2e35){const _0x422bcd=_0x598dc2[_0x5ace12(0x255)](_0x22ed73)||0x0,_0x2b4d7b=Math['max'](_0x422bcd,0x1);for(let _0x272ef6=0x0;_0x272ef6<_0x2b4d7b;_0x272ef6++){_0x26e618[_0x5ace12(0x23a)](_0x22ed73);}}_0x5e4d60['set'](_0x873fb6,_0x26e618);}return{'existingLocalSegmentNames':_0x2f38ef,'localSegmentRules':_0x4f0685,'localExpandedRuleToNames':_0x5e4d60};}export function createSegmentIdResolver(_0x5d7938,_0x53fb8b){return async _0x3a5210=>{const _0x4cf928=a142_0x3007,_0x39525c=_0x5d7938['get'](_0x3a5210);if(!_0x39525c)throw new SDKError(ErrorCode[_0x4cf928(0x1bc)],_0x4cf928(0x2b0)+_0x3a5210+_0x4cf928(0x26c)+_0x53fb8b+'\x27)');return _0x39525c;};}export function extractRootFolderId(_0x5aeda4){const _0x17260d=a142_0x119b8a;return _0x5aeda4[_0x17260d(0x1cf)]?.[_0x17260d(0x20f)]?.['data']?.['id']||_0x5aeda4[_0x17260d(0x1cf)]?.[_0x17260d(0x2ba)]?.[_0x17260d(0x284)]?.['id'];}export function buildConnectionMaps(_0x3553b9){const _0x477206=a142_0x119b8a,_0x45a386=new Map(),_0x11ff61=new Map(),_0x4af573=new Map();for(const _0x3835b9 of _0x3553b9){_0x45a386[_0x477206(0x1e5)](_0x3835b9['name'],parseInt(_0x3835b9['id'],0xa)),_0x11ff61[_0x477206(0x1e5)](_0x3835b9['id'],_0x3835b9[_0x477206(0x1d5)]),_0x4af573['set'](_0x3835b9[_0x477206(0x1d5)],_0x3835b9[_0x477206(0x1e7)]);}return{'nameToId':_0x45a386,'idToName':_0x11ff61,'nameToType':_0x4af573};}export function calculatePushStats(_0x4578da,_0x5b6319,_0x1b4a0d,_0x1d0496,_0x18461a,_0x11ab5e,_0x431d33){const _0x30aa2a=a142_0x119b8a,_0x56614f=_0x4578da[_0x30aa2a(0x2be)](_0x10396d=>_0x10396d[_0x30aa2a(0x1c0)]),_0xd2d6db=_0x4578da['filter'](_0x47ca53=>!_0x47ca53['isNew']&&_0x47ca53[_0x30aa2a(0x295)]),_0x1072c4=_0x4578da['filter'](_0x25f9d6=>!_0x25f9d6['isNew']&&!_0x25f9d6['hasChanges']),_0x2ebcb5=_0x11ab5e?_0x1d0496:[],_0xaaef5c=_0x5b6319[_0x30aa2a(0x2be)](_0x511b2d=>_0x511b2d[_0x30aa2a(0x1c0)]),_0x3bb394=_0x5b6319['filter'](_0x350330=>!_0x350330['isNew']&&_0x350330[_0x30aa2a(0x295)]),_0x18f524=_0x5b6319[_0x30aa2a(0x2be)](_0x3d261f=>!_0x3d261f[_0x30aa2a(0x1c0)]&&!_0x3d261f[_0x30aa2a(0x295)]),_0x3c8420=_0x11ab5e?_0x18461a:[],_0x3fb27e=_0x4578da[_0x30aa2a(0x266)](_0x4288af=>_0x4288af[_0x30aa2a(0x2a7)]),_0x571108=_0x3fb27e['filter'](_0x1a971e=>_0x1a971e[_0x30aa2a(0x1e7)]===_0x30aa2a(0x1cb)),_0x3c87e7=_0x3fb27e['filter'](_0x25f0d5=>_0x25f0d5[_0x30aa2a(0x1e7)]===_0x30aa2a(0x1ee)),_0x16ec0c=_0x3fb27e[_0x30aa2a(0x2be)](_0x42ee24=>_0x42ee24['type']===_0x30aa2a(0x2bc)),_0x480fbf=Array['from'](_0x1b4a0d)['sort'](),_0x62afb9=_0x431d33?![]:_0x56614f[_0x30aa2a(0x207)]>0x0||_0xd2d6db[_0x30aa2a(0x207)]>0x0||_0x2ebcb5[_0x30aa2a(0x207)]>0x0,_0x16a7b1=_0xaaef5c[_0x30aa2a(0x207)]>0x0||_0x3bb394['length']>0x0||_0x3c8420[_0x30aa2a(0x207)]>0x0,_0x2cde06=_0x431d33?![]:_0x3fb27e[_0x30aa2a(0x207)]>0x0,_0x7ebbcc=_0x480fbf[_0x30aa2a(0x207)]>0x0;return{'segments':{'new':_0x56614f,'changed':_0xd2d6db,'unchanged':_0x1072c4,'toDelete':_0x2ebcb5},'journeys':{'new':_0xaaef5c,'changed':_0x3bb394,'unchanged':_0x18f524,'toDelete':_0x3c8420},'activations':{'all':_0x3fb27e,'toCreate':_0x571108,'toUpdate':_0x3c87e7,'toDelete':_0x16ec0c},'folders':{'toCreate':_0x480fbf},'counts':{'segments':{'new':_0x56614f[_0x30aa2a(0x207)],'changed':_0xd2d6db[_0x30aa2a(0x207)],'unchanged':_0x1072c4[_0x30aa2a(0x207)],'toDelete':_0x2ebcb5[_0x30aa2a(0x207)]},'journeys':{'new':_0xaaef5c[_0x30aa2a(0x207)],'changed':_0x3bb394['length'],'unchanged':_0x18f524[_0x30aa2a(0x207)],'toDelete':_0x3c8420[_0x30aa2a(0x207)]},'activations':{'create':_0x571108[_0x30aa2a(0x207)],'update':_0x3c87e7[_0x30aa2a(0x207)],'delete':_0x16ec0c[_0x30aa2a(0x207)]},'folders':_0x480fbf[_0x30aa2a(0x207)]},'hasChanges':_0x62afb9||_0x16a7b1||_0x2cde06||_0x7ebbcc};}export async function buildPushExecutionContext(_0x54dafc,_0x49ffcd,_0x3b2556,_0x41a151,_0x2c4f8f,_0x519d38){const _0x132af3=a142_0x119b8a,_0x289455=extractRootFolderId(_0x3b2556),{pathToId:_0x39edd2,idToPath:_0x13ed8b}=buildFolderMaps(_0x2c4f8f),_0x5d2288=buildSegmentNameToIdMap(_0x41a151),_0x216830=new Map(),{batchAsync:_0x571cb5}=await import(_0x132af3(0x263)),[_0x3eb4d4,_0x38e543]=await Promise[_0x132af3(0x231)]([_0x54dafc[_0x132af3(0x273)][_0x132af3(0x20a)](),_0x54dafc['connection'][_0x132af3(0x1d6)](),((async()=>{!_0x519d38&&_0x41a151['length']>0x0&&await _0x571cb5(_0x41a151,async _0x16f051=>{const _0x386333=a142_0x3007,_0xc892b7=await _0x54dafc[_0x386333(0x1ea)][_0x386333(0x2bf)](_0x49ffcd,_0x16f051['id']);_0x216830[_0x386333(0x1e5)](_0x16f051['id'],_0xc892b7);});})())]),{emailToId:_0x4b506f,idToEmail:_0xf261f}=_0x3eb4d4,_0x50d4bb=buildConnectionMaps(_0x38e543);return{'rootFolderId':_0x289455,'folderPathToId':_0x39edd2,'folderIdToPath':_0x13ed8b,'segmentNameToId':_0x5d2288,'activationsBySegmentId':_0x216830,'emailToIdMap':_0x4b506f,'idToEmailMap':_0xf261f,'connectionNameToIdMap':_0x50d4bb[_0x132af3(0x24e)],'connectionIdToNameMap':_0x50d4bb[_0x132af3(0x2a8)],'connectionNameToTypeMap':_0x50d4bb[_0x132af3(0x2b7)]};}export function createPushYamlContextForBundle(_0x5d47ca,_0x152655,_0x11bc00,_0x1ad2f9,_0xded039,_0x1c2fcb,_0x474d25,_0x295344){const {existingLocalSegmentNames:_0x1d3f09,localExpandedRuleToNames:_0xd61fa}=_0x1ad2f9,_0x4f51ee=new Set(),_0x317062=new Map(),_0x4826b0=new Map(),_0x52303b=new Map(),_0x15eea2=createJumpTargetCache(),_0x58f304=new Map(),_0x52b3fc=new Map(),_0x4110fd=new Set();let _0xd5cbb3;const _0x50f83a=_0x16aab6=>{const _0x223b2d={'resolveSegment':async _0x4b9e3b=>{const _0x522685=a142_0x3007,_0x31319a=_0x52303b['get'](_0x4b9e3b);if(_0x31319a!==undefined)return{'name':_0x31319a,'isJourneyLocal':!![]};try{const _0x27e4c9=await fetchSegment(_0x5d47ca,_0x152655,_0x4b9e3b,_0x11bc00);if(!_0x27e4c9)throw new Error(_0x522685(0x2b2));const _0x25a966=generateJourneyLocalName(_0x27e4c9[_0x522685(0x1d5)]),_0x12a095=_0x27e4c9[_0x522685(0x213)]===SEGMENT_KIND_JOURNEY&&_0x25a966!==undefined;let _0x21be9c=_0x27e4c9[_0x522685(0x1d5)],_0x367785;if(_0x12a095&&_0x27e4c9['rule']){const _0x28b35c=apiRuleToYaml(_0x27e4c9['rule']);_0x52b3fc[_0x522685(0x1e5)](_0x4b9e3b,_0x28b35c);const _0x30bf68=async _0x5299f9=>{const _0x441d06=_0x522685,_0x360bc9=collectSegmentRefsFromRule(_0x5299f9);for(const _0x48ec74 of _0x360bc9){if(!_0x52b3fc[_0x441d06(0x215)](_0x48ec74))try{const _0x414ac4=await fetchSegment(_0x5d47ca,_0x152655,_0x48ec74,_0x11bc00);if(_0x414ac4?.[_0x441d06(0x209)]){const _0x53a2f3=apiRuleToYaml(_0x414ac4['rule']);_0x52b3fc['set'](_0x48ec74,_0x53a2f3),await _0x30bf68(_0x53a2f3);}}catch(_0x24a8aa){logger[_0x441d06(0x245)](_0x441d06(0x20b)+_0x48ec74+':\x20'+_0x24a8aa);}}};await _0x30bf68(_0x28b35c);const _0x1b307f=serializeExpandedRule(_0x28b35c,_0x52b3fc),_0x12a612=_0xd61fa[_0x522685(0x255)](_0x1b307f);if(_0x12a612&&_0x12a612[_0x522685(0x207)]>0x0){const _0x3866b9=_0x317062[_0x522685(0x255)](_0x1b307f)||0x0,_0x3be4dd=_0x12a612[_0x3866b9]||_0x12a612[_0x12a612[_0x522685(0x207)]-0x1];_0x317062['set'](_0x1b307f,_0x3866b9+0x1),_0x21be9c=_0x3be4dd,_0x4f51ee[_0x522685(0x1e8)](_0x21be9c),_0x52303b[_0x522685(0x1e5)](_0x4b9e3b,_0x21be9c);const _0x7de080=await resolveRuleSegmentRefs(_0x28b35c,async _0x2a9343=>{const _0x123564=_0x522685,_0x3d3b95=_0x52303b[_0x123564(0x255)](_0x2a9343);if(_0x3d3b95)return _0x3d3b95;const _0x1f95dd=await _0xd5cbb3[_0x123564(0x1de)](_0x2a9343);return _0x1f95dd[_0x123564(0x1d5)];});_0x367785={'description':_0x27e4c9[_0x522685(0x243)],'rule':_0x7de080};}else{const _0x43e561=_0x58f304[_0x522685(0x255)](_0x1b307f);if(_0x43e561)_0x21be9c=_0x43e561,_0x52303b[_0x522685(0x1e5)](_0x4b9e3b,_0x21be9c);else{if(_0x25a966){let _0x543090=_0x25a966,_0x1f8f42=0x2;while(_0x4f51ee[_0x522685(0x215)](_0x543090)||_0x1d3f09[_0x522685(0x215)](_0x543090)){_0x543090=_0x25a966+'_'+_0x1f8f42,_0x1f8f42++;}_0x4f51ee[_0x522685(0x1e8)](_0x543090),_0x21be9c=_0x543090;}_0x52303b[_0x522685(0x1e5)](_0x4b9e3b,_0x21be9c),_0x58f304[_0x522685(0x1e5)](_0x1b307f,_0x21be9c);const _0x165c62=await resolveRuleSegmentRefs(_0x28b35c,async _0x2b7113=>{const _0x49344c=_0x522685,_0x3943a9=_0x52303b['get'](_0x2b7113);if(_0x3943a9)return _0x3943a9;const _0x44c3d8=await _0xd5cbb3[_0x49344c(0x1de)](_0x2b7113);return _0x44c3d8[_0x49344c(0x1d5)];});_0x367785={'description':_0x27e4c9[_0x522685(0x243)],'rule':_0x165c62};}}}return{'name':_0x21be9c,'isJourneyLocal':_0x12a095,'definition':_0x367785};}catch(_0x57fdb2){return logger[_0x522685(0x245)](_0x522685(0x21c)+_0x4b9e3b+':\x20'+_0x57fdb2),{'name':_0x4b9e3b,'isJourneyLocal':![]};}},'resolveActivation':async _0xb83d64=>{const _0x124f3f=a142_0x3007,_0x491431=_0x4826b0[_0x124f3f(0x255)](_0xb83d64);if(_0x491431!==undefined)return{'name':_0x491431,'isJourneyLocal':!![]};try{let _0x4192e4=_0x474d25?.[_0x124f3f(0x255)](_0xb83d64);!_0x4192e4&&(_0x4192e4=await _0x5d47ca[_0x124f3f(0x1fa)]['getActivation'](_0x16aab6,_0xb83d64));const _0x144fd1=_0x4192e4['attributes'][_0x124f3f(0x24b)]['name']||_0xb83d64,_0x139078=sanitizeYamlKey(_0x144fd1)||'activation_'+_0xb83d64,_0x23a3bd=_0x139078;_0x4826b0[_0x124f3f(0x1e5)](_0xb83d64,_0x23a3bd);const _0x20b3bf=journeyActivationStepToYaml(_0x4192e4,_0xded039,_0x1c2fcb);return{'name':_0x23a3bd,'isJourneyLocal':!![],'definition':_0x20b3bf};}catch(_0x5c69de){return logger[_0x124f3f(0x245)](_0x124f3f(0x22b)+_0xb83d64+':\x20'+_0x5c69de),{'name':_0xb83d64,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x7a2ddd,_0xa6a694)=>resolveJumpTarget(_0x7a2ddd,_0xa6a694,_0x15eea2,async _0x27989f=>{const _0x420e5f=a142_0x3007,_0x2e502d=_0x295344?.[_0x420e5f(0x255)](_0x27989f);if(_0x2e502d)return _0x2e502d;return _0x5d47ca[_0x420e5f(0x1fa)][_0x420e5f(0x23d)](_0x27989f);})};return _0xd5cbb3=_0x223b2d,_0x223b2d;},_0x5e2d19=async _0x172206=>{const _0x50f282=a142_0x3007,{collectSegmentIdsFromJourneyApi:_0x4868c5}=await import('./journey-yaml.js'),{batchAsync:_0x1b38d1}=await import(_0x50f282(0x263)),_0x5a531=new Set();for(const _0xc17362 of _0x172206){let _0x2be179=_0x295344?.[_0x50f282(0x255)](_0xc17362);!_0x2be179&&(_0x2be179=await _0x5d47ca[_0x50f282(0x1fa)][_0x50f282(0x23d)](_0xc17362));const _0x311699=_0x4868c5(_0x2be179);for(const _0x1eb03f of _0x311699){_0x5a531['add'](_0x1eb03f);}}let _0x4ec6eb=Array[_0x50f282(0x1e0)](_0x5a531);while(_0x4ec6eb[_0x50f282(0x207)]>0x0){const _0x1dfa7d=_0x4ec6eb['filter'](_0x4b4610=>!_0x4110fd['has'](_0x4b4610));if(_0x1dfa7d[_0x50f282(0x207)]===0x0)break;const _0x4f45ab=await _0x1b38d1(_0x1dfa7d,async _0x8dae75=>{const _0x1d9d05=_0x50f282;_0x4110fd[_0x1d9d05(0x1e8)](_0x8dae75);const _0x3b4dc9=await fetchSegment(_0x5d47ca,_0x152655,_0x8dae75,_0x11bc00);if(!_0x3b4dc9)return null;return{'segmentId':_0x8dae75,'segment':_0x3b4dc9};},0xa),_0x5a7e13=new Set();for(const _0x462a5e of _0x4f45ab){if(!_0x462a5e?.[_0x50f282(0x1ea)]?.['rule'])continue;const _0x14f47d=apiRuleToYaml(_0x462a5e['segment'][_0x50f282(0x209)]);_0x52b3fc['set'](_0x462a5e[_0x50f282(0x278)],_0x14f47d);const _0x302832=collectSegmentRefsFromRule(_0x14f47d);for(const _0x2408e4 of _0x302832){!_0x4110fd[_0x50f282(0x215)](_0x2408e4)&&_0x5a7e13[_0x50f282(0x1e8)](_0x2408e4);}}_0x4ec6eb=Array[_0x50f282(0x1e0)](_0x5a7e13);}};return{'createYamlContext':_0x50f83a,'prefetchJourneySegments':_0x5e2d19};}export async function executePushSegments(_0x10ac81,_0x865481,_0xe40789,_0x3931bf,_0x2a22d5){const _0x419675=a142_0x119b8a,{segmentDefToCreateRequest:_0x286afd,segmentDefToUpdateRequest:_0x66458f}=await import(_0x419675(0x1c3)),_0x2e3bf3=_0xe40789[_0x419675(0x2a2)],_0x545212=0x5,_0x3bd82a=async _0x5e33f3=>{const _0x48ea38=_0x419675,_0xf3e7c3=_0x5e33f3['folderPath']?_0x2e3bf3['get'](_0x5e33f3['folderPath']):undefined;let _0x2fa58c;const _0x33be31={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x5c0abb=_0x5e33f3[_0x48ea38(0x257)];if(_0x5e33f3[_0x48ea38(0x257)][_0x48ea38(0x209)]){const _0x3848e9=createSegmentIdResolver(_0xe40789[_0x48ea38(0x1e3)],_0x5e33f3[_0x48ea38(0x257)][_0x48ea38(0x1d5)]),_0x4eb344=await resolveRuleSegmentIds(_0x5e33f3[_0x48ea38(0x257)][_0x48ea38(0x209)],_0x3848e9);_0x5c0abb={..._0x5e33f3[_0x48ea38(0x257)],'rule':_0x4eb344};}try{if(_0x5e33f3[_0x48ea38(0x1c0)]){_0x2a22d5[_0x48ea38(0x1fb)]?.({'type':_0x48ea38(0x1e1),'name':_0x5e33f3[_0x48ea38(0x257)]['name']});const _0x19b383=_0x286afd(_0x5c0abb,_0xf3e7c3),_0x52ee9d=await _0x2a22d5[_0x48ea38(0x241)](_0x48ea38(0x222)+_0x5e33f3[_0x48ea38(0x257)][_0x48ea38(0x1d5)]+'\x27...',()=>_0x10ac81['segment'][_0x48ea38(0x1c9)](_0x3931bf['parentId'],_0x19b383));_0x2fa58c=_0x52ee9d[_0x48ea38(0x284)]['id'],_0xe40789[_0x48ea38(0x1e3)][_0x48ea38(0x1e5)](_0x5e33f3[_0x48ea38(0x257)][_0x48ea38(0x1d5)],_0x2fa58c),_0x33be31['createdSegmentId']={'name':_0x5e33f3[_0x48ea38(0x257)][_0x48ea38(0x1d5)],'id':_0x2fa58c},_0x2a22d5[_0x48ea38(0x1fb)]?.({'type':'segment_created','name':_0x5e33f3[_0x48ea38(0x257)][_0x48ea38(0x1d5)],'segmentId':_0x2fa58c}),_0x2a22d5['logSuccess']?.(_0x48ea38(0x1fd)+_0x5e33f3[_0x48ea38(0x257)][_0x48ea38(0x1d5)]+'\x27'),_0x33be31[_0x48ea38(0x1dd)]=0x1;}else{if(_0x5e33f3[_0x48ea38(0x295)]){_0x2a22d5[_0x48ea38(0x1fb)]?.({'type':_0x48ea38(0x25b),'name':_0x5e33f3[_0x48ea38(0x257)][_0x48ea38(0x1d5)]});const _0xafda08=_0x66458f(_0x5c0abb);_0xf3e7c3!==_0x5e33f3[_0x48ea38(0x248)]?.['segmentFolderId']&&(_0xafda08['segmentFolderId']=_0xf3e7c3?parseInt(_0xf3e7c3,0xa):undefined),await _0x2a22d5[_0x48ea38(0x241)](_0x48ea38(0x2b8)+_0x5e33f3[_0x48ea38(0x257)]['name']+_0x48ea38(0x268),()=>_0x10ac81[_0x48ea38(0x1ea)][_0x48ea38(0x25f)](_0x3931bf[_0x48ea38(0x24a)],_0x5e33f3[_0x48ea38(0x248)]['id'],_0xafda08)),_0x2fa58c=_0x5e33f3[_0x48ea38(0x248)]['id'],_0x2a22d5[_0x48ea38(0x1fb)]?.({'type':_0x48ea38(0x226),'name':_0x5e33f3[_0x48ea38(0x257)][_0x48ea38(0x1d5)]}),_0x2a22d5[_0x48ea38(0x296)]?.('Updated\x20segment\x20\x27'+_0x5e33f3[_0x48ea38(0x257)][_0x48ea38(0x1d5)]+'\x27'),_0x33be31[_0x48ea38(0x1f1)]=0x1;}else _0x2fa58c=_0x5e33f3['existingSegment']['id'];}}catch(_0x24462d){const _0x253317=isHttp400Error(_0x24462d),_0x3cff19=_0x253317?ErrorCode[_0x48ea38(0x260)]:ErrorCode[_0x48ea38(0x1c8)],_0x2470e2=getErrorMessage(_0x24462d);throw new SDKError(_0x3cff19,_0x48ea38(0x23c)+(_0x5e33f3['isNew']?_0x48ea38(0x1cb):'update')+'\x20segment\x20from\x20file:\x20'+_0x5e33f3[_0x48ea38(0x1c1)]+_0x48ea38(0x225)+_0x2470e2,_0x24462d);}try{const _0xc08c69=await syncActivationsForSegment(_0x10ac81,_0x3931bf[_0x48ea38(0x24a)],_0x2fa58c,_0x5e33f3[_0x48ea38(0x257)][_0x48ea38(0x1d5)],_0x5e33f3[_0x48ea38(0x2a7)],_0x2a22d5,_0x5e33f3[_0x48ea38(0x1c1)]);_0x33be31['activations']=_0xc08c69;}catch(_0xbfe1b7){if(_0xbfe1b7 instanceof SDKError)throw _0xbfe1b7;throw new SDKError(ErrorCode[_0x48ea38(0x27b)],_0x48ea38(0x212)+_0x5e33f3[_0x48ea38(0x257)][_0x48ea38(0x1d5)]+_0x48ea38(0x227)+_0x5e33f3[_0x48ea38(0x1c1)]+_0x48ea38(0x225)+getErrorMessage(_0xbfe1b7),_0xbfe1b7);}return _0x33be31;},_0x36c58c=await batchAsync(_0x865481,_0x3bd82a,_0x545212),_0x3703fb={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x2fa2bd of _0x36c58c){_0x3703fb[_0x419675(0x1dd)]+=_0x2fa2bd[_0x419675(0x1dd)],_0x3703fb['updated']+=_0x2fa2bd[_0x419675(0x1f1)],_0x2fa2bd[_0x419675(0x28c)]&&_0x3703fb[_0x419675(0x2ad)][_0x419675(0x1e5)](_0x2fa2bd[_0x419675(0x28c)][_0x419675(0x1d5)],_0x2fa2bd[_0x419675(0x28c)]['id']),_0x3703fb['activations'][_0x419675(0x1dd)]+=_0x2fa2bd[_0x419675(0x293)][_0x419675(0x1dd)],_0x3703fb[_0x419675(0x293)][_0x419675(0x1f1)]+=_0x2fa2bd['activations'][_0x419675(0x1f1)],_0x3703fb[_0x419675(0x293)][_0x419675(0x211)]+=_0x2fa2bd['activations'][_0x419675(0x211)];}return _0x3703fb;}async function syncActivationsForSegment(_0x4fb354,_0x5ed1ef,_0x5ecf01,_0x20e22f,_0x2ffc24,_0x195937,_0x21fa7e){const _0x5b438f=a142_0x119b8a,_0x1ae6e4={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x199021 of _0x2ffc24){try{if(_0x199021[_0x5b438f(0x1e7)]===_0x5b438f(0x1cb)&&_0x199021[_0x5b438f(0x1f2)])_0x195937[_0x5b438f(0x1fb)]?.({'type':_0x5b438f(0x21b),'segmentName':_0x20e22f,'activationName':_0x199021[_0x5b438f(0x1d5)]}),await _0x195937[_0x5b438f(0x241)](_0x5b438f(0x1da)+_0x199021[_0x5b438f(0x1d5)]+_0x5b438f(0x268),()=>_0x4fb354[_0x5b438f(0x1ea)][_0x5b438f(0x249)](_0x5ed1ef,_0x5ecf01,_0x199021[_0x5b438f(0x1f2)])),_0x195937['onProgress']?.({'type':_0x5b438f(0x1ed),'segmentName':_0x20e22f,'activationName':_0x199021[_0x5b438f(0x1d5)]}),_0x195937[_0x5b438f(0x296)]?.(_0x5b438f(0x1d0)+_0x199021['name']+'\x27'),_0x1ae6e4['created']++;else{if(_0x199021[_0x5b438f(0x1e7)]===_0x5b438f(0x1ee)&&_0x199021[_0x5b438f(0x1f2)]&&_0x199021['existingActivation'])_0x195937[_0x5b438f(0x1fb)]?.({'type':_0x5b438f(0x21f),'segmentName':_0x20e22f,'activationName':_0x199021['name']}),await _0x195937[_0x5b438f(0x241)](_0x5b438f(0x2aa)+_0x199021[_0x5b438f(0x1d5)]+_0x5b438f(0x268),()=>_0x4fb354['segment'][_0x5b438f(0x26d)](_0x5ed1ef,_0x5ecf01,_0x199021[_0x5b438f(0x28b)]['id'],_0x199021['validatedRequest'])),_0x195937[_0x5b438f(0x1fb)]?.({'type':_0x5b438f(0x1c4),'segmentName':_0x20e22f,'activationName':_0x199021[_0x5b438f(0x1d5)]}),_0x195937[_0x5b438f(0x296)]?.(_0x5b438f(0x1d7)+_0x199021[_0x5b438f(0x1d5)]+'\x27'),_0x1ae6e4['updated']++;else _0x199021[_0x5b438f(0x1e7)]==='delete'&&_0x199021[_0x5b438f(0x28b)]&&(_0x195937['onProgress']?.({'type':'activation_deleting','segmentName':_0x20e22f,'activationName':_0x199021[_0x5b438f(0x1d5)]}),await _0x195937['withProgress'](_0x5b438f(0x1e2)+_0x199021[_0x5b438f(0x1d5)]+_0x5b438f(0x268),()=>_0x4fb354[_0x5b438f(0x1ea)][_0x5b438f(0x1ba)](_0x5ed1ef,_0x5ecf01,_0x199021[_0x5b438f(0x28b)]['id'])),_0x195937[_0x5b438f(0x1fb)]?.({'type':_0x5b438f(0x27d),'segmentName':_0x20e22f,'activationName':_0x199021[_0x5b438f(0x1d5)]}),_0x195937[_0x5b438f(0x269)]?.(_0x5b438f(0x270)+_0x199021[_0x5b438f(0x1d5)]+'\x27'),_0x1ae6e4['deleted']++);}}catch(_0x2a15e7){const _0x463ee2=isHttp400Error(_0x2a15e7),_0x1b3fb0=_0x463ee2?ErrorCode[_0x5b438f(0x1b9)]:ErrorCode[_0x5b438f(0x27b)],_0x21c9ff=getErrorMessage(_0x2a15e7);throw new SDKError(_0x1b3fb0,'Failed\x20to\x20'+_0x199021[_0x5b438f(0x1e7)]+_0x5b438f(0x277)+_0x199021[_0x5b438f(0x1d5)]+_0x5b438f(0x227)+_0x21fa7e+_0x5b438f(0x225)+_0x21c9ff,_0x2a15e7);}}return _0x1ae6e4;}export async function executePushFolders(_0xce7912,_0x585e4b,_0x52a133,_0x2c03ac,_0x106446){const _0xc0f244=a142_0x119b8a,_0x372d25=new Map(_0x52a133),_0x5798a1=sortFoldersByDepth(_0x585e4b);for(const _0x5de59e of _0x5798a1){const _0x3e0b12=_0x5de59e[_0xc0f244(0x29e)]('/'),_0x351fa4=_0x3e0b12[_0x3e0b12[_0xc0f244(0x207)]-0x1],_0x312efb=_0x3e0b12[_0xc0f244(0x25a)](0x0,-0x1)[_0xc0f244(0x265)]('/'),_0x24c341=_0x372d25[_0xc0f244(0x255)](_0x312efb);_0x106446['onProgress']?.({'type':_0xc0f244(0x1e4),'folder':_0x5de59e});const _0x5970fa={'name':_0x351fa4,'parentFolderId':_0x24c341},_0x2c2cd3=await _0x106446[_0xc0f244(0x241)](_0xc0f244(0x2bd)+_0x5de59e+_0xc0f244(0x268),()=>_0xce7912[_0xc0f244(0x1ea)][_0xc0f244(0x1ec)](_0x2c03ac[_0xc0f244(0x24a)],_0x5970fa));_0x372d25[_0xc0f244(0x1e5)](_0x5de59e,_0x2c2cd3[_0xc0f244(0x284)]['id']),_0x106446[_0xc0f244(0x1fb)]?.({'type':_0xc0f244(0x229),'folder':_0x5de59e,'folderId':_0x2c2cd3[_0xc0f244(0x284)]['id']}),_0x106446[_0xc0f244(0x236)]?.('Created\x20folder\x20\x27'+_0x5de59e+'\x27');}return _0x372d25;}export async function executePushSegmentDeletions(_0x2388da,_0x37563c,_0x264d6f){const _0x858e20=a142_0x119b8a;if(_0x37563c[_0x858e20(0x207)]===0x0)return 0x0;const {batchAsync:_0x51489d}=await import(_0x858e20(0x263)),_0x53ef0d=0x5,_0xd163d5=await _0x51489d(_0x37563c,async _0x2f0e89=>{const _0xc1b39c=_0x858e20;return _0x264d6f[_0xc1b39c(0x1fb)]?.({'type':_0xc1b39c(0x1cc),'name':_0x2f0e89[_0xc1b39c(0x1d5)]}),await _0x2388da[_0xc1b39c(0x1ea)]['deleteSegment'](_0x2f0e89['id']),_0x264d6f[_0xc1b39c(0x1fb)]?.({'type':_0xc1b39c(0x1cd),'name':_0x2f0e89['name']}),_0x264d6f['logDeleted']?.(_0xc1b39c(0x291)+_0x2f0e89[_0xc1b39c(0x1d5)]+'\x27'),0x1;},_0x53ef0d);return _0xd163d5[_0x858e20(0x20e)]((_0x30a12e,_0x3be94c)=>_0x30a12e+_0x3be94c,0x0);}export async function executePushJourneys(_0x3c4613,_0x315ad6,_0x4272f6,_0x5f3140,_0x494c4e){const _0x3dcefb=a142_0x119b8a,{journeyDefToRequest:_0x36a792}=await import('./journey-yaml.js'),{activationDefToCreateRequest:_0x189d7b,yamlRuleToApi:_0x10d7d7,validateSegmentRule:_0x220102}=await import(_0x3dcefb(0x1c3)),_0x1a9eb4={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x1baa63=new Map(_0x4272f6[_0x3dcefb(0x1e3)]),_0x5840e6=0x5;for(let _0x381257=0x0;_0x381257<_0x315ad6[_0x3dcefb(0x207)];_0x381257+=_0x5840e6){const _0x44da6c=_0x315ad6[_0x3dcefb(0x25a)](_0x381257,_0x381257+_0x5840e6),_0x254f7c=await Promise[_0x3dcefb(0x231)](_0x44da6c[_0x3dcefb(0x2b1)](async _0x1ea8f1=>{const _0x4ecce9=_0x3dcefb;if(!_0x1ea8f1[_0x4ecce9(0x1c0)]&&!_0x1ea8f1[_0x4ecce9(0x295)])return{'action':_0x4ecce9(0x1e9),'name':_0x1ea8f1[_0x4ecce9(0x257)][_0x4ecce9(0x1d5)],'journeyId':_0x1ea8f1[_0x4ecce9(0x299)]?.['id']};const _0x2b2a1f=_0x1ea8f1[_0x4ecce9(0x1f9)]?_0x4272f6['folderPathToId'][_0x4ecce9(0x255)](_0x1ea8f1[_0x4ecce9(0x1f9)]):undefined;_0x494c4e[_0x4ecce9(0x1fb)]?.({'type':_0x1ea8f1['isNew']?_0x4ecce9(0x201):_0x4ecce9(0x298),'name':_0x1ea8f1[_0x4ecce9(0x257)][_0x4ecce9(0x1d5)]});try{const _0x440ff7=await executeSingleJourneyPush(_0x3c4613,_0x1ea8f1,{..._0x4272f6,'segmentNameToId':_0x1baa63},{'parentId':_0x5f3140['parentId'],'rootFolderId':_0x5f3140['rootFolderId'],'folderId':_0x2b2a1f,'verbose':_0x5f3140['verbose']},_0x494c4e,{'journeyDefToRequest':_0x36a792,'activationDefToCreateRequest':_0x189d7b,'yamlRuleToApi':_0x10d7d7,'validateSegmentRule':_0x220102});for(const [_0x1534e9,_0x27f226]of _0x440ff7[_0x4ecce9(0x1db)]){_0x1baa63[_0x4ecce9(0x1e5)](_0x1534e9,_0x27f226),_0x1a9eb4[_0x4ecce9(0x1db)][_0x4ecce9(0x1e5)](_0x1534e9,_0x27f226);}if(_0x440ff7[_0x4ecce9(0x29c)]==='created')_0x494c4e['onProgress']?.({'type':_0x4ecce9(0x1ca),'name':_0x1ea8f1[_0x4ecce9(0x257)]['name'],'journeyId':_0x440ff7[_0x4ecce9(0x276)]}),_0x494c4e[_0x4ecce9(0x296)]?.(_0x4ecce9(0x282)+_0x1ea8f1['yamlConfig'][_0x4ecce9(0x1d5)]+'\x27'),_0x1a9eb4[_0x4ecce9(0x1dd)]++;else _0x440ff7[_0x4ecce9(0x29c)]===_0x4ecce9(0x1f1)&&(_0x494c4e[_0x4ecce9(0x1fb)]?.({'type':_0x4ecce9(0x26f),'name':_0x1ea8f1[_0x4ecce9(0x257)][_0x4ecce9(0x1d5)]}),_0x494c4e[_0x4ecce9(0x296)]?.('Updated\x20journey\x20\x27'+_0x1ea8f1[_0x4ecce9(0x257)]['name']+'\x27'),_0x1a9eb4[_0x4ecce9(0x1f1)]++);return{'action':_0x440ff7[_0x4ecce9(0x29c)],'name':_0x1ea8f1['yamlConfig'][_0x4ecce9(0x1d5)],'journeyId':_0x440ff7[_0x4ecce9(0x276)]};}catch(_0x4a4781){const _0x38b3d0=isHttp400Error(_0x4a4781),_0x595417=_0x38b3d0?ErrorCode[_0x4ecce9(0x279)]:ErrorCode[_0x4ecce9(0x23e)],_0x71cfdb=getErrorMessage(_0x4a4781);throw new SDKError(_0x595417,_0x4ecce9(0x23c)+(_0x1ea8f1['isNew']?'create':_0x4ecce9(0x1ee))+_0x4ecce9(0x294)+_0x1ea8f1['absolutePath']+_0x4ecce9(0x225)+_0x71cfdb,_0x4a4781);}}));_0x1a9eb4[_0x3dcefb(0x1dc)][_0x3dcefb(0x23a)](..._0x254f7c);}return _0x1a9eb4;}async function matchExistingJourneySegments(_0x4964ba,_0x4ec620,_0x35b07e,_0x400e59,_0x53b91c){const _0x59c368=a142_0x119b8a;if(!_0x4ec620[_0x59c368(0x299)]||!_0x4ec620[_0x59c368(0x257)][_0x59c368(0x1f7)])return;const _0x741a47=new Map(),_0x3cf898=new Set();for(const _0xb5d5b8 of Object[_0x59c368(0x29a)](_0x4ec620[_0x59c368(0x257)]['segments'])){const _0x2b47a8=generateDeterministicJourneySegmentName(_0x4ec620['yamlConfig'][_0x59c368(0x1d5)],_0xb5d5b8);_0x741a47['set'](_0x2b47a8,_0xb5d5b8),_0x3cf898[_0x59c368(0x1e8)](_0xb5d5b8);}const _0x17895a=[],_0x1acf2a=collectSegmentIdsFromJourneyApi(_0x4ec620[_0x59c368(0x299)]);for(const _0x123be9 of _0x1acf2a){const _0x5494cf=await fetchSegment(_0x4964ba,_0x35b07e,_0x123be9,_0x400e59);if(!_0x5494cf?.[_0x59c368(0x1d5)])continue;const _0xfec926=_0x741a47[_0x59c368(0x255)](_0x5494cf[_0x59c368(0x1d5)]);_0xfec926?(_0x53b91c[_0x59c368(0x1e5)](_0xfec926,_0x123be9),_0x3cf898[_0x59c368(0x2bc)](_0xfec926)):_0x17895a['push']({'id':_0x123be9,'seg':_0x5494cf});}if(_0x3cf898['size']>0x0&&_0x17895a[_0x59c368(0x207)]>0x0){const {localExpandedRuleToNames:_0x1aec61}=buildLocalExpandedRuleMappings(_0x4ec620[_0x59c368(0x257)]),_0x7cea12=new Map();for(const {id:_0x598327,seg:_0x47d5b2}of _0x17895a){if(_0x47d5b2[_0x59c368(0x209)]){const _0x26f026=apiRuleToYaml(_0x47d5b2[_0x59c368(0x209)]);_0x7cea12[_0x59c368(0x1e5)](_0x598327,_0x26f026);}}for(const {id:_0x3ce84e,seg:_0x22f829}of _0x17895a){if(!_0x22f829[_0x59c368(0x209)])continue;const _0x55ab96=_0x7cea12[_0x59c368(0x255)](_0x3ce84e);if(!_0x55ab96)continue;const _0x2e86d7=serializeExpandedRule(_0x55ab96,_0x7cea12),_0x86749=_0x1aec61[_0x59c368(0x255)](_0x2e86d7);if(_0x86749){const _0x2b880d=_0x86749[_0x59c368(0x240)](_0xb51de3=>_0x3cf898[_0x59c368(0x215)](_0xb51de3));_0x2b880d&&(_0x53b91c[_0x59c368(0x1e5)](_0x2b880d,_0x3ce84e),_0x3cf898[_0x59c368(0x2bc)](_0x2b880d),logger[_0x59c368(0x245)]('Matched\x20server\x20segment\x20\x27'+_0x22f829[_0x59c368(0x1d5)]+'\x27\x20to\x20local\x20\x27'+_0x2b880d+'\x27\x20by\x20rule\x20content'));}}}}async function executeSingleJourneyPush(_0x3b4182,_0x1f2bd6,_0x41e2d8,_0x343f43,_0x1b02cd,_0x23b2d){const _0x146cb6=a142_0x119b8a,{journeyDefToRequest:_0x45aaa5,activationDefToCreateRequest:_0x2db6be,yamlRuleToApi:_0x29c873,validateSegmentRule:_0x24bdea}=_0x23b2d,_0xc0fa1f=new Map(),_0x5ac523=new Map();recoverSegmentIdsFromPushRecovery(_0x1f2bd6,_0xc0fa1f,_0x41e2d8[_0x146cb6(0x1e3)]);const _0x4d445b=new Map(),_0x4c61ad=new Map(),_0x56dfa2=new Map();let _0x27f7e7;const _0x2c61ad=async()=>{const _0x4a66e4=_0x146cb6;if(_0x27f7e7)return;_0x27f7e7=new Map();if(!_0x1f2bd6[_0x4a66e4(0x299)])return;const _0x4f5dd6=await _0x3b4182[_0x4a66e4(0x1fa)][_0x4a66e4(0x2bf)](_0x1f2bd6[_0x4a66e4(0x299)]['id']);for(const _0xff05ad of _0x4f5dd6){const _0x44fe68=journeyActivationStepToYaml(_0xff05ad,_0x41e2d8[_0x4a66e4(0x29b)],_0x41e2d8['connectionIdToNameMap']),_0x1ef10d=activationSignature(_0x44fe68);!_0x27f7e7[_0x4a66e4(0x215)](_0x1ef10d)&&_0x27f7e7['set'](_0x1ef10d,_0xff05ad['id']),_0x44fe68[_0x4a66e4(0x1d5)]&&_0x5ac523[_0x4a66e4(0x1e5)](_0x44fe68[_0x4a66e4(0x1d5)],_0xff05ad['id']);}};await matchExistingJourneySegments(_0x3b4182,_0x1f2bd6,_0x343f43[_0x146cb6(0x24a)],_0x41e2d8[_0x146cb6(0x281)],_0x41e2d8[_0x146cb6(0x1e3)]);const _0x592680={'resolveSegmentId':async _0x414312=>{const _0x8443f2=_0x146cb6,_0x2b26ea=_0x41e2d8[_0x8443f2(0x1e3)][_0x8443f2(0x255)](_0x414312);if(!_0x2b26ea)throw new SDKError(ErrorCode[_0x8443f2(0x1bc)],_0x8443f2(0x2b0)+_0x414312+'\x20(referenced\x20in\x20journey\x20'+_0x1f2bd6[_0x8443f2(0x257)][_0x8443f2(0x1d5)]+')');return _0x2b26ea;},'resolveEmbeddedSegmentId':async(_0xe09e62,_0x950ccd)=>{const _0x1e6ec9=_0x146cb6,_0x100f97=_0x41e2d8[_0x1e6ec9(0x1e3)][_0x1e6ec9(0x255)](_0xe09e62);if(_0x100f97)return _0x100f97;const _0x3ba189=_0x41e2d8[_0x1e6ec9(0x281)][_0x1e6ec9(0x240)](_0xb161d2=>_0xb161d2['name']===_0xe09e62);if(_0x3ba189)return _0x41e2d8[_0x1e6ec9(0x1e3)][_0x1e6ec9(0x1e5)](_0xe09e62,_0x3ba189['id']),_0x3ba189['id'];if(_0x1f2bd6[_0x1e6ec9(0x1c0)]){const {stageName:_0x2c3d10,criteriaName:_0x5955cf}=findSegmentCriteriaLocation(_0x1f2bd6[_0x1e6ec9(0x257)],_0xe09e62);return _0x24bdea(_0xe09e62,_0x950ccd[_0x1e6ec9(0x209)]),_0x4c61ad['set'](_0xe09e62,{'definition':_0x950ccd,'stageName':_0x2c3d10,'criteriaName':_0x5955cf}),createPendingSegmentId(_0xe09e62);}const _0x507b5f=_0x1f2bd6[_0x1e6ec9(0x299)]?.['id'];if(!_0x507b5f)throw new SDKError(ErrorCode['INTERNAL'],_0x1e6ec9(0x29f));const _0x3d762a=_0x4d445b[_0x1e6ec9(0x255)](_0xe09e62);if(_0x3d762a)return _0x3d762a;const _0x20839=((async()=>{const _0x59fa80=_0x1e6ec9;_0x24bdea(_0xe09e62,_0x950ccd[_0x59fa80(0x209)]);const _0x123b49=generateDeterministicJourneySegmentName(_0x1f2bd6['yamlConfig'][_0x59fa80(0x1d5)],_0xe09e62),_0x5f311b=_0x41e2d8[_0x59fa80(0x281)][_0x59fa80(0x240)](_0x2e1185=>_0x2e1185['name']===_0x123b49),_0x504f1a=createSegmentIdResolver(_0x41e2d8[_0x59fa80(0x1e3)],_0xe09e62),_0x31ac50=await resolveRuleSegmentIds(_0x950ccd[_0x59fa80(0x209)],_0x504f1a);let _0x47d279;return _0x5f311b?(await _0x3b4182[_0x59fa80(0x1ea)][_0x59fa80(0x25f)](_0x343f43[_0x59fa80(0x24a)],_0x5f311b['id'],{'description':_0x950ccd[_0x59fa80(0x243)]||_0x59fa80(0x2a5)+_0xe09e62,'rule':_0x29c873(_0x31ac50,!![]),'countPopulation':!![]}),_0x47d279=_0x5f311b['id'],saveSegmentToPushRecovery(_0x1f2bd6[_0x59fa80(0x1c1)],_0x1f2bd6['yamlConfig'][_0x59fa80(0x1d5)],_0xe09e62,{'segmentId':_0x47d279,'uniqueServerName':_0x123b49,'createdAt':new Date()[_0x59fa80(0x1ce)]()})):_0x47d279=await createOrRecoverEmbeddedSegment(_0x3b4182,_0x1f2bd6,{'localName':_0xe09e62,'uniqueSegmentName':_0x123b49,'description':_0x950ccd[_0x59fa80(0x243)]||'Entry\x20criteria:\x20'+_0xe09e62,'journeyId':_0x507b5f,'resolvedRule':_0x31ac50,'parentId':_0x343f43['parentId'],'folderId':_0x343f43[_0x59fa80(0x233)]||''},_0x29c873),_0x41e2d8[_0x59fa80(0x1e3)][_0x59fa80(0x1e5)](_0xe09e62,_0x47d279),_0xc0fa1f['set'](_0xe09e62,_0x47d279),_0x47d279;})());_0x4d445b[_0x1e6ec9(0x1e5)](_0xe09e62,_0x20839);try{return await _0x20839;}finally{_0x4d445b[_0x1e6ec9(0x2bc)](_0xe09e62);}},'resolveActivationId':async _0x1843b5=>{const _0x8dabfe=_0x146cb6,_0x46b3d9=_0x5ac523[_0x8dabfe(0x255)](_0x1843b5);if(_0x46b3d9)return _0x46b3d9;if(_0x1f2bd6['existingJourney']){await _0x2c61ad();const _0x3f5448=_0x5ac523[_0x8dabfe(0x255)](_0x1843b5);if(_0x3f5448)return _0x3f5448;}throw new SDKError(ErrorCode[_0x8dabfe(0x23b)],_0x8dabfe(0x1ff)+_0x1843b5+_0x8dabfe(0x22d)+_0x1f2bd6[_0x8dabfe(0x257)][_0x8dabfe(0x1d5)]+_0x8dabfe(0x221)+_0x8dabfe(0x21e));},'resolveEmbeddedActivationId':async(_0x143653,_0x3e1e78)=>{const _0x3e18a2=_0x146cb6,_0x3315fb=_0x5ac523[_0x3e18a2(0x255)](_0x143653);if(_0x3315fb)return _0x3315fb;if(_0x1f2bd6['isNew'])return _0x56dfa2[_0x3e18a2(0x1e5)](_0x143653,_0x3e1e78),createPendingActivationId(_0x143653);if(_0x1f2bd6[_0x3e18a2(0x299)]){await _0x2c61ad();const _0x519fc4=_0x5ac523[_0x3e18a2(0x255)](_0x3e1e78[_0x3e18a2(0x1d5)]);if(_0x519fc4)return _0x5ac523[_0x3e18a2(0x1e5)](_0x143653,_0x519fc4),_0x519fc4;const _0x2204be=activationSignature(_0x3e1e78),_0x54c550=_0x27f7e7?.['get'](_0x2204be);if(_0x54c550)return _0x5ac523[_0x3e18a2(0x1e5)](_0x143653,_0x54c550),_0x54c550;const _0x456c5e=await _0x2db6be(_0x3e1e78,_0x41e2d8[_0x3e18a2(0x203)]),_0x5a682e={..._0x456c5e,..._0x3e1e78[_0x3e18a2(0x230)]!==undefined&&{'runAfterJourneyRefresh':_0x3e1e78[_0x3e18a2(0x230)]}},_0x441fe0=await _0x3b4182[_0x3e18a2(0x1fa)]['createActivation'](_0x1f2bd6[_0x3e18a2(0x299)]['id'],_0x5a682e);return _0x5ac523[_0x3e18a2(0x1e5)](_0x143653,_0x441fe0['id']),_0x441fe0['id'];}throw new SDKError(ErrorCode[_0x3e18a2(0x1fe)],_0x3e18a2(0x24c));},'resolveJourneyId':async _0x4b49c2=>{const _0x5ab159=_0x146cb6;try{return await _0x3b4182[_0x5ab159(0x1fa)][_0x5ab159(0x1df)](_0x343f43['parentId'],_0x4b49c2);}catch(_0x5e2bce){throw new SDKError(ErrorCode['NOT_FOUND'],_0x5ab159(0x2a3)+_0x4b49c2+_0x5ab159(0x2a9)+_0x1f2bd6[_0x5ab159(0x257)][_0x5ab159(0x1d5)]+'\x27)',_0x5e2bce);}},'resolveStageId':async(_0x14a8fd,_0x45efba)=>{const _0x5105ed=_0x146cb6,_0x1a997c=await _0x3b4182[_0x5105ed(0x1fa)]['getJourney'](_0x14a8fd),_0x71107d=_0x1a997c[_0x5105ed(0x206)][_0x5105ed(0x223)][_0x5105ed(0x240)](_0x89cd1d=>_0x89cd1d[_0x5105ed(0x1d5)]['toLowerCase']()===_0x45efba[_0x5105ed(0x202)]());if(!_0x71107d?.['id'])throw new SDKError(ErrorCode[_0x5105ed(0x23b)],_0x5105ed(0x216)+_0x45efba+_0x5105ed(0x238)+(_0x1a997c[_0x5105ed(0x206)]['journeyBundleName']||_0x1a997c[_0x5105ed(0x206)][_0x5105ed(0x1d5)])+'\x27');return _0x71107d['id'];}},_0x2e77ad=await _0x45aaa5(_0x1f2bd6[_0x146cb6(0x257)],_0x343f43[_0x146cb6(0x24a)],_0x592680),_0x43b432=_0x343f43['folderId']||_0x343f43[_0x146cb6(0x233)];_0x43b432&&(_0x2e77ad[_0x146cb6(0x1cf)]={'parentFolder':{'data':{'id':_0x43b432,'type':_0x146cb6(0x25c)}}});if(_0x1f2bd6[_0x146cb6(0x1c0)]){if(_0x4c61ad['size']>0x0||_0x56dfa2[_0x146cb6(0x274)]>0x0)return await executeThreeStepJourneyCreate(_0x3b4182,_0x1f2bd6,_0x2e77ad,{'pendingEmbeddedSegments':_0x4c61ad,'pendingEmbeddedActivations':_0x56dfa2,'embeddedSegmentNameToId':_0xc0fa1f,'journeyActivationNameToId':_0x5ac523},{..._0x343f43,'effectiveFolderId':_0x43b432},_0x41e2d8,_0x1b02cd,_0x23b2d);else{ensureJourneyDefaults(_0x2e77ad['attributes']);const _0x53212d=await _0x3b4182['journey'][_0x146cb6(0x1cb)](_0x2e77ad);return deletePushRecovery(_0x1f2bd6['absolutePath']),{'action':_0x146cb6(0x1dd),'journeyId':_0x53212d['id'],'embeddedSegmentNameToId':_0xc0fa1f};}}else{if(_0x1f2bd6[_0x146cb6(0x295)]&&_0x1f2bd6[_0x146cb6(0x299)]){_0x2e77ad['id']=_0x1f2bd6['existingJourney']['id'];const _0xf4275b=_0x2e77ad[_0x146cb6(0x206)];_0x1f2bd6[_0x146cb6(0x299)]['attributes']?.['journeyBundleName']&&(_0xf4275b['journeyBundleName']=_0x1f2bd6[_0x146cb6(0x299)]['attributes'][_0x146cb6(0x297)]);const _0x11bffb=_0x1f2bd6[_0x146cb6(0x299)]['attributes']?.[_0x146cb6(0x223)];return _0x11bffb&&_0x2e77ad[_0x146cb6(0x206)]['journeyStages']&&injectExistingStageIds(_0x2e77ad[_0x146cb6(0x206)][_0x146cb6(0x223)],_0x11bffb),ensureJourneyDefaults(_0xf4275b),await _0x3b4182[_0x146cb6(0x1fa)]['update'](_0x1f2bd6[_0x146cb6(0x299)]['id'],_0x2e77ad),deletePushRecovery(_0x1f2bd6['absolutePath']),{'action':_0x146cb6(0x1f1),'journeyId':_0x1f2bd6[_0x146cb6(0x299)]['id'],'embeddedSegmentNameToId':_0xc0fa1f};}}return deletePushRecovery(_0x1f2bd6[_0x146cb6(0x1c1)]),{'action':_0x146cb6(0x1e9),'journeyId':_0x1f2bd6[_0x146cb6(0x299)]?.['id'],'embeddedSegmentNameToId':_0xc0fa1f};}function findSegmentCriteriaLocation(_0x296073,_0x28a46e){const _0x26e7c3=a142_0x119b8a,_0x969d13=_0x296073[_0x26e7c3(0x2ac)]||_0x296073[_0x26e7c3(0x1f8)]?.[0x0]?.[_0x26e7c3(0x2ac)]||[];let _0xbc334d=_0x26e7c3(0x27e),_0x119cb6=_0x28a46e;const _0x4874aa=_0x296073['goal']||_0x296073['journeys']?.[0x0]?.['goal'];if(_0x4874aa?.[_0x26e7c3(0x1ea)]===_0x28a46e)return{'stageName':_0x26e7c3(0x1f5),'criteriaName':_0x4874aa['name']||_0x28a46e};_0x32e0ce:for(const _0x1f2b31 of _0x969d13){if(_0x1f2b31['entry_criteria']?.[_0x26e7c3(0x1ea)]===_0x28a46e){_0xbc334d=_0x1f2b31['name'],_0x119cb6=_0x1f2b31[_0x26e7c3(0x239)]['name']||_0x28a46e;break;}if(_0x1f2b31[_0x26e7c3(0x254)])for(const _0x17b853 of _0x1f2b31[_0x26e7c3(0x254)]){if(_0x17b853[_0x26e7c3(0x1e7)]===_0x26e7c3(0x2b9)&&_0x17b853['with']?.[_0x26e7c3(0x2af)])for(const _0xe4b7af of _0x17b853[_0x26e7c3(0x22f)][_0x26e7c3(0x2af)]){if(_0xe4b7af[_0x26e7c3(0x1ea)]===_0x28a46e){_0xbc334d=_0x1f2b31[_0x26e7c3(0x1d5)],_0x119cb6=_0xe4b7af[_0x26e7c3(0x1d5)]||_0x28a46e;break _0x32e0ce;}}}}return{'stageName':_0xbc334d,'criteriaName':_0x119cb6};}function a142_0x3007(_0xc1ae4e,_0x4ae4e5){_0xc1ae4e=_0xc1ae4e-0x1b9;const _0x2b21b0=a142_0x2b21();let _0x3007db=_0x2b21b0[_0xc1ae4e];return _0x3007db;}async function executeThreeStepJourneyCreate(_0x7becea,_0xb2f641,_0x1b2369,_0x5418c9,_0x3b894d,_0x2f0b84,_0x5465be,_0xf11fee){const _0x13b9d4=a142_0x119b8a,{activationDefToCreateRequest:_0x4450c0,yamlRuleToApi:_0x23df70}=_0xf11fee,{pendingEmbeddedSegments:_0x181fed,pendingEmbeddedActivations:_0x2931eb,embeddedSegmentNameToId:_0x10049c}=_0x5418c9,_0xfa2585=JSON[_0x13b9d4(0x2ab)](JSON['stringify'](_0x1b2369));ensureJourneyDefaults(_0xfa2585['attributes']),stripPendingIds(_0xfa2585);const _0x1178cd=await _0x7becea[_0x13b9d4(0x1fa)]['create'](_0xfa2585),_0x2929e3=_0x1178cd['id'],_0x621450=new Map();for(const _0x5c5aed of _0x1178cd[_0x13b9d4(0x206)]['journeyStages']){_0x621450[_0x13b9d4(0x1e5)](_0x5c5aed[_0x13b9d4(0x1d5)][_0x13b9d4(0x202)](),_0x5c5aed['id']);}recoverSegmentIdsFromPushRecovery(_0xb2f641,_0x10049c,_0x2f0b84[_0x13b9d4(0x1e3)]);for(const [_0xcb288c,{definition:_0x4dd65b}]of _0x181fed){if(_0x10049c[_0x13b9d4(0x215)](_0xcb288c)){_0x5465be[_0x13b9d4(0x1fb)]?.({'type':_0x13b9d4(0x252),'journeyName':_0xb2f641['yamlConfig'][_0x13b9d4(0x1d5)],'segmentName':_0xcb288c});continue;}const _0x5f1637=generateDeterministicJourneySegmentName(_0xb2f641[_0x13b9d4(0x257)][_0x13b9d4(0x1d5)],_0xcb288c);_0x5465be[_0x13b9d4(0x1fb)]?.({'type':_0x13b9d4(0x262),'journeyName':_0xb2f641[_0x13b9d4(0x257)][_0x13b9d4(0x1d5)],'segmentName':_0xcb288c});const _0x4007f0=createSegmentIdResolver(_0x2f0b84[_0x13b9d4(0x1e3)],_0xcb288c),_0x3927cc=await resolveRuleSegmentIds(_0x4dd65b[_0x13b9d4(0x209)],_0x4007f0),_0x424b97=await createOrRecoverEmbeddedSegment(_0x7becea,_0xb2f641,{'localName':_0xcb288c,'uniqueSegmentName':_0x5f1637,'description':_0x4dd65b[_0x13b9d4(0x243)]||_0x13b9d4(0x2a5)+_0xcb288c,'journeyId':_0x2929e3,'resolvedRule':_0x3927cc,'parentId':_0x3b894d[_0x13b9d4(0x24a)],'folderId':_0x3b894d[_0x13b9d4(0x208)]||''},_0x23df70);_0x10049c[_0x13b9d4(0x1e5)](_0xcb288c,_0x424b97),_0x2f0b84[_0x13b9d4(0x1e3)][_0x13b9d4(0x1e5)](_0xcb288c,_0x424b97),_0x5465be[_0x13b9d4(0x1fb)]?.({'type':_0x13b9d4(0x252),'journeyName':_0xb2f641[_0x13b9d4(0x257)]['name'],'segmentName':_0xcb288c});}const _0x109914=new Map();for(const [_0x138c18,_0x1f1b65]of _0x2931eb){_0x5465be['onProgress']?.({'type':_0x13b9d4(0x1d3),'journeyName':_0xb2f641[_0x13b9d4(0x257)][_0x13b9d4(0x1d5)],'activationName':_0x138c18});const _0x262068=await _0x4450c0(_0x1f1b65,_0x2f0b84['activationContext']),_0x3cc25a={..._0x262068,..._0x1f1b65[_0x13b9d4(0x230)]!==undefined&&{'runAfterJourneyRefresh':_0x1f1b65[_0x13b9d4(0x230)]}},_0x1b971e=await _0x7becea[_0x13b9d4(0x1fa)]['createActivation'](_0x2929e3,_0x3cc25a);_0x109914[_0x13b9d4(0x1e5)](_0x138c18,_0x1b971e['id']),_0x5418c9['journeyActivationNameToId'][_0x13b9d4(0x1e5)](_0x138c18,_0x1b971e['id']),_0x5465be[_0x13b9d4(0x1fb)]?.({'type':_0x13b9d4(0x1d8),'journeyName':_0xb2f641[_0x13b9d4(0x257)][_0x13b9d4(0x1d5)],'activationName':_0x138c18});}const _0x942075=JSON[_0x13b9d4(0x2ab)](JSON[_0x13b9d4(0x2a6)](_0x1b2369));return _0x942075['id']=_0x2929e3,ensureJourneyDefaults(_0x942075[_0x13b9d4(0x206)]),resolvePendingIdsInRequest(_0x942075,_0x1b2369,_0x621450,_0x10049c,_0x109914,_0x5465be),await _0x7becea[_0x13b9d4(0x1fa)][_0x13b9d4(0x1ee)](_0x2929e3,_0x942075),deletePushRecovery(_0xb2f641['absolutePath']),{'action':_0x13b9d4(0x1dd),'journeyId':_0x2929e3,'embeddedSegmentNameToId':_0x10049c};}export function stripWaitStepPendingIds(_0x3e7830){const _0x4cd8fd=a142_0x119b8a,_0x12bd6c=_0x3e7830[_0x4cd8fd(0x26b)]&&isPendingSegmentId(_0x3e7830[_0x4cd8fd(0x26b)]),_0xa17fb2=_0x3e7830[_0x4cd8fd(0x2b3)]?.[_0x4cd8fd(0x217)](_0x4cb3aa=>_0x4cb3aa[_0x4cd8fd(0x278)]&&isPendingSegmentId(_0x4cb3aa[_0x4cd8fd(0x278)]));(_0x12bd6c||_0xa17fb2)&&(_0x3e7830[_0x4cd8fd(0x224)]=_0x4cd8fd(0x2a1),_0x3e7830[_0x4cd8fd(0x200)]=0x1,_0x3e7830[_0x4cd8fd(0x24d)]=_0x4cd8fd(0x24f),delete _0x3e7830['conditionSegmentId'],delete _0x3e7830[_0x4cd8fd(0x2b5)],delete _0x3e7830[_0x4cd8fd(0x289)],delete _0x3e7830[_0x4cd8fd(0x2b3)]);}export function resolveWaitStepPendingIds(_0x6a11bf,_0x1e8431,_0x57b0e9,_0x109e8){const _0x3f1145=a142_0x119b8a;if(_0x1e8431[_0x3f1145(0x26b)]&&isPendingSegmentId(_0x1e8431['conditionSegmentId'])){const _0x360176=_0x57b0e9(_0x1e8431[_0x3f1145(0x26b)],_0x3f1145(0x2bb)+_0x109e8+_0x3f1145(0x23f));_0x360176&&(_0x6a11bf['waitStepType']='Condition',_0x6a11bf[_0x3f1145(0x26b)]=_0x360176,delete _0x6a11bf[_0x3f1145(0x200)],delete _0x6a11bf[_0x3f1145(0x24d)],_0x1e8431[_0x3f1145(0x2b5)]!==undefined&&(_0x6a11bf[_0x3f1145(0x2b5)]=_0x1e8431[_0x3f1145(0x2b5)]),_0x1e8431[_0x3f1145(0x289)]&&(_0x6a11bf[_0x3f1145(0x289)]=_0x1e8431[_0x3f1145(0x289)]));}if(_0x1e8431['conditions']){const _0x571b89=_0x1e8431[_0x3f1145(0x2b3)]['some'](_0x33b6fb=>_0x33b6fb[_0x3f1145(0x278)]&&isPendingSegmentId(_0x33b6fb[_0x3f1145(0x278)]));if(_0x571b89){const _0x2ac240=_0x1e8431[_0x3f1145(0x2b3)][_0x3f1145(0x2b1)](_0x5928a9=>{const _0x162c37=_0x3f1145;if(_0x5928a9[_0x162c37(0x278)]&&isPendingSegmentId(_0x5928a9[_0x162c37(0x278)])){const _0x57f2f8=_0x57b0e9(_0x5928a9[_0x162c37(0x278)],_0x162c37(0x2bb)+_0x109e8+'\x27\x20wait\x20condition');return{..._0x5928a9,'segmentId':_0x57f2f8||_0x5928a9['segmentId']};}return{..._0x5928a9};});_0x6a11bf[_0x3f1145(0x224)]='Condition',_0x6a11bf[_0x3f1145(0x2b3)]=_0x2ac240,delete _0x6a11bf[_0x3f1145(0x200)],delete _0x6a11bf[_0x3f1145(0x24d)],delete _0x6a11bf[_0x3f1145(0x26b)],delete _0x6a11bf[_0x3f1145(0x2b5)],delete _0x6a11bf[_0x3f1145(0x289)];}}}function stripPendingIds(_0xefc5f){const _0x5f4d6d=a142_0x119b8a;_0xefc5f[_0x5f4d6d(0x206)][_0x5f4d6d(0x1f5)]?.[_0x5f4d6d(0x278)]&&isPendingSegmentId(_0xefc5f[_0x5f4d6d(0x206)][_0x5f4d6d(0x1f5)][_0x5f4d6d(0x278)])&&delete _0xefc5f[_0x5f4d6d(0x206)]['goal'];for(const _0x357150 of _0xefc5f[_0x5f4d6d(0x206)]['journeyStages']||[]){_0x357150['entryCriteria']?.[_0x5f4d6d(0x278)]&&isPendingSegmentId(_0x357150[_0x5f4d6d(0x26a)][_0x5f4d6d(0x278)])&&delete _0x357150[_0x5f4d6d(0x26a)];_0x357150[_0x5f4d6d(0x237)]?.[_0x5f4d6d(0x278)]&&isPendingSegmentId(_0x357150[_0x5f4d6d(0x237)][_0x5f4d6d(0x278)])&&delete _0x357150['milestone'];_0x357150[_0x5f4d6d(0x256)]&&(_0x357150['exitCriterias']=_0x357150[_0x5f4d6d(0x256)][_0x5f4d6d(0x2be)](_0xb2b311=>!_0xb2b311['segmentId']||!isPendingSegmentId(_0xb2b311[_0x5f4d6d(0x278)])));if(_0x357150[_0x5f4d6d(0x254)])for(const _0x447dcf of Object[_0x5f4d6d(0x29a)](_0x357150[_0x5f4d6d(0x254)])){const _0x3554a9=_0x357150[_0x5f4d6d(0x254)][_0x447dcf];_0x3554a9[_0x5f4d6d(0x1e7)]===_0x5f4d6d(0x247)&&_0x3554a9[_0x5f4d6d(0x1bb)]&&isPendingActivationId(_0x3554a9['journeyActivationStepId'])&&(_0x3554a9['journeyActivationStepId']='');if(_0x3554a9[_0x5f4d6d(0x1e7)]==='DecisionPoint'&&_0x3554a9[_0x5f4d6d(0x2af)])for(const _0x8009df of _0x3554a9[_0x5f4d6d(0x2af)]){_0x8009df[_0x5f4d6d(0x278)]&&isPendingSegmentId(_0x8009df[_0x5f4d6d(0x278)])&&(_0x8009df[_0x5f4d6d(0x278)]='');}_0x3554a9['type']===_0x5f4d6d(0x22e)&&stripWaitStepPendingIds(_0x3554a9);}}}function resolvePendingIdsInRequest(_0x3d57c8,_0x208f0b,_0x2e0519,_0x46ec09,_0x415230,_0x5dd185){const _0x5b9f90=a142_0x119b8a,_0x2cd91d=(_0x3a7edf,_0x93874)=>{const _0x39c5ba=a142_0x3007;if(!isPendingSegmentId(_0x3a7edf))return _0x3a7edf;const _0x4a5a0c=extractPendingSegmentName(_0x3a7edf),_0x870831=_0x46ec09[_0x39c5ba(0x255)](_0x4a5a0c);return!_0x870831&&_0x5dd185[_0x39c5ba(0x246)]?.(_0x39c5ba(0x286)+_0x4a5a0c+_0x39c5ba(0x1bd)+_0x93874),_0x870831;};if(_0x3d57c8[_0x5b9f90(0x206)][_0x5b9f90(0x1f5)]?.[_0x5b9f90(0x278)]&&isPendingSegmentId(_0x3d57c8[_0x5b9f90(0x206)][_0x5b9f90(0x1f5)]['segmentId'])){const _0x4dbb66=_0x2cd91d(_0x3d57c8['attributes'][_0x5b9f90(0x1f5)]['segmentId'],_0x5b9f90(0x1eb));_0x4dbb66&&(_0x3d57c8[_0x5b9f90(0x206)][_0x5b9f90(0x1f5)][_0x5b9f90(0x278)]=_0x4dbb66);}for(const _0x7d2e7f of _0x3d57c8['attributes'][_0x5b9f90(0x223)]||[]){const _0x1acea4=_0x2e0519[_0x5b9f90(0x255)](_0x7d2e7f['name']['toLowerCase']());_0x1acea4&&(_0x7d2e7f['id']=_0x1acea4);if(_0x7d2e7f['entryCriteria']?.[_0x5b9f90(0x278)]&&isPendingSegmentId(_0x7d2e7f[_0x5b9f90(0x26a)][_0x5b9f90(0x278)])){const _0xf57f36=_0x2cd91d(_0x7d2e7f[_0x5b9f90(0x26a)][_0x5b9f90(0x278)],_0x5b9f90(0x2bb)+_0x7d2e7f[_0x5b9f90(0x1d5)]+_0x5b9f90(0x1e6));_0xf57f36&&(_0x7d2e7f['entryCriteria'][_0x5b9f90(0x278)]=_0xf57f36);}if(_0x7d2e7f[_0x5b9f90(0x256)])for(const _0x8a8650 of _0x7d2e7f[_0x5b9f90(0x256)]){if(_0x8a8650['segmentId']&&isPendingSegmentId(_0x8a8650['segmentId'])){const _0x3945d4=_0x2cd91d(_0x8a8650[_0x5b9f90(0x278)],_0x5b9f90(0x2bb)+_0x7d2e7f[_0x5b9f90(0x1d5)]+'\x27\x20exit\x20criteria');_0x3945d4&&(_0x8a8650[_0x5b9f90(0x278)]=_0x3945d4);}}if(_0x7d2e7f[_0x5b9f90(0x237)]?.[_0x5b9f90(0x278)]&&isPendingSegmentId(_0x7d2e7f['milestone'][_0x5b9f90(0x278)])){const _0x4d30e8=_0x2cd91d(_0x7d2e7f['milestone']['segmentId'],'stage\x20\x27'+_0x7d2e7f[_0x5b9f90(0x1d5)]+_0x5b9f90(0x250));_0x4d30e8&&(_0x7d2e7f[_0x5b9f90(0x237)][_0x5b9f90(0x278)]=_0x4d30e8);}if(_0x7d2e7f['steps']){const _0x242301=_0x59983b=>_0x208f0b[_0x5b9f90(0x206)][_0x5b9f90(0x223)]?.[_0x5b9f90(0x240)](_0x5434dd=>_0x5434dd['name'][_0x5b9f90(0x202)]()===_0x7d2e7f[_0x5b9f90(0x1d5)][_0x5b9f90(0x202)]())?.[_0x5b9f90(0x254)]?.[_0x59983b];for(const _0x4c1c48 of Object[_0x5b9f90(0x29a)](_0x7d2e7f[_0x5b9f90(0x254)])){const _0x1fe375=_0x7d2e7f['steps'][_0x4c1c48],_0x2ae32b=_0x242301(_0x4c1c48);if(_0x1fe375[_0x5b9f90(0x1e7)]===_0x5b9f90(0x247)&&_0x1fe375[_0x5b9f90(0x1bb)]&&(isPendingActivationId(_0x1fe375[_0x5b9f90(0x1bb)])||_0x1fe375[_0x5b9f90(0x1bb)]==='')){if(_0x2ae32b?.[_0x5b9f90(0x1bb)]&&isPendingActivationId(_0x2ae32b[_0x5b9f90(0x1bb)])){const _0x25b470=extractPendingActivationName(_0x2ae32b[_0x5b9f90(0x1bb)]),_0x31f601=_0x415230[_0x5b9f90(0x255)](_0x25b470);_0x31f601&&(_0x1fe375['journeyActivationStepId']=_0x31f601);}}if(_0x1fe375['type']===_0x5b9f90(0x261)&&_0x1fe375[_0x5b9f90(0x2af)]&&_0x2ae32b?.[_0x5b9f90(0x2af)])for(let _0x3ae288=0x0;_0x3ae288<_0x1fe375[_0x5b9f90(0x2af)][_0x5b9f90(0x207)];_0x3ae288++){const _0x5a6576=_0x1fe375[_0x5b9f90(0x2af)][_0x3ae288],_0x22ce1a=_0x2ae32b[_0x5b9f90(0x2af)][_0x3ae288];if(_0x22ce1a?.['segmentId']&&isPendingSegmentId(_0x22ce1a[_0x5b9f90(0x278)])){const _0x4c9f86=_0x2cd91d(_0x22ce1a[_0x5b9f90(0x278)],'stage\x20\x27'+_0x7d2e7f[_0x5b9f90(0x1d5)]+'\x27\x20decision\x20point\x20branch\x20\x27'+(_0x5a6576[_0x5b9f90(0x1d5)]||_0x3ae288)+'\x27');_0x4c9f86&&(_0x5a6576[_0x5b9f90(0x278)]=_0x4c9f86);}}_0x1fe375[_0x5b9f90(0x1e7)]===_0x5b9f90(0x22e)&&_0x2ae32b?.[_0x5b9f90(0x1e7)]===_0x5b9f90(0x22e)&&resolveWaitStepPendingIds(_0x1fe375,_0x2ae32b,_0x2cd91d,_0x7d2e7f['name']);}}}}
@@ -1 +1 @@
1
- function a143_0x54e1(_0x4da9ec,_0x2a9330){_0x4da9ec=_0x4da9ec-0xc3;const _0x57ddd7=a143_0x57dd();let _0x54e15c=_0x57ddd7[_0x4da9ec];return _0x54e15c;}(function(_0xba1141,_0x4e504c){const _0x49783b=a143_0x54e1,_0x13ad42=_0xba1141();while(!![]){try{const _0x4064f3=-parseInt(_0x49783b(0xd1))/0x1*(-parseInt(_0x49783b(0xc6))/0x2)+parseInt(_0x49783b(0xc4))/0x3*(parseInt(_0x49783b(0xce))/0x4)+-parseInt(_0x49783b(0xc9))/0x5+-parseInt(_0x49783b(0xcd))/0x6*(parseInt(_0x49783b(0xcb))/0x7)+-parseInt(_0x49783b(0xd2))/0x8+parseInt(_0x49783b(0xcc))/0x9+parseInt(_0x49783b(0xca))/0xa;if(_0x4064f3===_0x4e504c)break;else _0x13ad42['push'](_0x13ad42['shift']());}catch(_0x43424e){_0x13ad42['push'](_0x13ad42['shift']());}}}(a143_0x57dd,0x94ac2));function a143_0x57dd(){const _0xab8ebf=['has','add','2482410XFglEU','3430560pAtyYQ','4087489Eohzhc','8646129acNPGs','6xEdFqo','1170164SfICVR','set','name','505pwKrwj','8898200BzJbhb','parentFolderId','12hEfHiy','get','1298aFZaSQ'];a143_0x57dd=function(){return _0xab8ebf;};return a143_0x57dd();}export function buildFolderIdToPathMap(_0x3a7e0d){const _0x22f533=a143_0x54e1,_0x5d578f=new Map(),_0x417fe6=new Map();for(const _0x5b63b9 of _0x3a7e0d){_0x417fe6[_0x22f533(0xcf)](_0x5b63b9['id'],_0x5b63b9);}const _0x43483e=new Set();for(const _0x3e2896 of _0x3a7e0d){!_0x3e2896[_0x22f533(0xc3)]&&_0x43483e[_0x22f533(0xc8)](_0x3e2896['id']);}function _0x2791d2(_0x2a1a94){const _0x3e2297=_0x22f533;if(_0x5d578f['has'](_0x2a1a94['id']))return _0x5d578f[_0x3e2297(0xc5)](_0x2a1a94['id']);if(_0x43483e[_0x3e2297(0xc7)](_0x2a1a94['id']))return _0x5d578f['set'](_0x2a1a94['id'],''),'';if(_0x2a1a94[_0x3e2297(0xc3)]){const _0x1f5b10=_0x417fe6[_0x3e2297(0xc5)](_0x2a1a94[_0x3e2297(0xc3)]);if(_0x1f5b10){const _0x37a1be=_0x2791d2(_0x1f5b10),_0x422052=_0x37a1be?_0x37a1be+'/'+_0x2a1a94[_0x3e2297(0xd0)]:_0x2a1a94[_0x3e2297(0xd0)];return _0x5d578f[_0x3e2297(0xcf)](_0x2a1a94['id'],_0x422052),_0x422052;}}const _0x1631f0=_0x2a1a94[_0x3e2297(0xd0)];return _0x5d578f[_0x3e2297(0xcf)](_0x2a1a94['id'],_0x1631f0),_0x1631f0;}for(const _0x34d997 of _0x3a7e0d){_0x2791d2(_0x34d997);}return _0x5d578f;}export function buildFolderPathToIdMap(_0x3c4dd8){const _0x12131b=a143_0x54e1,_0x5263af=new Map(),_0x52dcb0=new Map();for(const _0xa0d6af of _0x3c4dd8){_0x52dcb0[_0x12131b(0xcf)](_0xa0d6af['id'],_0xa0d6af);}const _0x164ce8=new Set();for(const _0x4708d0 of _0x3c4dd8){!_0x4708d0[_0x12131b(0xc3)]&&_0x164ce8['add'](_0x4708d0['id']);}function _0x134528(_0xbc3d63){const _0x4d00ea=_0x12131b;if(_0x164ce8[_0x4d00ea(0xc7)](_0xbc3d63['id']))return'';if(_0xbc3d63[_0x4d00ea(0xc3)]){const _0x16a0e3=_0x52dcb0['get'](_0xbc3d63['parentFolderId']);if(_0x16a0e3){const _0x5983d7=_0x134528(_0x16a0e3);return _0x5983d7?_0x5983d7+'/'+_0xbc3d63[_0x4d00ea(0xd0)]:_0xbc3d63[_0x4d00ea(0xd0)];}}return _0xbc3d63['name'];}for(const _0x572355 of _0x3c4dd8){const _0x51f74a=_0x134528(_0x572355);_0x5263af[_0x12131b(0xcf)](_0x51f74a,_0x572355['id']);}return _0x5263af;}export function buildFolderMaps(_0x3ff2dd){const _0x236238=a143_0x54e1,_0x2af94d=buildFolderIdToPathMap(_0x3ff2dd),_0x3c1205=new Map();for(const [_0x129358,_0x2ba121]of _0x2af94d){_0x3c1205[_0x236238(0xcf)](_0x2ba121,_0x129358);}return{'idToPath':_0x2af94d,'pathToId':_0x3c1205};}export function getFolderPath(_0x335d64,_0x4bf948){const _0x387de7=a143_0x54e1;if(!_0x335d64)return'';return _0x4bf948[_0x387de7(0xc5)](_0x335d64)??'';}
1
+ (function(_0x1db703,_0xc5973){const _0x2c5519=a143_0x27ea,_0x2dd321=_0x1db703();while(!![]){try{const _0x4f3ace=parseInt(_0x2c5519(0x1e7))/0x1+parseInt(_0x2c5519(0x1eb))/0x2+parseInt(_0x2c5519(0x1f0))/0x3*(parseInt(_0x2c5519(0x1ee))/0x4)+-parseInt(_0x2c5519(0x1e5))/0x5+-parseInt(_0x2c5519(0x1f2))/0x6*(-parseInt(_0x2c5519(0x1f4))/0x7)+-parseInt(_0x2c5519(0x1ea))/0x8*(-parseInt(_0x2c5519(0x1ec))/0x9)+-parseInt(_0x2c5519(0x1e9))/0xa*(parseInt(_0x2c5519(0x1f1))/0xb);if(_0x4f3ace===_0xc5973)break;else _0x2dd321['push'](_0x2dd321['shift']());}catch(_0x972687){_0x2dd321['push'](_0x2dd321['shift']());}}}(a143_0x5851,0x9c1c3));function a143_0x27ea(_0x523f84,_0x1c6452){_0x523f84=_0x523f84-0x1e4;const _0x585159=a143_0x5851();let _0x27ea3c=_0x585159[_0x523f84];return _0x27ea3c;}export function buildFolderIdToPathMap(_0x199edf){const _0x256e66=a143_0x27ea,_0x1a20e7=new Map(),_0x249bc9=new Map();for(const _0x20bcec of _0x199edf){_0x249bc9['set'](_0x20bcec['id'],_0x20bcec);}const _0x2ea369=new Set();for(const _0x24534a of _0x199edf){!_0x24534a[_0x256e66(0x1e8)]&&_0x2ea369[_0x256e66(0x1e4)](_0x24534a['id']);}function _0x1d919d(_0x31c96d){const _0x140825=_0x256e66;if(_0x1a20e7[_0x140825(0x1f3)](_0x31c96d['id']))return _0x1a20e7[_0x140825(0x1ef)](_0x31c96d['id']);if(_0x2ea369[_0x140825(0x1f3)](_0x31c96d['id']))return _0x1a20e7[_0x140825(0x1e6)](_0x31c96d['id'],''),'';if(_0x31c96d[_0x140825(0x1e8)]){const _0x4ce514=_0x249bc9[_0x140825(0x1ef)](_0x31c96d[_0x140825(0x1e8)]);if(_0x4ce514){const _0x27181c=_0x1d919d(_0x4ce514),_0x57a20d=_0x27181c?_0x27181c+'/'+_0x31c96d['name']:_0x31c96d['name'];return _0x1a20e7[_0x140825(0x1e6)](_0x31c96d['id'],_0x57a20d),_0x57a20d;}}const _0x3e079b=_0x31c96d[_0x140825(0x1ed)];return _0x1a20e7['set'](_0x31c96d['id'],_0x3e079b),_0x3e079b;}for(const _0x1f5a6a of _0x199edf){_0x1d919d(_0x1f5a6a);}return _0x1a20e7;}function a143_0x5851(){const _0x38085f=['2407160DKnvnw','add','20570bjkurk','set','487854EsKdZI','parentFolderId','5490vhzSDn','161488aPOMZe','2132394gtKvAy','54vBTKQv','name','472tsxTtB','get','6618GXQLvY','39666BKJTnW','12Ruyvhm','has'];a143_0x5851=function(){return _0x38085f;};return a143_0x5851();}export function buildFolderPathToIdMap(_0x2790aa){const _0x1522d8=a143_0x27ea,_0x2657b8=new Map(),_0x400455=new Map();for(const _0x257ab8 of _0x2790aa){_0x400455[_0x1522d8(0x1e6)](_0x257ab8['id'],_0x257ab8);}const _0x58f0a8=new Set();for(const _0xc212ad of _0x2790aa){!_0xc212ad[_0x1522d8(0x1e8)]&&_0x58f0a8[_0x1522d8(0x1e4)](_0xc212ad['id']);}function _0x81d772(_0x195d97){const _0x1f41ff=_0x1522d8;if(_0x58f0a8[_0x1f41ff(0x1f3)](_0x195d97['id']))return'';if(_0x195d97[_0x1f41ff(0x1e8)]){const _0xd3ae2d=_0x400455['get'](_0x195d97[_0x1f41ff(0x1e8)]);if(_0xd3ae2d){const _0x39b9cc=_0x81d772(_0xd3ae2d);return _0x39b9cc?_0x39b9cc+'/'+_0x195d97[_0x1f41ff(0x1ed)]:_0x195d97['name'];}}return _0x195d97[_0x1f41ff(0x1ed)];}for(const _0x1b01a2 of _0x2790aa){const _0x8bd74=_0x81d772(_0x1b01a2);_0x2657b8[_0x1522d8(0x1e6)](_0x8bd74,_0x1b01a2['id']);}return _0x2657b8;}export function buildFolderMaps(_0x4c1953){const _0x3b4cf6=a143_0x27ea,_0x1b86ea=buildFolderIdToPathMap(_0x4c1953),_0x19c569=new Map();for(const [_0x830ec,_0x597256]of _0x1b86ea){_0x19c569[_0x3b4cf6(0x1e6)](_0x597256,_0x830ec);}return{'idToPath':_0x1b86ea,'pathToId':_0x19c569};}export function getFolderPath(_0x513b1f,_0x1152ad){if(!_0x513b1f)return'';return _0x1152ad['get'](_0x513b1f)??'';}
@@ -1 +1 @@
1
- (function(_0x694631,_0x2d97af){const _0x5dda67=a144_0x3c03,_0x2d59bc=_0x694631();while(!![]){try{const _0x54809b=-parseInt(_0x5dda67(0x98))/0x1*(-parseInt(_0x5dda67(0x73))/0x2)+-parseInt(_0x5dda67(0x82))/0x3*(-parseInt(_0x5dda67(0x74))/0x4)+parseInt(_0x5dda67(0x87))/0x5*(parseInt(_0x5dda67(0x99))/0x6)+parseInt(_0x5dda67(0x7a))/0x7+-parseInt(_0x5dda67(0x91))/0x8+-parseInt(_0x5dda67(0x80))/0x9+parseInt(_0x5dda67(0x7c))/0xa*(-parseInt(_0x5dda67(0x8a))/0xb);if(_0x54809b===_0x2d97af)break;else _0x2d59bc['push'](_0x2d59bc['shift']());}catch(_0x31fc37){_0x2d59bc['push'](_0x2d59bc['shift']());}}}(a144_0x3de9,0x34c4a));import a144_0x3bbd29 from'path';import{parse as a144_0x3c12f0}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x1f6e36){const _0x217084=a144_0x3c03;if(!_0x1f6e36||_0x1f6e36[_0x217084(0x7f)]()==='')throw new Error(_0x217084(0x97));const _0x538a3d=_0x1f6e36[_0x217084(0x7f)]();if(_0x538a3d==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x1f6e36};const _0x108735=_0x538a3d[_0x217084(0x93)]('/')?_0x538a3d[_0x217084(0x89)](0x1):_0x538a3d,_0x3b64b4=_0x108735['split']('/')[_0x217084(0x78)](_0x496186=>_0x496186!=='');if(_0x3b64b4[_0x217084(0x9b)]===0x0)throw new Error(_0x217084(0x83));const _0x21c38c=_0x538a3d['startsWith']('/')||!isRelativePathSegment(_0x3b64b4[0x0]);for(const _0xdf891 of _0x3b64b4){validatePathSegment(_0xdf891);}return{'segments':_0x3b64b4,'isAbsolute':_0x21c38c,'raw':_0x1f6e36};}function a144_0x3de9(){const _0x23e9e9=['6XMDjVC','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','exists','parse','journey','10tpIZbK','pop','substring','4110227yOeegQ','type','readFile','resolve','Relative\x20path\x20cannot\x20be\x20empty','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','33912lXuweG','Path\x20segment\x20cannot\x20be\x20empty','startsWith','tdx.json','No\x20tdx.json\x20found\x20for\x20file:\x20','push','Path\x20cannot\x20be\x20empty','378413jbvZmW','823002ZoHUbY','.yml','length','Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.','raw','join','isAbsolute','parent_segment','2ydHrer','504440vxTEBu','dirname','Cannot\x20navigate\x20above\x20root','relative','filter','File\x20not\x20found:\x20','2139123tVgwrj','segments','20VkjNWO','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','.yaml','trim','2185785nqLbVM','endsWith'];a144_0x3de9=function(){return _0x23e9e9;};return a144_0x3de9();}function isRelativePathSegment(_0xa77d8d){return _0xa77d8d==='.'||_0xa77d8d==='..';}function a144_0x3c03(_0x1a70f8,_0x458cec){_0x1a70f8=_0x1a70f8-0x6f;const _0x3de902=a144_0x3de9();let _0x3c0373=_0x3de902[_0x1a70f8];return _0x3c0373;}function validatePathSegment(_0x19546f){const _0x35b843=a144_0x3c03;if(_0x19546f==='')throw new Error(_0x35b843(0x92));if(_0x19546f==='.'||_0x19546f==='..')return;if(/[\x00-\x1F\x7F]/['test'](_0x19546f))throw new Error(_0x35b843(0x8f)+_0x19546f);if(_0x19546f!==_0x19546f[_0x35b843(0x7f)]()){}}export function validatePath(_0x520f7d){const _0x36af3a=a144_0x3c03;if(_0x520f7d['segments'][_0x36af3a(0x9b)]===0x0&&!_0x520f7d['isAbsolute'])throw new Error(_0x36af3a(0x8e));if(_0x520f7d[_0x36af3a(0x71)]){if(_0x520f7d[_0x36af3a(0x7b)][0x0]==='..')throw new Error('Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22');let _0x342562=0x0;for(const _0xfa79a2 of _0x520f7d[_0x36af3a(0x7b)]){if(_0xfa79a2==='..'){if(_0x342562===0x0)throw new Error('Path\x20attempts\x20to\x20navigate\x20above\x20root');_0x342562--;}else _0xfa79a2!=='.'&&_0x342562++;}}}export function joinPaths(_0x273b1c,_0x2f54c0){const _0x3b9d48=a144_0x3c03;if(!_0x273b1c||_0x273b1c==='/')return _0x2f54c0;if(!_0x2f54c0||_0x2f54c0==='.')return _0x273b1c;if(_0x2f54c0[_0x3b9d48(0x93)]('/'))return _0x2f54c0;const _0x3fcc65=parsePath(_0x273b1c),_0x1ec047=parsePath(_0x2f54c0),_0x2bc7c8=[..._0x3fcc65[_0x3b9d48(0x7b)]];for(const _0x3fe649 of _0x1ec047[_0x3b9d48(0x7b)]){if(_0x3fe649==='.')continue;else{if(_0x3fe649==='..'){if(_0x2bc7c8[_0x3b9d48(0x9b)]===0x0)throw new Error(_0x3b9d48(0x76));_0x2bc7c8[_0x3b9d48(0x88)]();}else _0x2bc7c8[_0x3b9d48(0x96)](_0x3fe649);}}const _0x339708=_0x2bc7c8['join']('/');return _0x3fcc65[_0x3b9d48(0x6f)][_0x3b9d48(0x93)]('/')?'/'+_0x339708:_0x339708;}export function normalizePath(_0x3acee3){const _0x5100ac=a144_0x3c03,_0x1d2892=parsePath(_0x3acee3),_0x52e015=[];for(const _0x33268b of _0x1d2892[_0x5100ac(0x7b)]){if(_0x33268b==='.')continue;else{if(_0x33268b==='..'){if(_0x52e015[_0x5100ac(0x9b)]===0x0){if(_0x1d2892[_0x5100ac(0x71)])throw new Error(_0x5100ac(0x76));_0x52e015[_0x5100ac(0x96)]('..');}else _0x52e015[_0x52e015[_0x5100ac(0x9b)]-0x1]==='..'?_0x52e015[_0x5100ac(0x96)]('..'):_0x52e015[_0x5100ac(0x88)]();}else _0x52e015[_0x5100ac(0x96)](_0x33268b);}}if(_0x52e015[_0x5100ac(0x9b)]===0x0)return _0x1d2892[_0x5100ac(0x71)]?'/':'.';const _0x542ed4=_0x52e015['join']('/');return _0x1d2892[_0x5100ac(0x6f)][_0x5100ac(0x93)]('/')?'/'+_0x542ed4:_0x542ed4;}export function getParentPath(_0x2c06d9){const _0x337e98=a144_0x3c03,_0x43daae=parsePath(_0x2c06d9);if(_0x43daae[_0x337e98(0x7b)][_0x337e98(0x9b)]<=0x1)return'/';const _0x48e127=_0x43daae[_0x337e98(0x7b)]['slice'](0x0,-0x1)[_0x337e98(0x70)]('/');return _0x43daae[_0x337e98(0x6f)][_0x337e98(0x93)]('/')?'/'+_0x48e127:_0x48e127;}export function getBaseName(_0x30548a){const _0x4017a1=a144_0x3c03,_0x4b4244=parsePath(_0x30548a);return _0x4b4244[_0x4017a1(0x7b)][_0x4b4244[_0x4017a1(0x7b)][_0x4017a1(0x9b)]-0x1]||'';}export function isChildPath(_0x1df960,_0x5738ce){const _0x3944e5=a144_0x3c03,_0x4a537=parsePath(_0x1df960),_0x288da6=parsePath(_0x5738ce);if(_0x4a537[_0x3944e5(0x7b)][_0x3944e5(0x9b)]<=_0x288da6[_0x3944e5(0x7b)][_0x3944e5(0x9b)])return![];for(let _0x382f63=0x0;_0x382f63<_0x288da6[_0x3944e5(0x7b)][_0x3944e5(0x9b)];_0x382f63++){if(_0x4a537[_0x3944e5(0x7b)][_0x382f63]!==_0x288da6['segments'][_0x382f63])return![];}return!![];}export function splitPath(_0x516f7a){const _0x5084e4=a144_0x3c03,_0x1028bb=parsePath(_0x516f7a);if(_0x1028bb[_0x5084e4(0x7b)]['length']===0x0)throw new Error('Cannot\x20split\x20empty\x20path');if(_0x1028bb[_0x5084e4(0x7b)][_0x5084e4(0x9b)]===0x1)return{'parent':_0x1028bb[_0x5084e4(0x7b)][0x0]};return{'parent':_0x1028bb['segments'][0x0],'child':_0x1028bb[_0x5084e4(0x7b)]['slice'](0x1)[_0x5084e4(0x70)]('/')};}export function isYamlFilePath(_0xa37ac8){const _0x4e112d=a144_0x3c03;return _0xa37ac8['endsWith'](_0x4e112d(0x9a))||_0xa37ac8[_0x4e112d(0x81)](_0x4e112d(0x7e));}export async function resolveYamlFilePath(_0x5f5622,_0x118ceb=nodeFileSystem){const _0x5e4e3e=a144_0x3c03,_0x5e0809=a144_0x3bbd29[_0x5e4e3e(0x8d)](_0x5f5622);if(!await _0x118ceb[_0x5e4e3e(0x84)](_0x5e0809))throw new Error(_0x5e4e3e(0x79)+_0x5f5622);let _0x33328e=a144_0x3bbd29['dirname'](_0x5e0809),_0x13d295=null,_0x19082b=null;const _0x39084d=a144_0x3bbd29[_0x5e4e3e(0x85)](_0x33328e)['root'];while(_0x33328e!==_0x39084d){const _0x2d9562=a144_0x3bbd29[_0x5e4e3e(0x70)](_0x33328e,_0x5e4e3e(0x94));if(await _0x118ceb[_0x5e4e3e(0x84)](_0x2d9562)){_0x13d295=_0x2d9562,_0x19082b=_0x33328e;break;}_0x33328e=a144_0x3bbd29[_0x5e4e3e(0x75)](_0x33328e);}if(!_0x13d295||!_0x19082b)throw new Error(_0x5e4e3e(0x95)+_0x5f5622+'\x0a'+_0x5e4e3e(0x9c));const _0x4d5d2e=await _0x118ceb[_0x5e4e3e(0x8c)](_0x13d295),_0x27f305=JSON['parse'](_0x4d5d2e),_0x357a18=_0x27f305[_0x5e4e3e(0x72)];if(!_0x357a18)throw new Error(_0x5e4e3e(0x90));const _0x439c33=await _0x118ceb[_0x5e4e3e(0x8c)](_0x5e0809),_0x1d73ea=a144_0x3c12f0(_0x439c33),_0x549718=_0x1d73ea['name'];if(!_0x549718)throw new Error(_0x5e4e3e(0x7d)+_0x5f5622);const _0x2b429b=_0x1d73ea[_0x5e4e3e(0x8b)]===_0x5e4e3e(0x86)?_0x5e4e3e(0x86):'segment',_0x54b0f9=a144_0x3bbd29[_0x5e4e3e(0x77)](_0x19082b,_0x5e0809),_0x425dfe=a144_0x3bbd29['dirname'](_0x54b0f9),_0x4ab2d9=_0x425dfe==='.'?'':_0x425dfe['replace'](/\\/g,'/'),_0x2d5030=_0x4ab2d9?_0x357a18+'/'+_0x4ab2d9+'/'+_0x549718:_0x357a18+'/'+_0x549718;return{'parentSegment':_0x357a18,'segmentName':_0x549718,'folderPath':_0x4ab2d9,'fullPath':_0x2d5030,'resourceType':_0x2b429b,'content':_0x439c33};}
1
+ (function(_0x5d3dea,_0x34d4f6){const _0x2c5e3d=a144_0x4823,_0x4e3839=_0x5d3dea();while(!![]){try{const _0x1f0bfd=parseInt(_0x2c5e3d(0x185))/0x1*(-parseInt(_0x2c5e3d(0x180))/0x2)+parseInt(_0x2c5e3d(0x170))/0x3*(parseInt(_0x2c5e3d(0x16f))/0x4)+parseInt(_0x2c5e3d(0x17e))/0x5*(-parseInt(_0x2c5e3d(0x17f))/0x6)+-parseInt(_0x2c5e3d(0x162))/0x7+parseInt(_0x2c5e3d(0x167))/0x8*(-parseInt(_0x2c5e3d(0x15f))/0x9)+-parseInt(_0x2c5e3d(0x181))/0xa*(-parseInt(_0x2c5e3d(0x166))/0xb)+parseInt(_0x2c5e3d(0x184))/0xc;if(_0x1f0bfd===_0x34d4f6)break;else _0x4e3839['push'](_0x4e3839['shift']());}catch(_0x421704){_0x4e3839['push'](_0x4e3839['shift']());}}}(a144_0x32fd,0x96ec4));function a144_0x32fd(){const _0x3e4acd=['Relative\x20path\x20cannot\x20be\x20empty','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','No\x20tdx.json\x20found\x20for\x20file:\x20','readFile','endsWith','pop','8WPjasL','1182849XdAvCy','relative','slice','name','replace','tdx.json','Cannot\x20split\x20empty\x20path','parse','journey','trim','isAbsolute','root','substring','push','95330FnwHQH','114MfOFEa','16VLuWVK','20wpuNAi','startsWith','Path\x20cannot\x20be\x20empty','1935468HPCQja','10987ZmqLmr','length','join','dirname','filter','Cannot\x20navigate\x20above\x20root','Path\x20attempts\x20to\x20navigate\x20above\x20root','raw','test','4043961ZWSjLB','Path\x20segment\x20cannot\x20be\x20empty','Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.','480235exBtAE','segments','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','5971559ohetUi','16WQGMIC','exists'];a144_0x32fd=function(){return _0x3e4acd;};return a144_0x32fd();}import a144_0x5c21e7 from'path';import{parse as a144_0x253e61}from'yaml';function a144_0x4823(_0x3ea31b,_0x11581e){_0x3ea31b=_0x3ea31b-0x15c;const _0x32fdca=a144_0x32fd();let _0x482317=_0x32fdca[_0x3ea31b];return _0x482317;}import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x2669ce){const _0x2bc0f5=a144_0x4823;if(!_0x2669ce||_0x2669ce[_0x2bc0f5(0x179)]()==='')throw new Error(_0x2bc0f5(0x183));const _0x1c3e52=_0x2669ce[_0x2bc0f5(0x179)]();if(_0x1c3e52==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x2669ce};const _0x3f4f77=_0x1c3e52['startsWith']('/')?_0x1c3e52[_0x2bc0f5(0x17c)](0x1):_0x1c3e52,_0x112f23=_0x3f4f77['split']('/')[_0x2bc0f5(0x189)](_0x2f83e9=>_0x2f83e9!=='');if(_0x112f23[_0x2bc0f5(0x186)]===0x0)throw new Error(_0x2bc0f5(0x16a));const _0x1f71a2=_0x1c3e52[_0x2bc0f5(0x182)]('/')||!isRelativePathSegment(_0x112f23[0x0]);for(const _0x406282 of _0x112f23){validatePathSegment(_0x406282);}return{'segments':_0x112f23,'isAbsolute':_0x1f71a2,'raw':_0x2669ce};}function isRelativePathSegment(_0x7a0e30){return _0x7a0e30==='.'||_0x7a0e30==='..';}function validatePathSegment(_0x2727d7){const _0x3ece6f=a144_0x4823;if(_0x2727d7==='')throw new Error(_0x3ece6f(0x160));if(_0x2727d7==='.'||_0x2727d7==='..')return;if(/[\x00-\x1F\x7F]/[_0x3ece6f(0x15e)](_0x2727d7))throw new Error('Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20'+_0x2727d7);if(_0x2727d7!==_0x2727d7[_0x3ece6f(0x179)]()){}}export function validatePath(_0x3503b4){const _0x21924d=a144_0x4823;if(_0x3503b4[_0x21924d(0x163)][_0x21924d(0x186)]===0x0&&!_0x3503b4[_0x21924d(0x17a)])throw new Error(_0x21924d(0x169));if(_0x3503b4[_0x21924d(0x17a)]){if(_0x3503b4[_0x21924d(0x163)][0x0]==='..')throw new Error(_0x21924d(0x165));let _0x25e914=0x0;for(const _0x1fbf6f of _0x3503b4[_0x21924d(0x163)]){if(_0x1fbf6f==='..'){if(_0x25e914===0x0)throw new Error(_0x21924d(0x15c));_0x25e914--;}else _0x1fbf6f!=='.'&&_0x25e914++;}}}export function joinPaths(_0x5cf140,_0x268567){const _0xff585f=a144_0x4823;if(!_0x5cf140||_0x5cf140==='/')return _0x268567;if(!_0x268567||_0x268567==='.')return _0x5cf140;if(_0x268567['startsWith']('/'))return _0x268567;const _0x5a0ce3=parsePath(_0x5cf140),_0x11f62b=parsePath(_0x268567),_0x55b377=[..._0x5a0ce3[_0xff585f(0x163)]];for(const _0x18433d of _0x11f62b[_0xff585f(0x163)]){if(_0x18433d==='.')continue;else{if(_0x18433d==='..'){if(_0x55b377[_0xff585f(0x186)]===0x0)throw new Error('Cannot\x20navigate\x20above\x20root');_0x55b377[_0xff585f(0x16e)]();}else _0x55b377[_0xff585f(0x17d)](_0x18433d);}}const _0x820ce2=_0x55b377['join']('/');return _0x5a0ce3[_0xff585f(0x15d)][_0xff585f(0x182)]('/')?'/'+_0x820ce2:_0x820ce2;}export function normalizePath(_0x4ad3ab){const _0x2c4b89=a144_0x4823,_0x2fc83=parsePath(_0x4ad3ab),_0x2433be=[];for(const _0x4f8072 of _0x2fc83[_0x2c4b89(0x163)]){if(_0x4f8072==='.')continue;else{if(_0x4f8072==='..'){if(_0x2433be[_0x2c4b89(0x186)]===0x0){if(_0x2fc83[_0x2c4b89(0x17a)])throw new Error(_0x2c4b89(0x18a));_0x2433be[_0x2c4b89(0x17d)]('..');}else _0x2433be[_0x2433be[_0x2c4b89(0x186)]-0x1]==='..'?_0x2433be['push']('..'):_0x2433be['pop']();}else _0x2433be[_0x2c4b89(0x17d)](_0x4f8072);}}if(_0x2433be[_0x2c4b89(0x186)]===0x0)return _0x2fc83[_0x2c4b89(0x17a)]?'/':'.';const _0x5ea252=_0x2433be[_0x2c4b89(0x187)]('/');return _0x2fc83[_0x2c4b89(0x15d)][_0x2c4b89(0x182)]('/')?'/'+_0x5ea252:_0x5ea252;}export function getParentPath(_0x22cc4a){const _0x2146d2=a144_0x4823,_0x4bad07=parsePath(_0x22cc4a);if(_0x4bad07[_0x2146d2(0x163)][_0x2146d2(0x186)]<=0x1)return'/';const _0x42b7ba=_0x4bad07[_0x2146d2(0x163)][_0x2146d2(0x172)](0x0,-0x1)['join']('/');return _0x4bad07[_0x2146d2(0x15d)]['startsWith']('/')?'/'+_0x42b7ba:_0x42b7ba;}export function getBaseName(_0x46cde8){const _0x1cd383=a144_0x4823,_0x3267f3=parsePath(_0x46cde8);return _0x3267f3[_0x1cd383(0x163)][_0x3267f3[_0x1cd383(0x163)][_0x1cd383(0x186)]-0x1]||'';}export function isChildPath(_0x55cdd7,_0x478f5a){const _0x1018f0=a144_0x4823,_0x25237b=parsePath(_0x55cdd7),_0x7bc13d=parsePath(_0x478f5a);if(_0x25237b[_0x1018f0(0x163)]['length']<=_0x7bc13d[_0x1018f0(0x163)]['length'])return![];for(let _0x5e1ea8=0x0;_0x5e1ea8<_0x7bc13d[_0x1018f0(0x163)]['length'];_0x5e1ea8++){if(_0x25237b['segments'][_0x5e1ea8]!==_0x7bc13d['segments'][_0x5e1ea8])return![];}return!![];}export function splitPath(_0x267e40){const _0x2fbeaf=a144_0x4823,_0x547b17=parsePath(_0x267e40);if(_0x547b17[_0x2fbeaf(0x163)][_0x2fbeaf(0x186)]===0x0)throw new Error(_0x2fbeaf(0x176));if(_0x547b17[_0x2fbeaf(0x163)][_0x2fbeaf(0x186)]===0x1)return{'parent':_0x547b17[_0x2fbeaf(0x163)][0x0]};return{'parent':_0x547b17[_0x2fbeaf(0x163)][0x0],'child':_0x547b17[_0x2fbeaf(0x163)][_0x2fbeaf(0x172)](0x1)[_0x2fbeaf(0x187)]('/')};}export function isYamlFilePath(_0x2d6d32){const _0x3bbc2f=a144_0x4823;return _0x2d6d32[_0x3bbc2f(0x16d)]('.yml')||_0x2d6d32['endsWith']('.yaml');}export async function resolveYamlFilePath(_0x3b027a,_0x1ae8fa=nodeFileSystem){const _0x31e1a9=a144_0x4823,_0x5ff14=a144_0x5c21e7['resolve'](_0x3b027a);if(!await _0x1ae8fa[_0x31e1a9(0x168)](_0x5ff14))throw new Error('File\x20not\x20found:\x20'+_0x3b027a);let _0x3fb070=a144_0x5c21e7['dirname'](_0x5ff14),_0x2df538=null,_0x5135ff=null;const _0x36d473=a144_0x5c21e7[_0x31e1a9(0x177)](_0x3fb070)[_0x31e1a9(0x17b)];while(_0x3fb070!==_0x36d473){const _0x4e7d75=a144_0x5c21e7['join'](_0x3fb070,_0x31e1a9(0x175));if(await _0x1ae8fa[_0x31e1a9(0x168)](_0x4e7d75)){_0x2df538=_0x4e7d75,_0x5135ff=_0x3fb070;break;}_0x3fb070=a144_0x5c21e7[_0x31e1a9(0x188)](_0x3fb070);}if(!_0x2df538||!_0x5135ff)throw new Error(_0x31e1a9(0x16b)+_0x3b027a+'\x0a'+_0x31e1a9(0x161));const _0x23b640=await _0x1ae8fa[_0x31e1a9(0x16c)](_0x2df538),_0x4bfd80=JSON[_0x31e1a9(0x177)](_0x23b640),_0x46a5c8=_0x4bfd80['parent_segment'];if(!_0x46a5c8)throw new Error('Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field');const _0x18f7ff=await _0x1ae8fa[_0x31e1a9(0x16c)](_0x5ff14),_0x3aae7c=a144_0x253e61(_0x18f7ff),_0x45bb4d=_0x3aae7c[_0x31e1a9(0x173)];if(!_0x45bb4d)throw new Error(_0x31e1a9(0x164)+_0x3b027a);const _0x247dc7=_0x3aae7c['type']===_0x31e1a9(0x178)?_0x31e1a9(0x178):'segment',_0x4cec79=a144_0x5c21e7[_0x31e1a9(0x171)](_0x5135ff,_0x5ff14),_0x11d55b=a144_0x5c21e7['dirname'](_0x4cec79),_0x3dec45=_0x11d55b==='.'?'':_0x11d55b[_0x31e1a9(0x174)](/\\/g,'/'),_0x375cfb=_0x3dec45?_0x46a5c8+'/'+_0x3dec45+'/'+_0x45bb4d:_0x46a5c8+'/'+_0x45bb4d;return{'parentSegment':_0x46a5c8,'segmentName':_0x45bb4d,'folderPath':_0x3dec45,'fullPath':_0x375cfb,'resourceType':_0x247dc7,'content':_0x18f7ff};}
@@ -1 +1 @@
1
- (function(_0x4e51ab,_0x3be020){const _0x299d79=a145_0x4769,_0xc4eb98=_0x4e51ab();while(!![]){try{const _0x2a32e1=parseInt(_0x299d79(0x1ef))/0x1+-parseInt(_0x299d79(0x1f1))/0x2*(parseInt(_0x299d79(0x1f2))/0x3)+parseInt(_0x299d79(0x1e5))/0x4+parseInt(_0x299d79(0x1e6))/0x5+parseInt(_0x299d79(0x1f0))/0x6*(parseInt(_0x299d79(0x1ee))/0x7)+parseInt(_0x299d79(0x1ed))/0x8*(parseInt(_0x299d79(0x1ea))/0x9)+-parseInt(_0x299d79(0x1e8))/0xa*(parseInt(_0x299d79(0x1f3))/0xb);if(_0x2a32e1===_0x3be020)break;else _0xc4eb98['push'](_0xc4eb98['shift']());}catch(_0x5b5957){_0xc4eb98['push'](_0xc4eb98['shift']());}}}(a145_0x3308,0xb8f32));export function parseSegmentRef(_0x3aec31){const _0x5ddd4=a145_0x4769,_0x556ac6=_0x3aec31[_0x5ddd4(0x1ec)]('/');if(_0x556ac6===-0x1)return{'parentId':_0x3aec31};if(_0x556ac6===0x0)throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x3aec31+'.\x20Parent\x20name\x20cannot\x20be\x20empty');const _0x23447f=_0x3aec31[_0x5ddd4(0x1e9)](0x0,_0x556ac6),_0x4dc3ab=_0x3aec31[_0x5ddd4(0x1e9)](_0x556ac6+0x1);if(_0x4dc3ab==='')throw new Error(_0x5ddd4(0x1e7)+_0x3aec31+_0x5ddd4(0x1eb));return{'parentId':_0x23447f,'childId':_0x4dc3ab};}function a145_0x4769(_0x25d77e,_0x5ec459){_0x25d77e=_0x25d77e-0x1e5;const _0x33080b=a145_0x3308();let _0x47696a=_0x33080b[_0x25d77e];return _0x47696a;}function a145_0x3308(){const _0x4703bb=['1088098LMnTCZ','3TsdKTs','121649mPGizM','5900512OrvVQy','6928520QqXlzi','Invalid\x20segment\x20reference\x20format:\x20','3170CEJugZ','substring','9sHgDIn','.\x20Child\x20name\x20cannot\x20be\x20empty','indexOf','1385768jqdqPH','14CbLkeT','1222841FcjUUj','1651236AqPCcy'];a145_0x3308=function(){return _0x4703bb;};return a145_0x3308();}
1
+ (function(_0x197ac3,_0x3508af){const _0x506d20=a145_0x218b,_0x37001d=_0x197ac3();while(!![]){try{const _0x521957=-parseInt(_0x506d20(0x15b))/0x1*(-parseInt(_0x506d20(0x15a))/0x2)+parseInt(_0x506d20(0x166))/0x3*(parseInt(_0x506d20(0x161))/0x4)+-parseInt(_0x506d20(0x160))/0x5+parseInt(_0x506d20(0x159))/0x6*(-parseInt(_0x506d20(0x15d))/0x7)+-parseInt(_0x506d20(0x163))/0x8+-parseInt(_0x506d20(0x15e))/0x9+parseInt(_0x506d20(0x15f))/0xa;if(_0x521957===_0x3508af)break;else _0x37001d['push'](_0x37001d['shift']());}catch(_0x4d8ca3){_0x37001d['push'](_0x37001d['shift']());}}}(a145_0x13c0,0x6fe7b));export function parseSegmentRef(_0x1df5df){const _0x13fc11=a145_0x218b,_0x32af75=_0x1df5df[_0x13fc11(0x162)]('/');if(_0x32af75===-0x1)return{'parentId':_0x1df5df};if(_0x32af75===0x0)throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x1df5df+_0x13fc11(0x165));const _0x1c2527=_0x1df5df[_0x13fc11(0x164)](0x0,_0x32af75),_0x335017=_0x1df5df['substring'](_0x32af75+0x1);if(_0x335017==='')throw new Error(_0x13fc11(0x15c)+_0x1df5df+_0x13fc11(0x167));return{'parentId':_0x1c2527,'childId':_0x335017};}function a145_0x218b(_0x27482a,_0x584940){_0x27482a=_0x27482a-0x159;const _0x13c007=a145_0x13c0();let _0x218be0=_0x13c007[_0x27482a];return _0x218be0;}function a145_0x13c0(){const _0x43bba1=['substring','.\x20Parent\x20name\x20cannot\x20be\x20empty','3138SDQxQY','.\x20Child\x20name\x20cannot\x20be\x20empty','138buajdI','14OnMqaZ','90053DwOAha','Invalid\x20segment\x20reference\x20format:\x20','139951eqBFIm','8165898ytOqky','6120230TkQXMC','13810eEUQtt','3464gUgoeW','indexOf','2559552nOBfxN'];a145_0x13c0=function(){return _0x43bba1;};return a145_0x13c0();}