@treasuredata/tdx 2026.3.48 → 2026.3.50

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 (258) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/agent-command.js +1 -1
  9. package/dist/commands/agent-test-command.js +1 -1
  10. package/dist/commands/api-command.js +1 -1
  11. package/dist/commands/auth-command.d.ts +22 -0
  12. package/dist/commands/auth-command.d.ts.map +1 -1
  13. package/dist/commands/auth-command.js +1 -1
  14. package/dist/commands/auth-command.js.map +1 -1
  15. package/dist/commands/cas-command.js +1 -1
  16. package/dist/commands/cas-segment-command.js +1 -1
  17. package/dist/commands/chat-command.js +1 -1
  18. package/dist/commands/claude-command.js +1 -1
  19. package/dist/commands/claude-statusline-command.js +1 -1
  20. package/dist/commands/claude-usage-command.js +1 -1
  21. package/dist/commands/command.js +1 -1
  22. package/dist/commands/connection-command.js +1 -1
  23. package/dist/commands/databases.js +1 -1
  24. package/dist/commands/delivery-command.js +1 -1
  25. package/dist/commands/describe.js +1 -1
  26. package/dist/commands/engage-campaign-pull-command.js +1 -1
  27. package/dist/commands/engage-campaign-push-command.js +1 -1
  28. package/dist/commands/engage-campaign-validate-command.js +1 -1
  29. package/dist/commands/engage-command.js +1 -1
  30. package/dist/commands/engage-template-pull-command.js +1 -1
  31. package/dist/commands/engage-template-push-command.js +1 -1
  32. package/dist/commands/engage-template-validate-command.js +1 -1
  33. package/dist/commands/job-command.js +1 -1
  34. package/dist/commands/journey-command.js +1 -1
  35. package/dist/commands/journey-validate-command.js +1 -1
  36. package/dist/commands/llm-command.js +1 -1
  37. package/dist/commands/mcp-command.js +1 -1
  38. package/dist/commands/parent-segment-command.js +1 -1
  39. package/dist/commands/policy-command.js +1 -1
  40. package/dist/commands/profile-command.d.ts +5 -5
  41. package/dist/commands/profile-command.d.ts.map +1 -1
  42. package/dist/commands/profile-command.js +1 -1
  43. package/dist/commands/profile-command.js.map +1 -1
  44. package/dist/commands/profiles-command.js +1 -1
  45. package/dist/commands/query-command.js +1 -1
  46. package/dist/commands/schedule-command.js +1 -1
  47. package/dist/commands/segment-command.js +1 -1
  48. package/dist/commands/segment-create-command.js +1 -1
  49. package/dist/commands/segment-fields-command.js +1 -1
  50. package/dist/commands/segment-pull-command.js +1 -1
  51. package/dist/commands/segment-push-command.js +1 -1
  52. package/dist/commands/segment-update-command.js +1 -1
  53. package/dist/commands/segment-use-command.js +1 -1
  54. package/dist/commands/segment-validate-command.js +1 -1
  55. package/dist/commands/segments.js +1 -1
  56. package/dist/commands/show.js +1 -1
  57. package/dist/commands/status-command.js +1 -1
  58. package/dist/commands/tables.js +1 -1
  59. package/dist/commands/unset-command.js +1 -1
  60. package/dist/commands/upgrade-command.js +1 -1
  61. package/dist/commands/use-command.js +1 -1
  62. package/dist/commands/user-command.js +1 -1
  63. package/dist/commands/work-command.js +1 -1
  64. package/dist/commands/workflow-command.js +1 -1
  65. package/dist/core/auth.js +1 -1
  66. package/dist/core/command-output.js +1 -1
  67. package/dist/core/config.d.ts +6 -4
  68. package/dist/core/config.d.ts.map +1 -1
  69. package/dist/core/config.js +1 -1
  70. package/dist/core/config.js.map +1 -1
  71. package/dist/core/connection-cache.js +1 -1
  72. package/dist/core/constants.js +1 -1
  73. package/dist/core/credential-cache.js +1 -1
  74. package/dist/core/global-context.js +1 -1
  75. package/dist/core/keychain.js +1 -1
  76. package/dist/core/oauth-keychain.js +1 -1
  77. package/dist/core/oauth.d.ts +12 -8
  78. package/dist/core/oauth.d.ts.map +1 -1
  79. package/dist/core/oauth.js +1 -1
  80. package/dist/core/oauth.js.map +1 -1
  81. package/dist/core/profile.js +1 -1
  82. package/dist/core/project-config.js +1 -1
  83. package/dist/core/session.js +1 -1
  84. package/dist/core/user-cache.js +1 -1
  85. package/dist/core/version.js +1 -1
  86. package/dist/index.js +1 -1
  87. package/dist/mcp/server.js +1 -1
  88. package/dist/mcp/tools/index.js +1 -1
  89. package/dist/mcp/tools/tdx-run.js +1 -1
  90. package/dist/mcp/tools/tdx-search.js +1 -1
  91. package/dist/mcp/utils.d.ts.map +1 -1
  92. package/dist/mcp/utils.js +1 -1
  93. package/dist/mcp/utils.js.map +1 -1
  94. package/dist/proxy/claude-usage-tracker.js +1 -1
  95. package/dist/proxy/passthrough-server.js +1 -1
  96. package/dist/proxy/sse-usage-parser.js +1 -1
  97. package/dist/sdk/agent/agent-config.js +1 -1
  98. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  99. package/dist/sdk/agent/agent-yaml.js +1 -1
  100. package/dist/sdk/agent/test/evaluator.js +1 -1
  101. package/dist/sdk/agent/test/executor.js +1 -1
  102. package/dist/sdk/agent/test/index.js +1 -1
  103. package/dist/sdk/agent/test/output.js +1 -1
  104. package/dist/sdk/agent/test/parser.js +1 -1
  105. package/dist/sdk/agent/tool-target-registry.js +1 -1
  106. package/dist/sdk/api.js +1 -1
  107. package/dist/sdk/cas/cas-api-client.js +1 -1
  108. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  109. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  110. package/dist/sdk/cas/index.js +1 -1
  111. package/dist/sdk/cas/pull-workflow.js +1 -1
  112. package/dist/sdk/cas/push-workflow.js +1 -1
  113. package/dist/sdk/client/cdp-api-client.js +1 -1
  114. package/dist/sdk/client/delivery-api-client.js +1 -1
  115. package/dist/sdk/client/endpoints.js +1 -1
  116. package/dist/sdk/client/engage-api-client.js +1 -1
  117. package/dist/sdk/client/http-client.js +1 -1
  118. package/dist/sdk/client/llm-api-client.js +1 -1
  119. package/dist/sdk/client/oauth-refresh.js +1 -1
  120. package/dist/sdk/client/rate-limiter.js +1 -1
  121. package/dist/sdk/client/td-api-client.js +1 -1
  122. package/dist/sdk/client/trino-api-client.js +1 -1
  123. package/dist/sdk/client/workflow-client.js +1 -1
  124. package/dist/sdk/connection-validator.js +1 -1
  125. package/dist/sdk/connection.js +1 -1
  126. package/dist/sdk/delivery.js +1 -1
  127. package/dist/sdk/engage/campaign-pull.js +1 -1
  128. package/dist/sdk/engage/campaign-push.js +1 -1
  129. package/dist/sdk/engage/campaign-validator.js +1 -1
  130. package/dist/sdk/engage/campaign-yaml.js +1 -1
  131. package/dist/sdk/engage/template-pull.js +1 -1
  132. package/dist/sdk/engage/template-push.js +1 -1
  133. package/dist/sdk/engage/template-validator.js +1 -1
  134. package/dist/sdk/engage/template-yaml.js +1 -1
  135. package/dist/sdk/engage/types/campaign-def.js +1 -1
  136. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  137. package/dist/sdk/engage/types/template-schema.js +1 -1
  138. package/dist/sdk/engage.js +1 -1
  139. package/dist/sdk/errors.js +1 -1
  140. package/dist/sdk/index.js +1 -1
  141. package/dist/sdk/io/index.js +1 -1
  142. package/dist/sdk/io/node-filesystem.js +1 -1
  143. package/dist/sdk/job.js +1 -1
  144. package/dist/sdk/journey.js +1 -1
  145. package/dist/sdk/llm/chat-cache.js +1 -1
  146. package/dist/sdk/llm/index.js +1 -1
  147. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  148. package/dist/sdk/llm/model-factors.js +1 -1
  149. package/dist/sdk/personalization.js +1 -1
  150. package/dist/sdk/policy.js +1 -1
  151. package/dist/sdk/query/index.js +1 -1
  152. package/dist/sdk/query/sql-parser.js +1 -1
  153. package/dist/sdk/realtime.js +1 -1
  154. package/dist/sdk/schedule.js +1 -1
  155. package/dist/sdk/segment/child-segment-yaml.d.ts +8 -0
  156. package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
  157. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  158. package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
  159. package/dist/sdk/segment/fields-display.js +1 -1
  160. package/dist/sdk/segment/file-discovery.js +1 -1
  161. package/dist/sdk/segment/journey-utils.js +1 -1
  162. package/dist/sdk/segment/journey-validator.js +1 -1
  163. package/dist/sdk/segment/journey-yaml.js +1 -1
  164. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  165. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  166. package/dist/sdk/segment/pull-workflow.js +1 -1
  167. package/dist/sdk/segment/push-recovery.js +1 -1
  168. package/dist/sdk/segment/push-workflow.js +1 -1
  169. package/dist/sdk/segment/resolution-context.js +1 -1
  170. package/dist/sdk/segment/segment-path-parser.js +1 -1
  171. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  172. package/dist/sdk/segment/segment-validator.js +1 -1
  173. package/dist/sdk/segment/target-resolution.js +1 -1
  174. package/dist/sdk/segment/tdx-config.js +1 -1
  175. package/dist/sdk/segment/types/activation-schema.js +1 -1
  176. package/dist/sdk/segment/types/journey-def.js +1 -1
  177. package/dist/sdk/segment/types/journey-schema.js +1 -1
  178. package/dist/sdk/segment/types/segment-def.js +1 -1
  179. package/dist/sdk/segment/types/segment-schema.js +1 -1
  180. package/dist/sdk/segment/validate-files.js +1 -1
  181. package/dist/sdk/segment/yaml-validator.js +1 -1
  182. package/dist/sdk/segment.js +1 -1
  183. package/dist/sdk/types/index.d.ts +1 -1
  184. package/dist/sdk/types/index.d.ts.map +1 -1
  185. package/dist/sdk/types/index.js +1 -1
  186. package/dist/sdk/types/index.js.map +1 -1
  187. package/dist/sdk/types/progress.js +1 -1
  188. package/dist/sdk/types/workspace.d.ts +29 -0
  189. package/dist/sdk/types/workspace.d.ts.map +1 -1
  190. package/dist/sdk/types/workspace.js +1 -1
  191. package/dist/sdk/user.js +1 -1
  192. package/dist/sdk/util/format-detector.js +1 -1
  193. package/dist/sdk/util/formatters.js +1 -1
  194. package/dist/sdk/util/index.js +1 -1
  195. package/dist/sdk/util/paginate.js +1 -1
  196. package/dist/sdk/util/tree-formatter.js +1 -1
  197. package/dist/sdk/workflow/archive-validation.js +1 -1
  198. package/dist/sdk/workflow/clone-workflow.js +1 -1
  199. package/dist/sdk/workflow/index.js +1 -1
  200. package/dist/sdk/workflow/pull-workflow.js +1 -1
  201. package/dist/sdk/workflow/push-workflow.js +1 -1
  202. package/dist/sdk/workflow/tdx-config.js +1 -1
  203. package/dist/sdk/workflow/workflow-utils.js +1 -1
  204. package/dist/sdk/workspace/frontmatter.js +1 -1
  205. package/dist/sdk/workspace/git.d.ts +4 -1
  206. package/dist/sdk/workspace/git.d.ts.map +1 -1
  207. package/dist/sdk/workspace/git.js +1 -1
  208. package/dist/sdk/workspace/git.js.map +1 -1
  209. package/dist/sdk/workspace/index.d.ts +8 -15
  210. package/dist/sdk/workspace/index.d.ts.map +1 -1
  211. package/dist/sdk/workspace/index.js +1 -1
  212. package/dist/sdk/workspace/index.js.map +1 -1
  213. package/dist/sdk/workspace/templates.js +1 -1
  214. package/dist/sdk/workspace/weekly.d.ts +3 -13
  215. package/dist/sdk/workspace/weekly.d.ts.map +1 -1
  216. package/dist/sdk/workspace/weekly.js +1 -1
  217. package/dist/sdk/workspace/weekly.js.map +1 -1
  218. package/dist/sdk/workspace/wikilinks.d.ts +15 -0
  219. package/dist/sdk/workspace/wikilinks.d.ts.map +1 -1
  220. package/dist/sdk/workspace/wikilinks.js +1 -1
  221. package/dist/sdk/workspace/wikilinks.js.map +1 -1
  222. package/dist/test-utils/command-runner.js +1 -1
  223. package/dist/test-utils/factories.js +1 -1
  224. package/dist/test-utils/fixtures.js +1 -1
  225. package/dist/test-utils/http-mock.js +1 -1
  226. package/dist/test-utils/index.js +1 -1
  227. package/dist/utils/async.js +1 -1
  228. package/dist/utils/colors.js +1 -1
  229. package/dist/utils/diff.js +1 -1
  230. package/dist/utils/file-permissions.js +1 -1
  231. package/dist/utils/file-reader.js +1 -1
  232. package/dist/utils/github-releases.js +1 -1
  233. package/dist/utils/global-cache.js +1 -1
  234. package/dist/utils/json-loader.js +1 -1
  235. package/dist/utils/local-cache.js +1 -1
  236. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  237. package/dist/utils/logger/formatters/index.js +1 -1
  238. package/dist/utils/logger/handlers/console-handler.js +1 -1
  239. package/dist/utils/logger/handlers/file-handler.js +1 -1
  240. package/dist/utils/logger/handlers/index.js +1 -1
  241. package/dist/utils/logger/handlers/null-handler.js +1 -1
  242. package/dist/utils/logger/index.js +1 -1
  243. package/dist/utils/logger/logger.js +1 -1
  244. package/dist/utils/logger/types.js +1 -1
  245. package/dist/utils/option-validation.js +1 -1
  246. package/dist/utils/process.js +1 -1
  247. package/dist/utils/prompt.js +1 -1
  248. package/dist/utils/spinner.js +1 -1
  249. package/dist/utils/sse-parser.js +1 -1
  250. package/dist/utils/string-utils.js +1 -1
  251. package/dist/utils/table-ref-parser.js +1 -1
  252. package/dist/utils/tdx-logger.js +1 -1
  253. package/dist/utils/version-check.js +1 -1
  254. package/package.json +1 -1
  255. package/dist/commands/auth-login-command.d.ts +0 -29
  256. package/dist/commands/auth-login-command.d.ts.map +0 -1
  257. package/dist/commands/auth-login-command.js +0 -1
  258. package/dist/commands/auth-login-command.js.map +0 -1
