@treasuredata/tdx 2026.3.29 → 2026.3.30

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 (203) 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.js +1 -1
  65. package/dist/core/profile.js +1 -1
  66. package/dist/core/project-config.js +1 -1
  67. package/dist/core/session.js +1 -1
  68. package/dist/core/user-cache.js +1 -1
  69. package/dist/core/version.js +1 -1
  70. package/dist/index.js +1 -1
  71. package/dist/mcp/server.js +1 -1
  72. package/dist/mcp/tools/index.js +1 -1
  73. package/dist/mcp/tools/tdx-run.js +1 -1
  74. package/dist/mcp/tools/tdx-search.js +1 -1
  75. package/dist/mcp/utils.js +1 -1
  76. package/dist/proxy/claude-usage-tracker.js +1 -1
  77. package/dist/proxy/passthrough-server.js +1 -1
  78. package/dist/proxy/sse-usage-parser.js +1 -1
  79. package/dist/sdk/agent/agent-config.js +1 -1
  80. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  81. package/dist/sdk/agent/agent-yaml.js +1 -1
  82. package/dist/sdk/agent/test/evaluator.js +1 -1
  83. package/dist/sdk/agent/test/executor.js +1 -1
  84. package/dist/sdk/agent/test/index.js +1 -1
  85. package/dist/sdk/agent/test/output.js +1 -1
  86. package/dist/sdk/agent/test/parser.js +1 -1
  87. package/dist/sdk/agent/tool-target-registry.js +1 -1
  88. package/dist/sdk/api.js +1 -1
  89. package/dist/sdk/client/cdp-api-client.js +1 -1
  90. package/dist/sdk/client/delivery-api-client.js +1 -1
  91. package/dist/sdk/client/endpoints.js +1 -1
  92. package/dist/sdk/client/engage-api-client.js +1 -1
  93. package/dist/sdk/client/http-client.js +1 -1
  94. package/dist/sdk/client/llm-api-client.js +1 -1
  95. package/dist/sdk/client/oauth-refresh.js +1 -1
  96. package/dist/sdk/client/rate-limiter.js +1 -1
  97. package/dist/sdk/client/td-api-client.js +1 -1
  98. package/dist/sdk/client/trino-api-client.js +1 -1
  99. package/dist/sdk/client/workflow-client.js +1 -1
  100. package/dist/sdk/connection-validator.js +1 -1
  101. package/dist/sdk/connection.js +1 -1
  102. package/dist/sdk/delivery.js +1 -1
  103. package/dist/sdk/engage/campaign-pull.js +1 -1
  104. package/dist/sdk/engage/campaign-push.js +1 -1
  105. package/dist/sdk/engage/campaign-validator.js +1 -1
  106. package/dist/sdk/engage/campaign-yaml.js +1 -1
  107. package/dist/sdk/engage/template-pull.js +1 -1
  108. package/dist/sdk/engage/template-push.js +1 -1
  109. package/dist/sdk/engage/template-validator.js +1 -1
  110. package/dist/sdk/engage/template-yaml.js +1 -1
  111. package/dist/sdk/engage/types/campaign-def.js +1 -1
  112. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  113. package/dist/sdk/engage/types/template-schema.js +1 -1
  114. package/dist/sdk/engage.js +1 -1
  115. package/dist/sdk/errors.js +1 -1
  116. package/dist/sdk/index.js +1 -1
  117. package/dist/sdk/io/index.js +1 -1
  118. package/dist/sdk/io/node-filesystem.js +1 -1
  119. package/dist/sdk/job.js +1 -1
  120. package/dist/sdk/journey.js +1 -1
  121. package/dist/sdk/llm/chat-cache.js +1 -1
  122. package/dist/sdk/llm/index.js +1 -1
  123. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  124. package/dist/sdk/llm/model-factors.js +1 -1
  125. package/dist/sdk/personalization.js +1 -1
  126. package/dist/sdk/policy.js +1 -1
  127. package/dist/sdk/query/index.js +1 -1
  128. package/dist/sdk/query/sql-parser.js +1 -1
  129. package/dist/sdk/realtime.js +1 -1
  130. package/dist/sdk/schedule.js +1 -1
  131. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  132. package/dist/sdk/segment/fields-display.js +1 -1
  133. package/dist/sdk/segment/file-discovery.js +1 -1
  134. package/dist/sdk/segment/journey-utils.js +1 -1
  135. package/dist/sdk/segment/journey-validator.js +1 -1
  136. package/dist/sdk/segment/journey-yaml.js +1 -1
  137. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  138. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  139. package/dist/sdk/segment/pull-workflow.js +1 -1
  140. package/dist/sdk/segment/push-recovery.js +1 -1
  141. package/dist/sdk/segment/push-workflow.js +1 -1
  142. package/dist/sdk/segment/resolution-context.js +1 -1
  143. package/dist/sdk/segment/segment-path-parser.js +1 -1
  144. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  145. package/dist/sdk/segment/segment-validator.js +1 -1
  146. package/dist/sdk/segment/target-resolution.js +1 -1
  147. package/dist/sdk/segment/tdx-config.js +1 -1
  148. package/dist/sdk/segment/types/activation-schema.js +1 -1
  149. package/dist/sdk/segment/types/journey-def.js +1 -1
  150. package/dist/sdk/segment/types/journey-schema.js +1 -1
  151. package/dist/sdk/segment/types/segment-def.js +1 -1
  152. package/dist/sdk/segment/types/segment-schema.js +1 -1
  153. package/dist/sdk/segment/validate-files.js +1 -1
  154. package/dist/sdk/segment/yaml-validator.js +1 -1
  155. package/dist/sdk/segment.js +1 -1
  156. package/dist/sdk/types/index.js +1 -1
  157. package/dist/sdk/types/progress.js +1 -1
  158. package/dist/sdk/user.js +1 -1
  159. package/dist/sdk/util/format-detector.js +1 -1
  160. package/dist/sdk/util/formatters.js +1 -1
  161. package/dist/sdk/util/index.js +1 -1
  162. package/dist/sdk/util/paginate.js +1 -1
  163. package/dist/sdk/util/tree-formatter.js +1 -1
  164. package/dist/sdk/workflow/archive-validation.js +1 -1
  165. package/dist/sdk/workflow/clone-workflow.js +1 -1
  166. package/dist/sdk/workflow/index.js +1 -1
  167. package/dist/sdk/workflow/pull-workflow.js +1 -1
  168. package/dist/sdk/workflow/push-workflow.js +1 -1
  169. package/dist/sdk/workflow/tdx-config.js +1 -1
  170. package/dist/sdk/workflow/workflow-utils.js +1 -1
  171. package/dist/test-utils/command-runner.js +1 -1
  172. package/dist/test-utils/factories.js +1 -1
  173. package/dist/test-utils/fixtures.js +1 -1
  174. package/dist/test-utils/http-mock.js +1 -1
  175. package/dist/test-utils/index.js +1 -1
  176. package/dist/utils/async.js +1 -1
  177. package/dist/utils/colors.js +1 -1
  178. package/dist/utils/diff.js +1 -1
  179. package/dist/utils/file-permissions.js +1 -1
  180. package/dist/utils/file-reader.js +1 -1
  181. package/dist/utils/github-releases.js +1 -1
  182. package/dist/utils/global-cache.js +1 -1
  183. package/dist/utils/json-loader.js +1 -1
  184. package/dist/utils/local-cache.js +1 -1
  185. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  186. package/dist/utils/logger/formatters/index.js +1 -1
  187. package/dist/utils/logger/handlers/console-handler.js +1 -1
  188. package/dist/utils/logger/handlers/file-handler.js +1 -1
  189. package/dist/utils/logger/handlers/index.js +1 -1
  190. package/dist/utils/logger/handlers/null-handler.js +1 -1
  191. package/dist/utils/logger/index.js +1 -1
  192. package/dist/utils/logger/logger.js +1 -1
  193. package/dist/utils/logger/types.js +1 -1
  194. package/dist/utils/option-validation.js +1 -1
  195. package/dist/utils/process.js +1 -1
  196. package/dist/utils/prompt.js +1 -1
  197. package/dist/utils/spinner.js +1 -1
  198. package/dist/utils/sse-parser.js +1 -1
  199. package/dist/utils/string-utils.js +1 -1
  200. package/dist/utils/table-ref-parser.js +1 -1
  201. package/dist/utils/tdx-logger.js +1 -1
  202. package/dist/utils/version-check.js +1 -1
  203. package/package.json +1 -1