@@ -1 +1 @@
1
- const a152_0x32dbf6=a152_0x13c2;(function(_0x59ed90,_0x52d4d9){const _0x44ad11=a152_0x13c2,_0x55368b=_0x59ed90();while(!![]){try{const _0x445fb9=-parseInt(_0x44ad11(0x168))/0x1*(-parseInt(_0x44ad11(0x1a3))/0x2)+parseInt(_0x44ad11(0x1db))/0x3+-parseInt(_0x44ad11(0x24c))/0x4+parseInt(_0x44ad11(0x176))/0x5+-parseInt(_0x44ad11(0x245))/0x6*(-parseInt(_0x44ad11(0x1f2))/0x7)+-parseInt(_0x44ad11(0x204))/0x8*(parseInt(_0x44ad11(0x19d))/0x9)+-parseInt(_0x44ad11(0x198))/0xa*(parseInt(_0x44ad11(0x1a4))/0xb);if(_0x445fb9===_0x52d4d9)break;else _0x55368b['push'](_0x55368b['shift']());}catch(_0x3863fd){_0x55368b['push'](_0x55368b['shift']());}}}(a152_0x5e75,0x8da48));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of']('tdx.sdk.push-workflow');export const PENDING_SEGMENT_PREFIX=a152_0x32dbf6(0x14e);export const PENDING_ACTIVATION_PREFIX=a152_0x32dbf6(0x250);export function createPendingSegmentId(_0xf76103){return''+PENDING_SEGMENT_PREFIX+_0xf76103+'__';}export function isPendingSegmentId(_0x4ff10d){return _0x4ff10d['startsWith'](PENDING_SEGMENT_PREFIX)&&!_0x4ff10d['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x460375){const _0x3e8a55=a152_0x32dbf6;return _0x460375[_0x3e8a55(0x202)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x4fe2ba){return''+PENDING_ACTIVATION_PREFIX+_0x4fe2ba+'__';}export function isPendingActivationId(_0x2a3480){return _0x2a3480['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x3a0946){const _0x40681a=a152_0x32dbf6;return _0x3a0946[_0x40681a(0x202)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x1ec216,_0x5b3f31){const _0x2bc67b=a152_0x32dbf6,_0x2961d0=_0x1ec216+'::'+(_0x5b3f31[_0x2bc67b(0x183)]()||_0x2bc67b(0x196)),_0x53fae6=createHash('sha1')[_0x2bc67b(0x166)](_0x2961d0)['digest']('hex')[_0x2bc67b(0x223)](0x0,0xc);return'journey_entry_criteria_'+_0x53fae6;}export function ensureJourneyDefaults(_0x20767d){const _0x47fb7e=a152_0x32dbf6;!_0x20767d['description']&&(_0x20767d[_0x47fb7e(0x1d7)]=''),!_0x20767d['state']&&(_0x20767d[_0x47fb7e(0x1e1)]='draft');}export function injectExistingStageIds(_0x5a2864,_0x5a0b6b){const _0x1476c5=a152_0x32dbf6,_0x4c7a01=new Map(_0x5a0b6b[_0x1476c5(0x189)](_0x3ddc8b=>[_0x3ddc8b[_0x1476c5(0x1de)],_0x3ddc8b['id']]));for(const _0xd0a563 of _0x5a2864){if(!_0xd0a563['id']){const _0x358177=_0x4c7a01[_0x1476c5(0x162)](_0xd0a563[_0x1476c5(0x1de)]);_0x358177&&(_0xd0a563['id']=_0x358177);}}}export function resolveTDFolderPath(_0x2e8db3,_0x2ef4d0,_0x147ec3){if(!_0x2ef4d0)return _0x2e8db3;if(_0x2e8db3===_0x147ec3||_0x2e8db3['startsWith'](_0x147ec3+'/'))return _0x2e8db3;return _0x2e8db3?_0x147ec3+'/'+_0x2e8db3:_0x147ec3;}export function addFoldersToCreate(_0x555e00,_0x342070,_0x525b29){const _0x3cced1=a152_0x32dbf6;if(!_0x555e00)return;if(_0x342070[_0x3cced1(0x1a6)](_0x555e00))return;const _0x572fc4=_0x555e00[_0x3cced1(0x1e6)]('/');let _0x455869='';for(const _0x22e991 of _0x572fc4){_0x455869=_0x455869?_0x455869+'/'+_0x22e991:_0x22e991,!_0x342070[_0x3cced1(0x1a6)](_0x455869)&&_0x525b29[_0x3cced1(0x1c1)](_0x455869);}}export function sortFoldersByDepth(_0x17eb1f){return[..._0x17eb1f]['sort']((_0x2e0c4f,_0x1c4bad)=>{const _0x1f9272=a152_0x13c2,_0x57a20a=(_0x2e0c4f[_0x1f9272(0x190)](/\//g)||[])[_0x1f9272(0x24d)],_0x354c67=(_0x1c4bad['match'](/\//g)||[])['length'];return _0x57a20a-_0x354c67;});}import*as a152_0x13b23a from'yaml';import{readFileSync}from'fs';import a152_0x54f873 from'path';import{isJourneyDef,parseYamlString as a152_0x3d28f1,toYamlString as a152_0x2358d9,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(_0x5b2cf0){const _0x1ccbe4=a152_0x32dbf6;if(Array[_0x1ccbe4(0x1f7)](_0x5b2cf0))return'['+_0x5b2cf0[_0x1ccbe4(0x189)](_0xbf68c6=>stableStringify(_0xbf68c6))['join'](',')+']';if(_0x5b2cf0&&typeof _0x5b2cf0===_0x1ccbe4(0x178)){const _0x3d758a=_0x5b2cf0,_0x373858=Object[_0x1ccbe4(0x21f)](_0x3d758a)[_0x1ccbe4(0x1a7)](),_0x28b956=_0x373858[_0x1ccbe4(0x189)](_0x331a7c=>'\x22'+_0x331a7c+'\x22:'+stableStringify(_0x3d758a[_0x331a7c]));return'{'+_0x28b956['join'](',')+'}';}const _0xff51ec=JSON[_0x1ccbe4(0x151)](_0x5b2cf0);return _0xff51ec===undefined?_0x1ccbe4(0x208):_0xff51ec;}function activationSignature(_0x2c49ca){const _0x4fe541=a152_0x32dbf6,_0x2b465c={'connection':_0x2c49ca[_0x4fe541(0x214)],..._0x2c49ca['all_columns']!==undefined&&{'all_columns':_0x2c49ca[_0x4fe541(0x1f3)]},..._0x2c49ca['columns']!==undefined&&{'columns':_0x2c49ca[_0x4fe541(0x167)]},..._0x2c49ca[_0x4fe541(0x235)]!==undefined&&{'behavior':_0x2c49ca[_0x4fe541(0x235)]},..._0x2c49ca['schedule']!==undefined&&{'schedule':_0x2c49ca['schedule']},..._0x2c49ca['notification']!==undefined&&{'notification':_0x2c49ca[_0x4fe541(0x251)]},..._0x2c49ca[_0x4fe541(0x17c)]!==undefined&&{'connector_config':_0x2c49ca[_0x4fe541(0x17c)]},..._0x2c49ca[_0x4fe541(0x1cf)]!==undefined&&{'activation_template_id':_0x2c49ca[_0x4fe541(0x1cf)]}};return stableStringify(_0x2b465c);}async function fetchSegment(_0x35aa07,_0x423e58,_0x21e0b0,_0x18d603){const _0xdbb54f=a152_0x32dbf6,_0x410450=_0x18d603?.['find'](_0x51c098=>_0x51c098['id']===_0x21e0b0);if(_0x410450)return _0x410450;try{return await _0x35aa07[_0xdbb54f(0x196)][_0xdbb54f(0x1b7)](_0x423e58,_0x21e0b0);}catch(_0x40afd6){logger['debug'](_0xdbb54f(0x206)+_0x21e0b0+_0xdbb54f(0x1e7)+_0x40afd6);try{return await _0x35aa07['segment'][_0xdbb54f(0x1e0)](_0x21e0b0);}catch(_0x204de7){return logger[_0xdbb54f(0x21e)](_0xdbb54f(0x1ff)+_0x21e0b0+':\x20'+_0x204de7),null;}}}function recoverSegmentIdsFromPushRecovery(_0x14461f,_0x22271c,_0x2f34bd){const _0xfdc7bb=a152_0x32dbf6,_0x378232=readPushRecovery(_0x14461f[_0xfdc7bb(0x160)]);if(_0x378232?.['journeyName']===_0x14461f[_0xfdc7bb(0x154)][_0xfdc7bb(0x1de)])for(const [_0x5eba50,_0x11f04a]of Object[_0xfdc7bb(0x21b)](_0x378232[_0xfdc7bb(0x175)])){const _0x5489c3=generateDeterministicJourneySegmentName(_0x14461f[_0xfdc7bb(0x154)][_0xfdc7bb(0x1de)],_0x5eba50);_0x11f04a[_0xfdc7bb(0x1a8)]===_0x5489c3&&(_0x22271c[_0xfdc7bb(0x20a)](_0x5eba50,_0x11f04a[_0xfdc7bb(0x15e)]),_0x2f34bd['set'](_0x5eba50,_0x11f04a['segmentId']));}}async function createOrRecoverEmbeddedSegment(_0x23f279,_0x56bd88,_0x2f3da4,_0x28d98d){const _0x80257d=a152_0x32dbf6;let _0x4b55d4;try{_0x4b55d4=await _0x23f279[_0x80257d(0x196)][_0x80257d(0x1bc)]({'name':_0x2f3da4['uniqueSegmentName'],'description':_0x2f3da4[_0x80257d(0x1d7)],'journeyId':_0x2f3da4['journeyId'],'rule':_0x28d98d(_0x2f3da4[_0x80257d(0x1b3)],!![]),'countPopulation':!![],'parentFolderId':_0x2f3da4[_0x80257d(0x22b)],'audienceId':_0x2f3da4[_0x80257d(0x1fd)]});}catch(_0x551da7){const _0x94c25=_0x551da7 instanceof Error&&_0x551da7[_0x80257d(0x163)][_0x80257d(0x1d1)]('Name\x20has\x20already\x20been\x20taken');if(_0x94c25){const _0x46a908=readPushRecovery(_0x56bd88[_0x80257d(0x160)]),_0x4938d1=_0x46a908?.[_0x80257d(0x216)]===_0x56bd88[_0x80257d(0x154)][_0x80257d(0x1de)]?_0x46a908[_0x80257d(0x175)][_0x2f3da4[_0x80257d(0x1be)]]:undefined;if(_0x4938d1?.[_0x80257d(0x1a8)]===_0x2f3da4[_0x80257d(0x188)])await _0x23f279[_0x80257d(0x196)][_0x80257d(0x1d6)](_0x2f3da4[_0x80257d(0x1fd)],_0x4938d1['segmentId'],{'description':_0x2f3da4[_0x80257d(0x1d7)],'rule':_0x28d98d(_0x2f3da4[_0x80257d(0x1b3)],!![]),'countPopulation':!![]}),_0x4b55d4=_0x4938d1[_0x80257d(0x15e)];else throw new SDKError(ErrorCode['SEGMENT_UPDATE_ERROR'],_0x80257d(0x1ef)+_0x2f3da4['localName']+_0x80257d(0x220)+(_0x80257d(0x1f8)+_0x56bd88[_0x80257d(0x160)]['replace'](/([^/]+)$/,_0x80257d(0x217))+')\x20')+'and\x20the\x20server\x20segment,\x20then\x20retry.',_0x551da7);}else throw _0x551da7;}return saveSegmentToPushRecovery(_0x56bd88[_0x80257d(0x160)],_0x56bd88[_0x80257d(0x154)]['name'],_0x2f3da4[_0x80257d(0x1be)],{'segmentId':_0x4b55d4,'uniqueServerName':_0x2f3da4['uniqueSegmentName'],'createdAt':new Date()['toISOString']()}),_0x4b55d4;}export async function prepareSegmentFiles(_0x4128d6,_0x48b934,_0x1a5bf3,_0x9b4b24,_0x2728f3){const _0x14796a=a152_0x32dbf6,{activationDefToCreateRequest:_0x1bef0f}=await import(_0x14796a(0x224)),_0x243552=[],_0x278c80=new Set();for(const {yamlConfig:_0x3fbd9f,folderPath:_0x11bddc,sourcePath:_0x32bc48}of _0x4128d6){const _0x3d9ac6=resolveTDFolderPath(_0x11bddc,_0x9b4b24,_0x2728f3),_0x516668=_0x3d9ac6+':'+_0x3fbd9f[_0x14796a(0x1de)],_0x4a9dd7=_0x48b934[_0x14796a(0x1b2)][_0x14796a(0x162)](_0x516668),_0x23b174=_0x4a9dd7?_0x48b934[_0x14796a(0x22e)][_0x14796a(0x162)](_0x4a9dd7['id'])||[]:[];addFoldersToCreate(_0x3d9ac6,_0x48b934[_0x14796a(0x192)],_0x278c80);const _0x11ffcc=calculateActivationActions(_0x3fbd9f['activations']||[],_0x23b174,_0x48b934[_0x14796a(0x199)],_0x48b934[_0x14796a(0x23d)]);for(const _0x34fbb4 of _0x11ffcc){(_0x34fbb4[_0x14796a(0x187)]===_0x14796a(0x1d9)||_0x34fbb4[_0x14796a(0x187)]===_0x14796a(0x166))&&_0x34fbb4[_0x14796a(0x203)]&&(_0x34fbb4[_0x14796a(0x1fb)]=await _0x1bef0f(_0x34fbb4[_0x14796a(0x203)],_0x1a5bf3));}const _0xe7a0db=calculateSegmentDiff(_0x3fbd9f,_0x4a9dd7,_0x23b174,_0x48b934['idToEmailMap'],_0x48b934[_0x14796a(0x23d)]);_0x243552[_0x14796a(0x1a2)]({'relativePath':_0x3fbd9f['name'],'absolutePath':_0x32bc48,'yamlConfig':_0x3fbd9f,'folderPath':_0x3d9ac6,'existingSegment':_0x4a9dd7,'existingActivations':_0x23b174,'isNew':_0xe7a0db[_0x14796a(0x22f)],'hasChanges':_0xe7a0db['hasChanges'],'diff':_0xe7a0db[_0x14796a(0x17b)],'activationActions':_0x11ffcc});}return{'segmentFiles':_0x243552,'foldersToCreate':_0x278c80};}export async function prepareJourneyFiles(_0x4e9adb,_0x41f8b6,_0xf627bd,_0x1fd26f){const _0x2c123b=a152_0x32dbf6,_0x99cc9b=[],_0x43c923=new Set();for(const {yamlConfig:_0x5b5d14,folderPath:_0x1f075e,sourcePath:_0x2dc631}of _0x4e9adb){const _0x127ab6=resolveTDFolderPath(_0x1f075e,_0xf627bd,_0x1fd26f),_0x44d0f2=_0x127ab6+':'+_0x5b5d14['name'],_0x56d3f0=_0x41f8b6[_0x2c123b(0x24f)][_0x2c123b(0x162)](_0x44d0f2);let _0x2d820b,_0x2aef2f;if(_0x56d3f0&&_0x56d3f0[_0x2c123b(0x24d)]>0x0){const _0x208c0b=buildLocalExpandedRuleMappings(_0x5b5d14),{createYamlContext:_0x13f57c,prefetchJourneySegments:_0x573611}=createPushYamlContextForBundle(_0x41f8b6[_0x2c123b(0x201)],_0x41f8b6[_0x2c123b(0x1fd)],_0x41f8b6[_0x2c123b(0x1b8)],_0x208c0b,_0x41f8b6[_0x2c123b(0x199)],_0x41f8b6[_0x2c123b(0x23d)],_0x41f8b6['activationStepsById'],_0x41f8b6[_0x2c123b(0x1fc)]);await _0x573611(_0x56d3f0[_0x2c123b(0x189)](_0x5cc970=>_0x5cc970['id']));const _0x399dc3=await _0x41f8b6['deps']['journey'][_0x2c123b(0x1ca)](_0x56d3f0[0x0][_0x2c123b(0x1c0)]),_0x5d1753=hasMultipleVersions(_0x5b5d14),_0x6c8e64=async _0x4b25f9=>{const _0x1d68c2=_0x2c123b,_0x1d0846=_0x41f8b6['journeyById']?.[_0x1d68c2(0x162)](_0x4b25f9);if(_0x1d0846)return _0x1d0846;return _0x41f8b6[_0x1d68c2(0x209)]({'journeyId':_0x4b25f9,'journeyName':_0x5b5d14[_0x1d68c2(0x1de)],'isMultiVersion':_0x56d3f0[_0x1d68c2(0x24d)]>0x1});};if(_0x5d1753&&_0x56d3f0[_0x2c123b(0x24d)]>0x1){const _0x42c4ef=[];for(const _0x44fe3a of _0x56d3f0){const _0x3684ca=_0x44fe3a[_0x2c123b(0x1cd)]||0x1;_0x41f8b6['progress']?.['update'](_0x2c123b(0x19c)+_0x5b5d14[_0x2c123b(0x1de)]+'\x20v'+_0x3684ca);const _0x2b3fd3=await _0x6c8e64(_0x44fe3a['id']),_0x540d9c=_0x13f57c(_0x44fe3a['id']),_0x419e3d=await journeyResponseToDef(_0x2b3fd3,_0x540d9c);_0x42c4ef[_0x2c123b(0x1a2)]({'item':_0x44fe3a,'yaml':_0x419e3d});}const _0x41da0f=buildLocalRuleToNameMappingFromJourney(_0x5b5d14);_0x2aef2f=buildMergedJourneyDef(_0x42c4ef,_0x41da0f,_0x399dc3);const _0x1781a1=Math['max'](..._0x42c4ef[_0x2c123b(0x189)](_0x1d115b=>_0x1d115b[_0x2c123b(0x1e5)]['versionNumber']||0x0)),_0x5dd509=_0x56d3f0['find'](_0x5d5091=>(_0x5d5091[_0x2c123b(0x1cd)]||0x0)===_0x1781a1);_0x5dd509&&(_0x41f8b6[_0x2c123b(0x1e3)]?.[_0x2c123b(0x166)](_0x2c123b(0x19c)+_0x5b5d14[_0x2c123b(0x1de)]+'\x20v'+_0x1781a1),_0x2d820b=await _0x6c8e64(_0x5dd509['id']));}else{const _0x3b86cd=_0x56d3f0[_0x56d3f0[_0x2c123b(0x24d)]-0x1];_0x41f8b6['progress']?.[_0x2c123b(0x166)](_0x2c123b(0x19c)+_0x5b5d14[_0x2c123b(0x1de)]),_0x2d820b=await _0x6c8e64(_0x3b86cd['id']);const _0x12a61c=_0x13f57c(_0x3b86cd['id']),_0x5d0205=await journeyResponseToDef(_0x2d820b,_0x12a61c),_0x1d882f=buildLocalRuleToNameMappingFromJourney(_0x5b5d14);_0x2aef2f=buildMergedJourneyDef([{'item':_0x3b86cd,'yaml':_0x5d0205}],_0x1d882f,_0x399dc3);}}addFoldersToCreate(_0x127ab6,_0x41f8b6['folderPathToId'],_0x43c923);const _0x49a049=calculateJourneyDiff(_0x5b5d14,_0x2aef2f);_0x99cc9b[_0x2c123b(0x1a2)]({'relativePath':_0x5b5d14[_0x2c123b(0x1de)],'absolutePath':_0x2dc631,'yamlConfig':_0x5b5d14,'folderPath':_0x127ab6,'existingJourney':_0x2d820b,'isNew':_0x49a049[_0x2c123b(0x22f)],'hasChanges':_0x49a049['hasChanges'],'diff':_0x49a049[_0x2c123b(0x17b)]});}return{'journeyFiles':_0x99cc9b,'foldersToCreate':_0x43c923};}function a152_0x13c2(_0x5687e5,_0x19af00){_0x5687e5=_0x5687e5-0x14b;const _0x5e75bb=a152_0x5e75();let _0x13c21c=_0x5e75bb[_0x5687e5];return _0x13c21c;}export function calculateActivationActions(_0x4ff80a,_0x2e682c,_0xc82dc3,_0x40998c){const _0x41694d=a152_0x32dbf6,_0x136928=[],_0x53214a=new Map();for(const _0xe21270 of _0x2e682c){_0x53214a[_0x41694d(0x20a)](_0xe21270[_0x41694d(0x1de)],_0xe21270);}const _0x5a8a5f=new Map();for(const _0x24ad2c of _0x4ff80a){_0x5a8a5f[_0x41694d(0x20a)](_0x24ad2c['name'],_0x24ad2c);}for(const _0x440dac of _0x4ff80a){const _0x49807c=_0x53214a[_0x41694d(0x162)](_0x440dac['name']);if(!_0x49807c)_0x136928[_0x41694d(0x1a2)]({'type':_0x41694d(0x1d9),'name':_0x440dac[_0x41694d(0x1de)],'yamlActivation':_0x440dac});else{const _0x4648bb=activationResponseToDef(_0x49807c,_0xc82dc3,_0x40998c),_0x521b9f=a152_0x13b23a['stringify'](_0x4648bb),_0x3e6929=a152_0x13b23a[_0x41694d(0x151)](_0x440dac);_0x521b9f!==_0x3e6929&&_0x136928[_0x41694d(0x1a2)]({'type':_0x41694d(0x166),'name':_0x440dac['name'],'yamlActivation':_0x440dac,'existingActivation':_0x49807c});}}for(const _0x67b3a5 of _0x2e682c){!_0x5a8a5f[_0x41694d(0x1a6)](_0x67b3a5[_0x41694d(0x1de)])&&_0x136928[_0x41694d(0x1a2)]({'type':'delete','name':_0x67b3a5[_0x41694d(0x1de)],'existingActivation':_0x67b3a5});}return _0x136928;}function calculateYamlDiff(_0x1eb796,_0x3a142c){if(_0x3a142c){const _0x36982c=generateDiff(_0x3a142c,_0x1eb796),_0x157f9d=hasChanges(_0x36982c);return{'isNew':![],'hasChanges':_0x157f9d,'diff':_0x157f9d?formatDiffWithColors(_0x36982c):undefined};}const _0x442ef=generateDiff('',_0x1eb796);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x442ef)};}export function calculateSegmentDiff(_0x1c6966,_0x522918,_0x343344,_0x343bb4,_0x11d837){const _0x386ec6=segmentToYamlString(_0x1c6966),_0x3f68e3=_0x522918?segmentToYamlString(segmentWithActivationsToYaml(_0x522918,_0x343344,undefined,_0x343bb4,_0x11d837)):undefined;return calculateYamlDiff(_0x386ec6,_0x3f68e3);}export function calculateJourneyDiff(_0x2ab124,_0x417913){const _0x42f1f3=normalizeJourneyDef(_0x2ab124,_0x2ab124),_0x429b97=a152_0x2358d9(_0x42f1f3),_0xfd05cf=_0x417913?a152_0x2358d9(normalizeJourneyDef(_0x417913,_0x2ab124)):undefined;return calculateYamlDiff(_0x429b97,_0xfd05cf);}export function findSegmentsToDelete(_0xd05d34,_0x31e3fc,_0x2b483c,_0x365058,_0x5addfe){const _0x107411=a152_0x32dbf6,_0x3ce545=new Set();for(const {yamlConfig:_0x110309,folderPath:_0x444290}of _0x31e3fc){_0x3ce545['add'](_0x444290+':'+_0x110309['name']);}return _0xd05d34[_0x107411(0x18c)](_0xd1ab8b=>{const _0x2ffa5e=_0x107411,_0x36cb01=_0xd1ab8b[_0x2ffa5e(0x1ac)]?_0x2b483c[_0x2ffa5e(0x162)](_0xd1ab8b[_0x2ffa5e(0x1ac)][_0x2ffa5e(0x19a)]())||'':'',_0x519b88=_0x36cb01+':'+_0xd1ab8b[_0x2ffa5e(0x1de)];if(_0x3ce545['has'](_0x519b88))return![];if(_0x5addfe)return _0x36cb01===_0x365058||_0x36cb01[_0x2ffa5e(0x179)](_0x365058+'/');return!![];});}export function findJourneysToDelete(_0x5394eb,_0x16bbc2,_0x40568f,_0x20514f,_0x1ef940){const _0x29f1fb=a152_0x32dbf6,_0x20fc68=new Set();for(const {yamlConfig:_0x69ec46,folderPath:_0x1e1a07}of _0x16bbc2){_0x20fc68[_0x29f1fb(0x1c1)](_0x1e1a07+':'+_0x69ec46[_0x29f1fb(0x1de)]);}return _0x5394eb['filter'](_0x490139=>{const _0x5bcf16=_0x29f1fb,_0x1b1ad9=_0x490139[_0x5bcf16(0x22b)]?_0x40568f[_0x5bcf16(0x162)](_0x490139['folderId'])||'':'',_0x46cf96=_0x1b1ad9+':'+_0x490139[_0x5bcf16(0x1b5)];if(_0x20fc68[_0x5bcf16(0x1a6)](_0x46cf96))return![];if(_0x1ef940)return _0x1b1ad9===_0x20514f||_0x1b1ad9[_0x5bcf16(0x179)](_0x20514f+'/');return!![];});}export function buildSegmentLookupMap(_0x5af2f9,_0xce25f1){const _0x53038b=a152_0x32dbf6,_0x5b57e3=new Map();for(const _0xbbb4d3 of _0x5af2f9){const _0x52d390=_0xbbb4d3[_0x53038b(0x1ac)]?_0xce25f1[_0x53038b(0x162)](_0xbbb4d3[_0x53038b(0x1ac)][_0x53038b(0x19a)]())||'':'',_0x4af619=_0x52d390+':'+_0xbbb4d3['name'];_0x5b57e3[_0x53038b(0x20a)](_0x4af619,_0xbbb4d3);}return _0x5b57e3;}export function buildSegmentNameToIdMap(_0x5593a9){const _0x9df65a=a152_0x32dbf6,_0x3c9c56=new Map();for(const _0x1eeb59 of _0x5593a9){_0x3c9c56['set'](_0x1eeb59[_0x9df65a(0x1de)],_0x1eeb59['id']);}return _0x3c9c56;}export function buildJourneyBundleLookupMap(_0x33aee3,_0x43d7ab){const _0x477842=a152_0x32dbf6,_0x18f331=new Map();for(const _0x53be9f of _0x33aee3){const _0xfaea48=_0x53be9f[_0x477842(0x22b)]?_0x43d7ab['get'](_0x53be9f[_0x477842(0x22b)])||'':'',_0x509670=_0xfaea48+':'+_0x53be9f[_0x477842(0x1b5)];!_0x18f331[_0x477842(0x1a6)](_0x509670)&&_0x18f331[_0x477842(0x20a)](_0x509670,[]),_0x18f331[_0x477842(0x162)](_0x509670)[_0x477842(0x1a2)](_0x53be9f);}for(const _0x68a03d of _0x18f331[_0x477842(0x226)]()){_0x68a03d[_0x477842(0x1a7)]((_0x56a81e,_0x241aaf)=>(_0x56a81e['versionNumber']||0x0)-(_0x241aaf[_0x477842(0x1cd)]||0x0));}return _0x18f331;}export function collectFoldersToCreate(_0x1f4460,_0x5bdd4a){const _0x7e45c6=a152_0x32dbf6,_0x42dca4=new Set();for(const _0x4df7c4 of _0x1f4460){if(!_0x4df7c4)continue;if(_0x5bdd4a[_0x7e45c6(0x1a6)](_0x4df7c4))continue;const _0x2f58ae=_0x4df7c4['split']('/');let _0x23ed99='';for(const _0x23f5a2 of _0x2f58ae){_0x23ed99=_0x23ed99?_0x23ed99+'/'+_0x23f5a2:_0x23f5a2,!_0x5bdd4a[_0x7e45c6(0x1a6)](_0x23ed99)&&_0x42dca4[_0x7e45c6(0x1c1)](_0x23ed99);}}return _0x42dca4;}export function parseAndClassifyYamlFiles(_0x1216a1,_0x3c125a,_0x1aef7d){const _0x34a16a=a152_0x32dbf6,_0x3c3ac3=[],_0x306721=[];for(const _0x4d8f54 of _0x1216a1){const _0x47adc4=a152_0x54f873[_0x34a16a(0x1c4)](_0x3c125a,a152_0x54f873['dirname'](_0x4d8f54)),_0x3d09ab=_0x47adc4==='.'?'':_0x47adc4,_0x1ba758=readFileSync(_0x4d8f54,_0x34a16a(0x20b)),_0xc6c597=a152_0x13b23a[_0x34a16a(0x247)](_0x1ba758);if(isJourneyDef(_0xc6c597)){const _0xed3500=a152_0x3d28f1(_0x1ba758);_0x306721[_0x34a16a(0x1a2)]({'yamlConfig':_0xed3500,'folderPath':_0x3d09ab,'sourcePath':_0x4d8f54});}else{if(!_0x1aef7d?.[_0x34a16a(0x1a1)]){const _0x4243af=parseSegmentYamlFile(_0x1ba758),_0x3d91d0=normalizeChildSegmentYaml(_0x4243af);_0x3c3ac3[_0x34a16a(0x1a2)]({'yamlConfig':_0x3d91d0,'folderPath':_0x3d09ab,'sourcePath':_0x4d8f54});}}}return{'segments':_0x3c3ac3,'journeys':_0x306721};}export function validateParsedFiles(_0x25f9b1,_0x41cc34){const _0x5c6dff=a152_0x32dbf6,_0x26d131=[];for(const {yamlConfig:_0x4be28e,sourcePath:_0x11b834}of _0x25f9b1[_0x5c6dff(0x175)]){const _0xa82da8=readFileSync(_0x11b834,_0x5c6dff(0x20b)),_0x39b153=a152_0x13b23a[_0x5c6dff(0x19f)](_0xa82da8),_0x543a6f=validateSegmentDef(_0x4be28e,{'source':_0xa82da8,'document':_0x39b153},{'skipSchema':!![]});if(!_0x543a6f['valid']){const _0x5251ff=a152_0x54f873[_0x5c6dff(0x1c4)](_0x41cc34,_0x11b834);_0x26d131[_0x5c6dff(0x1a2)]({'filePath':_0x5251ff,'source':_0xa82da8,'result':_0x543a6f,'isJourney':![]});}}for(const {yamlConfig:_0x5d0987,sourcePath:_0x19d337}of _0x25f9b1[_0x5c6dff(0x16d)]){const _0x54a36e=readFileSync(_0x19d337,'utf-8'),_0x1234c1=a152_0x13b23a['parseDocument'](_0x54a36e),_0x2f30bd=validateJourneyDef(_0x5d0987,{'source':_0x54a36e,'document':_0x1234c1},{'skipSchema':!![]});if(!_0x2f30bd[_0x5c6dff(0x240)]){const _0x5149f2=a152_0x54f873[_0x5c6dff(0x1c4)](_0x41cc34,_0x19d337);_0x26d131[_0x5c6dff(0x1a2)]({'filePath':_0x5149f2,'source':_0x54a36e,'result':_0x2f30bd,'isJourney':!![]});}}return _0x26d131;}export function formatValidationErrors(_0x17269a){const _0x23ec03=a152_0x32dbf6,_0x2ef58e=[];for(const {filePath:_0x5cf193,source:_0x3a8187,result:_0x301742,isJourney:_0x5301e5}of _0x17269a){const _0x30af79=_0x5301e5?_0x23ec03(0x1c3):_0x23ec03(0x196);_0x2ef58e[_0x23ec03(0x1a2)]('\x0a'+_0x5cf193+'\x20('+_0x30af79+_0x23ec03(0x14f)+_0x301742[_0x23ec03(0x17d)][_0x23ec03(0x24d)]+_0x23ec03(0x174)),_0x2ef58e[_0x23ec03(0x1a2)](formatValidationResult(_0x301742,_0x3a8187,_0x5cf193));}return _0x2ef58e[_0x23ec03(0x197)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x36c494){const _0x5768cb=a152_0x32dbf6,_0x1d88e5=new Set(),_0x4e2b7c=new Map(),_0x54232f=collectSegmentUsageCounts(_0x36c494);if(_0x36c494[_0x5768cb(0x175)])for(const [_0x2e61b2,_0x206d98]of Object['entries'](_0x36c494[_0x5768cb(0x175)])){_0x1d88e5[_0x5768cb(0x1c1)](_0x2e61b2);if(_0x206d98[_0x5768cb(0x195)]){const _0x3e3e37=yamlRuleToApi(_0x206d98['rule']),_0x11ec16=apiRuleToYaml(_0x3e3e37);_0x4e2b7c[_0x5768cb(0x20a)](_0x2e61b2,_0x11ec16);}}const _0x4a3a73=new Map();let _0x5242d5=0x0;for(const [_0x366790,_0x140e5f]of _0x4e2b7c){const _0x387911=serializeExpandedRule(_0x140e5f,_0x4e2b7c),_0x1d2aa0=_0x4a3a73[_0x5768cb(0x162)](_0x387911)||[];_0x1d2aa0[_0x5768cb(0x1a2)]({'name':_0x366790,'index':_0x5242d5}),_0x4a3a73[_0x5768cb(0x20a)](_0x387911,_0x1d2aa0),_0x5242d5++;}const _0x290123=new Map();for(const [_0xf4723a,_0x8f68fd]of _0x4a3a73){const _0xfa6479=_0x8f68fd[_0x5768cb(0x223)]()[_0x5768cb(0x1a7)]((_0x2850af,_0x341973)=>{const _0x507ce1=_0x5768cb,_0x239289=_0x54232f['get'](_0x2850af['name'])||0x0,_0x3fac9a=_0x54232f[_0x507ce1(0x162)](_0x341973[_0x507ce1(0x1de)])||0x0;if(_0x239289!==_0x3fac9a)return _0x3fac9a-_0x239289;return _0x2850af[_0x507ce1(0x15a)]-_0x341973[_0x507ce1(0x15a)];})[_0x5768cb(0x189)](_0x1ff9a1=>_0x1ff9a1[_0x5768cb(0x1de)]),_0x4a07df=[];for(const _0x4af1ef of _0xfa6479){const _0x497eca=_0x54232f[_0x5768cb(0x162)](_0x4af1ef)||0x0,_0x5f1aea=Math['max'](_0x497eca,0x1);for(let _0x474e29=0x0;_0x474e29<_0x5f1aea;_0x474e29++){_0x4a07df[_0x5768cb(0x1a2)](_0x4af1ef);}}_0x290123[_0x5768cb(0x20a)](_0xf4723a,_0x4a07df);}return{'existingLocalSegmentNames':_0x1d88e5,'localSegmentRules':_0x4e2b7c,'localExpandedRuleToNames':_0x290123};}export function createSegmentIdResolver(_0x393674,_0x36c2d7){return async _0x1974e0=>{const _0x6781cb=a152_0x13c2,_0x5e92fa=_0x393674['get'](_0x1974e0);if(!_0x5e92fa)throw new SDKError(ErrorCode[_0x6781cb(0x249)],_0x6781cb(0x1ab)+_0x1974e0+'\x20(referenced\x20in\x20embedded\x20segment\x20\x27'+_0x36c2d7+'\x27)');return _0x5e92fa;};}export function extractRootFolderId(_0x587ffb){const _0x4bcef1=a152_0x32dbf6;return _0x587ffb[_0x4bcef1(0x181)]?.[_0x4bcef1(0x182)]?.[_0x4bcef1(0x20f)]?.['id']||_0x587ffb[_0x4bcef1(0x181)]?.[_0x4bcef1(0x1c8)]?.[_0x4bcef1(0x20f)]?.['id'];}export function buildConnectionMaps(_0x3361a1){const _0x2e46f6=a152_0x32dbf6,_0x2761d4=new Map(),_0x4ff7cc=new Map(),_0xd348d9=new Map();for(const _0x5738e of _0x3361a1){_0x2761d4[_0x2e46f6(0x20a)](_0x5738e[_0x2e46f6(0x1de)],parseInt(_0x5738e['id'],0xa)),_0x4ff7cc['set'](_0x5738e['id'],_0x5738e['name']),_0xd348d9[_0x2e46f6(0x20a)](_0x5738e[_0x2e46f6(0x1de)],_0x5738e['type']);}return{'nameToId':_0x2761d4,'idToName':_0x4ff7cc,'nameToType':_0xd348d9};}export function calculatePushStats(_0x1bba01,_0xebb439,_0x17605b,_0x28c6cd,_0x2af139,_0x77fc07,_0x56cfd8){const _0x1c4f1c=a152_0x32dbf6,_0x4294d6=_0x1bba01[_0x1c4f1c(0x18c)](_0x20c8af=>_0x20c8af['isNew']),_0x492788=_0x1bba01[_0x1c4f1c(0x18c)](_0x577292=>!_0x577292[_0x1c4f1c(0x22f)]&&_0x577292['hasChanges']),_0xa55aed=_0x1bba01[_0x1c4f1c(0x18c)](_0x320796=>!_0x320796['isNew']&&!_0x320796[_0x1c4f1c(0x1c2)]),_0x477561=_0x77fc07?_0x28c6cd:[],_0x2df384=_0xebb439[_0x1c4f1c(0x18c)](_0x3a008d=>_0x3a008d[_0x1c4f1c(0x22f)]),_0x4bdb19=_0xebb439[_0x1c4f1c(0x18c)](_0x18e816=>!_0x18e816[_0x1c4f1c(0x22f)]&&_0x18e816[_0x1c4f1c(0x1c2)]),_0x38477c=_0xebb439[_0x1c4f1c(0x18c)](_0x44e10c=>!_0x44e10c[_0x1c4f1c(0x22f)]&&!_0x44e10c[_0x1c4f1c(0x1c2)]),_0x5926a8=_0x77fc07?_0x2af139:[],_0x87f706=_0x1bba01[_0x1c4f1c(0x152)](_0x4f3f1a=>_0x4f3f1a[_0x1c4f1c(0x14b)]),_0x1aa298=_0x87f706[_0x1c4f1c(0x18c)](_0x12d09b=>_0x12d09b[_0x1c4f1c(0x187)]==='create'),_0x4f3bf2=_0x87f706[_0x1c4f1c(0x18c)](_0x2a0338=>_0x2a0338['type']===_0x1c4f1c(0x166)),_0x20e069=_0x87f706[_0x1c4f1c(0x18c)](_0x590354=>_0x590354['type']===_0x1c4f1c(0x1a9)),_0x432739=Array['from'](_0x17605b)[_0x1c4f1c(0x1a7)](),_0x3ad0e6=_0x56cfd8?![]:_0x4294d6[_0x1c4f1c(0x24d)]>0x0||_0x492788['length']>0x0||_0x477561[_0x1c4f1c(0x24d)]>0x0,_0x353752=_0x2df384['length']>0x0||_0x4bdb19[_0x1c4f1c(0x24d)]>0x0||_0x5926a8[_0x1c4f1c(0x24d)]>0x0,_0x11e56f=_0x56cfd8?![]:_0x87f706[_0x1c4f1c(0x24d)]>0x0,_0x42e0c3=_0x432739['length']>0x0;return{'segments':{'new':_0x4294d6,'changed':_0x492788,'unchanged':_0xa55aed,'toDelete':_0x477561},'journeys':{'new':_0x2df384,'changed':_0x4bdb19,'unchanged':_0x38477c,'toDelete':_0x5926a8},'activations':{'all':_0x87f706,'toCreate':_0x1aa298,'toUpdate':_0x4f3bf2,'toDelete':_0x20e069},'folders':{'toCreate':_0x432739},'counts':{'segments':{'new':_0x4294d6[_0x1c4f1c(0x24d)],'changed':_0x492788[_0x1c4f1c(0x24d)],'unchanged':_0xa55aed[_0x1c4f1c(0x24d)],'toDelete':_0x477561[_0x1c4f1c(0x24d)]},'journeys':{'new':_0x2df384[_0x1c4f1c(0x24d)],'changed':_0x4bdb19['length'],'unchanged':_0x38477c['length'],'toDelete':_0x5926a8[_0x1c4f1c(0x24d)]},'activations':{'create':_0x1aa298[_0x1c4f1c(0x24d)],'update':_0x4f3bf2[_0x1c4f1c(0x24d)],'delete':_0x20e069[_0x1c4f1c(0x24d)]},'folders':_0x432739['length']},'hasChanges':_0x3ad0e6||_0x353752||_0x11e56f||_0x42e0c3};}export async function buildPushExecutionContext(_0x35ea84,_0x453094,_0xe9ce0b,_0x39ba3a,_0x366ae4,_0x25b800){const _0x118f75=a152_0x32dbf6,_0x25da3f=extractRootFolderId(_0xe9ce0b),{pathToId:_0x5dc2af,idToPath:_0x237e4f}=buildFolderMaps(_0x366ae4),_0x3ccfbb=buildSegmentNameToIdMap(_0x39ba3a),_0x47868e=new Map(),{batchAsync:_0x452506}=await import('../../utils/async.js'),[_0x574b61,_0x36a5b3]=await Promise['all']([_0x35ea84['user']['buildUserMaps'](),_0x35ea84[_0x118f75(0x214)]['list'](),((async()=>{const _0x3cfe11=_0x118f75;!_0x25b800&&_0x39ba3a[_0x3cfe11(0x24d)]>0x0&&await _0x452506(_0x39ba3a,async _0x40bcf7=>{const _0x4bbe1e=_0x3cfe11,_0x52839a=await _0x35ea84['segment']['listActivations'](_0x453094,_0x40bcf7['id']);_0x47868e[_0x4bbe1e(0x20a)](_0x40bcf7['id'],_0x52839a);});})())]),{emailToId:_0x271929,idToEmail:_0x51b1cb}=_0x574b61,_0x463f8b=buildConnectionMaps(_0x36a5b3);return{'rootFolderId':_0x25da3f,'folderPathToId':_0x5dc2af,'folderIdToPath':_0x237e4f,'segmentNameToId':_0x3ccfbb,'activationsBySegmentId':_0x47868e,'emailToIdMap':_0x271929,'idToEmailMap':_0x51b1cb,'connectionNameToIdMap':_0x463f8b[_0x118f75(0x1d4)],'connectionIdToNameMap':_0x463f8b['idToName'],'connectionNameToTypeMap':_0x463f8b[_0x118f75(0x241)]};}export function createPushYamlContextForBundle(_0x1683fa,_0x4f54b1,_0x570ad8,_0x50ede4,_0x20b6fc,_0x56efe6,_0x56603f,_0x17e974){const {existingLocalSegmentNames:_0x53ef0b,localExpandedRuleToNames:_0x3fb97f}=_0x50ede4,_0x292db5=new Set(),_0xa41288=new Map(),_0x956ac=new Map(),_0x17d478=new Map(),_0x45dd48=createJumpTargetCache(),_0x269c3f=new Map(),_0x3910c1=new Map(),_0xd4dcd7=new Set();let _0x65399f;const _0x10de23=_0x4d778a=>{const _0xa8379d={'resolveSegment':async _0x19eb9e=>{const _0x261be3=a152_0x13c2,_0xd2dd57=_0x17d478[_0x261be3(0x162)](_0x19eb9e);if(_0xd2dd57!==undefined)return{'name':_0xd2dd57,'isJourneyLocal':!![]};try{const _0x20fb19=await fetchSegment(_0x1683fa,_0x4f54b1,_0x19eb9e,_0x570ad8);if(!_0x20fb19)throw new Error(_0x261be3(0x159));const _0x489bf4=generateJourneyLocalName(_0x20fb19['name']),_0x1d4301=_0x20fb19[_0x261be3(0x243)]===SEGMENT_KIND_JOURNEY&&_0x489bf4!==undefined;let _0x62c2d3=_0x20fb19[_0x261be3(0x1de)],_0xc2d38a;if(_0x1d4301&&_0x20fb19[_0x261be3(0x195)]){const _0x23195e=apiRuleToYaml(_0x20fb19[_0x261be3(0x195)]);_0x3910c1[_0x261be3(0x20a)](_0x19eb9e,_0x23195e);const _0x50e17a=async _0x260595=>{const _0x2f1b81=_0x261be3,_0x56c993=collectSegmentRefsFromRule(_0x260595);for(const _0x4307f2 of _0x56c993){if(!_0x3910c1[_0x2f1b81(0x1a6)](_0x4307f2))try{const _0x109ebe=await fetchSegment(_0x1683fa,_0x4f54b1,_0x4307f2,_0x570ad8);if(_0x109ebe?.[_0x2f1b81(0x195)]){const _0x5b117d=apiRuleToYaml(_0x109ebe[_0x2f1b81(0x195)]);_0x3910c1[_0x2f1b81(0x20a)](_0x4307f2,_0x5b117d),await _0x50e17a(_0x5b117d);}}catch(_0x48aa78){logger['debug'](_0x2f1b81(0x228)+_0x4307f2+':\x20'+_0x48aa78);}}};await _0x50e17a(_0x23195e);const _0x23f3fe=serializeExpandedRule(_0x23195e,_0x3910c1),_0x2da367=_0x3fb97f[_0x261be3(0x162)](_0x23f3fe);if(_0x2da367&&_0x2da367['length']>0x0){const _0x25c4bb=_0xa41288[_0x261be3(0x162)](_0x23f3fe)||0x0,_0x3f366d=_0x2da367[_0x25c4bb]||_0x2da367[_0x2da367['length']-0x1];_0xa41288['set'](_0x23f3fe,_0x25c4bb+0x1),_0x62c2d3=_0x3f366d,_0x292db5[_0x261be3(0x1c1)](_0x62c2d3),_0x17d478['set'](_0x19eb9e,_0x62c2d3);const _0x35db11=await resolveRuleSegmentRefs(_0x23195e,async _0x509936=>{const _0x244466=_0x261be3,_0x5f4852=_0x17d478[_0x244466(0x162)](_0x509936);if(_0x5f4852)return _0x5f4852;const _0x1d40ad=await _0x65399f[_0x244466(0x191)](_0x509936);return _0x1d40ad[_0x244466(0x1de)];});_0xc2d38a={'description':_0x20fb19[_0x261be3(0x1d7)],'rule':_0x35db11};}else{const _0xa08885=_0x269c3f[_0x261be3(0x162)](_0x23f3fe);if(_0xa08885)_0x62c2d3=_0xa08885,_0x17d478['set'](_0x19eb9e,_0x62c2d3);else{if(_0x489bf4){let _0x1be920=_0x489bf4,_0x225514=0x2;while(_0x292db5[_0x261be3(0x1a6)](_0x1be920)||_0x53ef0b[_0x261be3(0x1a6)](_0x1be920)){_0x1be920=_0x489bf4+'_'+_0x225514,_0x225514++;}_0x292db5['add'](_0x1be920),_0x62c2d3=_0x1be920;}_0x17d478[_0x261be3(0x20a)](_0x19eb9e,_0x62c2d3),_0x269c3f['set'](_0x23f3fe,_0x62c2d3);const _0x26f639=await resolveRuleSegmentRefs(_0x23195e,async _0x46db30=>{const _0x382c6e=_0x261be3,_0x5bce9c=_0x17d478[_0x382c6e(0x162)](_0x46db30);if(_0x5bce9c)return _0x5bce9c;const _0x3469fe=await _0x65399f[_0x382c6e(0x191)](_0x46db30);return _0x3469fe[_0x382c6e(0x1de)];});_0xc2d38a={'description':_0x20fb19[_0x261be3(0x1d7)],'rule':_0x26f639};}}}return{'name':_0x62c2d3,'isJourneyLocal':_0x1d4301,'definition':_0xc2d38a};}catch(_0x3f2a59){return logger[_0x261be3(0x21e)](_0x261be3(0x23c)+_0x19eb9e+':\x20'+_0x3f2a59),{'name':_0x19eb9e,'isJourneyLocal':![]};}},'resolveActivation':async _0x53b18e=>{const _0x5b2cec=a152_0x13c2,_0x41f57a=_0x956ac['get'](_0x53b18e);if(_0x41f57a!==undefined)return{'name':_0x41f57a,'isJourneyLocal':!![]};try{let _0x474ae7=_0x56603f?.['get'](_0x53b18e);!_0x474ae7&&(_0x474ae7=await _0x1683fa[_0x5b2cec(0x1c3)]['getActivation'](_0x4d778a,_0x53b18e));const _0x233e5b=_0x474ae7['attributes'][_0x5b2cec(0x185)][_0x5b2cec(0x1de)]||_0x53b18e,_0x1c7937=sanitizeYamlKey(_0x233e5b)||_0x5b2cec(0x17a)+_0x53b18e,_0x416e15=_0x1c7937;_0x956ac['set'](_0x53b18e,_0x416e15);const _0x468f76=journeyActivationStepToYaml(_0x474ae7,_0x20b6fc,_0x56efe6);return{'name':_0x416e15,'isJourneyLocal':!![],'definition':_0x468f76};}catch(_0x3acee5){return logger[_0x5b2cec(0x21e)]('Failed\x20to\x20resolve\x20activation\x20'+_0x53b18e+':\x20'+_0x3acee5),{'name':_0x53b18e,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x128f91,_0x2da0b6)=>resolveJumpTarget(_0x128f91,_0x2da0b6,_0x45dd48,async _0x60c5a0=>{const _0x5b8aec=a152_0x13c2,_0x253c18=_0x17e974?.[_0x5b8aec(0x162)](_0x60c5a0);if(_0x253c18)return _0x253c18;return _0x1683fa[_0x5b8aec(0x1c3)][_0x5b8aec(0x232)](_0x60c5a0);})};return _0x65399f=_0xa8379d,_0xa8379d;},_0x4c10f8=async _0x479453=>{const _0x5919ee=a152_0x13c2,{collectSegmentIdsFromJourneyApi:_0xdd41c3}=await import(_0x5919ee(0x171)),{batchAsync:_0x1880d5}=await import(_0x5919ee(0x180)),_0x1f4228=new Set();for(const _0x468bfe of _0x479453){let _0xfa7f9c=_0x17e974?.[_0x5919ee(0x162)](_0x468bfe);!_0xfa7f9c&&(_0xfa7f9c=await _0x1683fa[_0x5919ee(0x1c3)][_0x5919ee(0x232)](_0x468bfe));const _0x55e665=_0xdd41c3(_0xfa7f9c);for(const _0x470a39 of _0x55e665){_0x1f4228[_0x5919ee(0x1c1)](_0x470a39);}}let _0x21e93a=Array[_0x5919ee(0x230)](_0x1f4228);while(_0x21e93a['length']>0x0){const _0x30d59d=_0x21e93a[_0x5919ee(0x18c)](_0x2cf22a=>!_0xd4dcd7[_0x5919ee(0x1a6)](_0x2cf22a));if(_0x30d59d['length']===0x0)break;const _0x2ace2a=await _0x1880d5(_0x30d59d,async _0x34561e=>{const _0x39612f=_0x5919ee;_0xd4dcd7[_0x39612f(0x1c1)](_0x34561e);const _0x29fe17=await fetchSegment(_0x1683fa,_0x4f54b1,_0x34561e,_0x570ad8);if(!_0x29fe17)return null;return{'segmentId':_0x34561e,'segment':_0x29fe17};},0xa),_0x5d59c3=new Set();for(const _0x74e20 of _0x2ace2a){if(!_0x74e20?.['segment']?.[_0x5919ee(0x195)])continue;const _0x207cf2=apiRuleToYaml(_0x74e20[_0x5919ee(0x196)][_0x5919ee(0x195)]);_0x3910c1[_0x5919ee(0x20a)](_0x74e20[_0x5919ee(0x15e)],_0x207cf2);const _0xa3e71d=collectSegmentRefsFromRule(_0x207cf2);for(const _0x215ccc of _0xa3e71d){!_0xd4dcd7[_0x5919ee(0x1a6)](_0x215ccc)&&_0x5d59c3[_0x5919ee(0x1c1)](_0x215ccc);}}_0x21e93a=Array['from'](_0x5d59c3);}};return{'createYamlContext':_0x10de23,'prefetchJourneySegments':_0x4c10f8};}export async function executePushSegments(_0x2700fe,_0xba8d1,_0x53b62e,_0x227b84,_0x4869d8){const _0xcc4da8=a152_0x32dbf6,{segmentDefToCreateRequest:_0x272c1a,segmentDefToUpdateRequest:_0x82ce6b}=await import('./child-segment-yaml.js'),_0x1eebd7=_0x53b62e['folderPathToId'],_0x2de08e=0x5,_0x451356=async _0x49b1df=>{const _0x1c1b21=a152_0x13c2,_0x37a2f2=_0x49b1df[_0x1c1b21(0x237)]?_0x1eebd7[_0x1c1b21(0x162)](_0x49b1df[_0x1c1b21(0x237)]):undefined;let _0x1668d3;const _0x3f51f2={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0xcc77ae=_0x49b1df[_0x1c1b21(0x154)];if(_0x49b1df[_0x1c1b21(0x154)]['rule']){const _0x12d548=createSegmentIdResolver(_0x53b62e['segmentNameToId'],_0x49b1df[_0x1c1b21(0x154)][_0x1c1b21(0x1de)]),_0x447af9=await resolveRuleSegmentIds(_0x49b1df[_0x1c1b21(0x154)][_0x1c1b21(0x195)],_0x12d548);_0xcc77ae={..._0x49b1df[_0x1c1b21(0x154)],'rule':_0x447af9};}try{if(_0x49b1df[_0x1c1b21(0x22f)]){_0x4869d8[_0x1c1b21(0x1da)]?.({'type':_0x1c1b21(0x15d),'name':_0x49b1df['yamlConfig'][_0x1c1b21(0x1de)]});const _0x11c956=_0x272c1a(_0xcc77ae,_0x37a2f2),_0x1f0b70=await _0x4869d8[_0x1c1b21(0x150)](_0x1c1b21(0x1af)+_0x49b1df[_0x1c1b21(0x154)]['name']+_0x1c1b21(0x18e),()=>_0x2700fe[_0x1c1b21(0x196)][_0x1c1b21(0x222)](_0x227b84[_0x1c1b21(0x1fd)],_0x11c956));_0x1668d3=_0x1f0b70[_0x1c1b21(0x20f)]['id'],_0x53b62e[_0x1c1b21(0x212)][_0x1c1b21(0x20a)](_0x49b1df[_0x1c1b21(0x154)][_0x1c1b21(0x1de)],_0x1668d3),_0x3f51f2[_0x1c1b21(0x1e8)]={'name':_0x49b1df[_0x1c1b21(0x154)][_0x1c1b21(0x1de)],'id':_0x1668d3},_0x4869d8['onProgress']?.({'type':_0x1c1b21(0x186),'name':_0x49b1df[_0x1c1b21(0x154)][_0x1c1b21(0x1de)],'segmentId':_0x1668d3}),_0x4869d8[_0x1c1b21(0x18b)]?.(_0x1c1b21(0x1f9)+_0x49b1df[_0x1c1b21(0x154)][_0x1c1b21(0x1de)]+'\x27'),_0x3f51f2[_0x1c1b21(0x1a5)]=0x1;}else{if(_0x49b1df[_0x1c1b21(0x1c2)]){_0x4869d8['onProgress']?.({'type':_0x1c1b21(0x1c5),'name':_0x49b1df[_0x1c1b21(0x154)][_0x1c1b21(0x1de)]});const _0x2fb742=_0x82ce6b(_0xcc77ae);_0x37a2f2!==_0x49b1df[_0x1c1b21(0x19b)]?.[_0x1c1b21(0x1ac)]&&(_0x2fb742['segmentFolderId']=_0x37a2f2?parseInt(_0x37a2f2,0xa):undefined),await _0x4869d8[_0x1c1b21(0x150)](_0x1c1b21(0x15b)+_0x49b1df[_0x1c1b21(0x154)][_0x1c1b21(0x1de)]+_0x1c1b21(0x18e),()=>_0x2700fe[_0x1c1b21(0x196)][_0x1c1b21(0x1d6)](_0x227b84['parentId'],_0x49b1df[_0x1c1b21(0x19b)]['id'],_0x2fb742)),_0x1668d3=_0x49b1df['existingSegment']['id'],_0x4869d8[_0x1c1b21(0x1da)]?.({'type':_0x1c1b21(0x246),'name':_0x49b1df['yamlConfig'][_0x1c1b21(0x1de)]}),_0x4869d8[_0x1c1b21(0x18b)]?.('Updated\x20segment\x20\x27'+_0x49b1df[_0x1c1b21(0x154)][_0x1c1b21(0x1de)]+'\x27'),_0x3f51f2[_0x1c1b21(0x1b9)]=0x1;}else _0x1668d3=_0x49b1df[_0x1c1b21(0x19b)]['id'];}}catch(_0x388942){const _0x629179=isHttp400Error(_0x388942),_0x4fc9ef=_0x629179?ErrorCode[_0x1c1b21(0x161)]:ErrorCode[_0x1c1b21(0x205)],_0x123ed9=getErrorMessage(_0x388942);throw new SDKError(_0x4fc9ef,'Failed\x20to\x20'+(_0x49b1df[_0x1c1b21(0x22f)]?_0x1c1b21(0x1d9):'update')+_0x1c1b21(0x1ad)+_0x49b1df[_0x1c1b21(0x160)]+'\x0a\x20\x20'+_0x123ed9,_0x388942);}try{const _0x2754ce=await syncActivationsForSegment(_0x2700fe,_0x227b84['parentId'],_0x1668d3,_0x49b1df['yamlConfig'][_0x1c1b21(0x1de)],_0x49b1df[_0x1c1b21(0x14b)],_0x4869d8,_0x49b1df[_0x1c1b21(0x160)]);_0x3f51f2['activations']=_0x2754ce;}catch(_0x45bbd4){if(_0x45bbd4 instanceof SDKError)throw _0x45bbd4;throw new SDKError(ErrorCode[_0x1c1b21(0x239)],_0x1c1b21(0x1b4)+_0x49b1df[_0x1c1b21(0x154)]['name']+'\x27\x20from\x20file:\x20'+_0x49b1df[_0x1c1b21(0x160)]+'\x0a\x20\x20'+getErrorMessage(_0x45bbd4),_0x45bbd4);}return _0x3f51f2;},_0x3094b1=await batchAsync(_0xba8d1,_0x451356,_0x2de08e),_0x3dcdfe={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x31deca of _0x3094b1){_0x3dcdfe['created']+=_0x31deca['created'],_0x3dcdfe[_0xcc4da8(0x1b9)]+=_0x31deca[_0xcc4da8(0x1b9)],_0x31deca[_0xcc4da8(0x1e8)]&&_0x3dcdfe['createdSegmentIds']['set'](_0x31deca[_0xcc4da8(0x1e8)][_0xcc4da8(0x1de)],_0x31deca[_0xcc4da8(0x1e8)]['id']),_0x3dcdfe[_0xcc4da8(0x169)]['created']+=_0x31deca[_0xcc4da8(0x169)][_0xcc4da8(0x1a5)],_0x3dcdfe['activations']['updated']+=_0x31deca[_0xcc4da8(0x169)][_0xcc4da8(0x1b9)],_0x3dcdfe[_0xcc4da8(0x169)][_0xcc4da8(0x1b0)]+=_0x31deca['activations'][_0xcc4da8(0x1b0)];}return _0x3dcdfe;}async function syncActivationsForSegment(_0xf11400,_0x578ae8,_0x255c44,_0x54640e,_0x12c2ed,_0x28417b,_0x2119ba){const _0x532b45=a152_0x32dbf6,_0x6a977a={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x1f98ee of _0x12c2ed){try{if(_0x1f98ee[_0x532b45(0x187)]===_0x532b45(0x1d9)&&_0x1f98ee[_0x532b45(0x1fb)])_0x28417b['onProgress']?.({'type':'activation_creating','segmentName':_0x54640e,'activationName':_0x1f98ee[_0x532b45(0x1de)]}),await _0x28417b[_0x532b45(0x150)](_0x532b45(0x15f)+_0x1f98ee[_0x532b45(0x1de)]+_0x532b45(0x18e),()=>_0xf11400['segment'][_0x532b45(0x14d)](_0x578ae8,_0x255c44,_0x1f98ee[_0x532b45(0x1fb)])),_0x28417b['onProgress']?.({'type':_0x532b45(0x236),'segmentName':_0x54640e,'activationName':_0x1f98ee[_0x532b45(0x1de)]}),_0x28417b[_0x532b45(0x18b)]?.('Created\x20activation\x20\x27'+_0x1f98ee['name']+'\x27'),_0x6a977a[_0x532b45(0x1a5)]++;else{if(_0x1f98ee['type']==='update'&&_0x1f98ee[_0x532b45(0x1fb)]&&_0x1f98ee[_0x532b45(0x158)])_0x28417b[_0x532b45(0x1da)]?.({'type':'activation_updating','segmentName':_0x54640e,'activationName':_0x1f98ee[_0x532b45(0x1de)]}),await _0x28417b[_0x532b45(0x150)](_0x532b45(0x173)+_0x1f98ee['name']+_0x532b45(0x18e),()=>_0xf11400['segment'][_0x532b45(0x1aa)](_0x578ae8,_0x255c44,_0x1f98ee[_0x532b45(0x158)]['id'],_0x1f98ee[_0x532b45(0x1fb)])),_0x28417b[_0x532b45(0x1da)]?.({'type':_0x532b45(0x24b),'segmentName':_0x54640e,'activationName':_0x1f98ee[_0x532b45(0x1de)]}),_0x28417b[_0x532b45(0x18b)]?.(_0x532b45(0x1f0)+_0x1f98ee['name']+'\x27'),_0x6a977a[_0x532b45(0x1b9)]++;else _0x1f98ee['type']===_0x532b45(0x1a9)&&_0x1f98ee[_0x532b45(0x158)]&&(_0x28417b[_0x532b45(0x1da)]?.({'type':_0x532b45(0x1c9),'segmentName':_0x54640e,'activationName':_0x1f98ee[_0x532b45(0x1de)]}),await _0x28417b[_0x532b45(0x150)](_0x532b45(0x221)+_0x1f98ee[_0x532b45(0x1de)]+_0x532b45(0x18e),()=>_0xf11400[_0x532b45(0x196)][_0x532b45(0x1dc)](_0x578ae8,_0x255c44,_0x1f98ee[_0x532b45(0x158)]['id'])),_0x28417b[_0x532b45(0x1da)]?.({'type':_0x532b45(0x219),'segmentName':_0x54640e,'activationName':_0x1f98ee[_0x532b45(0x1de)]}),_0x28417b[_0x532b45(0x1df)]?.(_0x532b45(0x1f5)+_0x1f98ee['name']+'\x27'),_0x6a977a[_0x532b45(0x1b0)]++);}}catch(_0x681c67){const _0x2c5880=isHttp400Error(_0x681c67),_0x2c3c72=_0x2c5880?ErrorCode[_0x532b45(0x1b1)]:ErrorCode[_0x532b45(0x239)],_0x4abd5b=getErrorMessage(_0x681c67);throw new SDKError(_0x2c3c72,_0x532b45(0x23e)+_0x1f98ee['type']+_0x532b45(0x177)+_0x1f98ee['name']+'\x27\x20from\x20file:\x20'+_0x2119ba+_0x532b45(0x172)+_0x4abd5b,_0x681c67);}}return _0x6a977a;}export async function executePushFolders(_0x330548,_0x150109,_0xf366c4,_0x170341,_0x5bfc14){const _0x711e3e=a152_0x32dbf6,_0x56540d=new Map(_0xf366c4),_0x39002f=sortFoldersByDepth(_0x150109);for(const _0x4fe15b of _0x39002f){const _0x36e453=_0x4fe15b[_0x711e3e(0x1e6)]('/'),_0x1e8187=_0x36e453[_0x36e453['length']-0x1],_0x464db1=_0x36e453[_0x711e3e(0x223)](0x0,-0x1)[_0x711e3e(0x197)]('/'),_0x417864=_0x56540d[_0x711e3e(0x162)](_0x464db1);_0x5bfc14[_0x711e3e(0x1da)]?.({'type':_0x711e3e(0x24e),'folder':_0x4fe15b});const _0x37027b={'name':_0x1e8187,'parentFolderId':_0x417864},_0x5ad411=await _0x5bfc14[_0x711e3e(0x150)](_0x711e3e(0x156)+_0x4fe15b+_0x711e3e(0x18e),()=>_0x330548['segment'][_0x711e3e(0x210)](_0x170341[_0x711e3e(0x1fd)],_0x37027b));_0x56540d[_0x711e3e(0x20a)](_0x4fe15b,_0x5ad411[_0x711e3e(0x20f)]['id']),_0x5bfc14[_0x711e3e(0x1da)]?.({'type':_0x711e3e(0x153),'folder':_0x4fe15b,'folderId':_0x5ad411[_0x711e3e(0x20f)]['id']}),_0x5bfc14[_0x711e3e(0x21c)]?.(_0x711e3e(0x1ea)+_0x4fe15b+'\x27');}return _0x56540d;}export async function executePushSegmentDeletions(_0x58b575,_0xe7738e,_0x539f99){const _0x20a7ed=a152_0x32dbf6;if(_0xe7738e[_0x20a7ed(0x24d)]===0x0)return 0x0;const {batchAsync:_0x30ed91}=await import(_0x20a7ed(0x180)),_0x37451e=0x5,_0x499a52=await _0x30ed91(_0xe7738e,async _0x2c0185=>{const _0x172870=_0x20a7ed;return _0x539f99['onProgress']?.({'type':_0x172870(0x1fe),'name':_0x2c0185[_0x172870(0x1de)]}),await _0x58b575[_0x172870(0x196)][_0x172870(0x1d0)](_0x2c0185['id']),_0x539f99[_0x172870(0x1da)]?.({'type':_0x172870(0x1cb),'name':_0x2c0185[_0x172870(0x1de)]}),_0x539f99[_0x172870(0x1df)]?.(_0x172870(0x227)+_0x2c0185[_0x172870(0x1de)]+'\x27'),0x1;},_0x37451e);return _0x499a52[_0x20a7ed(0x1ee)]((_0x58e842,_0x1cf218)=>_0x58e842+_0x1cf218,0x0);}export async function executePushJourneys(_0x5a98d9,_0x51647e,_0x1c8144,_0x285749,_0x5056b9){const _0x5c7385=a152_0x32dbf6,{journeyDefToRequest:_0x3c0262}=await import(_0x5c7385(0x171)),{activationDefToCreateRequest:_0x10729f,yamlRuleToApi:_0x552eef,validateSegmentRule:_0x4af711}=await import('./child-segment-yaml.js'),_0x1e7fa0={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x1e2fe2=new Map(_0x1c8144['segmentNameToId']),_0x522318=0x5;for(let _0x1a81c2=0x0;_0x1a81c2<_0x51647e[_0x5c7385(0x24d)];_0x1a81c2+=_0x522318){const _0x5d1bc4=_0x51647e[_0x5c7385(0x223)](_0x1a81c2,_0x1a81c2+_0x522318),_0x3ecc54=await Promise[_0x5c7385(0x1b6)](_0x5d1bc4[_0x5c7385(0x189)](async _0x41f425=>{const _0x9d6ab3=_0x5c7385;if(!_0x41f425[_0x9d6ab3(0x22f)]&&!_0x41f425['hasChanges'])return{'action':_0x9d6ab3(0x16e),'name':_0x41f425[_0x9d6ab3(0x154)][_0x9d6ab3(0x1de)],'journeyId':_0x41f425[_0x9d6ab3(0x1f4)]?.['id']};const _0x12549c=_0x41f425[_0x9d6ab3(0x237)]?_0x1c8144[_0x9d6ab3(0x192)]['get'](_0x41f425[_0x9d6ab3(0x237)]):undefined;_0x5056b9[_0x9d6ab3(0x1da)]?.({'type':_0x41f425[_0x9d6ab3(0x22f)]?_0x9d6ab3(0x184):'journey_updating','name':_0x41f425[_0x9d6ab3(0x154)][_0x9d6ab3(0x1de)]});try{const _0x31cc3c=await executeSingleJourneyPush(_0x5a98d9,_0x41f425,{..._0x1c8144,'segmentNameToId':_0x1e2fe2},{'parentId':_0x285749[_0x9d6ab3(0x1fd)],'rootFolderId':_0x285749['rootFolderId'],'folderId':_0x12549c,'verbose':_0x285749[_0x9d6ab3(0x14c)]},_0x5056b9,{'journeyDefToRequest':_0x3c0262,'activationDefToCreateRequest':_0x10729f,'yamlRuleToApi':_0x552eef,'validateSegmentRule':_0x4af711});for(const [_0x5ee115,_0x24ea24]of _0x31cc3c[_0x9d6ab3(0x21a)]){_0x1e2fe2[_0x9d6ab3(0x20a)](_0x5ee115,_0x24ea24),_0x1e7fa0[_0x9d6ab3(0x21a)][_0x9d6ab3(0x20a)](_0x5ee115,_0x24ea24);}if(_0x31cc3c[_0x9d6ab3(0x242)]===_0x9d6ab3(0x1a5))_0x5056b9[_0x9d6ab3(0x1da)]?.({'type':_0x9d6ab3(0x1fa),'name':_0x41f425['yamlConfig']['name'],'journeyId':_0x31cc3c['journeyId']}),_0x5056b9[_0x9d6ab3(0x18b)]?.(_0x9d6ab3(0x165)+_0x41f425[_0x9d6ab3(0x154)][_0x9d6ab3(0x1de)]+'\x27'),_0x1e7fa0[_0x9d6ab3(0x1a5)]++;else _0x31cc3c[_0x9d6ab3(0x242)]===_0x9d6ab3(0x1b9)&&(_0x5056b9[_0x9d6ab3(0x1da)]?.({'type':_0x9d6ab3(0x157),'name':_0x41f425['yamlConfig'][_0x9d6ab3(0x1de)]}),_0x5056b9['logSuccess']?.(_0x9d6ab3(0x225)+_0x41f425['yamlConfig']['name']+'\x27'),_0x1e7fa0['updated']++);return{'action':_0x31cc3c[_0x9d6ab3(0x242)],'name':_0x41f425['yamlConfig'][_0x9d6ab3(0x1de)],'journeyId':_0x31cc3c[_0x9d6ab3(0x244)]};}catch(_0x517670){const _0x114e4d=isHttp400Error(_0x517670),_0x599b31=_0x114e4d?ErrorCode['JOURNEY_SYNTAX_ERROR']:ErrorCode['JOURNEY_UPDATE_ERROR'],_0x1a95de=getErrorMessage(_0x517670);throw new SDKError(_0x599b31,'Failed\x20to\x20'+(_0x41f425[_0x9d6ab3(0x22f)]?_0x9d6ab3(0x1d9):_0x9d6ab3(0x166))+_0x9d6ab3(0x1ae)+_0x41f425[_0x9d6ab3(0x160)]+_0x9d6ab3(0x172)+_0x1a95de,_0x517670);}}));_0x1e7fa0['results'][_0x5c7385(0x1a2)](..._0x3ecc54);}return _0x1e7fa0;}function a152_0x5e75(){const _0x55c04f=['entries','logInfo','Entry\x20criteria:\x20','debug','keys','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','Deleting\x20activation\x20\x27','createSegment','slice','./child-segment-yaml.js','Updated\x20journey\x20\x27','values','Deleted\x20segment\x20\x27','Failed\x20to\x20fetch\x20referenced\x20segment\x20','\x27\x20entry\x20criteria','waitStepType','folderId','\x27\x20exit\x20criteria','\x20(referenced\x20in\x20journey\x20','activationsBySegmentId','isNew','from','logWarning','getJourney','entryCriteria','Journey\x20\x27','behavior','activation_created','folderPath','activationContext','ACTIVATION_UPDATE_ERROR','branches','day','Failed\x20to\x20resolve\x20segment\x20','connectionIdToNameMap','Failed\x20to\x20','\x27\x20wait\x20condition','valid','nameToType','action','kind','journeyId','24XZqDdI','segment_updated','parse','rootFolderId','SEGMENT_NOT_FOUND','NOT_FOUND','activation_updated','2859288XdYAgY','length','folder_creating','journeyBundlesByFolderAndName','__pending_act_','notification','activationActions','verbose','createActivation','__pending_','):\x20','withProgress','stringify','flatMap','folder_created','yamlConfig','goal','Creating\x20folder\x20\x27','journey_updated','existingActivation','Segment\x20not\x20found','index','Updating\x20segment\x20\x27','conditionTimeoutUnit','segment_creating','segmentId','Creating\x20activation\x20\x27','absolutePath','SEGMENT_SYNTAX_ERROR','get','message','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','Created\x20journey\x20\x27','update','columns','133782Xhqcbt','activations','waitStepUnit','some','toISOString','journeys','unchanged','embedded_activation_creating','toLowerCase','./journey-yaml.js','\x0a\x20\x20','Updating\x20activation\x20\x27','\x20error(s)','segments','4097355KgzfQz','\x20activation\x20\x27','object','startsWith','activation_','diff','connector_config','errors','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','Activation','../../utils/async.js','relationships','parentSegmentFolder','trim','journey_creating','activationParams','segment_created','type','uniqueSegmentName','map','Duration','logSuccess','filter','journeyActivationStepId','\x27...','steps','match','resolveSegment','folderPathToId','conditionSegmentId','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','rule','segment','join','2300TXMFNY','idToEmailMap','toString','existingSegment','Fetching\x20','1746378yBESkw','journeyStages','parseDocument','find','skipSegments','push','6XPPxKv','33704YefAzy','created','has','sort','uniqueServerName','delete','updateActivation','Segment\x20not\x20found:\x20','segmentFolderId','\x20segment\x20from\x20file:\x20','\x20journey\x20from\x20file:\x20','Creating\x20segment\x20\x27','deleted','ACTIVATION_SYNTAX_ERROR','segmentByFolderAndName','resolvedRule','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','journeyBundleName','all','getSegment','existingSegments','updated','WaitStep','Stage\x20\x27','createJourneySegment','milestone','localName','decision_point','journeyBundleId','add','hasChanges','journey','relative','segment_updating','\x27\x20for\x20','\x27\x20to\x20local\x20\x27','parentFolder','activation_deleting','getLatestJourneyId','segment_deleted','embedded_segment_created','versionNumber','\x27\x20not\x20found\x20in\x20journey\x20\x27','activation_template_id','deleteSegment','includes','INTERNAL','Activation\x20not\x20found:\x20','nameToId','journeyActivationNameToId','updateSegmentById','description','entry_criteria','create','onProgress','336885pQoInl','deleteActivation',').\x20','name','logDeleted','getSegmentEntity','state','Condition','progress','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','item','split',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','createdSegmentId','conditionTimeoutDuration','Created\x20folder\x20\x27','waitStep','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','resolveJourneyId','reduce','Embedded\x20segment\x20\x27','Updated\x20activation\x20\x27','\x27\x20by\x20rule\x20content','1506120PewSNf','all_columns','existingJourney','Deleted\x20activation\x20\x27','exitCriterias','isArray','Delete\x20the\x20push\x20recovery\x20file\x20(','Created\x20segment\x20\x27','journey_created','validatedRequest','journeyById','parentId','segment_deleting','getSegmentEntity\x20also\x20failed\x20for\x20','conditions','deps','replace','yamlActivation','8wjdRtU','SEGMENT_UPDATE_ERROR','getSegment\x20failed\x20for\x20','stage\x20\x27','null','fetchJourney','set','utf-8','embedded_segment_creating','attributes','goal\x20criteria','data','createFolder','stages','segmentNameToId','\x27\x20decision\x20point\x20branch\x20\x27','connection','Matched\x20server\x20segment\x20\x27','journeyName','.$1.push-recovery.json','listActivations','activation_deleted','embeddedSegmentNameToId'];a152_0x5e75=function(){return _0x55c04f;};return a152_0x5e75();}async function matchExistingJourneySegments(_0x57046a,_0x10d4c3,_0x2572d6,_0x40a6a7,_0x5689af){const _0x7c1553=a152_0x32dbf6;if(!_0x10d4c3['existingJourney']||!_0x10d4c3['yamlConfig'][_0x7c1553(0x175)])return;const _0x37b736=new Map(),_0x45368e=new Set();for(const _0x9f800 of Object[_0x7c1553(0x21f)](_0x10d4c3[_0x7c1553(0x154)][_0x7c1553(0x175)])){const _0x4254d7=generateDeterministicJourneySegmentName(_0x10d4c3['yamlConfig'][_0x7c1553(0x1de)],_0x9f800);_0x37b736['set'](_0x4254d7,_0x9f800),_0x45368e[_0x7c1553(0x1c1)](_0x9f800);}const _0x30a98c=[],_0x33bf39=collectSegmentIdsFromJourneyApi(_0x10d4c3[_0x7c1553(0x1f4)]);for(const _0x403013 of _0x33bf39){const _0x122771=await fetchSegment(_0x57046a,_0x2572d6,_0x403013,_0x40a6a7);if(!_0x122771?.[_0x7c1553(0x1de)])continue;const _0x4b0d0c=_0x37b736[_0x7c1553(0x162)](_0x122771[_0x7c1553(0x1de)]);_0x4b0d0c?(_0x5689af[_0x7c1553(0x20a)](_0x4b0d0c,_0x403013),_0x45368e[_0x7c1553(0x1a9)](_0x4b0d0c)):_0x30a98c[_0x7c1553(0x1a2)]({'id':_0x403013,'seg':_0x122771});}if(_0x45368e['size']>0x0&&_0x30a98c['length']>0x0){const {localExpandedRuleToNames:_0xb9e90b}=buildLocalExpandedRuleMappings(_0x10d4c3[_0x7c1553(0x154)]),_0x1b5c68=new Map();for(const {id:_0x89494,seg:_0x4fb910}of _0x30a98c){if(_0x4fb910['rule']){const _0x290be4=apiRuleToYaml(_0x4fb910[_0x7c1553(0x195)]);_0x1b5c68['set'](_0x89494,_0x290be4);}}for(const {id:_0x18e9a8,seg:_0x1273dc}of _0x30a98c){if(!_0x1273dc[_0x7c1553(0x195)])continue;const _0x1b7f36=_0x1b5c68[_0x7c1553(0x162)](_0x18e9a8);if(!_0x1b7f36)continue;const _0x1c8f96=serializeExpandedRule(_0x1b7f36,_0x1b5c68),_0x37b30e=_0xb9e90b[_0x7c1553(0x162)](_0x1c8f96);if(_0x37b30e){const _0x4c1b9a=_0x37b30e[_0x7c1553(0x1a0)](_0x3120f8=>_0x45368e[_0x7c1553(0x1a6)](_0x3120f8));_0x4c1b9a&&(_0x5689af[_0x7c1553(0x20a)](_0x4c1b9a,_0x18e9a8),_0x45368e['delete'](_0x4c1b9a),logger['debug'](_0x7c1553(0x215)+_0x1273dc[_0x7c1553(0x1de)]+_0x7c1553(0x1c7)+_0x4c1b9a+_0x7c1553(0x1f1)));}}}}async function executeSingleJourneyPush(_0x55a76c,_0x17f149,_0x56e15d,_0x4b1fe0,_0x11f751,_0x41364d){const _0xd80b1=a152_0x32dbf6,{journeyDefToRequest:_0x5277b9,activationDefToCreateRequest:_0x2c0b5b,yamlRuleToApi:_0x191bbc,validateSegmentRule:_0x43f25f}=_0x41364d,_0x34cb49=new Map(),_0x586bac=new Map();recoverSegmentIdsFromPushRecovery(_0x17f149,_0x34cb49,_0x56e15d['segmentNameToId']);const _0xf8a3b0=new Map(),_0x4244f4=new Map(),_0x2901c0=new Map();let _0x52d195;const _0x4c6b0c=async()=>{const _0x404509=a152_0x13c2;if(_0x52d195)return;_0x52d195=new Map();if(!_0x17f149[_0x404509(0x1f4)])return;const _0xc7251=await _0x55a76c[_0x404509(0x1c3)][_0x404509(0x218)](_0x17f149['existingJourney']['id']);for(const _0xa1911 of _0xc7251){const _0x802c85=journeyActivationStepToYaml(_0xa1911,_0x56e15d[_0x404509(0x199)],_0x56e15d[_0x404509(0x23d)]),_0x37a58b=activationSignature(_0x802c85);!_0x52d195[_0x404509(0x1a6)](_0x37a58b)&&_0x52d195[_0x404509(0x20a)](_0x37a58b,_0xa1911['id']),_0x802c85[_0x404509(0x1de)]&&_0x586bac[_0x404509(0x20a)](_0x802c85[_0x404509(0x1de)],_0xa1911['id']);}};await matchExistingJourneySegments(_0x55a76c,_0x17f149,_0x4b1fe0['parentId'],_0x56e15d[_0xd80b1(0x1b8)],_0x56e15d['segmentNameToId']);const _0x233c60={'resolveSegmentId':async _0x43a279=>{const _0x3c7be5=_0xd80b1,_0x5f0f3c=_0x56e15d[_0x3c7be5(0x212)][_0x3c7be5(0x162)](_0x43a279);if(!_0x5f0f3c)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x3c7be5(0x1ab)+_0x43a279+_0x3c7be5(0x22d)+_0x17f149[_0x3c7be5(0x154)][_0x3c7be5(0x1de)]+')');return _0x5f0f3c;},'resolveEmbeddedSegmentId':async(_0x49822e,_0xb5d941)=>{const _0x5eb066=_0xd80b1,_0x47534c=_0x56e15d[_0x5eb066(0x212)][_0x5eb066(0x162)](_0x49822e);if(_0x47534c)return _0x47534c;const _0x3e6bf3=_0x56e15d[_0x5eb066(0x1b8)][_0x5eb066(0x1a0)](_0x1535c1=>_0x1535c1[_0x5eb066(0x1de)]===_0x49822e);if(_0x3e6bf3)return _0x56e15d[_0x5eb066(0x212)]['set'](_0x49822e,_0x3e6bf3['id']),_0x3e6bf3['id'];if(_0x17f149[_0x5eb066(0x22f)]){const {stageName:_0x27b083,criteriaName:_0x36f98b}=findSegmentCriteriaLocation(_0x17f149[_0x5eb066(0x154)],_0x49822e);return _0x43f25f(_0x49822e,_0xb5d941[_0x5eb066(0x195)]),_0x4244f4['set'](_0x49822e,{'definition':_0xb5d941,'stageName':_0x27b083,'criteriaName':_0x36f98b}),createPendingSegmentId(_0x49822e);}const _0x14ede2=_0x17f149[_0x5eb066(0x1f4)]?.['id'];if(!_0x14ede2)throw new SDKError(ErrorCode[_0x5eb066(0x1d2)],_0x5eb066(0x1e4));const _0x157534=_0xf8a3b0[_0x5eb066(0x162)](_0x49822e);if(_0x157534)return _0x157534;const _0x369dfa=((async()=>{const _0x5f51bf=_0x5eb066;_0x43f25f(_0x49822e,_0xb5d941[_0x5f51bf(0x195)]);const _0x118fb1=generateDeterministicJourneySegmentName(_0x17f149[_0x5f51bf(0x154)][_0x5f51bf(0x1de)],_0x49822e),_0x138bc1=_0x56e15d[_0x5f51bf(0x1b8)]['find'](_0x2fe66d=>_0x2fe66d[_0x5f51bf(0x1de)]===_0x118fb1),_0x2190a3=createSegmentIdResolver(_0x56e15d[_0x5f51bf(0x212)],_0x49822e),_0x106a8b=await resolveRuleSegmentIds(_0xb5d941[_0x5f51bf(0x195)],_0x2190a3);let _0x4a13df;return _0x138bc1?(await _0x55a76c['segment']['updateSegmentById'](_0x4b1fe0[_0x5f51bf(0x1fd)],_0x138bc1['id'],{'description':_0xb5d941[_0x5f51bf(0x1d7)]||_0x5f51bf(0x21d)+_0x49822e,'rule':_0x191bbc(_0x106a8b),'countPopulation':!![]}),_0x4a13df=_0x138bc1['id'],saveSegmentToPushRecovery(_0x17f149[_0x5f51bf(0x160)],_0x17f149[_0x5f51bf(0x154)][_0x5f51bf(0x1de)],_0x49822e,{'segmentId':_0x4a13df,'uniqueServerName':_0x118fb1,'createdAt':new Date()[_0x5f51bf(0x16c)]()})):_0x4a13df=await createOrRecoverEmbeddedSegment(_0x55a76c,_0x17f149,{'localName':_0x49822e,'uniqueSegmentName':_0x118fb1,'description':_0xb5d941['description']||_0x5f51bf(0x21d)+_0x49822e,'journeyId':_0x14ede2,'resolvedRule':_0x106a8b,'parentId':_0x4b1fe0['parentId'],'folderId':_0x4b1fe0[_0x5f51bf(0x248)]||''},_0x191bbc),_0x56e15d[_0x5f51bf(0x212)]['set'](_0x49822e,_0x4a13df),_0x34cb49[_0x5f51bf(0x20a)](_0x49822e,_0x4a13df),_0x4a13df;})());_0xf8a3b0[_0x5eb066(0x20a)](_0x49822e,_0x369dfa);try{return await _0x369dfa;}finally{_0xf8a3b0[_0x5eb066(0x1a9)](_0x49822e);}},'resolveActivationId':async _0x48c942=>{const _0x3bf37c=_0xd80b1,_0x7b2917=_0x586bac[_0x3bf37c(0x162)](_0x48c942);if(_0x7b2917)return _0x7b2917;if(_0x17f149[_0x3bf37c(0x1f4)]){await _0x4c6b0c();const _0x1bbeba=_0x586bac[_0x3bf37c(0x162)](_0x48c942);if(_0x1bbeba)return _0x1bbeba;}throw new SDKError(ErrorCode[_0x3bf37c(0x24a)],_0x3bf37c(0x1d3)+_0x48c942+_0x3bf37c(0x22d)+_0x17f149[_0x3bf37c(0x154)]['name']+_0x3bf37c(0x1dd)+_0x3bf37c(0x17e));},'resolveEmbeddedActivationId':async(_0xb90571,_0x45a33f)=>{const _0x37de9f=_0xd80b1,_0x4d74d2=_0x586bac[_0x37de9f(0x162)](_0xb90571);if(_0x4d74d2)return _0x4d74d2;if(_0x17f149[_0x37de9f(0x22f)])return _0x2901c0['set'](_0xb90571,_0x45a33f),createPendingActivationId(_0xb90571);if(_0x17f149[_0x37de9f(0x1f4)]){await _0x4c6b0c();const _0x117e8b=_0x586bac['get'](_0x45a33f[_0x37de9f(0x1de)]);if(_0x117e8b)return _0x586bac['set'](_0xb90571,_0x117e8b),_0x117e8b;const _0x3e5298=activationSignature(_0x45a33f),_0x2e9770=_0x52d195?.['get'](_0x3e5298);if(_0x2e9770)return _0x586bac[_0x37de9f(0x20a)](_0xb90571,_0x2e9770),_0x2e9770;const _0x1d1e02=await _0x2c0b5b(_0x45a33f,_0x56e15d[_0x37de9f(0x238)]),_0x5dcae2={..._0x1d1e02,..._0x45a33f['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x45a33f['run_after_journey_refresh']}},_0x544a10=await _0x55a76c[_0x37de9f(0x1c3)][_0x37de9f(0x14d)](_0x17f149[_0x37de9f(0x1f4)]['id'],_0x5dcae2);return _0x586bac['set'](_0xb90571,_0x544a10['id']),_0x544a10['id'];}throw new SDKError(ErrorCode[_0x37de9f(0x1d2)],_0x37de9f(0x1ec));},'resolveJourneyId':async _0xa131cd=>{const _0xd0f49=_0xd80b1;try{return await _0x55a76c[_0xd0f49(0x1c3)][_0xd0f49(0x1ed)](_0x4b1fe0[_0xd0f49(0x1fd)],_0xa131cd);}catch(_0x3808d6){throw new SDKError(ErrorCode[_0xd0f49(0x24a)],_0xd0f49(0x234)+_0xa131cd+_0xd0f49(0x164)+_0x17f149['yamlConfig'][_0xd0f49(0x1de)]+'\x27)',_0x3808d6);}},'resolveStageId':async(_0x3ef602,_0x3572d3)=>{const _0x49ccb9=_0xd80b1,_0x3ca75e=await _0x55a76c['journey'][_0x49ccb9(0x232)](_0x3ef602),_0x28eb49=_0x3ca75e[_0x49ccb9(0x20d)][_0x49ccb9(0x19e)][_0x49ccb9(0x1a0)](_0x474930=>_0x474930['name'][_0x49ccb9(0x170)]()===_0x3572d3[_0x49ccb9(0x170)]());if(!_0x28eb49?.['id'])throw new SDKError(ErrorCode['NOT_FOUND'],_0x49ccb9(0x1bb)+_0x3572d3+_0x49ccb9(0x1ce)+(_0x3ca75e['attributes'][_0x49ccb9(0x1b5)]||_0x3ca75e['attributes'][_0x49ccb9(0x1de)])+'\x27');return _0x28eb49['id'];}},_0x259c41=await _0x5277b9(_0x17f149[_0xd80b1(0x154)],_0x4b1fe0[_0xd80b1(0x1fd)],_0x233c60),_0x2020bc=_0x4b1fe0[_0xd80b1(0x22b)]||_0x4b1fe0[_0xd80b1(0x248)];_0x2020bc&&(_0x259c41[_0xd80b1(0x181)]={'parentFolder':{'data':{'id':_0x2020bc,'type':'folder'}}});if(_0x17f149['isNew']){if(_0x4244f4['size']>0x0||_0x2901c0['size']>0x0)return await executeThreeStepJourneyCreate(_0x55a76c,_0x17f149,_0x259c41,{'pendingEmbeddedSegments':_0x4244f4,'pendingEmbeddedActivations':_0x2901c0,'embeddedSegmentNameToId':_0x34cb49,'journeyActivationNameToId':_0x586bac},{..._0x4b1fe0,'effectiveFolderId':_0x2020bc},_0x56e15d,_0x11f751,_0x41364d);else{ensureJourneyDefaults(_0x259c41[_0xd80b1(0x20d)]);const _0x3a8f49=await _0x55a76c['journey'][_0xd80b1(0x1d9)](_0x259c41);return deletePushRecovery(_0x17f149[_0xd80b1(0x160)]),{'action':_0xd80b1(0x1a5),'journeyId':_0x3a8f49['id'],'embeddedSegmentNameToId':_0x34cb49};}}else{if(_0x17f149[_0xd80b1(0x1c2)]&&_0x17f149[_0xd80b1(0x1f4)]){_0x259c41['id']=_0x17f149[_0xd80b1(0x1f4)]['id'];const _0x831204=_0x259c41[_0xd80b1(0x20d)];_0x17f149[_0xd80b1(0x1f4)][_0xd80b1(0x20d)]?.['journeyBundleName']&&(_0x831204[_0xd80b1(0x1b5)]=_0x17f149[_0xd80b1(0x1f4)][_0xd80b1(0x20d)]['journeyBundleName']);const _0x272e23=_0x17f149[_0xd80b1(0x1f4)]['attributes']?.[_0xd80b1(0x19e)];return _0x272e23&&_0x259c41[_0xd80b1(0x20d)][_0xd80b1(0x19e)]&&injectExistingStageIds(_0x259c41[_0xd80b1(0x20d)][_0xd80b1(0x19e)],_0x272e23),ensureJourneyDefaults(_0x831204),await _0x55a76c['journey'][_0xd80b1(0x166)](_0x17f149[_0xd80b1(0x1f4)]['id'],_0x259c41),deletePushRecovery(_0x17f149[_0xd80b1(0x160)]),{'action':_0xd80b1(0x1b9),'journeyId':_0x17f149[_0xd80b1(0x1f4)]['id'],'embeddedSegmentNameToId':_0x34cb49};}}return deletePushRecovery(_0x17f149['absolutePath']),{'action':_0xd80b1(0x16e),'journeyId':_0x17f149[_0xd80b1(0x1f4)]?.['id'],'embeddedSegmentNameToId':_0x34cb49};}function findSegmentCriteriaLocation(_0x4eb0e0,_0x376b08){const _0x55cebc=a152_0x32dbf6,_0x11f83d=_0x4eb0e0[_0x55cebc(0x211)]||_0x4eb0e0['journeys']?.[0x0]?.['stages']||[];let _0x3a4da0='entry',_0x450a1d=_0x376b08;const _0x39157c=_0x4eb0e0[_0x55cebc(0x155)]||_0x4eb0e0[_0x55cebc(0x16d)]?.[0x0]?.[_0x55cebc(0x155)];if(_0x39157c?.[_0x55cebc(0x196)]===_0x376b08)return{'stageName':_0x55cebc(0x155),'criteriaName':_0x39157c[_0x55cebc(0x1de)]||_0x376b08};_0x316bb0:for(const _0x5e4828 of _0x11f83d){if(_0x5e4828[_0x55cebc(0x1d8)]?.['segment']===_0x376b08){_0x3a4da0=_0x5e4828[_0x55cebc(0x1de)],_0x450a1d=_0x5e4828[_0x55cebc(0x1d8)]['name']||_0x376b08;break;}if(_0x5e4828[_0x55cebc(0x18f)])for(const _0xc4fb23 of _0x5e4828['steps']){if(_0xc4fb23[_0x55cebc(0x187)]===_0x55cebc(0x1bf)&&_0xc4fb23['with']?.['branches'])for(const _0x3047cc of _0xc4fb23['with'][_0x55cebc(0x23a)]){if(_0x3047cc[_0x55cebc(0x196)]===_0x376b08){_0x3a4da0=_0x5e4828[_0x55cebc(0x1de)],_0x450a1d=_0x3047cc[_0x55cebc(0x1de)]||_0x376b08;break _0x316bb0;}}}}return{'stageName':_0x3a4da0,'criteriaName':_0x450a1d};}async function executeThreeStepJourneyCreate(_0x29d0ab,_0x3c7e39,_0x12e7a4,_0x23046b,_0x171619,_0x3e5f7e,_0x232cf0,_0x25bc64){const _0x2f8821=a152_0x32dbf6,{activationDefToCreateRequest:_0xc52b68,yamlRuleToApi:_0x5b7351}=_0x25bc64,{pendingEmbeddedSegments:_0x50b0e8,pendingEmbeddedActivations:_0x25a833,embeddedSegmentNameToId:_0x1bf645}=_0x23046b,_0x5b660f=JSON[_0x2f8821(0x247)](JSON['stringify'](_0x12e7a4));ensureJourneyDefaults(_0x5b660f[_0x2f8821(0x20d)]),stripPendingIds(_0x5b660f);const _0x1c2b38=await _0x29d0ab[_0x2f8821(0x1c3)]['create'](_0x5b660f),_0x2c0922=_0x1c2b38['id'],_0x4eb878=new Map();for(const _0x435420 of _0x1c2b38[_0x2f8821(0x20d)]['journeyStages']){_0x4eb878['set'](_0x435420['name'][_0x2f8821(0x170)](),_0x435420['id']);}recoverSegmentIdsFromPushRecovery(_0x3c7e39,_0x1bf645,_0x3e5f7e[_0x2f8821(0x212)]);for(const [_0x6e9945,{definition:_0x243180}]of _0x50b0e8){if(_0x1bf645[_0x2f8821(0x1a6)](_0x6e9945)){_0x232cf0['onProgress']?.({'type':_0x2f8821(0x1cc),'journeyName':_0x3c7e39[_0x2f8821(0x154)]['name'],'segmentName':_0x6e9945});continue;}const _0x1dc874=generateDeterministicJourneySegmentName(_0x3c7e39['yamlConfig'][_0x2f8821(0x1de)],_0x6e9945);_0x232cf0[_0x2f8821(0x1da)]?.({'type':_0x2f8821(0x20c),'journeyName':_0x3c7e39[_0x2f8821(0x154)][_0x2f8821(0x1de)],'segmentName':_0x6e9945});const _0x2ce45a=createSegmentIdResolver(_0x3e5f7e['segmentNameToId'],_0x6e9945),_0x42f114=await resolveRuleSegmentIds(_0x243180['rule'],_0x2ce45a),_0x411b42=await createOrRecoverEmbeddedSegment(_0x29d0ab,_0x3c7e39,{'localName':_0x6e9945,'uniqueSegmentName':_0x1dc874,'description':_0x243180[_0x2f8821(0x1d7)]||_0x2f8821(0x21d)+_0x6e9945,'journeyId':_0x2c0922,'resolvedRule':_0x42f114,'parentId':_0x171619['parentId'],'folderId':_0x171619['effectiveFolderId']||''},_0x5b7351);_0x1bf645[_0x2f8821(0x20a)](_0x6e9945,_0x411b42),_0x3e5f7e[_0x2f8821(0x212)][_0x2f8821(0x20a)](_0x6e9945,_0x411b42),_0x232cf0[_0x2f8821(0x1da)]?.({'type':_0x2f8821(0x1cc),'journeyName':_0x3c7e39[_0x2f8821(0x154)][_0x2f8821(0x1de)],'segmentName':_0x6e9945});}const _0xf8a079=new Map();for(const [_0x2d1a54,_0x28fcec]of _0x25a833){_0x232cf0[_0x2f8821(0x1da)]?.({'type':_0x2f8821(0x16f),'journeyName':_0x3c7e39[_0x2f8821(0x154)][_0x2f8821(0x1de)],'activationName':_0x2d1a54});const _0x3ca21d=await _0xc52b68(_0x28fcec,_0x3e5f7e[_0x2f8821(0x238)]),_0x3f29ea={..._0x3ca21d,..._0x28fcec['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x28fcec['run_after_journey_refresh']}},_0x1d7b10=await _0x29d0ab['journey'][_0x2f8821(0x14d)](_0x2c0922,_0x3f29ea);_0xf8a079[_0x2f8821(0x20a)](_0x2d1a54,_0x1d7b10['id']),_0x23046b[_0x2f8821(0x1d5)][_0x2f8821(0x20a)](_0x2d1a54,_0x1d7b10['id']),_0x232cf0['onProgress']?.({'type':'embedded_activation_created','journeyName':_0x3c7e39[_0x2f8821(0x154)][_0x2f8821(0x1de)],'activationName':_0x2d1a54});}const _0x270243=JSON['parse'](JSON['stringify'](_0x12e7a4));return _0x270243['id']=_0x2c0922,ensureJourneyDefaults(_0x270243[_0x2f8821(0x20d)]),resolvePendingIdsInRequest(_0x270243,_0x12e7a4,_0x4eb878,_0x1bf645,_0xf8a079,_0x232cf0),await _0x29d0ab[_0x2f8821(0x1c3)][_0x2f8821(0x166)](_0x2c0922,_0x270243),deletePushRecovery(_0x3c7e39[_0x2f8821(0x160)]),{'action':_0x2f8821(0x1a5),'journeyId':_0x2c0922,'embeddedSegmentNameToId':_0x1bf645};}export function stripWaitStepPendingIds(_0x198c93){const _0x2f6a8a=a152_0x32dbf6,_0x434cc1=_0x198c93['conditionSegmentId']&&isPendingSegmentId(_0x198c93['conditionSegmentId']),_0x391c3d=_0x198c93[_0x2f6a8a(0x200)]?.[_0x2f6a8a(0x16b)](_0x113b04=>_0x113b04[_0x2f6a8a(0x15e)]&&isPendingSegmentId(_0x113b04[_0x2f6a8a(0x15e)]));(_0x434cc1||_0x391c3d)&&(_0x198c93[_0x2f6a8a(0x22a)]=_0x2f6a8a(0x18a),_0x198c93[_0x2f6a8a(0x1eb)]=0x1,_0x198c93[_0x2f6a8a(0x16a)]=_0x2f6a8a(0x23b),delete _0x198c93['conditionSegmentId'],delete _0x198c93[_0x2f6a8a(0x1e9)],delete _0x198c93[_0x2f6a8a(0x15c)],delete _0x198c93[_0x2f6a8a(0x200)]);}export function resolveWaitStepPendingIds(_0x44baa9,_0x30683a,_0x4f7294,_0x1efa71){const _0x4255a2=a152_0x32dbf6;if(_0x30683a[_0x4255a2(0x193)]&&isPendingSegmentId(_0x30683a[_0x4255a2(0x193)])){const _0x51b039=_0x4f7294(_0x30683a['conditionSegmentId'],_0x4255a2(0x207)+_0x1efa71+_0x4255a2(0x23f));_0x51b039&&(_0x44baa9[_0x4255a2(0x22a)]=_0x4255a2(0x1e2),_0x44baa9['conditionSegmentId']=_0x51b039,delete _0x44baa9[_0x4255a2(0x1eb)],delete _0x44baa9[_0x4255a2(0x16a)],_0x30683a[_0x4255a2(0x1e9)]!==undefined&&(_0x44baa9[_0x4255a2(0x1e9)]=_0x30683a[_0x4255a2(0x1e9)]),_0x30683a[_0x4255a2(0x15c)]&&(_0x44baa9[_0x4255a2(0x15c)]=_0x30683a[_0x4255a2(0x15c)]));}if(_0x30683a[_0x4255a2(0x200)]){const _0x2fa65a=_0x30683a['conditions'][_0x4255a2(0x16b)](_0x5cd22b=>_0x5cd22b[_0x4255a2(0x15e)]&&isPendingSegmentId(_0x5cd22b['segmentId']));if(_0x2fa65a){const _0x30fde3=_0x30683a['conditions'][_0x4255a2(0x189)](_0x44707d=>{const _0x2d5650=_0x4255a2;if(_0x44707d['segmentId']&&isPendingSegmentId(_0x44707d[_0x2d5650(0x15e)])){const _0x39d324=_0x4f7294(_0x44707d[_0x2d5650(0x15e)],'stage\x20\x27'+_0x1efa71+'\x27\x20wait\x20condition');return{..._0x44707d,'segmentId':_0x39d324||_0x44707d['segmentId']};}return{..._0x44707d};});_0x44baa9['waitStepType']=_0x4255a2(0x1e2),_0x44baa9[_0x4255a2(0x200)]=_0x30fde3,delete _0x44baa9['waitStep'],delete _0x44baa9[_0x4255a2(0x16a)],delete _0x44baa9[_0x4255a2(0x193)],delete _0x44baa9[_0x4255a2(0x1e9)],delete _0x44baa9[_0x4255a2(0x15c)];}}}function stripPendingIds(_0x5f5ae2){const _0xd700d=a152_0x32dbf6;_0x5f5ae2['attributes'][_0xd700d(0x155)]?.[_0xd700d(0x15e)]&&isPendingSegmentId(_0x5f5ae2['attributes']['goal']['segmentId'])&&delete _0x5f5ae2[_0xd700d(0x20d)][_0xd700d(0x155)];for(const _0x25294a of _0x5f5ae2[_0xd700d(0x20d)][_0xd700d(0x19e)]||[]){_0x25294a[_0xd700d(0x233)]?.[_0xd700d(0x15e)]&&isPendingSegmentId(_0x25294a[_0xd700d(0x233)][_0xd700d(0x15e)])&&delete _0x25294a[_0xd700d(0x233)];_0x25294a['milestone']?.[_0xd700d(0x15e)]&&isPendingSegmentId(_0x25294a[_0xd700d(0x1bd)][_0xd700d(0x15e)])&&delete _0x25294a[_0xd700d(0x1bd)];_0x25294a['exitCriterias']&&(_0x25294a[_0xd700d(0x1f6)]=_0x25294a[_0xd700d(0x1f6)]['filter'](_0x33e6eb=>!_0x33e6eb[_0xd700d(0x15e)]||!isPendingSegmentId(_0x33e6eb[_0xd700d(0x15e)])));if(_0x25294a['steps'])for(const _0x24d7d2 of Object['keys'](_0x25294a['steps'])){const _0x4136e0=_0x25294a['steps'][_0x24d7d2];_0x4136e0[_0xd700d(0x187)]==='Activation'&&_0x4136e0[_0xd700d(0x18d)]&&isPendingActivationId(_0x4136e0[_0xd700d(0x18d)])&&(_0x4136e0[_0xd700d(0x18d)]='');if(_0x4136e0[_0xd700d(0x187)]==='DecisionPoint'&&_0x4136e0[_0xd700d(0x23a)])for(const _0x4c7ba2 of _0x4136e0['branches']){_0x4c7ba2[_0xd700d(0x15e)]&&isPendingSegmentId(_0x4c7ba2[_0xd700d(0x15e)])&&(_0x4c7ba2[_0xd700d(0x15e)]='');}_0x4136e0[_0xd700d(0x187)]==='WaitStep'&&stripWaitStepPendingIds(_0x4136e0);}}}function resolvePendingIdsInRequest(_0x693057,_0x2ae16c,_0x4c4f63,_0x351523,_0x1ff869,_0x176935){const _0x556d18=a152_0x32dbf6,_0x8606a9=(_0x5952d5,_0x27eb8e)=>{const _0x1dae31=a152_0x13c2;if(!isPendingSegmentId(_0x5952d5))return _0x5952d5;const _0x1e345a=extractPendingSegmentName(_0x5952d5),_0x5985be=_0x351523[_0x1dae31(0x162)](_0x1e345a);return!_0x5985be&&_0x176935[_0x1dae31(0x231)]?.(_0x1dae31(0x194)+_0x1e345a+_0x1dae31(0x1c6)+_0x27eb8e),_0x5985be;};if(_0x693057[_0x556d18(0x20d)][_0x556d18(0x155)]?.[_0x556d18(0x15e)]&&isPendingSegmentId(_0x693057[_0x556d18(0x20d)][_0x556d18(0x155)][_0x556d18(0x15e)])){const _0x47c5c5=_0x8606a9(_0x693057[_0x556d18(0x20d)][_0x556d18(0x155)][_0x556d18(0x15e)],_0x556d18(0x20e));_0x47c5c5&&(_0x693057[_0x556d18(0x20d)][_0x556d18(0x155)][_0x556d18(0x15e)]=_0x47c5c5);}for(const _0x2b379c of _0x693057['attributes'][_0x556d18(0x19e)]||[]){const _0x5aaa6a=_0x4c4f63[_0x556d18(0x162)](_0x2b379c[_0x556d18(0x1de)]['toLowerCase']());_0x5aaa6a&&(_0x2b379c['id']=_0x5aaa6a);if(_0x2b379c['entryCriteria']?.[_0x556d18(0x15e)]&&isPendingSegmentId(_0x2b379c[_0x556d18(0x233)]['segmentId'])){const _0xf00029=_0x8606a9(_0x2b379c[_0x556d18(0x233)][_0x556d18(0x15e)],_0x556d18(0x207)+_0x2b379c[_0x556d18(0x1de)]+_0x556d18(0x229));_0xf00029&&(_0x2b379c[_0x556d18(0x233)][_0x556d18(0x15e)]=_0xf00029);}if(_0x2b379c[_0x556d18(0x1f6)])for(const _0x2a7c1b of _0x2b379c[_0x556d18(0x1f6)]){if(_0x2a7c1b[_0x556d18(0x15e)]&&isPendingSegmentId(_0x2a7c1b[_0x556d18(0x15e)])){const _0x275792=_0x8606a9(_0x2a7c1b[_0x556d18(0x15e)],'stage\x20\x27'+_0x2b379c[_0x556d18(0x1de)]+_0x556d18(0x22c));_0x275792&&(_0x2a7c1b['segmentId']=_0x275792);}}if(_0x2b379c[_0x556d18(0x1bd)]?.[_0x556d18(0x15e)]&&isPendingSegmentId(_0x2b379c['milestone'][_0x556d18(0x15e)])){const _0x571132=_0x8606a9(_0x2b379c['milestone']['segmentId'],_0x556d18(0x207)+_0x2b379c[_0x556d18(0x1de)]+'\x27\x20milestone');_0x571132&&(_0x2b379c[_0x556d18(0x1bd)]['segmentId']=_0x571132);}if(_0x2b379c[_0x556d18(0x18f)]){const _0x345583=_0x5f4a74=>_0x2ae16c[_0x556d18(0x20d)]['journeyStages']?.[_0x556d18(0x1a0)](_0x1122cf=>_0x1122cf[_0x556d18(0x1de)][_0x556d18(0x170)]()===_0x2b379c[_0x556d18(0x1de)][_0x556d18(0x170)]())?.[_0x556d18(0x18f)]?.[_0x5f4a74];for(const _0x5c2101 of Object[_0x556d18(0x21f)](_0x2b379c[_0x556d18(0x18f)])){const _0x5eb1fd=_0x2b379c[_0x556d18(0x18f)][_0x5c2101],_0x3507f9=_0x345583(_0x5c2101);if(_0x5eb1fd['type']===_0x556d18(0x17f)&&_0x5eb1fd[_0x556d18(0x18d)]&&(isPendingActivationId(_0x5eb1fd['journeyActivationStepId'])||_0x5eb1fd[_0x556d18(0x18d)]==='')){if(_0x3507f9?.['journeyActivationStepId']&&isPendingActivationId(_0x3507f9[_0x556d18(0x18d)])){const _0x783b90=extractPendingActivationName(_0x3507f9[_0x556d18(0x18d)]),_0x34ef66=_0x1ff869[_0x556d18(0x162)](_0x783b90);_0x34ef66&&(_0x5eb1fd[_0x556d18(0x18d)]=_0x34ef66);}}if(_0x5eb1fd[_0x556d18(0x187)]==='DecisionPoint'&&_0x5eb1fd[_0x556d18(0x23a)]&&_0x3507f9?.[_0x556d18(0x23a)])for(let _0x5ad68d=0x0;_0x5ad68d<_0x5eb1fd[_0x556d18(0x23a)]['length'];_0x5ad68d++){const _0x93763f=_0x5eb1fd['branches'][_0x5ad68d],_0x528ac9=_0x3507f9[_0x556d18(0x23a)][_0x5ad68d];if(_0x528ac9?.['segmentId']&&isPendingSegmentId(_0x528ac9['segmentId'])){const _0x39fbba=_0x8606a9(_0x528ac9[_0x556d18(0x15e)],_0x556d18(0x207)+_0x2b379c[_0x556d18(0x1de)]+_0x556d18(0x213)+(_0x93763f[_0x556d18(0x1de)]||_0x5ad68d)+'\x27');_0x39fbba&&(_0x93763f[_0x556d18(0x15e)]=_0x39fbba);}}_0x5eb1fd['type']==='WaitStep'&&_0x3507f9?.[_0x556d18(0x187)]===_0x556d18(0x1ba)&&resolveWaitStepPendingIds(_0x5eb1fd,_0x3507f9,_0x8606a9,_0x2b379c[_0x556d18(0x1de)]);}}}}
1
+ const a151_0x3dca48=a151_0x1b24;(function(_0x276571,_0xae9608){const _0x4ef68e=a151_0x1b24,_0x5bbf98=_0x276571();while(!![]){try{const _0x40b406=-parseInt(_0x4ef68e(0x200))/0x1*(-parseInt(_0x4ef68e(0x224))/0x2)+parseInt(_0x4ef68e(0x197))/0x3*(-parseInt(_0x4ef68e(0x16f))/0x4)+parseInt(_0x4ef68e(0x1d8))/0x5*(parseInt(_0x4ef68e(0x17f))/0x6)+-parseInt(_0x4ef68e(0x1a1))/0x7+parseInt(_0x4ef68e(0x1b1))/0x8*(parseInt(_0x4ef68e(0x190))/0x9)+-parseInt(_0x4ef68e(0x1da))/0xa*(-parseInt(_0x4ef68e(0x1f0))/0xb)+-parseInt(_0x4ef68e(0x15f))/0xc;if(_0x40b406===_0xae9608)break;else _0x5bbf98['push'](_0x5bbf98['shift']());}catch(_0x6ac668){_0x5bbf98['push'](_0x5bbf98['shift']());}}}(a151_0x4fc4,0x7706c));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a151_0x3dca48(0x202));export const PENDING_SEGMENT_PREFIX=a151_0x3dca48(0x134);export const PENDING_ACTIVATION_PREFIX=a151_0x3dca48(0x1fe);export function createPendingSegmentId(_0x495bbb){return''+PENDING_SEGMENT_PREFIX+_0x495bbb+'__';}export function isPendingSegmentId(_0x480a7c){const _0x5b2aaa=a151_0x3dca48;return _0x480a7c[_0x5b2aaa(0x1fb)](PENDING_SEGMENT_PREFIX)&&!_0x480a7c['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x2e8005){const _0x13991a=a151_0x3dca48;return _0x2e8005[_0x13991a(0x161)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x3004d5){return''+PENDING_ACTIVATION_PREFIX+_0x3004d5+'__';}export function isPendingActivationId(_0x463056){const _0xe875ee=a151_0x3dca48;return _0x463056[_0xe875ee(0x1fb)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0xe56a64){const _0xcc03be=a151_0x3dca48;return _0xe56a64[_0xcc03be(0x161)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x28805f,_0x528547){const _0x337f6b=a151_0x3dca48,_0x2564ad=_0x28805f+'::'+(_0x528547[_0x337f6b(0x189)]()||_0x337f6b(0x1b6)),_0x5a1353=createHash(_0x337f6b(0x238))['update'](_0x2564ad)[_0x337f6b(0x171)](_0x337f6b(0x20e))[_0x337f6b(0x1c3)](0x0,0xc);return _0x337f6b(0x166)+_0x5a1353;}function a151_0x1b24(_0x1f1c79,_0x48c14e){_0x1f1c79=_0x1f1c79-0x133;const _0x4fc478=a151_0x4fc4();let _0x1b24ca=_0x4fc478[_0x1f1c79];return _0x1b24ca;}export function ensureJourneyDefaults(_0x4eac32){const _0x59f255=a151_0x3dca48;!_0x4eac32['description']&&(_0x4eac32['description']=''),!_0x4eac32[_0x59f255(0x239)]&&(_0x4eac32[_0x59f255(0x239)]=_0x59f255(0x1be));}export function injectExistingStageIds(_0x53eef2,_0x1c119f){const _0xa1782f=a151_0x3dca48,_0x4014e5=new Map(_0x1c119f[_0xa1782f(0x237)](_0x3df6f7=>[_0x3df6f7[_0xa1782f(0x1a5)],_0x3df6f7['id']]));for(const _0x46c813 of _0x53eef2){if(!_0x46c813['id']){const _0xf4d631=_0x4014e5['get'](_0x46c813['name']);_0xf4d631&&(_0x46c813['id']=_0xf4d631);}}}export function resolveTDFolderPath(_0x1333a4,_0x4867ed,_0x538940){if(!_0x4867ed)return _0x1333a4;if(_0x1333a4===_0x538940||_0x1333a4['startsWith'](_0x538940+'/'))return _0x1333a4;return _0x1333a4?_0x538940+'/'+_0x1333a4:_0x538940;}export function addFoldersToCreate(_0x517d9f,_0x2ce997,_0x13aa0a){const _0x11f107=a151_0x3dca48;if(!_0x517d9f)return;if(_0x2ce997[_0x11f107(0x232)](_0x517d9f))return;const _0x196c3e=_0x517d9f[_0x11f107(0x1d3)]('/');let _0x4fb439='';for(const _0x35d31a of _0x196c3e){_0x4fb439=_0x4fb439?_0x4fb439+'/'+_0x35d31a:_0x35d31a,!_0x2ce997[_0x11f107(0x232)](_0x4fb439)&&_0x13aa0a[_0x11f107(0x158)](_0x4fb439);}}export function sortFoldersByDepth(_0x1fe3e8){const _0x30a8ce=a151_0x3dca48;return[..._0x1fe3e8][_0x30a8ce(0x1e0)]((_0x5bc1bd,_0x290056)=>{const _0x550b67=_0x30a8ce,_0x418a86=(_0x5bc1bd[_0x550b67(0x19d)](/\//g)||[])[_0x550b67(0x14a)],_0x4f7270=(_0x290056[_0x550b67(0x19d)](/\//g)||[])[_0x550b67(0x14a)];return _0x418a86-_0x4f7270;});}import*as a151_0x2931b5 from'yaml';import{readFileSync}from'fs';import a151_0x38937e from'path';import{isJourneyDef,parseYamlString as a151_0x1f20c,toYamlString as a151_0x290451,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(_0xac3b01){const _0x5ec7e0=a151_0x3dca48;if(Array[_0x5ec7e0(0x162)](_0xac3b01))return'['+_0xac3b01[_0x5ec7e0(0x237)](_0x23a435=>stableStringify(_0x23a435))[_0x5ec7e0(0x1b5)](',')+']';if(_0xac3b01&&typeof _0xac3b01===_0x5ec7e0(0x15d)){const _0x16ce4d=_0xac3b01,_0x25c5e7=Object[_0x5ec7e0(0x143)](_0x16ce4d)['sort'](),_0x7628cf=_0x25c5e7[_0x5ec7e0(0x237)](_0x53a662=>'\x22'+_0x53a662+'\x22:'+stableStringify(_0x16ce4d[_0x53a662]));return'{'+_0x7628cf[_0x5ec7e0(0x1b5)](',')+'}';}const _0x48d8fa=JSON[_0x5ec7e0(0x1eb)](_0xac3b01);return _0x48d8fa===undefined?_0x5ec7e0(0x157):_0x48d8fa;}function activationSignature(_0x3c8acc){const _0x50163a=a151_0x3dca48,_0xc3a648={'connection':_0x3c8acc[_0x50163a(0x231)],..._0x3c8acc['all_columns']!==undefined&&{'all_columns':_0x3c8acc['all_columns']},..._0x3c8acc[_0x50163a(0x141)]!==undefined&&{'columns':_0x3c8acc[_0x50163a(0x141)]},..._0x3c8acc[_0x50163a(0x142)]!==undefined&&{'behavior':_0x3c8acc[_0x50163a(0x142)]},..._0x3c8acc[_0x50163a(0x17e)]!==undefined&&{'schedule':_0x3c8acc[_0x50163a(0x17e)]},..._0x3c8acc['notification']!==undefined&&{'notification':_0x3c8acc['notification']},..._0x3c8acc[_0x50163a(0x13f)]!==undefined&&{'connector_config':_0x3c8acc[_0x50163a(0x13f)]},..._0x3c8acc[_0x50163a(0x221)]!==undefined&&{'activation_template_id':_0x3c8acc[_0x50163a(0x221)]}};return stableStringify(_0xc3a648);}async function fetchSegment(_0x68bf8d,_0x1b138a,_0x2211e5,_0x4d7dda){const _0x1a263d=a151_0x3dca48,_0x57d73f=_0x4d7dda?.['find'](_0x1b84de=>_0x1b84de['id']===_0x2211e5);if(_0x57d73f)return _0x57d73f;try{return await _0x68bf8d[_0x1a263d(0x1b6)]['getSegment'](_0x1b138a,_0x2211e5);}catch(_0x4374b4){logger[_0x1a263d(0x1d5)](_0x1a263d(0x1a0)+_0x2211e5+_0x1a263d(0x181)+_0x4374b4);try{return await _0x68bf8d[_0x1a263d(0x1b6)][_0x1a263d(0x133)](_0x2211e5);}catch(_0x3bab4b){return logger['debug']('getSegmentEntity\x20also\x20failed\x20for\x20'+_0x2211e5+':\x20'+_0x3bab4b),null;}}}function recoverSegmentIdsFromPushRecovery(_0x3ba76e,_0x3abc22,_0x4d5d25){const _0x545289=a151_0x3dca48,_0x588d08=readPushRecovery(_0x3ba76e[_0x545289(0x155)]);if(_0x588d08?.[_0x545289(0x1d2)]===_0x3ba76e[_0x545289(0x1f3)][_0x545289(0x1a5)])for(const [_0x47744c,_0x463d05]of Object['entries'](_0x588d08['segments'])){const _0x32af33=generateDeterministicJourneySegmentName(_0x3ba76e['yamlConfig'][_0x545289(0x1a5)],_0x47744c);_0x463d05['uniqueServerName']===_0x32af33&&(_0x3abc22[_0x545289(0x153)](_0x47744c,_0x463d05[_0x545289(0x1f5)]),_0x4d5d25['set'](_0x47744c,_0x463d05['segmentId']));}}async function createOrRecoverEmbeddedSegment(_0x20d1b0,_0x22bd83,_0x8363ac,_0x1a5c26){const _0x59baa4=a151_0x3dca48;let _0x17697d;try{_0x17697d=await _0x20d1b0['segment'][_0x59baa4(0x210)]({'name':_0x8363ac[_0x59baa4(0x1f6)],'description':_0x8363ac['description'],'journeyId':_0x8363ac['journeyId'],'rule':_0x1a5c26(_0x8363ac[_0x59baa4(0x188)],!![]),'countPopulation':!![],'parentFolderId':_0x8363ac[_0x59baa4(0x18c)],'audienceId':_0x8363ac[_0x59baa4(0x1cf)]});}catch(_0x5e8cff){const _0x127912=_0x5e8cff instanceof Error&&_0x5e8cff[_0x59baa4(0x1e6)][_0x59baa4(0x136)]('Name\x20has\x20already\x20been\x20taken');if(_0x127912){const _0x5393e5=readPushRecovery(_0x22bd83[_0x59baa4(0x155)]),_0x26e52a=_0x5393e5?.[_0x59baa4(0x1d2)]===_0x22bd83['yamlConfig'][_0x59baa4(0x1a5)]?_0x5393e5[_0x59baa4(0x18a)][_0x8363ac['localName']]:undefined;if(_0x26e52a?.[_0x59baa4(0x23c)]===_0x8363ac[_0x59baa4(0x1f6)])await _0x20d1b0[_0x59baa4(0x1b6)][_0x59baa4(0x1c6)](_0x8363ac['parentId'],_0x26e52a[_0x59baa4(0x1f5)],{'description':_0x8363ac[_0x59baa4(0x13b)],'rule':_0x1a5c26(_0x8363ac[_0x59baa4(0x188)],!![]),'countPopulation':!![]}),_0x17697d=_0x26e52a['segmentId'];else throw new SDKError(ErrorCode[_0x59baa4(0x1e4)],_0x59baa4(0x226)+_0x8363ac[_0x59baa4(0x137)]+'\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20'+(_0x59baa4(0x1ad)+_0x22bd83['absolutePath'][_0x59baa4(0x161)](/([^/]+)$/,_0x59baa4(0x235))+')\x20')+_0x59baa4(0x1c9),_0x5e8cff);}else throw _0x5e8cff;}return saveSegmentToPushRecovery(_0x22bd83['absolutePath'],_0x22bd83[_0x59baa4(0x1f3)]['name'],_0x8363ac[_0x59baa4(0x137)],{'segmentId':_0x17697d,'uniqueServerName':_0x8363ac[_0x59baa4(0x1f6)],'createdAt':new Date()['toISOString']()}),_0x17697d;}export async function prepareSegmentFiles(_0x55cc4b,_0x4f9a7b,_0x3cc1aa,_0xf772b9,_0x3b58b9){const _0x57e5cc=a151_0x3dca48,{activationDefToCreateRequest:_0x411978}=await import(_0x57e5cc(0x1a8)),_0x48dc8c=[],_0x48f5bd=new Set();for(const {yamlConfig:_0x5baf2f,folderPath:_0x3b9377,sourcePath:_0x5711d2}of _0x55cc4b){const _0x509274=resolveTDFolderPath(_0x3b9377,_0xf772b9,_0x3b58b9),_0x2876e6=_0x509274+':'+_0x5baf2f[_0x57e5cc(0x1a5)],_0xae3d51=_0x4f9a7b['segmentByFolderAndName'][_0x57e5cc(0x1aa)](_0x2876e6),_0x471a52=_0xae3d51?_0x4f9a7b[_0x57e5cc(0x21b)][_0x57e5cc(0x1aa)](_0xae3d51['id'])||[]:[];addFoldersToCreate(_0x509274,_0x4f9a7b[_0x57e5cc(0x20b)],_0x48f5bd);const _0x474f62=calculateActivationActions(_0x5baf2f[_0x57e5cc(0x20d)]||[],_0x471a52,_0x4f9a7b[_0x57e5cc(0x1d9)],_0x4f9a7b[_0x57e5cc(0x1e1)]);for(const _0xcaf7e3 of _0x474f62){(_0xcaf7e3[_0x57e5cc(0x1ed)]===_0x57e5cc(0x1ac)||_0xcaf7e3['type']===_0x57e5cc(0x219))&&_0xcaf7e3['yamlActivation']&&(_0xcaf7e3[_0x57e5cc(0x16c)]=await _0x411978(_0xcaf7e3['yamlActivation'],_0x3cc1aa));}const _0x420f96=calculateSegmentDiff(_0x5baf2f,_0xae3d51,_0x471a52,_0x4f9a7b[_0x57e5cc(0x1d9)],_0x4f9a7b['connectionIdToNameMap']);_0x48dc8c[_0x57e5cc(0x19b)]({'relativePath':_0x5baf2f['name'],'absolutePath':_0x5711d2,'yamlConfig':_0x5baf2f,'folderPath':_0x509274,'existingSegment':_0xae3d51,'existingActivations':_0x471a52,'isNew':_0x420f96[_0x57e5cc(0x1ff)],'hasChanges':_0x420f96[_0x57e5cc(0x19c)],'diff':_0x420f96[_0x57e5cc(0x1e7)],'activationActions':_0x474f62});}return{'segmentFiles':_0x48dc8c,'foldersToCreate':_0x48f5bd};}export async function prepareJourneyFiles(_0x502536,_0x56a045,_0x4d78d0,_0x58090e){const _0x2bfb91=a151_0x3dca48,_0x56a00a=[],_0x47fd9e=new Set();for(const {yamlConfig:_0x34c17f,folderPath:_0x32254d,sourcePath:_0x1d91ca}of _0x502536){const _0x1e7cb1=resolveTDFolderPath(_0x32254d,_0x4d78d0,_0x58090e),_0x112e63=_0x1e7cb1+':'+_0x34c17f[_0x2bfb91(0x1a5)],_0x1fb185=_0x56a045[_0x2bfb91(0x1a2)][_0x2bfb91(0x1aa)](_0x112e63);let _0x28eb79,_0x56bba2;if(_0x1fb185&&_0x1fb185[_0x2bfb91(0x14a)]>0x0){const _0x1a87c1=buildLocalExpandedRuleMappings(_0x34c17f),{createYamlContext:_0x2c9cd5,prefetchJourneySegments:_0x272d90}=createPushYamlContextForBundle(_0x56a045['deps'],_0x56a045[_0x2bfb91(0x1cf)],_0x56a045[_0x2bfb91(0x192)],_0x1a87c1,_0x56a045[_0x2bfb91(0x1d9)],_0x56a045[_0x2bfb91(0x1e1)],_0x56a045[_0x2bfb91(0x228)],_0x56a045[_0x2bfb91(0x241)]);await _0x272d90(_0x1fb185['map'](_0x5706ee=>_0x5706ee['id']));const _0x6c7d59=await _0x56a045[_0x2bfb91(0x1f4)][_0x2bfb91(0x229)][_0x2bfb91(0x140)](_0x1fb185[0x0][_0x2bfb91(0x1e9)]),_0x2f1a0a=hasMultipleVersions(_0x34c17f),_0x4520e2=async _0x241655=>{const _0xa8606f=_0x2bfb91,_0x18c016=_0x56a045[_0xa8606f(0x241)]?.['get'](_0x241655);if(_0x18c016)return _0x18c016;return _0x56a045[_0xa8606f(0x1bf)]({'journeyId':_0x241655,'journeyName':_0x34c17f['name'],'isMultiVersion':_0x1fb185[_0xa8606f(0x14a)]>0x1});};if(_0x2f1a0a&&_0x1fb185['length']>0x1){const _0x182b8c=[];for(const _0x50d20d of _0x1fb185){const _0x2a2181=_0x50d20d['versionNumber']||0x1;_0x56a045[_0x2bfb91(0x1fd)]?.[_0x2bfb91(0x219)](_0x2bfb91(0x163)+_0x34c17f[_0x2bfb91(0x1a5)]+'\x20v'+_0x2a2181);const _0x3c3e9b=await _0x4520e2(_0x50d20d['id']),_0x239463=_0x2c9cd5(_0x50d20d['id']),_0x322ca0=await journeyResponseToDef(_0x3c3e9b,_0x239463);_0x182b8c['push']({'item':_0x50d20d,'yaml':_0x322ca0});}const _0xf63960=buildLocalRuleToNameMappingFromJourney(_0x34c17f);_0x56bba2=buildMergedJourneyDef(_0x182b8c,_0xf63960,_0x6c7d59);const _0x5d0dc0=Math[_0x2bfb91(0x18d)](..._0x182b8c[_0x2bfb91(0x237)](_0x1ab94a=>_0x1ab94a[_0x2bfb91(0x167)][_0x2bfb91(0x242)]||0x0)),_0x429d49=_0x1fb185['find'](_0x5e2ef3=>(_0x5e2ef3[_0x2bfb91(0x242)]||0x0)===_0x5d0dc0);_0x429d49&&(_0x56a045[_0x2bfb91(0x1fd)]?.['update'](_0x2bfb91(0x163)+_0x34c17f[_0x2bfb91(0x1a5)]+'\x20v'+_0x5d0dc0),_0x28eb79=await _0x4520e2(_0x429d49['id']));}else{const _0x1d291e=_0x1fb185[_0x1fb185[_0x2bfb91(0x14a)]-0x1];_0x56a045['progress']?.[_0x2bfb91(0x219)](_0x2bfb91(0x163)+_0x34c17f[_0x2bfb91(0x1a5)]),_0x28eb79=await _0x4520e2(_0x1d291e['id']);const _0x1d40f8=_0x2c9cd5(_0x1d291e['id']),_0x5733d2=await journeyResponseToDef(_0x28eb79,_0x1d40f8),_0xfd1772=buildLocalRuleToNameMappingFromJourney(_0x34c17f);_0x56bba2=buildMergedJourneyDef([{'item':_0x1d291e,'yaml':_0x5733d2}],_0xfd1772,_0x6c7d59);}}addFoldersToCreate(_0x1e7cb1,_0x56a045[_0x2bfb91(0x20b)],_0x47fd9e);const _0x577df6=calculateJourneyDiff(_0x34c17f,_0x56bba2);_0x56a00a['push']({'relativePath':_0x34c17f[_0x2bfb91(0x1a5)],'absolutePath':_0x1d91ca,'yamlConfig':_0x34c17f,'folderPath':_0x1e7cb1,'existingJourney':_0x28eb79,'isNew':_0x577df6[_0x2bfb91(0x1ff)],'hasChanges':_0x577df6[_0x2bfb91(0x19c)],'diff':_0x577df6[_0x2bfb91(0x1e7)]});}return{'journeyFiles':_0x56a00a,'foldersToCreate':_0x47fd9e};}export function calculateActivationActions(_0xd564fb,_0x63121f,_0xa416fe,_0x249fb9){const _0x411388=a151_0x3dca48,_0x5e29a6=[],_0x15a792=new Map();for(const _0x4a662e of _0x63121f){_0x15a792[_0x411388(0x153)](_0x4a662e['name'],_0x4a662e);}const _0x42dc9e=new Map();for(const _0x440221 of _0xd564fb){_0x42dc9e[_0x411388(0x153)](_0x440221['name'],_0x440221);}for(const _0x2ca367 of _0xd564fb){const _0x1a5b70=_0x15a792[_0x411388(0x1aa)](_0x2ca367[_0x411388(0x1a5)]);if(!_0x1a5b70)_0x5e29a6[_0x411388(0x19b)]({'type':_0x411388(0x1ac),'name':_0x2ca367['name'],'yamlActivation':_0x2ca367});else{const _0x2fd4f4=activationResponseToDef(_0x1a5b70,_0xa416fe,_0x249fb9),_0x472752=a151_0x2931b5[_0x411388(0x1eb)](_0x2fd4f4),_0x3b428a=a151_0x2931b5[_0x411388(0x1eb)](_0x2ca367);_0x472752!==_0x3b428a&&_0x5e29a6[_0x411388(0x19b)]({'type':_0x411388(0x219),'name':_0x2ca367['name'],'yamlActivation':_0x2ca367,'existingActivation':_0x1a5b70});}}for(const _0x3fd6e3 of _0x63121f){!_0x42dc9e[_0x411388(0x232)](_0x3fd6e3[_0x411388(0x1a5)])&&_0x5e29a6[_0x411388(0x19b)]({'type':_0x411388(0x13d),'name':_0x3fd6e3[_0x411388(0x1a5)],'existingActivation':_0x3fd6e3});}return _0x5e29a6;}function calculateYamlDiff(_0x31f3e5,_0x48b3af){if(_0x48b3af){const _0xbf0aef=generateDiff(_0x48b3af,_0x31f3e5),_0x4732fd=hasChanges(_0xbf0aef);return{'isNew':![],'hasChanges':_0x4732fd,'diff':_0x4732fd?formatDiffWithColors(_0xbf0aef):undefined};}const _0x2e7373=generateDiff('',_0x31f3e5);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x2e7373)};}export function calculateSegmentDiff(_0x1ebf9c,_0x42e376,_0x43cc81,_0x137cba,_0x361031){const _0x3082c2=segmentToYamlString(_0x1ebf9c),_0x11fb41=_0x42e376?segmentToYamlString(segmentWithActivationsToYaml(_0x42e376,_0x43cc81,undefined,_0x137cba,_0x361031)):undefined;return calculateYamlDiff(_0x3082c2,_0x11fb41);}export function calculateJourneyDiff(_0x46bc43,_0x56dea3){const _0x22c06e=normalizeJourneyDef(_0x46bc43,_0x46bc43),_0x1f5817=a151_0x290451(_0x22c06e),_0x5d5f81=_0x56dea3?a151_0x290451(normalizeJourneyDef(_0x56dea3,_0x46bc43)):undefined;return calculateYamlDiff(_0x1f5817,_0x5d5f81);}export function findSegmentsToDelete(_0x3df532,_0x100da5,_0x3cc047,_0x5dfbfa,_0x3fd8f8){const _0xeae45f=a151_0x3dca48,_0xcce7da=new Set();for(const {yamlConfig:_0x3e8b48,folderPath:_0x4d0884}of _0x100da5){_0xcce7da['add'](_0x4d0884+':'+_0x3e8b48[_0xeae45f(0x1a5)]);}return _0x3df532[_0xeae45f(0x1f1)](_0x6faee1=>{const _0x24a512=_0xeae45f,_0x10fc9d=_0x6faee1[_0x24a512(0x17c)]?_0x3cc047[_0x24a512(0x1aa)](_0x6faee1['segmentFolderId']['toString']())||'':'',_0x5cd46b=_0x10fc9d+':'+_0x6faee1[_0x24a512(0x1a5)];if(_0xcce7da[_0x24a512(0x232)](_0x5cd46b))return![];if(_0x3fd8f8)return _0x10fc9d===_0x5dfbfa||_0x10fc9d[_0x24a512(0x1fb)](_0x5dfbfa+'/');return!![];});}export function findJourneysToDelete(_0x43cd30,_0x536e1c,_0x5ed8b6,_0xba4ece,_0x566dbc){const _0x514e0a=a151_0x3dca48,_0x20cd02=new Set();for(const {yamlConfig:_0x4a1541,folderPath:_0x493b51}of _0x536e1c){_0x20cd02[_0x514e0a(0x158)](_0x493b51+':'+_0x4a1541['name']);}return _0x43cd30['filter'](_0x2dc986=>{const _0x191c0a=_0x514e0a,_0x53b679=_0x2dc986[_0x191c0a(0x18c)]?_0x5ed8b6[_0x191c0a(0x1aa)](_0x2dc986[_0x191c0a(0x18c)])||'':'',_0x512f25=_0x53b679+':'+_0x2dc986['journeyBundleName'];if(_0x20cd02[_0x191c0a(0x232)](_0x512f25))return![];if(_0x566dbc)return _0x53b679===_0xba4ece||_0x53b679[_0x191c0a(0x1fb)](_0xba4ece+'/');return!![];});}export function buildSegmentLookupMap(_0x1c1373,_0x1c0b8d){const _0x49ff21=a151_0x3dca48,_0x5ce5da=new Map();for(const _0x12335e of _0x1c1373){const _0x27b48b=_0x12335e[_0x49ff21(0x17c)]?_0x1c0b8d[_0x49ff21(0x1aa)](_0x12335e['segmentFolderId'][_0x49ff21(0x1b9)]())||'':'',_0x3e5556=_0x27b48b+':'+_0x12335e[_0x49ff21(0x1a5)];_0x5ce5da['set'](_0x3e5556,_0x12335e);}return _0x5ce5da;}export function buildSegmentNameToIdMap(_0x71b7f4){const _0x2ebf65=a151_0x3dca48,_0x1159d1=new Map();for(const _0x704d82 of _0x71b7f4){_0x1159d1[_0x2ebf65(0x153)](_0x704d82[_0x2ebf65(0x1a5)],_0x704d82['id']);}return _0x1159d1;}export function buildJourneyBundleLookupMap(_0x53abcd,_0x42a387){const _0x5951c4=a151_0x3dca48,_0x172225=new Map();for(const _0x4a0fc8 of _0x53abcd){const _0x4044ef=_0x4a0fc8[_0x5951c4(0x18c)]?_0x42a387[_0x5951c4(0x1aa)](_0x4a0fc8[_0x5951c4(0x18c)])||'':'',_0x103131=_0x4044ef+':'+_0x4a0fc8['journeyBundleName'];!_0x172225[_0x5951c4(0x232)](_0x103131)&&_0x172225['set'](_0x103131,[]),_0x172225[_0x5951c4(0x1aa)](_0x103131)['push'](_0x4a0fc8);}for(const _0x8e2f66 of _0x172225[_0x5951c4(0x23b)]()){_0x8e2f66[_0x5951c4(0x1e0)]((_0x411f88,_0x305e68)=>(_0x411f88['versionNumber']||0x0)-(_0x305e68[_0x5951c4(0x242)]||0x0));}return _0x172225;}export function collectFoldersToCreate(_0x152f17,_0x48578f){const _0x1e1007=a151_0x3dca48,_0x4176aa=new Set();for(const _0xc12643 of _0x152f17){if(!_0xc12643)continue;if(_0x48578f[_0x1e1007(0x232)](_0xc12643))continue;const _0x18c950=_0xc12643[_0x1e1007(0x1d3)]('/');let _0x2b6240='';for(const _0x44235a of _0x18c950){_0x2b6240=_0x2b6240?_0x2b6240+'/'+_0x44235a:_0x44235a,!_0x48578f[_0x1e1007(0x232)](_0x2b6240)&&_0x4176aa[_0x1e1007(0x158)](_0x2b6240);}}return _0x4176aa;}function a151_0x4fc4(){const _0x42efe5=['logSuccess','\x27\x20decision\x20point\x20branch\x20\x27','flatMap','created','journeyById','versionNumber','getSegmentEntity','__pending_','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','includes','localName','conditions','dirname','embedded_segment_created','description','conditionSegmentId','delete','onProgress','connector_config','getLatestJourneyId','columns','behavior','keys','nameToId','some','embedded_segment_creating','segment_updating','activation_','results','length','journeyActivationNameToId','deleteActivation','unchanged','idToName','Updated\x20journey\x20\x27','journeyActivationStepId','skipSegments','segmentNameToId','set','SEGMENT_SYNTAX_ERROR','absolutePath','Deleted\x20activation\x20\x27','null','add','Activation\x20not\x20found:\x20','kind','logDeleted','nameToType','object','activationContext','15826356HrZbqI','Created\x20journey\x20\x27','replace','isArray','Fetching\x20','updated','createActivation','journey_entry_criteria_','item','journeyId','getJourney','existingActivation','deleteSegment','validatedRequest','Entry\x20criteria:\x20','\x20error(s)','4HwEtae','steps','digest','activation_created','entry','relationships','all','createFolder','Failed\x20to\x20resolve\x20activation\x20','index','activation_deleting','):\x20','existingJourney','segmentFolderId','activation_updated','schedule','23190BkHVNa','INTERNAL',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','\x20(referenced\x20in\x20journey\x20','waitStep','Stage\x20\x27','Duration','toISOString','data','resolvedRule','trim','segments','getActivation','folderId','max','Deleted\x20segment\x20\x27','entryCriteria','9OaYwzY','Creating\x20segment\x20\x27','existingSegments','rootFolderId','relative','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','utf-8','447357Vduqlu','Updated\x20activation\x20\x27','\x27\x20for\x20','user','push','hasChanges','match','Condition','Failed\x20to\x20fetch\x20referenced\x20segment\x20','getSegment\x20failed\x20for\x20','2967153jWNPCJ','journeyBundlesByFolderAndName','size','createdSegmentId','name','\x20journey\x20from\x20file:\x20','\x27\x20from\x20file:\x20','./child-segment-yaml.js','deleted','get','errors','create','Delete\x20the\x20push\x20recovery\x20file\x20(','waitStepUnit','run_after_journey_refresh','\x0a\x20\x20','6785816MfNkBJ','embedded_activation_created','entry_criteria','waitStepType','join','segment','resolveSegment','journey_created','toString','withProgress','\x20activation\x20\x27','\x27\x20wait\x20condition','activation_updating','draft','fetchJourney','parentFolder','stage\x20\x27','existingSegment','slice','journeyStages','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','updateSegmentById','\x27\x20exit\x20criteria','Updated\x20segment\x20\x27','and\x20the\x20server\x20segment,\x20then\x20retry.','ACTIVATION_UPDATE_ERROR','embedded_activation_creating','activationParams','stages','exitCriterias','parentId','Creating\x20folder\x20\x27','Created\x20activation\x20\x27','journeyName','split','Segment\x20not\x20found:\x20','debug','list','logInfo','315OlZsJA','idToEmailMap','6830PqGLCo','conditionTimeoutUnit','reduce','with','parse','conditionTimeoutDuration','sort','connectionIdToNameMap','\x27\x20not\x20found\x20in\x20journey\x20\x27','segment_creating','SEGMENT_UPDATE_ERROR','verbose','message','diff','journeys','journeyBundleId','createSegment','stringify','attributes','type','ACTIVATION_SYNTAX_ERROR','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','5357UoNTLm','filter','WaitStep','yamlConfig','deps','segmentId','uniqueSegmentName','\x20segment\x20from\x20file:\x20','Segment\x20not\x20found','Matched\x20server\x20segment\x20\x27','\x27\x20entry\x20criteria','startsWith','activation_deleted','progress','__pending_act_','isNew','6367DkhexU','journey_creating','tdx.sdk.push-workflow','toLowerCase','folder_created','find','\x27\x20by\x20rule\x20content','valid','segment_deleting','Created\x20folder\x20\x27','parentSegmentFolder','folderPathToId','parseDocument','activations','hex','Activation','createJourneySegment','segment_deleted',').\x20','buildUserMaps','rule','\x27...','folderPath','resolveJourneyId','action','update','journeyBundleName','activationsBySegmentId','decision_point','Failed\x20to\x20resolve\x20segment\x20','journey_updated','Updating\x20segment\x20\x27','DecisionPoint','activation_template_id','updateActivation','embeddedSegmentNameToId','300wMEyMY','segment_created','Embedded\x20segment\x20\x27','from','activationStepsById','journey','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','SEGMENT_NOT_FOUND','../../utils/async.js','activationActions','./journey-yaml.js','Failed\x20to\x20','goal','connection','has','Deleting\x20activation\x20\x27','branches','.$1.push-recovery.json','effectiveFolderId','map','sha1','state','milestone','values','uniqueServerName'];a151_0x4fc4=function(){return _0x42efe5;};return a151_0x4fc4();}export function parseAndClassifyYamlFiles(_0xc54357,_0x283789,_0x45aa13){const _0x42924f=a151_0x3dca48,_0x9fc425=[],_0x1ce793=[];for(const _0xac5b7c of _0xc54357){const _0x5c39d9=a151_0x38937e[_0x42924f(0x194)](_0x283789,a151_0x38937e[_0x42924f(0x139)](_0xac5b7c)),_0x2bbf1b=_0x5c39d9==='.'?'':_0x5c39d9,_0x5cbbed=readFileSync(_0xac5b7c,_0x42924f(0x196)),_0x15029c=a151_0x2931b5['parse'](_0x5cbbed);if(isJourneyDef(_0x15029c)){const _0x2789b8=a151_0x1f20c(_0x5cbbed);_0x1ce793['push']({'yamlConfig':_0x2789b8,'folderPath':_0x2bbf1b,'sourcePath':_0xac5b7c});}else{if(!_0x45aa13?.[_0x42924f(0x151)]){const _0x254b69=parseSegmentYamlFile(_0x5cbbed),_0x72ac82=normalizeChildSegmentYaml(_0x254b69);_0x9fc425[_0x42924f(0x19b)]({'yamlConfig':_0x72ac82,'folderPath':_0x2bbf1b,'sourcePath':_0xac5b7c});}}}return{'segments':_0x9fc425,'journeys':_0x1ce793};}export function validateParsedFiles(_0x7d84ff,_0x4996c0){const _0x2ae70c=a151_0x3dca48,_0x490818=[];for(const {yamlConfig:_0x3b59d6,sourcePath:_0x230459}of _0x7d84ff['segments']){const _0x884093=readFileSync(_0x230459,_0x2ae70c(0x196)),_0xcef6e0=a151_0x2931b5[_0x2ae70c(0x20c)](_0x884093),_0x4a7d0=validateSegmentDef(_0x3b59d6,{'source':_0x884093,'document':_0xcef6e0},{'skipSchema':!![]});if(!_0x4a7d0[_0x2ae70c(0x207)]){const _0x236a58=a151_0x38937e[_0x2ae70c(0x194)](_0x4996c0,_0x230459);_0x490818[_0x2ae70c(0x19b)]({'filePath':_0x236a58,'source':_0x884093,'result':_0x4a7d0,'isJourney':![]});}}for(const {yamlConfig:_0x209bb9,sourcePath:_0x26a476}of _0x7d84ff[_0x2ae70c(0x1e8)]){const _0x2215e2=readFileSync(_0x26a476,_0x2ae70c(0x196)),_0x4a6488=a151_0x2931b5[_0x2ae70c(0x20c)](_0x2215e2),_0x583fbc=validateJourneyDef(_0x209bb9,{'source':_0x2215e2,'document':_0x4a6488},{'skipSchema':!![]});if(!_0x583fbc[_0x2ae70c(0x207)]){const _0x285ae1=a151_0x38937e[_0x2ae70c(0x194)](_0x4996c0,_0x26a476);_0x490818[_0x2ae70c(0x19b)]({'filePath':_0x285ae1,'source':_0x2215e2,'result':_0x583fbc,'isJourney':!![]});}}return _0x490818;}export function formatValidationErrors(_0x31dca3){const _0x41c2f5=a151_0x3dca48,_0x17e62e=[];for(const {filePath:_0x1da823,source:_0xdcca98,result:_0x33b642,isJourney:_0x5e7476}of _0x31dca3){const _0x55b25a=_0x5e7476?_0x41c2f5(0x229):_0x41c2f5(0x1b6);_0x17e62e[_0x41c2f5(0x19b)]('\x0a'+_0x1da823+'\x20('+_0x55b25a+_0x41c2f5(0x17a)+_0x33b642[_0x41c2f5(0x1ab)]['length']+_0x41c2f5(0x16e)),_0x17e62e[_0x41c2f5(0x19b)](formatValidationResult(_0x33b642,_0xdcca98,_0x1da823));}return _0x17e62e[_0x41c2f5(0x1b5)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x48a3ad){const _0x25e2a3=a151_0x3dca48,_0xb3f72c=new Set(),_0x3a4674=new Map(),_0x36f210=collectSegmentUsageCounts(_0x48a3ad);if(_0x48a3ad[_0x25e2a3(0x18a)])for(const [_0x29e925,_0x58f9b6]of Object['entries'](_0x48a3ad[_0x25e2a3(0x18a)])){_0xb3f72c[_0x25e2a3(0x158)](_0x29e925);if(_0x58f9b6[_0x25e2a3(0x214)]){const _0x42db2c=yamlRuleToApi(_0x58f9b6[_0x25e2a3(0x214)]),_0x1d586f=apiRuleToYaml(_0x42db2c);_0x3a4674['set'](_0x29e925,_0x1d586f);}}const _0x3a1d41=new Map();let _0x5af6c7=0x0;for(const [_0x5e5ce9,_0x1ea9ad]of _0x3a4674){const _0x258bc6=serializeExpandedRule(_0x1ea9ad,_0x3a4674),_0x432ed2=_0x3a1d41['get'](_0x258bc6)||[];_0x432ed2[_0x25e2a3(0x19b)]({'name':_0x5e5ce9,'index':_0x5af6c7}),_0x3a1d41['set'](_0x258bc6,_0x432ed2),_0x5af6c7++;}const _0x13c52d=new Map();for(const [_0x5cb3a4,_0x456768]of _0x3a1d41){const _0x28d60e=_0x456768['slice']()[_0x25e2a3(0x1e0)]((_0x33995d,_0x24950b)=>{const _0x513bd2=_0x25e2a3,_0x321715=_0x36f210[_0x513bd2(0x1aa)](_0x33995d[_0x513bd2(0x1a5)])||0x0,_0xea091f=_0x36f210[_0x513bd2(0x1aa)](_0x24950b[_0x513bd2(0x1a5)])||0x0;if(_0x321715!==_0xea091f)return _0xea091f-_0x321715;return _0x33995d[_0x513bd2(0x178)]-_0x24950b[_0x513bd2(0x178)];})[_0x25e2a3(0x237)](_0x4c4090=>_0x4c4090['name']),_0x3961ec=[];for(const _0x411f81 of _0x28d60e){const _0x35e9ef=_0x36f210[_0x25e2a3(0x1aa)](_0x411f81)||0x0,_0x2d9be0=Math['max'](_0x35e9ef,0x1);for(let _0x16ef2c=0x0;_0x16ef2c<_0x2d9be0;_0x16ef2c++){_0x3961ec[_0x25e2a3(0x19b)](_0x411f81);}}_0x13c52d['set'](_0x5cb3a4,_0x3961ec);}return{'existingLocalSegmentNames':_0xb3f72c,'localSegmentRules':_0x3a4674,'localExpandedRuleToNames':_0x13c52d};}export function createSegmentIdResolver(_0x4d514b,_0x4df41d){return async _0x1fd123=>{const _0xdb2207=a151_0x1b24,_0x1865f8=_0x4d514b['get'](_0x1fd123);if(!_0x1865f8)throw new SDKError(ErrorCode[_0xdb2207(0x22b)],_0xdb2207(0x1d4)+_0x1fd123+_0xdb2207(0x195)+_0x4df41d+'\x27)');return _0x1865f8;};}export function extractRootFolderId(_0x24801b){const _0x57e7d4=a151_0x3dca48;return _0x24801b['relationships']?.[_0x57e7d4(0x20a)]?.[_0x57e7d4(0x187)]?.['id']||_0x24801b['relationships']?.[_0x57e7d4(0x1c0)]?.['data']?.['id'];}export function buildConnectionMaps(_0xbc87e1){const _0x3d497d=a151_0x3dca48,_0x55bb40=new Map(),_0x22b5cf=new Map(),_0x85ac71=new Map();for(const _0x494a57 of _0xbc87e1){_0x55bb40['set'](_0x494a57['name'],parseInt(_0x494a57['id'],0xa)),_0x22b5cf['set'](_0x494a57['id'],_0x494a57[_0x3d497d(0x1a5)]),_0x85ac71[_0x3d497d(0x153)](_0x494a57[_0x3d497d(0x1a5)],_0x494a57[_0x3d497d(0x1ed)]);}return{'nameToId':_0x55bb40,'idToName':_0x22b5cf,'nameToType':_0x85ac71};}export function calculatePushStats(_0x10e260,_0x5247c5,_0x12f293,_0x11d4a1,_0x45cbae,_0x30442e,_0x571759){const _0x5cf736=a151_0x3dca48,_0x180ade=_0x10e260[_0x5cf736(0x1f1)](_0x787e1f=>_0x787e1f[_0x5cf736(0x1ff)]),_0xdddd91=_0x10e260[_0x5cf736(0x1f1)](_0x43685d=>!_0x43685d[_0x5cf736(0x1ff)]&&_0x43685d['hasChanges']),_0xb1d50d=_0x10e260['filter'](_0x599ff8=>!_0x599ff8['isNew']&&!_0x599ff8[_0x5cf736(0x19c)]),_0x320822=_0x30442e?_0x11d4a1:[],_0x2de646=_0x5247c5[_0x5cf736(0x1f1)](_0x33a463=>_0x33a463[_0x5cf736(0x1ff)]),_0x57810a=_0x5247c5[_0x5cf736(0x1f1)](_0x370d23=>!_0x370d23['isNew']&&_0x370d23[_0x5cf736(0x19c)]),_0x460f55=_0x5247c5['filter'](_0x478144=>!_0x478144[_0x5cf736(0x1ff)]&&!_0x478144[_0x5cf736(0x19c)]),_0x26eaeb=_0x30442e?_0x45cbae:[],_0x528344=_0x10e260[_0x5cf736(0x23f)](_0x44385c=>_0x44385c[_0x5cf736(0x22d)]),_0x2b7315=_0x528344[_0x5cf736(0x1f1)](_0x5d1133=>_0x5d1133[_0x5cf736(0x1ed)]===_0x5cf736(0x1ac)),_0x57d97d=_0x528344[_0x5cf736(0x1f1)](_0x2c801a=>_0x2c801a[_0x5cf736(0x1ed)]===_0x5cf736(0x219)),_0x3665e0=_0x528344[_0x5cf736(0x1f1)](_0xd21027=>_0xd21027[_0x5cf736(0x1ed)]==='delete'),_0x1b70d6=Array[_0x5cf736(0x227)](_0x12f293)[_0x5cf736(0x1e0)](),_0xb260e9=_0x571759?![]:_0x180ade[_0x5cf736(0x14a)]>0x0||_0xdddd91[_0x5cf736(0x14a)]>0x0||_0x320822[_0x5cf736(0x14a)]>0x0,_0x471b93=_0x2de646['length']>0x0||_0x57810a['length']>0x0||_0x26eaeb[_0x5cf736(0x14a)]>0x0,_0x35ce2c=_0x571759?![]:_0x528344[_0x5cf736(0x14a)]>0x0,_0x22f0b0=_0x1b70d6['length']>0x0;return{'segments':{'new':_0x180ade,'changed':_0xdddd91,'unchanged':_0xb1d50d,'toDelete':_0x320822},'journeys':{'new':_0x2de646,'changed':_0x57810a,'unchanged':_0x460f55,'toDelete':_0x26eaeb},'activations':{'all':_0x528344,'toCreate':_0x2b7315,'toUpdate':_0x57d97d,'toDelete':_0x3665e0},'folders':{'toCreate':_0x1b70d6},'counts':{'segments':{'new':_0x180ade[_0x5cf736(0x14a)],'changed':_0xdddd91[_0x5cf736(0x14a)],'unchanged':_0xb1d50d[_0x5cf736(0x14a)],'toDelete':_0x320822[_0x5cf736(0x14a)]},'journeys':{'new':_0x2de646[_0x5cf736(0x14a)],'changed':_0x57810a['length'],'unchanged':_0x460f55['length'],'toDelete':_0x26eaeb[_0x5cf736(0x14a)]},'activations':{'create':_0x2b7315[_0x5cf736(0x14a)],'update':_0x57d97d[_0x5cf736(0x14a)],'delete':_0x3665e0[_0x5cf736(0x14a)]},'folders':_0x1b70d6[_0x5cf736(0x14a)]},'hasChanges':_0xb260e9||_0x471b93||_0x35ce2c||_0x22f0b0};}export async function buildPushExecutionContext(_0x560401,_0x26b117,_0x3ea727,_0x3b9bab,_0x22765c,_0x48c2a8){const _0x23f235=a151_0x3dca48,_0x10a3ef=extractRootFolderId(_0x3ea727),{pathToId:_0x12ce25,idToPath:_0x546db8}=buildFolderMaps(_0x22765c),_0x36b12b=buildSegmentNameToIdMap(_0x3b9bab),_0x3a8555=new Map(),{batchAsync:_0x5f0eb9}=await import(_0x23f235(0x22c)),[_0x277e79,_0x4bd1f8]=await Promise[_0x23f235(0x175)]([_0x560401[_0x23f235(0x19a)][_0x23f235(0x213)](),_0x560401[_0x23f235(0x231)][_0x23f235(0x1d6)](),((async()=>{const _0x2545c7=_0x23f235;!_0x48c2a8&&_0x3b9bab[_0x2545c7(0x14a)]>0x0&&await _0x5f0eb9(_0x3b9bab,async _0x356ccf=>{const _0x32e3f2=_0x2545c7,_0xf2ec06=await _0x560401['segment']['listActivations'](_0x26b117,_0x356ccf['id']);_0x3a8555[_0x32e3f2(0x153)](_0x356ccf['id'],_0xf2ec06);});})())]),{emailToId:_0x1529c1,idToEmail:_0x4a8402}=_0x277e79,_0x2a523f=buildConnectionMaps(_0x4bd1f8);return{'rootFolderId':_0x10a3ef,'folderPathToId':_0x12ce25,'folderIdToPath':_0x546db8,'segmentNameToId':_0x36b12b,'activationsBySegmentId':_0x3a8555,'emailToIdMap':_0x1529c1,'idToEmailMap':_0x4a8402,'connectionNameToIdMap':_0x2a523f[_0x23f235(0x144)],'connectionIdToNameMap':_0x2a523f[_0x23f235(0x14e)],'connectionNameToTypeMap':_0x2a523f[_0x23f235(0x15c)]};}export function createPushYamlContextForBundle(_0x42fe70,_0x34d3b2,_0x5cc2fc,_0x294136,_0x2bd79c,_0x3e6161,_0x5e7dfc,_0x256a1a){const {existingLocalSegmentNames:_0xa30759,localExpandedRuleToNames:_0x15172d}=_0x294136,_0x90f283=new Set(),_0x29b9f6=new Map(),_0xa1e6d2=new Map(),_0x557b45=new Map(),_0x5ae371=createJumpTargetCache(),_0x4517da=new Map(),_0x454ff0=new Map(),_0x2c9cf0=new Set();let _0x575070;const _0x58713b=_0x1545c1=>{const _0x2586e9={'resolveSegment':async _0x29a2ff=>{const _0x243c3a=a151_0x1b24,_0x2370c2=_0x557b45['get'](_0x29a2ff);if(_0x2370c2!==undefined)return{'name':_0x2370c2,'isJourneyLocal':!![]};try{const _0x1d65cd=await fetchSegment(_0x42fe70,_0x34d3b2,_0x29a2ff,_0x5cc2fc);if(!_0x1d65cd)throw new Error(_0x243c3a(0x1f8));const _0x4bc1a7=generateJourneyLocalName(_0x1d65cd[_0x243c3a(0x1a5)]),_0x112bb7=_0x1d65cd[_0x243c3a(0x15a)]===SEGMENT_KIND_JOURNEY&&_0x4bc1a7!==undefined;let _0x20dfab=_0x1d65cd['name'],_0x399223;if(_0x112bb7&&_0x1d65cd[_0x243c3a(0x214)]){const _0x383af0=apiRuleToYaml(_0x1d65cd[_0x243c3a(0x214)]);_0x454ff0['set'](_0x29a2ff,_0x383af0);const _0x59d6e3=async _0x54bc19=>{const _0x2d4ed9=_0x243c3a,_0x8eac36=collectSegmentRefsFromRule(_0x54bc19);for(const _0xb140f6 of _0x8eac36){if(!_0x454ff0[_0x2d4ed9(0x232)](_0xb140f6))try{const _0x4ca77c=await fetchSegment(_0x42fe70,_0x34d3b2,_0xb140f6,_0x5cc2fc);if(_0x4ca77c?.['rule']){const _0x28a7e7=apiRuleToYaml(_0x4ca77c[_0x2d4ed9(0x214)]);_0x454ff0['set'](_0xb140f6,_0x28a7e7),await _0x59d6e3(_0x28a7e7);}}catch(_0x3905a4){logger['debug'](_0x2d4ed9(0x19f)+_0xb140f6+':\x20'+_0x3905a4);}}};await _0x59d6e3(_0x383af0);const _0x274005=serializeExpandedRule(_0x383af0,_0x454ff0),_0x5b560f=_0x15172d[_0x243c3a(0x1aa)](_0x274005);if(_0x5b560f&&_0x5b560f['length']>0x0){const _0xbeef08=_0x29b9f6[_0x243c3a(0x1aa)](_0x274005)||0x0,_0x28a7ba=_0x5b560f[_0xbeef08]||_0x5b560f[_0x5b560f[_0x243c3a(0x14a)]-0x1];_0x29b9f6[_0x243c3a(0x153)](_0x274005,_0xbeef08+0x1),_0x20dfab=_0x28a7ba,_0x90f283[_0x243c3a(0x158)](_0x20dfab),_0x557b45[_0x243c3a(0x153)](_0x29a2ff,_0x20dfab);const _0x5dc018=await resolveRuleSegmentRefs(_0x383af0,async _0x3919f6=>{const _0x19fa74=_0x243c3a,_0x2a548d=_0x557b45[_0x19fa74(0x1aa)](_0x3919f6);if(_0x2a548d)return _0x2a548d;const _0x48c867=await _0x575070[_0x19fa74(0x1b7)](_0x3919f6);return _0x48c867[_0x19fa74(0x1a5)];});_0x399223={'description':_0x1d65cd[_0x243c3a(0x13b)],'rule':_0x5dc018};}else{const _0x33c549=_0x4517da[_0x243c3a(0x1aa)](_0x274005);if(_0x33c549)_0x20dfab=_0x33c549,_0x557b45[_0x243c3a(0x153)](_0x29a2ff,_0x20dfab);else{if(_0x4bc1a7){let _0xb13d1c=_0x4bc1a7,_0x29bc7f=0x2;while(_0x90f283[_0x243c3a(0x232)](_0xb13d1c)||_0xa30759[_0x243c3a(0x232)](_0xb13d1c)){_0xb13d1c=_0x4bc1a7+'_'+_0x29bc7f,_0x29bc7f++;}_0x90f283['add'](_0xb13d1c),_0x20dfab=_0xb13d1c;}_0x557b45[_0x243c3a(0x153)](_0x29a2ff,_0x20dfab),_0x4517da[_0x243c3a(0x153)](_0x274005,_0x20dfab);const _0x19514e=await resolveRuleSegmentRefs(_0x383af0,async _0x5320df=>{const _0x53f9d8=_0x243c3a,_0x9bebb4=_0x557b45[_0x53f9d8(0x1aa)](_0x5320df);if(_0x9bebb4)return _0x9bebb4;const _0x2cd45a=await _0x575070[_0x53f9d8(0x1b7)](_0x5320df);return _0x2cd45a[_0x53f9d8(0x1a5)];});_0x399223={'description':_0x1d65cd[_0x243c3a(0x13b)],'rule':_0x19514e};}}}return{'name':_0x20dfab,'isJourneyLocal':_0x112bb7,'definition':_0x399223};}catch(_0x429464){return logger[_0x243c3a(0x1d5)](_0x243c3a(0x21d)+_0x29a2ff+':\x20'+_0x429464),{'name':_0x29a2ff,'isJourneyLocal':![]};}},'resolveActivation':async _0x43e1ef=>{const _0x433c84=a151_0x1b24,_0x1d84c0=_0xa1e6d2[_0x433c84(0x1aa)](_0x43e1ef);if(_0x1d84c0!==undefined)return{'name':_0x1d84c0,'isJourneyLocal':!![]};try{let _0x4ae26e=_0x5e7dfc?.[_0x433c84(0x1aa)](_0x43e1ef);!_0x4ae26e&&(_0x4ae26e=await _0x42fe70[_0x433c84(0x229)][_0x433c84(0x18b)](_0x1545c1,_0x43e1ef));const _0x37ed4a=_0x4ae26e['attributes'][_0x433c84(0x1cc)][_0x433c84(0x1a5)]||_0x43e1ef,_0x3d4df9=sanitizeYamlKey(_0x37ed4a)||_0x433c84(0x148)+_0x43e1ef,_0x48e9cb=_0x3d4df9;_0xa1e6d2['set'](_0x43e1ef,_0x48e9cb);const _0xa390a4=journeyActivationStepToYaml(_0x4ae26e,_0x2bd79c,_0x3e6161);return{'name':_0x48e9cb,'isJourneyLocal':!![],'definition':_0xa390a4};}catch(_0xcefd14){return logger[_0x433c84(0x1d5)](_0x433c84(0x177)+_0x43e1ef+':\x20'+_0xcefd14),{'name':_0x43e1ef,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x1a7458,_0x430156)=>resolveJumpTarget(_0x1a7458,_0x430156,_0x5ae371,async _0x462d33=>{const _0x3bbcba=a151_0x1b24,_0x4198e3=_0x256a1a?.[_0x3bbcba(0x1aa)](_0x462d33);if(_0x4198e3)return _0x4198e3;return _0x42fe70[_0x3bbcba(0x229)][_0x3bbcba(0x169)](_0x462d33);})};return _0x575070=_0x2586e9,_0x2586e9;},_0x3c09ca=async _0x4e40f0=>{const _0x52b17a=a151_0x1b24,{collectSegmentIdsFromJourneyApi:_0xe5f7ca}=await import(_0x52b17a(0x22e)),{batchAsync:_0x389cfe}=await import(_0x52b17a(0x22c)),_0x47243f=new Set();for(const _0x3a9f03 of _0x4e40f0){let _0x4cb90a=_0x256a1a?.[_0x52b17a(0x1aa)](_0x3a9f03);!_0x4cb90a&&(_0x4cb90a=await _0x42fe70[_0x52b17a(0x229)][_0x52b17a(0x169)](_0x3a9f03));const _0x58f55e=_0xe5f7ca(_0x4cb90a);for(const _0xba5027 of _0x58f55e){_0x47243f[_0x52b17a(0x158)](_0xba5027);}}let _0x5412ad=Array[_0x52b17a(0x227)](_0x47243f);while(_0x5412ad[_0x52b17a(0x14a)]>0x0){const _0x11b6ea=_0x5412ad[_0x52b17a(0x1f1)](_0x4f2579=>!_0x2c9cf0[_0x52b17a(0x232)](_0x4f2579));if(_0x11b6ea[_0x52b17a(0x14a)]===0x0)break;const _0xd54d06=await _0x389cfe(_0x11b6ea,async _0x45e79f=>{_0x2c9cf0['add'](_0x45e79f);const _0x3323e2=await fetchSegment(_0x42fe70,_0x34d3b2,_0x45e79f,_0x5cc2fc);if(!_0x3323e2)return null;return{'segmentId':_0x45e79f,'segment':_0x3323e2};},0xa),_0x4e4633=new Set();for(const _0x3cf0b4 of _0xd54d06){if(!_0x3cf0b4?.[_0x52b17a(0x1b6)]?.[_0x52b17a(0x214)])continue;const _0x17a842=apiRuleToYaml(_0x3cf0b4[_0x52b17a(0x1b6)][_0x52b17a(0x214)]);_0x454ff0[_0x52b17a(0x153)](_0x3cf0b4['segmentId'],_0x17a842);const _0x31a6d6=collectSegmentRefsFromRule(_0x17a842);for(const _0x54906d of _0x31a6d6){!_0x2c9cf0[_0x52b17a(0x232)](_0x54906d)&&_0x4e4633[_0x52b17a(0x158)](_0x54906d);}}_0x5412ad=Array[_0x52b17a(0x227)](_0x4e4633);}};return{'createYamlContext':_0x58713b,'prefetchJourneySegments':_0x3c09ca};}export async function executePushSegments(_0x1c639b,_0x2fd7f9,_0x273b0e,_0x105280,_0x2bb0a5){const _0x4f5173=a151_0x3dca48,{segmentDefToCreateRequest:_0x1495d2,segmentDefToUpdateRequest:_0x1f564a}=await import(_0x4f5173(0x1a8)),_0x3a9af6=_0x273b0e[_0x4f5173(0x20b)],_0x54438d=0x5,_0x2389c8=async _0x5a202e=>{const _0x57841e=_0x4f5173,_0x191adf=_0x5a202e[_0x57841e(0x216)]?_0x3a9af6[_0x57841e(0x1aa)](_0x5a202e[_0x57841e(0x216)]):undefined;let _0x4274c4;const _0x5a1d7c={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x26cee9=_0x5a202e[_0x57841e(0x1f3)];if(_0x5a202e[_0x57841e(0x1f3)][_0x57841e(0x214)]){const _0x303c14=createSegmentIdResolver(_0x273b0e['segmentNameToId'],_0x5a202e[_0x57841e(0x1f3)][_0x57841e(0x1a5)]),_0x3bb1dc=await resolveRuleSegmentIds(_0x5a202e['yamlConfig'][_0x57841e(0x214)],_0x303c14);_0x26cee9={..._0x5a202e[_0x57841e(0x1f3)],'rule':_0x3bb1dc};}try{if(_0x5a202e[_0x57841e(0x1ff)]){_0x2bb0a5['onProgress']?.({'type':_0x57841e(0x1e3),'name':_0x5a202e[_0x57841e(0x1f3)][_0x57841e(0x1a5)]});const _0x383b2a=_0x1495d2(_0x26cee9,_0x191adf),_0xab3038=await _0x2bb0a5['withProgress'](_0x57841e(0x191)+_0x5a202e[_0x57841e(0x1f3)][_0x57841e(0x1a5)]+_0x57841e(0x215),()=>_0x1c639b[_0x57841e(0x1b6)][_0x57841e(0x1ea)](_0x105280[_0x57841e(0x1cf)],_0x383b2a));_0x4274c4=_0xab3038[_0x57841e(0x187)]['id'],_0x273b0e[_0x57841e(0x152)]['set'](_0x5a202e[_0x57841e(0x1f3)]['name'],_0x4274c4),_0x5a1d7c[_0x57841e(0x1a4)]={'name':_0x5a202e[_0x57841e(0x1f3)][_0x57841e(0x1a5)],'id':_0x4274c4},_0x2bb0a5[_0x57841e(0x13e)]?.({'type':_0x57841e(0x225),'name':_0x5a202e[_0x57841e(0x1f3)][_0x57841e(0x1a5)],'segmentId':_0x4274c4}),_0x2bb0a5['logSuccess']?.('Created\x20segment\x20\x27'+_0x5a202e[_0x57841e(0x1f3)][_0x57841e(0x1a5)]+'\x27'),_0x5a1d7c[_0x57841e(0x240)]=0x1;}else{if(_0x5a202e[_0x57841e(0x19c)]){_0x2bb0a5['onProgress']?.({'type':_0x57841e(0x147),'name':_0x5a202e[_0x57841e(0x1f3)]['name']});const _0xd78cf8=_0x1f564a(_0x26cee9);_0x191adf!==_0x5a202e[_0x57841e(0x1c2)]?.[_0x57841e(0x17c)]&&(_0xd78cf8[_0x57841e(0x17c)]=_0x191adf?parseInt(_0x191adf,0xa):undefined),await _0x2bb0a5[_0x57841e(0x1ba)](_0x57841e(0x21f)+_0x5a202e[_0x57841e(0x1f3)][_0x57841e(0x1a5)]+_0x57841e(0x215),()=>_0x1c639b['segment'][_0x57841e(0x1c6)](_0x105280[_0x57841e(0x1cf)],_0x5a202e[_0x57841e(0x1c2)]['id'],_0xd78cf8)),_0x4274c4=_0x5a202e['existingSegment']['id'],_0x2bb0a5['onProgress']?.({'type':'segment_updated','name':_0x5a202e[_0x57841e(0x1f3)][_0x57841e(0x1a5)]}),_0x2bb0a5[_0x57841e(0x23d)]?.(_0x57841e(0x1c8)+_0x5a202e['yamlConfig']['name']+'\x27'),_0x5a1d7c['updated']=0x1;}else _0x4274c4=_0x5a202e['existingSegment']['id'];}}catch(_0x5056c4){const _0x4f2864=isHttp400Error(_0x5056c4),_0x99113a=_0x4f2864?ErrorCode[_0x57841e(0x154)]:ErrorCode[_0x57841e(0x1e4)],_0x3d3ef5=getErrorMessage(_0x5056c4);throw new SDKError(_0x99113a,_0x57841e(0x22f)+(_0x5a202e[_0x57841e(0x1ff)]?_0x57841e(0x1ac):_0x57841e(0x219))+_0x57841e(0x1f7)+_0x5a202e[_0x57841e(0x155)]+'\x0a\x20\x20'+_0x3d3ef5,_0x5056c4);}try{const _0x278fdd=await syncActivationsForSegment(_0x1c639b,_0x105280[_0x57841e(0x1cf)],_0x4274c4,_0x5a202e[_0x57841e(0x1f3)]['name'],_0x5a202e[_0x57841e(0x22d)],_0x2bb0a5,_0x5a202e['absolutePath']);_0x5a1d7c[_0x57841e(0x20d)]=_0x278fdd;}catch(_0x16f85b){if(_0x16f85b instanceof SDKError)throw _0x16f85b;throw new SDKError(ErrorCode[_0x57841e(0x1ca)],'Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27'+_0x5a202e['yamlConfig'][_0x57841e(0x1a5)]+_0x57841e(0x1a7)+_0x5a202e['absolutePath']+_0x57841e(0x1b0)+getErrorMessage(_0x16f85b),_0x16f85b);}return _0x5a1d7c;},_0x58bddb=await batchAsync(_0x2fd7f9,_0x2389c8,_0x54438d),_0x454e53={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x1a5839 of _0x58bddb){_0x454e53[_0x4f5173(0x240)]+=_0x1a5839['created'],_0x454e53[_0x4f5173(0x164)]+=_0x1a5839[_0x4f5173(0x164)],_0x1a5839[_0x4f5173(0x1a4)]&&_0x454e53['createdSegmentIds'][_0x4f5173(0x153)](_0x1a5839[_0x4f5173(0x1a4)][_0x4f5173(0x1a5)],_0x1a5839[_0x4f5173(0x1a4)]['id']),_0x454e53['activations'][_0x4f5173(0x240)]+=_0x1a5839[_0x4f5173(0x20d)]['created'],_0x454e53[_0x4f5173(0x20d)][_0x4f5173(0x164)]+=_0x1a5839['activations'][_0x4f5173(0x164)],_0x454e53[_0x4f5173(0x20d)][_0x4f5173(0x1a9)]+=_0x1a5839['activations'][_0x4f5173(0x1a9)];}return _0x454e53;}async function syncActivationsForSegment(_0x282aac,_0xeb8277,_0xf14a6e,_0x59286c,_0x88186f,_0x2d6df1,_0x5b2211){const _0x165d29=a151_0x3dca48,_0x5751f8={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x474053 of _0x88186f){try{if(_0x474053[_0x165d29(0x1ed)]==='create'&&_0x474053[_0x165d29(0x16c)])_0x2d6df1[_0x165d29(0x13e)]?.({'type':'activation_creating','segmentName':_0x59286c,'activationName':_0x474053[_0x165d29(0x1a5)]}),await _0x2d6df1[_0x165d29(0x1ba)]('Creating\x20activation\x20\x27'+_0x474053['name']+_0x165d29(0x215),()=>_0x282aac['segment'][_0x165d29(0x165)](_0xeb8277,_0xf14a6e,_0x474053[_0x165d29(0x16c)])),_0x2d6df1[_0x165d29(0x13e)]?.({'type':_0x165d29(0x172),'segmentName':_0x59286c,'activationName':_0x474053[_0x165d29(0x1a5)]}),_0x2d6df1[_0x165d29(0x23d)]?.(_0x165d29(0x1d1)+_0x474053['name']+'\x27'),_0x5751f8['created']++;else{if(_0x474053[_0x165d29(0x1ed)]===_0x165d29(0x219)&&_0x474053[_0x165d29(0x16c)]&&_0x474053[_0x165d29(0x16a)])_0x2d6df1[_0x165d29(0x13e)]?.({'type':_0x165d29(0x1bd),'segmentName':_0x59286c,'activationName':_0x474053[_0x165d29(0x1a5)]}),await _0x2d6df1[_0x165d29(0x1ba)]('Updating\x20activation\x20\x27'+_0x474053[_0x165d29(0x1a5)]+_0x165d29(0x215),()=>_0x282aac[_0x165d29(0x1b6)][_0x165d29(0x222)](_0xeb8277,_0xf14a6e,_0x474053[_0x165d29(0x16a)]['id'],_0x474053[_0x165d29(0x16c)])),_0x2d6df1[_0x165d29(0x13e)]?.({'type':_0x165d29(0x17d),'segmentName':_0x59286c,'activationName':_0x474053[_0x165d29(0x1a5)]}),_0x2d6df1['logSuccess']?.(_0x165d29(0x198)+_0x474053['name']+'\x27'),_0x5751f8[_0x165d29(0x164)]++;else _0x474053[_0x165d29(0x1ed)]===_0x165d29(0x13d)&&_0x474053[_0x165d29(0x16a)]&&(_0x2d6df1[_0x165d29(0x13e)]?.({'type':_0x165d29(0x179),'segmentName':_0x59286c,'activationName':_0x474053['name']}),await _0x2d6df1[_0x165d29(0x1ba)](_0x165d29(0x233)+_0x474053['name']+'\x27...',()=>_0x282aac['segment'][_0x165d29(0x14c)](_0xeb8277,_0xf14a6e,_0x474053[_0x165d29(0x16a)]['id'])),_0x2d6df1[_0x165d29(0x13e)]?.({'type':_0x165d29(0x1fc),'segmentName':_0x59286c,'activationName':_0x474053['name']}),_0x2d6df1[_0x165d29(0x15b)]?.(_0x165d29(0x156)+_0x474053[_0x165d29(0x1a5)]+'\x27'),_0x5751f8[_0x165d29(0x1a9)]++);}}catch(_0x13b7d1){const _0x22c695=isHttp400Error(_0x13b7d1),_0x19df42=_0x22c695?ErrorCode[_0x165d29(0x1ee)]:ErrorCode[_0x165d29(0x1ca)],_0x5a273a=getErrorMessage(_0x13b7d1);throw new SDKError(_0x19df42,_0x165d29(0x22f)+_0x474053[_0x165d29(0x1ed)]+_0x165d29(0x1bb)+_0x474053['name']+_0x165d29(0x1a7)+_0x5b2211+_0x165d29(0x1b0)+_0x5a273a,_0x13b7d1);}}return _0x5751f8;}export async function executePushFolders(_0x4618b3,_0x5cd86c,_0x5e1984,_0x431aa8,_0x4a0ee8){const _0x4f8784=a151_0x3dca48,_0x320e99=new Map(_0x5e1984),_0x4980f2=sortFoldersByDepth(_0x5cd86c);for(const _0x5599ad of _0x4980f2){const _0x2e91a1=_0x5599ad['split']('/'),_0x246119=_0x2e91a1[_0x2e91a1[_0x4f8784(0x14a)]-0x1],_0x3f3bc0=_0x2e91a1[_0x4f8784(0x1c3)](0x0,-0x1)[_0x4f8784(0x1b5)]('/'),_0x59a230=_0x320e99[_0x4f8784(0x1aa)](_0x3f3bc0);_0x4a0ee8[_0x4f8784(0x13e)]?.({'type':'folder_creating','folder':_0x5599ad});const _0xf36e2a={'name':_0x246119,'parentFolderId':_0x59a230},_0x31f017=await _0x4a0ee8[_0x4f8784(0x1ba)](_0x4f8784(0x1d0)+_0x5599ad+_0x4f8784(0x215),()=>_0x4618b3[_0x4f8784(0x1b6)][_0x4f8784(0x176)](_0x431aa8['parentId'],_0xf36e2a));_0x320e99[_0x4f8784(0x153)](_0x5599ad,_0x31f017[_0x4f8784(0x187)]['id']),_0x4a0ee8['onProgress']?.({'type':_0x4f8784(0x204),'folder':_0x5599ad,'folderId':_0x31f017[_0x4f8784(0x187)]['id']}),_0x4a0ee8[_0x4f8784(0x1d7)]?.(_0x4f8784(0x209)+_0x5599ad+'\x27');}return _0x320e99;}export async function executePushSegmentDeletions(_0xf124e0,_0x5e5018,_0x40dbb6){const _0x508a2f=a151_0x3dca48;if(_0x5e5018[_0x508a2f(0x14a)]===0x0)return 0x0;const {batchAsync:_0x5446f0}=await import(_0x508a2f(0x22c)),_0x4a1497=0x5,_0x20fd3e=await _0x5446f0(_0x5e5018,async _0x5a82ba=>{const _0x2442b8=_0x508a2f;return _0x40dbb6[_0x2442b8(0x13e)]?.({'type':_0x2442b8(0x208),'name':_0x5a82ba[_0x2442b8(0x1a5)]}),await _0xf124e0['segment'][_0x2442b8(0x16b)](_0x5a82ba['id']),_0x40dbb6[_0x2442b8(0x13e)]?.({'type':_0x2442b8(0x211),'name':_0x5a82ba['name']}),_0x40dbb6[_0x2442b8(0x15b)]?.(_0x2442b8(0x18e)+_0x5a82ba[_0x2442b8(0x1a5)]+'\x27'),0x1;},_0x4a1497);return _0x20fd3e[_0x508a2f(0x1dc)]((_0x5635d3,_0x35e544)=>_0x5635d3+_0x35e544,0x0);}export async function executePushJourneys(_0x4730a5,_0x358775,_0x594005,_0x355ccb,_0x1c41ae){const _0x255fa3=a151_0x3dca48,{journeyDefToRequest:_0x4469a1}=await import(_0x255fa3(0x22e)),{activationDefToCreateRequest:_0x2c3d5f,yamlRuleToApi:_0x5025c6,validateSegmentRule:_0x10f576}=await import(_0x255fa3(0x1a8)),_0x41d17b={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x56d6b6=new Map(_0x594005[_0x255fa3(0x152)]),_0x36a7b0=0x5;for(let _0xbe8b50=0x0;_0xbe8b50<_0x358775['length'];_0xbe8b50+=_0x36a7b0){const _0x383327=_0x358775[_0x255fa3(0x1c3)](_0xbe8b50,_0xbe8b50+_0x36a7b0),_0x5aebdb=await Promise[_0x255fa3(0x175)](_0x383327[_0x255fa3(0x237)](async _0x5620e9=>{const _0x3aa06d=_0x255fa3;if(!_0x5620e9[_0x3aa06d(0x1ff)]&&!_0x5620e9['hasChanges'])return{'action':'unchanged','name':_0x5620e9[_0x3aa06d(0x1f3)]['name'],'journeyId':_0x5620e9[_0x3aa06d(0x17b)]?.['id']};const _0x478fd7=_0x5620e9[_0x3aa06d(0x216)]?_0x594005[_0x3aa06d(0x20b)][_0x3aa06d(0x1aa)](_0x5620e9[_0x3aa06d(0x216)]):undefined;_0x1c41ae[_0x3aa06d(0x13e)]?.({'type':_0x5620e9[_0x3aa06d(0x1ff)]?_0x3aa06d(0x201):'journey_updating','name':_0x5620e9['yamlConfig']['name']});try{const _0x3199bb=await executeSingleJourneyPush(_0x4730a5,_0x5620e9,{..._0x594005,'segmentNameToId':_0x56d6b6},{'parentId':_0x355ccb['parentId'],'rootFolderId':_0x355ccb['rootFolderId'],'folderId':_0x478fd7,'verbose':_0x355ccb[_0x3aa06d(0x1e5)]},_0x1c41ae,{'journeyDefToRequest':_0x4469a1,'activationDefToCreateRequest':_0x2c3d5f,'yamlRuleToApi':_0x5025c6,'validateSegmentRule':_0x10f576});for(const [_0x56fa05,_0x11f695]of _0x3199bb[_0x3aa06d(0x223)]){_0x56d6b6[_0x3aa06d(0x153)](_0x56fa05,_0x11f695),_0x41d17b['embeddedSegmentNameToId']['set'](_0x56fa05,_0x11f695);}if(_0x3199bb[_0x3aa06d(0x218)]==='created')_0x1c41ae[_0x3aa06d(0x13e)]?.({'type':_0x3aa06d(0x1b8),'name':_0x5620e9[_0x3aa06d(0x1f3)][_0x3aa06d(0x1a5)],'journeyId':_0x3199bb[_0x3aa06d(0x168)]}),_0x1c41ae['logSuccess']?.(_0x3aa06d(0x160)+_0x5620e9[_0x3aa06d(0x1f3)][_0x3aa06d(0x1a5)]+'\x27'),_0x41d17b[_0x3aa06d(0x240)]++;else _0x3199bb[_0x3aa06d(0x218)]===_0x3aa06d(0x164)&&(_0x1c41ae[_0x3aa06d(0x13e)]?.({'type':_0x3aa06d(0x21e),'name':_0x5620e9[_0x3aa06d(0x1f3)][_0x3aa06d(0x1a5)]}),_0x1c41ae['logSuccess']?.(_0x3aa06d(0x14f)+_0x5620e9[_0x3aa06d(0x1f3)][_0x3aa06d(0x1a5)]+'\x27'),_0x41d17b['updated']++);return{'action':_0x3199bb['action'],'name':_0x5620e9['yamlConfig'][_0x3aa06d(0x1a5)],'journeyId':_0x3199bb[_0x3aa06d(0x168)]};}catch(_0x154d51){const _0x4748e2=isHttp400Error(_0x154d51),_0xdc8a0d=_0x4748e2?ErrorCode['JOURNEY_SYNTAX_ERROR']:ErrorCode['JOURNEY_UPDATE_ERROR'],_0x214e72=getErrorMessage(_0x154d51);throw new SDKError(_0xdc8a0d,'Failed\x20to\x20'+(_0x5620e9[_0x3aa06d(0x1ff)]?_0x3aa06d(0x1ac):_0x3aa06d(0x219))+_0x3aa06d(0x1a6)+_0x5620e9[_0x3aa06d(0x155)]+_0x3aa06d(0x1b0)+_0x214e72,_0x154d51);}}));_0x41d17b[_0x255fa3(0x149)][_0x255fa3(0x19b)](..._0x5aebdb);}return _0x41d17b;}async function matchExistingJourneySegments(_0x50d340,_0x444cf1,_0x26f9e0,_0x31e173,_0x1231e8){const _0x428222=a151_0x3dca48;if(!_0x444cf1[_0x428222(0x17b)]||!_0x444cf1[_0x428222(0x1f3)][_0x428222(0x18a)])return;const _0xb96477=new Map(),_0x31321e=new Set();for(const _0x39284c of Object['keys'](_0x444cf1[_0x428222(0x1f3)][_0x428222(0x18a)])){const _0x9fded8=generateDeterministicJourneySegmentName(_0x444cf1[_0x428222(0x1f3)][_0x428222(0x1a5)],_0x39284c);_0xb96477['set'](_0x9fded8,_0x39284c),_0x31321e[_0x428222(0x158)](_0x39284c);}const _0x5509fc=[],_0x394abb=collectSegmentIdsFromJourneyApi(_0x444cf1[_0x428222(0x17b)]);for(const _0x26fe96 of _0x394abb){const _0x136374=await fetchSegment(_0x50d340,_0x26f9e0,_0x26fe96,_0x31e173);if(!_0x136374?.[_0x428222(0x1a5)])continue;const _0x331568=_0xb96477[_0x428222(0x1aa)](_0x136374['name']);_0x331568?(_0x1231e8[_0x428222(0x153)](_0x331568,_0x26fe96),_0x31321e['delete'](_0x331568)):_0x5509fc[_0x428222(0x19b)]({'id':_0x26fe96,'seg':_0x136374});}if(_0x31321e[_0x428222(0x1a3)]>0x0&&_0x5509fc[_0x428222(0x14a)]>0x0){const {localExpandedRuleToNames:_0x2636bc}=buildLocalExpandedRuleMappings(_0x444cf1['yamlConfig']),_0x222fb3=new Map();for(const {id:_0x30e5ea,seg:_0x85fa97}of _0x5509fc){if(_0x85fa97[_0x428222(0x214)]){const _0x51b80a=apiRuleToYaml(_0x85fa97[_0x428222(0x214)]);_0x222fb3[_0x428222(0x153)](_0x30e5ea,_0x51b80a);}}for(const {id:_0x227634,seg:_0x315db5}of _0x5509fc){if(!_0x315db5[_0x428222(0x214)])continue;const _0x19ac0e=_0x222fb3[_0x428222(0x1aa)](_0x227634);if(!_0x19ac0e)continue;const _0x262cc8=serializeExpandedRule(_0x19ac0e,_0x222fb3),_0x5ab154=_0x2636bc[_0x428222(0x1aa)](_0x262cc8);if(_0x5ab154){const _0x3ecad0=_0x5ab154[_0x428222(0x205)](_0x6d2a27=>_0x31321e['has'](_0x6d2a27));_0x3ecad0&&(_0x1231e8[_0x428222(0x153)](_0x3ecad0,_0x227634),_0x31321e[_0x428222(0x13d)](_0x3ecad0),logger[_0x428222(0x1d5)](_0x428222(0x1f9)+_0x315db5['name']+'\x27\x20to\x20local\x20\x27'+_0x3ecad0+_0x428222(0x206)));}}}}async function executeSingleJourneyPush(_0x119c0f,_0x1e4ddc,_0x5a1851,_0x7fbbe1,_0x3acb96,_0x10472c){const _0x2ad734=a151_0x3dca48,{journeyDefToRequest:_0x4e41ff,activationDefToCreateRequest:_0x468f52,yamlRuleToApi:_0x482ec4,validateSegmentRule:_0x208c8a}=_0x10472c,_0x119567=new Map(),_0x22a395=new Map();recoverSegmentIdsFromPushRecovery(_0x1e4ddc,_0x119567,_0x5a1851[_0x2ad734(0x152)]);const _0x268fd9=new Map(),_0x498038=new Map(),_0xcb306a=new Map();let _0x1e09cc;const _0x3d3536=async()=>{const _0x217ee4=_0x2ad734;if(_0x1e09cc)return;_0x1e09cc=new Map();if(!_0x1e4ddc[_0x217ee4(0x17b)])return;const _0x2c2ef8=await _0x119c0f[_0x217ee4(0x229)]['listActivations'](_0x1e4ddc['existingJourney']['id']);for(const _0x123299 of _0x2c2ef8){const _0x13e780=journeyActivationStepToYaml(_0x123299,_0x5a1851[_0x217ee4(0x1d9)],_0x5a1851[_0x217ee4(0x1e1)]),_0xbcdecb=activationSignature(_0x13e780);!_0x1e09cc[_0x217ee4(0x232)](_0xbcdecb)&&_0x1e09cc[_0x217ee4(0x153)](_0xbcdecb,_0x123299['id']),_0x13e780[_0x217ee4(0x1a5)]&&_0x22a395[_0x217ee4(0x153)](_0x13e780[_0x217ee4(0x1a5)],_0x123299['id']);}};await matchExistingJourneySegments(_0x119c0f,_0x1e4ddc,_0x7fbbe1[_0x2ad734(0x1cf)],_0x5a1851[_0x2ad734(0x192)],_0x5a1851[_0x2ad734(0x152)]);const _0x30580d={'resolveSegmentId':async _0x216354=>{const _0x4d70e4=_0x2ad734,_0x270c0c=_0x5a1851[_0x4d70e4(0x152)][_0x4d70e4(0x1aa)](_0x216354);if(!_0x270c0c)throw new SDKError(ErrorCode[_0x4d70e4(0x22b)],_0x4d70e4(0x1d4)+_0x216354+_0x4d70e4(0x182)+_0x1e4ddc[_0x4d70e4(0x1f3)][_0x4d70e4(0x1a5)]+')');return _0x270c0c;},'resolveEmbeddedSegmentId':async(_0x550b64,_0x404e39)=>{const _0xc65688=_0x2ad734,_0xff8830=_0x5a1851[_0xc65688(0x152)][_0xc65688(0x1aa)](_0x550b64);if(_0xff8830)return _0xff8830;const _0x10bfb8=_0x5a1851[_0xc65688(0x192)][_0xc65688(0x205)](_0x4ee694=>_0x4ee694['name']===_0x550b64);if(_0x10bfb8)return _0x5a1851[_0xc65688(0x152)][_0xc65688(0x153)](_0x550b64,_0x10bfb8['id']),_0x10bfb8['id'];if(_0x1e4ddc['isNew']){const {stageName:_0x1de239,criteriaName:_0x4cbe90}=findSegmentCriteriaLocation(_0x1e4ddc['yamlConfig'],_0x550b64);return _0x208c8a(_0x550b64,_0x404e39['rule']),_0x498038['set'](_0x550b64,{'definition':_0x404e39,'stageName':_0x1de239,'criteriaName':_0x4cbe90}),createPendingSegmentId(_0x550b64);}const _0x452a78=_0x1e4ddc[_0xc65688(0x17b)]?.['id'];if(!_0x452a78)throw new SDKError(ErrorCode[_0xc65688(0x180)],_0xc65688(0x135));const _0xfbcaf=_0x268fd9['get'](_0x550b64);if(_0xfbcaf)return _0xfbcaf;const _0x27ae87=((async()=>{const _0x5da21e=_0xc65688;_0x208c8a(_0x550b64,_0x404e39['rule']);const _0x21942d=generateDeterministicJourneySegmentName(_0x1e4ddc[_0x5da21e(0x1f3)][_0x5da21e(0x1a5)],_0x550b64),_0x163559=_0x5a1851['existingSegments'][_0x5da21e(0x205)](_0xc38bdf=>_0xc38bdf[_0x5da21e(0x1a5)]===_0x21942d),_0x351b67=createSegmentIdResolver(_0x5a1851[_0x5da21e(0x152)],_0x550b64),_0x9baf72=await resolveRuleSegmentIds(_0x404e39[_0x5da21e(0x214)],_0x351b67);let _0x1a381b;return _0x163559?(await _0x119c0f['segment'][_0x5da21e(0x1c6)](_0x7fbbe1[_0x5da21e(0x1cf)],_0x163559['id'],{'description':_0x404e39['description']||'Entry\x20criteria:\x20'+_0x550b64,'rule':_0x482ec4(_0x9baf72),'countPopulation':!![]}),_0x1a381b=_0x163559['id'],saveSegmentToPushRecovery(_0x1e4ddc['absolutePath'],_0x1e4ddc[_0x5da21e(0x1f3)][_0x5da21e(0x1a5)],_0x550b64,{'segmentId':_0x1a381b,'uniqueServerName':_0x21942d,'createdAt':new Date()[_0x5da21e(0x186)]()})):_0x1a381b=await createOrRecoverEmbeddedSegment(_0x119c0f,_0x1e4ddc,{'localName':_0x550b64,'uniqueSegmentName':_0x21942d,'description':_0x404e39[_0x5da21e(0x13b)]||_0x5da21e(0x16d)+_0x550b64,'journeyId':_0x452a78,'resolvedRule':_0x9baf72,'parentId':_0x7fbbe1['parentId'],'folderId':_0x7fbbe1[_0x5da21e(0x193)]||''},_0x482ec4),_0x5a1851[_0x5da21e(0x152)][_0x5da21e(0x153)](_0x550b64,_0x1a381b),_0x119567[_0x5da21e(0x153)](_0x550b64,_0x1a381b),_0x1a381b;})());_0x268fd9[_0xc65688(0x153)](_0x550b64,_0x27ae87);try{return await _0x27ae87;}finally{_0x268fd9[_0xc65688(0x13d)](_0x550b64);}},'resolveActivationId':async _0xa8a360=>{const _0x282350=_0x2ad734,_0x44d447=_0x22a395['get'](_0xa8a360);if(_0x44d447)return _0x44d447;if(_0x1e4ddc['existingJourney']){await _0x3d3536();const _0xc285b3=_0x22a395[_0x282350(0x1aa)](_0xa8a360);if(_0xc285b3)return _0xc285b3;}throw new SDKError(ErrorCode['NOT_FOUND'],_0x282350(0x159)+_0xa8a360+_0x282350(0x182)+_0x1e4ddc[_0x282350(0x1f3)]['name']+_0x282350(0x212)+_0x282350(0x22a));},'resolveEmbeddedActivationId':async(_0x8fc52c,_0x332cdd)=>{const _0x3d4d7a=_0x2ad734,_0x2526ea=_0x22a395[_0x3d4d7a(0x1aa)](_0x8fc52c);if(_0x2526ea)return _0x2526ea;if(_0x1e4ddc[_0x3d4d7a(0x1ff)])return _0xcb306a[_0x3d4d7a(0x153)](_0x8fc52c,_0x332cdd),createPendingActivationId(_0x8fc52c);if(_0x1e4ddc[_0x3d4d7a(0x17b)]){await _0x3d3536();const _0x2b35e9=_0x22a395[_0x3d4d7a(0x1aa)](_0x332cdd['name']);if(_0x2b35e9)return _0x22a395['set'](_0x8fc52c,_0x2b35e9),_0x2b35e9;const _0x3675a9=activationSignature(_0x332cdd),_0x42ab04=_0x1e09cc?.[_0x3d4d7a(0x1aa)](_0x3675a9);if(_0x42ab04)return _0x22a395[_0x3d4d7a(0x153)](_0x8fc52c,_0x42ab04),_0x42ab04;const _0x34196f=await _0x468f52(_0x332cdd,_0x5a1851[_0x3d4d7a(0x15e)]),_0x5c2a35={..._0x34196f,..._0x332cdd['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x332cdd[_0x3d4d7a(0x1af)]}},_0x25928=await _0x119c0f['journey'][_0x3d4d7a(0x165)](_0x1e4ddc[_0x3d4d7a(0x17b)]['id'],_0x5c2a35);return _0x22a395[_0x3d4d7a(0x153)](_0x8fc52c,_0x25928['id']),_0x25928['id'];}throw new SDKError(ErrorCode['INTERNAL'],'Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context');},'resolveJourneyId':async _0xc1fab1=>{const _0x48788b=_0x2ad734;try{return await _0x119c0f['journey'][_0x48788b(0x217)](_0x7fbbe1[_0x48788b(0x1cf)],_0xc1fab1);}catch(_0x261187){throw new SDKError(ErrorCode['NOT_FOUND'],'Journey\x20\x27'+_0xc1fab1+_0x48788b(0x1c5)+_0x1e4ddc[_0x48788b(0x1f3)][_0x48788b(0x1a5)]+'\x27)',_0x261187);}},'resolveStageId':async(_0x2e6757,_0x156276)=>{const _0x5ca0ee=_0x2ad734,_0x3b0979=await _0x119c0f[_0x5ca0ee(0x229)][_0x5ca0ee(0x169)](_0x2e6757),_0x54bded=_0x3b0979[_0x5ca0ee(0x1ec)][_0x5ca0ee(0x1c4)][_0x5ca0ee(0x205)](_0x2dca54=>_0x2dca54['name']['toLowerCase']()===_0x156276[_0x5ca0ee(0x203)]());if(!_0x54bded?.['id'])throw new SDKError(ErrorCode['NOT_FOUND'],_0x5ca0ee(0x184)+_0x156276+_0x5ca0ee(0x1e2)+(_0x3b0979[_0x5ca0ee(0x1ec)][_0x5ca0ee(0x21a)]||_0x3b0979[_0x5ca0ee(0x1ec)][_0x5ca0ee(0x1a5)])+'\x27');return _0x54bded['id'];}},_0x3e2acd=await _0x4e41ff(_0x1e4ddc[_0x2ad734(0x1f3)],_0x7fbbe1['parentId'],_0x30580d),_0x2ac688=_0x7fbbe1[_0x2ad734(0x18c)]||_0x7fbbe1[_0x2ad734(0x193)];_0x2ac688&&(_0x3e2acd[_0x2ad734(0x174)]={'parentFolder':{'data':{'id':_0x2ac688,'type':'folder'}}});if(_0x1e4ddc[_0x2ad734(0x1ff)]){if(_0x498038[_0x2ad734(0x1a3)]>0x0||_0xcb306a[_0x2ad734(0x1a3)]>0x0)return await executeThreeStepJourneyCreate(_0x119c0f,_0x1e4ddc,_0x3e2acd,{'pendingEmbeddedSegments':_0x498038,'pendingEmbeddedActivations':_0xcb306a,'embeddedSegmentNameToId':_0x119567,'journeyActivationNameToId':_0x22a395},{..._0x7fbbe1,'effectiveFolderId':_0x2ac688},_0x5a1851,_0x3acb96,_0x10472c);else{ensureJourneyDefaults(_0x3e2acd['attributes']);const _0x43d136=await _0x119c0f[_0x2ad734(0x229)][_0x2ad734(0x1ac)](_0x3e2acd);return deletePushRecovery(_0x1e4ddc[_0x2ad734(0x155)]),{'action':'created','journeyId':_0x43d136['id'],'embeddedSegmentNameToId':_0x119567};}}else{if(_0x1e4ddc[_0x2ad734(0x19c)]&&_0x1e4ddc['existingJourney']){_0x3e2acd['id']=_0x1e4ddc['existingJourney']['id'];const _0x5ab40c=_0x3e2acd[_0x2ad734(0x1ec)];_0x1e4ddc[_0x2ad734(0x17b)][_0x2ad734(0x1ec)]?.[_0x2ad734(0x21a)]&&(_0x5ab40c[_0x2ad734(0x21a)]=_0x1e4ddc[_0x2ad734(0x17b)][_0x2ad734(0x1ec)]['journeyBundleName']);const _0x508ccf=_0x1e4ddc[_0x2ad734(0x17b)][_0x2ad734(0x1ec)]?.[_0x2ad734(0x1c4)];return _0x508ccf&&_0x3e2acd['attributes'][_0x2ad734(0x1c4)]&&injectExistingStageIds(_0x3e2acd[_0x2ad734(0x1ec)]['journeyStages'],_0x508ccf),ensureJourneyDefaults(_0x5ab40c),await _0x119c0f['journey'][_0x2ad734(0x219)](_0x1e4ddc[_0x2ad734(0x17b)]['id'],_0x3e2acd),deletePushRecovery(_0x1e4ddc[_0x2ad734(0x155)]),{'action':_0x2ad734(0x164),'journeyId':_0x1e4ddc[_0x2ad734(0x17b)]['id'],'embeddedSegmentNameToId':_0x119567};}}return deletePushRecovery(_0x1e4ddc[_0x2ad734(0x155)]),{'action':_0x2ad734(0x14d),'journeyId':_0x1e4ddc[_0x2ad734(0x17b)]?.['id'],'embeddedSegmentNameToId':_0x119567};}function findSegmentCriteriaLocation(_0x844b00,_0x3af8a5){const _0xad1b9=a151_0x3dca48,_0x3780ee=_0x844b00[_0xad1b9(0x1cd)]||_0x844b00[_0xad1b9(0x1e8)]?.[0x0]?.['stages']||[];let _0x5a0dc7=_0xad1b9(0x173),_0x3f3f89=_0x3af8a5;const _0x57c7c5=_0x844b00[_0xad1b9(0x230)]||_0x844b00[_0xad1b9(0x1e8)]?.[0x0]?.[_0xad1b9(0x230)];if(_0x57c7c5?.['segment']===_0x3af8a5)return{'stageName':'goal','criteriaName':_0x57c7c5[_0xad1b9(0x1a5)]||_0x3af8a5};_0x2e4642:for(const _0x435f70 of _0x3780ee){if(_0x435f70['entry_criteria']?.[_0xad1b9(0x1b6)]===_0x3af8a5){_0x5a0dc7=_0x435f70[_0xad1b9(0x1a5)],_0x3f3f89=_0x435f70[_0xad1b9(0x1b3)][_0xad1b9(0x1a5)]||_0x3af8a5;break;}if(_0x435f70[_0xad1b9(0x170)])for(const _0x5e142f of _0x435f70['steps']){if(_0x5e142f[_0xad1b9(0x1ed)]===_0xad1b9(0x21c)&&_0x5e142f[_0xad1b9(0x1dd)]?.[_0xad1b9(0x234)])for(const _0x2e4e88 of _0x5e142f['with']['branches']){if(_0x2e4e88['segment']===_0x3af8a5){_0x5a0dc7=_0x435f70[_0xad1b9(0x1a5)],_0x3f3f89=_0x2e4e88[_0xad1b9(0x1a5)]||_0x3af8a5;break _0x2e4642;}}}}return{'stageName':_0x5a0dc7,'criteriaName':_0x3f3f89};}async function executeThreeStepJourneyCreate(_0x1cd8f3,_0x4ed854,_0x2c221e,_0x30db65,_0x33f64d,_0x13d81c,_0x131dc4,_0x2b78e7){const _0x4d8b07=a151_0x3dca48,{activationDefToCreateRequest:_0xb4d1ac,yamlRuleToApi:_0x4ea1e6}=_0x2b78e7,{pendingEmbeddedSegments:_0x4df3c1,pendingEmbeddedActivations:_0x4abe42,embeddedSegmentNameToId:_0x4c87fc}=_0x30db65,_0x10d8c3=JSON[_0x4d8b07(0x1de)](JSON['stringify'](_0x2c221e));ensureJourneyDefaults(_0x10d8c3[_0x4d8b07(0x1ec)]),stripPendingIds(_0x10d8c3);const _0xfc9d44=await _0x1cd8f3[_0x4d8b07(0x229)]['create'](_0x10d8c3),_0x568c36=_0xfc9d44['id'],_0x1008b5=new Map();for(const _0x5008eb of _0xfc9d44[_0x4d8b07(0x1ec)][_0x4d8b07(0x1c4)]){_0x1008b5[_0x4d8b07(0x153)](_0x5008eb[_0x4d8b07(0x1a5)]['toLowerCase'](),_0x5008eb['id']);}recoverSegmentIdsFromPushRecovery(_0x4ed854,_0x4c87fc,_0x13d81c[_0x4d8b07(0x152)]);for(const [_0x535637,{definition:_0x2bdf82}]of _0x4df3c1){if(_0x4c87fc[_0x4d8b07(0x232)](_0x535637)){_0x131dc4[_0x4d8b07(0x13e)]?.({'type':_0x4d8b07(0x13a),'journeyName':_0x4ed854[_0x4d8b07(0x1f3)][_0x4d8b07(0x1a5)],'segmentName':_0x535637});continue;}const _0x54c19e=generateDeterministicJourneySegmentName(_0x4ed854[_0x4d8b07(0x1f3)][_0x4d8b07(0x1a5)],_0x535637);_0x131dc4[_0x4d8b07(0x13e)]?.({'type':_0x4d8b07(0x146),'journeyName':_0x4ed854[_0x4d8b07(0x1f3)][_0x4d8b07(0x1a5)],'segmentName':_0x535637});const _0x22ed5f=createSegmentIdResolver(_0x13d81c['segmentNameToId'],_0x535637),_0x1d8b67=await resolveRuleSegmentIds(_0x2bdf82[_0x4d8b07(0x214)],_0x22ed5f),_0x2e2d29=await createOrRecoverEmbeddedSegment(_0x1cd8f3,_0x4ed854,{'localName':_0x535637,'uniqueSegmentName':_0x54c19e,'description':_0x2bdf82['description']||'Entry\x20criteria:\x20'+_0x535637,'journeyId':_0x568c36,'resolvedRule':_0x1d8b67,'parentId':_0x33f64d[_0x4d8b07(0x1cf)],'folderId':_0x33f64d[_0x4d8b07(0x236)]||''},_0x4ea1e6);_0x4c87fc[_0x4d8b07(0x153)](_0x535637,_0x2e2d29),_0x13d81c['segmentNameToId'][_0x4d8b07(0x153)](_0x535637,_0x2e2d29),_0x131dc4[_0x4d8b07(0x13e)]?.({'type':_0x4d8b07(0x13a),'journeyName':_0x4ed854[_0x4d8b07(0x1f3)][_0x4d8b07(0x1a5)],'segmentName':_0x535637});}const _0x5f5b16=new Map();for(const [_0x4fbeed,_0x2dbd47]of _0x4abe42){_0x131dc4[_0x4d8b07(0x13e)]?.({'type':_0x4d8b07(0x1cb),'journeyName':_0x4ed854['yamlConfig'][_0x4d8b07(0x1a5)],'activationName':_0x4fbeed});const _0x52b063=await _0xb4d1ac(_0x2dbd47,_0x13d81c['activationContext']),_0x194247={..._0x52b063,..._0x2dbd47[_0x4d8b07(0x1af)]!==undefined&&{'runAfterJourneyRefresh':_0x2dbd47[_0x4d8b07(0x1af)]}},_0x2bdc0c=await _0x1cd8f3[_0x4d8b07(0x229)][_0x4d8b07(0x165)](_0x568c36,_0x194247);_0x5f5b16[_0x4d8b07(0x153)](_0x4fbeed,_0x2bdc0c['id']),_0x30db65[_0x4d8b07(0x14b)][_0x4d8b07(0x153)](_0x4fbeed,_0x2bdc0c['id']),_0x131dc4[_0x4d8b07(0x13e)]?.({'type':_0x4d8b07(0x1b2),'journeyName':_0x4ed854[_0x4d8b07(0x1f3)][_0x4d8b07(0x1a5)],'activationName':_0x4fbeed});}const _0x2364fd=JSON[_0x4d8b07(0x1de)](JSON[_0x4d8b07(0x1eb)](_0x2c221e));return _0x2364fd['id']=_0x568c36,ensureJourneyDefaults(_0x2364fd[_0x4d8b07(0x1ec)]),resolvePendingIdsInRequest(_0x2364fd,_0x2c221e,_0x1008b5,_0x4c87fc,_0x5f5b16,_0x131dc4),await _0x1cd8f3[_0x4d8b07(0x229)]['update'](_0x568c36,_0x2364fd),deletePushRecovery(_0x4ed854[_0x4d8b07(0x155)]),{'action':'created','journeyId':_0x568c36,'embeddedSegmentNameToId':_0x4c87fc};}export function stripWaitStepPendingIds(_0x16c3e1){const _0x168dc7=a151_0x3dca48,_0x2408b5=_0x16c3e1[_0x168dc7(0x13c)]&&isPendingSegmentId(_0x16c3e1['conditionSegmentId']),_0x59113f=_0x16c3e1[_0x168dc7(0x138)]?.[_0x168dc7(0x145)](_0x2170cf=>_0x2170cf[_0x168dc7(0x1f5)]&&isPendingSegmentId(_0x2170cf[_0x168dc7(0x1f5)]));(_0x2408b5||_0x59113f)&&(_0x16c3e1['waitStepType']=_0x168dc7(0x185),_0x16c3e1[_0x168dc7(0x183)]=0x1,_0x16c3e1[_0x168dc7(0x1ae)]='day',delete _0x16c3e1[_0x168dc7(0x13c)],delete _0x16c3e1[_0x168dc7(0x1df)],delete _0x16c3e1['conditionTimeoutUnit'],delete _0x16c3e1[_0x168dc7(0x138)]);}export function resolveWaitStepPendingIds(_0x24f568,_0x1bdd0e,_0x417fff,_0x53118e){const _0x125730=a151_0x3dca48;if(_0x1bdd0e[_0x125730(0x13c)]&&isPendingSegmentId(_0x1bdd0e[_0x125730(0x13c)])){const _0x4ee527=_0x417fff(_0x1bdd0e[_0x125730(0x13c)],_0x125730(0x1c1)+_0x53118e+_0x125730(0x1bc));_0x4ee527&&(_0x24f568[_0x125730(0x1b4)]='Condition',_0x24f568[_0x125730(0x13c)]=_0x4ee527,delete _0x24f568[_0x125730(0x183)],delete _0x24f568['waitStepUnit'],_0x1bdd0e[_0x125730(0x1df)]!==undefined&&(_0x24f568[_0x125730(0x1df)]=_0x1bdd0e[_0x125730(0x1df)]),_0x1bdd0e['conditionTimeoutUnit']&&(_0x24f568[_0x125730(0x1db)]=_0x1bdd0e['conditionTimeoutUnit']));}if(_0x1bdd0e[_0x125730(0x138)]){const _0x42c2c8=_0x1bdd0e[_0x125730(0x138)]['some'](_0x305992=>_0x305992[_0x125730(0x1f5)]&&isPendingSegmentId(_0x305992[_0x125730(0x1f5)]));if(_0x42c2c8){const _0x4136f1=_0x1bdd0e[_0x125730(0x138)][_0x125730(0x237)](_0x241ce5=>{const _0x56afbb=_0x125730;if(_0x241ce5[_0x56afbb(0x1f5)]&&isPendingSegmentId(_0x241ce5['segmentId'])){const _0x589b2f=_0x417fff(_0x241ce5['segmentId'],_0x56afbb(0x1c1)+_0x53118e+_0x56afbb(0x1bc));return{..._0x241ce5,'segmentId':_0x589b2f||_0x241ce5[_0x56afbb(0x1f5)]};}return{..._0x241ce5};});_0x24f568[_0x125730(0x1b4)]=_0x125730(0x19e),_0x24f568[_0x125730(0x138)]=_0x4136f1,delete _0x24f568['waitStep'],delete _0x24f568[_0x125730(0x1ae)],delete _0x24f568['conditionSegmentId'],delete _0x24f568[_0x125730(0x1df)],delete _0x24f568[_0x125730(0x1db)];}}}function stripPendingIds(_0x37cc64){const _0x2cd91f=a151_0x3dca48;_0x37cc64[_0x2cd91f(0x1ec)][_0x2cd91f(0x230)]?.[_0x2cd91f(0x1f5)]&&isPendingSegmentId(_0x37cc64['attributes'][_0x2cd91f(0x230)][_0x2cd91f(0x1f5)])&&delete _0x37cc64[_0x2cd91f(0x1ec)][_0x2cd91f(0x230)];for(const _0xa93c1f of _0x37cc64[_0x2cd91f(0x1ec)]['journeyStages']||[]){_0xa93c1f[_0x2cd91f(0x18f)]?.[_0x2cd91f(0x1f5)]&&isPendingSegmentId(_0xa93c1f[_0x2cd91f(0x18f)][_0x2cd91f(0x1f5)])&&delete _0xa93c1f['entryCriteria'];_0xa93c1f['milestone']?.[_0x2cd91f(0x1f5)]&&isPendingSegmentId(_0xa93c1f[_0x2cd91f(0x23a)][_0x2cd91f(0x1f5)])&&delete _0xa93c1f[_0x2cd91f(0x23a)];_0xa93c1f['exitCriterias']&&(_0xa93c1f[_0x2cd91f(0x1ce)]=_0xa93c1f['exitCriterias']['filter'](_0x7a8288=>!_0x7a8288[_0x2cd91f(0x1f5)]||!isPendingSegmentId(_0x7a8288['segmentId'])));if(_0xa93c1f['steps'])for(const _0x5b510d of Object[_0x2cd91f(0x143)](_0xa93c1f[_0x2cd91f(0x170)])){const _0x292b67=_0xa93c1f['steps'][_0x5b510d];_0x292b67[_0x2cd91f(0x1ed)]===_0x2cd91f(0x20f)&&_0x292b67[_0x2cd91f(0x150)]&&isPendingActivationId(_0x292b67[_0x2cd91f(0x150)])&&(_0x292b67[_0x2cd91f(0x150)]='');if(_0x292b67[_0x2cd91f(0x1ed)]===_0x2cd91f(0x220)&&_0x292b67[_0x2cd91f(0x234)])for(const _0x1bf9b1 of _0x292b67[_0x2cd91f(0x234)]){_0x1bf9b1['segmentId']&&isPendingSegmentId(_0x1bf9b1[_0x2cd91f(0x1f5)])&&(_0x1bf9b1[_0x2cd91f(0x1f5)]='');}_0x292b67[_0x2cd91f(0x1ed)]==='WaitStep'&&stripWaitStepPendingIds(_0x292b67);}}}function resolvePendingIdsInRequest(_0x52c8b5,_0x56f466,_0x520d0d,_0x4c22c5,_0x442902,_0x2088de){const _0x3a73d2=a151_0x3dca48,_0x23be1b=(_0x370db2,_0x2be263)=>{const _0x529786=a151_0x1b24;if(!isPendingSegmentId(_0x370db2))return _0x370db2;const _0xb5a485=extractPendingSegmentName(_0x370db2),_0x49b4c1=_0x4c22c5['get'](_0xb5a485);return!_0x49b4c1&&_0x2088de['logWarning']?.(_0x529786(0x1ef)+_0xb5a485+_0x529786(0x199)+_0x2be263),_0x49b4c1;};if(_0x52c8b5[_0x3a73d2(0x1ec)][_0x3a73d2(0x230)]?.[_0x3a73d2(0x1f5)]&&isPendingSegmentId(_0x52c8b5[_0x3a73d2(0x1ec)][_0x3a73d2(0x230)]['segmentId'])){const _0x21cbac=_0x23be1b(_0x52c8b5[_0x3a73d2(0x1ec)][_0x3a73d2(0x230)]['segmentId'],'goal\x20criteria');_0x21cbac&&(_0x52c8b5[_0x3a73d2(0x1ec)][_0x3a73d2(0x230)][_0x3a73d2(0x1f5)]=_0x21cbac);}for(const _0x5577a6 of _0x52c8b5['attributes'][_0x3a73d2(0x1c4)]||[]){const _0x54e643=_0x520d0d[_0x3a73d2(0x1aa)](_0x5577a6[_0x3a73d2(0x1a5)][_0x3a73d2(0x203)]());_0x54e643&&(_0x5577a6['id']=_0x54e643);if(_0x5577a6['entryCriteria']?.['segmentId']&&isPendingSegmentId(_0x5577a6[_0x3a73d2(0x18f)][_0x3a73d2(0x1f5)])){const _0x31d421=_0x23be1b(_0x5577a6[_0x3a73d2(0x18f)][_0x3a73d2(0x1f5)],_0x3a73d2(0x1c1)+_0x5577a6['name']+_0x3a73d2(0x1fa));_0x31d421&&(_0x5577a6[_0x3a73d2(0x18f)][_0x3a73d2(0x1f5)]=_0x31d421);}if(_0x5577a6['exitCriterias'])for(const _0x10b884 of _0x5577a6[_0x3a73d2(0x1ce)]){if(_0x10b884['segmentId']&&isPendingSegmentId(_0x10b884[_0x3a73d2(0x1f5)])){const _0xe6b311=_0x23be1b(_0x10b884[_0x3a73d2(0x1f5)],_0x3a73d2(0x1c1)+_0x5577a6['name']+_0x3a73d2(0x1c7));_0xe6b311&&(_0x10b884[_0x3a73d2(0x1f5)]=_0xe6b311);}}if(_0x5577a6[_0x3a73d2(0x23a)]?.[_0x3a73d2(0x1f5)]&&isPendingSegmentId(_0x5577a6['milestone']['segmentId'])){const _0x58cabb=_0x23be1b(_0x5577a6[_0x3a73d2(0x23a)][_0x3a73d2(0x1f5)],_0x3a73d2(0x1c1)+_0x5577a6['name']+'\x27\x20milestone');_0x58cabb&&(_0x5577a6[_0x3a73d2(0x23a)]['segmentId']=_0x58cabb);}if(_0x5577a6[_0x3a73d2(0x170)]){const _0x3676cf=_0x2f9b93=>_0x56f466[_0x3a73d2(0x1ec)]['journeyStages']?.[_0x3a73d2(0x205)](_0x4b7a41=>_0x4b7a41[_0x3a73d2(0x1a5)][_0x3a73d2(0x203)]()===_0x5577a6[_0x3a73d2(0x1a5)][_0x3a73d2(0x203)]())?.['steps']?.[_0x2f9b93];for(const _0x7d038a of Object[_0x3a73d2(0x143)](_0x5577a6[_0x3a73d2(0x170)])){const _0x40c647=_0x5577a6[_0x3a73d2(0x170)][_0x7d038a],_0x10b4b6=_0x3676cf(_0x7d038a);if(_0x40c647[_0x3a73d2(0x1ed)]==='Activation'&&_0x40c647[_0x3a73d2(0x150)]&&(isPendingActivationId(_0x40c647[_0x3a73d2(0x150)])||_0x40c647[_0x3a73d2(0x150)]==='')){if(_0x10b4b6?.['journeyActivationStepId']&&isPendingActivationId(_0x10b4b6[_0x3a73d2(0x150)])){const _0x2990df=extractPendingActivationName(_0x10b4b6['journeyActivationStepId']),_0x234ecb=_0x442902[_0x3a73d2(0x1aa)](_0x2990df);_0x234ecb&&(_0x40c647[_0x3a73d2(0x150)]=_0x234ecb);}}if(_0x40c647['type']===_0x3a73d2(0x220)&&_0x40c647[_0x3a73d2(0x234)]&&_0x10b4b6?.[_0x3a73d2(0x234)])for(let _0x8f0ebf=0x0;_0x8f0ebf<_0x40c647[_0x3a73d2(0x234)][_0x3a73d2(0x14a)];_0x8f0ebf++){const _0x111c38=_0x40c647[_0x3a73d2(0x234)][_0x8f0ebf],_0x40bb82=_0x10b4b6[_0x3a73d2(0x234)][_0x8f0ebf];if(_0x40bb82?.[_0x3a73d2(0x1f5)]&&isPendingSegmentId(_0x40bb82[_0x3a73d2(0x1f5)])){const _0x2c7de3=_0x23be1b(_0x40bb82['segmentId'],_0x3a73d2(0x1c1)+_0x5577a6[_0x3a73d2(0x1a5)]+_0x3a73d2(0x23e)+(_0x111c38[_0x3a73d2(0x1a5)]||_0x8f0ebf)+'\x27');_0x2c7de3&&(_0x111c38['segmentId']=_0x2c7de3);}}_0x40c647[_0x3a73d2(0x1ed)]===_0x3a73d2(0x1f2)&&_0x10b4b6?.['type']===_0x3a73d2(0x1f2)&&resolveWaitStepPendingIds(_0x40c647,_0x10b4b6,_0x23be1b,_0x5577a6['name']);}}}}
@@ -1 +1 @@
1
- (function(_0x5a1158,_0x1515b1){const _0x574a50=a153_0x47fa,_0x3bfe93=_0x5a1158();while(!![]){try{const _0x4f7577=parseInt(_0x574a50(0xff))/0x1+-parseInt(_0x574a50(0x103))/0x2*(parseInt(_0x574a50(0xfb))/0x3)+-parseInt(_0x574a50(0x102))/0x4+-parseInt(_0x574a50(0xf6))/0x5+-parseInt(_0x574a50(0xf8))/0x6*(parseInt(_0x574a50(0x105))/0x7)+parseInt(_0x574a50(0xf7))/0x8*(-parseInt(_0x574a50(0x100))/0x9)+parseInt(_0x574a50(0xf9))/0xa;if(_0x4f7577===_0x1515b1)break;else _0x3bfe93['push'](_0x3bfe93['shift']());}catch(_0x2786a3){_0x3bfe93['push'](_0x3bfe93['shift']());}}}(a153_0x50bd,0x8c976));function a153_0x47fa(_0x14cb86,_0x40b4a1){_0x14cb86=_0x14cb86-0xf6;const _0x50bdd9=a153_0x50bd();let _0x47fadb=_0x50bdd9[_0x14cb86];return _0x47fadb;}export function buildFolderIdToPathMap(_0x2b8b08){const _0x52fdcb=a153_0x47fa,_0x39b603=new Map(),_0x588dcf=new Map();for(const _0x3bed59 of _0x2b8b08){_0x588dcf['set'](_0x3bed59['id'],_0x3bed59);}const _0x14490b=new Set();for(const _0x59e904 of _0x2b8b08){!_0x59e904[_0x52fdcb(0xfa)]&&_0x14490b[_0x52fdcb(0xfd)](_0x59e904['id']);}function _0x2793f8(_0x30630c){const _0x1fb4e4=_0x52fdcb;if(_0x39b603[_0x1fb4e4(0x101)](_0x30630c['id']))return _0x39b603[_0x1fb4e4(0xfc)](_0x30630c['id']);if(_0x14490b[_0x1fb4e4(0x101)](_0x30630c['id']))return _0x39b603[_0x1fb4e4(0x104)](_0x30630c['id'],''),'';if(_0x30630c[_0x1fb4e4(0xfa)]){const _0x3dae1a=_0x588dcf[_0x1fb4e4(0xfc)](_0x30630c[_0x1fb4e4(0xfa)]);if(_0x3dae1a){const _0xb2a164=_0x2793f8(_0x3dae1a),_0x396a75=_0xb2a164?_0xb2a164+'/'+_0x30630c[_0x1fb4e4(0xfe)]:_0x30630c[_0x1fb4e4(0xfe)];return _0x39b603[_0x1fb4e4(0x104)](_0x30630c['id'],_0x396a75),_0x396a75;}}const _0x268194=_0x30630c['name'];return _0x39b603['set'](_0x30630c['id'],_0x268194),_0x268194;}for(const _0x4e429c of _0x2b8b08){_0x2793f8(_0x4e429c);}return _0x39b603;}function a153_0x50bd(){const _0x268ad5=['5778794LngrtJ','4164710slIEou','128HKGDmg','6mZjPJt','24036820fwSWNs','parentFolderId','2859iCHOYU','get','add','name','1024477PPtlRZ','217395vsDzGC','has','366520XIYdlK','1502QWOwSv','set'];a153_0x50bd=function(){return _0x268ad5;};return a153_0x50bd();}export function buildFolderPathToIdMap(_0x109c2b){const _0x41028a=a153_0x47fa,_0x4ad673=new Map(),_0x10e06d=new Map();for(const _0x183cfb of _0x109c2b){_0x10e06d[_0x41028a(0x104)](_0x183cfb['id'],_0x183cfb);}const _0x52ae39=new Set();for(const _0x42f427 of _0x109c2b){!_0x42f427[_0x41028a(0xfa)]&&_0x52ae39[_0x41028a(0xfd)](_0x42f427['id']);}function _0x1b08c9(_0x56ab9e){const _0x25fe28=_0x41028a;if(_0x52ae39[_0x25fe28(0x101)](_0x56ab9e['id']))return'';if(_0x56ab9e['parentFolderId']){const _0x467b27=_0x10e06d[_0x25fe28(0xfc)](_0x56ab9e[_0x25fe28(0xfa)]);if(_0x467b27){const _0x14111f=_0x1b08c9(_0x467b27);return _0x14111f?_0x14111f+'/'+_0x56ab9e[_0x25fe28(0xfe)]:_0x56ab9e[_0x25fe28(0xfe)];}}return _0x56ab9e[_0x25fe28(0xfe)];}for(const _0x2ac97b of _0x109c2b){const _0x401cad=_0x1b08c9(_0x2ac97b);_0x4ad673[_0x41028a(0x104)](_0x401cad,_0x2ac97b['id']);}return _0x4ad673;}export function buildFolderMaps(_0x7a78aa){const _0x382789=a153_0x47fa,_0x12a23e=buildFolderIdToPathMap(_0x7a78aa),_0x4faa14=new Map();for(const [_0x548361,_0x20c53d]of _0x12a23e){_0x4faa14[_0x382789(0x104)](_0x20c53d,_0x548361);}return{'idToPath':_0x12a23e,'pathToId':_0x4faa14};}export function getFolderPath(_0x12fcb7,_0x5e8440){const _0x382c7f=a153_0x47fa;if(!_0x12fcb7)return'';return _0x5e8440[_0x382c7f(0xfc)](_0x12fcb7)??'';}
1
+ (function(_0x2734c2,_0x167dbf){const _0x4a4d91=a152_0x3cc2,_0x2d7fd9=_0x2734c2();while(!![]){try{const _0x502d19=-parseInt(_0x4a4d91(0x1c8))/0x1*(parseInt(_0x4a4d91(0x1bd))/0x2)+parseInt(_0x4a4d91(0x1c5))/0x3*(parseInt(_0x4a4d91(0x1c2))/0x4)+-parseInt(_0x4a4d91(0x1c6))/0x5+-parseInt(_0x4a4d91(0x1cb))/0x6+-parseInt(_0x4a4d91(0x1c3))/0x7+-parseInt(_0x4a4d91(0x1be))/0x8*(parseInt(_0x4a4d91(0x1c9))/0x9)+parseInt(_0x4a4d91(0x1ca))/0xa;if(_0x502d19===_0x167dbf)break;else _0x2d7fd9['push'](_0x2d7fd9['shift']());}catch(_0x32dfa1){_0x2d7fd9['push'](_0x2d7fd9['shift']());}}}(a152_0x213d,0xd6bfa));function a152_0x3cc2(_0x44f898,_0x5df16a){_0x44f898=_0x44f898-0x1bc;const _0x213dec=a152_0x213d();let _0x3cc229=_0x213dec[_0x44f898];return _0x3cc229;}export function buildFolderIdToPathMap(_0x350ce6){const _0x25d8ef=a152_0x3cc2,_0x404376=new Map(),_0x5dacec=new Map();for(const _0x1554e0 of _0x350ce6){_0x5dacec[_0x25d8ef(0x1bf)](_0x1554e0['id'],_0x1554e0);}const _0x5c0c47=new Set();for(const _0x544e9b of _0x350ce6){!_0x544e9b['parentFolderId']&&_0x5c0c47['add'](_0x544e9b['id']);}function _0x438812(_0xd598a0){const _0x416747=_0x25d8ef;if(_0x404376[_0x416747(0x1c7)](_0xd598a0['id']))return _0x404376[_0x416747(0x1c0)](_0xd598a0['id']);if(_0x5c0c47[_0x416747(0x1c7)](_0xd598a0['id']))return _0x404376[_0x416747(0x1bf)](_0xd598a0['id'],''),'';if(_0xd598a0[_0x416747(0x1c1)]){const _0x1fae12=_0x5dacec[_0x416747(0x1c0)](_0xd598a0[_0x416747(0x1c1)]);if(_0x1fae12){const _0x513802=_0x438812(_0x1fae12),_0x447a82=_0x513802?_0x513802+'/'+_0xd598a0[_0x416747(0x1bc)]:_0xd598a0[_0x416747(0x1bc)];return _0x404376[_0x416747(0x1bf)](_0xd598a0['id'],_0x447a82),_0x447a82;}}const _0x3d307c=_0xd598a0[_0x416747(0x1bc)];return _0x404376['set'](_0xd598a0['id'],_0x3d307c),_0x3d307c;}for(const _0x3b648c of _0x350ce6){_0x438812(_0x3b648c);}return _0x404376;}function a152_0x213d(){const _0x120fe6=['2ToRqFP','8HPAkYh','set','get','parentFolderId','6416ndfRtx','11549804JeOqzb','add','1278pDIHzH','6628520tzgVUk','has','1736332YRGNBN','15507396IbamVU','69745280LwxNjP','2059020ydPjhK','name'];a152_0x213d=function(){return _0x120fe6;};return a152_0x213d();}export function buildFolderPathToIdMap(_0x56deab){const _0x33d0db=a152_0x3cc2,_0x3cb74f=new Map(),_0xfb49fd=new Map();for(const _0x4abe41 of _0x56deab){_0xfb49fd[_0x33d0db(0x1bf)](_0x4abe41['id'],_0x4abe41);}const _0x567217=new Set();for(const _0x3db99c of _0x56deab){!_0x3db99c[_0x33d0db(0x1c1)]&&_0x567217[_0x33d0db(0x1c4)](_0x3db99c['id']);}function _0x25224b(_0x587bde){const _0x4fb783=_0x33d0db;if(_0x567217[_0x4fb783(0x1c7)](_0x587bde['id']))return'';if(_0x587bde[_0x4fb783(0x1c1)]){const _0x56ad04=_0xfb49fd[_0x4fb783(0x1c0)](_0x587bde[_0x4fb783(0x1c1)]);if(_0x56ad04){const _0x3b3c1a=_0x25224b(_0x56ad04);return _0x3b3c1a?_0x3b3c1a+'/'+_0x587bde[_0x4fb783(0x1bc)]:_0x587bde[_0x4fb783(0x1bc)];}}return _0x587bde[_0x4fb783(0x1bc)];}for(const _0x20d0bc of _0x56deab){const _0x503f1c=_0x25224b(_0x20d0bc);_0x3cb74f[_0x33d0db(0x1bf)](_0x503f1c,_0x20d0bc['id']);}return _0x3cb74f;}export function buildFolderMaps(_0x7bad7b){const _0x1142d9=a152_0x3cc2,_0x2553b3=buildFolderIdToPathMap(_0x7bad7b),_0x379d60=new Map();for(const [_0x1a611f,_0x1e5357]of _0x2553b3){_0x379d60[_0x1142d9(0x1bf)](_0x1e5357,_0x1a611f);}return{'idToPath':_0x2553b3,'pathToId':_0x379d60};}export function getFolderPath(_0x302759,_0x1b8c23){const _0x3adef8=a152_0x3cc2;if(!_0x302759)return'';return _0x1b8c23[_0x3adef8(0x1c0)](_0x302759)??'';}
@@ -1 +1 @@
1
- function a154_0x533b(_0x384e3a,_0x5d4a96){_0x384e3a=_0x384e3a-0xf6;const _0xab92af=a154_0xab92();let _0x533b07=_0xab92af[_0x384e3a];return _0x533b07;}(function(_0x3974f6,_0x3cfd34){const _0x2170f9=a154_0x533b,_0x552342=_0x3974f6();while(!![]){try{const _0x376426=-parseInt(_0x2170f9(0x10b))/0x1*(parseInt(_0x2170f9(0x101))/0x2)+-parseInt(_0x2170f9(0x117))/0x3*(-parseInt(_0x2170f9(0x11b))/0x4)+parseInt(_0x2170f9(0x106))/0x5+parseInt(_0x2170f9(0x127))/0x6*(-parseInt(_0x2170f9(0x123))/0x7)+parseInt(_0x2170f9(0x102))/0x8*(-parseInt(_0x2170f9(0xf7))/0x9)+-parseInt(_0x2170f9(0x10f))/0xa*(parseInt(_0x2170f9(0x114))/0xb)+parseInt(_0x2170f9(0xfd))/0xc;if(_0x376426===_0x3cfd34)break;else _0x552342['push'](_0x552342['shift']());}catch(_0x2546a6){_0x552342['push'](_0x552342['shift']());}}}(a154_0xab92,0x4f912));import a154_0x522b0c from'path';import{parse as a154_0x23a388}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x4d8b98){const _0x233c13=a154_0x533b;if(!_0x4d8b98||_0x4d8b98['trim']()==='')throw new Error(_0x233c13(0x120));const _0x398e61=_0x4d8b98[_0x233c13(0x112)]();if(_0x398e61==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x4d8b98};const _0x3f3034=_0x398e61[_0x233c13(0x110)]('/')?_0x398e61[_0x233c13(0x128)](0x1):_0x398e61,_0x3fff0f=_0x3f3034['split']('/')['filter'](_0x3fd34e=>_0x3fd34e!=='');if(_0x3fff0f[_0x233c13(0x10c)]===0x0)throw new Error('Path\x20must\x20contain\x20at\x20least\x20one\x20segment');const _0x178b9=_0x398e61[_0x233c13(0x110)]('/')||!isRelativePathSegment(_0x3fff0f[0x0]);for(const _0x30e6d8 of _0x3fff0f){validatePathSegment(_0x30e6d8);}return{'segments':_0x3fff0f,'isAbsolute':_0x178b9,'raw':_0x4d8b98};}function isRelativePathSegment(_0x1806e3){return _0x1806e3==='.'||_0x1806e3==='..';}function validatePathSegment(_0x53bcdf){const _0x3e39c3=a154_0x533b;if(_0x53bcdf==='')throw new Error('Path\x20segment\x20cannot\x20be\x20empty');if(_0x53bcdf==='.'||_0x53bcdf==='..')return;if(/[\x00-\x1F\x7F]/['test'](_0x53bcdf))throw new Error(_0x3e39c3(0x124)+_0x53bcdf);if(_0x53bcdf!==_0x53bcdf['trim']()){}}export function validatePath(_0x38f9e8){const _0xc9e926=a154_0x533b;if(_0x38f9e8[_0xc9e926(0x11d)][_0xc9e926(0x10c)]===0x0&&!_0x38f9e8[_0xc9e926(0x108)])throw new Error(_0xc9e926(0x11a));if(_0x38f9e8[_0xc9e926(0x108)]){if(_0x38f9e8[_0xc9e926(0x11d)][0x0]==='..')throw new Error(_0xc9e926(0xfe));let _0x8c9c9a=0x0;for(const _0xe8b61 of _0x38f9e8['segments']){if(_0xe8b61==='..'){if(_0x8c9c9a===0x0)throw new Error(_0xc9e926(0xfb));_0x8c9c9a--;}else _0xe8b61!=='.'&&_0x8c9c9a++;}}}export function joinPaths(_0x1624ae,_0x1a327b){const _0x172d51=a154_0x533b;if(!_0x1624ae||_0x1624ae==='/')return _0x1a327b;if(!_0x1a327b||_0x1a327b==='.')return _0x1624ae;if(_0x1a327b[_0x172d51(0x110)]('/'))return _0x1a327b;const _0x4d447d=parsePath(_0x1624ae),_0x330aec=parsePath(_0x1a327b),_0x169435=[..._0x4d447d['segments']];for(const _0xf2024f of _0x330aec['segments']){if(_0xf2024f==='.')continue;else{if(_0xf2024f==='..'){if(_0x169435['length']===0x0)throw new Error(_0x172d51(0x116));_0x169435[_0x172d51(0x107)]();}else _0x169435[_0x172d51(0x11f)](_0xf2024f);}}const _0xc31d90=_0x169435[_0x172d51(0x121)]('/');return _0x4d447d[_0x172d51(0x115)][_0x172d51(0x110)]('/')?'/'+_0xc31d90:_0xc31d90;}function a154_0xab92(){const _0x3b5996=['837133anlVBo','raw','Cannot\x20navigate\x20above\x20root','643407PLwmNE','No\x20tdx.json\x20found\x20for\x20file:\x20','type','Relative\x20path\x20cannot\x20be\x20empty','4RQhDDI','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','segments','parse','push','Path\x20cannot\x20be\x20empty','join','File\x20not\x20found:\x20','7bcSxiB','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','segment','root','2394534qSExbF','substring','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','538506TZnhjF','replace','.yml','slice','Path\x20attempts\x20to\x20navigate\x20above\x20root','journey','3480588GWJevs','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','resolve','tdx.json','272206vkMZYO','16MrcHEE','parent_segment','dirname','exists','2761755bShmGm','pop','isAbsolute','Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.','endsWith','1dAlvpx','length','.yaml','relative','10CBvBGu','startsWith','readFile','trim','name'];a154_0xab92=function(){return _0x3b5996;};return a154_0xab92();}export function normalizePath(_0x3680f9){const _0x344a78=a154_0x533b,_0x1fee79=parsePath(_0x3680f9),_0x2d61ac=[];for(const _0x18c89f of _0x1fee79[_0x344a78(0x11d)]){if(_0x18c89f==='.')continue;else{if(_0x18c89f==='..'){if(_0x2d61ac[_0x344a78(0x10c)]===0x0){if(_0x1fee79[_0x344a78(0x108)])throw new Error(_0x344a78(0x116));_0x2d61ac[_0x344a78(0x11f)]('..');}else _0x2d61ac[_0x2d61ac[_0x344a78(0x10c)]-0x1]==='..'?_0x2d61ac[_0x344a78(0x11f)]('..'):_0x2d61ac['pop']();}else _0x2d61ac[_0x344a78(0x11f)](_0x18c89f);}}if(_0x2d61ac['length']===0x0)return _0x1fee79[_0x344a78(0x108)]?'/':'.';const _0x39c3da=_0x2d61ac[_0x344a78(0x121)]('/');return _0x1fee79[_0x344a78(0x115)][_0x344a78(0x110)]('/')?'/'+_0x39c3da:_0x39c3da;}export function getParentPath(_0x491a11){const _0x3ddf4f=a154_0x533b,_0x548986=parsePath(_0x491a11);if(_0x548986['segments'][_0x3ddf4f(0x10c)]<=0x1)return'/';const _0x208ac2=_0x548986[_0x3ddf4f(0x11d)][_0x3ddf4f(0xfa)](0x0,-0x1)['join']('/');return _0x548986[_0x3ddf4f(0x115)][_0x3ddf4f(0x110)]('/')?'/'+_0x208ac2:_0x208ac2;}export function getBaseName(_0x5c412f){const _0x1f01a6=a154_0x533b,_0x5d06f9=parsePath(_0x5c412f);return _0x5d06f9[_0x1f01a6(0x11d)][_0x5d06f9[_0x1f01a6(0x11d)][_0x1f01a6(0x10c)]-0x1]||'';}export function isChildPath(_0x468a74,_0x17b192){const _0x2ace28=a154_0x533b,_0x4ef66c=parsePath(_0x468a74),_0x4a0161=parsePath(_0x17b192);if(_0x4ef66c['segments'][_0x2ace28(0x10c)]<=_0x4a0161['segments'][_0x2ace28(0x10c)])return![];for(let _0x135ba1=0x0;_0x135ba1<_0x4a0161[_0x2ace28(0x11d)][_0x2ace28(0x10c)];_0x135ba1++){if(_0x4ef66c[_0x2ace28(0x11d)][_0x135ba1]!==_0x4a0161['segments'][_0x135ba1])return![];}return!![];}export function splitPath(_0x2a4138){const _0x964248=a154_0x533b,_0x347605=parsePath(_0x2a4138);if(_0x347605[_0x964248(0x11d)][_0x964248(0x10c)]===0x0)throw new Error('Cannot\x20split\x20empty\x20path');if(_0x347605[_0x964248(0x11d)][_0x964248(0x10c)]===0x1)return{'parent':_0x347605[_0x964248(0x11d)][0x0]};return{'parent':_0x347605[_0x964248(0x11d)][0x0],'child':_0x347605[_0x964248(0x11d)][_0x964248(0xfa)](0x1)['join']('/')};}export function isYamlFilePath(_0x4d5738){const _0x1923ad=a154_0x533b;return _0x4d5738['endsWith'](_0x1923ad(0xf9))||_0x4d5738[_0x1923ad(0x10a)](_0x1923ad(0x10d));}export async function resolveYamlFilePath(_0x3e12f0,_0x1ff209=nodeFileSystem){const _0x45d050=a154_0x533b,_0x10fb6e=a154_0x522b0c[_0x45d050(0xff)](_0x3e12f0);if(!await _0x1ff209[_0x45d050(0x105)](_0x10fb6e))throw new Error(_0x45d050(0x122)+_0x3e12f0);let _0x435201=a154_0x522b0c['dirname'](_0x10fb6e),_0x4524be=null,_0x5e8782=null;const _0x179697=a154_0x522b0c['parse'](_0x435201)[_0x45d050(0x126)];while(_0x435201!==_0x179697){const _0x14718e=a154_0x522b0c[_0x45d050(0x121)](_0x435201,_0x45d050(0x100));if(await _0x1ff209[_0x45d050(0x105)](_0x14718e)){_0x4524be=_0x14718e,_0x5e8782=_0x435201;break;}_0x435201=a154_0x522b0c[_0x45d050(0x104)](_0x435201);}if(!_0x4524be||!_0x5e8782)throw new Error(_0x45d050(0x118)+_0x3e12f0+'\x0a'+_0x45d050(0x109));const _0x119417=await _0x1ff209[_0x45d050(0x111)](_0x4524be),_0x33fd36=JSON[_0x45d050(0x11e)](_0x119417),_0x2d33df=_0x33fd36[_0x45d050(0x103)];if(!_0x2d33df)throw new Error(_0x45d050(0xf6));const _0x4a85b7=await _0x1ff209['readFile'](_0x10fb6e),_0x5be24e=a154_0x23a388(_0x4a85b7),_0x576e8f=_0x5be24e[_0x45d050(0x113)];if(!_0x576e8f)throw new Error(_0x45d050(0x11c)+_0x3e12f0);const _0x38d360=_0x5be24e[_0x45d050(0x119)]===_0x45d050(0xfc)?_0x45d050(0xfc):_0x45d050(0x125),_0x81086=a154_0x522b0c[_0x45d050(0x10e)](_0x5e8782,_0x10fb6e),_0x22938a=a154_0x522b0c[_0x45d050(0x104)](_0x81086),_0x30da80=_0x22938a==='.'?'':_0x22938a[_0x45d050(0xf8)](/\\/g,'/'),_0x303457=_0x30da80?_0x2d33df+'/'+_0x30da80+'/'+_0x576e8f:_0x2d33df+'/'+_0x576e8f;return{'parentSegment':_0x2d33df,'segmentName':_0x576e8f,'folderPath':_0x30da80,'fullPath':_0x303457,'resourceType':_0x38d360,'content':_0x4a85b7};}
1
+ (function(_0x4a980,_0x420614){const _0x144578=a153_0x13f3,_0x4c771d=_0x4a980();while(!![]){try{const _0x33e22a=-parseInt(_0x144578(0x1b6))/0x1*(-parseInt(_0x144578(0x1d4))/0x2)+-parseInt(_0x144578(0x1b8))/0x3*(-parseInt(_0x144578(0x1ad))/0x4)+parseInt(_0x144578(0x1ba))/0x5+-parseInt(_0x144578(0x1b1))/0x6*(parseInt(_0x144578(0x1ca))/0x7)+parseInt(_0x144578(0x1d1))/0x8*(-parseInt(_0x144578(0x1dc))/0x9)+parseInt(_0x144578(0x1c1))/0xa+-parseInt(_0x144578(0x1c2))/0xb;if(_0x33e22a===_0x420614)break;else _0x4c771d['push'](_0x4c771d['shift']());}catch(_0x592554){_0x4c771d['push'](_0x4c771d['shift']());}}}(a153_0x3b73,0xd3619));function a153_0x3b73(){const _0x5d576f=['isAbsolute','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','dirname','root','No\x20tdx.json\x20found\x20for\x20file:\x20','2106710pQDkRb','10413293OcHbtT','segments','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','join','tdx.json','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','Cannot\x20split\x20empty\x20path','filter','28tXZrFo','length','trim','Path\x20cannot\x20be\x20empty','substring','startsWith','File\x20not\x20found:\x20','24amOWFW','journey','endsWith','44SJshVu','parent_segment','readFile','exists','Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.','Cannot\x20navigate\x20above\x20root','parse','segment','2841102XglbBH','.yml','38344dtWUAs','Path\x20segment\x20cannot\x20be\x20empty','slice','raw','1746366dVnyrV','.yaml','split','resolve','pop','53255rKeBZu','push','273DsdupT','Relative\x20path\x20cannot\x20be\x20empty','8345755kccmbd'];a153_0x3b73=function(){return _0x5d576f;};return a153_0x3b73();}import a153_0xe8c71d from'path';import{parse as a153_0x393f16}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';function a153_0x13f3(_0x459a44,_0x510520){_0x459a44=_0x459a44-0x1ad;const _0x3b7351=a153_0x3b73();let _0x13f31f=_0x3b7351[_0x459a44];return _0x13f31f;}export function parsePath(_0x1942dd){const _0x1587f7=a153_0x13f3;if(!_0x1942dd||_0x1942dd[_0x1587f7(0x1cc)]()==='')throw new Error(_0x1587f7(0x1cd));const _0x1d15e1=_0x1942dd[_0x1587f7(0x1cc)]();if(_0x1d15e1==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x1942dd};const _0x2cf417=_0x1d15e1[_0x1587f7(0x1cf)]('/')?_0x1d15e1[_0x1587f7(0x1ce)](0x1):_0x1d15e1,_0x1ef0c0=_0x2cf417[_0x1587f7(0x1b3)]('/')[_0x1587f7(0x1c9)](_0x51ba29=>_0x51ba29!=='');if(_0x1ef0c0[_0x1587f7(0x1cb)]===0x0)throw new Error(_0x1587f7(0x1c7));const _0x1ad689=_0x1d15e1[_0x1587f7(0x1cf)]('/')||!isRelativePathSegment(_0x1ef0c0[0x0]);for(const _0x28afa7 of _0x1ef0c0){validatePathSegment(_0x28afa7);}return{'segments':_0x1ef0c0,'isAbsolute':_0x1ad689,'raw':_0x1942dd};}function isRelativePathSegment(_0x2af54a){return _0x2af54a==='.'||_0x2af54a==='..';}function validatePathSegment(_0x70a82b){const _0x4acbd7=a153_0x13f3;if(_0x70a82b==='')throw new Error(_0x4acbd7(0x1ae));if(_0x70a82b==='.'||_0x70a82b==='..')return;if(/[\x00-\x1F\x7F]/['test'](_0x70a82b))throw new Error(_0x4acbd7(0x1bd)+_0x70a82b);if(_0x70a82b!==_0x70a82b[_0x4acbd7(0x1cc)]()){}}export function validatePath(_0xc8f80b){const _0x2617e9=a153_0x13f3;if(_0xc8f80b[_0x2617e9(0x1c3)][_0x2617e9(0x1cb)]===0x0&&!_0xc8f80b[_0x2617e9(0x1bb)])throw new Error(_0x2617e9(0x1b9));if(_0xc8f80b[_0x2617e9(0x1bb)]){if(_0xc8f80b[_0x2617e9(0x1c3)][0x0]==='..')throw new Error('Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22');let _0x5ae488=0x0;for(const _0x706372 of _0xc8f80b['segments']){if(_0x706372==='..'){if(_0x5ae488===0x0)throw new Error('Path\x20attempts\x20to\x20navigate\x20above\x20root');_0x5ae488--;}else _0x706372!=='.'&&_0x5ae488++;}}}export function joinPaths(_0x4a162f,_0x3cec3f){const _0x1a4a0f=a153_0x13f3;if(!_0x4a162f||_0x4a162f==='/')return _0x3cec3f;if(!_0x3cec3f||_0x3cec3f==='.')return _0x4a162f;if(_0x3cec3f[_0x1a4a0f(0x1cf)]('/'))return _0x3cec3f;const _0x5e2926=parsePath(_0x4a162f),_0x35533c=parsePath(_0x3cec3f),_0x14556d=[..._0x5e2926['segments']];for(const _0xbac63c of _0x35533c[_0x1a4a0f(0x1c3)]){if(_0xbac63c==='.')continue;else{if(_0xbac63c==='..'){if(_0x14556d[_0x1a4a0f(0x1cb)]===0x0)throw new Error('Cannot\x20navigate\x20above\x20root');_0x14556d[_0x1a4a0f(0x1b5)]();}else _0x14556d['push'](_0xbac63c);}}const _0x26a519=_0x14556d[_0x1a4a0f(0x1c5)]('/');return _0x5e2926[_0x1a4a0f(0x1b0)][_0x1a4a0f(0x1cf)]('/')?'/'+_0x26a519:_0x26a519;}export function normalizePath(_0x308fe6){const _0x4e3f43=a153_0x13f3,_0x289fc7=parsePath(_0x308fe6),_0x19ac06=[];for(const _0x516b5d of _0x289fc7['segments']){if(_0x516b5d==='.')continue;else{if(_0x516b5d==='..'){if(_0x19ac06['length']===0x0){if(_0x289fc7[_0x4e3f43(0x1bb)])throw new Error(_0x4e3f43(0x1d9));_0x19ac06[_0x4e3f43(0x1b7)]('..');}else _0x19ac06[_0x19ac06[_0x4e3f43(0x1cb)]-0x1]==='..'?_0x19ac06['push']('..'):_0x19ac06['pop']();}else _0x19ac06[_0x4e3f43(0x1b7)](_0x516b5d);}}if(_0x19ac06['length']===0x0)return _0x289fc7['isAbsolute']?'/':'.';const _0x5993f8=_0x19ac06[_0x4e3f43(0x1c5)]('/');return _0x289fc7['raw']['startsWith']('/')?'/'+_0x5993f8:_0x5993f8;}export function getParentPath(_0x2b9988){const _0x330136=a153_0x13f3,_0x33e2ea=parsePath(_0x2b9988);if(_0x33e2ea[_0x330136(0x1c3)][_0x330136(0x1cb)]<=0x1)return'/';const _0x357569=_0x33e2ea[_0x330136(0x1c3)][_0x330136(0x1af)](0x0,-0x1)[_0x330136(0x1c5)]('/');return _0x33e2ea['raw']['startsWith']('/')?'/'+_0x357569:_0x357569;}export function getBaseName(_0x66fc69){const _0x4eb24=a153_0x13f3,_0x3ac463=parsePath(_0x66fc69);return _0x3ac463[_0x4eb24(0x1c3)][_0x3ac463[_0x4eb24(0x1c3)][_0x4eb24(0x1cb)]-0x1]||'';}export function isChildPath(_0x4116c1,_0x254a8d){const _0x2d1e8e=a153_0x13f3,_0x24374b=parsePath(_0x4116c1),_0x495379=parsePath(_0x254a8d);if(_0x24374b[_0x2d1e8e(0x1c3)][_0x2d1e8e(0x1cb)]<=_0x495379[_0x2d1e8e(0x1c3)][_0x2d1e8e(0x1cb)])return![];for(let _0x39ae4b=0x0;_0x39ae4b<_0x495379[_0x2d1e8e(0x1c3)][_0x2d1e8e(0x1cb)];_0x39ae4b++){if(_0x24374b['segments'][_0x39ae4b]!==_0x495379[_0x2d1e8e(0x1c3)][_0x39ae4b])return![];}return!![];}export function splitPath(_0x846a22){const _0x1e9e94=a153_0x13f3,_0x593de7=parsePath(_0x846a22);if(_0x593de7['segments']['length']===0x0)throw new Error(_0x1e9e94(0x1c8));if(_0x593de7['segments'][_0x1e9e94(0x1cb)]===0x1)return{'parent':_0x593de7[_0x1e9e94(0x1c3)][0x0]};return{'parent':_0x593de7[_0x1e9e94(0x1c3)][0x0],'child':_0x593de7[_0x1e9e94(0x1c3)][_0x1e9e94(0x1af)](0x1)[_0x1e9e94(0x1c5)]('/')};}export function isYamlFilePath(_0xf30881){const _0x48432e=a153_0x13f3;return _0xf30881['endsWith'](_0x48432e(0x1dd))||_0xf30881[_0x48432e(0x1d3)](_0x48432e(0x1b2));}export async function resolveYamlFilePath(_0x43132f,_0x1fb98e=nodeFileSystem){const _0x411037=a153_0x13f3,_0x2cd830=a153_0xe8c71d[_0x411037(0x1b4)](_0x43132f);if(!await _0x1fb98e[_0x411037(0x1d7)](_0x2cd830))throw new Error(_0x411037(0x1d0)+_0x43132f);let _0x35af09=a153_0xe8c71d['dirname'](_0x2cd830),_0x273cb0=null,_0x52543b=null;const _0x449106=a153_0xe8c71d['parse'](_0x35af09)[_0x411037(0x1bf)];while(_0x35af09!==_0x449106){const _0x1b86c3=a153_0xe8c71d[_0x411037(0x1c5)](_0x35af09,_0x411037(0x1c6));if(await _0x1fb98e[_0x411037(0x1d7)](_0x1b86c3)){_0x273cb0=_0x1b86c3,_0x52543b=_0x35af09;break;}_0x35af09=a153_0xe8c71d[_0x411037(0x1be)](_0x35af09);}if(!_0x273cb0||!_0x52543b)throw new Error(_0x411037(0x1c0)+_0x43132f+'\x0a'+_0x411037(0x1d8));const _0x199f6f=await _0x1fb98e[_0x411037(0x1d6)](_0x273cb0),_0x9ed60a=JSON[_0x411037(0x1da)](_0x199f6f),_0x7e9836=_0x9ed60a[_0x411037(0x1d5)];if(!_0x7e9836)throw new Error(_0x411037(0x1bc));const _0x112f23=await _0x1fb98e[_0x411037(0x1d6)](_0x2cd830),_0x473258=a153_0x393f16(_0x112f23),_0x185d5b=_0x473258['name'];if(!_0x185d5b)throw new Error(_0x411037(0x1c4)+_0x43132f);const _0x45202a=_0x473258['type']===_0x411037(0x1d2)?_0x411037(0x1d2):_0x411037(0x1db),_0x318fa0=a153_0xe8c71d['relative'](_0x52543b,_0x2cd830),_0x9092c=a153_0xe8c71d[_0x411037(0x1be)](_0x318fa0),_0x45386d=_0x9092c==='.'?'':_0x9092c['replace'](/\\/g,'/'),_0x145a35=_0x45386d?_0x7e9836+'/'+_0x45386d+'/'+_0x185d5b:_0x7e9836+'/'+_0x185d5b;return{'parentSegment':_0x7e9836,'segmentName':_0x185d5b,'folderPath':_0x45386d,'fullPath':_0x145a35,'resourceType':_0x45202a,'content':_0x112f23};}
@@ -1 +1 @@
1
- (function(_0x3a2828,_0x32f1fb){const _0x157623=a155_0x4eb6,_0x8783b9=_0x3a2828();while(!![]){try{const _0x50d7c3=parseInt(_0x157623(0xb8))/0x1*(parseInt(_0x157623(0xb7))/0x2)+parseInt(_0x157623(0xae))/0x3*(-parseInt(_0x157623(0xb3))/0x4)+-parseInt(_0x157623(0xba))/0x5*(parseInt(_0x157623(0xb2))/0x6)+parseInt(_0x157623(0xb4))/0x7*(parseInt(_0x157623(0xac))/0x8)+-parseInt(_0x157623(0xb9))/0x9*(parseInt(_0x157623(0xbb))/0xa)+parseInt(_0x157623(0xb5))/0xb+parseInt(_0x157623(0xb6))/0xc;if(_0x50d7c3===_0x32f1fb)break;else _0x8783b9['push'](_0x8783b9['shift']());}catch(_0xecf252){_0x8783b9['push'](_0x8783b9['shift']());}}}(a155_0x9b8c,0xa3a0d));export function parseSegmentRef(_0x487a19){const _0x133793=a155_0x4eb6,_0x104f0c=_0x487a19['indexOf']('/');if(_0x104f0c===-0x1)return{'parentId':_0x487a19};if(_0x104f0c===0x0)throw new Error(_0x133793(0xb1)+_0x487a19+_0x133793(0xaf));const _0x308846=_0x487a19[_0x133793(0xb0)](0x0,_0x104f0c),_0xc0f2df=_0x487a19[_0x133793(0xb0)](_0x104f0c+0x1);if(_0xc0f2df==='')throw new Error(_0x133793(0xb1)+_0x487a19+_0x133793(0xad));return{'parentId':_0x308846,'childId':_0xc0f2df};}function a155_0x4eb6(_0x1666af,_0x214a58){_0x1666af=_0x1666af-0xac;const _0x9b8cd6=a155_0x9b8c();let _0x4eb6d0=_0x9b8cd6[_0x1666af];return _0x4eb6d0;}function a155_0x9b8c(){const _0x2c3fee=['Invalid\x20segment\x20reference\x20format:\x20','198246uGTSZy','23948VPrmUT','3535dvSrxe','6388008aMCcIl','7809552vpLtRm','274954GZTEBG','1NyivDT','297JafPSu','55SYRnmL','131050HxhMfF','5048Depfho','.\x20Child\x20name\x20cannot\x20be\x20empty','111kmUuLe','.\x20Parent\x20name\x20cannot\x20be\x20empty','substring'];a155_0x9b8c=function(){return _0x2c3fee;};return a155_0x9b8c();}
1
+ function a154_0x49ca(){const _0x111978=['678OBlYOh','9KehIvs','36576760aqeKqA','indexOf','95854bIwHld','4fRdhFj','20839jDBTjQ','1643309SAnNtj','5496515NDRpsM','263328xDttwh','substring','3548799rhuvai'];a154_0x49ca=function(){return _0x111978;};return a154_0x49ca();}(function(_0x33e760,_0xdaf0f3){const _0x564399=a154_0x4303,_0x248e10=_0x33e760();while(!![]){try{const _0x45f99c=-parseInt(_0x564399(0x1d8))/0x1+-parseInt(_0x564399(0x1d5))/0x2*(-parseInt(_0x564399(0x1de))/0x3)+-parseInt(_0x564399(0x1d6))/0x4*(parseInt(_0x564399(0x1d9))/0x5)+-parseInt(_0x564399(0x1dd))/0x6*(-parseInt(_0x564399(0x1d7))/0x7)+-parseInt(_0x564399(0x1da))/0x8+-parseInt(_0x564399(0x1dc))/0x9+parseInt(_0x564399(0x1df))/0xa;if(_0x45f99c===_0xdaf0f3)break;else _0x248e10['push'](_0x248e10['shift']());}catch(_0x13b278){_0x248e10['push'](_0x248e10['shift']());}}}(a154_0x49ca,0xec553));function a154_0x4303(_0x545bca,_0x32abf2){_0x545bca=_0x545bca-0x1d4;const _0x49ca2d=a154_0x49ca();let _0x4303ae=_0x49ca2d[_0x545bca];return _0x4303ae;}export function parseSegmentRef(_0xb0b12b){const _0x29cbef=a154_0x4303,_0x44cda4=_0xb0b12b[_0x29cbef(0x1d4)]('/');if(_0x44cda4===-0x1)return{'parentId':_0xb0b12b};if(_0x44cda4===0x0)throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0xb0b12b+'.\x20Parent\x20name\x20cannot\x20be\x20empty');const _0x285051=_0xb0b12b[_0x29cbef(0x1db)](0x0,_0x44cda4),_0x5401cf=_0xb0b12b['substring'](_0x44cda4+0x1);if(_0x5401cf==='')throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0xb0b12b+'.\x20Child\x20name\x20cannot\x20be\x20empty');return{'parentId':_0x285051,'childId':_0x5401cf};}