@@ -1 +1 @@
1
- const a141_0x25f0fd=a141_0x4ca8;(function(_0x5cc177,_0x1a5953){const _0x14500b=a141_0x4ca8,_0x46d46c=_0x5cc177();while(!![]){try{const _0xddce2d=parseInt(_0x14500b(0xee))/0x1+parseInt(_0x14500b(0xf5))/0x2*(-parseInt(_0x14500b(0xf9))/0x3)+parseInt(_0x14500b(0xfd))/0x4+-parseInt(_0x14500b(0xfc))/0x5*(-parseInt(_0x14500b(0xf1))/0x6)+-parseInt(_0x14500b(0xeb))/0x7+parseInt(_0x14500b(0xf0))/0x8+-parseInt(_0x14500b(0xf4))/0x9*(-parseInt(_0x14500b(0xef))/0xa);if(_0xddce2d===_0x1a5953)break;else _0x46d46c['push'](_0x46d46c['shift']());}catch(_0x2badb0){_0x46d46c['push'](_0x46d46c['shift']());}}}(a141_0x1bba,0xea1fa));import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';import a141_0x141414 from'path';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a141_0x25f0fd(0xf8));export function getPushRecoveryPath(_0x4920be){const _0x1eacc1=a141_0x25f0fd,_0xf0c425=a141_0x141414[_0x1eacc1(0xe6)](_0x4920be),_0x4124ce=a141_0x141414['basename'](_0x4920be);return a141_0x141414[_0x1eacc1(0xfa)](_0xf0c425,'.'+_0x4124ce+'.push-recovery.json');}function a141_0x4ca8(_0x2c48ac,_0x5402a1){_0x2c48ac=_0x2c48ac-0xe5;const _0x1bbab9=a141_0x1bba();let _0x4ca84b=_0x1bbab9[_0x2c48ac];return _0x4ca84b;}function a141_0x1bba(){const _0x42c669=['5AepSUR','84668YaeBMq','parse','dirname','Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20','string','stringify','version','10560263pTjYXB','code','utf-8','50850nQhNZQ','17210ieTCEp','2992992vVcPLL','4935234kBckTU','Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20','warn','9621iMaxxM','51268vqEPPG','segments','toISOString','tdx.sdk.push-recovery','75QtGZAT','join','debug'];a141_0x1bba=function(){return _0x42c669;};return a141_0x1bba();}export function readPushRecovery(_0x38054d){const _0x4b45c1=a141_0x25f0fd,_0x542937=getPushRecoveryPath(_0x38054d);if(!existsSync(_0x542937))return undefined;try{const _0x341331=readFileSync(_0x542937,_0x4b45c1(0xed)),_0x220d2b=JSON[_0x4b45c1(0xe5)](_0x341331);if(_0x220d2b?.[_0x4b45c1(0xea)]!==0x1||typeof _0x220d2b['journeyName']!==_0x4b45c1(0xe8))return undefined;return _0x220d2b;}catch(_0x28a057){return _0x28a057 instanceof SyntaxError?logger['debug'](_0x4b45c1(0xf2)+_0x28a057):logger[_0x4b45c1(0xf3)]('Failed\x20to\x20read\x20push\x20recovery\x20file:\x20'+_0x28a057),undefined;}}export function writePushRecovery(_0x26a083,_0x192104){const _0x4ab18a=a141_0x25f0fd,_0x2760a1=getPushRecoveryPath(_0x26a083),_0x39131f=_0x2760a1+'.tmp';writeFileSync(_0x39131f,JSON[_0x4ab18a(0xe9)](_0x192104,null,0x2)+'\x0a',_0x4ab18a(0xed)),renameSync(_0x39131f,_0x2760a1);}export function deletePushRecovery(_0x246f12){const _0x22b5ce=a141_0x25f0fd,_0x12a801=getPushRecoveryPath(_0x246f12);try{unlinkSync(_0x12a801);}catch(_0x211032){_0x211032[_0x22b5ce(0xec)]!=='ENOENT'&&logger[_0x22b5ce(0xfb)](_0x22b5ce(0xe7)+_0x211032);}}export function saveSegmentToPushRecovery(_0x3f1972,_0xce480b,_0x4f6a9e,_0x56531a){const _0x44dd1c=a141_0x25f0fd,_0x293e9e=readPushRecovery(_0x3f1972),_0x8eaf53=_0x293e9e?.['journeyName']===_0xce480b?{..._0x293e9e,'updatedAt':new Date()['toISOString']()}:{'version':0x1,'journeyName':_0xce480b,'updatedAt':new Date()[_0x44dd1c(0xf7)](),'segments':{}};_0x8eaf53[_0x44dd1c(0xf6)][_0x4f6a9e]=_0x56531a,writePushRecovery(_0x3f1972,_0x8eaf53);}
1
+ const a141_0xc59602=a141_0x163b;(function(_0x1f5c96,_0x4ab8f0){const _0x190d1e=a141_0x163b,_0x43d59b=_0x1f5c96();while(!![]){try{const _0x12222b=parseInt(_0x190d1e(0xe6))/0x1+parseInt(_0x190d1e(0xd0))/0x2+-parseInt(_0x190d1e(0xe1))/0x3+parseInt(_0x190d1e(0xd2))/0x4*(parseInt(_0x190d1e(0xde))/0x5)+-parseInt(_0x190d1e(0xd1))/0x6+parseInt(_0x190d1e(0xe8))/0x7+-parseInt(_0x190d1e(0xdd))/0x8*(-parseInt(_0x190d1e(0xe4))/0x9);if(_0x12222b===_0x4ab8f0)break;else _0x43d59b['push'](_0x43d59b['shift']());}catch(_0x5e4be4){_0x43d59b['push'](_0x43d59b['shift']());}}}(a141_0xc10b,0xbb945));import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';import a141_0x514325 from'path';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a141_0xc59602(0xd9));function a141_0xc10b(){const _0xadc48c=['warn','segments','debug','tdx.sdk.push-recovery','Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20','.tmp','stringify','272ejaHuY','2010625DAdTiv','utf-8','join','2118651KBIIpe','ENOENT','basename','106614KvNdfT','parse','370065RTNMBg','journeyName','2878533iAfTpN','.push-recovery.json','2123948fsrcXF','7041630OnROHt','4JOQGHv','toISOString','code','Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20'];a141_0xc10b=function(){return _0xadc48c;};return a141_0xc10b();}export function getPushRecoveryPath(_0x4e711f){const _0x9df603=a141_0xc59602,_0x17bbef=a141_0x514325['dirname'](_0x4e711f),_0x2381b4=a141_0x514325[_0x9df603(0xe3)](_0x4e711f);return a141_0x514325[_0x9df603(0xe0)](_0x17bbef,'.'+_0x2381b4+_0x9df603(0xe9));}export function readPushRecovery(_0x5ad344){const _0x55cdae=a141_0xc59602,_0x964a1b=getPushRecoveryPath(_0x5ad344);if(!existsSync(_0x964a1b))return undefined;try{const _0x3aeb17=readFileSync(_0x964a1b,_0x55cdae(0xdf)),_0x167cca=JSON[_0x55cdae(0xe5)](_0x3aeb17);if(_0x167cca?.['version']!==0x1||typeof _0x167cca[_0x55cdae(0xe7)]!=='string')return undefined;return _0x167cca;}catch(_0xb62c06){return _0xb62c06 instanceof SyntaxError?logger[_0x55cdae(0xd8)](_0x55cdae(0xd5)+_0xb62c06):logger[_0x55cdae(0xd6)]('Failed\x20to\x20read\x20push\x20recovery\x20file:\x20'+_0xb62c06),undefined;}}function a141_0x163b(_0x27448d,_0x184a4b){_0x27448d=_0x27448d-0xd0;const _0xc10b0a=a141_0xc10b();let _0x163be6=_0xc10b0a[_0x27448d];return _0x163be6;}export function writePushRecovery(_0x23e92d,_0xea2314){const _0x4cdfc7=a141_0xc59602,_0x2155d6=getPushRecoveryPath(_0x23e92d),_0xb15943=_0x2155d6+_0x4cdfc7(0xdb);writeFileSync(_0xb15943,JSON[_0x4cdfc7(0xdc)](_0xea2314,null,0x2)+'\x0a',_0x4cdfc7(0xdf)),renameSync(_0xb15943,_0x2155d6);}export function deletePushRecovery(_0x256e6a){const _0x3149de=a141_0xc59602,_0x2417f7=getPushRecoveryPath(_0x256e6a);try{unlinkSync(_0x2417f7);}catch(_0x13cfc9){_0x13cfc9[_0x3149de(0xd4)]!==_0x3149de(0xe2)&&logger[_0x3149de(0xd8)](_0x3149de(0xda)+_0x13cfc9);}}export function saveSegmentToPushRecovery(_0x3dc4af,_0x40b59e,_0x24ed73,_0xf79a97){const _0x3b469f=a141_0xc59602,_0x257ced=readPushRecovery(_0x3dc4af),_0x2c6d7f=_0x257ced?.[_0x3b469f(0xe7)]===_0x40b59e?{..._0x257ced,'updatedAt':new Date()['toISOString']()}:{'version':0x1,'journeyName':_0x40b59e,'updatedAt':new Date()[_0x3b469f(0xd3)](),'segments':{}};_0x2c6d7f[_0x3b469f(0xd7)][_0x24ed73]=_0xf79a97,writePushRecovery(_0x3dc4af,_0x2c6d7f);}
@@ -1 +1 @@
1
- const a142_0x11892d=a142_0x1405;(function(_0x5bc96a,_0x148815){const _0x4d7416=a142_0x1405,_0x24b6fe=_0x5bc96a();while(!![]){try{const _0x59ce92=parseInt(_0x4d7416(0x18b))/0x1*(parseInt(_0x4d7416(0x13b))/0x2)+parseInt(_0x4d7416(0x1b2))/0x3+parseInt(_0x4d7416(0xbd))/0x4+parseInt(_0x4d7416(0x178))/0x5+-parseInt(_0x4d7416(0xcd))/0x6+parseInt(_0x4d7416(0xf3))/0x7+-parseInt(_0x4d7416(0xec))/0x8;if(_0x59ce92===_0x148815)break;else _0x24b6fe['push'](_0x24b6fe['shift']());}catch(_0x1ed0ca){_0x24b6fe['push'](_0x24b6fe['shift']());}}}(a142_0x3e6b,0xedd5c));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a142_0x11892d(0xc5));export const PENDING_SEGMENT_PREFIX=a142_0x11892d(0xdd);export const PENDING_ACTIVATION_PREFIX=a142_0x11892d(0x150);export function createPendingSegmentId(_0x2d8b4a){return''+PENDING_SEGMENT_PREFIX+_0x2d8b4a+'__';}export function isPendingSegmentId(_0x17474f){const _0x55863a=a142_0x11892d;return _0x17474f[_0x55863a(0x113)](PENDING_SEGMENT_PREFIX)&&!_0x17474f['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x137259){const _0x1a7f08=a142_0x11892d;return _0x137259[_0x1a7f08(0xf5)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x131e0b){return''+PENDING_ACTIVATION_PREFIX+_0x131e0b+'__';}export function isPendingActivationId(_0x1f4432){const _0x45322b=a142_0x11892d;return _0x1f4432[_0x45322b(0x113)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x3eaa97){return _0x3eaa97['replace'](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x45dd53,_0x4a51fc){const _0x16370c=a142_0x11892d,_0x4a499e=_0x45dd53+'::'+(_0x4a51fc[_0x16370c(0xe8)]()||'segment'),_0x1c1247=createHash(_0x16370c(0x15d))['update'](_0x4a499e)['digest'](_0x16370c(0x12f))[_0x16370c(0x126)](0x0,0xc);return _0x16370c(0x1bf)+_0x1c1247;}export function ensureJourneyDefaults(_0x169fa0){const _0x5225b5=a142_0x11892d;!_0x169fa0[_0x5225b5(0xde)]&&(_0x169fa0[_0x5225b5(0xde)]=''),!_0x169fa0[_0x5225b5(0x11d)]&&(_0x169fa0[_0x5225b5(0x11d)]='draft');}export function injectExistingStageIds(_0xc72758,_0x50b1fc){const _0x3fc5c3=a142_0x11892d,_0x176626=new Map(_0x50b1fc[_0x3fc5c3(0xc7)](_0x328bbc=>[_0x328bbc['name'],_0x328bbc['id']]));for(const _0x283682 of _0xc72758){if(!_0x283682['id']){const _0x37248a=_0x176626['get'](_0x283682[_0x3fc5c3(0xc3)]);_0x37248a&&(_0x283682['id']=_0x37248a);}}}export function resolveTDFolderPath(_0x42e25b,_0x26a7e0,_0x4c101f){const _0xeff3ab=a142_0x11892d;if(!_0x26a7e0)return _0x42e25b;if(_0x42e25b===_0x4c101f||_0x42e25b[_0xeff3ab(0x113)](_0x4c101f+'/'))return _0x42e25b;return _0x42e25b?_0x4c101f+'/'+_0x42e25b:_0x4c101f;}export function addFoldersToCreate(_0x4c5060,_0x2dce4c,_0x207d7d){const _0xee8e4c=a142_0x11892d;if(!_0x4c5060)return;if(_0x2dce4c[_0xee8e4c(0x1c1)](_0x4c5060))return;const _0x2cadfc=_0x4c5060[_0xee8e4c(0x11a)]('/');let _0x12bf0c='';for(const _0x5206e4 of _0x2cadfc){_0x12bf0c=_0x12bf0c?_0x12bf0c+'/'+_0x5206e4:_0x5206e4,!_0x2dce4c[_0xee8e4c(0x1c1)](_0x12bf0c)&&_0x207d7d[_0xee8e4c(0xcc)](_0x12bf0c);}}export function sortFoldersByDepth(_0x232839){const _0x16a5a4=a142_0x11892d;return[..._0x232839][_0x16a5a4(0x123)]((_0x21c33a,_0x20181d)=>{const _0x29e36d=_0x16a5a4,_0x103ce6=(_0x21c33a['match'](/\//g)||[])[_0x29e36d(0x12a)],_0x56f44d=(_0x20181d[_0x29e36d(0x19f)](/\//g)||[])['length'];return _0x103ce6-_0x56f44d;});}import*as a142_0x157744 from'yaml';import{readFileSync}from'fs';import a142_0x22112c from'path';import{isJourneyDef,parseYamlString as a142_0x32e890,toYamlString as a142_0xe1e2b4,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(_0x44f55f){const _0x4baf0c=a142_0x11892d;if(Array[_0x4baf0c(0x15a)](_0x44f55f))return'['+_0x44f55f[_0x4baf0c(0xc7)](_0x5ba38f=>stableStringify(_0x5ba38f))[_0x4baf0c(0xe4)](',')+']';if(_0x44f55f&&typeof _0x44f55f===_0x4baf0c(0x1a8)){const _0x40780d=_0x44f55f,_0x4b401c=Object[_0x4baf0c(0x1b6)](_0x40780d)[_0x4baf0c(0x123)](),_0x3f8631=_0x4b401c[_0x4baf0c(0xc7)](_0x540106=>'\x22'+_0x540106+'\x22:'+stableStringify(_0x40780d[_0x540106]));return'{'+_0x3f8631[_0x4baf0c(0xe4)](',')+'}';}const _0x1cfdae=JSON[_0x4baf0c(0x17c)](_0x44f55f);return _0x1cfdae===undefined?_0x4baf0c(0x191):_0x1cfdae;}function activationSignature(_0x1a739f){const _0x20d9de=a142_0x11892d,_0x46ffa0={'connection':_0x1a739f['connection'],..._0x1a739f[_0x20d9de(0x16b)]!==undefined&&{'all_columns':_0x1a739f[_0x20d9de(0x16b)]},..._0x1a739f[_0x20d9de(0x164)]!==undefined&&{'columns':_0x1a739f[_0x20d9de(0x164)]},..._0x1a739f[_0x20d9de(0x15b)]!==undefined&&{'behavior':_0x1a739f[_0x20d9de(0x15b)]},..._0x1a739f[_0x20d9de(0xda)]!==undefined&&{'schedule':_0x1a739f[_0x20d9de(0xda)]},..._0x1a739f['notification']!==undefined&&{'notification':_0x1a739f[_0x20d9de(0xbe)]},..._0x1a739f[_0x20d9de(0x139)]!==undefined&&{'connector_config':_0x1a739f[_0x20d9de(0x139)]},..._0x1a739f['activation_template_id']!==undefined&&{'activation_template_id':_0x1a739f['activation_template_id']}};return stableStringify(_0x46ffa0);}async function fetchSegment(_0x565a89,_0x132bc3,_0x4e3db7,_0x4b3375){const _0x404795=a142_0x11892d,_0x411dbe=_0x4b3375?.[_0x404795(0x1c0)](_0x3b7225=>_0x3b7225['id']===_0x4e3db7);if(_0x411dbe)return _0x411dbe;try{return await _0x565a89['segment']['getSegment'](_0x132bc3,_0x4e3db7);}catch(_0x167139){logger[_0x404795(0xe1)](_0x404795(0xd3)+_0x4e3db7+_0x404795(0x172)+_0x167139);try{return await _0x565a89[_0x404795(0x194)][_0x404795(0x159)](_0x4e3db7);}catch(_0x53bd2b){return logger[_0x404795(0xe1)](_0x404795(0x13c)+_0x4e3db7+':\x20'+_0x53bd2b),null;}}}function recoverSegmentIdsFromPushRecovery(_0x3455c6,_0xf59902,_0x3d844a){const _0x33b2c3=a142_0x11892d,_0x3d48e8=readPushRecovery(_0x3455c6['absolutePath']);if(_0x3d48e8?.['journeyName']===_0x3455c6['yamlConfig'][_0x33b2c3(0xc3)])for(const [_0x40a923,_0x409506]of Object[_0x33b2c3(0x141)](_0x3d48e8['segments'])){const _0x4c8d9c=generateDeterministicJourneySegmentName(_0x3455c6[_0x33b2c3(0xd1)][_0x33b2c3(0xc3)],_0x40a923);_0x409506[_0x33b2c3(0x190)]===_0x4c8d9c&&(_0xf59902[_0x33b2c3(0x13e)](_0x40a923,_0x409506[_0x33b2c3(0xd6)]),_0x3d844a['set'](_0x40a923,_0x409506[_0x33b2c3(0xd6)]));}}async function createOrRecoverEmbeddedSegment(_0x1f512d,_0x539937,_0x5d0f2a,_0x155308){const _0x1d7077=a142_0x11892d;let _0x568c0b;try{_0x568c0b=await _0x1f512d[_0x1d7077(0x194)][_0x1d7077(0x19d)]({'name':_0x5d0f2a[_0x1d7077(0xc6)],'description':_0x5d0f2a['description'],'journeyId':_0x5d0f2a['journeyId'],'rule':_0x155308(_0x5d0f2a[_0x1d7077(0xba)],!![]),'countPopulation':!![],'parentFolderId':_0x5d0f2a[_0x1d7077(0xe7)],'audienceId':_0x5d0f2a[_0x1d7077(0x14d)]});}catch(_0x54bbd9){const _0x56535a=_0x54bbd9 instanceof Error&&_0x54bbd9[_0x1d7077(0x147)][_0x1d7077(0x12b)](_0x1d7077(0xd9));if(_0x56535a){const _0x5d5f9f=readPushRecovery(_0x539937['absolutePath']),_0xf2ee13=_0x5d5f9f?.['journeyName']===_0x539937[_0x1d7077(0xd1)][_0x1d7077(0xc3)]?_0x5d5f9f[_0x1d7077(0x185)][_0x5d0f2a[_0x1d7077(0x106)]]:undefined;if(_0xf2ee13?.[_0x1d7077(0x190)]===_0x5d0f2a['uniqueSegmentName'])await _0x1f512d['segment'][_0x1d7077(0x14a)](_0x5d0f2a[_0x1d7077(0x14d)],_0xf2ee13[_0x1d7077(0xd6)],{'description':_0x5d0f2a[_0x1d7077(0xde)],'rule':_0x155308(_0x5d0f2a['resolvedRule'],!![]),'countPopulation':!![]}),_0x568c0b=_0xf2ee13[_0x1d7077(0xd6)];else throw new SDKError(ErrorCode['SEGMENT_UPDATE_ERROR'],_0x1d7077(0xe0)+_0x5d0f2a[_0x1d7077(0x106)]+_0x1d7077(0x118)+(_0x1d7077(0xdc)+_0x539937[_0x1d7077(0x111)][_0x1d7077(0xf5)](/([^/]+)$/,_0x1d7077(0x19a))+')\x20')+_0x1d7077(0x199),_0x54bbd9);}else throw _0x54bbd9;}return saveSegmentToPushRecovery(_0x539937[_0x1d7077(0x111)],_0x539937[_0x1d7077(0xd1)]['name'],_0x5d0f2a[_0x1d7077(0x106)],{'segmentId':_0x568c0b,'uniqueServerName':_0x5d0f2a['uniqueSegmentName'],'createdAt':new Date()[_0x1d7077(0xc9)]()}),_0x568c0b;}export async function prepareSegmentFiles(_0x562a17,_0x18ff52,_0x5b7c15,_0x469e17,_0x26dce1){const _0x3b5cf4=a142_0x11892d,{activationDefToCreateRequest:_0x385ad2}=await import(_0x3b5cf4(0x136)),_0xcb5e3f=[],_0x20fcc5=new Set();for(const {yamlConfig:_0x4cbc07,folderPath:_0x4ff7a0,sourcePath:_0x312d39}of _0x562a17){const _0x11bc9b=resolveTDFolderPath(_0x4ff7a0,_0x469e17,_0x26dce1),_0x88e8a9=_0x11bc9b+':'+_0x4cbc07[_0x3b5cf4(0xc3)],_0x472dc4=_0x18ff52[_0x3b5cf4(0x137)]['get'](_0x88e8a9),_0x469e2f=_0x472dc4?_0x18ff52['activationsBySegmentId'][_0x3b5cf4(0x1aa)](_0x472dc4['id'])||[]:[];addFoldersToCreate(_0x11bc9b,_0x18ff52['folderPathToId'],_0x20fcc5);const _0x45a06d=calculateActivationActions(_0x4cbc07[_0x3b5cf4(0x169)]||[],_0x469e2f,_0x18ff52[_0x3b5cf4(0x13a)],_0x18ff52['connectionIdToNameMap']);for(const _0x1e9d25 of _0x45a06d){(_0x1e9d25[_0x3b5cf4(0x11c)]===_0x3b5cf4(0xf1)||_0x1e9d25[_0x3b5cf4(0x11c)]===_0x3b5cf4(0x14e))&&_0x1e9d25[_0x3b5cf4(0x154)]&&(_0x1e9d25[_0x3b5cf4(0xc8)]=await _0x385ad2(_0x1e9d25[_0x3b5cf4(0x154)],_0x5b7c15));}const _0x3f970e=calculateSegmentDiff(_0x4cbc07,_0x472dc4,_0x469e2f,_0x18ff52[_0x3b5cf4(0x13a)],_0x18ff52[_0x3b5cf4(0x198)]);_0xcb5e3f[_0x3b5cf4(0x135)]({'relativePath':_0x4cbc07[_0x3b5cf4(0xc3)],'absolutePath':_0x312d39,'yamlConfig':_0x4cbc07,'folderPath':_0x11bc9b,'existingSegment':_0x472dc4,'existingActivations':_0x469e2f,'isNew':_0x3f970e[_0x3b5cf4(0x17e)],'hasChanges':_0x3f970e['hasChanges'],'diff':_0x3f970e['diff'],'activationActions':_0x45a06d});}return{'segmentFiles':_0xcb5e3f,'foldersToCreate':_0x20fcc5};}export async function prepareJourneyFiles(_0x2ccef0,_0x421e71,_0x5d747f,_0x336e57){const _0x46c1d3=a142_0x11892d,_0x50132d=[],_0x17c9a1=new Set();for(const {yamlConfig:_0x5e319a,folderPath:_0x2e5bf8,sourcePath:_0x551e5c}of _0x2ccef0){const _0x37e921=resolveTDFolderPath(_0x2e5bf8,_0x5d747f,_0x336e57),_0x2e1529=_0x37e921+':'+_0x5e319a[_0x46c1d3(0xc3)],_0x3ef83f=_0x421e71[_0x46c1d3(0xff)][_0x46c1d3(0x1aa)](_0x2e1529);let _0x183b15,_0x925f0c;if(_0x3ef83f&&_0x3ef83f['length']>0x0){const _0x163209=buildLocalExpandedRuleMappings(_0x5e319a),{createYamlContext:_0x490483,prefetchJourneySegments:_0x226ffe}=createPushYamlContextForBundle(_0x421e71[_0x46c1d3(0x18a)],_0x421e71[_0x46c1d3(0x14d)],_0x421e71[_0x46c1d3(0x179)],_0x163209,_0x421e71[_0x46c1d3(0x13a)],_0x421e71[_0x46c1d3(0x198)],_0x421e71[_0x46c1d3(0x19c)],_0x421e71[_0x46c1d3(0x176)]);await _0x226ffe(_0x3ef83f['map'](_0x51f261=>_0x51f261['id']));const _0x4f486f=await _0x421e71[_0x46c1d3(0x18a)][_0x46c1d3(0x1ab)]['getLatestJourneyId'](_0x3ef83f[0x0][_0x46c1d3(0x187)]),_0xb2e761=hasMultipleVersions(_0x5e319a),_0x2ea040=async _0x3261f8=>{const _0xcea277=_0x46c1d3,_0x3084d6=_0x421e71[_0xcea277(0x176)]?.[_0xcea277(0x1aa)](_0x3261f8);if(_0x3084d6)return _0x3084d6;return _0x421e71[_0xcea277(0x144)]({'journeyId':_0x3261f8,'journeyName':_0x5e319a[_0xcea277(0xc3)],'isMultiVersion':_0x3ef83f[_0xcea277(0x12a)]>0x1});};if(_0xb2e761&&_0x3ef83f[_0x46c1d3(0x12a)]>0x1){const _0x8135f4=[];for(const _0x46b550 of _0x3ef83f){const _0x2892bb=_0x46b550[_0x46c1d3(0x1ac)]||0x1;_0x421e71[_0x46c1d3(0xe9)]?.[_0x46c1d3(0x14e)](_0x46c1d3(0xd0)+_0x5e319a[_0x46c1d3(0xc3)]+'\x20v'+_0x2892bb);const _0x5529e9=await _0x2ea040(_0x46b550['id']),_0x455100=_0x490483(_0x46b550['id']),_0x5614ba=await journeyResponseToDef(_0x5529e9,_0x455100);_0x8135f4[_0x46c1d3(0x135)]({'item':_0x46b550,'yaml':_0x5614ba});}const _0x46a2c1=buildLocalRuleToNameMappingFromJourney(_0x5e319a);_0x925f0c=buildMergedJourneyDef(_0x8135f4,_0x46a2c1,_0x4f486f);const _0x2d38ec=Math[_0x46c1d3(0x1b1)](..._0x8135f4['map'](_0x46db72=>_0x46db72[_0x46c1d3(0x170)][_0x46c1d3(0x1ac)]||0x0)),_0x50c58d=_0x3ef83f[_0x46c1d3(0x1c0)](_0x1876b1=>(_0x1876b1[_0x46c1d3(0x1ac)]||0x0)===_0x2d38ec);_0x50c58d&&(_0x421e71[_0x46c1d3(0xe9)]?.[_0x46c1d3(0x14e)]('Fetching\x20'+_0x5e319a[_0x46c1d3(0xc3)]+'\x20v'+_0x2d38ec),_0x183b15=await _0x2ea040(_0x50c58d['id']));}else{const _0x56f195=_0x3ef83f[_0x3ef83f['length']-0x1];_0x421e71['progress']?.['update'](_0x46c1d3(0xd0)+_0x5e319a[_0x46c1d3(0xc3)]),_0x183b15=await _0x2ea040(_0x56f195['id']);const _0x1ebf28=_0x490483(_0x56f195['id']),_0xf2ae5e=await journeyResponseToDef(_0x183b15,_0x1ebf28),_0x3c46ce=buildLocalRuleToNameMappingFromJourney(_0x5e319a);_0x925f0c=buildMergedJourneyDef([{'item':_0x56f195,'yaml':_0xf2ae5e}],_0x3c46ce,_0x4f486f);}}addFoldersToCreate(_0x37e921,_0x421e71[_0x46c1d3(0x1a0)],_0x17c9a1);const _0x139af2=calculateJourneyDiff(_0x5e319a,_0x925f0c);_0x50132d[_0x46c1d3(0x135)]({'relativePath':_0x5e319a['name'],'absolutePath':_0x551e5c,'yamlConfig':_0x5e319a,'folderPath':_0x37e921,'existingJourney':_0x183b15,'isNew':_0x139af2[_0x46c1d3(0x17e)],'hasChanges':_0x139af2[_0x46c1d3(0x184)],'diff':_0x139af2[_0x46c1d3(0x104)]});}return{'journeyFiles':_0x50132d,'foldersToCreate':_0x17c9a1};}export function calculateActivationActions(_0x2033e0,_0x43179f,_0x17a317,_0x261349){const _0x1ee151=a142_0x11892d,_0x47a306=[],_0x15cb85=new Map();for(const _0x3df640 of _0x43179f){_0x15cb85[_0x1ee151(0x13e)](_0x3df640[_0x1ee151(0xc3)],_0x3df640);}const _0xc53f3d=new Map();for(const _0xb232f of _0x2033e0){_0xc53f3d['set'](_0xb232f['name'],_0xb232f);}for(const _0x19bd20 of _0x2033e0){const _0x10ca05=_0x15cb85[_0x1ee151(0x1aa)](_0x19bd20[_0x1ee151(0xc3)]);if(!_0x10ca05)_0x47a306[_0x1ee151(0x135)]({'type':_0x1ee151(0xf1),'name':_0x19bd20[_0x1ee151(0xc3)],'yamlActivation':_0x19bd20});else{const _0x1b58e8=activationResponseToDef(_0x10ca05,_0x17a317,_0x261349),_0x485469=a142_0x157744[_0x1ee151(0x17c)](_0x1b58e8),_0x2fcdac=a142_0x157744[_0x1ee151(0x17c)](_0x19bd20);_0x485469!==_0x2fcdac&&_0x47a306['push']({'type':'update','name':_0x19bd20[_0x1ee151(0xc3)],'yamlActivation':_0x19bd20,'existingActivation':_0x10ca05});}}for(const _0x29b665 of _0x43179f){!_0xc53f3d[_0x1ee151(0x1c1)](_0x29b665['name'])&&_0x47a306[_0x1ee151(0x135)]({'type':_0x1ee151(0x10c),'name':_0x29b665[_0x1ee151(0xc3)],'existingActivation':_0x29b665});}return _0x47a306;}function calculateYamlDiff(_0x252388,_0x2c2ca7){if(_0x2c2ca7){const _0x26ecd7=generateDiff(_0x2c2ca7,_0x252388),_0x47f634=hasChanges(_0x26ecd7);return{'isNew':![],'hasChanges':_0x47f634,'diff':_0x47f634?formatDiffWithColors(_0x26ecd7):undefined};}const _0x5647f3=generateDiff('',_0x252388);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x5647f3)};}export function calculateSegmentDiff(_0x3bf65e,_0x1e0b4f,_0x1674e9,_0x4b9412,_0x18defc){const _0x583997=segmentToYamlString(_0x3bf65e),_0x3813ad=_0x1e0b4f?segmentToYamlString(segmentWithActivationsToYaml(_0x1e0b4f,_0x1674e9,undefined,_0x4b9412,_0x18defc)):undefined;return calculateYamlDiff(_0x583997,_0x3813ad);}export function calculateJourneyDiff(_0x434f0a,_0x4d94fd){const _0x51b34b=normalizeJourneyDef(_0x434f0a,_0x434f0a),_0x2441c2=a142_0xe1e2b4(_0x51b34b),_0x5cd857=_0x4d94fd?a142_0xe1e2b4(normalizeJourneyDef(_0x4d94fd,_0x434f0a)):undefined;return calculateYamlDiff(_0x2441c2,_0x5cd857);}export function findSegmentsToDelete(_0x4642ac,_0x42eedc,_0x5999a4,_0x1fe6b7,_0x3da363){const _0x5f2fe0=a142_0x11892d,_0x3880fa=new Set();for(const {yamlConfig:_0x364c57,folderPath:_0x3b44e7}of _0x42eedc){_0x3880fa[_0x5f2fe0(0xcc)](_0x3b44e7+':'+_0x364c57['name']);}return _0x4642ac[_0x5f2fe0(0x15c)](_0x3f89b8=>{const _0x3cdce1=_0x5f2fe0,_0x4151fe=_0x3f89b8[_0x3cdce1(0x143)]?_0x5999a4[_0x3cdce1(0x1aa)](_0x3f89b8[_0x3cdce1(0x143)][_0x3cdce1(0x183)]())||'':'',_0x2a20d2=_0x4151fe+':'+_0x3f89b8[_0x3cdce1(0xc3)];if(_0x3880fa[_0x3cdce1(0x1c1)](_0x2a20d2))return![];if(_0x3da363)return _0x4151fe===_0x1fe6b7||_0x4151fe[_0x3cdce1(0x113)](_0x1fe6b7+'/');return!![];});}export function findJourneysToDelete(_0xd1bfaa,_0x229181,_0x43c545,_0x1ee612,_0x24afb6){const _0x10af46=a142_0x11892d,_0x22a706=new Set();for(const {yamlConfig:_0x1ca23d,folderPath:_0x49f6ad}of _0x229181){_0x22a706[_0x10af46(0xcc)](_0x49f6ad+':'+_0x1ca23d[_0x10af46(0xc3)]);}return _0xd1bfaa[_0x10af46(0x15c)](_0x12af51=>{const _0x245e72=_0x10af46,_0x5b6f1a=_0x12af51['folderId']?_0x43c545[_0x245e72(0x1aa)](_0x12af51[_0x245e72(0xe7)])||'':'',_0x3f1a3d=_0x5b6f1a+':'+_0x12af51['journeyBundleName'];if(_0x22a706['has'](_0x3f1a3d))return![];if(_0x24afb6)return _0x5b6f1a===_0x1ee612||_0x5b6f1a['startsWith'](_0x1ee612+'/');return!![];});}export function buildSegmentLookupMap(_0x319544,_0x1ad35a){const _0x1d61ea=a142_0x11892d,_0x2815b8=new Map();for(const _0x41a603 of _0x319544){const _0x19e4d9=_0x41a603[_0x1d61ea(0x143)]?_0x1ad35a['get'](_0x41a603[_0x1d61ea(0x143)]['toString']())||'':'',_0x528916=_0x19e4d9+':'+_0x41a603[_0x1d61ea(0xc3)];_0x2815b8[_0x1d61ea(0x13e)](_0x528916,_0x41a603);}return _0x2815b8;}export function buildSegmentNameToIdMap(_0x180908){const _0x84a734=a142_0x11892d,_0x4aa3a2=new Map();for(const _0x2fb9f0 of _0x180908){_0x4aa3a2[_0x84a734(0x13e)](_0x2fb9f0[_0x84a734(0xc3)],_0x2fb9f0['id']);}return _0x4aa3a2;}export function buildJourneyBundleLookupMap(_0x342214,_0x3311b0){const _0x12d475=a142_0x11892d,_0x38d8d2=new Map();for(const _0x26fce9 of _0x342214){const _0x215971=_0x26fce9['folderId']?_0x3311b0['get'](_0x26fce9[_0x12d475(0xe7)])||'':'',_0x5f1dc6=_0x215971+':'+_0x26fce9[_0x12d475(0x131)];!_0x38d8d2[_0x12d475(0x1c1)](_0x5f1dc6)&&_0x38d8d2[_0x12d475(0x13e)](_0x5f1dc6,[]),_0x38d8d2[_0x12d475(0x1aa)](_0x5f1dc6)[_0x12d475(0x135)](_0x26fce9);}for(const _0x4e1a8a of _0x38d8d2['values']()){_0x4e1a8a[_0x12d475(0x123)]((_0x5a8c4b,_0x13ac5e)=>(_0x5a8c4b[_0x12d475(0x1ac)]||0x0)-(_0x13ac5e[_0x12d475(0x1ac)]||0x0));}return _0x38d8d2;}export function collectFoldersToCreate(_0x403839,_0x26ccdd){const _0x4b5d6d=a142_0x11892d,_0xaa3af0=new Set();for(const _0x341293 of _0x403839){if(!_0x341293)continue;if(_0x26ccdd[_0x4b5d6d(0x1c1)](_0x341293))continue;const _0x23b869=_0x341293[_0x4b5d6d(0x11a)]('/');let _0x1b7007='';for(const _0x307ed4 of _0x23b869){_0x1b7007=_0x1b7007?_0x1b7007+'/'+_0x307ed4:_0x307ed4,!_0x26ccdd[_0x4b5d6d(0x1c1)](_0x1b7007)&&_0xaa3af0[_0x4b5d6d(0xcc)](_0x1b7007);}}return _0xaa3af0;}export function parseAndClassifyYamlFiles(_0x31326b,_0x1293ae,_0x2a145d){const _0x128971=a142_0x11892d,_0xe52643=[],_0x31c776=[];for(const _0x33eea7 of _0x31326b){const _0x41f786=a142_0x22112c[_0x128971(0x134)](_0x1293ae,a142_0x22112c[_0x128971(0x197)](_0x33eea7)),_0x3ca9a9=_0x41f786==='.'?'':_0x41f786,_0x233e71=readFileSync(_0x33eea7,_0x128971(0x189)),_0x2fe4f5=a142_0x157744['parse'](_0x233e71);if(isJourneyDef(_0x2fe4f5)){const _0x3eadb2=a142_0x32e890(_0x233e71);_0x31c776['push']({'yamlConfig':_0x3eadb2,'folderPath':_0x3ca9a9,'sourcePath':_0x33eea7});}else{if(!_0x2a145d?.[_0x128971(0xb9)]){const _0xcd338=parseSegmentYamlFile(_0x233e71),_0x4f7a40=normalizeChildSegmentYaml(_0xcd338);_0xe52643[_0x128971(0x135)]({'yamlConfig':_0x4f7a40,'folderPath':_0x3ca9a9,'sourcePath':_0x33eea7});}}}return{'segments':_0xe52643,'journeys':_0x31c776};}export function validateParsedFiles(_0x14c188,_0x294b32){const _0x31f10b=a142_0x11892d,_0x330081=[];for(const {yamlConfig:_0x2cfb6e,sourcePath:_0x44f3e6}of _0x14c188['segments']){const _0x3498b3=readFileSync(_0x44f3e6,_0x31f10b(0x189)),_0x1d72aa=a142_0x157744['parseDocument'](_0x3498b3),_0x1763bb=validateSegmentDef(_0x2cfb6e,{'source':_0x3498b3,'document':_0x1d72aa},{'skipSchema':!![]});if(!_0x1763bb['valid']){const _0x32c962=a142_0x22112c['relative'](_0x294b32,_0x44f3e6);_0x330081[_0x31f10b(0x135)]({'filePath':_0x32c962,'source':_0x3498b3,'result':_0x1763bb,'isJourney':![]});}}for(const {yamlConfig:_0x54d26b,sourcePath:_0x4d6b85}of _0x14c188[_0x31f10b(0x1b9)]){const _0x2a4ecb=readFileSync(_0x4d6b85,_0x31f10b(0x189)),_0x52c09c=a142_0x157744[_0x31f10b(0x112)](_0x2a4ecb),_0x36348c=validateJourneyDef(_0x54d26b,{'source':_0x2a4ecb,'document':_0x52c09c},{'skipSchema':!![]});if(!_0x36348c[_0x31f10b(0xf0)]){const _0x32d5e8=a142_0x22112c[_0x31f10b(0x134)](_0x294b32,_0x4d6b85);_0x330081[_0x31f10b(0x135)]({'filePath':_0x32d5e8,'source':_0x2a4ecb,'result':_0x36348c,'isJourney':!![]});}}return _0x330081;}export function formatValidationErrors(_0x2c0d81){const _0x469804=a142_0x11892d,_0x1d8b2e=[];for(const {filePath:_0x1e8d94,source:_0x2f0b02,result:_0x404b5b,isJourney:_0xfa6bee}of _0x2c0d81){const _0x54a610=_0xfa6bee?'journey':_0x469804(0x194);_0x1d8b2e['push']('\x0a'+_0x1e8d94+'\x20('+_0x54a610+_0x469804(0x160)+_0x404b5b[_0x469804(0x1b0)]['length']+_0x469804(0x17a)),_0x1d8b2e[_0x469804(0x135)](formatValidationResult(_0x404b5b,_0x2f0b02,_0x1e8d94));}return _0x1d8b2e[_0x469804(0xe4)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x35cbab){const _0x4ad9d6=a142_0x11892d,_0x55d915=new Set(),_0x49e19c=new Map(),_0xcf4e68=collectSegmentUsageCounts(_0x35cbab);if(_0x35cbab[_0x4ad9d6(0x185)])for(const [_0x27fed4,_0x5d0b3e]of Object[_0x4ad9d6(0x141)](_0x35cbab[_0x4ad9d6(0x185)])){_0x55d915[_0x4ad9d6(0xcc)](_0x27fed4);if(_0x5d0b3e[_0x4ad9d6(0x10b)]){const _0x172283=yamlRuleToApi(_0x5d0b3e[_0x4ad9d6(0x10b)]),_0x533c78=apiRuleToYaml(_0x172283);_0x49e19c['set'](_0x27fed4,_0x533c78);}}const _0x1b52d1=new Map();let _0x4f4c1e=0x0;for(const [_0x577b1e,_0x4b622c]of _0x49e19c){const _0x132b87=serializeExpandedRule(_0x4b622c,_0x49e19c),_0x4e311c=_0x1b52d1[_0x4ad9d6(0x1aa)](_0x132b87)||[];_0x4e311c['push']({'name':_0x577b1e,'index':_0x4f4c1e}),_0x1b52d1[_0x4ad9d6(0x13e)](_0x132b87,_0x4e311c),_0x4f4c1e++;}const _0x2bf442=new Map();for(const [_0x5d958a,_0x2f0b03]of _0x1b52d1){const _0x3784e4=_0x2f0b03[_0x4ad9d6(0x126)]()[_0x4ad9d6(0x123)]((_0x65aa66,_0x33c533)=>{const _0x3ed989=_0x4ad9d6,_0x3a3431=_0xcf4e68[_0x3ed989(0x1aa)](_0x65aa66['name'])||0x0,_0x232903=_0xcf4e68[_0x3ed989(0x1aa)](_0x33c533['name'])||0x0;if(_0x3a3431!==_0x232903)return _0x232903-_0x3a3431;return _0x65aa66[_0x3ed989(0x1a4)]-_0x33c533[_0x3ed989(0x1a4)];})[_0x4ad9d6(0xc7)](_0x180f12=>_0x180f12[_0x4ad9d6(0xc3)]),_0x7131b8=[];for(const _0x313282 of _0x3784e4){const _0x25e4f0=_0xcf4e68[_0x4ad9d6(0x1aa)](_0x313282)||0x0,_0x208f60=Math[_0x4ad9d6(0x1b1)](_0x25e4f0,0x1);for(let _0x5aa072=0x0;_0x5aa072<_0x208f60;_0x5aa072++){_0x7131b8[_0x4ad9d6(0x135)](_0x313282);}}_0x2bf442[_0x4ad9d6(0x13e)](_0x5d958a,_0x7131b8);}return{'existingLocalSegmentNames':_0x55d915,'localSegmentRules':_0x49e19c,'localExpandedRuleToNames':_0x2bf442};}export function createSegmentIdResolver(_0x38ca67,_0x5f705e){return async _0x3efafa=>{const _0x4e9971=a142_0x1405,_0x5d0a61=_0x38ca67['get'](_0x3efafa);if(!_0x5d0a61)throw new SDKError(ErrorCode[_0x4e9971(0x156)],'Segment\x20not\x20found:\x20'+_0x3efafa+_0x4e9971(0x10e)+_0x5f705e+'\x27)');return _0x5d0a61;};}export function extractRootFolderId(_0x1b8aa5){const _0x1e43e3=a142_0x11892d;return _0x1b8aa5[_0x1e43e3(0xef)]?.[_0x1e43e3(0x127)]?.[_0x1e43e3(0x180)]?.['id']||_0x1b8aa5[_0x1e43e3(0xef)]?.['parentFolder']?.[_0x1e43e3(0x180)]?.['id'];}export function buildConnectionMaps(_0x4d83d8){const _0x38aaca=a142_0x11892d,_0x2c029c=new Map(),_0x1e13a0=new Map(),_0x4c8b4e=new Map();for(const _0x1dc061 of _0x4d83d8){_0x2c029c[_0x38aaca(0x13e)](_0x1dc061[_0x38aaca(0xc3)],parseInt(_0x1dc061['id'],0xa)),_0x1e13a0[_0x38aaca(0x13e)](_0x1dc061['id'],_0x1dc061[_0x38aaca(0xc3)]),_0x4c8b4e[_0x38aaca(0x13e)](_0x1dc061[_0x38aaca(0xc3)],_0x1dc061['type']);}return{'nameToId':_0x2c029c,'idToName':_0x1e13a0,'nameToType':_0x4c8b4e};}export function calculatePushStats(_0x39f839,_0x475bcb,_0x43526e,_0x4c3ae1,_0x7f7560,_0x2468cd,_0x157f1a){const _0x2d3f2d=a142_0x11892d,_0x35fda1=_0x39f839[_0x2d3f2d(0x15c)](_0x5259f7=>_0x5259f7[_0x2d3f2d(0x17e)]),_0x479a5b=_0x39f839[_0x2d3f2d(0x15c)](_0xe79346=>!_0xe79346[_0x2d3f2d(0x17e)]&&_0xe79346[_0x2d3f2d(0x184)]),_0x224da4=_0x39f839['filter'](_0x3b3e15=>!_0x3b3e15[_0x2d3f2d(0x17e)]&&!_0x3b3e15[_0x2d3f2d(0x184)]),_0x50377f=_0x2468cd?_0x4c3ae1:[],_0x3b0136=_0x475bcb[_0x2d3f2d(0x15c)](_0x2c9c36=>_0x2c9c36[_0x2d3f2d(0x17e)]),_0x1b504b=_0x475bcb[_0x2d3f2d(0x15c)](_0x2129ee=>!_0x2129ee[_0x2d3f2d(0x17e)]&&_0x2129ee[_0x2d3f2d(0x184)]),_0x1cae53=_0x475bcb[_0x2d3f2d(0x15c)](_0x278441=>!_0x278441[_0x2d3f2d(0x17e)]&&!_0x278441[_0x2d3f2d(0x184)]),_0x27b97a=_0x2468cd?_0x7f7560:[],_0xf47ba7=_0x39f839[_0x2d3f2d(0xf7)](_0x3fb4f5=>_0x3fb4f5[_0x2d3f2d(0x117)]),_0x55d9b8=_0xf47ba7[_0x2d3f2d(0x15c)](_0x1a51e5=>_0x1a51e5['type']==='create'),_0x1b122e=_0xf47ba7[_0x2d3f2d(0x15c)](_0x3ac413=>_0x3ac413['type']==='update'),_0x4d7e17=_0xf47ba7[_0x2d3f2d(0x15c)](_0x4abd71=>_0x4abd71['type']==='delete'),_0x136bed=Array[_0x2d3f2d(0xbb)](_0x43526e)['sort'](),_0x51a68e=_0x157f1a?![]:_0x35fda1[_0x2d3f2d(0x12a)]>0x0||_0x479a5b[_0x2d3f2d(0x12a)]>0x0||_0x50377f[_0x2d3f2d(0x12a)]>0x0,_0x32db4f=_0x3b0136['length']>0x0||_0x1b504b[_0x2d3f2d(0x12a)]>0x0||_0x27b97a[_0x2d3f2d(0x12a)]>0x0,_0x11135e=_0x157f1a?![]:_0xf47ba7[_0x2d3f2d(0x12a)]>0x0,_0x6fc7d7=_0x136bed[_0x2d3f2d(0x12a)]>0x0;return{'segments':{'new':_0x35fda1,'changed':_0x479a5b,'unchanged':_0x224da4,'toDelete':_0x50377f},'journeys':{'new':_0x3b0136,'changed':_0x1b504b,'unchanged':_0x1cae53,'toDelete':_0x27b97a},'activations':{'all':_0xf47ba7,'toCreate':_0x55d9b8,'toUpdate':_0x1b122e,'toDelete':_0x4d7e17},'folders':{'toCreate':_0x136bed},'counts':{'segments':{'new':_0x35fda1[_0x2d3f2d(0x12a)],'changed':_0x479a5b[_0x2d3f2d(0x12a)],'unchanged':_0x224da4['length'],'toDelete':_0x50377f[_0x2d3f2d(0x12a)]},'journeys':{'new':_0x3b0136[_0x2d3f2d(0x12a)],'changed':_0x1b504b[_0x2d3f2d(0x12a)],'unchanged':_0x1cae53[_0x2d3f2d(0x12a)],'toDelete':_0x27b97a[_0x2d3f2d(0x12a)]},'activations':{'create':_0x55d9b8[_0x2d3f2d(0x12a)],'update':_0x1b122e[_0x2d3f2d(0x12a)],'delete':_0x4d7e17['length']},'folders':_0x136bed[_0x2d3f2d(0x12a)]},'hasChanges':_0x51a68e||_0x32db4f||_0x11135e||_0x6fc7d7};}export async function buildPushExecutionContext(_0x359fd4,_0x23e7ac,_0x3fd8b5,_0x4977db,_0x297732,_0x837f78){const _0x32c7ac=a142_0x11892d,_0x38b638=extractRootFolderId(_0x3fd8b5),{pathToId:_0x2cb80d,idToPath:_0x57b2a3}=buildFolderMaps(_0x297732),_0x4e73ac=buildSegmentNameToIdMap(_0x4977db),_0x19d72c=new Map(),{batchAsync:_0xea73ca}=await import(_0x32c7ac(0x182)),[_0x3649e5,_0x24fe76]=await Promise[_0x32c7ac(0xd7)]([_0x359fd4[_0x32c7ac(0xc1)][_0x32c7ac(0x145)](),_0x359fd4['connection']['list'](),((async()=>{!_0x837f78&&_0x4977db['length']>0x0&&await _0xea73ca(_0x4977db,async _0x28a5cb=>{const _0x59b016=a142_0x1405,_0x35f420=await _0x359fd4[_0x59b016(0x194)]['listActivations'](_0x23e7ac,_0x28a5cb['id']);_0x19d72c[_0x59b016(0x13e)](_0x28a5cb['id'],_0x35f420);});})())]),{emailToId:_0x187fdf,idToEmail:_0x33fccb}=_0x3649e5,_0x290230=buildConnectionMaps(_0x24fe76);return{'rootFolderId':_0x38b638,'folderPathToId':_0x2cb80d,'folderIdToPath':_0x57b2a3,'segmentNameToId':_0x4e73ac,'activationsBySegmentId':_0x19d72c,'emailToIdMap':_0x187fdf,'idToEmailMap':_0x33fccb,'connectionNameToIdMap':_0x290230[_0x32c7ac(0xd2)],'connectionIdToNameMap':_0x290230['idToName'],'connectionNameToTypeMap':_0x290230[_0x32c7ac(0x158)]};}export function createPushYamlContextForBundle(_0x5b98a5,_0x1b78ef,_0x147174,_0x379f04,_0x3b18c7,_0x25930b,_0x46a230,_0x33f005){const {existingLocalSegmentNames:_0x34cef9,localExpandedRuleToNames:_0x579a95}=_0x379f04,_0x12e0be=new Set(),_0x1bbb9d=new Map(),_0x35fcfe=new Map(),_0x5b1de6=new Map(),_0x1af040=createJumpTargetCache(),_0x52ed8b=new Map(),_0xd213d=new Map(),_0x2f12c0=new Set();let _0x3cf9a1;const _0x36ec38=_0x401100=>{const _0x4b191d={'resolveSegment':async _0x21823f=>{const _0x56fc4a=a142_0x1405,_0x534174=_0x5b1de6[_0x56fc4a(0x1aa)](_0x21823f);if(_0x534174!==undefined)return{'name':_0x534174,'isJourneyLocal':!![]};try{const _0x633178=await fetchSegment(_0x5b98a5,_0x1b78ef,_0x21823f,_0x147174);if(!_0x633178)throw new Error('Segment\x20not\x20found');const _0x46834c=generateJourneyLocalName(_0x633178[_0x56fc4a(0xc3)]),_0x5c5087=_0x633178[_0x56fc4a(0x140)]===SEGMENT_KIND_JOURNEY&&_0x46834c!==undefined;let _0x1f918b=_0x633178[_0x56fc4a(0xc3)],_0x391d1b;if(_0x5c5087&&_0x633178['rule']){const _0xe557f=apiRuleToYaml(_0x633178[_0x56fc4a(0x10b)]);_0xd213d[_0x56fc4a(0x13e)](_0x21823f,_0xe557f);const _0x40b05b=async _0xbc888c=>{const _0x15352b=_0x56fc4a,_0x304687=collectSegmentRefsFromRule(_0xbc888c);for(const _0x39225c of _0x304687){if(!_0xd213d[_0x15352b(0x1c1)](_0x39225c))try{const _0x2a5478=await fetchSegment(_0x5b98a5,_0x1b78ef,_0x39225c,_0x147174);if(_0x2a5478?.[_0x15352b(0x10b)]){const _0x31aa60=apiRuleToYaml(_0x2a5478[_0x15352b(0x10b)]);_0xd213d['set'](_0x39225c,_0x31aa60),await _0x40b05b(_0x31aa60);}}catch(_0x2fd69a){logger[_0x15352b(0xe1)](_0x15352b(0x14f)+_0x39225c+':\x20'+_0x2fd69a);}}};await _0x40b05b(_0xe557f);const _0x2f3e45=serializeExpandedRule(_0xe557f,_0xd213d),_0x54d7eb=_0x579a95[_0x56fc4a(0x1aa)](_0x2f3e45);if(_0x54d7eb&&_0x54d7eb['length']>0x0){const _0x123089=_0x1bbb9d[_0x56fc4a(0x1aa)](_0x2f3e45)||0x0,_0x3299b6=_0x54d7eb[_0x123089]||_0x54d7eb[_0x54d7eb['length']-0x1];_0x1bbb9d['set'](_0x2f3e45,_0x123089+0x1),_0x1f918b=_0x3299b6,_0x12e0be[_0x56fc4a(0xcc)](_0x1f918b),_0x5b1de6[_0x56fc4a(0x13e)](_0x21823f,_0x1f918b);const _0x389e28=await resolveRuleSegmentRefs(_0xe557f,async _0xa00363=>{const _0x23b5fe=_0x56fc4a,_0x1bb670=_0x5b1de6['get'](_0xa00363);if(_0x1bb670)return _0x1bb670;const _0x2962f7=await _0x3cf9a1[_0x23b5fe(0x109)](_0xa00363);return _0x2962f7['name'];});_0x391d1b={'description':_0x633178[_0x56fc4a(0xde)],'rule':_0x389e28};}else{const _0x508fdb=_0x52ed8b[_0x56fc4a(0x1aa)](_0x2f3e45);if(_0x508fdb)_0x1f918b=_0x508fdb,_0x5b1de6[_0x56fc4a(0x13e)](_0x21823f,_0x1f918b);else{if(_0x46834c){let _0x9994e3=_0x46834c,_0x23ba73=0x2;while(_0x12e0be[_0x56fc4a(0x1c1)](_0x9994e3)||_0x34cef9[_0x56fc4a(0x1c1)](_0x9994e3)){_0x9994e3=_0x46834c+'_'+_0x23ba73,_0x23ba73++;}_0x12e0be['add'](_0x9994e3),_0x1f918b=_0x9994e3;}_0x5b1de6[_0x56fc4a(0x13e)](_0x21823f,_0x1f918b),_0x52ed8b[_0x56fc4a(0x13e)](_0x2f3e45,_0x1f918b);const _0x22c6b7=await resolveRuleSegmentRefs(_0xe557f,async _0x291ea0=>{const _0x3d4891=_0x56fc4a,_0x514422=_0x5b1de6['get'](_0x291ea0);if(_0x514422)return _0x514422;const _0xbcf4c9=await _0x3cf9a1[_0x3d4891(0x109)](_0x291ea0);return _0xbcf4c9['name'];});_0x391d1b={'description':_0x633178['description'],'rule':_0x22c6b7};}}}return{'name':_0x1f918b,'isJourneyLocal':_0x5c5087,'definition':_0x391d1b};}catch(_0x4146f3){return logger[_0x56fc4a(0xe1)](_0x56fc4a(0x108)+_0x21823f+':\x20'+_0x4146f3),{'name':_0x21823f,'isJourneyLocal':![]};}},'resolveActivation':async _0x4bdec6=>{const _0x2e0655=a142_0x1405,_0x5e5815=_0x35fcfe['get'](_0x4bdec6);if(_0x5e5815!==undefined)return{'name':_0x5e5815,'isJourneyLocal':!![]};try{let _0xa9f220=_0x46a230?.[_0x2e0655(0x1aa)](_0x4bdec6);!_0xa9f220&&(_0xa9f220=await _0x5b98a5[_0x2e0655(0x1ab)]['getActivation'](_0x401100,_0x4bdec6));const _0x44c151=_0xa9f220['attributes'][_0x2e0655(0x105)][_0x2e0655(0xc3)]||_0x4bdec6,_0x1fc0fa=sanitizeYamlKey(_0x44c151)||_0x2e0655(0x1a5)+_0x4bdec6,_0x591df4=_0x1fc0fa;_0x35fcfe[_0x2e0655(0x13e)](_0x4bdec6,_0x591df4);const _0x317277=journeyActivationStepToYaml(_0xa9f220,_0x3b18c7,_0x25930b);return{'name':_0x591df4,'isJourneyLocal':!![],'definition':_0x317277};}catch(_0x5dde91){return logger[_0x2e0655(0xe1)](_0x2e0655(0x192)+_0x4bdec6+':\x20'+_0x5dde91),{'name':_0x4bdec6,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x48c2d5,_0x258547)=>resolveJumpTarget(_0x48c2d5,_0x258547,_0x1af040,async _0x4b5acd=>{const _0x365f93=a142_0x1405,_0x101a16=_0x33f005?.[_0x365f93(0x1aa)](_0x4b5acd);if(_0x101a16)return _0x101a16;return _0x5b98a5[_0x365f93(0x1ab)]['getJourney'](_0x4b5acd);})};return _0x3cf9a1=_0x4b191d,_0x4b191d;},_0x39c30b=async _0x4c2119=>{const _0x376077=a142_0x1405,{collectSegmentIdsFromJourneyApi:_0x2e8d4e}=await import('./journey-yaml.js'),{batchAsync:_0xbfe1b4}=await import(_0x376077(0x182)),_0x55b9c4=new Set();for(const _0x5a3eec of _0x4c2119){let _0x19818b=_0x33f005?.[_0x376077(0x1aa)](_0x5a3eec);!_0x19818b&&(_0x19818b=await _0x5b98a5[_0x376077(0x1ab)][_0x376077(0x16c)](_0x5a3eec));const _0x3fae44=_0x2e8d4e(_0x19818b);for(const _0x175f5e of _0x3fae44){_0x55b9c4['add'](_0x175f5e);}}let _0x1204f4=Array[_0x376077(0xbb)](_0x55b9c4);while(_0x1204f4[_0x376077(0x12a)]>0x0){const _0x489c9d=_0x1204f4[_0x376077(0x15c)](_0x12036b=>!_0x2f12c0[_0x376077(0x1c1)](_0x12036b));if(_0x489c9d[_0x376077(0x12a)]===0x0)break;const _0x41a2a6=await _0xbfe1b4(_0x489c9d,async _0x1177fd=>{_0x2f12c0['add'](_0x1177fd);const _0x16e9d1=await fetchSegment(_0x5b98a5,_0x1b78ef,_0x1177fd,_0x147174);if(!_0x16e9d1)return null;return{'segmentId':_0x1177fd,'segment':_0x16e9d1};},0xa),_0x3b5d86=new Set();for(const _0x5b36d5 of _0x41a2a6){if(!_0x5b36d5?.[_0x376077(0x194)]?.[_0x376077(0x10b)])continue;const _0x4d96bb=apiRuleToYaml(_0x5b36d5[_0x376077(0x194)][_0x376077(0x10b)]);_0xd213d[_0x376077(0x13e)](_0x5b36d5[_0x376077(0xd6)],_0x4d96bb);const _0x4c24ce=collectSegmentRefsFromRule(_0x4d96bb);for(const _0x973fb0 of _0x4c24ce){!_0x2f12c0[_0x376077(0x1c1)](_0x973fb0)&&_0x3b5d86['add'](_0x973fb0);}}_0x1204f4=Array['from'](_0x3b5d86);}};return{'createYamlContext':_0x36ec38,'prefetchJourneySegments':_0x39c30b};}export async function executePushSegments(_0x4cb7c7,_0x44b58d,_0x5d8803,_0x4fa401,_0x3cdc93){const _0x4bb01e=a142_0x11892d,{segmentDefToCreateRequest:_0x3eea69,segmentDefToUpdateRequest:_0x5a2212}=await import(_0x4bb01e(0x136)),_0x2e50d1=_0x5d8803[_0x4bb01e(0x1a0)],_0x583a2d=0x5,_0x469f56=async _0x10dfa6=>{const _0x56e483=_0x4bb01e,_0x50408c=_0x10dfa6['folderPath']?_0x2e50d1[_0x56e483(0x1aa)](_0x10dfa6[_0x56e483(0x116)]):undefined;let _0x1a0dcc;const _0x1a0cbb={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x207442=_0x10dfa6[_0x56e483(0xd1)];if(_0x10dfa6['yamlConfig'][_0x56e483(0x10b)]){const _0x3681da=createSegmentIdResolver(_0x5d8803['segmentNameToId'],_0x10dfa6[_0x56e483(0xd1)][_0x56e483(0xc3)]),_0xba7ccd=await resolveRuleSegmentIds(_0x10dfa6['yamlConfig'][_0x56e483(0x10b)],_0x3681da);_0x207442={..._0x10dfa6[_0x56e483(0xd1)],'rule':_0xba7ccd};}try{if(_0x10dfa6[_0x56e483(0x17e)]){_0x3cdc93[_0x56e483(0x1a2)]?.({'type':_0x56e483(0x110),'name':_0x10dfa6[_0x56e483(0xd1)][_0x56e483(0xc3)]});const _0x26e0e8=_0x3eea69(_0x207442,_0x50408c),_0x24afae=await _0x3cdc93[_0x56e483(0xca)]('Creating\x20segment\x20\x27'+_0x10dfa6['yamlConfig'][_0x56e483(0xc3)]+_0x56e483(0x19e),()=>_0x4cb7c7[_0x56e483(0x194)][_0x56e483(0xea)](_0x4fa401['parentId'],_0x26e0e8));_0x1a0dcc=_0x24afae[_0x56e483(0x180)]['id'],_0x5d8803['segmentNameToId'][_0x56e483(0x13e)](_0x10dfa6['yamlConfig'][_0x56e483(0xc3)],_0x1a0dcc),_0x1a0cbb[_0x56e483(0xce)]={'name':_0x10dfa6[_0x56e483(0xd1)][_0x56e483(0xc3)],'id':_0x1a0dcc},_0x3cdc93['onProgress']?.({'type':_0x56e483(0xf4),'name':_0x10dfa6[_0x56e483(0xd1)][_0x56e483(0xc3)],'segmentId':_0x1a0dcc}),_0x3cdc93[_0x56e483(0x167)]?.(_0x56e483(0x12c)+_0x10dfa6[_0x56e483(0xd1)][_0x56e483(0xc3)]+'\x27'),_0x1a0cbb[_0x56e483(0x14b)]=0x1;}else{if(_0x10dfa6[_0x56e483(0x184)]){_0x3cdc93[_0x56e483(0x1a2)]?.({'type':_0x56e483(0x155),'name':_0x10dfa6[_0x56e483(0xd1)]['name']});const _0x43865e=_0x5a2212(_0x207442);_0x50408c!==_0x10dfa6[_0x56e483(0x107)]?.[_0x56e483(0x143)]&&(_0x43865e[_0x56e483(0x143)]=_0x50408c?parseInt(_0x50408c,0xa):undefined),await _0x3cdc93[_0x56e483(0xca)](_0x56e483(0x1bc)+_0x10dfa6['yamlConfig'][_0x56e483(0xc3)]+_0x56e483(0x19e),()=>_0x4cb7c7[_0x56e483(0x194)][_0x56e483(0x14a)](_0x4fa401[_0x56e483(0x14d)],_0x10dfa6[_0x56e483(0x107)]['id'],_0x43865e)),_0x1a0dcc=_0x10dfa6[_0x56e483(0x107)]['id'],_0x3cdc93[_0x56e483(0x1a2)]?.({'type':_0x56e483(0x162),'name':_0x10dfa6[_0x56e483(0xd1)]['name']}),_0x3cdc93['logSuccess']?.(_0x56e483(0x1b5)+_0x10dfa6[_0x56e483(0xd1)]['name']+'\x27'),_0x1a0cbb[_0x56e483(0x129)]=0x1;}else _0x1a0dcc=_0x10dfa6['existingSegment']['id'];}}catch(_0x306a1d){const _0x26052e=isHttp400Error(_0x306a1d),_0xcf49b3=_0x26052e?ErrorCode[_0x56e483(0xc0)]:ErrorCode['SEGMENT_UPDATE_ERROR'],_0x586afc=getErrorMessage(_0x306a1d);throw new SDKError(_0xcf49b3,_0x56e483(0x1ae)+(_0x10dfa6[_0x56e483(0x17e)]?_0x56e483(0xf1):_0x56e483(0x14e))+_0x56e483(0x17b)+_0x10dfa6[_0x56e483(0x111)]+_0x56e483(0x119)+_0x586afc,_0x306a1d);}try{const _0x35bf24=await syncActivationsForSegment(_0x4cb7c7,_0x4fa401[_0x56e483(0x14d)],_0x1a0dcc,_0x10dfa6[_0x56e483(0xd1)][_0x56e483(0xc3)],_0x10dfa6['activationActions'],_0x3cdc93,_0x10dfa6[_0x56e483(0x111)]);_0x1a0cbb['activations']=_0x35bf24;}catch(_0x33a5af){if(_0x33a5af instanceof SDKError)throw _0x33a5af;throw new SDKError(ErrorCode[_0x56e483(0xc4)],_0x56e483(0x1b8)+_0x10dfa6['yamlConfig']['name']+_0x56e483(0x175)+_0x10dfa6[_0x56e483(0x111)]+'\x0a\x20\x20'+getErrorMessage(_0x33a5af),_0x33a5af);}return _0x1a0cbb;},_0x4a59f4=await batchAsync(_0x44b58d,_0x469f56,_0x583a2d),_0x16e4dd={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x37bb9d of _0x4a59f4){_0x16e4dd[_0x4bb01e(0x14b)]+=_0x37bb9d[_0x4bb01e(0x14b)],_0x16e4dd[_0x4bb01e(0x129)]+=_0x37bb9d[_0x4bb01e(0x129)],_0x37bb9d[_0x4bb01e(0xce)]&&_0x16e4dd[_0x4bb01e(0x16f)][_0x4bb01e(0x13e)](_0x37bb9d[_0x4bb01e(0xce)]['name'],_0x37bb9d[_0x4bb01e(0xce)]['id']),_0x16e4dd[_0x4bb01e(0x169)][_0x4bb01e(0x14b)]+=_0x37bb9d[_0x4bb01e(0x169)][_0x4bb01e(0x14b)],_0x16e4dd[_0x4bb01e(0x169)][_0x4bb01e(0x129)]+=_0x37bb9d[_0x4bb01e(0x169)][_0x4bb01e(0x129)],_0x16e4dd[_0x4bb01e(0x169)][_0x4bb01e(0x132)]+=_0x37bb9d[_0x4bb01e(0x169)]['deleted'];}return _0x16e4dd;}function a142_0x1405(_0x289c7f,_0x1796f6){_0x289c7f=_0x289c7f-0xb9;const _0x3e6b5b=a142_0x3e6b();let _0x1405e5=_0x3e6b5b[_0x289c7f];return _0x1405e5;}async function syncActivationsForSegment(_0x5cb3f9,_0x156542,_0x25adf8,_0x2ed541,_0xfe65aa,_0x554c42,_0xe5ff29){const _0x3fe6de=a142_0x11892d,_0x21b11e={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x5db66d of _0xfe65aa){try{if(_0x5db66d[_0x3fe6de(0x11c)]==='create'&&_0x5db66d[_0x3fe6de(0xc8)])_0x554c42[_0x3fe6de(0x1a2)]?.({'type':'activation_creating','segmentName':_0x2ed541,'activationName':_0x5db66d['name']}),await _0x554c42[_0x3fe6de(0xca)](_0x3fe6de(0xd8)+_0x5db66d['name']+_0x3fe6de(0x19e),()=>_0x5cb3f9[_0x3fe6de(0x194)]['createActivation'](_0x156542,_0x25adf8,_0x5db66d[_0x3fe6de(0xc8)])),_0x554c42['onProgress']?.({'type':_0x3fe6de(0x149),'segmentName':_0x2ed541,'activationName':_0x5db66d['name']}),_0x554c42['logSuccess']?.(_0x3fe6de(0x18d)+_0x5db66d[_0x3fe6de(0xc3)]+'\x27'),_0x21b11e[_0x3fe6de(0x14b)]++;else{if(_0x5db66d[_0x3fe6de(0x11c)]===_0x3fe6de(0x14e)&&_0x5db66d[_0x3fe6de(0xc8)]&&_0x5db66d[_0x3fe6de(0x157)])_0x554c42['onProgress']?.({'type':_0x3fe6de(0x151),'segmentName':_0x2ed541,'activationName':_0x5db66d['name']}),await _0x554c42[_0x3fe6de(0xca)]('Updating\x20activation\x20\x27'+_0x5db66d[_0x3fe6de(0xc3)]+_0x3fe6de(0x19e),()=>_0x5cb3f9[_0x3fe6de(0x194)][_0x3fe6de(0x13f)](_0x156542,_0x25adf8,_0x5db66d[_0x3fe6de(0x157)]['id'],_0x5db66d['validatedRequest'])),_0x554c42['onProgress']?.({'type':_0x3fe6de(0xbc),'segmentName':_0x2ed541,'activationName':_0x5db66d[_0x3fe6de(0xc3)]}),_0x554c42[_0x3fe6de(0x167)]?.(_0x3fe6de(0x17f)+_0x5db66d[_0x3fe6de(0xc3)]+'\x27'),_0x21b11e[_0x3fe6de(0x129)]++;else _0x5db66d[_0x3fe6de(0x11c)]===_0x3fe6de(0x10c)&&_0x5db66d[_0x3fe6de(0x157)]&&(_0x554c42[_0x3fe6de(0x1a2)]?.({'type':_0x3fe6de(0xcf),'segmentName':_0x2ed541,'activationName':_0x5db66d[_0x3fe6de(0xc3)]}),await _0x554c42[_0x3fe6de(0xca)](_0x3fe6de(0xf6)+_0x5db66d[_0x3fe6de(0xc3)]+'\x27...',()=>_0x5cb3f9['segment'][_0x3fe6de(0x11e)](_0x156542,_0x25adf8,_0x5db66d[_0x3fe6de(0x157)]['id'])),_0x554c42[_0x3fe6de(0x1a2)]?.({'type':_0x3fe6de(0x1b4),'segmentName':_0x2ed541,'activationName':_0x5db66d['name']}),_0x554c42[_0x3fe6de(0x11f)]?.(_0x3fe6de(0x16d)+_0x5db66d[_0x3fe6de(0xc3)]+'\x27'),_0x21b11e['deleted']++);}}catch(_0x45fba3){const _0xb32a88=isHttp400Error(_0x45fba3),_0x25f48e=_0xb32a88?ErrorCode[_0x3fe6de(0x196)]:ErrorCode[_0x3fe6de(0xc4)],_0x117e3d=getErrorMessage(_0x45fba3);throw new SDKError(_0x25f48e,'Failed\x20to\x20'+_0x5db66d[_0x3fe6de(0x11c)]+'\x20activation\x20\x27'+_0x5db66d[_0x3fe6de(0xc3)]+_0x3fe6de(0x175)+_0xe5ff29+_0x3fe6de(0x119)+_0x117e3d,_0x45fba3);}}return _0x21b11e;}export async function executePushFolders(_0x323ffb,_0x5839cc,_0x31e2d4,_0x153e92,_0x50f254){const _0x5c2fe2=a142_0x11892d,_0x52945a=new Map(_0x31e2d4),_0x3246ef=sortFoldersByDepth(_0x5839cc);for(const _0xa8346a of _0x3246ef){const _0x55bf46=_0xa8346a[_0x5c2fe2(0x11a)]('/'),_0x257fae=_0x55bf46[_0x55bf46[_0x5c2fe2(0x12a)]-0x1],_0x1a4641=_0x55bf46[_0x5c2fe2(0x126)](0x0,-0x1)[_0x5c2fe2(0xe4)]('/'),_0x444d2d=_0x52945a['get'](_0x1a4641);_0x50f254['onProgress']?.({'type':_0x5c2fe2(0x133),'folder':_0xa8346a});const _0x54baaa={'name':_0x257fae,'parentFolderId':_0x444d2d},_0xc949=await _0x50f254['withProgress'](_0x5c2fe2(0x10a)+_0xa8346a+_0x5c2fe2(0x19e),()=>_0x323ffb[_0x5c2fe2(0x194)][_0x5c2fe2(0x161)](_0x153e92['parentId'],_0x54baaa));_0x52945a[_0x5c2fe2(0x13e)](_0xa8346a,_0xc949[_0x5c2fe2(0x180)]['id']),_0x50f254[_0x5c2fe2(0x1a2)]?.({'type':_0x5c2fe2(0x1be),'folder':_0xa8346a,'folderId':_0xc949[_0x5c2fe2(0x180)]['id']}),_0x50f254[_0x5c2fe2(0x1ba)]?.('Created\x20folder\x20\x27'+_0xa8346a+'\x27');}return _0x52945a;}export async function executePushSegmentDeletions(_0x5d28a4,_0x3268f0,_0x5aa6ef){const _0x82aa64=a142_0x11892d;if(_0x3268f0['length']===0x0)return 0x0;const {batchAsync:_0x2205d5}=await import(_0x82aa64(0x182)),_0x22ae8e=0x5,_0x492715=await _0x2205d5(_0x3268f0,async _0x3f7d62=>{const _0x471cde=_0x82aa64;return _0x5aa6ef[_0x471cde(0x1a2)]?.({'type':_0x471cde(0xcb),'name':_0x3f7d62[_0x471cde(0xc3)]}),await _0x5d28a4['segment']['deleteSegment'](_0x3f7d62['id']),_0x5aa6ef[_0x471cde(0x1a2)]?.({'type':_0x471cde(0x181),'name':_0x3f7d62[_0x471cde(0xc3)]}),_0x5aa6ef[_0x471cde(0x11f)]?.('Deleted\x20segment\x20\x27'+_0x3f7d62['name']+'\x27'),0x1;},_0x22ae8e);return _0x492715[_0x82aa64(0xf8)]((_0x3aa4f7,_0x5f011f)=>_0x3aa4f7+_0x5f011f,0x0);}export async function executePushJourneys(_0x2fd453,_0x5ec88a,_0xac21b,_0x158d70,_0x152d7e){const _0x144808=a142_0x11892d,{journeyDefToRequest:_0x47e1fb}=await import(_0x144808(0x1a9)),{activationDefToCreateRequest:_0x5a4383,yamlRuleToApi:_0x12866a,validateSegmentRule:_0x39b8de}=await import('./child-segment-yaml.js'),_0x373e5a={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x279da0=new Map(_0xac21b[_0x144808(0xf2)]),_0x283bd7=0x5;for(let _0xe78abb=0x0;_0xe78abb<_0x5ec88a[_0x144808(0x12a)];_0xe78abb+=_0x283bd7){const _0x354928=_0x5ec88a['slice'](_0xe78abb,_0xe78abb+_0x283bd7),_0x420c3b=await Promise['all'](_0x354928[_0x144808(0xc7)](async _0x2fb8f7=>{const _0xd5e137=_0x144808;if(!_0x2fb8f7[_0xd5e137(0x17e)]&&!_0x2fb8f7[_0xd5e137(0x184)])return{'action':'unchanged','name':_0x2fb8f7[_0xd5e137(0xd1)][_0xd5e137(0xc3)],'journeyId':_0x2fb8f7[_0xd5e137(0x1a7)]?.['id']};const _0x4e162a=_0x2fb8f7['folderPath']?_0xac21b[_0xd5e137(0x1a0)][_0xd5e137(0x1aa)](_0x2fb8f7[_0xd5e137(0x116)]):undefined;_0x152d7e[_0xd5e137(0x1a2)]?.({'type':_0x2fb8f7[_0xd5e137(0x17e)]?_0xd5e137(0x115):'journey_updating','name':_0x2fb8f7[_0xd5e137(0xd1)][_0xd5e137(0xc3)]});try{const _0x444dd8=await executeSingleJourneyPush(_0x2fd453,_0x2fb8f7,{..._0xac21b,'segmentNameToId':_0x279da0},{'parentId':_0x158d70[_0xd5e137(0x14d)],'rootFolderId':_0x158d70[_0xd5e137(0x1ad)],'folderId':_0x4e162a,'verbose':_0x158d70[_0xd5e137(0xe3)]},_0x152d7e,{'journeyDefToRequest':_0x47e1fb,'activationDefToCreateRequest':_0x5a4383,'yamlRuleToApi':_0x12866a,'validateSegmentRule':_0x39b8de});for(const [_0x19f23c,_0x2a770f]of _0x444dd8['embeddedSegmentNameToId']){_0x279da0[_0xd5e137(0x13e)](_0x19f23c,_0x2a770f),_0x373e5a[_0xd5e137(0x153)]['set'](_0x19f23c,_0x2a770f);}if(_0x444dd8[_0xd5e137(0x1a1)]===_0xd5e137(0x14b))_0x152d7e[_0xd5e137(0x1a2)]?.({'type':_0xd5e137(0x101),'name':_0x2fb8f7['yamlConfig'][_0xd5e137(0xc3)],'journeyId':_0x444dd8['journeyId']}),_0x152d7e[_0xd5e137(0x167)]?.(_0xd5e137(0xf9)+_0x2fb8f7[_0xd5e137(0xd1)]['name']+'\x27'),_0x373e5a[_0xd5e137(0x14b)]++;else _0x444dd8['action']==='updated'&&(_0x152d7e[_0xd5e137(0x1a2)]?.({'type':_0xd5e137(0x125),'name':_0x2fb8f7[_0xd5e137(0xd1)][_0xd5e137(0xc3)]}),_0x152d7e[_0xd5e137(0x167)]?.(_0xd5e137(0x124)+_0x2fb8f7[_0xd5e137(0xd1)]['name']+'\x27'),_0x373e5a[_0xd5e137(0x129)]++);return{'action':_0x444dd8[_0xd5e137(0x1a1)],'name':_0x2fb8f7[_0xd5e137(0xd1)]['name'],'journeyId':_0x444dd8['journeyId']};}catch(_0xde735c){const _0x258e6f=isHttp400Error(_0xde735c),_0x57dadc=_0x258e6f?ErrorCode[_0xd5e137(0x18e)]:ErrorCode['JOURNEY_UPDATE_ERROR'],_0x18cf9b=getErrorMessage(_0xde735c);throw new SDKError(_0x57dadc,_0xd5e137(0x1ae)+(_0x2fb8f7['isNew']?_0xd5e137(0xf1):_0xd5e137(0x14e))+'\x20journey\x20from\x20file:\x20'+_0x2fb8f7[_0xd5e137(0x111)]+_0xd5e137(0x119)+_0x18cf9b,_0xde735c);}}));_0x373e5a[_0x144808(0x1bb)][_0x144808(0x135)](..._0x420c3b);}return _0x373e5a;}async function matchExistingJourneySegments(_0x2c46fd,_0x7671d7,_0x13bbcb,_0x57ee12,_0x48ab76){const _0x4d55a7=a142_0x11892d;if(!_0x7671d7[_0x4d55a7(0x1a7)]||!_0x7671d7['yamlConfig'][_0x4d55a7(0x185)])return;const _0x2bd29a=new Map(),_0x51e592=new Set();for(const _0x377843 of Object[_0x4d55a7(0x1b6)](_0x7671d7[_0x4d55a7(0xd1)][_0x4d55a7(0x185)])){const _0x34b642=generateDeterministicJourneySegmentName(_0x7671d7['yamlConfig']['name'],_0x377843);_0x2bd29a[_0x4d55a7(0x13e)](_0x34b642,_0x377843),_0x51e592[_0x4d55a7(0xcc)](_0x377843);}const _0x8d7da7=[],_0x43465b=collectSegmentIdsFromJourneyApi(_0x7671d7['existingJourney']);for(const _0x8900a1 of _0x43465b){const _0x407bc3=await fetchSegment(_0x2c46fd,_0x13bbcb,_0x8900a1,_0x57ee12);if(!_0x407bc3?.['name'])continue;const _0x2974e0=_0x2bd29a[_0x4d55a7(0x1aa)](_0x407bc3[_0x4d55a7(0xc3)]);_0x2974e0?(_0x48ab76[_0x4d55a7(0x13e)](_0x2974e0,_0x8900a1),_0x51e592[_0x4d55a7(0x10c)](_0x2974e0)):_0x8d7da7['push']({'id':_0x8900a1,'seg':_0x407bc3});}if(_0x51e592['size']>0x0&&_0x8d7da7[_0x4d55a7(0x12a)]>0x0){const {localExpandedRuleToNames:_0x3607fd}=buildLocalExpandedRuleMappings(_0x7671d7[_0x4d55a7(0xd1)]),_0x4c14ef=new Map();for(const {id:_0x4f31b7,seg:_0x21d2cc}of _0x8d7da7){if(_0x21d2cc['rule']){const _0x2d3c5c=apiRuleToYaml(_0x21d2cc[_0x4d55a7(0x10b)]);_0x4c14ef[_0x4d55a7(0x13e)](_0x4f31b7,_0x2d3c5c);}}for(const {id:_0x4e3c82,seg:_0x58ac16}of _0x8d7da7){if(!_0x58ac16[_0x4d55a7(0x10b)])continue;const _0x34889f=_0x4c14ef[_0x4d55a7(0x1aa)](_0x4e3c82);if(!_0x34889f)continue;const _0x7aba5=serializeExpandedRule(_0x34889f,_0x4c14ef),_0x366146=_0x3607fd[_0x4d55a7(0x1aa)](_0x7aba5);if(_0x366146){const _0x587c59=_0x366146['find'](_0x53230b=>_0x51e592[_0x4d55a7(0x1c1)](_0x53230b));_0x587c59&&(_0x48ab76[_0x4d55a7(0x13e)](_0x587c59,_0x4e3c82),_0x51e592['delete'](_0x587c59),logger['debug']('Matched\x20server\x20segment\x20\x27'+_0x58ac16[_0x4d55a7(0xc3)]+_0x4d55a7(0x142)+_0x587c59+_0x4d55a7(0x12d)));}}}}function a142_0x3e6b(){const _0x47829d=['2100570KrDkGO','getSegmentEntity\x20also\x20failed\x20for\x20','toLowerCase','set','updateActivation','kind','entries','\x27\x20to\x20local\x20\x27','segmentFolderId','fetchJourney','buildUserMaps','embedded_activation_created','message','\x27\x20for\x20','activation_created','updateSegmentById','created','DecisionPoint','parentId','update','Failed\x20to\x20fetch\x20referenced\x20segment\x20','__pending_act_','activation_updating','run_after_journey_refresh','embeddedSegmentNameToId','yamlActivation','segment_updating','SEGMENT_NOT_FOUND','existingActivation','nameToType','getSegmentEntity','isArray','behavior','filter','sha1','Activation\x20not\x20found:\x20','goal\x20criteria','):\x20','createFolder','segment_updated','activationContext','columns','branches','embedded_activation_creating','logSuccess','Entry\x20criteria:\x20','activations','folder','all_columns','getJourney','Deleted\x20activation\x20\x27','entry_criteria','createdSegmentIds','item','milestone',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','effectiveFolderId','\x20(referenced\x20in\x20journey\x20','\x27\x20from\x20file:\x20','journeyById','waitStepUnit','8206955ILSMOy','existingSegments','\x20error(s)','\x20segment\x20from\x20file:\x20','stringify','some','isNew','Updated\x20activation\x20\x27','data','segment_deleted','../../utils/async.js','toString','hasChanges','segments','journeyStages','journeyBundleId','\x27\x20not\x20found\x20in\x20journey\x20\x27','utf-8','deps','1PXonin','attributes','Created\x20activation\x20\x27','JOURNEY_SYNTAX_ERROR','steps','uniqueServerName','null','Failed\x20to\x20resolve\x20activation\x20','entry','segment','INTERNAL','ACTIVATION_SYNTAX_ERROR','dirname','connectionIdToNameMap','and\x20the\x20server\x20segment,\x20then\x20retry.','.$1.push-recovery.json','\x27\x20entry\x20criteria','activationStepsById','createJourneySegment','\x27...','match','folderPathToId','action','onProgress','entryCriteria','index','activation_','goal','existingJourney','object','./journey-yaml.js','get','journey','versionNumber','rootFolderId','Failed\x20to\x20','\x27\x20decision\x20point\x20branch\x20\x27','errors','max','2851071GwlWNQ','logWarning','activation_deleted','Updated\x20segment\x20\x27','keys','conditionTimeoutUnit','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','journeys','logInfo','results','Updating\x20segment\x20\x27','Stage\x20\x27','folder_created','journey_entry_criteria_','find','has','NOT_FOUND','skipSegments','resolvedRule','from','activation_updated','148456FUcrlF','notification','exitCriterias','SEGMENT_SYNTAX_ERROR','user','conditionSegmentId','name','ACTIVATION_UPDATE_ERROR','tdx.sdk.push-workflow','uniqueSegmentName','map','validatedRequest','toISOString','withProgress','segment_deleting','add','2098860GHIhkQ','createdSegmentId','activation_deleting','Fetching\x20','yamlConfig','nameToId','getSegment\x20failed\x20for\x20','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','unchanged','segmentId','all','Creating\x20activation\x20\x27','Name\x20has\x20already\x20been\x20taken','schedule','listActivations','Delete\x20the\x20push\x20recovery\x20file\x20(','__pending_','description','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','Embedded\x20segment\x20\x27','debug','with','verbose','join','WaitStep','journeyActivationStepId','folderId','trim','progress','createSegment','\x27\x20wait\x20condition','21399648Swdmvi','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27',').\x20','relationships','valid','create','segmentNameToId','2238537VSdVDZ','segment_created','replace','Deleting\x20activation\x20\x27','flatMap','reduce','Created\x20journey\x20\x27','day','stage\x20\x27','waitStep','stages','embedded_segment_creating','journeyBundlesByFolderAndName','createActivation','journey_created','Duration','journeyActivationNameToId','diff','activationParams','localName','existingSegment','Failed\x20to\x20resolve\x20segment\x20','resolveSegment','Creating\x20folder\x20\x27','rule','delete','waitStepType','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','Activation','segment_creating','absolutePath','parseDocument','startsWith','embedded_segment_created','journey_creating','folderPath','activationActions','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','\x0a\x20\x20','split','resolveJourneyId','type','state','deleteActivation','logDeleted','parse','Condition','conditionTimeoutDuration','sort','Updated\x20journey\x20\x27','journey_updated','slice','parentSegmentFolder','decision_point','updated','length','includes','Created\x20segment\x20\x27','\x27\x20by\x20rule\x20content','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','hex','conditions','journeyBundleName','deleted','folder_creating','relative','push','./child-segment-yaml.js','segmentByFolderAndName','\x27\x20milestone','connector_config','idToEmailMap'];a142_0x3e6b=function(){return _0x47829d;};return a142_0x3e6b();}async function executeSingleJourneyPush(_0x1cf3f7,_0x54ab91,_0x550c89,_0x45bef9,_0x1a6ca9,_0x383da8){const _0x213896=a142_0x11892d,{journeyDefToRequest:_0x4d8946,activationDefToCreateRequest:_0x35a34d,yamlRuleToApi:_0x115af8,validateSegmentRule:_0x103631}=_0x383da8,_0x3062e9=new Map(),_0x15cb7a=new Map();recoverSegmentIdsFromPushRecovery(_0x54ab91,_0x3062e9,_0x550c89[_0x213896(0xf2)]);const _0xfa9275=new Map(),_0xed49be=new Map(),_0x135f3e=new Map();let _0x2e4c40;const _0x210e76=async()=>{const _0x47dac0=_0x213896;if(_0x2e4c40)return;_0x2e4c40=new Map();if(!_0x54ab91[_0x47dac0(0x1a7)])return;const _0xc45908=await _0x1cf3f7[_0x47dac0(0x1ab)][_0x47dac0(0xdb)](_0x54ab91[_0x47dac0(0x1a7)]['id']);for(const _0x3e91d5 of _0xc45908){const _0x1a4b96=journeyActivationStepToYaml(_0x3e91d5,_0x550c89[_0x47dac0(0x13a)],_0x550c89[_0x47dac0(0x198)]),_0x5afa0e=activationSignature(_0x1a4b96);!_0x2e4c40[_0x47dac0(0x1c1)](_0x5afa0e)&&_0x2e4c40[_0x47dac0(0x13e)](_0x5afa0e,_0x3e91d5['id']),_0x1a4b96[_0x47dac0(0xc3)]&&_0x15cb7a['set'](_0x1a4b96[_0x47dac0(0xc3)],_0x3e91d5['id']);}};await matchExistingJourneySegments(_0x1cf3f7,_0x54ab91,_0x45bef9['parentId'],_0x550c89[_0x213896(0x179)],_0x550c89[_0x213896(0xf2)]);const _0x1aa583={'resolveSegmentId':async _0x41a517=>{const _0xf66e20=_0x213896,_0x494b4f=_0x550c89[_0xf66e20(0xf2)][_0xf66e20(0x1aa)](_0x41a517);if(!_0x494b4f)throw new SDKError(ErrorCode[_0xf66e20(0x156)],'Segment\x20not\x20found:\x20'+_0x41a517+_0xf66e20(0x174)+_0x54ab91[_0xf66e20(0xd1)][_0xf66e20(0xc3)]+')');return _0x494b4f;},'resolveEmbeddedSegmentId':async(_0x4a8cf3,_0x7b4c73)=>{const _0x27109c=_0x213896,_0x567e65=_0x550c89['segmentNameToId'][_0x27109c(0x1aa)](_0x4a8cf3);if(_0x567e65)return _0x567e65;const _0x5b9dad=_0x550c89[_0x27109c(0x179)][_0x27109c(0x1c0)](_0xa4c312=>_0xa4c312[_0x27109c(0xc3)]===_0x4a8cf3);if(_0x5b9dad)return _0x550c89['segmentNameToId'][_0x27109c(0x13e)](_0x4a8cf3,_0x5b9dad['id']),_0x5b9dad['id'];if(_0x54ab91[_0x27109c(0x17e)]){const {stageName:_0x2d199e,criteriaName:_0x26f63a}=findSegmentCriteriaLocation(_0x54ab91[_0x27109c(0xd1)],_0x4a8cf3);return _0x103631(_0x4a8cf3,_0x7b4c73[_0x27109c(0x10b)]),_0xed49be[_0x27109c(0x13e)](_0x4a8cf3,{'definition':_0x7b4c73,'stageName':_0x2d199e,'criteriaName':_0x26f63a}),createPendingSegmentId(_0x4a8cf3);}const _0x437b07=_0x54ab91[_0x27109c(0x1a7)]?.['id'];if(!_0x437b07)throw new SDKError(ErrorCode[_0x27109c(0x195)],_0x27109c(0xdf));const _0x4f89b0=_0xfa9275[_0x27109c(0x1aa)](_0x4a8cf3);if(_0x4f89b0)return _0x4f89b0;const _0xb295b9=((async()=>{const _0xb3c5c7=_0x27109c;_0x103631(_0x4a8cf3,_0x7b4c73['rule']);const _0x1c2b06=generateDeterministicJourneySegmentName(_0x54ab91[_0xb3c5c7(0xd1)][_0xb3c5c7(0xc3)],_0x4a8cf3),_0x1bbe97=_0x550c89[_0xb3c5c7(0x179)][_0xb3c5c7(0x1c0)](_0x1420bb=>_0x1420bb[_0xb3c5c7(0xc3)]===_0x1c2b06),_0x1f872f=createSegmentIdResolver(_0x550c89['segmentNameToId'],_0x4a8cf3),_0x2aa1b0=await resolveRuleSegmentIds(_0x7b4c73[_0xb3c5c7(0x10b)],_0x1f872f);let _0xac98b5;return _0x1bbe97?(await _0x1cf3f7[_0xb3c5c7(0x194)]['updateSegmentById'](_0x45bef9[_0xb3c5c7(0x14d)],_0x1bbe97['id'],{'description':_0x7b4c73['description']||_0xb3c5c7(0x168)+_0x4a8cf3,'rule':_0x115af8(_0x2aa1b0,!![]),'countPopulation':!![]}),_0xac98b5=_0x1bbe97['id'],saveSegmentToPushRecovery(_0x54ab91[_0xb3c5c7(0x111)],_0x54ab91['yamlConfig'][_0xb3c5c7(0xc3)],_0x4a8cf3,{'segmentId':_0xac98b5,'uniqueServerName':_0x1c2b06,'createdAt':new Date()[_0xb3c5c7(0xc9)]()})):_0xac98b5=await createOrRecoverEmbeddedSegment(_0x1cf3f7,_0x54ab91,{'localName':_0x4a8cf3,'uniqueSegmentName':_0x1c2b06,'description':_0x7b4c73[_0xb3c5c7(0xde)]||'Entry\x20criteria:\x20'+_0x4a8cf3,'journeyId':_0x437b07,'resolvedRule':_0x2aa1b0,'parentId':_0x45bef9[_0xb3c5c7(0x14d)],'folderId':_0x45bef9[_0xb3c5c7(0x1ad)]||''},_0x115af8),_0x550c89[_0xb3c5c7(0xf2)][_0xb3c5c7(0x13e)](_0x4a8cf3,_0xac98b5),_0x3062e9['set'](_0x4a8cf3,_0xac98b5),_0xac98b5;})());_0xfa9275['set'](_0x4a8cf3,_0xb295b9);try{return await _0xb295b9;}finally{_0xfa9275[_0x27109c(0x10c)](_0x4a8cf3);}},'resolveActivationId':async _0xbe759c=>{const _0x5e8b03=_0x213896,_0x531818=_0x15cb7a[_0x5e8b03(0x1aa)](_0xbe759c);if(_0x531818)return _0x531818;if(_0x54ab91['existingJourney']){await _0x210e76();const _0xbd4ca1=_0x15cb7a['get'](_0xbe759c);if(_0xbd4ca1)return _0xbd4ca1;}throw new SDKError(ErrorCode['NOT_FOUND'],_0x5e8b03(0x15e)+_0xbe759c+'\x20(referenced\x20in\x20journey\x20'+_0x54ab91['yamlConfig'][_0x5e8b03(0xc3)]+_0x5e8b03(0xee)+_0x5e8b03(0x12e));},'resolveEmbeddedActivationId':async(_0xef8734,_0xb66c02)=>{const _0x5ec5a7=_0x213896,_0x1e2b15=_0x15cb7a['get'](_0xef8734);if(_0x1e2b15)return _0x1e2b15;if(_0x54ab91[_0x5ec5a7(0x17e)])return _0x135f3e[_0x5ec5a7(0x13e)](_0xef8734,_0xb66c02),createPendingActivationId(_0xef8734);if(_0x54ab91['existingJourney']){await _0x210e76();const _0x1fa014=_0x15cb7a[_0x5ec5a7(0x1aa)](_0xb66c02[_0x5ec5a7(0xc3)]);if(_0x1fa014)return _0x15cb7a[_0x5ec5a7(0x13e)](_0xef8734,_0x1fa014),_0x1fa014;const _0x3c8907=activationSignature(_0xb66c02),_0x4b286d=_0x2e4c40?.['get'](_0x3c8907);if(_0x4b286d)return _0x15cb7a[_0x5ec5a7(0x13e)](_0xef8734,_0x4b286d),_0x4b286d;const _0x2e16cf=await _0x35a34d(_0xb66c02,_0x550c89[_0x5ec5a7(0x163)]),_0x1da9d8={..._0x2e16cf,..._0xb66c02[_0x5ec5a7(0x152)]!==undefined&&{'runAfterJourneyRefresh':_0xb66c02[_0x5ec5a7(0x152)]}},_0x2e4a52=await _0x1cf3f7[_0x5ec5a7(0x1ab)][_0x5ec5a7(0x100)](_0x54ab91[_0x5ec5a7(0x1a7)]['id'],_0x1da9d8);return _0x15cb7a[_0x5ec5a7(0x13e)](_0xef8734,_0x2e4a52['id']),_0x2e4a52['id'];}throw new SDKError(ErrorCode[_0x5ec5a7(0x195)],'Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context');},'resolveJourneyId':async _0x2e23a8=>{const _0x653f19=_0x213896;try{return await _0x1cf3f7[_0x653f19(0x1ab)][_0x653f19(0x11b)](_0x45bef9[_0x653f19(0x14d)],_0x2e23a8);}catch(_0x4e489f){throw new SDKError(ErrorCode[_0x653f19(0x1c2)],'Journey\x20\x27'+_0x2e23a8+_0x653f19(0xed)+_0x54ab91[_0x653f19(0xd1)]['name']+'\x27)',_0x4e489f);}},'resolveStageId':async(_0x5eda67,_0x37d4a3)=>{const _0x243f4a=_0x213896,_0xb75da2=await _0x1cf3f7[_0x243f4a(0x1ab)][_0x243f4a(0x16c)](_0x5eda67),_0x22350d=_0xb75da2[_0x243f4a(0x18c)]['journeyStages']['find'](_0x265cf7=>_0x265cf7[_0x243f4a(0xc3)][_0x243f4a(0x13d)]()===_0x37d4a3[_0x243f4a(0x13d)]());if(!_0x22350d?.['id'])throw new SDKError(ErrorCode[_0x243f4a(0x1c2)],_0x243f4a(0x1bd)+_0x37d4a3+_0x243f4a(0x188)+(_0xb75da2[_0x243f4a(0x18c)][_0x243f4a(0x131)]||_0xb75da2[_0x243f4a(0x18c)][_0x243f4a(0xc3)])+'\x27');return _0x22350d['id'];}},_0x41dbc6=await _0x4d8946(_0x54ab91['yamlConfig'],_0x45bef9[_0x213896(0x14d)],_0x1aa583),_0x27f475=_0x45bef9[_0x213896(0xe7)]||_0x45bef9['rootFolderId'];_0x27f475&&(_0x41dbc6[_0x213896(0xef)]={'parentFolder':{'data':{'id':_0x27f475,'type':_0x213896(0x16a)}}});if(_0x54ab91[_0x213896(0x17e)]){if(_0xed49be['size']>0x0||_0x135f3e['size']>0x0)return await executeThreeStepJourneyCreate(_0x1cf3f7,_0x54ab91,_0x41dbc6,{'pendingEmbeddedSegments':_0xed49be,'pendingEmbeddedActivations':_0x135f3e,'embeddedSegmentNameToId':_0x3062e9,'journeyActivationNameToId':_0x15cb7a},{..._0x45bef9,'effectiveFolderId':_0x27f475},_0x550c89,_0x1a6ca9,_0x383da8);else{ensureJourneyDefaults(_0x41dbc6[_0x213896(0x18c)]);const _0x4f0497=await _0x1cf3f7[_0x213896(0x1ab)][_0x213896(0xf1)](_0x41dbc6);return deletePushRecovery(_0x54ab91['absolutePath']),{'action':_0x213896(0x14b),'journeyId':_0x4f0497['id'],'embeddedSegmentNameToId':_0x3062e9};}}else{if(_0x54ab91[_0x213896(0x184)]&&_0x54ab91[_0x213896(0x1a7)]){_0x41dbc6['id']=_0x54ab91[_0x213896(0x1a7)]['id'];const _0x174a6f=_0x41dbc6[_0x213896(0x18c)];_0x54ab91[_0x213896(0x1a7)][_0x213896(0x18c)]?.[_0x213896(0x131)]&&(_0x174a6f['journeyBundleName']=_0x54ab91['existingJourney'][_0x213896(0x18c)][_0x213896(0x131)]);const _0x2ffe88=_0x54ab91['existingJourney'][_0x213896(0x18c)]?.[_0x213896(0x186)];return _0x2ffe88&&_0x41dbc6[_0x213896(0x18c)][_0x213896(0x186)]&&injectExistingStageIds(_0x41dbc6[_0x213896(0x18c)][_0x213896(0x186)],_0x2ffe88),ensureJourneyDefaults(_0x174a6f),await _0x1cf3f7[_0x213896(0x1ab)]['update'](_0x54ab91[_0x213896(0x1a7)]['id'],_0x41dbc6),deletePushRecovery(_0x54ab91['absolutePath']),{'action':_0x213896(0x129),'journeyId':_0x54ab91['existingJourney']['id'],'embeddedSegmentNameToId':_0x3062e9};}}return deletePushRecovery(_0x54ab91['absolutePath']),{'action':_0x213896(0xd5),'journeyId':_0x54ab91['existingJourney']?.['id'],'embeddedSegmentNameToId':_0x3062e9};}function findSegmentCriteriaLocation(_0x340787,_0x5caa3f){const _0x556d07=a142_0x11892d,_0x4608e7=_0x340787[_0x556d07(0xfd)]||_0x340787[_0x556d07(0x1b9)]?.[0x0]?.[_0x556d07(0xfd)]||[];let _0x18b017=_0x556d07(0x193),_0x5e8f0e=_0x5caa3f;const _0x3403e8=_0x340787[_0x556d07(0x1a6)]||_0x340787[_0x556d07(0x1b9)]?.[0x0]?.[_0x556d07(0x1a6)];if(_0x3403e8?.[_0x556d07(0x194)]===_0x5caa3f)return{'stageName':_0x556d07(0x1a6),'criteriaName':_0x3403e8[_0x556d07(0xc3)]||_0x5caa3f};_0x5dfbbd:for(const _0x4dcc2a of _0x4608e7){if(_0x4dcc2a[_0x556d07(0x16e)]?.[_0x556d07(0x194)]===_0x5caa3f){_0x18b017=_0x4dcc2a[_0x556d07(0xc3)],_0x5e8f0e=_0x4dcc2a[_0x556d07(0x16e)][_0x556d07(0xc3)]||_0x5caa3f;break;}if(_0x4dcc2a[_0x556d07(0x18f)])for(const _0x56774e of _0x4dcc2a[_0x556d07(0x18f)]){if(_0x56774e[_0x556d07(0x11c)]===_0x556d07(0x128)&&_0x56774e['with']?.[_0x556d07(0x165)])for(const _0x44420d of _0x56774e[_0x556d07(0xe2)][_0x556d07(0x165)]){if(_0x44420d['segment']===_0x5caa3f){_0x18b017=_0x4dcc2a[_0x556d07(0xc3)],_0x5e8f0e=_0x44420d[_0x556d07(0xc3)]||_0x5caa3f;break _0x5dfbbd;}}}}return{'stageName':_0x18b017,'criteriaName':_0x5e8f0e};}async function executeThreeStepJourneyCreate(_0x522322,_0x542093,_0x4bc165,_0x20874e,_0x2dfaad,_0x324279,_0x1e62b3,_0x289a13){const _0xf6ffa6=a142_0x11892d,{activationDefToCreateRequest:_0x2667b2,yamlRuleToApi:_0xcb70ba}=_0x289a13,{pendingEmbeddedSegments:_0x50248a,pendingEmbeddedActivations:_0x56156d,embeddedSegmentNameToId:_0xe758c8}=_0x20874e,_0x2a6ea4=JSON[_0xf6ffa6(0x120)](JSON[_0xf6ffa6(0x17c)](_0x4bc165));ensureJourneyDefaults(_0x2a6ea4['attributes']),stripPendingIds(_0x2a6ea4);const _0x1a0a91=await _0x522322[_0xf6ffa6(0x1ab)][_0xf6ffa6(0xf1)](_0x2a6ea4),_0x161903=_0x1a0a91['id'],_0x2a0a58=new Map();for(const _0x35865b of _0x1a0a91[_0xf6ffa6(0x18c)][_0xf6ffa6(0x186)]){_0x2a0a58['set'](_0x35865b[_0xf6ffa6(0xc3)]['toLowerCase'](),_0x35865b['id']);}recoverSegmentIdsFromPushRecovery(_0x542093,_0xe758c8,_0x324279[_0xf6ffa6(0xf2)]);for(const [_0xacd273,{definition:_0x2356c4}]of _0x50248a){if(_0xe758c8[_0xf6ffa6(0x1c1)](_0xacd273)){_0x1e62b3['onProgress']?.({'type':_0xf6ffa6(0x114),'journeyName':_0x542093[_0xf6ffa6(0xd1)][_0xf6ffa6(0xc3)],'segmentName':_0xacd273});continue;}const _0x87ac6f=generateDeterministicJourneySegmentName(_0x542093[_0xf6ffa6(0xd1)][_0xf6ffa6(0xc3)],_0xacd273);_0x1e62b3[_0xf6ffa6(0x1a2)]?.({'type':_0xf6ffa6(0xfe),'journeyName':_0x542093[_0xf6ffa6(0xd1)][_0xf6ffa6(0xc3)],'segmentName':_0xacd273});const _0x291529=createSegmentIdResolver(_0x324279['segmentNameToId'],_0xacd273),_0x15c6c5=await resolveRuleSegmentIds(_0x2356c4[_0xf6ffa6(0x10b)],_0x291529),_0x41d1de=await createOrRecoverEmbeddedSegment(_0x522322,_0x542093,{'localName':_0xacd273,'uniqueSegmentName':_0x87ac6f,'description':_0x2356c4[_0xf6ffa6(0xde)]||_0xf6ffa6(0x168)+_0xacd273,'journeyId':_0x161903,'resolvedRule':_0x15c6c5,'parentId':_0x2dfaad[_0xf6ffa6(0x14d)],'folderId':_0x2dfaad[_0xf6ffa6(0x173)]||''},_0xcb70ba);_0xe758c8[_0xf6ffa6(0x13e)](_0xacd273,_0x41d1de),_0x324279[_0xf6ffa6(0xf2)][_0xf6ffa6(0x13e)](_0xacd273,_0x41d1de),_0x1e62b3['onProgress']?.({'type':_0xf6ffa6(0x114),'journeyName':_0x542093[_0xf6ffa6(0xd1)]['name'],'segmentName':_0xacd273});}const _0x31bd80=new Map();for(const [_0x363d25,_0x2b2b6b]of _0x56156d){_0x1e62b3[_0xf6ffa6(0x1a2)]?.({'type':_0xf6ffa6(0x166),'journeyName':_0x542093[_0xf6ffa6(0xd1)][_0xf6ffa6(0xc3)],'activationName':_0x363d25});const _0x416c14=await _0x2667b2(_0x2b2b6b,_0x324279[_0xf6ffa6(0x163)]),_0x44ab34={..._0x416c14,..._0x2b2b6b[_0xf6ffa6(0x152)]!==undefined&&{'runAfterJourneyRefresh':_0x2b2b6b[_0xf6ffa6(0x152)]}},_0x3541ce=await _0x522322['journey'][_0xf6ffa6(0x100)](_0x161903,_0x44ab34);_0x31bd80[_0xf6ffa6(0x13e)](_0x363d25,_0x3541ce['id']),_0x20874e[_0xf6ffa6(0x103)][_0xf6ffa6(0x13e)](_0x363d25,_0x3541ce['id']),_0x1e62b3[_0xf6ffa6(0x1a2)]?.({'type':_0xf6ffa6(0x146),'journeyName':_0x542093[_0xf6ffa6(0xd1)][_0xf6ffa6(0xc3)],'activationName':_0x363d25});}const _0x4576a1=JSON[_0xf6ffa6(0x120)](JSON[_0xf6ffa6(0x17c)](_0x4bc165));return _0x4576a1['id']=_0x161903,ensureJourneyDefaults(_0x4576a1['attributes']),resolvePendingIdsInRequest(_0x4576a1,_0x4bc165,_0x2a0a58,_0xe758c8,_0x31bd80,_0x1e62b3),await _0x522322[_0xf6ffa6(0x1ab)][_0xf6ffa6(0x14e)](_0x161903,_0x4576a1),deletePushRecovery(_0x542093[_0xf6ffa6(0x111)]),{'action':_0xf6ffa6(0x14b),'journeyId':_0x161903,'embeddedSegmentNameToId':_0xe758c8};}export function stripWaitStepPendingIds(_0x2fe5ac){const _0x7ebccf=a142_0x11892d,_0x2e9b0d=_0x2fe5ac[_0x7ebccf(0xc2)]&&isPendingSegmentId(_0x2fe5ac['conditionSegmentId']),_0x45d5d2=_0x2fe5ac['conditions']?.['some'](_0x561a6c=>_0x561a6c[_0x7ebccf(0xd6)]&&isPendingSegmentId(_0x561a6c[_0x7ebccf(0xd6)]));(_0x2e9b0d||_0x45d5d2)&&(_0x2fe5ac['waitStepType']=_0x7ebccf(0x102),_0x2fe5ac[_0x7ebccf(0xfc)]=0x1,_0x2fe5ac[_0x7ebccf(0x177)]=_0x7ebccf(0xfa),delete _0x2fe5ac[_0x7ebccf(0xc2)],delete _0x2fe5ac[_0x7ebccf(0x122)],delete _0x2fe5ac['conditionTimeoutUnit'],delete _0x2fe5ac[_0x7ebccf(0x130)]);}export function resolveWaitStepPendingIds(_0x2cd7fa,_0x5b922c,_0x3dd0b4,_0x20a609){const _0x1f128b=a142_0x11892d;if(_0x5b922c[_0x1f128b(0xc2)]&&isPendingSegmentId(_0x5b922c[_0x1f128b(0xc2)])){const _0x53ed46=_0x3dd0b4(_0x5b922c[_0x1f128b(0xc2)],_0x1f128b(0xfb)+_0x20a609+_0x1f128b(0xeb));_0x53ed46&&(_0x2cd7fa[_0x1f128b(0x10d)]='Condition',_0x2cd7fa['conditionSegmentId']=_0x53ed46,delete _0x2cd7fa[_0x1f128b(0xfc)],delete _0x2cd7fa[_0x1f128b(0x177)],_0x5b922c[_0x1f128b(0x122)]!==undefined&&(_0x2cd7fa[_0x1f128b(0x122)]=_0x5b922c[_0x1f128b(0x122)]),_0x5b922c[_0x1f128b(0x1b7)]&&(_0x2cd7fa['conditionTimeoutUnit']=_0x5b922c[_0x1f128b(0x1b7)]));}if(_0x5b922c['conditions']){const _0x334091=_0x5b922c[_0x1f128b(0x130)][_0x1f128b(0x17d)](_0x28ffe0=>_0x28ffe0[_0x1f128b(0xd6)]&&isPendingSegmentId(_0x28ffe0[_0x1f128b(0xd6)]));if(_0x334091){const _0x4e85e1=_0x5b922c[_0x1f128b(0x130)][_0x1f128b(0xc7)](_0x325456=>{const _0x2cd2f0=_0x1f128b;if(_0x325456[_0x2cd2f0(0xd6)]&&isPendingSegmentId(_0x325456[_0x2cd2f0(0xd6)])){const _0x1bec2f=_0x3dd0b4(_0x325456[_0x2cd2f0(0xd6)],_0x2cd2f0(0xfb)+_0x20a609+_0x2cd2f0(0xeb));return{..._0x325456,'segmentId':_0x1bec2f||_0x325456[_0x2cd2f0(0xd6)]};}return{..._0x325456};});_0x2cd7fa[_0x1f128b(0x10d)]=_0x1f128b(0x121),_0x2cd7fa[_0x1f128b(0x130)]=_0x4e85e1,delete _0x2cd7fa[_0x1f128b(0xfc)],delete _0x2cd7fa[_0x1f128b(0x177)],delete _0x2cd7fa['conditionSegmentId'],delete _0x2cd7fa[_0x1f128b(0x122)],delete _0x2cd7fa['conditionTimeoutUnit'];}}}function stripPendingIds(_0x45db40){const _0x4768d7=a142_0x11892d;_0x45db40[_0x4768d7(0x18c)][_0x4768d7(0x1a6)]?.[_0x4768d7(0xd6)]&&isPendingSegmentId(_0x45db40[_0x4768d7(0x18c)][_0x4768d7(0x1a6)][_0x4768d7(0xd6)])&&delete _0x45db40[_0x4768d7(0x18c)][_0x4768d7(0x1a6)];for(const _0x409ec3 of _0x45db40['attributes'][_0x4768d7(0x186)]||[]){_0x409ec3[_0x4768d7(0x1a3)]?.['segmentId']&&isPendingSegmentId(_0x409ec3[_0x4768d7(0x1a3)][_0x4768d7(0xd6)])&&delete _0x409ec3[_0x4768d7(0x1a3)];_0x409ec3[_0x4768d7(0x171)]?.[_0x4768d7(0xd6)]&&isPendingSegmentId(_0x409ec3[_0x4768d7(0x171)][_0x4768d7(0xd6)])&&delete _0x409ec3[_0x4768d7(0x171)];_0x409ec3[_0x4768d7(0xbf)]&&(_0x409ec3[_0x4768d7(0xbf)]=_0x409ec3['exitCriterias'][_0x4768d7(0x15c)](_0xb25fe5=>!_0xb25fe5[_0x4768d7(0xd6)]||!isPendingSegmentId(_0xb25fe5[_0x4768d7(0xd6)])));if(_0x409ec3[_0x4768d7(0x18f)])for(const _0x346158 of Object[_0x4768d7(0x1b6)](_0x409ec3[_0x4768d7(0x18f)])){const _0x396a49=_0x409ec3[_0x4768d7(0x18f)][_0x346158];_0x396a49[_0x4768d7(0x11c)]===_0x4768d7(0x10f)&&_0x396a49['journeyActivationStepId']&&isPendingActivationId(_0x396a49[_0x4768d7(0xe6)])&&(_0x396a49['journeyActivationStepId']='');if(_0x396a49['type']===_0x4768d7(0x14c)&&_0x396a49[_0x4768d7(0x165)])for(const _0x4620ac of _0x396a49[_0x4768d7(0x165)]){_0x4620ac[_0x4768d7(0xd6)]&&isPendingSegmentId(_0x4620ac[_0x4768d7(0xd6)])&&(_0x4620ac['segmentId']='');}_0x396a49[_0x4768d7(0x11c)]==='WaitStep'&&stripWaitStepPendingIds(_0x396a49);}}}function resolvePendingIdsInRequest(_0x497ae0,_0x132b1f,_0x451716,_0x381bd5,_0x39d5ec,_0x3543a0){const _0x1300d7=a142_0x11892d,_0x3efd91=(_0x59c58b,_0x1ab5c0)=>{const _0x5c855b=a142_0x1405;if(!isPendingSegmentId(_0x59c58b))return _0x59c58b;const _0x4457b9=extractPendingSegmentName(_0x59c58b),_0x3cdc97=_0x381bd5[_0x5c855b(0x1aa)](_0x4457b9);return!_0x3cdc97&&_0x3543a0[_0x5c855b(0x1b3)]?.(_0x5c855b(0xd4)+_0x4457b9+_0x5c855b(0x148)+_0x1ab5c0),_0x3cdc97;};if(_0x497ae0[_0x1300d7(0x18c)][_0x1300d7(0x1a6)]?.[_0x1300d7(0xd6)]&&isPendingSegmentId(_0x497ae0['attributes'][_0x1300d7(0x1a6)][_0x1300d7(0xd6)])){const _0x2dd6f7=_0x3efd91(_0x497ae0[_0x1300d7(0x18c)][_0x1300d7(0x1a6)]['segmentId'],_0x1300d7(0x15f));_0x2dd6f7&&(_0x497ae0[_0x1300d7(0x18c)][_0x1300d7(0x1a6)]['segmentId']=_0x2dd6f7);}for(const _0x5a4f93 of _0x497ae0[_0x1300d7(0x18c)][_0x1300d7(0x186)]||[]){const _0x530fb0=_0x451716['get'](_0x5a4f93[_0x1300d7(0xc3)][_0x1300d7(0x13d)]());_0x530fb0&&(_0x5a4f93['id']=_0x530fb0);if(_0x5a4f93[_0x1300d7(0x1a3)]?.[_0x1300d7(0xd6)]&&isPendingSegmentId(_0x5a4f93[_0x1300d7(0x1a3)][_0x1300d7(0xd6)])){const _0xf49d=_0x3efd91(_0x5a4f93[_0x1300d7(0x1a3)][_0x1300d7(0xd6)],_0x1300d7(0xfb)+_0x5a4f93[_0x1300d7(0xc3)]+_0x1300d7(0x19b));_0xf49d&&(_0x5a4f93['entryCriteria']['segmentId']=_0xf49d);}if(_0x5a4f93[_0x1300d7(0xbf)])for(const _0x50f7c2 of _0x5a4f93[_0x1300d7(0xbf)]){if(_0x50f7c2['segmentId']&&isPendingSegmentId(_0x50f7c2[_0x1300d7(0xd6)])){const _0x1e7e10=_0x3efd91(_0x50f7c2[_0x1300d7(0xd6)],_0x1300d7(0xfb)+_0x5a4f93[_0x1300d7(0xc3)]+'\x27\x20exit\x20criteria');_0x1e7e10&&(_0x50f7c2['segmentId']=_0x1e7e10);}}if(_0x5a4f93[_0x1300d7(0x171)]?.[_0x1300d7(0xd6)]&&isPendingSegmentId(_0x5a4f93['milestone'][_0x1300d7(0xd6)])){const _0x4f2863=_0x3efd91(_0x5a4f93[_0x1300d7(0x171)][_0x1300d7(0xd6)],_0x1300d7(0xfb)+_0x5a4f93[_0x1300d7(0xc3)]+_0x1300d7(0x138));_0x4f2863&&(_0x5a4f93['milestone']['segmentId']=_0x4f2863);}if(_0x5a4f93[_0x1300d7(0x18f)]){const _0x359b6b=_0x10e031=>_0x132b1f[_0x1300d7(0x18c)]['journeyStages']?.['find'](_0x8191c3=>_0x8191c3[_0x1300d7(0xc3)][_0x1300d7(0x13d)]()===_0x5a4f93[_0x1300d7(0xc3)][_0x1300d7(0x13d)]())?.[_0x1300d7(0x18f)]?.[_0x10e031];for(const _0x32702a of Object[_0x1300d7(0x1b6)](_0x5a4f93[_0x1300d7(0x18f)])){const _0x4a6b27=_0x5a4f93['steps'][_0x32702a],_0x55403d=_0x359b6b(_0x32702a);if(_0x4a6b27[_0x1300d7(0x11c)]==='Activation'&&_0x4a6b27['journeyActivationStepId']&&(isPendingActivationId(_0x4a6b27[_0x1300d7(0xe6)])||_0x4a6b27[_0x1300d7(0xe6)]==='')){if(_0x55403d?.['journeyActivationStepId']&&isPendingActivationId(_0x55403d[_0x1300d7(0xe6)])){const _0x79284f=extractPendingActivationName(_0x55403d[_0x1300d7(0xe6)]),_0x57d3d7=_0x39d5ec[_0x1300d7(0x1aa)](_0x79284f);_0x57d3d7&&(_0x4a6b27['journeyActivationStepId']=_0x57d3d7);}}if(_0x4a6b27[_0x1300d7(0x11c)]===_0x1300d7(0x14c)&&_0x4a6b27[_0x1300d7(0x165)]&&_0x55403d?.['branches'])for(let _0x47ddab=0x0;_0x47ddab<_0x4a6b27[_0x1300d7(0x165)][_0x1300d7(0x12a)];_0x47ddab++){const _0x5a061e=_0x4a6b27[_0x1300d7(0x165)][_0x47ddab],_0x19b01a=_0x55403d['branches'][_0x47ddab];if(_0x19b01a?.[_0x1300d7(0xd6)]&&isPendingSegmentId(_0x19b01a[_0x1300d7(0xd6)])){const _0x526023=_0x3efd91(_0x19b01a[_0x1300d7(0xd6)],_0x1300d7(0xfb)+_0x5a4f93[_0x1300d7(0xc3)]+_0x1300d7(0x1af)+(_0x5a061e[_0x1300d7(0xc3)]||_0x47ddab)+'\x27');_0x526023&&(_0x5a061e[_0x1300d7(0xd6)]=_0x526023);}}_0x4a6b27[_0x1300d7(0x11c)]===_0x1300d7(0xe5)&&_0x55403d?.[_0x1300d7(0x11c)]===_0x1300d7(0xe5)&&resolveWaitStepPendingIds(_0x4a6b27,_0x55403d,_0x3efd91,_0x5a4f93[_0x1300d7(0xc3)]);}}}}
1
+ function a142_0x1ee8(){const _0x4db154=['push','relationships','rule','getSegmentEntity\x20also\x20failed\x20for\x20','\x27\x20wait\x20condition','activationStepsById','conditionSegmentId','getLatestJourneyId','18lmWFby','createdSegmentId','Duration','replace','journeyStages','parentFolder','stages','\x27...','deps','activation_updating','getJourney','notification','entryCriteria','Activation','Deleting\x20activation\x20\x27','run_after_journey_refresh','index','10cVsfzW','SEGMENT_UPDATE_ERROR','add','description','goal','has','utf-8','existingJourney','trim','activation_','533268kGWvMr','find','WaitStep','toLowerCase','resolvedRule','state','journey_creating','journeyActivationStepId','journeyActivationNameToId','action','nameToType','7QGZYWG','createJourneySegment','exitCriterias','conditionTimeoutUnit','../../utils/async.js','journeyId','embedded_segment_created','journeyName','\x0a\x20\x20','Updating\x20activation\x20\x27','match','existingSegments','waitStep','Segment\x20not\x20found:\x20','size','draft','set','activation_updated','create','versionNumber','updateSegmentById','conditions','all','stage\x20\x27','segments','129165MPLZbk','parse','split','some','segment','Entry\x20criteria:\x20','journeyBundleName','Creating\x20folder\x20\x27','includes','activation_created','isArray','1180856kNZwVx','validatedRequest','startsWith','getSegment','activation_template_id','\x27\x20by\x20rule\x20content','existingSegment','stringify','activationsBySegmentId','journey_updated','withProgress','JOURNEY_UPDATE_ERROR','hasChanges','results','Created\x20segment\x20\x27','Creating\x20segment\x20\x27','folder_creating','from','segmentNameToId','Name\x20has\x20already\x20been\x20taken','kind','getActivation','__pending_act_','parentId','SEGMENT_SYNTAX_ERROR','Embedded\x20segment\x20\x27','sort','yamlConfig','./journey-yaml.js','connector_config','uniqueSegmentName','journey_entry_criteria_','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','flatMap','rootFolderId','activation_deleted','milestone','unchanged','segmentId','Matched\x20server\x20segment\x20\x27','__pending_','\x27\x20decision\x20point\x20branch\x20\x27','logWarning','\x20segment\x20from\x20file:\x20','deleted','folderPath','buildUserMaps','createSegment','progress','Fetching\x20','steps','segment_creating','deleteActivation','localName','SEGMENT_NOT_FOUND','data','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','map','keys','connectionIdToNameMap',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','verbose','logInfo','delete','Condition','isNew','embedded_segment_creating','segmentFolderId','parseDocument','activation_deleting','Activation\x20not\x20found:\x20','uniqueServerName','deleteSegment','logSuccess','skipSegments','list','valid','JOURNEY_SYNTAX_ERROR','idToName','slice','Deleted\x20segment\x20\x27','activationParams','connection','\x20error(s)','name','ACTIVATION_UPDATE_ERROR','dirname','activationContext','created','journeyById','diff','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','updated','6UaUtXc','goal\x20criteria','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','columns','349586pIPMVr','relative','reduce','\x27\x20not\x20found\x20in\x20journey\x20\x27','update','idToEmailMap','errors','resolveSegment','activation_creating','\x27\x20to\x20local\x20\x27','nameToId','journeys','createActivation','Failed\x20to\x20resolve\x20segment\x20','type','Journey\x20\x27','join','null','createdSegmentIds','waitStepType','day','\x20(referenced\x20in\x20journey\x20','behavior','folderPathToId','10804800XifIpc','\x20activation\x20\x27','folder','values','.$1.push-recovery.json','existingActivation','embeddedSegmentNameToId','digest','with','segment_updated','all_columns','segmentByFolderAndName','message','folderId','toISOString','NOT_FOUND','createFolder','journeyBundleId','length','getSegmentEntity','toString','DecisionPoint','absolutePath','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','logDeleted','branches','\x20journey\x20from\x20file:\x20','activations','Stage\x20\x27','hex','conditionTimeoutDuration','2jgYQrH','entries','schedule','):\x20','object','entry','waitStepUnit','Creating\x20activation\x20\x27','Updated\x20segment\x20\x27','610348yWFTLb','ACTIVATION_SYNTAX_ERROR','getSegment\x20failed\x20for\x20','entry_criteria','onProgress','embedded_activation_created','Updating\x20segment\x20\x27','listActivations','\x27\x20from\x20file:\x20','Failed\x20to\x20fetch\x20referenced\x20segment\x20','debug','journey_updating','get','journey','Failed\x20to\x20','filter','./child-segment-yaml.js','attributes','Segment\x20not\x20found','3790952PcXlQO','\x27\x20exit\x20criteria','sha1','effectiveFolderId','segment_deleted'];a142_0x1ee8=function(){return _0x4db154;};return a142_0x1ee8();}const a142_0x5b6902=a142_0x10a9;(function(_0x3cbca4,_0x50cfd3){const _0x4b12ed=a142_0x10a9,_0x34b4cd=_0x3cbca4();while(!![]){try{const _0x1be317=-parseInt(_0x4b12ed(0x123))/0x1*(parseInt(_0x4b12ed(0xec))/0x2)+parseInt(_0x4b12ed(0xe8))/0x3*(-parseInt(_0x4b12ed(0x12c))/0x4)+parseInt(_0x4b12ed(0x18b))/0x5*(parseInt(_0x4b12ed(0x14c))/0x6)+-parseInt(_0x4b12ed(0x172))/0x7*(-parseInt(_0x4b12ed(0x196))/0x8)+-parseInt(_0x4b12ed(0x167))/0x9*(-parseInt(_0x4b12ed(0x15d))/0xa)+-parseInt(_0x4b12ed(0x13f))/0xb+parseInt(_0x4b12ed(0x104))/0xc;if(_0x1be317===_0x50cfd3)break;else _0x34b4cd['push'](_0x34b4cd['shift']());}catch(_0x15dffe){_0x34b4cd['push'](_0x34b4cd['shift']());}}}(a142_0x1ee8,0x2d416));function a142_0x10a9(_0x41c3ee,_0x33c69a){_0x41c3ee=_0x41c3ee-0xd8;const _0x1ee8b6=a142_0x1ee8();let _0x10a9d0=_0x1ee8b6[_0x41c3ee];return _0x10a9d0;}import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of']('tdx.sdk.push-workflow');export const PENDING_SEGMENT_PREFIX=a142_0x5b6902(0x1be);export const PENDING_ACTIVATION_PREFIX=a142_0x5b6902(0x1ac);export function createPendingSegmentId(_0x23a4df){return''+PENDING_SEGMENT_PREFIX+_0x23a4df+'__';}export function isPendingSegmentId(_0x5ba069){const _0x217cc2=a142_0x5b6902;return _0x5ba069[_0x217cc2(0x198)](PENDING_SEGMENT_PREFIX)&&!_0x5ba069[_0x217cc2(0x198)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x2645fa){return _0x2645fa['replace'](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0xc0514a){return''+PENDING_ACTIVATION_PREFIX+_0xc0514a+'__';}export function isPendingActivationId(_0x7adf63){const _0x5b23aa=a142_0x5b6902;return _0x7adf63[_0x5b23aa(0x198)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x49e54a){const _0x99557b=a142_0x5b6902;return _0x49e54a[_0x99557b(0x14f)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x3f8853,_0x3ecd12){const _0x373cae=a142_0x5b6902,_0x508947=_0x3f8853+'::'+(_0x3ecd12[_0x373cae(0x165)]()||'segment'),_0x54da98=createHash(_0x373cae(0x141))[_0x373cae(0xf0)](_0x508947)[_0x373cae(0x10b)](_0x373cae(0x121))['slice'](0x0,0xc);return _0x373cae(0x1b5)+_0x54da98;}export function ensureJourneyDefaults(_0x31d998){const _0x2428dd=a142_0x5b6902;!_0x31d998[_0x2428dd(0x160)]&&(_0x31d998[_0x2428dd(0x160)]=''),!_0x31d998[_0x2428dd(0x16c)]&&(_0x31d998[_0x2428dd(0x16c)]=_0x2428dd(0x181));}export function injectExistingStageIds(_0x1d9843,_0x455127){const _0x37a4df=a142_0x5b6902,_0x3f55b7=new Map(_0x455127['map'](_0x5ad221=>[_0x5ad221[_0x37a4df(0xdf)],_0x5ad221['id']]));for(const _0x4e28a2 of _0x1d9843){if(!_0x4e28a2['id']){const _0x2977f6=_0x3f55b7[_0x37a4df(0x138)](_0x4e28a2[_0x37a4df(0xdf)]);_0x2977f6&&(_0x4e28a2['id']=_0x2977f6);}}}export function resolveTDFolderPath(_0x349ee6,_0x126f41,_0x23ad55){if(!_0x126f41)return _0x349ee6;if(_0x349ee6===_0x23ad55||_0x349ee6['startsWith'](_0x23ad55+'/'))return _0x349ee6;return _0x349ee6?_0x23ad55+'/'+_0x349ee6:_0x23ad55;}export function addFoldersToCreate(_0x58cebf,_0x47eddc,_0x990158){const _0x144f6a=a142_0x5b6902;if(!_0x58cebf)return;if(_0x47eddc['has'](_0x58cebf))return;const _0x15f443=_0x58cebf[_0x144f6a(0x18d)]('/');let _0x4fc75a='';for(const _0x3d3ba6 of _0x15f443){_0x4fc75a=_0x4fc75a?_0x4fc75a+'/'+_0x3d3ba6:_0x3d3ba6,!_0x47eddc[_0x144f6a(0x162)](_0x4fc75a)&&_0x990158[_0x144f6a(0x15f)](_0x4fc75a);}}export function sortFoldersByDepth(_0x2b29d4){const _0x1bab78=a142_0x5b6902;return[..._0x2b29d4][_0x1bab78(0x1b0)]((_0x5cd6f6,_0x30751e)=>{const _0x6df7fc=_0x1bab78,_0x5f12ee=(_0x5cd6f6[_0x6df7fc(0x17c)](/\//g)||[])[_0x6df7fc(0x116)],_0x101e73=(_0x30751e[_0x6df7fc(0x17c)](/\//g)||[])[_0x6df7fc(0x116)];return _0x5f12ee-_0x101e73;});}import*as a142_0x26725c from'yaml';import{readFileSync}from'fs';import a142_0x2fc8e0 from'path';import{isJourneyDef,parseYamlString as a142_0x4f5357,toYamlString as a142_0xf8032f,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(_0x796cd3){const _0x3c104d=a142_0x5b6902;if(Array[_0x3c104d(0x195)](_0x796cd3))return'['+_0x796cd3['map'](_0x1a8bee=>stableStringify(_0x1a8bee))[_0x3c104d(0xfc)](',')+']';if(_0x796cd3&&typeof _0x796cd3===_0x3c104d(0x127)){const _0x515807=_0x796cd3,_0x4c3cde=Object[_0x3c104d(0x1d0)](_0x515807)['sort'](),_0x57e337=_0x4c3cde[_0x3c104d(0x1cf)](_0x4d5a35=>'\x22'+_0x4d5a35+'\x22:'+stableStringify(_0x515807[_0x4d5a35]));return'{'+_0x57e337[_0x3c104d(0xfc)](',')+'}';}const _0x30e8b2=JSON[_0x3c104d(0x19d)](_0x796cd3);return _0x30e8b2===undefined?_0x3c104d(0xfd):_0x30e8b2;}function activationSignature(_0x489dc9){const _0x1c0f31=a142_0x5b6902,_0x1a95e4={'connection':_0x489dc9[_0x1c0f31(0xdd)],..._0x489dc9[_0x1c0f31(0x10e)]!==undefined&&{'all_columns':_0x489dc9['all_columns']},..._0x489dc9[_0x1c0f31(0xeb)]!==undefined&&{'columns':_0x489dc9[_0x1c0f31(0xeb)]},..._0x489dc9['behavior']!==undefined&&{'behavior':_0x489dc9[_0x1c0f31(0x102)]},..._0x489dc9[_0x1c0f31(0x125)]!==undefined&&{'schedule':_0x489dc9[_0x1c0f31(0x125)]},..._0x489dc9[_0x1c0f31(0x157)]!==undefined&&{'notification':_0x489dc9[_0x1c0f31(0x157)]},..._0x489dc9[_0x1c0f31(0x1b3)]!==undefined&&{'connector_config':_0x489dc9['connector_config']},..._0x489dc9[_0x1c0f31(0x19a)]!==undefined&&{'activation_template_id':_0x489dc9[_0x1c0f31(0x19a)]}};return stableStringify(_0x1a95e4);}async function fetchSegment(_0x147d0e,_0x2a6f2a,_0x471f40,_0x201959){const _0x1af14a=a142_0x5b6902,_0x48de28=_0x201959?.[_0x1af14a(0x168)](_0x1ed114=>_0x1ed114['id']===_0x471f40);if(_0x48de28)return _0x48de28;try{return await _0x147d0e[_0x1af14a(0x18f)][_0x1af14a(0x199)](_0x2a6f2a,_0x471f40);}catch(_0x127a67){logger[_0x1af14a(0x136)](_0x1af14a(0x12e)+_0x471f40+_0x1af14a(0x1d2)+_0x127a67);try{return await _0x147d0e[_0x1af14a(0x18f)][_0x1af14a(0x117)](_0x471f40);}catch(_0x1912e){return logger[_0x1af14a(0x136)](_0x1af14a(0x147)+_0x471f40+':\x20'+_0x1912e),null;}}}function recoverSegmentIdsFromPushRecovery(_0x4621d7,_0x182159,_0x468224){const _0x3ee766=a142_0x5b6902,_0x27d689=readPushRecovery(_0x4621d7[_0x3ee766(0x11a)]);if(_0x27d689?.['journeyName']===_0x4621d7[_0x3ee766(0x1b1)]['name'])for(const [_0x28a5d2,_0x5585ed]of Object[_0x3ee766(0x124)](_0x27d689[_0x3ee766(0x18a)])){const _0x48160d=generateDeterministicJourneySegmentName(_0x4621d7[_0x3ee766(0x1b1)][_0x3ee766(0xdf)],_0x28a5d2);_0x5585ed[_0x3ee766(0x1dd)]===_0x48160d&&(_0x182159[_0x3ee766(0x182)](_0x28a5d2,_0x5585ed[_0x3ee766(0x1bc)]),_0x468224[_0x3ee766(0x182)](_0x28a5d2,_0x5585ed['segmentId']));}}async function createOrRecoverEmbeddedSegment(_0x5e1048,_0x4984d8,_0x45859d,_0x434e55){const _0x2b8ab3=a142_0x5b6902;let _0x12a03b;try{_0x12a03b=await _0x5e1048['segment'][_0x2b8ab3(0x173)]({'name':_0x45859d[_0x2b8ab3(0x1b4)],'description':_0x45859d['description'],'journeyId':_0x45859d['journeyId'],'rule':_0x434e55(_0x45859d[_0x2b8ab3(0x16b)],!![]),'countPopulation':!![],'parentFolderId':_0x45859d['folderId'],'audienceId':_0x45859d[_0x2b8ab3(0x1ad)]});}catch(_0x400ba2){const _0x5ca4b2=_0x400ba2 instanceof Error&&_0x400ba2[_0x2b8ab3(0x110)][_0x2b8ab3(0x193)](_0x2b8ab3(0x1a9));if(_0x5ca4b2){const _0x312210=readPushRecovery(_0x4984d8[_0x2b8ab3(0x11a)]),_0x49275b=_0x312210?.[_0x2b8ab3(0x179)]===_0x4984d8[_0x2b8ab3(0x1b1)]['name']?_0x312210[_0x2b8ab3(0x18a)][_0x45859d[_0x2b8ab3(0x1cb)]]:undefined;if(_0x49275b?.[_0x2b8ab3(0x1dd)]===_0x45859d[_0x2b8ab3(0x1b4)])await _0x5e1048[_0x2b8ab3(0x18f)][_0x2b8ab3(0x186)](_0x45859d['parentId'],_0x49275b[_0x2b8ab3(0x1bc)],{'description':_0x45859d[_0x2b8ab3(0x160)],'rule':_0x434e55(_0x45859d['resolvedRule'],!![]),'countPopulation':!![]}),_0x12a03b=_0x49275b[_0x2b8ab3(0x1bc)];else throw new SDKError(ErrorCode[_0x2b8ab3(0x15e)],_0x2b8ab3(0x1af)+_0x45859d[_0x2b8ab3(0x1cb)]+'\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20'+('Delete\x20the\x20push\x20recovery\x20file\x20('+_0x4984d8[_0x2b8ab3(0x11a)][_0x2b8ab3(0x14f)](/([^/]+)$/,_0x2b8ab3(0x108))+')\x20')+'and\x20the\x20server\x20segment,\x20then\x20retry.',_0x400ba2);}else throw _0x400ba2;}return saveSegmentToPushRecovery(_0x4984d8[_0x2b8ab3(0x11a)],_0x4984d8[_0x2b8ab3(0x1b1)][_0x2b8ab3(0xdf)],_0x45859d['localName'],{'segmentId':_0x12a03b,'uniqueServerName':_0x45859d[_0x2b8ab3(0x1b4)],'createdAt':new Date()[_0x2b8ab3(0x112)]()}),_0x12a03b;}export async function prepareSegmentFiles(_0x88d94e,_0x1eacc8,_0x413cfc,_0xe3c517,_0x12874d){const _0x114db9=a142_0x5b6902,{activationDefToCreateRequest:_0x56c821}=await import(_0x114db9(0x13c)),_0x32b9d9=[],_0x24a8c0=new Set();for(const {yamlConfig:_0x281f03,folderPath:_0x3e0f54,sourcePath:_0x27e72e}of _0x88d94e){const _0x519555=resolveTDFolderPath(_0x3e0f54,_0xe3c517,_0x12874d),_0x49ca6e=_0x519555+':'+_0x281f03[_0x114db9(0xdf)],_0x337f49=_0x1eacc8[_0x114db9(0x10f)][_0x114db9(0x138)](_0x49ca6e),_0x4f34a2=_0x337f49?_0x1eacc8[_0x114db9(0x19e)][_0x114db9(0x138)](_0x337f49['id'])||[]:[];addFoldersToCreate(_0x519555,_0x1eacc8[_0x114db9(0x103)],_0x24a8c0);const _0x50d184=calculateActivationActions(_0x281f03[_0x114db9(0x11f)]||[],_0x4f34a2,_0x1eacc8[_0x114db9(0xf1)],_0x1eacc8[_0x114db9(0x1d1)]);for(const _0x445ed1 of _0x50d184){(_0x445ed1['type']===_0x114db9(0x184)||_0x445ed1[_0x114db9(0xfa)]===_0x114db9(0xf0))&&_0x445ed1['yamlActivation']&&(_0x445ed1[_0x114db9(0x197)]=await _0x56c821(_0x445ed1['yamlActivation'],_0x413cfc));}const _0x38b448=calculateSegmentDiff(_0x281f03,_0x337f49,_0x4f34a2,_0x1eacc8[_0x114db9(0xf1)],_0x1eacc8[_0x114db9(0x1d1)]);_0x32b9d9[_0x114db9(0x144)]({'relativePath':_0x281f03['name'],'absolutePath':_0x27e72e,'yamlConfig':_0x281f03,'folderPath':_0x519555,'existingSegment':_0x337f49,'existingActivations':_0x4f34a2,'isNew':_0x38b448[_0x114db9(0x1d7)],'hasChanges':_0x38b448[_0x114db9(0x1a2)],'diff':_0x38b448[_0x114db9(0xe5)],'activationActions':_0x50d184});}return{'segmentFiles':_0x32b9d9,'foldersToCreate':_0x24a8c0};}export async function prepareJourneyFiles(_0x3efd52,_0x18c33e,_0x3ced14,_0x2c2b4c){const _0x30fbfe=a142_0x5b6902,_0x4e0fb5=[],_0x452779=new Set();for(const {yamlConfig:_0x422cf8,folderPath:_0x5e1b5d,sourcePath:_0x489039}of _0x3efd52){const _0x5f0a91=resolveTDFolderPath(_0x5e1b5d,_0x3ced14,_0x2c2b4c),_0x181630=_0x5f0a91+':'+_0x422cf8[_0x30fbfe(0xdf)],_0x27f53a=_0x18c33e['journeyBundlesByFolderAndName'][_0x30fbfe(0x138)](_0x181630);let _0x2993d5,_0x4c3bf3;if(_0x27f53a&&_0x27f53a[_0x30fbfe(0x116)]>0x0){const _0x4123e3=buildLocalExpandedRuleMappings(_0x422cf8),{createYamlContext:_0x2a5ea6,prefetchJourneySegments:_0x573822}=createPushYamlContextForBundle(_0x18c33e['deps'],_0x18c33e[_0x30fbfe(0x1ad)],_0x18c33e[_0x30fbfe(0x17d)],_0x4123e3,_0x18c33e['idToEmailMap'],_0x18c33e[_0x30fbfe(0x1d1)],_0x18c33e[_0x30fbfe(0x149)],_0x18c33e[_0x30fbfe(0xe4)]);await _0x573822(_0x27f53a['map'](_0x5a8fdf=>_0x5a8fdf['id']));const _0x3cb638=await _0x18c33e[_0x30fbfe(0x154)][_0x30fbfe(0x139)][_0x30fbfe(0x14b)](_0x27f53a[0x0][_0x30fbfe(0x115)]),_0x162223=hasMultipleVersions(_0x422cf8),_0x1fda6d=async _0x326d29=>{const _0x44fc61=_0x30fbfe,_0x46fd30=_0x18c33e[_0x44fc61(0xe4)]?.[_0x44fc61(0x138)](_0x326d29);if(_0x46fd30)return _0x46fd30;return _0x18c33e['fetchJourney']({'journeyId':_0x326d29,'journeyName':_0x422cf8['name'],'isMultiVersion':_0x27f53a['length']>0x1});};if(_0x162223&&_0x27f53a['length']>0x1){const _0x47058c=[];for(const _0x15eca1 of _0x27f53a){const _0x15249b=_0x15eca1[_0x30fbfe(0x185)]||0x1;_0x18c33e[_0x30fbfe(0x1c6)]?.['update'](_0x30fbfe(0x1c7)+_0x422cf8[_0x30fbfe(0xdf)]+'\x20v'+_0x15249b);const _0x3854e1=await _0x1fda6d(_0x15eca1['id']),_0x5bf93a=_0x2a5ea6(_0x15eca1['id']),_0x2f65f1=await journeyResponseToDef(_0x3854e1,_0x5bf93a);_0x47058c['push']({'item':_0x15eca1,'yaml':_0x2f65f1});}const _0x226449=buildLocalRuleToNameMappingFromJourney(_0x422cf8);_0x4c3bf3=buildMergedJourneyDef(_0x47058c,_0x226449,_0x3cb638);const _0x195e67=Math['max'](..._0x47058c[_0x30fbfe(0x1cf)](_0x2bbb1d=>_0x2bbb1d['item'][_0x30fbfe(0x185)]||0x0)),_0x4ab0de=_0x27f53a[_0x30fbfe(0x168)](_0x4b0fbb=>(_0x4b0fbb[_0x30fbfe(0x185)]||0x0)===_0x195e67);_0x4ab0de&&(_0x18c33e[_0x30fbfe(0x1c6)]?.[_0x30fbfe(0xf0)](_0x30fbfe(0x1c7)+_0x422cf8['name']+'\x20v'+_0x195e67),_0x2993d5=await _0x1fda6d(_0x4ab0de['id']));}else{const _0x161bb3=_0x27f53a[_0x27f53a[_0x30fbfe(0x116)]-0x1];_0x18c33e[_0x30fbfe(0x1c6)]?.['update']('Fetching\x20'+_0x422cf8[_0x30fbfe(0xdf)]),_0x2993d5=await _0x1fda6d(_0x161bb3['id']);const _0x385db8=_0x2a5ea6(_0x161bb3['id']),_0x14c0c2=await journeyResponseToDef(_0x2993d5,_0x385db8),_0x1c8676=buildLocalRuleToNameMappingFromJourney(_0x422cf8);_0x4c3bf3=buildMergedJourneyDef([{'item':_0x161bb3,'yaml':_0x14c0c2}],_0x1c8676,_0x3cb638);}}addFoldersToCreate(_0x5f0a91,_0x18c33e[_0x30fbfe(0x103)],_0x452779);const _0x440da8=calculateJourneyDiff(_0x422cf8,_0x4c3bf3);_0x4e0fb5[_0x30fbfe(0x144)]({'relativePath':_0x422cf8[_0x30fbfe(0xdf)],'absolutePath':_0x489039,'yamlConfig':_0x422cf8,'folderPath':_0x5f0a91,'existingJourney':_0x2993d5,'isNew':_0x440da8[_0x30fbfe(0x1d7)],'hasChanges':_0x440da8[_0x30fbfe(0x1a2)],'diff':_0x440da8[_0x30fbfe(0xe5)]});}return{'journeyFiles':_0x4e0fb5,'foldersToCreate':_0x452779};}export function calculateActivationActions(_0x5743a6,_0x40dbea,_0x4d0e2e,_0x48d4e0){const _0x4a3edb=a142_0x5b6902,_0x2ac7e1=[],_0x4317ba=new Map();for(const _0x35c4d7 of _0x40dbea){_0x4317ba[_0x4a3edb(0x182)](_0x35c4d7[_0x4a3edb(0xdf)],_0x35c4d7);}const _0x47ff1a=new Map();for(const _0x593ab0 of _0x5743a6){_0x47ff1a[_0x4a3edb(0x182)](_0x593ab0[_0x4a3edb(0xdf)],_0x593ab0);}for(const _0x1a2656 of _0x5743a6){const _0x3e3dc8=_0x4317ba[_0x4a3edb(0x138)](_0x1a2656[_0x4a3edb(0xdf)]);if(!_0x3e3dc8)_0x2ac7e1[_0x4a3edb(0x144)]({'type':_0x4a3edb(0x184),'name':_0x1a2656[_0x4a3edb(0xdf)],'yamlActivation':_0x1a2656});else{const _0x595593=activationResponseToDef(_0x3e3dc8,_0x4d0e2e,_0x48d4e0),_0x3088a5=a142_0x26725c[_0x4a3edb(0x19d)](_0x595593),_0x416443=a142_0x26725c[_0x4a3edb(0x19d)](_0x1a2656);_0x3088a5!==_0x416443&&_0x2ac7e1[_0x4a3edb(0x144)]({'type':_0x4a3edb(0xf0),'name':_0x1a2656['name'],'yamlActivation':_0x1a2656,'existingActivation':_0x3e3dc8});}}for(const _0x7ce348 of _0x40dbea){!_0x47ff1a[_0x4a3edb(0x162)](_0x7ce348[_0x4a3edb(0xdf)])&&_0x2ac7e1[_0x4a3edb(0x144)]({'type':_0x4a3edb(0x1d5),'name':_0x7ce348[_0x4a3edb(0xdf)],'existingActivation':_0x7ce348});}return _0x2ac7e1;}function calculateYamlDiff(_0x512208,_0x4d58a7){if(_0x4d58a7){const _0x2a545b=generateDiff(_0x4d58a7,_0x512208),_0xd74430=hasChanges(_0x2a545b);return{'isNew':![],'hasChanges':_0xd74430,'diff':_0xd74430?formatDiffWithColors(_0x2a545b):undefined};}const _0x2ae94f=generateDiff('',_0x512208);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x2ae94f)};}export function calculateSegmentDiff(_0x38ba3f,_0x23c6b5,_0x5d1154,_0x18c4b1,_0x427f3a){const _0x125171=segmentToYamlString(_0x38ba3f),_0x189666=_0x23c6b5?segmentToYamlString(segmentWithActivationsToYaml(_0x23c6b5,_0x5d1154,undefined,_0x18c4b1,_0x427f3a)):undefined;return calculateYamlDiff(_0x125171,_0x189666);}export function calculateJourneyDiff(_0x56178e,_0xb5ef25){const _0x3d4427=normalizeJourneyDef(_0x56178e,_0x56178e),_0x3106da=a142_0xf8032f(_0x3d4427),_0x3c3066=_0xb5ef25?a142_0xf8032f(normalizeJourneyDef(_0xb5ef25,_0x56178e)):undefined;return calculateYamlDiff(_0x3106da,_0x3c3066);}export function findSegmentsToDelete(_0x195e57,_0xb7f425,_0x2b1412,_0x284f39,_0x1bdcb5){const _0x4d6a43=a142_0x5b6902,_0x35508d=new Set();for(const {yamlConfig:_0x3c7fdb,folderPath:_0x2c607a}of _0xb7f425){_0x35508d['add'](_0x2c607a+':'+_0x3c7fdb[_0x4d6a43(0xdf)]);}return _0x195e57[_0x4d6a43(0x13b)](_0x40f14d=>{const _0x276dab=_0x4d6a43,_0x652626=_0x40f14d['segmentFolderId']?_0x2b1412[_0x276dab(0x138)](_0x40f14d['segmentFolderId'][_0x276dab(0x118)]())||'':'',_0x35f916=_0x652626+':'+_0x40f14d[_0x276dab(0xdf)];if(_0x35508d[_0x276dab(0x162)](_0x35f916))return![];if(_0x1bdcb5)return _0x652626===_0x284f39||_0x652626[_0x276dab(0x198)](_0x284f39+'/');return!![];});}export function findJourneysToDelete(_0x14bebd,_0x1aea01,_0x7eb685,_0x12e1e0,_0x11912b){const _0x4e17c7=a142_0x5b6902,_0x4e1772=new Set();for(const {yamlConfig:_0x282c77,folderPath:_0x56ec53}of _0x1aea01){_0x4e1772[_0x4e17c7(0x15f)](_0x56ec53+':'+_0x282c77[_0x4e17c7(0xdf)]);}return _0x14bebd[_0x4e17c7(0x13b)](_0x46e17d=>{const _0x50f266=_0x4e17c7,_0x3ee098=_0x46e17d[_0x50f266(0x111)]?_0x7eb685[_0x50f266(0x138)](_0x46e17d[_0x50f266(0x111)])||'':'',_0x260e6d=_0x3ee098+':'+_0x46e17d[_0x50f266(0x191)];if(_0x4e1772[_0x50f266(0x162)](_0x260e6d))return![];if(_0x11912b)return _0x3ee098===_0x12e1e0||_0x3ee098[_0x50f266(0x198)](_0x12e1e0+'/');return!![];});}export function buildSegmentLookupMap(_0x10aa90,_0x4f455f){const _0x226fe1=a142_0x5b6902,_0x18d122=new Map();for(const _0x3c2d3d of _0x10aa90){const _0x512a2d=_0x3c2d3d['segmentFolderId']?_0x4f455f['get'](_0x3c2d3d[_0x226fe1(0x1d9)][_0x226fe1(0x118)]())||'':'',_0x5eef7d=_0x512a2d+':'+_0x3c2d3d[_0x226fe1(0xdf)];_0x18d122[_0x226fe1(0x182)](_0x5eef7d,_0x3c2d3d);}return _0x18d122;}export function buildSegmentNameToIdMap(_0x5f0803){const _0x528506=a142_0x5b6902,_0x2c6a44=new Map();for(const _0xa1bb7 of _0x5f0803){_0x2c6a44['set'](_0xa1bb7[_0x528506(0xdf)],_0xa1bb7['id']);}return _0x2c6a44;}export function buildJourneyBundleLookupMap(_0x74e354,_0xd4777b){const _0x55c226=a142_0x5b6902,_0x25ffc6=new Map();for(const _0x4bb55e of _0x74e354){const _0x2463e5=_0x4bb55e[_0x55c226(0x111)]?_0xd4777b[_0x55c226(0x138)](_0x4bb55e[_0x55c226(0x111)])||'':'',_0x42a385=_0x2463e5+':'+_0x4bb55e[_0x55c226(0x191)];!_0x25ffc6[_0x55c226(0x162)](_0x42a385)&&_0x25ffc6['set'](_0x42a385,[]),_0x25ffc6['get'](_0x42a385)[_0x55c226(0x144)](_0x4bb55e);}for(const _0x45018d of _0x25ffc6[_0x55c226(0x107)]()){_0x45018d[_0x55c226(0x1b0)]((_0x5ded9e,_0x428c79)=>(_0x5ded9e['versionNumber']||0x0)-(_0x428c79[_0x55c226(0x185)]||0x0));}return _0x25ffc6;}export function collectFoldersToCreate(_0x5c85ca,_0x38428b){const _0x3e8ac8=a142_0x5b6902,_0x5e11e3=new Set();for(const _0x11930f of _0x5c85ca){if(!_0x11930f)continue;if(_0x38428b[_0x3e8ac8(0x162)](_0x11930f))continue;const _0x2fe9b5=_0x11930f['split']('/');let _0x35a213='';for(const _0x54b0fc of _0x2fe9b5){_0x35a213=_0x35a213?_0x35a213+'/'+_0x54b0fc:_0x54b0fc,!_0x38428b[_0x3e8ac8(0x162)](_0x35a213)&&_0x5e11e3[_0x3e8ac8(0x15f)](_0x35a213);}}return _0x5e11e3;}export function parseAndClassifyYamlFiles(_0x5e67ce,_0xfa8a32,_0x3ecc72){const _0x2bd785=a142_0x5b6902,_0x36f4a5=[],_0x4695df=[];for(const _0x3a6b7d of _0x5e67ce){const _0x90d36e=a142_0x2fc8e0[_0x2bd785(0xed)](_0xfa8a32,a142_0x2fc8e0[_0x2bd785(0xe1)](_0x3a6b7d)),_0x5c12df=_0x90d36e==='.'?'':_0x90d36e,_0xb970ae=readFileSync(_0x3a6b7d,_0x2bd785(0x163)),_0x35179d=a142_0x26725c[_0x2bd785(0x18c)](_0xb970ae);if(isJourneyDef(_0x35179d)){const _0x392d72=a142_0x4f5357(_0xb970ae);_0x4695df['push']({'yamlConfig':_0x392d72,'folderPath':_0x5c12df,'sourcePath':_0x3a6b7d});}else{if(!_0x3ecc72?.[_0x2bd785(0x1e0)]){const _0x23dc0f=parseSegmentYamlFile(_0xb970ae),_0x7a1f8d=normalizeChildSegmentYaml(_0x23dc0f);_0x36f4a5[_0x2bd785(0x144)]({'yamlConfig':_0x7a1f8d,'folderPath':_0x5c12df,'sourcePath':_0x3a6b7d});}}}return{'segments':_0x36f4a5,'journeys':_0x4695df};}export function validateParsedFiles(_0x17da96,_0x3c2277){const _0x2214bc=a142_0x5b6902,_0xbc6bce=[];for(const {yamlConfig:_0x89981e,sourcePath:_0x567fb2}of _0x17da96[_0x2214bc(0x18a)]){const _0x43322b=readFileSync(_0x567fb2,_0x2214bc(0x163)),_0x25535c=a142_0x26725c[_0x2214bc(0x1da)](_0x43322b),_0x55c0f0=validateSegmentDef(_0x89981e,{'source':_0x43322b,'document':_0x25535c},{'skipSchema':!![]});if(!_0x55c0f0[_0x2214bc(0x1e2)]){const _0x27925d=a142_0x2fc8e0[_0x2214bc(0xed)](_0x3c2277,_0x567fb2);_0xbc6bce['push']({'filePath':_0x27925d,'source':_0x43322b,'result':_0x55c0f0,'isJourney':![]});}}for(const {yamlConfig:_0x1c0017,sourcePath:_0x1db18a}of _0x17da96[_0x2214bc(0xf7)]){const _0x312d39=readFileSync(_0x1db18a,_0x2214bc(0x163)),_0x3b5aa4=a142_0x26725c[_0x2214bc(0x1da)](_0x312d39),_0x14a1f0=validateJourneyDef(_0x1c0017,{'source':_0x312d39,'document':_0x3b5aa4},{'skipSchema':!![]});if(!_0x14a1f0[_0x2214bc(0x1e2)]){const _0x2e5cc2=a142_0x2fc8e0[_0x2214bc(0xed)](_0x3c2277,_0x1db18a);_0xbc6bce[_0x2214bc(0x144)]({'filePath':_0x2e5cc2,'source':_0x312d39,'result':_0x14a1f0,'isJourney':!![]});}}return _0xbc6bce;}export function formatValidationErrors(_0x405715){const _0x277c75=a142_0x5b6902,_0x8dc5c1=[];for(const {filePath:_0x523205,source:_0x500fbc,result:_0x7e9be8,isJourney:_0x7f61b4}of _0x405715){const _0x48887d=_0x7f61b4?_0x277c75(0x139):_0x277c75(0x18f);_0x8dc5c1[_0x277c75(0x144)]('\x0a'+_0x523205+'\x20('+_0x48887d+_0x277c75(0x126)+_0x7e9be8[_0x277c75(0xf2)]['length']+_0x277c75(0xde)),_0x8dc5c1['push'](formatValidationResult(_0x7e9be8,_0x500fbc,_0x523205));}return _0x8dc5c1[_0x277c75(0xfc)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x451289){const _0x1adebc=a142_0x5b6902,_0x757ffc=new Set(),_0x519051=new Map(),_0x2ce8e8=collectSegmentUsageCounts(_0x451289);if(_0x451289[_0x1adebc(0x18a)])for(const [_0x2ede74,_0x1aff5a]of Object[_0x1adebc(0x124)](_0x451289[_0x1adebc(0x18a)])){_0x757ffc[_0x1adebc(0x15f)](_0x2ede74);if(_0x1aff5a['rule']){const _0x44e358=yamlRuleToApi(_0x1aff5a['rule']),_0x2100f6=apiRuleToYaml(_0x44e358);_0x519051['set'](_0x2ede74,_0x2100f6);}}const _0x54cfc4=new Map();let _0x421785=0x0;for(const [_0xdbdcf1,_0x16c241]of _0x519051){const _0x18c1b3=serializeExpandedRule(_0x16c241,_0x519051),_0x5e118c=_0x54cfc4[_0x1adebc(0x138)](_0x18c1b3)||[];_0x5e118c[_0x1adebc(0x144)]({'name':_0xdbdcf1,'index':_0x421785}),_0x54cfc4[_0x1adebc(0x182)](_0x18c1b3,_0x5e118c),_0x421785++;}const _0x1f7008=new Map();for(const [_0x5023a3,_0x5502d7]of _0x54cfc4){const _0x745f2b=_0x5502d7[_0x1adebc(0xda)]()[_0x1adebc(0x1b0)]((_0x5aa078,_0x2cf558)=>{const _0x59bea0=_0x1adebc,_0x3430e8=_0x2ce8e8[_0x59bea0(0x138)](_0x5aa078['name'])||0x0,_0x5bc4e9=_0x2ce8e8[_0x59bea0(0x138)](_0x2cf558[_0x59bea0(0xdf)])||0x0;if(_0x3430e8!==_0x5bc4e9)return _0x5bc4e9-_0x3430e8;return _0x5aa078[_0x59bea0(0x15c)]-_0x2cf558[_0x59bea0(0x15c)];})['map'](_0x296966=>_0x296966[_0x1adebc(0xdf)]),_0x4a7a3b=[];for(const _0x56257c of _0x745f2b){const _0x206479=_0x2ce8e8[_0x1adebc(0x138)](_0x56257c)||0x0,_0x339ac3=Math['max'](_0x206479,0x1);for(let _0x177825=0x0;_0x177825<_0x339ac3;_0x177825++){_0x4a7a3b['push'](_0x56257c);}}_0x1f7008[_0x1adebc(0x182)](_0x5023a3,_0x4a7a3b);}return{'existingLocalSegmentNames':_0x757ffc,'localSegmentRules':_0x519051,'localExpandedRuleToNames':_0x1f7008};}export function createSegmentIdResolver(_0x432480,_0x26c784){return async _0x3ad89c=>{const _0x35e659=a142_0x10a9,_0x2f195c=_0x432480[_0x35e659(0x138)](_0x3ad89c);if(!_0x2f195c)throw new SDKError(ErrorCode[_0x35e659(0x1cc)],'Segment\x20not\x20found:\x20'+_0x3ad89c+_0x35e659(0x1b6)+_0x26c784+'\x27)');return _0x2f195c;};}export function extractRootFolderId(_0x10d176){const _0x4f4979=a142_0x5b6902;return _0x10d176[_0x4f4979(0x145)]?.['parentSegmentFolder']?.[_0x4f4979(0x1cd)]?.['id']||_0x10d176[_0x4f4979(0x145)]?.[_0x4f4979(0x151)]?.[_0x4f4979(0x1cd)]?.['id'];}export function buildConnectionMaps(_0x1c56f9){const _0x480175=a142_0x5b6902,_0x219941=new Map(),_0xe219db=new Map(),_0x372df1=new Map();for(const _0x10d7e5 of _0x1c56f9){_0x219941[_0x480175(0x182)](_0x10d7e5['name'],parseInt(_0x10d7e5['id'],0xa)),_0xe219db[_0x480175(0x182)](_0x10d7e5['id'],_0x10d7e5[_0x480175(0xdf)]),_0x372df1[_0x480175(0x182)](_0x10d7e5[_0x480175(0xdf)],_0x10d7e5['type']);}return{'nameToId':_0x219941,'idToName':_0xe219db,'nameToType':_0x372df1};}export function calculatePushStats(_0x565454,_0x3b75fc,_0x44d4f6,_0x309caf,_0x1bade0,_0x3170b0,_0x5ceeb8){const _0x2bf0bb=a142_0x5b6902,_0x384554=_0x565454['filter'](_0x2460f7=>_0x2460f7[_0x2bf0bb(0x1d7)]),_0x2e2a40=_0x565454[_0x2bf0bb(0x13b)](_0xc48df7=>!_0xc48df7['isNew']&&_0xc48df7[_0x2bf0bb(0x1a2)]),_0x17019b=_0x565454[_0x2bf0bb(0x13b)](_0x5e1c6c=>!_0x5e1c6c[_0x2bf0bb(0x1d7)]&&!_0x5e1c6c[_0x2bf0bb(0x1a2)]),_0x511ea3=_0x3170b0?_0x309caf:[],_0x68d963=_0x3b75fc[_0x2bf0bb(0x13b)](_0x48f6aa=>_0x48f6aa[_0x2bf0bb(0x1d7)]),_0x936b63=_0x3b75fc['filter'](_0x183157=>!_0x183157[_0x2bf0bb(0x1d7)]&&_0x183157['hasChanges']),_0x35bcc4=_0x3b75fc[_0x2bf0bb(0x13b)](_0x676cae=>!_0x676cae['isNew']&&!_0x676cae['hasChanges']),_0x4dea93=_0x3170b0?_0x1bade0:[],_0x3fc922=_0x565454[_0x2bf0bb(0x1b7)](_0x3e06c6=>_0x3e06c6['activationActions']),_0x53d8e8=_0x3fc922[_0x2bf0bb(0x13b)](_0x9ea675=>_0x9ea675[_0x2bf0bb(0xfa)]==='create'),_0x16f97d=_0x3fc922[_0x2bf0bb(0x13b)](_0x1bb63b=>_0x1bb63b[_0x2bf0bb(0xfa)]==='update'),_0x17e316=_0x3fc922[_0x2bf0bb(0x13b)](_0x46a4d4=>_0x46a4d4['type']==='delete'),_0x1d7767=Array[_0x2bf0bb(0x1a7)](_0x44d4f6)['sort'](),_0xbcf7a=_0x5ceeb8?![]:_0x384554[_0x2bf0bb(0x116)]>0x0||_0x2e2a40['length']>0x0||_0x511ea3['length']>0x0,_0x1342c0=_0x68d963[_0x2bf0bb(0x116)]>0x0||_0x936b63['length']>0x0||_0x4dea93[_0x2bf0bb(0x116)]>0x0,_0x20b98d=_0x5ceeb8?![]:_0x3fc922[_0x2bf0bb(0x116)]>0x0,_0x50f7e9=_0x1d7767[_0x2bf0bb(0x116)]>0x0;return{'segments':{'new':_0x384554,'changed':_0x2e2a40,'unchanged':_0x17019b,'toDelete':_0x511ea3},'journeys':{'new':_0x68d963,'changed':_0x936b63,'unchanged':_0x35bcc4,'toDelete':_0x4dea93},'activations':{'all':_0x3fc922,'toCreate':_0x53d8e8,'toUpdate':_0x16f97d,'toDelete':_0x17e316},'folders':{'toCreate':_0x1d7767},'counts':{'segments':{'new':_0x384554[_0x2bf0bb(0x116)],'changed':_0x2e2a40[_0x2bf0bb(0x116)],'unchanged':_0x17019b[_0x2bf0bb(0x116)],'toDelete':_0x511ea3['length']},'journeys':{'new':_0x68d963['length'],'changed':_0x936b63[_0x2bf0bb(0x116)],'unchanged':_0x35bcc4[_0x2bf0bb(0x116)],'toDelete':_0x4dea93[_0x2bf0bb(0x116)]},'activations':{'create':_0x53d8e8['length'],'update':_0x16f97d['length'],'delete':_0x17e316[_0x2bf0bb(0x116)]},'folders':_0x1d7767['length']},'hasChanges':_0xbcf7a||_0x1342c0||_0x20b98d||_0x50f7e9};}export async function buildPushExecutionContext(_0x553d5e,_0x56ffd2,_0x5b4222,_0x3192c5,_0x1178e6,_0x2934ce){const _0x516836=a142_0x5b6902,_0x2ee3d1=extractRootFolderId(_0x5b4222),{pathToId:_0x7e1c74,idToPath:_0x4942f6}=buildFolderMaps(_0x1178e6),_0x1d8a44=buildSegmentNameToIdMap(_0x3192c5),_0xee277f=new Map(),{batchAsync:_0x1bdf22}=await import(_0x516836(0x176)),[_0x435075,_0x2ff27e]=await Promise[_0x516836(0x188)]([_0x553d5e['user'][_0x516836(0x1c4)](),_0x553d5e[_0x516836(0xdd)][_0x516836(0x1e1)](),((async()=>{!_0x2934ce&&_0x3192c5['length']>0x0&&await _0x1bdf22(_0x3192c5,async _0x34d22c=>{const _0x1a33ad=a142_0x10a9,_0x1fee00=await _0x553d5e['segment'][_0x1a33ad(0x133)](_0x56ffd2,_0x34d22c['id']);_0xee277f[_0x1a33ad(0x182)](_0x34d22c['id'],_0x1fee00);});})())]),{emailToId:_0xf4e3b8,idToEmail:_0x29eb42}=_0x435075,_0x446f43=buildConnectionMaps(_0x2ff27e);return{'rootFolderId':_0x2ee3d1,'folderPathToId':_0x7e1c74,'folderIdToPath':_0x4942f6,'segmentNameToId':_0x1d8a44,'activationsBySegmentId':_0xee277f,'emailToIdMap':_0xf4e3b8,'idToEmailMap':_0x29eb42,'connectionNameToIdMap':_0x446f43[_0x516836(0xf6)],'connectionIdToNameMap':_0x446f43[_0x516836(0xd9)],'connectionNameToTypeMap':_0x446f43[_0x516836(0x171)]};}export function createPushYamlContextForBundle(_0x205054,_0x1d8462,_0x5a015f,_0x30c116,_0x21d00e,_0x4fdd9d,_0x114c61,_0x274205){const {existingLocalSegmentNames:_0x38e859,localExpandedRuleToNames:_0x134c5c}=_0x30c116,_0x176398=new Set(),_0x7f7115=new Map(),_0x185135=new Map(),_0x1d3d1b=new Map(),_0x2ae73e=createJumpTargetCache(),_0x2976cf=new Map(),_0x4162b9=new Map(),_0x209bec=new Set();let _0x14d7fb;const _0x29e7c8=_0x327bb4=>{const _0x2fc39a={'resolveSegment':async _0x474fb7=>{const _0x21b6de=a142_0x10a9,_0x355b97=_0x1d3d1b['get'](_0x474fb7);if(_0x355b97!==undefined)return{'name':_0x355b97,'isJourneyLocal':!![]};try{const _0x5183ea=await fetchSegment(_0x205054,_0x1d8462,_0x474fb7,_0x5a015f);if(!_0x5183ea)throw new Error(_0x21b6de(0x13e));const _0xe6a408=generateJourneyLocalName(_0x5183ea['name']),_0x186485=_0x5183ea[_0x21b6de(0x1aa)]===SEGMENT_KIND_JOURNEY&&_0xe6a408!==undefined;let _0x5056ad=_0x5183ea[_0x21b6de(0xdf)],_0x504a7e;if(_0x186485&&_0x5183ea['rule']){const _0x21bd78=apiRuleToYaml(_0x5183ea[_0x21b6de(0x146)]);_0x4162b9[_0x21b6de(0x182)](_0x474fb7,_0x21bd78);const _0x2f7c7b=async _0x15f047=>{const _0x4eb5fa=_0x21b6de,_0x5e3697=collectSegmentRefsFromRule(_0x15f047);for(const _0x5c5eeb of _0x5e3697){if(!_0x4162b9[_0x4eb5fa(0x162)](_0x5c5eeb))try{const _0x6057e3=await fetchSegment(_0x205054,_0x1d8462,_0x5c5eeb,_0x5a015f);if(_0x6057e3?.[_0x4eb5fa(0x146)]){const _0x1e5819=apiRuleToYaml(_0x6057e3[_0x4eb5fa(0x146)]);_0x4162b9[_0x4eb5fa(0x182)](_0x5c5eeb,_0x1e5819),await _0x2f7c7b(_0x1e5819);}}catch(_0x298dbf){logger[_0x4eb5fa(0x136)](_0x4eb5fa(0x135)+_0x5c5eeb+':\x20'+_0x298dbf);}}};await _0x2f7c7b(_0x21bd78);const _0x428b33=serializeExpandedRule(_0x21bd78,_0x4162b9),_0x31e7f7=_0x134c5c['get'](_0x428b33);if(_0x31e7f7&&_0x31e7f7['length']>0x0){const _0x3485be=_0x7f7115[_0x21b6de(0x138)](_0x428b33)||0x0,_0x4fab45=_0x31e7f7[_0x3485be]||_0x31e7f7[_0x31e7f7[_0x21b6de(0x116)]-0x1];_0x7f7115[_0x21b6de(0x182)](_0x428b33,_0x3485be+0x1),_0x5056ad=_0x4fab45,_0x176398['add'](_0x5056ad),_0x1d3d1b[_0x21b6de(0x182)](_0x474fb7,_0x5056ad);const _0x47971c=await resolveRuleSegmentRefs(_0x21bd78,async _0x2d1fe7=>{const _0x50feab=_0x21b6de,_0x121c23=_0x1d3d1b[_0x50feab(0x138)](_0x2d1fe7);if(_0x121c23)return _0x121c23;const _0x24d0cf=await _0x14d7fb[_0x50feab(0xf3)](_0x2d1fe7);return _0x24d0cf[_0x50feab(0xdf)];});_0x504a7e={'description':_0x5183ea[_0x21b6de(0x160)],'rule':_0x47971c};}else{const _0x16651a=_0x2976cf[_0x21b6de(0x138)](_0x428b33);if(_0x16651a)_0x5056ad=_0x16651a,_0x1d3d1b[_0x21b6de(0x182)](_0x474fb7,_0x5056ad);else{if(_0xe6a408){let _0x3bb9e7=_0xe6a408,_0xe374ab=0x2;while(_0x176398[_0x21b6de(0x162)](_0x3bb9e7)||_0x38e859[_0x21b6de(0x162)](_0x3bb9e7)){_0x3bb9e7=_0xe6a408+'_'+_0xe374ab,_0xe374ab++;}_0x176398[_0x21b6de(0x15f)](_0x3bb9e7),_0x5056ad=_0x3bb9e7;}_0x1d3d1b['set'](_0x474fb7,_0x5056ad),_0x2976cf[_0x21b6de(0x182)](_0x428b33,_0x5056ad);const _0x84146b=await resolveRuleSegmentRefs(_0x21bd78,async _0xfd071e=>{const _0x52d6d8=_0x21b6de,_0x277082=_0x1d3d1b[_0x52d6d8(0x138)](_0xfd071e);if(_0x277082)return _0x277082;const _0xda2cff=await _0x14d7fb[_0x52d6d8(0xf3)](_0xfd071e);return _0xda2cff[_0x52d6d8(0xdf)];});_0x504a7e={'description':_0x5183ea[_0x21b6de(0x160)],'rule':_0x84146b};}}}return{'name':_0x5056ad,'isJourneyLocal':_0x186485,'definition':_0x504a7e};}catch(_0x41047d){return logger[_0x21b6de(0x136)](_0x21b6de(0xf9)+_0x474fb7+':\x20'+_0x41047d),{'name':_0x474fb7,'isJourneyLocal':![]};}},'resolveActivation':async _0x666c69=>{const _0xb12082=a142_0x10a9,_0x41bde2=_0x185135[_0xb12082(0x138)](_0x666c69);if(_0x41bde2!==undefined)return{'name':_0x41bde2,'isJourneyLocal':!![]};try{let _0x21c87c=_0x114c61?.['get'](_0x666c69);!_0x21c87c&&(_0x21c87c=await _0x205054[_0xb12082(0x139)][_0xb12082(0x1ab)](_0x327bb4,_0x666c69));const _0x3ef145=_0x21c87c[_0xb12082(0x13d)][_0xb12082(0xdc)]['name']||_0x666c69,_0x3dbff2=sanitizeYamlKey(_0x3ef145)||_0xb12082(0x166)+_0x666c69,_0x3ee676=_0x3dbff2;_0x185135[_0xb12082(0x182)](_0x666c69,_0x3ee676);const _0x146569=journeyActivationStepToYaml(_0x21c87c,_0x21d00e,_0x4fdd9d);return{'name':_0x3ee676,'isJourneyLocal':!![],'definition':_0x146569};}catch(_0x3dcab7){return logger['debug']('Failed\x20to\x20resolve\x20activation\x20'+_0x666c69+':\x20'+_0x3dcab7),{'name':_0x666c69,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x5e56ab,_0x2f656b)=>resolveJumpTarget(_0x5e56ab,_0x2f656b,_0x2ae73e,async _0x163376=>{const _0x59af8a=a142_0x10a9,_0x20f403=_0x274205?.[_0x59af8a(0x138)](_0x163376);if(_0x20f403)return _0x20f403;return _0x205054[_0x59af8a(0x139)]['getJourney'](_0x163376);})};return _0x14d7fb=_0x2fc39a,_0x2fc39a;},_0x5c6bfb=async _0x3e71b0=>{const _0x2b33ee=a142_0x10a9,{collectSegmentIdsFromJourneyApi:_0x40f00d}=await import(_0x2b33ee(0x1b2)),{batchAsync:_0x39ee64}=await import(_0x2b33ee(0x176)),_0x242d9a=new Set();for(const _0x38864b of _0x3e71b0){let _0x40f366=_0x274205?.[_0x2b33ee(0x138)](_0x38864b);!_0x40f366&&(_0x40f366=await _0x205054[_0x2b33ee(0x139)]['getJourney'](_0x38864b));const _0x280e44=_0x40f00d(_0x40f366);for(const _0x34d606 of _0x280e44){_0x242d9a['add'](_0x34d606);}}let _0x127007=Array[_0x2b33ee(0x1a7)](_0x242d9a);while(_0x127007['length']>0x0){const _0x55f141=_0x127007[_0x2b33ee(0x13b)](_0x5c3c1e=>!_0x209bec[_0x2b33ee(0x162)](_0x5c3c1e));if(_0x55f141[_0x2b33ee(0x116)]===0x0)break;const _0xe35854=await _0x39ee64(_0x55f141,async _0x2f4654=>{const _0x219b42=_0x2b33ee;_0x209bec[_0x219b42(0x15f)](_0x2f4654);const _0x104015=await fetchSegment(_0x205054,_0x1d8462,_0x2f4654,_0x5a015f);if(!_0x104015)return null;return{'segmentId':_0x2f4654,'segment':_0x104015};},0xa),_0x490a5f=new Set();for(const _0x528d03 of _0xe35854){if(!_0x528d03?.[_0x2b33ee(0x18f)]?.['rule'])continue;const _0xb63227=apiRuleToYaml(_0x528d03['segment'][_0x2b33ee(0x146)]);_0x4162b9[_0x2b33ee(0x182)](_0x528d03[_0x2b33ee(0x1bc)],_0xb63227);const _0x359145=collectSegmentRefsFromRule(_0xb63227);for(const _0x56e665 of _0x359145){!_0x209bec[_0x2b33ee(0x162)](_0x56e665)&&_0x490a5f[_0x2b33ee(0x15f)](_0x56e665);}}_0x127007=Array[_0x2b33ee(0x1a7)](_0x490a5f);}};return{'createYamlContext':_0x29e7c8,'prefetchJourneySegments':_0x5c6bfb};}export async function executePushSegments(_0x29d7e1,_0x21951f,_0x1ac9f1,_0xddc26e,_0x4ed740){const _0x226845=a142_0x5b6902,{segmentDefToCreateRequest:_0x453450,segmentDefToUpdateRequest:_0x3a290f}=await import(_0x226845(0x13c)),_0x6603c8=_0x1ac9f1[_0x226845(0x103)],_0xfee1e0=0x5,_0x338252=async _0x2f5018=>{const _0x177ace=_0x226845,_0x2b37af=_0x2f5018[_0x177ace(0x1c3)]?_0x6603c8[_0x177ace(0x138)](_0x2f5018['folderPath']):undefined;let _0x8f6a8;const _0x56415c={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x3f055e=_0x2f5018['yamlConfig'];if(_0x2f5018['yamlConfig'][_0x177ace(0x146)]){const _0x143e1f=createSegmentIdResolver(_0x1ac9f1[_0x177ace(0x1a8)],_0x2f5018[_0x177ace(0x1b1)][_0x177ace(0xdf)]),_0x1fcc57=await resolveRuleSegmentIds(_0x2f5018['yamlConfig'][_0x177ace(0x146)],_0x143e1f);_0x3f055e={..._0x2f5018[_0x177ace(0x1b1)],'rule':_0x1fcc57};}try{if(_0x2f5018[_0x177ace(0x1d7)]){_0x4ed740[_0x177ace(0x130)]?.({'type':_0x177ace(0x1c9),'name':_0x2f5018[_0x177ace(0x1b1)]['name']});const _0x588121=_0x453450(_0x3f055e,_0x2b37af),_0x1293cb=await _0x4ed740[_0x177ace(0x1a0)](_0x177ace(0x1a5)+_0x2f5018[_0x177ace(0x1b1)][_0x177ace(0xdf)]+_0x177ace(0x153),()=>_0x29d7e1['segment'][_0x177ace(0x1c5)](_0xddc26e['parentId'],_0x588121));_0x8f6a8=_0x1293cb[_0x177ace(0x1cd)]['id'],_0x1ac9f1[_0x177ace(0x1a8)]['set'](_0x2f5018[_0x177ace(0x1b1)][_0x177ace(0xdf)],_0x8f6a8),_0x56415c[_0x177ace(0x14d)]={'name':_0x2f5018['yamlConfig'][_0x177ace(0xdf)],'id':_0x8f6a8},_0x4ed740['onProgress']?.({'type':'segment_created','name':_0x2f5018[_0x177ace(0x1b1)][_0x177ace(0xdf)],'segmentId':_0x8f6a8}),_0x4ed740[_0x177ace(0x1df)]?.(_0x177ace(0x1a4)+_0x2f5018['yamlConfig']['name']+'\x27'),_0x56415c[_0x177ace(0xe3)]=0x1;}else{if(_0x2f5018[_0x177ace(0x1a2)]){_0x4ed740[_0x177ace(0x130)]?.({'type':'segment_updating','name':_0x2f5018[_0x177ace(0x1b1)]['name']});const _0x1147af=_0x3a290f(_0x3f055e);_0x2b37af!==_0x2f5018[_0x177ace(0x19c)]?.[_0x177ace(0x1d9)]&&(_0x1147af[_0x177ace(0x1d9)]=_0x2b37af?parseInt(_0x2b37af,0xa):undefined),await _0x4ed740[_0x177ace(0x1a0)](_0x177ace(0x132)+_0x2f5018['yamlConfig'][_0x177ace(0xdf)]+'\x27...',()=>_0x29d7e1['segment'][_0x177ace(0x186)](_0xddc26e[_0x177ace(0x1ad)],_0x2f5018['existingSegment']['id'],_0x1147af)),_0x8f6a8=_0x2f5018['existingSegment']['id'],_0x4ed740[_0x177ace(0x130)]?.({'type':_0x177ace(0x10d),'name':_0x2f5018['yamlConfig'][_0x177ace(0xdf)]}),_0x4ed740[_0x177ace(0x1df)]?.(_0x177ace(0x12b)+_0x2f5018[_0x177ace(0x1b1)][_0x177ace(0xdf)]+'\x27'),_0x56415c[_0x177ace(0xe7)]=0x1;}else _0x8f6a8=_0x2f5018[_0x177ace(0x19c)]['id'];}}catch(_0x1cb21e){const _0x32b034=isHttp400Error(_0x1cb21e),_0xe2c9ca=_0x32b034?ErrorCode[_0x177ace(0x1ae)]:ErrorCode[_0x177ace(0x15e)],_0x59325a=getErrorMessage(_0x1cb21e);throw new SDKError(_0xe2c9ca,_0x177ace(0x13a)+(_0x2f5018['isNew']?_0x177ace(0x184):_0x177ace(0xf0))+_0x177ace(0x1c1)+_0x2f5018[_0x177ace(0x11a)]+'\x0a\x20\x20'+_0x59325a,_0x1cb21e);}try{const _0x4817d2=await syncActivationsForSegment(_0x29d7e1,_0xddc26e['parentId'],_0x8f6a8,_0x2f5018[_0x177ace(0x1b1)][_0x177ace(0xdf)],_0x2f5018['activationActions'],_0x4ed740,_0x2f5018[_0x177ace(0x11a)]);_0x56415c[_0x177ace(0x11f)]=_0x4817d2;}catch(_0x421090){if(_0x421090 instanceof SDKError)throw _0x421090;throw new SDKError(ErrorCode[_0x177ace(0xe0)],'Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27'+_0x2f5018[_0x177ace(0x1b1)][_0x177ace(0xdf)]+_0x177ace(0x134)+_0x2f5018[_0x177ace(0x11a)]+_0x177ace(0x17a)+getErrorMessage(_0x421090),_0x421090);}return _0x56415c;},_0x27c253=await batchAsync(_0x21951f,_0x338252,_0xfee1e0),_0x29d575={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x36c74e of _0x27c253){_0x29d575[_0x226845(0xe3)]+=_0x36c74e[_0x226845(0xe3)],_0x29d575[_0x226845(0xe7)]+=_0x36c74e[_0x226845(0xe7)],_0x36c74e['createdSegmentId']&&_0x29d575[_0x226845(0xfe)][_0x226845(0x182)](_0x36c74e['createdSegmentId'][_0x226845(0xdf)],_0x36c74e[_0x226845(0x14d)]['id']),_0x29d575[_0x226845(0x11f)][_0x226845(0xe3)]+=_0x36c74e[_0x226845(0x11f)][_0x226845(0xe3)],_0x29d575[_0x226845(0x11f)][_0x226845(0xe7)]+=_0x36c74e['activations']['updated'],_0x29d575[_0x226845(0x11f)][_0x226845(0x1c2)]+=_0x36c74e[_0x226845(0x11f)][_0x226845(0x1c2)];}return _0x29d575;}async function syncActivationsForSegment(_0x1f592f,_0x1d769b,_0x48e0d2,_0x539ca1,_0xca0e52,_0x5eaf82,_0x379a45){const _0x4dc22d=a142_0x5b6902,_0x3ecd1e={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0xcc9392 of _0xca0e52){try{if(_0xcc9392[_0x4dc22d(0xfa)]===_0x4dc22d(0x184)&&_0xcc9392[_0x4dc22d(0x197)])_0x5eaf82['onProgress']?.({'type':_0x4dc22d(0xf4),'segmentName':_0x539ca1,'activationName':_0xcc9392[_0x4dc22d(0xdf)]}),await _0x5eaf82[_0x4dc22d(0x1a0)](_0x4dc22d(0x12a)+_0xcc9392['name']+_0x4dc22d(0x153),()=>_0x1f592f['segment'][_0x4dc22d(0xf8)](_0x1d769b,_0x48e0d2,_0xcc9392[_0x4dc22d(0x197)])),_0x5eaf82[_0x4dc22d(0x130)]?.({'type':_0x4dc22d(0x194),'segmentName':_0x539ca1,'activationName':_0xcc9392[_0x4dc22d(0xdf)]}),_0x5eaf82[_0x4dc22d(0x1df)]?.('Created\x20activation\x20\x27'+_0xcc9392[_0x4dc22d(0xdf)]+'\x27'),_0x3ecd1e[_0x4dc22d(0xe3)]++;else{if(_0xcc9392['type']==='update'&&_0xcc9392['validatedRequest']&&_0xcc9392[_0x4dc22d(0x109)])_0x5eaf82[_0x4dc22d(0x130)]?.({'type':_0x4dc22d(0x155),'segmentName':_0x539ca1,'activationName':_0xcc9392[_0x4dc22d(0xdf)]}),await _0x5eaf82['withProgress'](_0x4dc22d(0x17b)+_0xcc9392[_0x4dc22d(0xdf)]+_0x4dc22d(0x153),()=>_0x1f592f[_0x4dc22d(0x18f)]['updateActivation'](_0x1d769b,_0x48e0d2,_0xcc9392[_0x4dc22d(0x109)]['id'],_0xcc9392['validatedRequest'])),_0x5eaf82[_0x4dc22d(0x130)]?.({'type':_0x4dc22d(0x183),'segmentName':_0x539ca1,'activationName':_0xcc9392[_0x4dc22d(0xdf)]}),_0x5eaf82['logSuccess']?.('Updated\x20activation\x20\x27'+_0xcc9392[_0x4dc22d(0xdf)]+'\x27'),_0x3ecd1e[_0x4dc22d(0xe7)]++;else _0xcc9392[_0x4dc22d(0xfa)]==='delete'&&_0xcc9392[_0x4dc22d(0x109)]&&(_0x5eaf82[_0x4dc22d(0x130)]?.({'type':_0x4dc22d(0x1db),'segmentName':_0x539ca1,'activationName':_0xcc9392[_0x4dc22d(0xdf)]}),await _0x5eaf82['withProgress'](_0x4dc22d(0x15a)+_0xcc9392[_0x4dc22d(0xdf)]+'\x27...',()=>_0x1f592f[_0x4dc22d(0x18f)][_0x4dc22d(0x1ca)](_0x1d769b,_0x48e0d2,_0xcc9392['existingActivation']['id'])),_0x5eaf82[_0x4dc22d(0x130)]?.({'type':_0x4dc22d(0x1b9),'segmentName':_0x539ca1,'activationName':_0xcc9392[_0x4dc22d(0xdf)]}),_0x5eaf82[_0x4dc22d(0x11c)]?.('Deleted\x20activation\x20\x27'+_0xcc9392['name']+'\x27'),_0x3ecd1e[_0x4dc22d(0x1c2)]++);}}catch(_0xadfa08){const _0x49304c=isHttp400Error(_0xadfa08),_0x3ce0f7=_0x49304c?ErrorCode[_0x4dc22d(0x12d)]:ErrorCode[_0x4dc22d(0xe0)],_0x25309b=getErrorMessage(_0xadfa08);throw new SDKError(_0x3ce0f7,_0x4dc22d(0x13a)+_0xcc9392[_0x4dc22d(0xfa)]+_0x4dc22d(0x105)+_0xcc9392['name']+_0x4dc22d(0x134)+_0x379a45+'\x0a\x20\x20'+_0x25309b,_0xadfa08);}}return _0x3ecd1e;}export async function executePushFolders(_0x27a6a0,_0x54d671,_0x8236f9,_0x30732f,_0x49030b){const _0x60d669=a142_0x5b6902,_0x16ada4=new Map(_0x8236f9),_0x3afecf=sortFoldersByDepth(_0x54d671);for(const _0x2399f8 of _0x3afecf){const _0x4a8e83=_0x2399f8[_0x60d669(0x18d)]('/'),_0x381997=_0x4a8e83[_0x4a8e83['length']-0x1],_0x4dc0ce=_0x4a8e83['slice'](0x0,-0x1)[_0x60d669(0xfc)]('/'),_0x49d79c=_0x16ada4['get'](_0x4dc0ce);_0x49030b['onProgress']?.({'type':_0x60d669(0x1a6),'folder':_0x2399f8});const _0x36c8a6={'name':_0x381997,'parentFolderId':_0x49d79c},_0x3df331=await _0x49030b[_0x60d669(0x1a0)](_0x60d669(0x192)+_0x2399f8+_0x60d669(0x153),()=>_0x27a6a0[_0x60d669(0x18f)][_0x60d669(0x114)](_0x30732f[_0x60d669(0x1ad)],_0x36c8a6));_0x16ada4[_0x60d669(0x182)](_0x2399f8,_0x3df331[_0x60d669(0x1cd)]['id']),_0x49030b[_0x60d669(0x130)]?.({'type':'folder_created','folder':_0x2399f8,'folderId':_0x3df331[_0x60d669(0x1cd)]['id']}),_0x49030b[_0x60d669(0x1d4)]?.('Created\x20folder\x20\x27'+_0x2399f8+'\x27');}return _0x16ada4;}export async function executePushSegmentDeletions(_0x2a1092,_0x35b9ac,_0x54f30a){const _0x1816a0=a142_0x5b6902;if(_0x35b9ac[_0x1816a0(0x116)]===0x0)return 0x0;const {batchAsync:_0x525082}=await import(_0x1816a0(0x176)),_0xab286c=0x5,_0x5048ac=await _0x525082(_0x35b9ac,async _0x358d85=>{const _0x2eaeff=_0x1816a0;return _0x54f30a[_0x2eaeff(0x130)]?.({'type':'segment_deleting','name':_0x358d85[_0x2eaeff(0xdf)]}),await _0x2a1092[_0x2eaeff(0x18f)][_0x2eaeff(0x1de)](_0x358d85['id']),_0x54f30a['onProgress']?.({'type':_0x2eaeff(0x143),'name':_0x358d85[_0x2eaeff(0xdf)]}),_0x54f30a[_0x2eaeff(0x11c)]?.(_0x2eaeff(0xdb)+_0x358d85['name']+'\x27'),0x1;},_0xab286c);return _0x5048ac[_0x1816a0(0xee)]((_0x1a48ef,_0x26295c)=>_0x1a48ef+_0x26295c,0x0);}export async function executePushJourneys(_0x3ac57a,_0x47768a,_0x396336,_0x117ac8,_0x4c5875){const _0x5e9d0e=a142_0x5b6902,{journeyDefToRequest:_0x2029bb}=await import(_0x5e9d0e(0x1b2)),{activationDefToCreateRequest:_0x3e4035,yamlRuleToApi:_0x2eb53e,validateSegmentRule:_0x295df1}=await import(_0x5e9d0e(0x13c)),_0x3ce7e3={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x4289c6=new Map(_0x396336[_0x5e9d0e(0x1a8)]),_0x1b3990=0x5;for(let _0x14bf95=0x0;_0x14bf95<_0x47768a[_0x5e9d0e(0x116)];_0x14bf95+=_0x1b3990){const _0x348975=_0x47768a[_0x5e9d0e(0xda)](_0x14bf95,_0x14bf95+_0x1b3990),_0x2b99a5=await Promise[_0x5e9d0e(0x188)](_0x348975[_0x5e9d0e(0x1cf)](async _0x5ac2d1=>{const _0x51f645=_0x5e9d0e;if(!_0x5ac2d1[_0x51f645(0x1d7)]&&!_0x5ac2d1[_0x51f645(0x1a2)])return{'action':'unchanged','name':_0x5ac2d1[_0x51f645(0x1b1)][_0x51f645(0xdf)],'journeyId':_0x5ac2d1[_0x51f645(0x164)]?.['id']};const _0x3869d5=_0x5ac2d1['folderPath']?_0x396336[_0x51f645(0x103)]['get'](_0x5ac2d1['folderPath']):undefined;_0x4c5875['onProgress']?.({'type':_0x5ac2d1['isNew']?_0x51f645(0x16d):_0x51f645(0x137),'name':_0x5ac2d1[_0x51f645(0x1b1)][_0x51f645(0xdf)]});try{const _0x2f3777=await executeSingleJourneyPush(_0x3ac57a,_0x5ac2d1,{..._0x396336,'segmentNameToId':_0x4289c6},{'parentId':_0x117ac8['parentId'],'rootFolderId':_0x117ac8['rootFolderId'],'folderId':_0x3869d5,'verbose':_0x117ac8[_0x51f645(0x1d3)]},_0x4c5875,{'journeyDefToRequest':_0x2029bb,'activationDefToCreateRequest':_0x3e4035,'yamlRuleToApi':_0x2eb53e,'validateSegmentRule':_0x295df1});for(const [_0x37a121,_0x326b90]of _0x2f3777['embeddedSegmentNameToId']){_0x4289c6['set'](_0x37a121,_0x326b90),_0x3ce7e3[_0x51f645(0x10a)][_0x51f645(0x182)](_0x37a121,_0x326b90);}if(_0x2f3777[_0x51f645(0x170)]===_0x51f645(0xe3))_0x4c5875[_0x51f645(0x130)]?.({'type':'journey_created','name':_0x5ac2d1[_0x51f645(0x1b1)][_0x51f645(0xdf)],'journeyId':_0x2f3777[_0x51f645(0x177)]}),_0x4c5875[_0x51f645(0x1df)]?.('Created\x20journey\x20\x27'+_0x5ac2d1[_0x51f645(0x1b1)][_0x51f645(0xdf)]+'\x27'),_0x3ce7e3[_0x51f645(0xe3)]++;else _0x2f3777['action']===_0x51f645(0xe7)&&(_0x4c5875[_0x51f645(0x130)]?.({'type':_0x51f645(0x19f),'name':_0x5ac2d1[_0x51f645(0x1b1)][_0x51f645(0xdf)]}),_0x4c5875[_0x51f645(0x1df)]?.('Updated\x20journey\x20\x27'+_0x5ac2d1[_0x51f645(0x1b1)][_0x51f645(0xdf)]+'\x27'),_0x3ce7e3['updated']++);return{'action':_0x2f3777[_0x51f645(0x170)],'name':_0x5ac2d1[_0x51f645(0x1b1)][_0x51f645(0xdf)],'journeyId':_0x2f3777[_0x51f645(0x177)]};}catch(_0x368bcb){const _0x1e3b5f=isHttp400Error(_0x368bcb),_0x46de5b=_0x1e3b5f?ErrorCode[_0x51f645(0xd8)]:ErrorCode[_0x51f645(0x1a1)],_0x1a150d=getErrorMessage(_0x368bcb);throw new SDKError(_0x46de5b,_0x51f645(0x13a)+(_0x5ac2d1[_0x51f645(0x1d7)]?'create':'update')+_0x51f645(0x11e)+_0x5ac2d1[_0x51f645(0x11a)]+_0x51f645(0x17a)+_0x1a150d,_0x368bcb);}}));_0x3ce7e3[_0x5e9d0e(0x1a3)][_0x5e9d0e(0x144)](..._0x2b99a5);}return _0x3ce7e3;}async function matchExistingJourneySegments(_0x4863c1,_0x4df27b,_0x46cbb1,_0x218deb,_0x4b075b){const _0x3f3ad2=a142_0x5b6902;if(!_0x4df27b[_0x3f3ad2(0x164)]||!_0x4df27b[_0x3f3ad2(0x1b1)]['segments'])return;const _0x4fa767=new Map(),_0x53599a=new Set();for(const _0x15ffbc of Object['keys'](_0x4df27b['yamlConfig'][_0x3f3ad2(0x18a)])){const _0x454394=generateDeterministicJourneySegmentName(_0x4df27b[_0x3f3ad2(0x1b1)][_0x3f3ad2(0xdf)],_0x15ffbc);_0x4fa767[_0x3f3ad2(0x182)](_0x454394,_0x15ffbc),_0x53599a[_0x3f3ad2(0x15f)](_0x15ffbc);}const _0x4d3e33=[],_0x6e7bfc=collectSegmentIdsFromJourneyApi(_0x4df27b[_0x3f3ad2(0x164)]);for(const _0x46156a of _0x6e7bfc){const _0x36508f=await fetchSegment(_0x4863c1,_0x46cbb1,_0x46156a,_0x218deb);if(!_0x36508f?.[_0x3f3ad2(0xdf)])continue;const _0x17b150=_0x4fa767[_0x3f3ad2(0x138)](_0x36508f[_0x3f3ad2(0xdf)]);_0x17b150?(_0x4b075b['set'](_0x17b150,_0x46156a),_0x53599a[_0x3f3ad2(0x1d5)](_0x17b150)):_0x4d3e33[_0x3f3ad2(0x144)]({'id':_0x46156a,'seg':_0x36508f});}if(_0x53599a['size']>0x0&&_0x4d3e33['length']>0x0){const {localExpandedRuleToNames:_0x206a6b}=buildLocalExpandedRuleMappings(_0x4df27b['yamlConfig']),_0x373503=new Map();for(const {id:_0x99067b,seg:_0x23961d}of _0x4d3e33){if(_0x23961d['rule']){const _0x113c76=apiRuleToYaml(_0x23961d['rule']);_0x373503[_0x3f3ad2(0x182)](_0x99067b,_0x113c76);}}for(const {id:_0x25e8aa,seg:_0x40e191}of _0x4d3e33){if(!_0x40e191[_0x3f3ad2(0x146)])continue;const _0x1fb4d0=_0x373503['get'](_0x25e8aa);if(!_0x1fb4d0)continue;const _0x171333=serializeExpandedRule(_0x1fb4d0,_0x373503),_0x1dddf9=_0x206a6b[_0x3f3ad2(0x138)](_0x171333);if(_0x1dddf9){const _0x3ea294=_0x1dddf9[_0x3f3ad2(0x168)](_0x17b6b4=>_0x53599a[_0x3f3ad2(0x162)](_0x17b6b4));_0x3ea294&&(_0x4b075b['set'](_0x3ea294,_0x25e8aa),_0x53599a['delete'](_0x3ea294),logger[_0x3f3ad2(0x136)](_0x3f3ad2(0x1bd)+_0x40e191[_0x3f3ad2(0xdf)]+_0x3f3ad2(0xf5)+_0x3ea294+_0x3f3ad2(0x19b)));}}}}async function executeSingleJourneyPush(_0x210ade,_0x356efd,_0x5cd914,_0xd878b4,_0x48ed4e,_0x53306d){const _0xd482b1=a142_0x5b6902,{journeyDefToRequest:_0x3699c7,activationDefToCreateRequest:_0x1cfb6e,yamlRuleToApi:_0x22ec80,validateSegmentRule:_0x29bea8}=_0x53306d,_0x574db5=new Map(),_0x1c6cbd=new Map();recoverSegmentIdsFromPushRecovery(_0x356efd,_0x574db5,_0x5cd914[_0xd482b1(0x1a8)]);const _0x558f53=new Map(),_0x5c1dd2=new Map(),_0xdc8fbf=new Map();let _0x2425d5;const _0x4629b4=async()=>{const _0x4f9e6b=_0xd482b1;if(_0x2425d5)return;_0x2425d5=new Map();if(!_0x356efd[_0x4f9e6b(0x164)])return;const _0x97cee=await _0x210ade[_0x4f9e6b(0x139)]['listActivations'](_0x356efd['existingJourney']['id']);for(const _0x313de1 of _0x97cee){const _0x3b9bd4=journeyActivationStepToYaml(_0x313de1,_0x5cd914[_0x4f9e6b(0xf1)],_0x5cd914[_0x4f9e6b(0x1d1)]),_0x2f3fc7=activationSignature(_0x3b9bd4);!_0x2425d5[_0x4f9e6b(0x162)](_0x2f3fc7)&&_0x2425d5[_0x4f9e6b(0x182)](_0x2f3fc7,_0x313de1['id']),_0x3b9bd4[_0x4f9e6b(0xdf)]&&_0x1c6cbd[_0x4f9e6b(0x182)](_0x3b9bd4[_0x4f9e6b(0xdf)],_0x313de1['id']);}};await matchExistingJourneySegments(_0x210ade,_0x356efd,_0xd878b4[_0xd482b1(0x1ad)],_0x5cd914[_0xd482b1(0x17d)],_0x5cd914['segmentNameToId']);const _0x40ff6d={'resolveSegmentId':async _0x37afec=>{const _0x24f6b4=_0xd482b1,_0x2793ad=_0x5cd914[_0x24f6b4(0x1a8)][_0x24f6b4(0x138)](_0x37afec);if(!_0x2793ad)throw new SDKError(ErrorCode[_0x24f6b4(0x1cc)],_0x24f6b4(0x17f)+_0x37afec+_0x24f6b4(0x101)+_0x356efd['yamlConfig'][_0x24f6b4(0xdf)]+')');return _0x2793ad;},'resolveEmbeddedSegmentId':async(_0x140055,_0x39669c)=>{const _0x704275=_0xd482b1,_0x2a42c4=_0x5cd914[_0x704275(0x1a8)][_0x704275(0x138)](_0x140055);if(_0x2a42c4)return _0x2a42c4;const _0x8017ef=_0x5cd914[_0x704275(0x17d)][_0x704275(0x168)](_0x4002d2=>_0x4002d2[_0x704275(0xdf)]===_0x140055);if(_0x8017ef)return _0x5cd914[_0x704275(0x1a8)]['set'](_0x140055,_0x8017ef['id']),_0x8017ef['id'];if(_0x356efd[_0x704275(0x1d7)]){const {stageName:_0x3f544c,criteriaName:_0x4abba7}=findSegmentCriteriaLocation(_0x356efd[_0x704275(0x1b1)],_0x140055);return _0x29bea8(_0x140055,_0x39669c['rule']),_0x5c1dd2[_0x704275(0x182)](_0x140055,{'definition':_0x39669c,'stageName':_0x3f544c,'criteriaName':_0x4abba7}),createPendingSegmentId(_0x140055);}const _0x1a536e=_0x356efd[_0x704275(0x164)]?.['id'];if(!_0x1a536e)throw new SDKError(ErrorCode['INTERNAL'],'Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID');const _0x39ca87=_0x558f53['get'](_0x140055);if(_0x39ca87)return _0x39ca87;const _0x5a1ab6=((async()=>{const _0x157e31=_0x704275;_0x29bea8(_0x140055,_0x39669c[_0x157e31(0x146)]);const _0xc29d34=generateDeterministicJourneySegmentName(_0x356efd[_0x157e31(0x1b1)][_0x157e31(0xdf)],_0x140055),_0x1234b1=_0x5cd914[_0x157e31(0x17d)][_0x157e31(0x168)](_0x9a8630=>_0x9a8630[_0x157e31(0xdf)]===_0xc29d34),_0x1a5b03=createSegmentIdResolver(_0x5cd914[_0x157e31(0x1a8)],_0x140055),_0x56044f=await resolveRuleSegmentIds(_0x39669c[_0x157e31(0x146)],_0x1a5b03);let _0x2f9ce8;return _0x1234b1?(await _0x210ade[_0x157e31(0x18f)][_0x157e31(0x186)](_0xd878b4[_0x157e31(0x1ad)],_0x1234b1['id'],{'description':_0x39669c['description']||_0x157e31(0x190)+_0x140055,'rule':_0x22ec80(_0x56044f,!![]),'countPopulation':!![]}),_0x2f9ce8=_0x1234b1['id'],saveSegmentToPushRecovery(_0x356efd[_0x157e31(0x11a)],_0x356efd[_0x157e31(0x1b1)][_0x157e31(0xdf)],_0x140055,{'segmentId':_0x2f9ce8,'uniqueServerName':_0xc29d34,'createdAt':new Date()['toISOString']()})):_0x2f9ce8=await createOrRecoverEmbeddedSegment(_0x210ade,_0x356efd,{'localName':_0x140055,'uniqueSegmentName':_0xc29d34,'description':_0x39669c[_0x157e31(0x160)]||'Entry\x20criteria:\x20'+_0x140055,'journeyId':_0x1a536e,'resolvedRule':_0x56044f,'parentId':_0xd878b4[_0x157e31(0x1ad)],'folderId':_0xd878b4['rootFolderId']||''},_0x22ec80),_0x5cd914['segmentNameToId'][_0x157e31(0x182)](_0x140055,_0x2f9ce8),_0x574db5[_0x157e31(0x182)](_0x140055,_0x2f9ce8),_0x2f9ce8;})());_0x558f53['set'](_0x140055,_0x5a1ab6);try{return await _0x5a1ab6;}finally{_0x558f53['delete'](_0x140055);}},'resolveActivationId':async _0x160822=>{const _0x49a1c8=_0xd482b1,_0xaa0cdb=_0x1c6cbd[_0x49a1c8(0x138)](_0x160822);if(_0xaa0cdb)return _0xaa0cdb;if(_0x356efd['existingJourney']){await _0x4629b4();const _0x920679=_0x1c6cbd[_0x49a1c8(0x138)](_0x160822);if(_0x920679)return _0x920679;}throw new SDKError(ErrorCode[_0x49a1c8(0x113)],_0x49a1c8(0x1dc)+_0x160822+_0x49a1c8(0x101)+_0x356efd[_0x49a1c8(0x1b1)][_0x49a1c8(0xdf)]+').\x20'+_0x49a1c8(0xea));},'resolveEmbeddedActivationId':async(_0x54296c,_0x27fab3)=>{const _0x5f3216=_0xd482b1,_0x334b42=_0x1c6cbd[_0x5f3216(0x138)](_0x54296c);if(_0x334b42)return _0x334b42;if(_0x356efd[_0x5f3216(0x1d7)])return _0xdc8fbf[_0x5f3216(0x182)](_0x54296c,_0x27fab3),createPendingActivationId(_0x54296c);if(_0x356efd[_0x5f3216(0x164)]){await _0x4629b4();const _0x681a72=_0x1c6cbd[_0x5f3216(0x138)](_0x27fab3[_0x5f3216(0xdf)]);if(_0x681a72)return _0x1c6cbd['set'](_0x54296c,_0x681a72),_0x681a72;const _0x126b61=activationSignature(_0x27fab3),_0xd2d507=_0x2425d5?.[_0x5f3216(0x138)](_0x126b61);if(_0xd2d507)return _0x1c6cbd[_0x5f3216(0x182)](_0x54296c,_0xd2d507),_0xd2d507;const _0x225775=await _0x1cfb6e(_0x27fab3,_0x5cd914[_0x5f3216(0xe2)]),_0x2fbedc={..._0x225775,..._0x27fab3[_0x5f3216(0x15b)]!==undefined&&{'runAfterJourneyRefresh':_0x27fab3[_0x5f3216(0x15b)]}},_0x34f1df=await _0x210ade['journey'][_0x5f3216(0xf8)](_0x356efd[_0x5f3216(0x164)]['id'],_0x2fbedc);return _0x1c6cbd[_0x5f3216(0x182)](_0x54296c,_0x34f1df['id']),_0x34f1df['id'];}throw new SDKError(ErrorCode['INTERNAL'],_0x5f3216(0x1ce));},'resolveJourneyId':async _0x30d4c2=>{const _0xc6eb59=_0xd482b1;try{return await _0x210ade[_0xc6eb59(0x139)]['resolveJourneyId'](_0xd878b4[_0xc6eb59(0x1ad)],_0x30d4c2);}catch(_0x279564){throw new SDKError(ErrorCode[_0xc6eb59(0x113)],_0xc6eb59(0xfb)+_0x30d4c2+_0xc6eb59(0xe6)+_0x356efd[_0xc6eb59(0x1b1)]['name']+'\x27)',_0x279564);}},'resolveStageId':async(_0x18eae9,_0xd75515)=>{const _0x144ede=_0xd482b1,_0x1ff4b9=await _0x210ade[_0x144ede(0x139)][_0x144ede(0x156)](_0x18eae9),_0x316554=_0x1ff4b9[_0x144ede(0x13d)][_0x144ede(0x150)]['find'](_0x2a8f02=>_0x2a8f02['name']['toLowerCase']()===_0xd75515[_0x144ede(0x16a)]());if(!_0x316554?.['id'])throw new SDKError(ErrorCode[_0x144ede(0x113)],_0x144ede(0x120)+_0xd75515+_0x144ede(0xef)+(_0x1ff4b9[_0x144ede(0x13d)]['journeyBundleName']||_0x1ff4b9[_0x144ede(0x13d)][_0x144ede(0xdf)])+'\x27');return _0x316554['id'];}},_0x362083=await _0x3699c7(_0x356efd[_0xd482b1(0x1b1)],_0xd878b4[_0xd482b1(0x1ad)],_0x40ff6d),_0x29ab1f=_0xd878b4[_0xd482b1(0x111)]||_0xd878b4[_0xd482b1(0x1b8)];_0x29ab1f&&(_0x362083[_0xd482b1(0x145)]={'parentFolder':{'data':{'id':_0x29ab1f,'type':_0xd482b1(0x106)}}});if(_0x356efd[_0xd482b1(0x1d7)]){if(_0x5c1dd2[_0xd482b1(0x180)]>0x0||_0xdc8fbf[_0xd482b1(0x180)]>0x0)return await executeThreeStepJourneyCreate(_0x210ade,_0x356efd,_0x362083,{'pendingEmbeddedSegments':_0x5c1dd2,'pendingEmbeddedActivations':_0xdc8fbf,'embeddedSegmentNameToId':_0x574db5,'journeyActivationNameToId':_0x1c6cbd},{..._0xd878b4,'effectiveFolderId':_0x29ab1f},_0x5cd914,_0x48ed4e,_0x53306d);else{ensureJourneyDefaults(_0x362083[_0xd482b1(0x13d)]);const _0x30f237=await _0x210ade[_0xd482b1(0x139)]['create'](_0x362083);return deletePushRecovery(_0x356efd[_0xd482b1(0x11a)]),{'action':'created','journeyId':_0x30f237['id'],'embeddedSegmentNameToId':_0x574db5};}}else{if(_0x356efd[_0xd482b1(0x1a2)]&&_0x356efd[_0xd482b1(0x164)]){_0x362083['id']=_0x356efd['existingJourney']['id'];const _0x5ce97c=_0x362083[_0xd482b1(0x13d)];_0x356efd[_0xd482b1(0x164)][_0xd482b1(0x13d)]?.[_0xd482b1(0x191)]&&(_0x5ce97c[_0xd482b1(0x191)]=_0x356efd[_0xd482b1(0x164)][_0xd482b1(0x13d)]['journeyBundleName']);const _0x3007c3=_0x356efd['existingJourney'][_0xd482b1(0x13d)]?.['journeyStages'];return _0x3007c3&&_0x362083['attributes'][_0xd482b1(0x150)]&&injectExistingStageIds(_0x362083['attributes'][_0xd482b1(0x150)],_0x3007c3),ensureJourneyDefaults(_0x5ce97c),await _0x210ade[_0xd482b1(0x139)][_0xd482b1(0xf0)](_0x356efd[_0xd482b1(0x164)]['id'],_0x362083),deletePushRecovery(_0x356efd['absolutePath']),{'action':_0xd482b1(0xe7),'journeyId':_0x356efd[_0xd482b1(0x164)]['id'],'embeddedSegmentNameToId':_0x574db5};}}return deletePushRecovery(_0x356efd[_0xd482b1(0x11a)]),{'action':_0xd482b1(0x1bb),'journeyId':_0x356efd[_0xd482b1(0x164)]?.['id'],'embeddedSegmentNameToId':_0x574db5};}function findSegmentCriteriaLocation(_0x766864,_0x1a49ba){const _0x2d0c8a=a142_0x5b6902,_0x125fba=_0x766864['stages']||_0x766864[_0x2d0c8a(0xf7)]?.[0x0]?.[_0x2d0c8a(0x152)]||[];let _0x359c1d=_0x2d0c8a(0x128),_0x44fa28=_0x1a49ba;const _0x3c8120=_0x766864[_0x2d0c8a(0x161)]||_0x766864[_0x2d0c8a(0xf7)]?.[0x0]?.['goal'];if(_0x3c8120?.[_0x2d0c8a(0x18f)]===_0x1a49ba)return{'stageName':_0x2d0c8a(0x161),'criteriaName':_0x3c8120[_0x2d0c8a(0xdf)]||_0x1a49ba};_0xfdb4c0:for(const _0x1fddbf of _0x125fba){if(_0x1fddbf['entry_criteria']?.[_0x2d0c8a(0x18f)]===_0x1a49ba){_0x359c1d=_0x1fddbf[_0x2d0c8a(0xdf)],_0x44fa28=_0x1fddbf[_0x2d0c8a(0x12f)]['name']||_0x1a49ba;break;}if(_0x1fddbf[_0x2d0c8a(0x1c8)])for(const _0x71b402 of _0x1fddbf['steps']){if(_0x71b402[_0x2d0c8a(0xfa)]==='decision_point'&&_0x71b402[_0x2d0c8a(0x10c)]?.[_0x2d0c8a(0x11d)])for(const _0xc6d389 of _0x71b402[_0x2d0c8a(0x10c)]['branches']){if(_0xc6d389['segment']===_0x1a49ba){_0x359c1d=_0x1fddbf[_0x2d0c8a(0xdf)],_0x44fa28=_0xc6d389[_0x2d0c8a(0xdf)]||_0x1a49ba;break _0xfdb4c0;}}}}return{'stageName':_0x359c1d,'criteriaName':_0x44fa28};}async function executeThreeStepJourneyCreate(_0x53669e,_0x315b7e,_0x17f308,_0x43adb0,_0xa1ba47,_0x1bc2f5,_0x5bc24e,_0xe26638){const _0x328b57=a142_0x5b6902,{activationDefToCreateRequest:_0x2da53e,yamlRuleToApi:_0xbae6bd}=_0xe26638,{pendingEmbeddedSegments:_0x590509,pendingEmbeddedActivations:_0x1c847a,embeddedSegmentNameToId:_0x2d8008}=_0x43adb0,_0x270c36=JSON['parse'](JSON[_0x328b57(0x19d)](_0x17f308));ensureJourneyDefaults(_0x270c36[_0x328b57(0x13d)]),stripPendingIds(_0x270c36);const _0x32b3ed=await _0x53669e[_0x328b57(0x139)][_0x328b57(0x184)](_0x270c36),_0x3159c4=_0x32b3ed['id'],_0x4d4bd1=new Map();for(const _0x289405 of _0x32b3ed[_0x328b57(0x13d)]['journeyStages']){_0x4d4bd1['set'](_0x289405[_0x328b57(0xdf)][_0x328b57(0x16a)](),_0x289405['id']);}recoverSegmentIdsFromPushRecovery(_0x315b7e,_0x2d8008,_0x1bc2f5[_0x328b57(0x1a8)]);for(const [_0x4e65fa,{definition:_0x519b7d}]of _0x590509){if(_0x2d8008['has'](_0x4e65fa)){_0x5bc24e[_0x328b57(0x130)]?.({'type':_0x328b57(0x178),'journeyName':_0x315b7e[_0x328b57(0x1b1)][_0x328b57(0xdf)],'segmentName':_0x4e65fa});continue;}const _0x5334db=generateDeterministicJourneySegmentName(_0x315b7e[_0x328b57(0x1b1)][_0x328b57(0xdf)],_0x4e65fa);_0x5bc24e[_0x328b57(0x130)]?.({'type':_0x328b57(0x1d8),'journeyName':_0x315b7e[_0x328b57(0x1b1)][_0x328b57(0xdf)],'segmentName':_0x4e65fa});const _0x57ede6=createSegmentIdResolver(_0x1bc2f5[_0x328b57(0x1a8)],_0x4e65fa),_0x1cbf7e=await resolveRuleSegmentIds(_0x519b7d[_0x328b57(0x146)],_0x57ede6),_0x44cc35=await createOrRecoverEmbeddedSegment(_0x53669e,_0x315b7e,{'localName':_0x4e65fa,'uniqueSegmentName':_0x5334db,'description':_0x519b7d[_0x328b57(0x160)]||_0x328b57(0x190)+_0x4e65fa,'journeyId':_0x3159c4,'resolvedRule':_0x1cbf7e,'parentId':_0xa1ba47['parentId'],'folderId':_0xa1ba47[_0x328b57(0x142)]||''},_0xbae6bd);_0x2d8008['set'](_0x4e65fa,_0x44cc35),_0x1bc2f5[_0x328b57(0x1a8)][_0x328b57(0x182)](_0x4e65fa,_0x44cc35),_0x5bc24e[_0x328b57(0x130)]?.({'type':_0x328b57(0x178),'journeyName':_0x315b7e[_0x328b57(0x1b1)][_0x328b57(0xdf)],'segmentName':_0x4e65fa});}const _0xadb412=new Map();for(const [_0x18b4e3,_0x3daf2b]of _0x1c847a){_0x5bc24e['onProgress']?.({'type':'embedded_activation_creating','journeyName':_0x315b7e[_0x328b57(0x1b1)]['name'],'activationName':_0x18b4e3});const _0x135f2a=await _0x2da53e(_0x3daf2b,_0x1bc2f5[_0x328b57(0xe2)]),_0x1872a5={..._0x135f2a,..._0x3daf2b[_0x328b57(0x15b)]!==undefined&&{'runAfterJourneyRefresh':_0x3daf2b[_0x328b57(0x15b)]}},_0x147740=await _0x53669e[_0x328b57(0x139)][_0x328b57(0xf8)](_0x3159c4,_0x1872a5);_0xadb412[_0x328b57(0x182)](_0x18b4e3,_0x147740['id']),_0x43adb0[_0x328b57(0x16f)][_0x328b57(0x182)](_0x18b4e3,_0x147740['id']),_0x5bc24e[_0x328b57(0x130)]?.({'type':_0x328b57(0x131),'journeyName':_0x315b7e[_0x328b57(0x1b1)][_0x328b57(0xdf)],'activationName':_0x18b4e3});}const _0x24db84=JSON[_0x328b57(0x18c)](JSON['stringify'](_0x17f308));return _0x24db84['id']=_0x3159c4,ensureJourneyDefaults(_0x24db84['attributes']),resolvePendingIdsInRequest(_0x24db84,_0x17f308,_0x4d4bd1,_0x2d8008,_0xadb412,_0x5bc24e),await _0x53669e[_0x328b57(0x139)][_0x328b57(0xf0)](_0x3159c4,_0x24db84),deletePushRecovery(_0x315b7e[_0x328b57(0x11a)]),{'action':_0x328b57(0xe3),'journeyId':_0x3159c4,'embeddedSegmentNameToId':_0x2d8008};}export function stripWaitStepPendingIds(_0x5b47e4){const _0x45742a=a142_0x5b6902,_0x1da506=_0x5b47e4[_0x45742a(0x14a)]&&isPendingSegmentId(_0x5b47e4[_0x45742a(0x14a)]),_0x569358=_0x5b47e4[_0x45742a(0x187)]?.['some'](_0x4e7c45=>_0x4e7c45[_0x45742a(0x1bc)]&&isPendingSegmentId(_0x4e7c45[_0x45742a(0x1bc)]));(_0x1da506||_0x569358)&&(_0x5b47e4[_0x45742a(0xff)]=_0x45742a(0x14e),_0x5b47e4[_0x45742a(0x17e)]=0x1,_0x5b47e4[_0x45742a(0x129)]=_0x45742a(0x100),delete _0x5b47e4[_0x45742a(0x14a)],delete _0x5b47e4[_0x45742a(0x122)],delete _0x5b47e4['conditionTimeoutUnit'],delete _0x5b47e4[_0x45742a(0x187)]);}export function resolveWaitStepPendingIds(_0x442a76,_0x1a57d5,_0x451386,_0x187a74){const _0x3f31eb=a142_0x5b6902;if(_0x1a57d5[_0x3f31eb(0x14a)]&&isPendingSegmentId(_0x1a57d5[_0x3f31eb(0x14a)])){const _0x2f9fe8=_0x451386(_0x1a57d5[_0x3f31eb(0x14a)],_0x3f31eb(0x189)+_0x187a74+_0x3f31eb(0x148));_0x2f9fe8&&(_0x442a76['waitStepType']='Condition',_0x442a76[_0x3f31eb(0x14a)]=_0x2f9fe8,delete _0x442a76['waitStep'],delete _0x442a76['waitStepUnit'],_0x1a57d5[_0x3f31eb(0x122)]!==undefined&&(_0x442a76[_0x3f31eb(0x122)]=_0x1a57d5[_0x3f31eb(0x122)]),_0x1a57d5[_0x3f31eb(0x175)]&&(_0x442a76['conditionTimeoutUnit']=_0x1a57d5[_0x3f31eb(0x175)]));}if(_0x1a57d5[_0x3f31eb(0x187)]){const _0x430f09=_0x1a57d5[_0x3f31eb(0x187)][_0x3f31eb(0x18e)](_0x5a92b1=>_0x5a92b1[_0x3f31eb(0x1bc)]&&isPendingSegmentId(_0x5a92b1[_0x3f31eb(0x1bc)]));if(_0x430f09){const _0x16e53f=_0x1a57d5[_0x3f31eb(0x187)][_0x3f31eb(0x1cf)](_0x3ba6b0=>{const _0x524da4=_0x3f31eb;if(_0x3ba6b0['segmentId']&&isPendingSegmentId(_0x3ba6b0['segmentId'])){const _0x26ef68=_0x451386(_0x3ba6b0[_0x524da4(0x1bc)],_0x524da4(0x189)+_0x187a74+'\x27\x20wait\x20condition');return{..._0x3ba6b0,'segmentId':_0x26ef68||_0x3ba6b0[_0x524da4(0x1bc)]};}return{..._0x3ba6b0};});_0x442a76[_0x3f31eb(0xff)]=_0x3f31eb(0x1d6),_0x442a76[_0x3f31eb(0x187)]=_0x16e53f,delete _0x442a76[_0x3f31eb(0x17e)],delete _0x442a76[_0x3f31eb(0x129)],delete _0x442a76['conditionSegmentId'],delete _0x442a76[_0x3f31eb(0x122)],delete _0x442a76[_0x3f31eb(0x175)];}}}function stripPendingIds(_0x14a412){const _0x45ca81=a142_0x5b6902;_0x14a412[_0x45ca81(0x13d)][_0x45ca81(0x161)]?.[_0x45ca81(0x1bc)]&&isPendingSegmentId(_0x14a412[_0x45ca81(0x13d)][_0x45ca81(0x161)]['segmentId'])&&delete _0x14a412[_0x45ca81(0x13d)][_0x45ca81(0x161)];for(const _0x317a42 of _0x14a412[_0x45ca81(0x13d)]['journeyStages']||[]){_0x317a42[_0x45ca81(0x158)]?.[_0x45ca81(0x1bc)]&&isPendingSegmentId(_0x317a42[_0x45ca81(0x158)][_0x45ca81(0x1bc)])&&delete _0x317a42[_0x45ca81(0x158)];_0x317a42[_0x45ca81(0x1ba)]?.['segmentId']&&isPendingSegmentId(_0x317a42['milestone'][_0x45ca81(0x1bc)])&&delete _0x317a42[_0x45ca81(0x1ba)];_0x317a42['exitCriterias']&&(_0x317a42[_0x45ca81(0x174)]=_0x317a42[_0x45ca81(0x174)]['filter'](_0x25ad80=>!_0x25ad80['segmentId']||!isPendingSegmentId(_0x25ad80[_0x45ca81(0x1bc)])));if(_0x317a42[_0x45ca81(0x1c8)])for(const _0x2eb656 of Object[_0x45ca81(0x1d0)](_0x317a42['steps'])){const _0x576b32=_0x317a42[_0x45ca81(0x1c8)][_0x2eb656];_0x576b32[_0x45ca81(0xfa)]==='Activation'&&_0x576b32[_0x45ca81(0x16e)]&&isPendingActivationId(_0x576b32[_0x45ca81(0x16e)])&&(_0x576b32[_0x45ca81(0x16e)]='');if(_0x576b32[_0x45ca81(0xfa)]==='DecisionPoint'&&_0x576b32[_0x45ca81(0x11d)])for(const _0x40af8d of _0x576b32[_0x45ca81(0x11d)]){_0x40af8d['segmentId']&&isPendingSegmentId(_0x40af8d[_0x45ca81(0x1bc)])&&(_0x40af8d[_0x45ca81(0x1bc)]='');}_0x576b32[_0x45ca81(0xfa)]===_0x45ca81(0x169)&&stripWaitStepPendingIds(_0x576b32);}}}function resolvePendingIdsInRequest(_0x14929a,_0x5a9bd8,_0x311cbe,_0x1b2451,_0x34fdce,_0x248fd3){const _0x18e957=a142_0x5b6902,_0x50a236=(_0x8107ff,_0x5b1e57)=>{const _0x4cf4c4=a142_0x10a9;if(!isPendingSegmentId(_0x8107ff))return _0x8107ff;const _0x394a76=extractPendingSegmentName(_0x8107ff),_0x273ceb=_0x1b2451[_0x4cf4c4(0x138)](_0x394a76);return!_0x273ceb&&_0x248fd3[_0x4cf4c4(0x1c0)]?.(_0x4cf4c4(0x11b)+_0x394a76+'\x27\x20for\x20'+_0x5b1e57),_0x273ceb;};if(_0x14929a[_0x18e957(0x13d)][_0x18e957(0x161)]?.[_0x18e957(0x1bc)]&&isPendingSegmentId(_0x14929a[_0x18e957(0x13d)][_0x18e957(0x161)][_0x18e957(0x1bc)])){const _0x3efbb5=_0x50a236(_0x14929a[_0x18e957(0x13d)][_0x18e957(0x161)][_0x18e957(0x1bc)],_0x18e957(0xe9));_0x3efbb5&&(_0x14929a[_0x18e957(0x13d)][_0x18e957(0x161)]['segmentId']=_0x3efbb5);}for(const _0x2b7084 of _0x14929a[_0x18e957(0x13d)]['journeyStages']||[]){const _0x7c0326=_0x311cbe[_0x18e957(0x138)](_0x2b7084['name'][_0x18e957(0x16a)]());_0x7c0326&&(_0x2b7084['id']=_0x7c0326);if(_0x2b7084[_0x18e957(0x158)]?.[_0x18e957(0x1bc)]&&isPendingSegmentId(_0x2b7084[_0x18e957(0x158)][_0x18e957(0x1bc)])){const _0x56409a=_0x50a236(_0x2b7084[_0x18e957(0x158)][_0x18e957(0x1bc)],_0x18e957(0x189)+_0x2b7084[_0x18e957(0xdf)]+'\x27\x20entry\x20criteria');_0x56409a&&(_0x2b7084[_0x18e957(0x158)]['segmentId']=_0x56409a);}if(_0x2b7084['exitCriterias'])for(const _0x592b9e of _0x2b7084[_0x18e957(0x174)]){if(_0x592b9e[_0x18e957(0x1bc)]&&isPendingSegmentId(_0x592b9e[_0x18e957(0x1bc)])){const _0x533474=_0x50a236(_0x592b9e['segmentId'],_0x18e957(0x189)+_0x2b7084['name']+_0x18e957(0x140));_0x533474&&(_0x592b9e[_0x18e957(0x1bc)]=_0x533474);}}if(_0x2b7084[_0x18e957(0x1ba)]?.['segmentId']&&isPendingSegmentId(_0x2b7084['milestone'][_0x18e957(0x1bc)])){const _0x38fc79=_0x50a236(_0x2b7084[_0x18e957(0x1ba)]['segmentId'],_0x18e957(0x189)+_0x2b7084[_0x18e957(0xdf)]+'\x27\x20milestone');_0x38fc79&&(_0x2b7084['milestone'][_0x18e957(0x1bc)]=_0x38fc79);}if(_0x2b7084[_0x18e957(0x1c8)]){const _0x315605=_0x2a7b6f=>_0x5a9bd8[_0x18e957(0x13d)][_0x18e957(0x150)]?.[_0x18e957(0x168)](_0x2e3e93=>_0x2e3e93['name'][_0x18e957(0x16a)]()===_0x2b7084['name']['toLowerCase']())?.[_0x18e957(0x1c8)]?.[_0x2a7b6f];for(const _0x28456c of Object['keys'](_0x2b7084[_0x18e957(0x1c8)])){const _0x8c384=_0x2b7084['steps'][_0x28456c],_0x241c24=_0x315605(_0x28456c);if(_0x8c384['type']===_0x18e957(0x159)&&_0x8c384[_0x18e957(0x16e)]&&(isPendingActivationId(_0x8c384[_0x18e957(0x16e)])||_0x8c384[_0x18e957(0x16e)]==='')){if(_0x241c24?.[_0x18e957(0x16e)]&&isPendingActivationId(_0x241c24[_0x18e957(0x16e)])){const _0x3a77b5=extractPendingActivationName(_0x241c24[_0x18e957(0x16e)]),_0x543c00=_0x34fdce[_0x18e957(0x138)](_0x3a77b5);_0x543c00&&(_0x8c384[_0x18e957(0x16e)]=_0x543c00);}}if(_0x8c384[_0x18e957(0xfa)]===_0x18e957(0x119)&&_0x8c384[_0x18e957(0x11d)]&&_0x241c24?.['branches'])for(let _0xdab58b=0x0;_0xdab58b<_0x8c384[_0x18e957(0x11d)][_0x18e957(0x116)];_0xdab58b++){const _0x2b2143=_0x8c384[_0x18e957(0x11d)][_0xdab58b],_0x2d738f=_0x241c24[_0x18e957(0x11d)][_0xdab58b];if(_0x2d738f?.[_0x18e957(0x1bc)]&&isPendingSegmentId(_0x2d738f['segmentId'])){const _0x2b1b07=_0x50a236(_0x2d738f[_0x18e957(0x1bc)],_0x18e957(0x189)+_0x2b7084[_0x18e957(0xdf)]+_0x18e957(0x1bf)+(_0x2b2143[_0x18e957(0xdf)]||_0xdab58b)+'\x27');_0x2b1b07&&(_0x2b2143['segmentId']=_0x2b1b07);}}_0x8c384[_0x18e957(0xfa)]==='WaitStep'&&_0x241c24?.[_0x18e957(0xfa)]==='WaitStep'&&resolveWaitStepPendingIds(_0x8c384,_0x241c24,_0x50a236,_0x2b7084[_0x18e957(0xdf)]);}}}}
@@ -1 +1 @@
1
- (function(_0x441ef6,_0x184b9e){const _0x13fc48=a143_0x481b,_0x4740f7=_0x441ef6();while(!![]){try{const _0x4db8ba=parseInt(_0x13fc48(0x125))/0x1*(parseInt(_0x13fc48(0x119))/0x2)+parseInt(_0x13fc48(0x11d))/0x3*(-parseInt(_0x13fc48(0x11f))/0x4)+-parseInt(_0x13fc48(0x118))/0x5+parseInt(_0x13fc48(0x114))/0x6*(-parseInt(_0x13fc48(0x11e))/0x7)+-parseInt(_0x13fc48(0x117))/0x8*(-parseInt(_0x13fc48(0x122))/0x9)+-parseInt(_0x13fc48(0x11a))/0xa+parseInt(_0x13fc48(0x123))/0xb*(parseInt(_0x13fc48(0x115))/0xc);if(_0x4db8ba===_0x184b9e)break;else _0x4740f7['push'](_0x4740f7['shift']());}catch(_0x189711){_0x4740f7['push'](_0x4740f7['shift']());}}}(a143_0x3a0b,0x768fb));export function buildFolderIdToPathMap(_0x178927){const _0x233eef=a143_0x481b,_0x905ce2=new Map(),_0x258def=new Map();for(const _0x436967 of _0x178927){_0x258def[_0x233eef(0x121)](_0x436967['id'],_0x436967);}const _0x4e04f4=new Set();for(const _0x3a13a4 of _0x178927){!_0x3a13a4['parentFolderId']&&_0x4e04f4[_0x233eef(0x116)](_0x3a13a4['id']);}function _0x3d4ab2(_0x49aee9){const _0x1f7234=_0x233eef;if(_0x905ce2[_0x1f7234(0x11c)](_0x49aee9['id']))return _0x905ce2['get'](_0x49aee9['id']);if(_0x4e04f4['has'](_0x49aee9['id']))return _0x905ce2[_0x1f7234(0x121)](_0x49aee9['id'],''),'';if(_0x49aee9[_0x1f7234(0x11b)]){const _0x266677=_0x258def[_0x1f7234(0x124)](_0x49aee9[_0x1f7234(0x11b)]);if(_0x266677){const _0x2dce6c=_0x3d4ab2(_0x266677),_0xd02d2f=_0x2dce6c?_0x2dce6c+'/'+_0x49aee9['name']:_0x49aee9[_0x1f7234(0x120)];return _0x905ce2[_0x1f7234(0x121)](_0x49aee9['id'],_0xd02d2f),_0xd02d2f;}}const _0xcbcb68=_0x49aee9[_0x1f7234(0x120)];return _0x905ce2['set'](_0x49aee9['id'],_0xcbcb68),_0xcbcb68;}for(const _0x3759b8 of _0x178927){_0x3d4ab2(_0x3759b8);}return _0x905ce2;}export function buildFolderPathToIdMap(_0x4ec55a){const _0x31e323=a143_0x481b,_0x5fdd8=new Map(),_0xe1e42b=new Map();for(const _0x4d34c5 of _0x4ec55a){_0xe1e42b[_0x31e323(0x121)](_0x4d34c5['id'],_0x4d34c5);}const _0x1b93a8=new Set();for(const _0x1784c7 of _0x4ec55a){!_0x1784c7[_0x31e323(0x11b)]&&_0x1b93a8[_0x31e323(0x116)](_0x1784c7['id']);}function _0x46cb27(_0x583a4a){const _0x462b9d=_0x31e323;if(_0x1b93a8[_0x462b9d(0x11c)](_0x583a4a['id']))return'';if(_0x583a4a[_0x462b9d(0x11b)]){const _0x21ef59=_0xe1e42b[_0x462b9d(0x124)](_0x583a4a[_0x462b9d(0x11b)]);if(_0x21ef59){const _0x221271=_0x46cb27(_0x21ef59);return _0x221271?_0x221271+'/'+_0x583a4a[_0x462b9d(0x120)]:_0x583a4a[_0x462b9d(0x120)];}}return _0x583a4a[_0x462b9d(0x120)];}for(const _0x2c1a72 of _0x4ec55a){const _0x86f8f6=_0x46cb27(_0x2c1a72);_0x5fdd8[_0x31e323(0x121)](_0x86f8f6,_0x2c1a72['id']);}return _0x5fdd8;}function a143_0x3a0b(){const _0x1d28d6=['12QnZboN','12rjVerd','add','8gtzzqa','2649355UMclBj','9398JVemfj','8287940xcZEWo','parentFolderId','has','1026444YlCMDz','561918DonKOo','4ijCzHM','name','set','1677069csDiSV','16220523GdMQOc','get','146BxbWhJ'];a143_0x3a0b=function(){return _0x1d28d6;};return a143_0x3a0b();}export function buildFolderMaps(_0x12e5ee){const _0x2668f9=buildFolderIdToPathMap(_0x12e5ee),_0x3c4c55=new Map();for(const [_0x56d58b,_0x3d830a]of _0x2668f9){_0x3c4c55['set'](_0x3d830a,_0x56d58b);}return{'idToPath':_0x2668f9,'pathToId':_0x3c4c55};}function a143_0x481b(_0x100775,_0x522f97){_0x100775=_0x100775-0x114;const _0x3a0b7b=a143_0x3a0b();let _0x481b91=_0x3a0b7b[_0x100775];return _0x481b91;}export function getFolderPath(_0x533002,_0x55d849){const _0x15063c=a143_0x481b;if(!_0x533002)return'';return _0x55d849[_0x15063c(0x124)](_0x533002)??'';}
1
+ (function(_0x46f009,_0x21fc2c){const _0x5f0468=a143_0x349b,_0x2e55ca=_0x46f009();while(!![]){try{const _0x2901f5=parseInt(_0x5f0468(0xfc))/0x1+-parseInt(_0x5f0468(0x107))/0x2+-parseInt(_0x5f0468(0x102))/0x3+parseInt(_0x5f0468(0x108))/0x4+parseInt(_0x5f0468(0x103))/0x5+-parseInt(_0x5f0468(0xfe))/0x6*(-parseInt(_0x5f0468(0xff))/0x7)+parseInt(_0x5f0468(0x106))/0x8;if(_0x2901f5===_0x21fc2c)break;else _0x2e55ca['push'](_0x2e55ca['shift']());}catch(_0x29ad08){_0x2e55ca['push'](_0x2e55ca['shift']());}}}(a143_0x40f8,0x6db7c));function a143_0x40f8(){const _0x2e1f67=['1427172iNXJNK','516808LvZvsD','add','366912tXqUMA','set','2304ArGWDK','7231hzYKly','has','parentFolderId','443067WCugzI','353540IznCMC','name','get','2777480uBGJhT'];a143_0x40f8=function(){return _0x2e1f67;};return a143_0x40f8();}function a143_0x349b(_0x6c94fd,_0x3f7b15){_0x6c94fd=_0x6c94fd-0xfc;const _0x40f85b=a143_0x40f8();let _0x349bb0=_0x40f85b[_0x6c94fd];return _0x349bb0;}export function buildFolderIdToPathMap(_0x9a2b8b){const _0xcf8d6d=a143_0x349b,_0x11aabd=new Map(),_0x75e069=new Map();for(const _0x48e389 of _0x9a2b8b){_0x75e069[_0xcf8d6d(0xfd)](_0x48e389['id'],_0x48e389);}const _0x31ef34=new Set();for(const _0x56d156 of _0x9a2b8b){!_0x56d156['parentFolderId']&&_0x31ef34[_0xcf8d6d(0x109)](_0x56d156['id']);}function _0x4b5086(_0x297951){const _0x153da5=_0xcf8d6d;if(_0x11aabd[_0x153da5(0x100)](_0x297951['id']))return _0x11aabd[_0x153da5(0x105)](_0x297951['id']);if(_0x31ef34[_0x153da5(0x100)](_0x297951['id']))return _0x11aabd[_0x153da5(0xfd)](_0x297951['id'],''),'';if(_0x297951[_0x153da5(0x101)]){const _0x8ca397=_0x75e069[_0x153da5(0x105)](_0x297951[_0x153da5(0x101)]);if(_0x8ca397){const _0x4796b2=_0x4b5086(_0x8ca397),_0xac5b5e=_0x4796b2?_0x4796b2+'/'+_0x297951[_0x153da5(0x104)]:_0x297951['name'];return _0x11aabd[_0x153da5(0xfd)](_0x297951['id'],_0xac5b5e),_0xac5b5e;}}const _0x4ce1cb=_0x297951[_0x153da5(0x104)];return _0x11aabd[_0x153da5(0xfd)](_0x297951['id'],_0x4ce1cb),_0x4ce1cb;}for(const _0x33e41d of _0x9a2b8b){_0x4b5086(_0x33e41d);}return _0x11aabd;}export function buildFolderPathToIdMap(_0x54b497){const _0x1e483d=a143_0x349b,_0x5c7b3d=new Map(),_0x435fec=new Map();for(const _0x2d5204 of _0x54b497){_0x435fec[_0x1e483d(0xfd)](_0x2d5204['id'],_0x2d5204);}const _0xbac9a7=new Set();for(const _0x4187c8 of _0x54b497){!_0x4187c8['parentFolderId']&&_0xbac9a7['add'](_0x4187c8['id']);}function _0x40b59a(_0x3ce375){const _0x18165e=_0x1e483d;if(_0xbac9a7[_0x18165e(0x100)](_0x3ce375['id']))return'';if(_0x3ce375['parentFolderId']){const _0x347a7b=_0x435fec[_0x18165e(0x105)](_0x3ce375['parentFolderId']);if(_0x347a7b){const _0x5d9c5c=_0x40b59a(_0x347a7b);return _0x5d9c5c?_0x5d9c5c+'/'+_0x3ce375[_0x18165e(0x104)]:_0x3ce375[_0x18165e(0x104)];}}return _0x3ce375[_0x18165e(0x104)];}for(const _0x5a9109 of _0x54b497){const _0x2b1b94=_0x40b59a(_0x5a9109);_0x5c7b3d[_0x1e483d(0xfd)](_0x2b1b94,_0x5a9109['id']);}return _0x5c7b3d;}export function buildFolderMaps(_0x27ee37){const _0x4e3504=a143_0x349b,_0x25e30b=buildFolderIdToPathMap(_0x27ee37),_0x23b206=new Map();for(const [_0x1aa427,_0x56e641]of _0x25e30b){_0x23b206[_0x4e3504(0xfd)](_0x56e641,_0x1aa427);}return{'idToPath':_0x25e30b,'pathToId':_0x23b206};}export function getFolderPath(_0x190502,_0x269d07){const _0x419247=a143_0x349b;if(!_0x190502)return'';return _0x269d07[_0x419247(0x105)](_0x190502)??'';}
@@ -1 +1 @@
1
- function a144_0x49d1(){const _0x51e855=['Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','name','parse','test','join','type','229208acfoJC','parent_segment','19502989hcDSia','split','12aCICbA','trim','relative','raw','isAbsolute','push','10740kogWLs','dirname','648QwXJoP','resolve','readFile','length','pop','endsWith','journey','startsWith','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','filter','tdx.json','segments','Path\x20attempts\x20to\x20navigate\x20above\x20root','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','.yml','File\x20not\x20found:\x20','10YoAwfD','75375UGcLlN','segment','2260053uUSUpj','665928SxNjtj','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','root','Relative\x20path\x20cannot\x20be\x20empty','.yaml','slice','Path\x20segment\x20cannot\x20be\x20empty','Cannot\x20navigate\x20above\x20root','30vsyVdh','exists','2944896OYyzVc'];a144_0x49d1=function(){return _0x51e855;};return a144_0x49d1();}(function(_0x43cd14,_0x39ef7c){const _0x3c361e=a144_0x54a8,_0xc1d605=_0x43cd14();while(!![]){try{const _0x4e0809=-parseInt(_0x3c361e(0x93))/0x1*(parseInt(_0x3c361e(0xab))/0x2)+-parseInt(_0x3c361e(0x95))/0x3+-parseInt(_0x3c361e(0xb3))/0x4*(-parseInt(_0x3c361e(0xb1))/0x5)+parseInt(_0x3c361e(0x9e))/0x6*(-parseInt(_0x3c361e(0xa7))/0x7)+-parseInt(_0x3c361e(0xa0))/0x8+-parseInt(_0x3c361e(0x96))/0x9*(-parseInt(_0x3c361e(0xc3))/0xa)+parseInt(_0x3c361e(0xa9))/0xb;if(_0x4e0809===_0x39ef7c)break;else _0xc1d605['push'](_0xc1d605['shift']());}catch(_0x103a59){_0xc1d605['push'](_0xc1d605['shift']());}}}(a144_0x49d1,0x6fb3e));import a144_0x2330de from'path';import{parse as a144_0x25f441}from'yaml';function a144_0x54a8(_0x505cdf,_0x5bf527){_0x505cdf=_0x505cdf-0x93;const _0x49d1f5=a144_0x49d1();let _0x54a854=_0x49d1f5[_0x505cdf];return _0x54a854;}import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x51520f){const _0x7acbf5=a144_0x54a8;if(!_0x51520f||_0x51520f[_0x7acbf5(0xac)]()==='')throw new Error('Path\x20cannot\x20be\x20empty');const _0x587995=_0x51520f[_0x7acbf5(0xac)]();if(_0x587995==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x51520f};const _0x5bbdc8=_0x587995['startsWith']('/')?_0x587995['substring'](0x1):_0x587995,_0x4abf43=_0x5bbdc8[_0x7acbf5(0xaa)]('/')[_0x7acbf5(0xbc)](_0x5449a8=>_0x5449a8!=='');if(_0x4abf43[_0x7acbf5(0xb6)]===0x0)throw new Error(_0x7acbf5(0x97));const _0x555d9a=_0x587995[_0x7acbf5(0xba)]('/')||!isRelativePathSegment(_0x4abf43[0x0]);for(const _0x2eb8a2 of _0x4abf43){validatePathSegment(_0x2eb8a2);}return{'segments':_0x4abf43,'isAbsolute':_0x555d9a,'raw':_0x51520f};}function isRelativePathSegment(_0x5256d6){return _0x5256d6==='.'||_0x5256d6==='..';}function validatePathSegment(_0x1ac1df){const _0x4438df=a144_0x54a8;if(_0x1ac1df==='')throw new Error(_0x4438df(0x9c));if(_0x1ac1df==='.'||_0x1ac1df==='..')return;if(/[\x00-\x1F\x7F]/[_0x4438df(0xa4)](_0x1ac1df))throw new Error(_0x4438df(0xa1)+_0x1ac1df);if(_0x1ac1df!==_0x1ac1df[_0x4438df(0xac)]()){}}export function validatePath(_0xf2fcb7){const _0x34356d=a144_0x54a8;if(_0xf2fcb7[_0x34356d(0xbe)][_0x34356d(0xb6)]===0x0&&!_0xf2fcb7[_0x34356d(0xaf)])throw new Error(_0x34356d(0x99));if(_0xf2fcb7[_0x34356d(0xaf)]){if(_0xf2fcb7[_0x34356d(0xbe)][0x0]==='..')throw new Error(_0x34356d(0xbb));let _0x22a7b4=0x0;for(const _0x3f7f8d of _0xf2fcb7[_0x34356d(0xbe)]){if(_0x3f7f8d==='..'){if(_0x22a7b4===0x0)throw new Error(_0x34356d(0xbf));_0x22a7b4--;}else _0x3f7f8d!=='.'&&_0x22a7b4++;}}}export function joinPaths(_0x5aaae1,_0x4ac10b){const _0x6345c5=a144_0x54a8;if(!_0x5aaae1||_0x5aaae1==='/')return _0x4ac10b;if(!_0x4ac10b||_0x4ac10b==='.')return _0x5aaae1;if(_0x4ac10b[_0x6345c5(0xba)]('/'))return _0x4ac10b;const _0x4756e2=parsePath(_0x5aaae1),_0x48ef7e=parsePath(_0x4ac10b),_0x53a750=[..._0x4756e2['segments']];for(const _0x59c637 of _0x48ef7e[_0x6345c5(0xbe)]){if(_0x59c637==='.')continue;else{if(_0x59c637==='..'){if(_0x53a750[_0x6345c5(0xb6)]===0x0)throw new Error('Cannot\x20navigate\x20above\x20root');_0x53a750[_0x6345c5(0xb7)]();}else _0x53a750[_0x6345c5(0xb0)](_0x59c637);}}const _0x3e1cc9=_0x53a750[_0x6345c5(0xa5)]('/');return _0x4756e2[_0x6345c5(0xae)]['startsWith']('/')?'/'+_0x3e1cc9:_0x3e1cc9;}export function normalizePath(_0x3d30c5){const _0x109897=a144_0x54a8,_0x3eed40=parsePath(_0x3d30c5),_0xf48e8=[];for(const _0x2bcb76 of _0x3eed40[_0x109897(0xbe)]){if(_0x2bcb76==='.')continue;else{if(_0x2bcb76==='..'){if(_0xf48e8[_0x109897(0xb6)]===0x0){if(_0x3eed40[_0x109897(0xaf)])throw new Error(_0x109897(0x9d));_0xf48e8[_0x109897(0xb0)]('..');}else _0xf48e8[_0xf48e8[_0x109897(0xb6)]-0x1]==='..'?_0xf48e8[_0x109897(0xb0)]('..'):_0xf48e8[_0x109897(0xb7)]();}else _0xf48e8['push'](_0x2bcb76);}}if(_0xf48e8[_0x109897(0xb6)]===0x0)return _0x3eed40[_0x109897(0xaf)]?'/':'.';const _0x27cb36=_0xf48e8[_0x109897(0xa5)]('/');return _0x3eed40[_0x109897(0xae)]['startsWith']('/')?'/'+_0x27cb36:_0x27cb36;}export function getParentPath(_0x18d21e){const _0x3e0cf9=a144_0x54a8,_0x1da8b7=parsePath(_0x18d21e);if(_0x1da8b7[_0x3e0cf9(0xbe)][_0x3e0cf9(0xb6)]<=0x1)return'/';const _0x3d72f3=_0x1da8b7[_0x3e0cf9(0xbe)][_0x3e0cf9(0x9b)](0x0,-0x1)[_0x3e0cf9(0xa5)]('/');return _0x1da8b7[_0x3e0cf9(0xae)]['startsWith']('/')?'/'+_0x3d72f3:_0x3d72f3;}export function getBaseName(_0x233e39){const _0x41a7ab=a144_0x54a8,_0x4fbf09=parsePath(_0x233e39);return _0x4fbf09[_0x41a7ab(0xbe)][_0x4fbf09[_0x41a7ab(0xbe)][_0x41a7ab(0xb6)]-0x1]||'';}export function isChildPath(_0x493b6f,_0x58a398){const _0x19d4c9=a144_0x54a8,_0x131e83=parsePath(_0x493b6f),_0x5eb1fd=parsePath(_0x58a398);if(_0x131e83[_0x19d4c9(0xbe)][_0x19d4c9(0xb6)]<=_0x5eb1fd['segments']['length'])return![];for(let _0x21ed79=0x0;_0x21ed79<_0x5eb1fd[_0x19d4c9(0xbe)][_0x19d4c9(0xb6)];_0x21ed79++){if(_0x131e83[_0x19d4c9(0xbe)][_0x21ed79]!==_0x5eb1fd[_0x19d4c9(0xbe)][_0x21ed79])return![];}return!![];}export function splitPath(_0x5f3ec5){const _0x4ea25f=a144_0x54a8,_0x5cce47=parsePath(_0x5f3ec5);if(_0x5cce47[_0x4ea25f(0xbe)][_0x4ea25f(0xb6)]===0x0)throw new Error('Cannot\x20split\x20empty\x20path');if(_0x5cce47[_0x4ea25f(0xbe)][_0x4ea25f(0xb6)]===0x1)return{'parent':_0x5cce47[_0x4ea25f(0xbe)][0x0]};return{'parent':_0x5cce47[_0x4ea25f(0xbe)][0x0],'child':_0x5cce47[_0x4ea25f(0xbe)][_0x4ea25f(0x9b)](0x1)['join']('/')};}export function isYamlFilePath(_0x24a772){const _0x1ae994=a144_0x54a8;return _0x24a772[_0x1ae994(0xb8)](_0x1ae994(0xc1))||_0x24a772[_0x1ae994(0xb8)](_0x1ae994(0x9a));}export async function resolveYamlFilePath(_0x4498b5,_0x233e59=nodeFileSystem){const _0x1dda5f=a144_0x54a8,_0xc6ae1=a144_0x2330de[_0x1dda5f(0xb4)](_0x4498b5);if(!await _0x233e59[_0x1dda5f(0x9f)](_0xc6ae1))throw new Error(_0x1dda5f(0xc2)+_0x4498b5);let _0x48a23e=a144_0x2330de[_0x1dda5f(0xb2)](_0xc6ae1),_0x36c05b=null,_0x5c0cb7=null;const _0x296493=a144_0x2330de[_0x1dda5f(0xa3)](_0x48a23e)[_0x1dda5f(0x98)];while(_0x48a23e!==_0x296493){const _0x4bd0f9=a144_0x2330de['join'](_0x48a23e,_0x1dda5f(0xbd));if(await _0x233e59['exists'](_0x4bd0f9)){_0x36c05b=_0x4bd0f9,_0x5c0cb7=_0x48a23e;break;}_0x48a23e=a144_0x2330de[_0x1dda5f(0xb2)](_0x48a23e);}if(!_0x36c05b||!_0x5c0cb7)throw new Error('No\x20tdx.json\x20found\x20for\x20file:\x20'+_0x4498b5+'\x0a'+'Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.');const _0x5b96ff=await _0x233e59[_0x1dda5f(0xb5)](_0x36c05b),_0x5122fc=JSON['parse'](_0x5b96ff),_0x334b42=_0x5122fc[_0x1dda5f(0xa8)];if(!_0x334b42)throw new Error(_0x1dda5f(0xc0));const _0x3a789d=await _0x233e59[_0x1dda5f(0xb5)](_0xc6ae1),_0x3201e4=a144_0x25f441(_0x3a789d),_0x312870=_0x3201e4[_0x1dda5f(0xa2)];if(!_0x312870)throw new Error('Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20'+_0x4498b5);const _0x3160ed=_0x3201e4[_0x1dda5f(0xa6)]===_0x1dda5f(0xb9)?_0x1dda5f(0xb9):_0x1dda5f(0x94),_0x3a5323=a144_0x2330de[_0x1dda5f(0xad)](_0x5c0cb7,_0xc6ae1),_0x627797=a144_0x2330de[_0x1dda5f(0xb2)](_0x3a5323),_0x370b14=_0x627797==='.'?'':_0x627797['replace'](/\\/g,'/'),_0x1269fe=_0x370b14?_0x334b42+'/'+_0x370b14+'/'+_0x312870:_0x334b42+'/'+_0x312870;return{'parentSegment':_0x334b42,'segmentName':_0x312870,'folderPath':_0x370b14,'fullPath':_0x1269fe,'resourceType':_0x3160ed,'content':_0x3a789d};}
1
+ function a144_0x20ff(){const _0x47cd3c=['.yaml','relative','filter','Cannot\x20split\x20empty\x20path','Path\x20segment\x20cannot\x20be\x20empty','tdx.json','push','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','test','segments','substring','startsWith','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','344178MwmFry','8sKeial','raw','4894650hFLfci','replace','name','585197GVdWzK','File\x20not\x20found:\x20','25370191eWtWdu','length','Cannot\x20navigate\x20above\x20root','4468965SkQEbU','parse','Relative\x20path\x20cannot\x20be\x20empty','segment','.yml','slice','344996WujJUV','Path\x20attempts\x20to\x20navigate\x20above\x20root','isAbsolute','4fMziPf','Path\x20cannot\x20be\x20empty','3408503wLwfsR','No\x20tdx.json\x20found\x20for\x20file:\x20','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','split','pop','140aMmLSC','root','dirname','trim','journey','3ofXJxF','join','exists'];a144_0x20ff=function(){return _0x47cd3c;};return a144_0x20ff();}(function(_0x4a3e2c,_0x1463cb){const _0x5429af=a144_0x2075,_0x2ab2f9=_0x4a3e2c();while(!![]){try{const _0x235fcb=-parseInt(_0x5429af(0x131))/0x1+parseInt(_0x5429af(0x13c))/0x2*(-parseInt(_0x5429af(0x11b))/0x3)+-parseInt(_0x5429af(0x10f))/0x4*(parseInt(_0x5429af(0x136))/0x5)+parseInt(_0x5429af(0x12e))/0x6+parseInt(_0x5429af(0x111))/0x7*(-parseInt(_0x5429af(0x12c))/0x8)+-parseInt(_0x5429af(0x12b))/0x9*(parseInt(_0x5429af(0x116))/0xa)+parseInt(_0x5429af(0x133))/0xb;if(_0x235fcb===_0x1463cb)break;else _0x2ab2f9['push'](_0x2ab2f9['shift']());}catch(_0x3565a7){_0x2ab2f9['push'](_0x2ab2f9['shift']());}}}(a144_0x20ff,0x6d75f));import a144_0x381e13 from'path';import{parse as a144_0x45feee}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x29d947){const _0x4b2905=a144_0x2075;if(!_0x29d947||_0x29d947[_0x4b2905(0x119)]()==='')throw new Error(_0x4b2905(0x110));const _0xfc407=_0x29d947[_0x4b2905(0x119)]();if(_0xfc407==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x29d947};const _0x1762cf=_0xfc407['startsWith']('/')?_0xfc407[_0x4b2905(0x128)](0x1):_0xfc407,_0x5f213a=_0x1762cf[_0x4b2905(0x114)]('/')[_0x4b2905(0x120)](_0x4181eb=>_0x4181eb!=='');if(_0x5f213a[_0x4b2905(0x134)]===0x0)throw new Error(_0x4b2905(0x125));const _0x535e0c=_0xfc407[_0x4b2905(0x129)]('/')||!isRelativePathSegment(_0x5f213a[0x0]);for(const _0x567467 of _0x5f213a){validatePathSegment(_0x567467);}return{'segments':_0x5f213a,'isAbsolute':_0x535e0c,'raw':_0x29d947};}function isRelativePathSegment(_0x3c1664){return _0x3c1664==='.'||_0x3c1664==='..';}function validatePathSegment(_0x89d19a){const _0xc8dfaa=a144_0x2075;if(_0x89d19a==='')throw new Error(_0xc8dfaa(0x122));if(_0x89d19a==='.'||_0x89d19a==='..')return;if(/[\x00-\x1F\x7F]/[_0xc8dfaa(0x126)](_0x89d19a))throw new Error(_0xc8dfaa(0x113)+_0x89d19a);if(_0x89d19a!==_0x89d19a[_0xc8dfaa(0x119)]()){}}export function validatePath(_0x2fca9c){const _0x4e3358=a144_0x2075;if(_0x2fca9c['segments']['length']===0x0&&!_0x2fca9c[_0x4e3358(0x10e)])throw new Error(_0x4e3358(0x138));if(_0x2fca9c[_0x4e3358(0x10e)]){if(_0x2fca9c[_0x4e3358(0x127)][0x0]==='..')throw new Error(_0x4e3358(0x12a));let _0x4736d7=0x0;for(const _0x125eac of _0x2fca9c['segments']){if(_0x125eac==='..'){if(_0x4736d7===0x0)throw new Error(_0x4e3358(0x10d));_0x4736d7--;}else _0x125eac!=='.'&&_0x4736d7++;}}}export function joinPaths(_0x2c84b5,_0x22ba71){const _0x1fa3e8=a144_0x2075;if(!_0x2c84b5||_0x2c84b5==='/')return _0x22ba71;if(!_0x22ba71||_0x22ba71==='.')return _0x2c84b5;if(_0x22ba71[_0x1fa3e8(0x129)]('/'))return _0x22ba71;const _0x4bb559=parsePath(_0x2c84b5),_0x49880a=parsePath(_0x22ba71),_0x373175=[..._0x4bb559['segments']];for(const _0x444efd of _0x49880a['segments']){if(_0x444efd==='.')continue;else{if(_0x444efd==='..'){if(_0x373175['length']===0x0)throw new Error(_0x1fa3e8(0x135));_0x373175[_0x1fa3e8(0x115)]();}else _0x373175[_0x1fa3e8(0x124)](_0x444efd);}}const _0x511782=_0x373175[_0x1fa3e8(0x11c)]('/');return _0x4bb559[_0x1fa3e8(0x12d)][_0x1fa3e8(0x129)]('/')?'/'+_0x511782:_0x511782;}export function normalizePath(_0x2838c4){const _0x3d4d90=a144_0x2075,_0x2ec2b8=parsePath(_0x2838c4),_0x57179c=[];for(const _0x19c891 of _0x2ec2b8['segments']){if(_0x19c891==='.')continue;else{if(_0x19c891==='..'){if(_0x57179c[_0x3d4d90(0x134)]===0x0){if(_0x2ec2b8[_0x3d4d90(0x10e)])throw new Error(_0x3d4d90(0x135));_0x57179c['push']('..');}else _0x57179c[_0x57179c['length']-0x1]==='..'?_0x57179c[_0x3d4d90(0x124)]('..'):_0x57179c[_0x3d4d90(0x115)]();}else _0x57179c[_0x3d4d90(0x124)](_0x19c891);}}if(_0x57179c[_0x3d4d90(0x134)]===0x0)return _0x2ec2b8['isAbsolute']?'/':'.';const _0xbf9f38=_0x57179c['join']('/');return _0x2ec2b8['raw'][_0x3d4d90(0x129)]('/')?'/'+_0xbf9f38:_0xbf9f38;}export function getParentPath(_0x588b2a){const _0x4c030e=a144_0x2075,_0x5ac8bf=parsePath(_0x588b2a);if(_0x5ac8bf['segments'][_0x4c030e(0x134)]<=0x1)return'/';const _0x26532b=_0x5ac8bf['segments'][_0x4c030e(0x13b)](0x0,-0x1)['join']('/');return _0x5ac8bf[_0x4c030e(0x12d)][_0x4c030e(0x129)]('/')?'/'+_0x26532b:_0x26532b;}export function getBaseName(_0x2a243a){const _0x1f21b8=a144_0x2075,_0x56f625=parsePath(_0x2a243a);return _0x56f625[_0x1f21b8(0x127)][_0x56f625[_0x1f21b8(0x127)][_0x1f21b8(0x134)]-0x1]||'';}export function isChildPath(_0x3dd348,_0xfd944){const _0x932d34=a144_0x2075,_0x4cc8ab=parsePath(_0x3dd348),_0x4810c6=parsePath(_0xfd944);if(_0x4cc8ab[_0x932d34(0x127)][_0x932d34(0x134)]<=_0x4810c6[_0x932d34(0x127)][_0x932d34(0x134)])return![];for(let _0x3980f1=0x0;_0x3980f1<_0x4810c6[_0x932d34(0x127)][_0x932d34(0x134)];_0x3980f1++){if(_0x4cc8ab[_0x932d34(0x127)][_0x3980f1]!==_0x4810c6['segments'][_0x3980f1])return![];}return!![];}export function splitPath(_0x47ab90){const _0x19590a=a144_0x2075,_0x427a0a=parsePath(_0x47ab90);if(_0x427a0a[_0x19590a(0x127)][_0x19590a(0x134)]===0x0)throw new Error(_0x19590a(0x121));if(_0x427a0a[_0x19590a(0x127)][_0x19590a(0x134)]===0x1)return{'parent':_0x427a0a[_0x19590a(0x127)][0x0]};return{'parent':_0x427a0a[_0x19590a(0x127)][0x0],'child':_0x427a0a[_0x19590a(0x127)]['slice'](0x1)[_0x19590a(0x11c)]('/')};}export function isYamlFilePath(_0x22badb){const _0x391586=a144_0x2075;return _0x22badb['endsWith'](_0x391586(0x13a))||_0x22badb['endsWith'](_0x391586(0x11e));}function a144_0x2075(_0x4e9d4a,_0x2b5839){_0x4e9d4a=_0x4e9d4a-0x10d;const _0x20ff4a=a144_0x20ff();let _0x2075da=_0x20ff4a[_0x4e9d4a];return _0x2075da;}export async function resolveYamlFilePath(_0x377fd0,_0x41cd47=nodeFileSystem){const _0x5303ef=a144_0x2075,_0x3b31b0=a144_0x381e13['resolve'](_0x377fd0);if(!await _0x41cd47[_0x5303ef(0x11d)](_0x3b31b0))throw new Error(_0x5303ef(0x132)+_0x377fd0);let _0xfe4412=a144_0x381e13[_0x5303ef(0x118)](_0x3b31b0),_0x170a73=null,_0x4e9001=null;const _0x308175=a144_0x381e13[_0x5303ef(0x137)](_0xfe4412)[_0x5303ef(0x117)];while(_0xfe4412!==_0x308175){const _0x1a8fe6=a144_0x381e13[_0x5303ef(0x11c)](_0xfe4412,_0x5303ef(0x123));if(await _0x41cd47['exists'](_0x1a8fe6)){_0x170a73=_0x1a8fe6,_0x4e9001=_0xfe4412;break;}_0xfe4412=a144_0x381e13[_0x5303ef(0x118)](_0xfe4412);}if(!_0x170a73||!_0x4e9001)throw new Error(_0x5303ef(0x112)+_0x377fd0+'\x0a'+'Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.');const _0x88973=await _0x41cd47['readFile'](_0x170a73),_0x3298b6=JSON[_0x5303ef(0x137)](_0x88973),_0x57b75c=_0x3298b6['parent_segment'];if(!_0x57b75c)throw new Error('Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field');const _0x16774d=await _0x41cd47['readFile'](_0x3b31b0),_0x13210c=a144_0x45feee(_0x16774d),_0x3f5ca6=_0x13210c[_0x5303ef(0x130)];if(!_0x3f5ca6)throw new Error('Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20'+_0x377fd0);const _0x413d3c=_0x13210c['type']===_0x5303ef(0x11a)?_0x5303ef(0x11a):_0x5303ef(0x139),_0x429db0=a144_0x381e13[_0x5303ef(0x11f)](_0x4e9001,_0x3b31b0),_0x4abeb9=a144_0x381e13[_0x5303ef(0x118)](_0x429db0),_0x16912c=_0x4abeb9==='.'?'':_0x4abeb9[_0x5303ef(0x12f)](/\\/g,'/'),_0x2410d5=_0x16912c?_0x57b75c+'/'+_0x16912c+'/'+_0x3f5ca6:_0x57b75c+'/'+_0x3f5ca6;return{'parentSegment':_0x57b75c,'segmentName':_0x3f5ca6,'folderPath':_0x16912c,'fullPath':_0x2410d5,'resourceType':_0x413d3c,'content':_0x16774d};}
@@ -1 +1 @@
1
- (function(_0x3f1c16,_0x3c477b){const _0x49a0ce=a145_0x5495,_0x43575a=_0x3f1c16();while(!![]){try{const _0x5b0c4f=parseInt(_0x49a0ce(0x174))/0x1+parseInt(_0x49a0ce(0x16c))/0x2*(parseInt(_0x49a0ce(0x16b))/0x3)+-parseInt(_0x49a0ce(0x169))/0x4+parseInt(_0x49a0ce(0x16d))/0x5*(parseInt(_0x49a0ce(0x176))/0x6)+-parseInt(_0x49a0ce(0x16e))/0x7+-parseInt(_0x49a0ce(0x173))/0x8+-parseInt(_0x49a0ce(0x175))/0x9;if(_0x5b0c4f===_0x3c477b)break;else _0x43575a['push'](_0x43575a['shift']());}catch(_0x4c818e){_0x43575a['push'](_0x43575a['shift']());}}}(a145_0x1475,0xab23b));function a145_0x5495(_0x2722a9,_0x40b0a1){_0x2722a9=_0x2722a9-0x169;const _0x1475fa=a145_0x1475();let _0x549580=_0x1475fa[_0x2722a9];return _0x549580;}function a145_0x1475(){const _0x15dc30=['substring','indexOf','980472expykB','1341955KoszCB','24947865CPTtjg','6VrpioE','107096FrmrcK','.\x20Parent\x20name\x20cannot\x20be\x20empty','897vxVdfI','8968soVutK','6159695mmAflf','2046135fNgezg','Invalid\x20segment\x20reference\x20format:\x20','.\x20Child\x20name\x20cannot\x20be\x20empty'];a145_0x1475=function(){return _0x15dc30;};return a145_0x1475();}export function parseSegmentRef(_0x345171){const _0x40dee6=a145_0x5495,_0xb501e9=_0x345171[_0x40dee6(0x172)]('/');if(_0xb501e9===-0x1)return{'parentId':_0x345171};if(_0xb501e9===0x0)throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x345171+_0x40dee6(0x16a));const _0x590ff5=_0x345171[_0x40dee6(0x171)](0x0,_0xb501e9),_0x2bc8fc=_0x345171[_0x40dee6(0x171)](_0xb501e9+0x1);if(_0x2bc8fc==='')throw new Error(_0x40dee6(0x16f)+_0x345171+_0x40dee6(0x170));return{'parentId':_0x590ff5,'childId':_0x2bc8fc};}
1
+ (function(_0xbf2d12,_0x34bc19){const _0x5aa324=a145_0x174f,_0x49fb8b=_0xbf2d12();while(!![]){try{const _0x58295e=parseInt(_0x5aa324(0xf1))/0x1*(-parseInt(_0x5aa324(0xf5))/0x2)+-parseInt(_0x5aa324(0xec))/0x3*(-parseInt(_0x5aa324(0xf2))/0x4)+-parseInt(_0x5aa324(0xf6))/0x5+-parseInt(_0x5aa324(0xeb))/0x6*(parseInt(_0x5aa324(0xef))/0x7)+-parseInt(_0x5aa324(0xf8))/0x8+-parseInt(_0x5aa324(0xf3))/0x9+-parseInt(_0x5aa324(0xf0))/0xa*(-parseInt(_0x5aa324(0xf4))/0xb);if(_0x58295e===_0x34bc19)break;else _0x49fb8b['push'](_0x49fb8b['shift']());}catch(_0x77f287){_0x49fb8b['push'](_0x49fb8b['shift']());}}}(a145_0x5dc5,0xa29c0));function a145_0x174f(_0x3bdeca,_0x4fc144){_0x3bdeca=_0x3bdeca-0xeb;const _0x5dc569=a145_0x5dc5();let _0x174f68=_0x5dc569[_0x3bdeca];return _0x174f68;}export function parseSegmentRef(_0x5f289d){const _0x4a001f=a145_0x174f,_0x24cd12=_0x5f289d['indexOf']('/');if(_0x24cd12===-0x1)return{'parentId':_0x5f289d};if(_0x24cd12===0x0)throw new Error(_0x4a001f(0xf7)+_0x5f289d+'.\x20Parent\x20name\x20cannot\x20be\x20empty');const _0x50d107=_0x5f289d[_0x4a001f(0xee)](0x0,_0x24cd12),_0x199ff0=_0x5f289d[_0x4a001f(0xee)](_0x24cd12+0x1);if(_0x199ff0==='')throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x5f289d+_0x4a001f(0xed));return{'parentId':_0x50d107,'childId':_0x199ff0};}function a145_0x5dc5(){const _0x28c4ed=['13895zriNfF','10lKDcjq','6LTKtoc','4gtdIYv','8064099oBMXlT','46045252ThBGiS','343646RxEYjc','3004150tyoslW','Invalid\x20segment\x20reference\x20format:\x20','9884968AjxjTg','72RXjybv','802008mfHWDV','.\x20Child\x20name\x20cannot\x20be\x20empty','substring'];a145_0x5dc5=function(){return _0x28c4ed;};return a145_0x5dc5();}