@treasuredata/tdx 2026.3.18 → 2026.3.20
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.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-login-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/segment-validator.js.map +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a139_0x3153(_0x56c118,_0x31f67c){_0x56c118=_0x56c118-0x1bd;const _0x5d6ecf=a139_0x5d6e();let _0x3153c4=_0x5d6ecf[_0x56c118];return _0x3153c4;}(function(_0xbf3c1b,_0x2f1d8e){const _0x5c07b4=a139_0x3153,_0x376403=_0xbf3c1b();while(!![]){try{const _0x4fb029=-parseInt(_0x5c07b4(0x1d1))/0x1*(parseInt(_0x5c07b4(0x1cb))/0x2)+parseInt(_0x5c07b4(0x1be))/0x3*(parseInt(_0x5c07b4(0x1d3))/0x4)+-parseInt(_0x5c07b4(0x1cc))/0x5*(-parseInt(_0x5c07b4(0x1cd))/0x6)+-parseInt(_0x5c07b4(0x1d9))/0x7+-parseInt(_0x5c07b4(0x1ce))/0x8*(parseInt(_0x5c07b4(0x1c3))/0x9)+-parseInt(_0x5c07b4(0x1da))/0xa*(-parseInt(_0x5c07b4(0x1c1))/0xb)+-parseInt(_0x5c07b4(0x1d0))/0xc*(-parseInt(_0x5c07b4(0x1c5))/0xd);if(_0x4fb029===_0x2f1d8e)break;else _0x376403['push'](_0x376403['shift']());}catch(_0x5a7992){_0x376403['push'](_0x376403['shift']());}}}(a139_0x5d6e,0x1ac3a));function a139_0x5d6e(){const _0x4e68fe=['124046SwBvfr','parse','segments','journeyName','Failed\x20to\x20read\x20push\x20recovery\x20file:\x20','.tmp','20CTVgNd','45byVWFB','133314RrUZoK','368tLqmNy','.push-recovery.json','276nMSgQq','9799jHiQky','string','716cjNiwD','join','utf-8','basename','dirname','debug','770273MEBYhL','50kwVSOZ','toISOString','267gYNewk','code','Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20','144617nOtHNQ','stringify','35892tYuiwZ','warn'];a139_0x5d6e=function(){return _0x4e68fe;};return a139_0x5d6e();}import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';import a139_0x26e96f from'path';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of']('tdx.sdk.push-recovery');export function getPushRecoveryPath(_0x1bbafd){const _0x3bb21e=a139_0x3153,_0x597f80=a139_0x26e96f[_0x3bb21e(0x1d7)](_0x1bbafd),_0x530d83=a139_0x26e96f[_0x3bb21e(0x1d6)](_0x1bbafd);return a139_0x26e96f[_0x3bb21e(0x1d4)](_0x597f80,'.'+_0x530d83+_0x3bb21e(0x1cf));}export function readPushRecovery(_0x5dac52){const _0xd6861a=a139_0x3153,_0xeed22b=getPushRecoveryPath(_0x5dac52);if(!existsSync(_0xeed22b))return undefined;try{const _0x5876fe=readFileSync(_0xeed22b,_0xd6861a(0x1d5)),_0x1755c6=JSON[_0xd6861a(0x1c6)](_0x5876fe);if(_0x1755c6?.['version']!==0x1||typeof _0x1755c6[_0xd6861a(0x1c8)]!==_0xd6861a(0x1d2))return undefined;return _0x1755c6;}catch(_0xb45071){return _0xb45071 instanceof SyntaxError?logger[_0xd6861a(0x1d8)](_0xd6861a(0x1c0)+_0xb45071):logger[_0xd6861a(0x1c4)](_0xd6861a(0x1c9)+_0xb45071),undefined;}}export function writePushRecovery(_0x2ad128,_0x48474a){const _0x5a8e58=a139_0x3153,_0x1413f0=getPushRecoveryPath(_0x2ad128),_0x2e89e8=_0x1413f0+_0x5a8e58(0x1ca);writeFileSync(_0x2e89e8,JSON[_0x5a8e58(0x1c2)](_0x48474a,null,0x2)+'\x0a',_0x5a8e58(0x1d5)),renameSync(_0x2e89e8,_0x1413f0);}export function deletePushRecovery(_0x24431d){const _0x5dd447=a139_0x3153,_0x336036=getPushRecoveryPath(_0x24431d);try{unlinkSync(_0x336036);}catch(_0x122236){_0x122236[_0x5dd447(0x1bf)]!=='ENOENT'&&logger[_0x5dd447(0x1d8)]('Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20'+_0x122236);}}export function saveSegmentToPushRecovery(_0x4c063c,_0x4f10c6,_0x4d62c8,_0x409cc6){const _0x5d1d88=a139_0x3153,_0x457893=readPushRecovery(_0x4c063c),_0x767b52=_0x457893?.[_0x5d1d88(0x1c8)]===_0x4f10c6?{..._0x457893,'updatedAt':new Date()[_0x5d1d88(0x1bd)]()}:{'version':0x1,'journeyName':_0x4f10c6,'updatedAt':new Date()[_0x5d1d88(0x1bd)](),'segments':{}};_0x767b52[_0x5d1d88(0x1c7)][_0x4d62c8]=_0x409cc6,writePushRecovery(_0x4c063c,_0x767b52);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a140_0x47e9b3=a140_0x564c;(function(_0x13937e,_0x10164b){const _0x563e57=a140_0x564c,_0x2e2605=_0x13937e();while(!![]){try{const _0x306f33=-parseInt(_0x563e57(0x199))/0x1*(-parseInt(_0x563e57(0x1aa))/0x2)+parseInt(_0x563e57(0x11a))/0x3*(-parseInt(_0x563e57(0x138))/0x4)+parseInt(_0x563e57(0x15d))/0x5+parseInt(_0x563e57(0x130))/0x6*(-parseInt(_0x563e57(0xb8))/0x7)+-parseInt(_0x563e57(0x18b))/0x8*(parseInt(_0x563e57(0x128))/0x9)+parseInt(_0x563e57(0x196))/0xa*(-parseInt(_0x563e57(0xe5))/0xb)+-parseInt(_0x563e57(0x176))/0xc*(-parseInt(_0x563e57(0x165))/0xd);if(_0x306f33===_0x10164b)break;else _0x2e2605['push'](_0x2e2605['shift']());}catch(_0x2dcb36){_0x2e2605['push'](_0x2e2605['shift']());}}}(a140_0x1dde,0x9f78f));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of']('tdx.sdk.push-workflow');export const PENDING_SEGMENT_PREFIX=a140_0x47e9b3(0x107);export const PENDING_ACTIVATION_PREFIX=a140_0x47e9b3(0x11c);export function createPendingSegmentId(_0x3ad226){return''+PENDING_SEGMENT_PREFIX+_0x3ad226+'__';}export function isPendingSegmentId(_0x1e242a){const _0x536154=a140_0x47e9b3;return _0x1e242a[_0x536154(0xd1)](PENDING_SEGMENT_PREFIX)&&!_0x1e242a[_0x536154(0xd1)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x4813d6){return _0x4813d6['replace'](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x878bd1){return''+PENDING_ACTIVATION_PREFIX+_0x878bd1+'__';}export function isPendingActivationId(_0x337239){const _0x2cd5ce=a140_0x47e9b3;return _0x337239[_0x2cd5ce(0xd1)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x1457c1){const _0x35caa1=a140_0x47e9b3;return _0x1457c1[_0x35caa1(0x1b2)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x2ab543,_0x1320a7){const _0xb78ac=a140_0x47e9b3,_0x56c890=_0x2ab543+'::'+(_0x1320a7[_0xb78ac(0x101)]()||'segment'),_0x1290b3=createHash(_0xb78ac(0x12b))[_0xb78ac(0xc9)](_0x56c890)[_0xb78ac(0x1ab)](_0xb78ac(0x12a))['slice'](0x0,0xc);return'journey_entry_criteria_'+_0x1290b3;}export function ensureJourneyDefaults(_0x1e3c77){const _0x136ae8=a140_0x47e9b3;!_0x1e3c77[_0x136ae8(0x14e)]&&(_0x1e3c77[_0x136ae8(0x14e)]=''),!_0x1e3c77[_0x136ae8(0x104)]&&(_0x1e3c77['state']=_0x136ae8(0xe8));}export function injectExistingStageIds(_0x48f120,_0xfe9a78){const _0x142959=a140_0x47e9b3,_0x242742=new Map(_0xfe9a78[_0x142959(0x154)](_0x32015e=>[_0x32015e[_0x142959(0x1ad)],_0x32015e['id']]));for(const _0x3275fc of _0x48f120){if(!_0x3275fc['id']){const _0x2ea206=_0x242742[_0x142959(0x188)](_0x3275fc['name']);_0x2ea206&&(_0x3275fc['id']=_0x2ea206);}}}export function resolveTDFolderPath(_0x5db000,_0xb96143,_0x5cea97){const _0x40293=a140_0x47e9b3;if(!_0xb96143)return _0x5db000;if(_0x5db000===_0x5cea97||_0x5db000[_0x40293(0xd1)](_0x5cea97+'/'))return _0x5db000;return _0x5db000?_0x5cea97+'/'+_0x5db000:_0x5cea97;}export function addFoldersToCreate(_0x50ed8e,_0xf2c1d5,_0x1414b3){const _0x4ed343=a140_0x47e9b3;if(!_0x50ed8e)return;if(_0xf2c1d5['has'](_0x50ed8e))return;const _0x4bf85a=_0x50ed8e['split']('/');let _0x165e1c='';for(const _0xb46766 of _0x4bf85a){_0x165e1c=_0x165e1c?_0x165e1c+'/'+_0xb46766:_0xb46766,!_0xf2c1d5[_0x4ed343(0xba)](_0x165e1c)&&_0x1414b3[_0x4ed343(0x13c)](_0x165e1c);}}export function sortFoldersByDepth(_0x3b49af){const _0x2f1538=a140_0x47e9b3;return[..._0x3b49af][_0x2f1538(0xbd)]((_0x1f7bb7,_0x56c76d)=>{const _0x185f53=_0x2f1538,_0x1726db=(_0x1f7bb7[_0x185f53(0xeb)](/\//g)||[])[_0x185f53(0xf9)],_0x42da15=(_0x56c76d['match'](/\//g)||[])[_0x185f53(0xf9)];return _0x1726db-_0x42da15;});}import*as a140_0x241f52 from'yaml';import{readFileSync}from'fs';import a140_0x4ffbc3 from'path';import{isJourneyDef,parseYamlString as a140_0x27048e,toYamlString as a140_0x1a8958,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(_0xdd0e33){const _0x43cc45=a140_0x47e9b3;if(Array['isArray'](_0xdd0e33))return'['+_0xdd0e33[_0x43cc45(0x154)](_0x55f351=>stableStringify(_0x55f351))[_0x43cc45(0xb3)](',')+']';if(_0xdd0e33&&typeof _0xdd0e33===_0x43cc45(0x17f)){const _0x266276=_0xdd0e33,_0x3bdc4c=Object[_0x43cc45(0x1ac)](_0x266276)[_0x43cc45(0xbd)](),_0x5df132=_0x3bdc4c[_0x43cc45(0x154)](_0x14b3d9=>'\x22'+_0x14b3d9+'\x22:'+stableStringify(_0x266276[_0x14b3d9]));return'{'+_0x5df132['join'](',')+'}';}const _0x2067c3=JSON[_0x43cc45(0x102)](_0xdd0e33);return _0x2067c3===undefined?_0x43cc45(0xd4):_0x2067c3;}function activationSignature(_0x4ba218){const _0x11162a=a140_0x47e9b3,_0x41736a={'connection':_0x4ba218[_0x11162a(0x1a8)],..._0x4ba218[_0x11162a(0x164)]!==undefined&&{'all_columns':_0x4ba218[_0x11162a(0x164)]},..._0x4ba218[_0x11162a(0x18c)]!==undefined&&{'columns':_0x4ba218['columns']},..._0x4ba218[_0x11162a(0xea)]!==undefined&&{'behavior':_0x4ba218[_0x11162a(0xea)]},..._0x4ba218[_0x11162a(0x117)]!==undefined&&{'schedule':_0x4ba218['schedule']},..._0x4ba218[_0x11162a(0x186)]!==undefined&&{'notification':_0x4ba218[_0x11162a(0x186)]},..._0x4ba218['connector_config']!==undefined&&{'connector_config':_0x4ba218[_0x11162a(0x1a0)]},..._0x4ba218[_0x11162a(0x1a7)]!==undefined&&{'activation_template_id':_0x4ba218['activation_template_id']}};return stableStringify(_0x41736a);}async function fetchSegment(_0x2b2251,_0xe05040,_0x41cd06,_0x28dad3){const _0x29b497=a140_0x47e9b3,_0x1886ed=_0x28dad3?.[_0x29b497(0x137)](_0x35f616=>_0x35f616['id']===_0x41cd06);if(_0x1886ed)return _0x1886ed;try{return await _0x2b2251[_0x29b497(0x10e)][_0x29b497(0x11d)](_0xe05040,_0x41cd06);}catch(_0x30c6f8){logger[_0x29b497(0x11e)](_0x29b497(0x131)+_0x41cd06+_0x29b497(0xed)+_0x30c6f8);try{return await _0x2b2251[_0x29b497(0x10e)][_0x29b497(0xf6)](_0x41cd06);}catch(_0x12c7a7){return logger[_0x29b497(0x11e)]('getSegmentEntity\x20also\x20failed\x20for\x20'+_0x41cd06+':\x20'+_0x12c7a7),null;}}}function recoverSegmentIdsFromPushRecovery(_0x2a35a2,_0xc00c8e,_0x5a426d){const _0x1899b9=a140_0x47e9b3,_0x5bc995=readPushRecovery(_0x2a35a2[_0x1899b9(0x126)]);if(_0x5bc995?.[_0x1899b9(0x173)]===_0x2a35a2[_0x1899b9(0x15c)][_0x1899b9(0x1ad)])for(const [_0x556468,_0x4c30d5]of Object[_0x1899b9(0x16e)](_0x5bc995[_0x1899b9(0xe2)])){const _0x497805=generateDeterministicJourneySegmentName(_0x2a35a2[_0x1899b9(0x15c)][_0x1899b9(0x1ad)],_0x556468);_0x4c30d5[_0x1899b9(0x10f)]===_0x497805&&(_0xc00c8e[_0x1899b9(0xc5)](_0x556468,_0x4c30d5[_0x1899b9(0x193)]),_0x5a426d['set'](_0x556468,_0x4c30d5['segmentId']));}}async function createOrRecoverEmbeddedSegment(_0x190e1d,_0x4b1ceb,_0x62bf9c,_0x5a372d){const _0x4df529=a140_0x47e9b3;let _0x40cdd3;try{_0x40cdd3=await _0x190e1d['segment'][_0x4df529(0x19b)]({'name':_0x62bf9c['uniqueSegmentName'],'description':_0x62bf9c['description'],'journeyId':_0x62bf9c[_0x4df529(0x166)],'rule':_0x5a372d(_0x62bf9c[_0x4df529(0xcb)],!![]),'countPopulation':!![],'parentFolderId':_0x62bf9c['folderId'],'audienceId':_0x62bf9c[_0x4df529(0x108)]});}catch(_0xbd750e){const _0x4d54e0=_0xbd750e instanceof Error&&_0xbd750e[_0x4df529(0x175)][_0x4df529(0x13d)](_0x4df529(0x135));if(_0x4d54e0){const _0x2966a0=readPushRecovery(_0x4b1ceb[_0x4df529(0x126)]),_0x268816=_0x2966a0?.[_0x4df529(0x173)]===_0x4b1ceb[_0x4df529(0x15c)]['name']?_0x2966a0[_0x4df529(0xe2)][_0x62bf9c['localName']]:undefined;if(_0x268816?.[_0x4df529(0x10f)]===_0x62bf9c[_0x4df529(0x105)])await _0x190e1d[_0x4df529(0x10e)][_0x4df529(0x119)](_0x62bf9c['parentId'],_0x268816[_0x4df529(0x193)],{'description':_0x62bf9c[_0x4df529(0x14e)],'rule':_0x5a372d(_0x62bf9c[_0x4df529(0xcb)],!![]),'countPopulation':!![]}),_0x40cdd3=_0x268816[_0x4df529(0x193)];else throw new SDKError(ErrorCode[_0x4df529(0xfd)],_0x4df529(0x136)+_0x62bf9c[_0x4df529(0x144)]+_0x4df529(0xf3)+(_0x4df529(0x12e)+_0x4b1ceb[_0x4df529(0x126)][_0x4df529(0x1b2)](/([^/]+)$/,'.$1.push-recovery.json')+')\x20')+_0x4df529(0x161),_0xbd750e);}else throw _0xbd750e;}return saveSegmentToPushRecovery(_0x4b1ceb['absolutePath'],_0x4b1ceb['yamlConfig'][_0x4df529(0x1ad)],_0x62bf9c[_0x4df529(0x144)],{'segmentId':_0x40cdd3,'uniqueServerName':_0x62bf9c[_0x4df529(0x105)],'createdAt':new Date()[_0x4df529(0x17e)]()}),_0x40cdd3;}export async function prepareSegmentFiles(_0x16c8b5,_0x4bbfe3,_0x31b8ff,_0x3de303,_0x1874e6){const _0x3498f5=a140_0x47e9b3,{activationDefToCreateRequest:_0x288734}=await import('./child-segment-yaml.js'),_0x203395=[],_0x2d8a24=new Set();for(const {yamlConfig:_0x58265a,folderPath:_0x4b4e99,sourcePath:_0x465ef0}of _0x16c8b5){const _0x1e7200=resolveTDFolderPath(_0x4b4e99,_0x3de303,_0x1874e6),_0x388e26=_0x1e7200+':'+_0x58265a[_0x3498f5(0x1ad)],_0x10ce21=_0x4bbfe3[_0x3498f5(0x158)][_0x3498f5(0x188)](_0x388e26),_0x5bae44=_0x10ce21?_0x4bbfe3['activationsBySegmentId'][_0x3498f5(0x188)](_0x10ce21['id'])||[]:[];addFoldersToCreate(_0x1e7200,_0x4bbfe3[_0x3498f5(0x10b)],_0x2d8a24);const _0x3b3d5e=calculateActivationActions(_0x58265a[_0x3498f5(0x1a9)]||[],_0x5bae44,_0x4bbfe3['idToEmailMap'],_0x4bbfe3[_0x3498f5(0x157)]);for(const _0x35840d of _0x3b3d5e){(_0x35840d[_0x3498f5(0xce)]===_0x3498f5(0xdc)||_0x35840d[_0x3498f5(0xce)]===_0x3498f5(0xc9))&&_0x35840d[_0x3498f5(0xd0)]&&(_0x35840d['validatedRequest']=await _0x288734(_0x35840d['yamlActivation'],_0x31b8ff));}const _0x1460c3=calculateSegmentDiff(_0x58265a,_0x10ce21,_0x5bae44,_0x4bbfe3[_0x3498f5(0x17a)],_0x4bbfe3['connectionIdToNameMap']);_0x203395[_0x3498f5(0x181)]({'relativePath':_0x58265a[_0x3498f5(0x1ad)],'absolutePath':_0x465ef0,'yamlConfig':_0x58265a,'folderPath':_0x1e7200,'existingSegment':_0x10ce21,'existingActivations':_0x5bae44,'isNew':_0x1460c3[_0x3498f5(0xc7)],'hasChanges':_0x1460c3['hasChanges'],'diff':_0x1460c3[_0x3498f5(0xde)],'activationActions':_0x3b3d5e});}return{'segmentFiles':_0x203395,'foldersToCreate':_0x2d8a24};}export async function prepareJourneyFiles(_0x1301be,_0x13221d,_0x2e8f94,_0x2799c7){const _0x33f77b=a140_0x47e9b3,_0x1e4d9e=[],_0x9ab21c=new Set();for(const {yamlConfig:_0x19ea12,folderPath:_0x32538b,sourcePath:_0x11dc3d}of _0x1301be){const _0x581f14=resolveTDFolderPath(_0x32538b,_0x2e8f94,_0x2799c7),_0xee5d4b=_0x581f14+':'+_0x19ea12[_0x33f77b(0x1ad)],_0x59aa7c=_0x13221d[_0x33f77b(0x10d)][_0x33f77b(0x188)](_0xee5d4b);let _0x27dd90,_0x920977;if(_0x59aa7c&&_0x59aa7c[_0x33f77b(0xf9)]>0x0){const _0x45e358=buildLocalExpandedRuleMappings(_0x19ea12),{createYamlContext:_0x282e24,prefetchJourneySegments:_0x510ee0}=createPushYamlContextForBundle(_0x13221d['deps'],_0x13221d[_0x33f77b(0x108)],_0x13221d[_0x33f77b(0x142)],_0x45e358,_0x13221d[_0x33f77b(0x17a)],_0x13221d[_0x33f77b(0x157)],_0x13221d[_0x33f77b(0x153)],_0x13221d['journeyById']);await _0x510ee0(_0x59aa7c[_0x33f77b(0x154)](_0x58c2ac=>_0x58c2ac['id']));const _0x277967=await _0x13221d[_0x33f77b(0x11b)]['journey'][_0x33f77b(0x139)](_0x59aa7c[0x0][_0x33f77b(0x14a)]),_0x3790cf=hasMultipleVersions(_0x19ea12),_0x5585d6=async _0x1ea921=>{const _0xe48007=_0x33f77b,_0x1ba6be=_0x13221d[_0xe48007(0x1a5)]?.[_0xe48007(0x188)](_0x1ea921);if(_0x1ba6be)return _0x1ba6be;return _0x13221d[_0xe48007(0x1b0)]({'journeyId':_0x1ea921,'journeyName':_0x19ea12[_0xe48007(0x1ad)],'isMultiVersion':_0x59aa7c[_0xe48007(0xf9)]>0x1});};if(_0x3790cf&&_0x59aa7c[_0x33f77b(0xf9)]>0x1){const _0x333c19=[];for(const _0x2d9634 of _0x59aa7c){const _0x144d2b=_0x2d9634[_0x33f77b(0x170)]||0x1;_0x13221d['progress']?.['update'](_0x33f77b(0x132)+_0x19ea12[_0x33f77b(0x1ad)]+'\x20v'+_0x144d2b);const _0x37e514=await _0x5585d6(_0x2d9634['id']),_0x4cf5f9=_0x282e24(_0x2d9634['id']),_0x205b5b=await journeyResponseToDef(_0x37e514,_0x4cf5f9);_0x333c19[_0x33f77b(0x181)]({'item':_0x2d9634,'yaml':_0x205b5b});}const _0x30789a=buildLocalRuleToNameMappingFromJourney(_0x19ea12);_0x920977=buildMergedJourneyDef(_0x333c19,_0x30789a,_0x277967);const _0x43ae1a=Math[_0x33f77b(0x123)](..._0x333c19[_0x33f77b(0x154)](_0x782223=>_0x782223[_0x33f77b(0x192)][_0x33f77b(0x170)]||0x0)),_0x1ae98d=_0x59aa7c['find'](_0x12ef98=>(_0x12ef98[_0x33f77b(0x170)]||0x0)===_0x43ae1a);_0x1ae98d&&(_0x13221d[_0x33f77b(0xda)]?.['update'](_0x33f77b(0x132)+_0x19ea12[_0x33f77b(0x1ad)]+'\x20v'+_0x43ae1a),_0x27dd90=await _0x5585d6(_0x1ae98d['id']));}else{const _0x11bd62=_0x59aa7c[_0x59aa7c[_0x33f77b(0xf9)]-0x1];_0x13221d[_0x33f77b(0xda)]?.[_0x33f77b(0xc9)](_0x33f77b(0x132)+_0x19ea12['name']),_0x27dd90=await _0x5585d6(_0x11bd62['id']);const _0x28cd02=_0x282e24(_0x11bd62['id']),_0x29a436=await journeyResponseToDef(_0x27dd90,_0x28cd02),_0x5ca1b1=buildLocalRuleToNameMappingFromJourney(_0x19ea12);_0x920977=buildMergedJourneyDef([{'item':_0x11bd62,'yaml':_0x29a436}],_0x5ca1b1,_0x277967);}}addFoldersToCreate(_0x581f14,_0x13221d[_0x33f77b(0x10b)],_0x9ab21c);const _0x18a7be=calculateJourneyDiff(_0x19ea12,_0x920977);_0x1e4d9e[_0x33f77b(0x181)]({'relativePath':_0x19ea12[_0x33f77b(0x1ad)],'absolutePath':_0x11dc3d,'yamlConfig':_0x19ea12,'folderPath':_0x581f14,'existingJourney':_0x27dd90,'isNew':_0x18a7be['isNew'],'hasChanges':_0x18a7be[_0x33f77b(0x129)],'diff':_0x18a7be[_0x33f77b(0xde)]});}return{'journeyFiles':_0x1e4d9e,'foldersToCreate':_0x9ab21c};}export function calculateActivationActions(_0xe21407,_0x3c2066,_0x5e7d2e,_0x1551e6){const _0x3c51d4=a140_0x47e9b3,_0x25a0fa=[],_0x5f5b7d=new Map();for(const _0x2ed155 of _0x3c2066){_0x5f5b7d[_0x3c51d4(0xc5)](_0x2ed155[_0x3c51d4(0x1ad)],_0x2ed155);}const _0x52d7e5=new Map();for(const _0x9bb22e of _0xe21407){_0x52d7e5[_0x3c51d4(0xc5)](_0x9bb22e['name'],_0x9bb22e);}for(const _0x4d29ab of _0xe21407){const _0x5bb825=_0x5f5b7d['get'](_0x4d29ab[_0x3c51d4(0x1ad)]);if(!_0x5bb825)_0x25a0fa['push']({'type':_0x3c51d4(0xdc),'name':_0x4d29ab[_0x3c51d4(0x1ad)],'yamlActivation':_0x4d29ab});else{const _0x40b128=activationResponseToDef(_0x5bb825,_0x5e7d2e,_0x1551e6),_0x5b81a9=a140_0x241f52[_0x3c51d4(0x102)](_0x40b128),_0x48585b=a140_0x241f52['stringify'](_0x4d29ab);_0x5b81a9!==_0x48585b&&_0x25a0fa[_0x3c51d4(0x181)]({'type':_0x3c51d4(0xc9),'name':_0x4d29ab['name'],'yamlActivation':_0x4d29ab,'existingActivation':_0x5bb825});}}for(const _0x1e71d6 of _0x3c2066){!_0x52d7e5[_0x3c51d4(0xba)](_0x1e71d6['name'])&&_0x25a0fa[_0x3c51d4(0x181)]({'type':_0x3c51d4(0xb6),'name':_0x1e71d6[_0x3c51d4(0x1ad)],'existingActivation':_0x1e71d6});}return _0x25a0fa;}function calculateYamlDiff(_0x4e7cc8,_0x5e62ff){if(_0x5e62ff){const _0x1268e7=generateDiff(_0x5e62ff,_0x4e7cc8),_0x4493b1=hasChanges(_0x1268e7);return{'isNew':![],'hasChanges':_0x4493b1,'diff':_0x4493b1?formatDiffWithColors(_0x1268e7):undefined};}const _0x4b5ab4=generateDiff('',_0x4e7cc8);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x4b5ab4)};}function a140_0x564c(_0x23792,_0x54b85f){_0x23792=_0x23792-0xb2;const _0x1ddecb=a140_0x1dde();let _0x564c2e=_0x1ddecb[_0x23792];return _0x564c2e;}export function calculateSegmentDiff(_0x565572,_0x4e6045,_0x400000,_0x1ee7a8,_0x255ff4){const _0x252ee3=segmentToYamlString(_0x565572),_0x37206a=_0x4e6045?segmentToYamlString(segmentWithActivationsToYaml(_0x4e6045,_0x400000,undefined,_0x1ee7a8,_0x255ff4)):undefined;return calculateYamlDiff(_0x252ee3,_0x37206a);}export function calculateJourneyDiff(_0x5456ea,_0x899269){const _0x157550=normalizeJourneyDef(_0x5456ea,_0x5456ea),_0x43b737=a140_0x1a8958(_0x157550),_0x56cc66=_0x899269?a140_0x1a8958(normalizeJourneyDef(_0x899269,_0x5456ea)):undefined;return calculateYamlDiff(_0x43b737,_0x56cc66);}export function findSegmentsToDelete(_0x3ca2c1,_0x17b1df,_0x1efc06,_0x302ed9,_0x531e0e){const _0x348c9a=a140_0x47e9b3,_0x4d79a0=new Set();for(const {yamlConfig:_0x40a9b4,folderPath:_0x30b6de}of _0x17b1df){_0x4d79a0[_0x348c9a(0x13c)](_0x30b6de+':'+_0x40a9b4[_0x348c9a(0x1ad)]);}return _0x3ca2c1[_0x348c9a(0x13a)](_0x22ca5d=>{const _0x304bbb=_0x348c9a,_0x374f14=_0x22ca5d[_0x304bbb(0x148)]?_0x1efc06[_0x304bbb(0x188)](_0x22ca5d[_0x304bbb(0x148)][_0x304bbb(0x118)]())||'':'',_0xc1ff69=_0x374f14+':'+_0x22ca5d['name'];if(_0x4d79a0['has'](_0xc1ff69))return![];if(_0x531e0e)return _0x374f14===_0x302ed9||_0x374f14[_0x304bbb(0xd1)](_0x302ed9+'/');return!![];});}export function findJourneysToDelete(_0x51ae2e,_0x4ee414,_0x5d58d7,_0x177b3e,_0x3ed503){const _0x114184=a140_0x47e9b3,_0x178f16=new Set();for(const {yamlConfig:_0x2610a3,folderPath:_0x5f498b}of _0x4ee414){_0x178f16[_0x114184(0x13c)](_0x5f498b+':'+_0x2610a3[_0x114184(0x1ad)]);}return _0x51ae2e[_0x114184(0x13a)](_0xa3a890=>{const _0x225430=_0x114184,_0x47bb14=_0xa3a890['folderId']?_0x5d58d7[_0x225430(0x188)](_0xa3a890[_0x225430(0x1b6)])||'':'',_0x393aa5=_0x47bb14+':'+_0xa3a890[_0x225430(0x1ae)];if(_0x178f16[_0x225430(0xba)](_0x393aa5))return![];if(_0x3ed503)return _0x47bb14===_0x177b3e||_0x47bb14['startsWith'](_0x177b3e+'/');return!![];});}export function buildSegmentLookupMap(_0x1b8c7d,_0x4fe4ab){const _0x18ccc1=a140_0x47e9b3,_0x5ad04c=new Map();for(const _0x9b2b1 of _0x1b8c7d){const _0x43d534=_0x9b2b1[_0x18ccc1(0x148)]?_0x4fe4ab['get'](_0x9b2b1[_0x18ccc1(0x148)][_0x18ccc1(0x118)]())||'':'',_0x3872c4=_0x43d534+':'+_0x9b2b1['name'];_0x5ad04c['set'](_0x3872c4,_0x9b2b1);}return _0x5ad04c;}export function buildSegmentNameToIdMap(_0x1de56b){const _0x14a84a=a140_0x47e9b3,_0x2505bf=new Map();for(const _0x18e615 of _0x1de56b){_0x2505bf[_0x14a84a(0xc5)](_0x18e615['name'],_0x18e615['id']);}return _0x2505bf;}export function buildJourneyBundleLookupMap(_0x3a85e0,_0x40f104){const _0x7db16f=a140_0x47e9b3,_0x1e3eae=new Map();for(const _0x35b93d of _0x3a85e0){const _0x19575e=_0x35b93d[_0x7db16f(0x1b6)]?_0x40f104[_0x7db16f(0x188)](_0x35b93d[_0x7db16f(0x1b6)])||'':'',_0xb3f878=_0x19575e+':'+_0x35b93d[_0x7db16f(0x1ae)];!_0x1e3eae[_0x7db16f(0xba)](_0xb3f878)&&_0x1e3eae[_0x7db16f(0xc5)](_0xb3f878,[]),_0x1e3eae[_0x7db16f(0x188)](_0xb3f878)[_0x7db16f(0x181)](_0x35b93d);}for(const _0xa2b6ab of _0x1e3eae[_0x7db16f(0x18f)]()){_0xa2b6ab[_0x7db16f(0xbd)]((_0x57cd3b,_0x3e691b)=>(_0x57cd3b[_0x7db16f(0x170)]||0x0)-(_0x3e691b[_0x7db16f(0x170)]||0x0));}return _0x1e3eae;}export function collectFoldersToCreate(_0x287821,_0x723d8e){const _0x13767f=a140_0x47e9b3,_0xcbc77=new Set();for(const _0x394a72 of _0x287821){if(!_0x394a72)continue;if(_0x723d8e[_0x13767f(0xba)](_0x394a72))continue;const _0x531c74=_0x394a72[_0x13767f(0xc6)]('/');let _0x6047cc='';for(const _0x348c41 of _0x531c74){_0x6047cc=_0x6047cc?_0x6047cc+'/'+_0x348c41:_0x348c41,!_0x723d8e[_0x13767f(0xba)](_0x6047cc)&&_0xcbc77[_0x13767f(0x13c)](_0x6047cc);}}return _0xcbc77;}export function parseAndClassifyYamlFiles(_0x12317c,_0x40a734,_0x3d04f7){const _0x2734f9=a140_0x47e9b3,_0x4dd472=[],_0x25cdf7=[];for(const _0x396f88 of _0x12317c){const _0x3148e4=a140_0x4ffbc3[_0x2734f9(0xfa)](_0x40a734,a140_0x4ffbc3['dirname'](_0x396f88)),_0x3c0a95=_0x3148e4==='.'?'':_0x3148e4,_0x35e9bf=readFileSync(_0x396f88,'utf-8'),_0x8b1454=a140_0x241f52[_0x2734f9(0x171)](_0x35e9bf);if(isJourneyDef(_0x8b1454)){const _0x43ad35=a140_0x27048e(_0x35e9bf);_0x25cdf7[_0x2734f9(0x181)]({'yamlConfig':_0x43ad35,'folderPath':_0x3c0a95,'sourcePath':_0x396f88});}else{if(!_0x3d04f7?.[_0x2734f9(0xd7)]){const _0x5cc3e3=parseSegmentYamlFile(_0x35e9bf),_0x46d6dd=normalizeChildSegmentYaml(_0x5cc3e3);_0x4dd472[_0x2734f9(0x181)]({'yamlConfig':_0x46d6dd,'folderPath':_0x3c0a95,'sourcePath':_0x396f88});}}}return{'segments':_0x4dd472,'journeys':_0x25cdf7};}export function validateParsedFiles(_0x2fb50f,_0x25cac3){const _0x5dcd81=a140_0x47e9b3,_0x5404d9=[];for(const {yamlConfig:_0x104dfd,sourcePath:_0x298ce6}of _0x2fb50f[_0x5dcd81(0xe2)]){const _0x385439=readFileSync(_0x298ce6,_0x5dcd81(0x109)),_0x3b3bb7=a140_0x241f52['parseDocument'](_0x385439),_0x2d21d3=validateSegmentDef(_0x104dfd,{'source':_0x385439,'document':_0x3b3bb7},{'skipSchema':!![]});if(!_0x2d21d3['valid']){const _0xe84e76=a140_0x4ffbc3[_0x5dcd81(0xfa)](_0x25cac3,_0x298ce6);_0x5404d9[_0x5dcd81(0x181)]({'filePath':_0xe84e76,'source':_0x385439,'result':_0x2d21d3,'isJourney':![]});}}for(const {yamlConfig:_0xbd9499,sourcePath:_0x4f42fd}of _0x2fb50f[_0x5dcd81(0x15f)]){const _0x1c7c6a=readFileSync(_0x4f42fd,_0x5dcd81(0x109)),_0x1bc7a0=a140_0x241f52[_0x5dcd81(0xf8)](_0x1c7c6a),_0x171a36=validateJourneyDef(_0xbd9499,{'source':_0x1c7c6a,'document':_0x1bc7a0},{'skipSchema':!![]});if(!_0x171a36[_0x5dcd81(0xc4)]){const _0x5f00cb=a140_0x4ffbc3[_0x5dcd81(0xfa)](_0x25cac3,_0x4f42fd);_0x5404d9[_0x5dcd81(0x181)]({'filePath':_0x5f00cb,'source':_0x1c7c6a,'result':_0x171a36,'isJourney':!![]});}}return _0x5404d9;}export function formatValidationErrors(_0x48e915){const _0x2b9c6d=a140_0x47e9b3,_0x205726=[];for(const {filePath:_0xd64506,source:_0x263c36,result:_0x5b0aea,isJourney:_0x569aed}of _0x48e915){const _0x183d85=_0x569aed?_0x2b9c6d(0xe9):'segment';_0x205726['push']('\x0a'+_0xd64506+'\x20('+_0x183d85+_0x2b9c6d(0xfb)+_0x5b0aea['errors'][_0x2b9c6d(0xf9)]+_0x2b9c6d(0xd6)),_0x205726[_0x2b9c6d(0x181)](formatValidationResult(_0x5b0aea,_0x263c36,_0xd64506));}return _0x205726[_0x2b9c6d(0xb3)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x5a643e){const _0x1412ed=a140_0x47e9b3,_0x3bcffe=new Set(),_0x2b68a4=new Map(),_0x353891=collectSegmentUsageCounts(_0x5a643e);if(_0x5a643e[_0x1412ed(0xe2)])for(const [_0x3ad1cb,_0x1912e9]of Object[_0x1412ed(0x16e)](_0x5a643e[_0x1412ed(0xe2)])){_0x3bcffe[_0x1412ed(0x13c)](_0x3ad1cb);if(_0x1912e9[_0x1412ed(0x1ba)]){const _0x1d38f9=yamlRuleToApi(_0x1912e9[_0x1412ed(0x1ba)]),_0x1f680f=apiRuleToYaml(_0x1d38f9);_0x2b68a4[_0x1412ed(0xc5)](_0x3ad1cb,_0x1f680f);}}const _0x4036f0=new Map();let _0x4ae714=0x0;for(const [_0xd47d76,_0x5336be]of _0x2b68a4){const _0x5a5791=serializeExpandedRule(_0x5336be,_0x2b68a4),_0x194a4c=_0x4036f0[_0x1412ed(0x188)](_0x5a5791)||[];_0x194a4c[_0x1412ed(0x181)]({'name':_0xd47d76,'index':_0x4ae714}),_0x4036f0['set'](_0x5a5791,_0x194a4c),_0x4ae714++;}const _0x1a5e5f=new Map();for(const [_0x5b4967,_0x1d4fc4]of _0x4036f0){const _0xc82aa4=_0x1d4fc4['slice']()['sort']((_0x450714,_0x34b72e)=>{const _0x3e4863=_0x1412ed,_0x441185=_0x353891[_0x3e4863(0x188)](_0x450714[_0x3e4863(0x1ad)])||0x0,_0x7138d7=_0x353891[_0x3e4863(0x188)](_0x34b72e[_0x3e4863(0x1ad)])||0x0;if(_0x441185!==_0x7138d7)return _0x7138d7-_0x441185;return _0x450714[_0x3e4863(0xb2)]-_0x34b72e['index'];})[_0x1412ed(0x154)](_0x540e18=>_0x540e18[_0x1412ed(0x1ad)]),_0x4bb082=[];for(const _0x4d60bc of _0xc82aa4){const _0x53d4ea=_0x353891[_0x1412ed(0x188)](_0x4d60bc)||0x0,_0x31444c=Math[_0x1412ed(0x123)](_0x53d4ea,0x1);for(let _0x21d922=0x0;_0x21d922<_0x31444c;_0x21d922++){_0x4bb082['push'](_0x4d60bc);}}_0x1a5e5f['set'](_0x5b4967,_0x4bb082);}return{'existingLocalSegmentNames':_0x3bcffe,'localSegmentRules':_0x2b68a4,'localExpandedRuleToNames':_0x1a5e5f};}export function createSegmentIdResolver(_0x4f7c5b,_0x3b1454){return async _0x143437=>{const _0x4ce73c=a140_0x564c,_0x1f531e=_0x4f7c5b[_0x4ce73c(0x188)](_0x143437);if(!_0x1f531e)throw new SDKError(ErrorCode[_0x4ce73c(0x162)],'Segment\x20not\x20found:\x20'+_0x143437+_0x4ce73c(0x10a)+_0x3b1454+'\x27)');return _0x1f531e;};}export function extractRootFolderId(_0xa54bf2){const _0xea81ab=a140_0x47e9b3;return _0xa54bf2['relationships']?.[_0xea81ab(0x13e)]?.[_0xea81ab(0x120)]?.['id']||_0xa54bf2[_0xea81ab(0x155)]?.[_0xea81ab(0x12f)]?.['data']?.['id'];}export function buildConnectionMaps(_0x15fc98){const _0x19eac6=a140_0x47e9b3,_0x2098c2=new Map(),_0x1f4b54=new Map(),_0x3eb60a=new Map();for(const _0x7f5fcb of _0x15fc98){_0x2098c2[_0x19eac6(0xc5)](_0x7f5fcb[_0x19eac6(0x1ad)],parseInt(_0x7f5fcb['id'],0xa)),_0x1f4b54['set'](_0x7f5fcb['id'],_0x7f5fcb[_0x19eac6(0x1ad)]),_0x3eb60a[_0x19eac6(0xc5)](_0x7f5fcb['name'],_0x7f5fcb[_0x19eac6(0xce)]);}return{'nameToId':_0x2098c2,'idToName':_0x1f4b54,'nameToType':_0x3eb60a};}export function calculatePushStats(_0x60fad,_0x2d8b65,_0xfbfbf2,_0x124704,_0x17f909,_0x373553,_0x55cff7){const _0x5e3020=a140_0x47e9b3,_0xa6996e=_0x60fad[_0x5e3020(0x13a)](_0x5418ee=>_0x5418ee[_0x5e3020(0xc7)]),_0x52ce87=_0x60fad[_0x5e3020(0x13a)](_0x571a0d=>!_0x571a0d['isNew']&&_0x571a0d[_0x5e3020(0x129)]),_0x2a3538=_0x60fad[_0x5e3020(0x13a)](_0x487869=>!_0x487869['isNew']&&!_0x487869['hasChanges']),_0x346430=_0x373553?_0x124704:[],_0x7854b=_0x2d8b65[_0x5e3020(0x13a)](_0x501b5f=>_0x501b5f[_0x5e3020(0xc7)]),_0x13e5ae=_0x2d8b65[_0x5e3020(0x13a)](_0x264297=>!_0x264297[_0x5e3020(0xc7)]&&_0x264297[_0x5e3020(0x129)]),_0x6ecf73=_0x2d8b65[_0x5e3020(0x13a)](_0xb7a84f=>!_0xb7a84f['isNew']&&!_0xb7a84f[_0x5e3020(0x129)]),_0x192cea=_0x373553?_0x17f909:[],_0x264473=_0x60fad[_0x5e3020(0xd5)](_0x1680e0=>_0x1680e0[_0x5e3020(0xbf)]),_0x3bfab6=_0x264473[_0x5e3020(0x13a)](_0x4da6de=>_0x4da6de[_0x5e3020(0xce)]===_0x5e3020(0xdc)),_0x25dcba=_0x264473[_0x5e3020(0x13a)](_0x13ef77=>_0x13ef77[_0x5e3020(0xce)]===_0x5e3020(0xc9)),_0x671f43=_0x264473[_0x5e3020(0x13a)](_0x17253d=>_0x17253d['type']===_0x5e3020(0xb6)),_0x47c2cf=Array[_0x5e3020(0xe7)](_0xfbfbf2)[_0x5e3020(0xbd)](),_0x3962bd=_0x55cff7?![]:_0xa6996e[_0x5e3020(0xf9)]>0x0||_0x52ce87[_0x5e3020(0xf9)]>0x0||_0x346430['length']>0x0,_0x115cea=_0x7854b[_0x5e3020(0xf9)]>0x0||_0x13e5ae[_0x5e3020(0xf9)]>0x0||_0x192cea['length']>0x0,_0x21d101=_0x55cff7?![]:_0x264473[_0x5e3020(0xf9)]>0x0,_0x543bf3=_0x47c2cf[_0x5e3020(0xf9)]>0x0;return{'segments':{'new':_0xa6996e,'changed':_0x52ce87,'unchanged':_0x2a3538,'toDelete':_0x346430},'journeys':{'new':_0x7854b,'changed':_0x13e5ae,'unchanged':_0x6ecf73,'toDelete':_0x192cea},'activations':{'all':_0x264473,'toCreate':_0x3bfab6,'toUpdate':_0x25dcba,'toDelete':_0x671f43},'folders':{'toCreate':_0x47c2cf},'counts':{'segments':{'new':_0xa6996e[_0x5e3020(0xf9)],'changed':_0x52ce87[_0x5e3020(0xf9)],'unchanged':_0x2a3538[_0x5e3020(0xf9)],'toDelete':_0x346430[_0x5e3020(0xf9)]},'journeys':{'new':_0x7854b[_0x5e3020(0xf9)],'changed':_0x13e5ae['length'],'unchanged':_0x6ecf73[_0x5e3020(0xf9)],'toDelete':_0x192cea['length']},'activations':{'create':_0x3bfab6['length'],'update':_0x25dcba['length'],'delete':_0x671f43[_0x5e3020(0xf9)]},'folders':_0x47c2cf[_0x5e3020(0xf9)]},'hasChanges':_0x3962bd||_0x115cea||_0x21d101||_0x543bf3};}export async function buildPushExecutionContext(_0x5ead70,_0x4c6159,_0x4890c9,_0x3741c8,_0x52571d,_0x5659c7){const _0x3f21b2=a140_0x47e9b3,_0x4e95f2=extractRootFolderId(_0x4890c9),{pathToId:_0x58fb04,idToPath:_0x3187b2}=buildFolderMaps(_0x52571d),_0x3b4243=buildSegmentNameToIdMap(_0x3741c8),_0x28381a=new Map(),{batchAsync:_0x1db468}=await import('../../utils/async.js'),[_0x5c680f,_0x245c52]=await Promise[_0x3f21b2(0xbc)]([_0x5ead70['user'][_0x3f21b2(0x168)](),_0x5ead70[_0x3f21b2(0x1a8)][_0x3f21b2(0xfe)](),((async()=>{const _0x3d30c0=_0x3f21b2;!_0x5659c7&&_0x3741c8[_0x3d30c0(0xf9)]>0x0&&await _0x1db468(_0x3741c8,async _0x3c6991=>{const _0x4b1b8b=_0x3d30c0,_0x59027e=await _0x5ead70[_0x4b1b8b(0x10e)]['listActivations'](_0x4c6159,_0x3c6991['id']);_0x28381a[_0x4b1b8b(0xc5)](_0x3c6991['id'],_0x59027e);});})())]),{emailToId:_0x235a36,idToEmail:_0x45847d}=_0x5c680f,_0x36857e=buildConnectionMaps(_0x245c52);return{'rootFolderId':_0x4e95f2,'folderPathToId':_0x58fb04,'folderIdToPath':_0x3187b2,'segmentNameToId':_0x3b4243,'activationsBySegmentId':_0x28381a,'emailToIdMap':_0x235a36,'idToEmailMap':_0x45847d,'connectionNameToIdMap':_0x36857e['nameToId'],'connectionIdToNameMap':_0x36857e[_0x3f21b2(0x1a1)],'connectionNameToTypeMap':_0x36857e[_0x3f21b2(0x1b1)]};}export function createPushYamlContextForBundle(_0x23004c,_0x2832b8,_0x270ce9,_0xbb1d2b,_0x87f9e7,_0x38e7ff,_0x47db42,_0x3dc198){const {existingLocalSegmentNames:_0x56af43,localExpandedRuleToNames:_0x13856d}=_0xbb1d2b,_0x48de29=new Set(),_0x479088=new Map(),_0xb0ba32=new Map(),_0x232be1=new Map(),_0x23f0b3=createJumpTargetCache(),_0x272008=new Map(),_0x3cd7ff=new Map(),_0x3f189e=new Set();let _0xd1aff;const _0x4ac8fa=_0x470b5e=>{const _0x1da5a4={'resolveSegment':async _0x444c7d=>{const _0x2773ab=a140_0x564c,_0xc76f23=_0x232be1['get'](_0x444c7d);if(_0xc76f23!==undefined)return{'name':_0xc76f23,'isJourneyLocal':!![]};try{const _0x121d5e=await fetchSegment(_0x23004c,_0x2832b8,_0x444c7d,_0x270ce9);if(!_0x121d5e)throw new Error(_0x2773ab(0xdd));const _0x2d606b=generateJourneyLocalName(_0x121d5e[_0x2773ab(0x1ad)]),_0xccd538=_0x121d5e[_0x2773ab(0xd8)]===SEGMENT_KIND_JOURNEY&&_0x2d606b!==undefined;let _0x32ec7d=_0x121d5e['name'],_0x52e6c0;if(_0xccd538&&_0x121d5e[_0x2773ab(0x1ba)]){const _0x488b40=apiRuleToYaml(_0x121d5e['rule']);_0x3cd7ff[_0x2773ab(0xc5)](_0x444c7d,_0x488b40);const _0x1699e3=async _0x3eee4a=>{const _0x27c0e6=_0x2773ab,_0x3a6edd=collectSegmentRefsFromRule(_0x3eee4a);for(const _0x59802d of _0x3a6edd){if(!_0x3cd7ff[_0x27c0e6(0xba)](_0x59802d))try{const _0x1f3557=await fetchSegment(_0x23004c,_0x2832b8,_0x59802d,_0x270ce9);if(_0x1f3557?.[_0x27c0e6(0x1ba)]){const _0x58e6c3=apiRuleToYaml(_0x1f3557[_0x27c0e6(0x1ba)]);_0x3cd7ff[_0x27c0e6(0xc5)](_0x59802d,_0x58e6c3),await _0x1699e3(_0x58e6c3);}}catch(_0x4ef781){logger[_0x27c0e6(0x11e)]('Failed\x20to\x20fetch\x20referenced\x20segment\x20'+_0x59802d+':\x20'+_0x4ef781);}}};await _0x1699e3(_0x488b40);const _0x2da9a2=serializeExpandedRule(_0x488b40,_0x3cd7ff),_0x2ad64d=_0x13856d[_0x2773ab(0x188)](_0x2da9a2);if(_0x2ad64d&&_0x2ad64d[_0x2773ab(0xf9)]>0x0){const _0x180dda=_0x479088['get'](_0x2da9a2)||0x0,_0x5e4b3f=_0x2ad64d[_0x180dda]||_0x2ad64d[_0x2ad64d[_0x2773ab(0xf9)]-0x1];_0x479088[_0x2773ab(0xc5)](_0x2da9a2,_0x180dda+0x1),_0x32ec7d=_0x5e4b3f,_0x48de29[_0x2773ab(0x13c)](_0x32ec7d),_0x232be1[_0x2773ab(0xc5)](_0x444c7d,_0x32ec7d);const _0x43ea20=await resolveRuleSegmentRefs(_0x488b40,async _0x4207e1=>{const _0x5246d3=_0x2773ab,_0x799f8c=_0x232be1[_0x5246d3(0x188)](_0x4207e1);if(_0x799f8c)return _0x799f8c;const _0x2afdf6=await _0xd1aff[_0x5246d3(0x1b3)](_0x4207e1);return _0x2afdf6[_0x5246d3(0x1ad)];});_0x52e6c0={'description':_0x121d5e[_0x2773ab(0x14e)],'rule':_0x43ea20};}else{const _0x4e87da=_0x272008['get'](_0x2da9a2);if(_0x4e87da)_0x32ec7d=_0x4e87da,_0x232be1['set'](_0x444c7d,_0x32ec7d);else{if(_0x2d606b){let _0x3e5048=_0x2d606b,_0x6c02a7=0x2;while(_0x48de29[_0x2773ab(0xba)](_0x3e5048)||_0x56af43[_0x2773ab(0xba)](_0x3e5048)){_0x3e5048=_0x2d606b+'_'+_0x6c02a7,_0x6c02a7++;}_0x48de29['add'](_0x3e5048),_0x32ec7d=_0x3e5048;}_0x232be1[_0x2773ab(0xc5)](_0x444c7d,_0x32ec7d),_0x272008[_0x2773ab(0xc5)](_0x2da9a2,_0x32ec7d);const _0x10e7d2=await resolveRuleSegmentRefs(_0x488b40,async _0xfa1b9d=>{const _0x153888=_0x2773ab,_0x49b461=_0x232be1[_0x153888(0x188)](_0xfa1b9d);if(_0x49b461)return _0x49b461;const _0x5a608b=await _0xd1aff[_0x153888(0x1b3)](_0xfa1b9d);return _0x5a608b[_0x153888(0x1ad)];});_0x52e6c0={'description':_0x121d5e['description'],'rule':_0x10e7d2};}}}return{'name':_0x32ec7d,'isJourneyLocal':_0xccd538,'definition':_0x52e6c0};}catch(_0x24e1ee){return logger['debug'](_0x2773ab(0x122)+_0x444c7d+':\x20'+_0x24e1ee),{'name':_0x444c7d,'isJourneyLocal':![]};}},'resolveActivation':async _0x172d82=>{const _0x2dd96e=a140_0x564c,_0x277b7e=_0xb0ba32['get'](_0x172d82);if(_0x277b7e!==undefined)return{'name':_0x277b7e,'isJourneyLocal':!![]};try{let _0x4e07e9=_0x47db42?.[_0x2dd96e(0x188)](_0x172d82);!_0x4e07e9&&(_0x4e07e9=await _0x23004c[_0x2dd96e(0xe9)]['getActivation'](_0x470b5e,_0x172d82));const _0x177213=_0x4e07e9['attributes']['activationParams']['name']||_0x172d82,_0x2d68ab=sanitizeYamlKey(_0x177213)||_0x2dd96e(0x19c)+_0x172d82,_0x308b4b=_0x2d68ab;_0xb0ba32[_0x2dd96e(0xc5)](_0x172d82,_0x308b4b);const _0x392479=journeyActivationStepToYaml(_0x4e07e9,_0x87f9e7,_0x38e7ff);return{'name':_0x308b4b,'isJourneyLocal':!![],'definition':_0x392479};}catch(_0x19bc6d){return logger[_0x2dd96e(0x11e)](_0x2dd96e(0xb5)+_0x172d82+':\x20'+_0x19bc6d),{'name':_0x172d82,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x5052ad,_0x2dbf4b)=>resolveJumpTarget(_0x5052ad,_0x2dbf4b,_0x23f0b3,async _0x3031fe=>{const _0x51f172=a140_0x564c,_0x270fd8=_0x3dc198?.['get'](_0x3031fe);if(_0x270fd8)return _0x270fd8;return _0x23004c[_0x51f172(0xe9)][_0x51f172(0x15e)](_0x3031fe);})};return _0xd1aff=_0x1da5a4,_0x1da5a4;},_0x1ec392=async _0xe91831=>{const _0x35d602=a140_0x564c,{collectSegmentIdsFromJourneyApi:_0x45c9e2}=await import('./journey-yaml.js'),{batchAsync:_0x2f4143}=await import('../../utils/async.js'),_0x335d02=new Set();for(const _0xad6544 of _0xe91831){let _0x568823=_0x3dc198?.[_0x35d602(0x188)](_0xad6544);!_0x568823&&(_0x568823=await _0x23004c[_0x35d602(0xe9)]['getJourney'](_0xad6544));const _0x215747=_0x45c9e2(_0x568823);for(const _0x1d4530 of _0x215747){_0x335d02['add'](_0x1d4530);}}let _0x479516=Array[_0x35d602(0xe7)](_0x335d02);while(_0x479516[_0x35d602(0xf9)]>0x0){const _0xb4b940=_0x479516[_0x35d602(0x13a)](_0x25b1c4=>!_0x3f189e[_0x35d602(0xba)](_0x25b1c4));if(_0xb4b940['length']===0x0)break;const _0x92f5f5=await _0x2f4143(_0xb4b940,async _0xbf4a6a=>{const _0x463e6b=_0x35d602;_0x3f189e[_0x463e6b(0x13c)](_0xbf4a6a);const _0x3c1823=await fetchSegment(_0x23004c,_0x2832b8,_0xbf4a6a,_0x270ce9);if(!_0x3c1823)return null;return{'segmentId':_0xbf4a6a,'segment':_0x3c1823};},0xa),_0x4860af=new Set();for(const _0x1946fe of _0x92f5f5){if(!_0x1946fe?.[_0x35d602(0x10e)]?.[_0x35d602(0x1ba)])continue;const _0x35421a=apiRuleToYaml(_0x1946fe['segment'][_0x35d602(0x1ba)]);_0x3cd7ff[_0x35d602(0xc5)](_0x1946fe[_0x35d602(0x193)],_0x35421a);const _0x3a76d3=collectSegmentRefsFromRule(_0x35421a);for(const _0x501456 of _0x3a76d3){!_0x3f189e['has'](_0x501456)&&_0x4860af[_0x35d602(0x13c)](_0x501456);}}_0x479516=Array[_0x35d602(0xe7)](_0x4860af);}};return{'createYamlContext':_0x4ac8fa,'prefetchJourneySegments':_0x1ec392};}export async function executePushSegments(_0x39bdf4,_0x18c88b,_0x4eb0a3,_0x1ac84,_0x2baa6e){const _0x5cc8f1=a140_0x47e9b3,{segmentDefToCreateRequest:_0x5eab22,segmentDefToUpdateRequest:_0x58ddd4}=await import('./child-segment-yaml.js'),_0x35663b=_0x4eb0a3[_0x5cc8f1(0x10b)],_0x332543=0x5,_0xf5bfc=async _0x5eb5d1=>{const _0x56fa82=_0x5cc8f1,_0x2c4ad8=_0x5eb5d1[_0x56fa82(0x1a3)]?_0x35663b[_0x56fa82(0x188)](_0x5eb5d1[_0x56fa82(0x1a3)]):undefined;let _0x406e3b;const _0xe0ecf9={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x13eb99=_0x5eb5d1[_0x56fa82(0x15c)];if(_0x5eb5d1[_0x56fa82(0x15c)][_0x56fa82(0x1ba)]){const _0x4187e2=createSegmentIdResolver(_0x4eb0a3[_0x56fa82(0x18e)],_0x5eb5d1[_0x56fa82(0x15c)]['name']),_0x1812a4=await resolveRuleSegmentIds(_0x5eb5d1[_0x56fa82(0x15c)][_0x56fa82(0x1ba)],_0x4187e2);_0x13eb99={..._0x5eb5d1[_0x56fa82(0x15c)],'rule':_0x1812a4};}try{if(_0x5eb5d1[_0x56fa82(0xc7)]){_0x2baa6e[_0x56fa82(0x151)]?.({'type':_0x56fa82(0x1a2),'name':_0x5eb5d1[_0x56fa82(0x15c)]['name']});const _0x56e089=_0x5eab22(_0x13eb99,_0x2c4ad8),_0x2f9142=await _0x2baa6e[_0x56fa82(0xc2)]('Creating\x20segment\x20\x27'+_0x5eb5d1[_0x56fa82(0x15c)][_0x56fa82(0x1ad)]+_0x56fa82(0xf4),()=>_0x39bdf4[_0x56fa82(0x10e)][_0x56fa82(0x14f)](_0x1ac84[_0x56fa82(0x108)],_0x56e089));_0x406e3b=_0x2f9142[_0x56fa82(0x120)]['id'],_0x4eb0a3[_0x56fa82(0x18e)][_0x56fa82(0xc5)](_0x5eb5d1['yamlConfig'][_0x56fa82(0x1ad)],_0x406e3b),_0xe0ecf9[_0x56fa82(0x19a)]={'name':_0x5eb5d1['yamlConfig'][_0x56fa82(0x1ad)],'id':_0x406e3b},_0x2baa6e[_0x56fa82(0x151)]?.({'type':_0x56fa82(0xe6),'name':_0x5eb5d1[_0x56fa82(0x15c)][_0x56fa82(0x1ad)],'segmentId':_0x406e3b}),_0x2baa6e['logSuccess']?.(_0x56fa82(0x143)+_0x5eb5d1[_0x56fa82(0x15c)][_0x56fa82(0x1ad)]+'\x27'),_0xe0ecf9[_0x56fa82(0x115)]=0x1;}else{if(_0x5eb5d1[_0x56fa82(0x129)]){_0x2baa6e[_0x56fa82(0x151)]?.({'type':_0x56fa82(0x19d),'name':_0x5eb5d1['yamlConfig']['name']});const _0x3f60cc=_0x58ddd4(_0x13eb99);_0x2c4ad8!==_0x5eb5d1[_0x56fa82(0x1b4)]?.[_0x56fa82(0x148)]&&(_0x3f60cc['segmentFolderId']=_0x2c4ad8?parseInt(_0x2c4ad8,0xa):undefined),await _0x2baa6e['withProgress'](_0x56fa82(0x12d)+_0x5eb5d1[_0x56fa82(0x15c)]['name']+_0x56fa82(0xf4),()=>_0x39bdf4[_0x56fa82(0x10e)]['updateSegmentById'](_0x1ac84[_0x56fa82(0x108)],_0x5eb5d1[_0x56fa82(0x1b4)]['id'],_0x3f60cc)),_0x406e3b=_0x5eb5d1[_0x56fa82(0x1b4)]['id'],_0x2baa6e[_0x56fa82(0x151)]?.({'type':_0x56fa82(0x133),'name':_0x5eb5d1[_0x56fa82(0x15c)][_0x56fa82(0x1ad)]}),_0x2baa6e['logSuccess']?.('Updated\x20segment\x20\x27'+_0x5eb5d1['yamlConfig'][_0x56fa82(0x1ad)]+'\x27'),_0xe0ecf9[_0x56fa82(0x19e)]=0x1;}else _0x406e3b=_0x5eb5d1[_0x56fa82(0x1b4)]['id'];}}catch(_0x28eab4){const _0x22c772=isHttp400Error(_0x28eab4),_0x2cf4cc=_0x22c772?ErrorCode[_0x56fa82(0x14d)]:ErrorCode[_0x56fa82(0xfd)],_0x55fb3c=getErrorMessage(_0x28eab4);throw new SDKError(_0x2cf4cc,_0x56fa82(0x184)+(_0x5eb5d1[_0x56fa82(0xc7)]?_0x56fa82(0xdc):'update')+_0x56fa82(0x19f)+_0x5eb5d1[_0x56fa82(0x126)]+_0x56fa82(0x16c)+_0x55fb3c,_0x28eab4);}try{const _0x51bd8c=await syncActivationsForSegment(_0x39bdf4,_0x1ac84[_0x56fa82(0x108)],_0x406e3b,_0x5eb5d1[_0x56fa82(0x15c)][_0x56fa82(0x1ad)],_0x5eb5d1['activationActions'],_0x2baa6e,_0x5eb5d1['absolutePath']);_0xe0ecf9['activations']=_0x51bd8c;}catch(_0x2120c4){if(_0x2120c4 instanceof SDKError)throw _0x2120c4;throw new SDKError(ErrorCode[_0x56fa82(0x160)],'Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27'+_0x5eb5d1[_0x56fa82(0x15c)][_0x56fa82(0x1ad)]+_0x56fa82(0xcf)+_0x5eb5d1[_0x56fa82(0x126)]+'\x0a\x20\x20'+getErrorMessage(_0x2120c4),_0x2120c4);}return _0xe0ecf9;},_0x39a1ca=await batchAsync(_0x18c88b,_0xf5bfc,_0x332543),_0x21f46a={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x80019d of _0x39a1ca){_0x21f46a[_0x5cc8f1(0x115)]+=_0x80019d[_0x5cc8f1(0x115)],_0x21f46a[_0x5cc8f1(0x19e)]+=_0x80019d[_0x5cc8f1(0x19e)],_0x80019d['createdSegmentId']&&_0x21f46a[_0x5cc8f1(0x198)][_0x5cc8f1(0xc5)](_0x80019d[_0x5cc8f1(0x19a)][_0x5cc8f1(0x1ad)],_0x80019d[_0x5cc8f1(0x19a)]['id']),_0x21f46a[_0x5cc8f1(0x1a9)]['created']+=_0x80019d[_0x5cc8f1(0x1a9)][_0x5cc8f1(0x115)],_0x21f46a[_0x5cc8f1(0x1a9)][_0x5cc8f1(0x19e)]+=_0x80019d['activations'][_0x5cc8f1(0x19e)],_0x21f46a[_0x5cc8f1(0x1a9)]['deleted']+=_0x80019d[_0x5cc8f1(0x1a9)][_0x5cc8f1(0x18a)];}return _0x21f46a;}async function syncActivationsForSegment(_0x368e20,_0x5d6384,_0x3676d1,_0x153540,_0x106a12,_0x249396,_0x53ba44){const _0x2ad145=a140_0x47e9b3,_0x530534={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x5e8745 of _0x106a12){try{if(_0x5e8745[_0x2ad145(0xce)]===_0x2ad145(0xdc)&&_0x5e8745[_0x2ad145(0xe4)])_0x249396[_0x2ad145(0x151)]?.({'type':'activation_creating','segmentName':_0x153540,'activationName':_0x5e8745[_0x2ad145(0x1ad)]}),await _0x249396[_0x2ad145(0xc2)]('Creating\x20activation\x20\x27'+_0x5e8745[_0x2ad145(0x1ad)]+_0x2ad145(0xf4),()=>_0x368e20[_0x2ad145(0x10e)][_0x2ad145(0x141)](_0x5d6384,_0x3676d1,_0x5e8745[_0x2ad145(0xe4)])),_0x249396['onProgress']?.({'type':'activation_created','segmentName':_0x153540,'activationName':_0x5e8745[_0x2ad145(0x1ad)]}),_0x249396[_0x2ad145(0x197)]?.(_0x2ad145(0x163)+_0x5e8745[_0x2ad145(0x1ad)]+'\x27'),_0x530534['created']++;else{if(_0x5e8745[_0x2ad145(0xce)]===_0x2ad145(0xc9)&&_0x5e8745[_0x2ad145(0xe4)]&&_0x5e8745['existingActivation'])_0x249396[_0x2ad145(0x151)]?.({'type':'activation_updating','segmentName':_0x153540,'activationName':_0x5e8745[_0x2ad145(0x1ad)]}),await _0x249396[_0x2ad145(0xc2)](_0x2ad145(0x169)+_0x5e8745['name']+_0x2ad145(0xf4),()=>_0x368e20['segment'][_0x2ad145(0x180)](_0x5d6384,_0x3676d1,_0x5e8745['existingActivation']['id'],_0x5e8745[_0x2ad145(0xe4)])),_0x249396[_0x2ad145(0x151)]?.({'type':_0x2ad145(0x191),'segmentName':_0x153540,'activationName':_0x5e8745[_0x2ad145(0x1ad)]}),_0x249396['logSuccess']?.('Updated\x20activation\x20\x27'+_0x5e8745['name']+'\x27'),_0x530534[_0x2ad145(0x19e)]++;else _0x5e8745[_0x2ad145(0xce)]===_0x2ad145(0xb6)&&_0x5e8745[_0x2ad145(0x127)]&&(_0x249396[_0x2ad145(0x151)]?.({'type':_0x2ad145(0x13b),'segmentName':_0x153540,'activationName':_0x5e8745[_0x2ad145(0x1ad)]}),await _0x249396[_0x2ad145(0xc2)]('Deleting\x20activation\x20\x27'+_0x5e8745[_0x2ad145(0x1ad)]+'\x27...',()=>_0x368e20[_0x2ad145(0x10e)][_0x2ad145(0xfc)](_0x5d6384,_0x3676d1,_0x5e8745['existingActivation']['id'])),_0x249396[_0x2ad145(0x151)]?.({'type':_0x2ad145(0x189),'segmentName':_0x153540,'activationName':_0x5e8745[_0x2ad145(0x1ad)]}),_0x249396[_0x2ad145(0xd9)]?.('Deleted\x20activation\x20\x27'+_0x5e8745[_0x2ad145(0x1ad)]+'\x27'),_0x530534[_0x2ad145(0x18a)]++);}}catch(_0x597aab){const _0xcb69dd=isHttp400Error(_0x597aab),_0x569492=_0xcb69dd?ErrorCode[_0x2ad145(0xf5)]:ErrorCode[_0x2ad145(0x160)],_0x46f4bd=getErrorMessage(_0x597aab);throw new SDKError(_0x569492,_0x2ad145(0x184)+_0x5e8745[_0x2ad145(0xce)]+_0x2ad145(0xc3)+_0x5e8745['name']+_0x2ad145(0xcf)+_0x53ba44+_0x2ad145(0x16c)+_0x46f4bd,_0x597aab);}}return _0x530534;}function a140_0x1dde(){const _0x3ab39f=['Fetching\x20','segment_updated','conditionTimeoutDuration','Name\x20has\x20already\x20been\x20taken','Embedded\x20segment\x20\x27','find','565100wCHEHJ','getLatestJourneyId','filter','activation_deleting','add','includes','parentSegmentFolder','slice','embeddedSegmentNameToId','createActivation','existingSegments','Created\x20segment\x20\x27','localName','size','Created\x20journey\x20\x27','toLowerCase','segmentFolderId','with','journeyBundleId','logWarning','journey_updated','SEGMENT_SYNTAX_ERROR','description','createSegment','Segment\x20not\x20found:\x20','onProgress','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','activationStepsById','map','relationships','\x27\x20to\x20local\x20\x27','connectionIdToNameMap','segmentByFolderAndName','embedded_segment_created','Activation','attributes','yamlConfig','1633085bPGzWW','getJourney','journeys','ACTIVATION_UPDATE_ERROR','and\x20the\x20server\x20segment,\x20then\x20retry.','SEGMENT_NOT_FOUND','Created\x20activation\x20\x27','all_columns','13GzVKwl','journeyId','\x27\x20milestone','buildUserMaps','Updating\x20activation\x20\x27','WaitStep','Stage\x20\x27','\x0a\x20\x20','journey_updating','entries','decision_point','versionNumber','parse','segment_deleting','journeyName','INTERNAL','message','39937332cJmVbT','activationContext','conditionTimeoutUnit','folder_creating','idToEmailMap','journeyActivationStepId','createFolder','\x27\x20decision\x20point\x20branch\x20\x27','toISOString','object','updateActivation','push','some','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','Failed\x20to\x20','NOT_FOUND','notification','waitStep','get','activation_deleted','deleted','248tLIiHN','columns','folder_created','segmentNameToId','values','Journey\x20\x27','activation_updated','item','segmentId','effectiveFolderId','segment_deleted','190uGDEYc','logSuccess','createdSegmentIds','1vnmWti','createdSegmentId','createJourneySegment','activation_','segment_updating','updated','\x20segment\x20from\x20file:\x20','connector_config','idToName','segment_creating','folderPath','\x27\x20for\x20','journeyById','./child-segment-yaml.js','activation_template_id','connection','activations','949678OlVCgN','digest','keys','name','journeyBundleName','conditionSegmentId','fetchJourney','nameToType','replace','resolveSegment','existingSegment','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','folderId','action','Updated\x20journey\x20\x27','steps','rule','exitCriterias','milestone','index','join','\x27\x20wait\x20condition','Failed\x20to\x20resolve\x20activation\x20','delete','rootFolderId','8064119VutLnK','JOURNEY_UPDATE_ERROR','has','\x27\x20exit\x20criteria','all','sort','entry_criteria','activationActions','Deleted\x20segment\x20\x27','folder','withProgress','\x20activation\x20\x27','valid','set','split','isNew','stages','update','journeyStages','resolvedRule','existingJourney','embedded_segment_creating','type','\x27\x20from\x20file:\x20','yamlActivation','startsWith','entryCriteria','\x27\x20by\x20rule\x20content','null','flatMap','\x20error(s)','skipSegments','kind','logDeleted','progress','waitStepUnit','create','Segment\x20not\x20found','diff','../../utils/async.js','run_after_journey_refresh','results','segments','\x20(referenced\x20in\x20journey\x20','validatedRequest','192203SAHzqQ','segment_created','from','draft','journey','behavior','match','waitStepType',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','embedded_activation_created','reduce','journey_created','Created\x20folder\x20\x27','day','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','\x27...','ACTIVATION_SYNTAX_ERROR','getSegmentEntity','unchanged','parseDocument','length','relative','):\x20','deleteActivation','SEGMENT_UPDATE_ERROR','list','journey_creating','\x27\x20not\x20found\x20in\x20journey\x20\x27','trim','stringify','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','state','uniqueSegmentName','conditions','__pending_','parentId','utf-8','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','folderPathToId','./journey-yaml.js','journeyBundlesByFolderAndName','segment','uniqueServerName','deleteSegment','Entry\x20criteria:\x20','\x20journey\x20from\x20file:\x20','DecisionPoint','embedded_activation_creating','created','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','schedule','toString','updateSegmentById','21TdEUbY','deps','__pending_act_','getSegment','debug','branches','data','Duration','Failed\x20to\x20resolve\x20segment\x20','max','resolveJourneyId','stage\x20\x27','absolutePath','existingActivation','291321upuyvO','hasChanges','hex','sha1','goal','Updating\x20segment\x20\x27','Delete\x20the\x20push\x20recovery\x20file\x20(','parentFolder','6nJfBpW','getSegment\x20failed\x20for\x20'];a140_0x1dde=function(){return _0x3ab39f;};return a140_0x1dde();}export async function executePushFolders(_0x45affd,_0x4ed799,_0x740467,_0x48a3c0,_0x2b4ae0){const _0x1cde14=a140_0x47e9b3,_0x42d4d5=new Map(_0x740467),_0x4c5e27=sortFoldersByDepth(_0x4ed799);for(const _0x516110 of _0x4c5e27){const _0x233b0e=_0x516110['split']('/'),_0x6cc904=_0x233b0e[_0x233b0e[_0x1cde14(0xf9)]-0x1],_0x56ab8e=_0x233b0e[_0x1cde14(0x13f)](0x0,-0x1)[_0x1cde14(0xb3)]('/'),_0x673e2f=_0x42d4d5[_0x1cde14(0x188)](_0x56ab8e);_0x2b4ae0['onProgress']?.({'type':_0x1cde14(0x179),'folder':_0x516110});const _0xa5cc30={'name':_0x6cc904,'parentFolderId':_0x673e2f},_0x3c690e=await _0x2b4ae0['withProgress']('Creating\x20folder\x20\x27'+_0x516110+_0x1cde14(0xf4),()=>_0x45affd[_0x1cde14(0x10e)][_0x1cde14(0x17c)](_0x48a3c0[_0x1cde14(0x108)],_0xa5cc30));_0x42d4d5[_0x1cde14(0xc5)](_0x516110,_0x3c690e['data']['id']),_0x2b4ae0[_0x1cde14(0x151)]?.({'type':_0x1cde14(0x18d),'folder':_0x516110,'folderId':_0x3c690e[_0x1cde14(0x120)]['id']}),_0x2b4ae0['logInfo']?.(_0x1cde14(0xf1)+_0x516110+'\x27');}return _0x42d4d5;}export async function executePushSegmentDeletions(_0x4d428b,_0x141802,_0x4b2fa4){const _0x398b4c=a140_0x47e9b3;if(_0x141802[_0x398b4c(0xf9)]===0x0)return 0x0;const {batchAsync:_0x7199b2}=await import(_0x398b4c(0xdf)),_0x48be44=0x5,_0x39520a=await _0x7199b2(_0x141802,async _0x5ecaa1=>{const _0xc86a8a=_0x398b4c;return _0x4b2fa4[_0xc86a8a(0x151)]?.({'type':_0xc86a8a(0x172),'name':_0x5ecaa1[_0xc86a8a(0x1ad)]}),await _0x4d428b[_0xc86a8a(0x10e)][_0xc86a8a(0x110)](_0x5ecaa1['id']),_0x4b2fa4[_0xc86a8a(0x151)]?.({'type':_0xc86a8a(0x195),'name':_0x5ecaa1[_0xc86a8a(0x1ad)]}),_0x4b2fa4[_0xc86a8a(0xd9)]?.(_0xc86a8a(0xc0)+_0x5ecaa1[_0xc86a8a(0x1ad)]+'\x27'),0x1;},_0x48be44);return _0x39520a[_0x398b4c(0xef)]((_0x4206b7,_0x3195ba)=>_0x4206b7+_0x3195ba,0x0);}export async function executePushJourneys(_0x27431a,_0x13666f,_0xb1297d,_0x56f3b1,_0x1bd164){const _0x1ca16c=a140_0x47e9b3,{journeyDefToRequest:_0x1107a1}=await import(_0x1ca16c(0x10c)),{activationDefToCreateRequest:_0x254b49,yamlRuleToApi:_0x11002e,validateSegmentRule:_0x354d60}=await import(_0x1ca16c(0x1a6)),_0x3b1c2d={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x14cd8a=new Map(_0xb1297d[_0x1ca16c(0x18e)]),_0x1a067a=0x5;for(let _0x3293ea=0x0;_0x3293ea<_0x13666f[_0x1ca16c(0xf9)];_0x3293ea+=_0x1a067a){const _0x320140=_0x13666f['slice'](_0x3293ea,_0x3293ea+_0x1a067a),_0x2893fe=await Promise[_0x1ca16c(0xbc)](_0x320140['map'](async _0x2c0b97=>{const _0x36953d=_0x1ca16c;if(!_0x2c0b97[_0x36953d(0xc7)]&&!_0x2c0b97['hasChanges'])return{'action':_0x36953d(0xf7),'name':_0x2c0b97[_0x36953d(0x15c)][_0x36953d(0x1ad)],'journeyId':_0x2c0b97[_0x36953d(0xcc)]?.['id']};const _0x5dee4d=_0x2c0b97[_0x36953d(0x1a3)]?_0xb1297d[_0x36953d(0x10b)]['get'](_0x2c0b97['folderPath']):undefined;_0x1bd164['onProgress']?.({'type':_0x2c0b97[_0x36953d(0xc7)]?_0x36953d(0xff):_0x36953d(0x16d),'name':_0x2c0b97[_0x36953d(0x15c)][_0x36953d(0x1ad)]});try{const _0x66d1ff=await executeSingleJourneyPush(_0x27431a,_0x2c0b97,{..._0xb1297d,'segmentNameToId':_0x14cd8a},{'parentId':_0x56f3b1[_0x36953d(0x108)],'rootFolderId':_0x56f3b1[_0x36953d(0xb7)],'folderId':_0x5dee4d,'verbose':_0x56f3b1['verbose']},_0x1bd164,{'journeyDefToRequest':_0x1107a1,'activationDefToCreateRequest':_0x254b49,'yamlRuleToApi':_0x11002e,'validateSegmentRule':_0x354d60});for(const [_0x5e873e,_0x1b08cd]of _0x66d1ff[_0x36953d(0x140)]){_0x14cd8a[_0x36953d(0xc5)](_0x5e873e,_0x1b08cd),_0x3b1c2d[_0x36953d(0x140)][_0x36953d(0xc5)](_0x5e873e,_0x1b08cd);}if(_0x66d1ff['action']===_0x36953d(0x115))_0x1bd164[_0x36953d(0x151)]?.({'type':_0x36953d(0xf0),'name':_0x2c0b97[_0x36953d(0x15c)][_0x36953d(0x1ad)],'journeyId':_0x66d1ff[_0x36953d(0x166)]}),_0x1bd164[_0x36953d(0x197)]?.(_0x36953d(0x146)+_0x2c0b97[_0x36953d(0x15c)]['name']+'\x27'),_0x3b1c2d[_0x36953d(0x115)]++;else _0x66d1ff[_0x36953d(0x1b7)]===_0x36953d(0x19e)&&(_0x1bd164[_0x36953d(0x151)]?.({'type':_0x36953d(0x14c),'name':_0x2c0b97[_0x36953d(0x15c)][_0x36953d(0x1ad)]}),_0x1bd164['logSuccess']?.(_0x36953d(0x1b8)+_0x2c0b97[_0x36953d(0x15c)][_0x36953d(0x1ad)]+'\x27'),_0x3b1c2d[_0x36953d(0x19e)]++);return{'action':_0x66d1ff['action'],'name':_0x2c0b97['yamlConfig']['name'],'journeyId':_0x66d1ff[_0x36953d(0x166)]};}catch(_0x1d825d){const _0x32cc87=isHttp400Error(_0x1d825d),_0x4a0b49=_0x32cc87?ErrorCode['JOURNEY_SYNTAX_ERROR']:ErrorCode[_0x36953d(0xb9)],_0x14b358=getErrorMessage(_0x1d825d);throw new SDKError(_0x4a0b49,_0x36953d(0x184)+(_0x2c0b97[_0x36953d(0xc7)]?_0x36953d(0xdc):_0x36953d(0xc9))+_0x36953d(0x112)+_0x2c0b97[_0x36953d(0x126)]+_0x36953d(0x16c)+_0x14b358,_0x1d825d);}}));_0x3b1c2d[_0x1ca16c(0xe1)][_0x1ca16c(0x181)](..._0x2893fe);}return _0x3b1c2d;}async function matchExistingJourneySegments(_0x1f8f50,_0x24571b,_0x194c6d,_0x18ca1b,_0x5dcbfe){const _0x12b5ed=a140_0x47e9b3;if(!_0x24571b[_0x12b5ed(0xcc)]||!_0x24571b[_0x12b5ed(0x15c)][_0x12b5ed(0xe2)])return;const _0x3e937c=new Map(),_0x1fb87a=new Set();for(const _0x985772 of Object[_0x12b5ed(0x1ac)](_0x24571b['yamlConfig'][_0x12b5ed(0xe2)])){const _0x215764=generateDeterministicJourneySegmentName(_0x24571b[_0x12b5ed(0x15c)][_0x12b5ed(0x1ad)],_0x985772);_0x3e937c[_0x12b5ed(0xc5)](_0x215764,_0x985772),_0x1fb87a[_0x12b5ed(0x13c)](_0x985772);}const _0x1d2972=[],_0x53dde5=collectSegmentIdsFromJourneyApi(_0x24571b[_0x12b5ed(0xcc)]);for(const _0x37895b of _0x53dde5){const _0x2978f2=await fetchSegment(_0x1f8f50,_0x194c6d,_0x37895b,_0x18ca1b);if(!_0x2978f2?.[_0x12b5ed(0x1ad)])continue;const _0x7efb2e=_0x3e937c[_0x12b5ed(0x188)](_0x2978f2[_0x12b5ed(0x1ad)]);_0x7efb2e?(_0x5dcbfe[_0x12b5ed(0xc5)](_0x7efb2e,_0x37895b),_0x1fb87a[_0x12b5ed(0xb6)](_0x7efb2e)):_0x1d2972[_0x12b5ed(0x181)]({'id':_0x37895b,'seg':_0x2978f2});}if(_0x1fb87a[_0x12b5ed(0x145)]>0x0&&_0x1d2972['length']>0x0){const {localExpandedRuleToNames:_0xba00b1}=buildLocalExpandedRuleMappings(_0x24571b[_0x12b5ed(0x15c)]),_0x53cdb8=new Map();for(const {id:_0x40a3d0,seg:_0xeca30f}of _0x1d2972){if(_0xeca30f[_0x12b5ed(0x1ba)]){const _0x3f1206=apiRuleToYaml(_0xeca30f[_0x12b5ed(0x1ba)]);_0x53cdb8[_0x12b5ed(0xc5)](_0x40a3d0,_0x3f1206);}}for(const {id:_0xd48751,seg:_0x48a5e1}of _0x1d2972){if(!_0x48a5e1[_0x12b5ed(0x1ba)])continue;const _0x4fecfb=_0x53cdb8[_0x12b5ed(0x188)](_0xd48751);if(!_0x4fecfb)continue;const _0x1108e6=serializeExpandedRule(_0x4fecfb,_0x53cdb8),_0x32c677=_0xba00b1[_0x12b5ed(0x188)](_0x1108e6);if(_0x32c677){const _0x116ab4=_0x32c677['find'](_0x45031b=>_0x1fb87a[_0x12b5ed(0xba)](_0x45031b));_0x116ab4&&(_0x5dcbfe[_0x12b5ed(0xc5)](_0x116ab4,_0xd48751),_0x1fb87a[_0x12b5ed(0xb6)](_0x116ab4),logger[_0x12b5ed(0x11e)]('Matched\x20server\x20segment\x20\x27'+_0x48a5e1[_0x12b5ed(0x1ad)]+_0x12b5ed(0x156)+_0x116ab4+_0x12b5ed(0xd3)));}}}}async function executeSingleJourneyPush(_0x282178,_0x13f6be,_0x3426c2,_0x361296,_0x381e5f,_0x3e60e0){const _0x556925=a140_0x47e9b3,{journeyDefToRequest:_0x214461,activationDefToCreateRequest:_0x27e374,yamlRuleToApi:_0x1e3afb,validateSegmentRule:_0xe5b3e0}=_0x3e60e0,_0x5c2838=new Map(),_0x50cccd=new Map();recoverSegmentIdsFromPushRecovery(_0x13f6be,_0x5c2838,_0x3426c2[_0x556925(0x18e)]);const _0x56b86c=new Map(),_0x506da8=new Map(),_0x4951a0=new Map();let _0x3fdbd9;const _0x4a6bbb=async()=>{const _0x545d07=_0x556925;if(_0x3fdbd9)return;_0x3fdbd9=new Map();if(!_0x13f6be[_0x545d07(0xcc)])return;const _0x68f554=await _0x282178[_0x545d07(0xe9)]['listActivations'](_0x13f6be['existingJourney']['id']);for(const _0x30419b of _0x68f554){const _0x32e0d5=journeyActivationStepToYaml(_0x30419b,_0x3426c2[_0x545d07(0x17a)],_0x3426c2[_0x545d07(0x157)]),_0x1f3a10=activationSignature(_0x32e0d5);!_0x3fdbd9[_0x545d07(0xba)](_0x1f3a10)&&_0x3fdbd9['set'](_0x1f3a10,_0x30419b['id']),_0x32e0d5[_0x545d07(0x1ad)]&&_0x50cccd[_0x545d07(0xc5)](_0x32e0d5[_0x545d07(0x1ad)],_0x30419b['id']);}};await matchExistingJourneySegments(_0x282178,_0x13f6be,_0x361296[_0x556925(0x108)],_0x3426c2[_0x556925(0x142)],_0x3426c2[_0x556925(0x18e)]);const _0x159ec5={'resolveSegmentId':async _0x30838c=>{const _0x389e04=_0x556925,_0x428dc8=_0x3426c2[_0x389e04(0x18e)]['get'](_0x30838c);if(!_0x428dc8)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x389e04(0x150)+_0x30838c+_0x389e04(0xe3)+_0x13f6be[_0x389e04(0x15c)][_0x389e04(0x1ad)]+')');return _0x428dc8;},'resolveEmbeddedSegmentId':async(_0x268a09,_0x1fd1bf)=>{const _0x499e1b=_0x556925,_0x48b7cd=_0x3426c2[_0x499e1b(0x18e)][_0x499e1b(0x188)](_0x268a09);if(_0x48b7cd)return _0x48b7cd;const _0x9808b6=_0x3426c2[_0x499e1b(0x142)][_0x499e1b(0x137)](_0x210ca0=>_0x210ca0[_0x499e1b(0x1ad)]===_0x268a09);if(_0x9808b6)return _0x3426c2[_0x499e1b(0x18e)][_0x499e1b(0xc5)](_0x268a09,_0x9808b6['id']),_0x9808b6['id'];if(_0x13f6be['isNew']){const {stageName:_0x35dc9b,criteriaName:_0x5bdab9}=findSegmentCriteriaLocation(_0x13f6be[_0x499e1b(0x15c)],_0x268a09);return _0xe5b3e0(_0x268a09,_0x1fd1bf[_0x499e1b(0x1ba)]),_0x506da8['set'](_0x268a09,{'definition':_0x1fd1bf,'stageName':_0x35dc9b,'criteriaName':_0x5bdab9}),createPendingSegmentId(_0x268a09);}const _0x46c293=_0x13f6be[_0x499e1b(0xcc)]?.['id'];if(!_0x46c293)throw new SDKError(ErrorCode[_0x499e1b(0x174)],_0x499e1b(0x152));const _0x4c3a26=_0x56b86c[_0x499e1b(0x188)](_0x268a09);if(_0x4c3a26)return _0x4c3a26;const _0x5cf810=((async()=>{const _0xe1eebc=_0x499e1b;_0xe5b3e0(_0x268a09,_0x1fd1bf[_0xe1eebc(0x1ba)]);const _0x46fefa=generateDeterministicJourneySegmentName(_0x13f6be['yamlConfig']['name'],_0x268a09),_0x3e5e84=_0x3426c2[_0xe1eebc(0x142)][_0xe1eebc(0x137)](_0x799f56=>_0x799f56[_0xe1eebc(0x1ad)]===_0x46fefa),_0x24210b=createSegmentIdResolver(_0x3426c2[_0xe1eebc(0x18e)],_0x268a09),_0x5a784a=await resolveRuleSegmentIds(_0x1fd1bf[_0xe1eebc(0x1ba)],_0x24210b);let _0x3ebbb6;return _0x3e5e84?(await _0x282178[_0xe1eebc(0x10e)][_0xe1eebc(0x119)](_0x361296[_0xe1eebc(0x108)],_0x3e5e84['id'],{'description':_0x1fd1bf[_0xe1eebc(0x14e)]||'Entry\x20criteria:\x20'+_0x268a09,'rule':_0x1e3afb(_0x5a784a,!![]),'countPopulation':!![]}),_0x3ebbb6=_0x3e5e84['id'],saveSegmentToPushRecovery(_0x13f6be[_0xe1eebc(0x126)],_0x13f6be['yamlConfig'][_0xe1eebc(0x1ad)],_0x268a09,{'segmentId':_0x3ebbb6,'uniqueServerName':_0x46fefa,'createdAt':new Date()[_0xe1eebc(0x17e)]()})):_0x3ebbb6=await createOrRecoverEmbeddedSegment(_0x282178,_0x13f6be,{'localName':_0x268a09,'uniqueSegmentName':_0x46fefa,'description':_0x1fd1bf['description']||_0xe1eebc(0x111)+_0x268a09,'journeyId':_0x46c293,'resolvedRule':_0x5a784a,'parentId':_0x361296['parentId'],'folderId':_0x361296[_0xe1eebc(0xb7)]||''},_0x1e3afb),_0x3426c2[_0xe1eebc(0x18e)][_0xe1eebc(0xc5)](_0x268a09,_0x3ebbb6),_0x5c2838[_0xe1eebc(0xc5)](_0x268a09,_0x3ebbb6),_0x3ebbb6;})());_0x56b86c[_0x499e1b(0xc5)](_0x268a09,_0x5cf810);try{return await _0x5cf810;}finally{_0x56b86c['delete'](_0x268a09);}},'resolveActivationId':async _0x5b434b=>{const _0x5c876f=_0x556925,_0x1cdf3e=_0x50cccd[_0x5c876f(0x188)](_0x5b434b);if(_0x1cdf3e)return _0x1cdf3e;if(_0x13f6be[_0x5c876f(0xcc)]){await _0x4a6bbb();const _0x24688c=_0x50cccd[_0x5c876f(0x188)](_0x5b434b);if(_0x24688c)return _0x24688c;}throw new SDKError(ErrorCode['NOT_FOUND'],'Activation\x20not\x20found:\x20'+_0x5b434b+_0x5c876f(0xe3)+_0x13f6be[_0x5c876f(0x15c)][_0x5c876f(0x1ad)]+').\x20'+_0x5c876f(0x183));},'resolveEmbeddedActivationId':async(_0x5c6042,_0x1bd8a9)=>{const _0x506f21=_0x556925,_0x1a9ce0=_0x50cccd['get'](_0x5c6042);if(_0x1a9ce0)return _0x1a9ce0;if(_0x13f6be[_0x506f21(0xc7)])return _0x4951a0[_0x506f21(0xc5)](_0x5c6042,_0x1bd8a9),createPendingActivationId(_0x5c6042);if(_0x13f6be[_0x506f21(0xcc)]){await _0x4a6bbb();const _0x2d11bf=_0x50cccd[_0x506f21(0x188)](_0x1bd8a9[_0x506f21(0x1ad)]);if(_0x2d11bf)return _0x50cccd['set'](_0x5c6042,_0x2d11bf),_0x2d11bf;const _0x1c12f2=activationSignature(_0x1bd8a9),_0x65c1a7=_0x3fdbd9?.['get'](_0x1c12f2);if(_0x65c1a7)return _0x50cccd[_0x506f21(0xc5)](_0x5c6042,_0x65c1a7),_0x65c1a7;const _0x4054d3=await _0x27e374(_0x1bd8a9,_0x3426c2[_0x506f21(0x177)]),_0x307260={..._0x4054d3,..._0x1bd8a9['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x1bd8a9['run_after_journey_refresh']}},_0x5a3798=await _0x282178['journey'][_0x506f21(0x141)](_0x13f6be[_0x506f21(0xcc)]['id'],_0x307260);return _0x50cccd['set'](_0x5c6042,_0x5a3798['id']),_0x5a3798['id'];}throw new SDKError(ErrorCode[_0x506f21(0x174)],_0x506f21(0x1b5));},'resolveJourneyId':async _0x5410eb=>{const _0x3af9a9=_0x556925;try{return await _0x282178['journey'][_0x3af9a9(0x124)](_0x361296['parentId'],_0x5410eb);}catch(_0x2d1d78){throw new SDKError(ErrorCode[_0x3af9a9(0x185)],_0x3af9a9(0x190)+_0x5410eb+_0x3af9a9(0x103)+_0x13f6be['yamlConfig'][_0x3af9a9(0x1ad)]+'\x27)',_0x2d1d78);}},'resolveStageId':async(_0x364211,_0x4710d7)=>{const _0x466871=_0x556925,_0x30dcdb=await _0x282178[_0x466871(0xe9)]['getJourney'](_0x364211),_0x414ccb=_0x30dcdb[_0x466871(0x15b)][_0x466871(0xca)]['find'](_0x426c26=>_0x426c26[_0x466871(0x1ad)][_0x466871(0x147)]()===_0x4710d7[_0x466871(0x147)]());if(!_0x414ccb?.['id'])throw new SDKError(ErrorCode[_0x466871(0x185)],_0x466871(0x16b)+_0x4710d7+_0x466871(0x100)+(_0x30dcdb[_0x466871(0x15b)][_0x466871(0x1ae)]||_0x30dcdb[_0x466871(0x15b)][_0x466871(0x1ad)])+'\x27');return _0x414ccb['id'];}},_0x26d3e2=await _0x214461(_0x13f6be[_0x556925(0x15c)],_0x361296[_0x556925(0x108)],_0x159ec5),_0x32b895=_0x361296[_0x556925(0x1b6)]||_0x361296[_0x556925(0xb7)];_0x32b895&&(_0x26d3e2[_0x556925(0x155)]={'parentFolder':{'data':{'id':_0x32b895,'type':_0x556925(0xc1)}}});if(_0x13f6be[_0x556925(0xc7)]){if(_0x506da8[_0x556925(0x145)]>0x0||_0x4951a0['size']>0x0)return await executeThreeStepJourneyCreate(_0x282178,_0x13f6be,_0x26d3e2,{'pendingEmbeddedSegments':_0x506da8,'pendingEmbeddedActivations':_0x4951a0,'embeddedSegmentNameToId':_0x5c2838,'journeyActivationNameToId':_0x50cccd},{..._0x361296,'effectiveFolderId':_0x32b895},_0x3426c2,_0x381e5f,_0x3e60e0);else{ensureJourneyDefaults(_0x26d3e2[_0x556925(0x15b)]);const _0x4a31d0=await _0x282178[_0x556925(0xe9)][_0x556925(0xdc)](_0x26d3e2);return deletePushRecovery(_0x13f6be['absolutePath']),{'action':_0x556925(0x115),'journeyId':_0x4a31d0['id'],'embeddedSegmentNameToId':_0x5c2838};}}else{if(_0x13f6be[_0x556925(0x129)]&&_0x13f6be[_0x556925(0xcc)]){_0x26d3e2['id']=_0x13f6be['existingJourney']['id'];const _0xa4964=_0x26d3e2[_0x556925(0x15b)];_0x13f6be[_0x556925(0xcc)][_0x556925(0x15b)]?.[_0x556925(0x1ae)]&&(_0xa4964[_0x556925(0x1ae)]=_0x13f6be['existingJourney'][_0x556925(0x15b)][_0x556925(0x1ae)]);const _0xc5db7c=_0x13f6be['existingJourney'][_0x556925(0x15b)]?.[_0x556925(0xca)];return _0xc5db7c&&_0x26d3e2['attributes'][_0x556925(0xca)]&&injectExistingStageIds(_0x26d3e2[_0x556925(0x15b)]['journeyStages'],_0xc5db7c),ensureJourneyDefaults(_0xa4964),await _0x282178[_0x556925(0xe9)][_0x556925(0xc9)](_0x13f6be[_0x556925(0xcc)]['id'],_0x26d3e2),deletePushRecovery(_0x13f6be[_0x556925(0x126)]),{'action':_0x556925(0x19e),'journeyId':_0x13f6be[_0x556925(0xcc)]['id'],'embeddedSegmentNameToId':_0x5c2838};}}return deletePushRecovery(_0x13f6be[_0x556925(0x126)]),{'action':'unchanged','journeyId':_0x13f6be['existingJourney']?.['id'],'embeddedSegmentNameToId':_0x5c2838};}function findSegmentCriteriaLocation(_0x7e80d2,_0x2f3c57){const _0x463828=a140_0x47e9b3,_0x31b63d=_0x7e80d2[_0x463828(0xc8)]||_0x7e80d2[_0x463828(0x15f)]?.[0x0]?.[_0x463828(0xc8)]||[];let _0x2970d0='entry',_0x11923a=_0x2f3c57;const _0x15bf6c=_0x7e80d2[_0x463828(0x12c)]||_0x7e80d2['journeys']?.[0x0]?.['goal'];if(_0x15bf6c?.['segment']===_0x2f3c57)return{'stageName':_0x463828(0x12c),'criteriaName':_0x15bf6c[_0x463828(0x1ad)]||_0x2f3c57};_0x2f77a8:for(const _0x11b81e of _0x31b63d){if(_0x11b81e[_0x463828(0xbe)]?.[_0x463828(0x10e)]===_0x2f3c57){_0x2970d0=_0x11b81e[_0x463828(0x1ad)],_0x11923a=_0x11b81e[_0x463828(0xbe)][_0x463828(0x1ad)]||_0x2f3c57;break;}if(_0x11b81e[_0x463828(0x1b9)])for(const _0x3151ec of _0x11b81e[_0x463828(0x1b9)]){if(_0x3151ec[_0x463828(0xce)]===_0x463828(0x16f)&&_0x3151ec[_0x463828(0x149)]?.['branches'])for(const _0x4d67b4 of _0x3151ec['with']['branches']){if(_0x4d67b4['segment']===_0x2f3c57){_0x2970d0=_0x11b81e[_0x463828(0x1ad)],_0x11923a=_0x4d67b4[_0x463828(0x1ad)]||_0x2f3c57;break _0x2f77a8;}}}}return{'stageName':_0x2970d0,'criteriaName':_0x11923a};}async function executeThreeStepJourneyCreate(_0x4bdd04,_0x588336,_0x397844,_0x4bbb7a,_0x4aa1d0,_0x4622bd,_0x41ccb7,_0x256aef){const _0x4f31e5=a140_0x47e9b3,{activationDefToCreateRequest:_0xfd71e6,yamlRuleToApi:_0x42dfa9}=_0x256aef,{pendingEmbeddedSegments:_0x2cbdf6,pendingEmbeddedActivations:_0x28ab7c,embeddedSegmentNameToId:_0x392b92}=_0x4bbb7a,_0x12579c=JSON[_0x4f31e5(0x171)](JSON[_0x4f31e5(0x102)](_0x397844));ensureJourneyDefaults(_0x12579c[_0x4f31e5(0x15b)]),stripPendingIds(_0x12579c);const _0x46d3aa=await _0x4bdd04['journey'][_0x4f31e5(0xdc)](_0x12579c),_0x40e8ee=_0x46d3aa['id'],_0x58c07a=new Map();for(const _0x39ec10 of _0x46d3aa[_0x4f31e5(0x15b)]['journeyStages']){_0x58c07a[_0x4f31e5(0xc5)](_0x39ec10[_0x4f31e5(0x1ad)][_0x4f31e5(0x147)](),_0x39ec10['id']);}recoverSegmentIdsFromPushRecovery(_0x588336,_0x392b92,_0x4622bd[_0x4f31e5(0x18e)]);for(const [_0x2d9999,{definition:_0x22d67c}]of _0x2cbdf6){if(_0x392b92[_0x4f31e5(0xba)](_0x2d9999)){_0x41ccb7[_0x4f31e5(0x151)]?.({'type':_0x4f31e5(0x159),'journeyName':_0x588336[_0x4f31e5(0x15c)][_0x4f31e5(0x1ad)],'segmentName':_0x2d9999});continue;}const _0x2490d0=generateDeterministicJourneySegmentName(_0x588336[_0x4f31e5(0x15c)][_0x4f31e5(0x1ad)],_0x2d9999);_0x41ccb7[_0x4f31e5(0x151)]?.({'type':_0x4f31e5(0xcd),'journeyName':_0x588336['yamlConfig']['name'],'segmentName':_0x2d9999});const _0x3b9403=createSegmentIdResolver(_0x4622bd[_0x4f31e5(0x18e)],_0x2d9999),_0x2d35a3=await resolveRuleSegmentIds(_0x22d67c[_0x4f31e5(0x1ba)],_0x3b9403),_0x1fbb90=await createOrRecoverEmbeddedSegment(_0x4bdd04,_0x588336,{'localName':_0x2d9999,'uniqueSegmentName':_0x2490d0,'description':_0x22d67c[_0x4f31e5(0x14e)]||_0x4f31e5(0x111)+_0x2d9999,'journeyId':_0x40e8ee,'resolvedRule':_0x2d35a3,'parentId':_0x4aa1d0[_0x4f31e5(0x108)],'folderId':_0x4aa1d0[_0x4f31e5(0x194)]||''},_0x42dfa9);_0x392b92['set'](_0x2d9999,_0x1fbb90),_0x4622bd[_0x4f31e5(0x18e)]['set'](_0x2d9999,_0x1fbb90),_0x41ccb7[_0x4f31e5(0x151)]?.({'type':_0x4f31e5(0x159),'journeyName':_0x588336[_0x4f31e5(0x15c)][_0x4f31e5(0x1ad)],'segmentName':_0x2d9999});}const _0x285f0a=new Map();for(const [_0x283c11,_0x5c4d29]of _0x28ab7c){_0x41ccb7[_0x4f31e5(0x151)]?.({'type':_0x4f31e5(0x114),'journeyName':_0x588336['yamlConfig']['name'],'activationName':_0x283c11});const _0xe1c05d=await _0xfd71e6(_0x5c4d29,_0x4622bd[_0x4f31e5(0x177)]),_0x1de489={..._0xe1c05d,..._0x5c4d29['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x5c4d29[_0x4f31e5(0xe0)]}},_0x10bc57=await _0x4bdd04[_0x4f31e5(0xe9)][_0x4f31e5(0x141)](_0x40e8ee,_0x1de489);_0x285f0a[_0x4f31e5(0xc5)](_0x283c11,_0x10bc57['id']),_0x4bbb7a['journeyActivationNameToId'][_0x4f31e5(0xc5)](_0x283c11,_0x10bc57['id']),_0x41ccb7[_0x4f31e5(0x151)]?.({'type':_0x4f31e5(0xee),'journeyName':_0x588336[_0x4f31e5(0x15c)]['name'],'activationName':_0x283c11});}const _0x1c2618=JSON['parse'](JSON[_0x4f31e5(0x102)](_0x397844));return _0x1c2618['id']=_0x40e8ee,ensureJourneyDefaults(_0x1c2618['attributes']),resolvePendingIdsInRequest(_0x1c2618,_0x397844,_0x58c07a,_0x392b92,_0x285f0a,_0x41ccb7),await _0x4bdd04[_0x4f31e5(0xe9)][_0x4f31e5(0xc9)](_0x40e8ee,_0x1c2618),deletePushRecovery(_0x588336['absolutePath']),{'action':_0x4f31e5(0x115),'journeyId':_0x40e8ee,'embeddedSegmentNameToId':_0x392b92};}export function stripWaitStepPendingIds(_0x571c11){const _0x13298f=a140_0x47e9b3,_0x19404f=_0x571c11[_0x13298f(0x1af)]&&isPendingSegmentId(_0x571c11[_0x13298f(0x1af)]),_0x3ac28d=_0x571c11[_0x13298f(0x106)]?.[_0x13298f(0x182)](_0x283d8a=>_0x283d8a['segmentId']&&isPendingSegmentId(_0x283d8a['segmentId']));(_0x19404f||_0x3ac28d)&&(_0x571c11[_0x13298f(0xec)]=_0x13298f(0x121),_0x571c11[_0x13298f(0x187)]=0x1,_0x571c11['waitStepUnit']=_0x13298f(0xf2),delete _0x571c11['conditionSegmentId'],delete _0x571c11[_0x13298f(0x134)],delete _0x571c11[_0x13298f(0x178)],delete _0x571c11['conditions']);}export function resolveWaitStepPendingIds(_0x29a8c1,_0x4738ed,_0x59701b,_0x214f2d){const _0x4465a2=a140_0x47e9b3;if(_0x4738ed[_0x4465a2(0x1af)]&&isPendingSegmentId(_0x4738ed[_0x4465a2(0x1af)])){const _0x31bcab=_0x59701b(_0x4738ed[_0x4465a2(0x1af)],'stage\x20\x27'+_0x214f2d+_0x4465a2(0xb4));_0x31bcab&&(_0x29a8c1['waitStepType']='Condition',_0x29a8c1['conditionSegmentId']=_0x31bcab,delete _0x29a8c1['waitStep'],delete _0x29a8c1[_0x4465a2(0xdb)],_0x4738ed[_0x4465a2(0x134)]!==undefined&&(_0x29a8c1['conditionTimeoutDuration']=_0x4738ed[_0x4465a2(0x134)]),_0x4738ed['conditionTimeoutUnit']&&(_0x29a8c1[_0x4465a2(0x178)]=_0x4738ed['conditionTimeoutUnit']));}if(_0x4738ed['conditions']){const _0x54bf3a=_0x4738ed[_0x4465a2(0x106)]['some'](_0x5bc3d3=>_0x5bc3d3[_0x4465a2(0x193)]&&isPendingSegmentId(_0x5bc3d3['segmentId']));if(_0x54bf3a){const _0x5de971=_0x4738ed['conditions']['map'](_0x3d3555=>{const _0x56ad29=_0x4465a2;if(_0x3d3555[_0x56ad29(0x193)]&&isPendingSegmentId(_0x3d3555['segmentId'])){const _0x476a07=_0x59701b(_0x3d3555[_0x56ad29(0x193)],_0x56ad29(0x125)+_0x214f2d+'\x27\x20wait\x20condition');return{..._0x3d3555,'segmentId':_0x476a07||_0x3d3555[_0x56ad29(0x193)]};}return{..._0x3d3555};});_0x29a8c1['waitStepType']='Condition',_0x29a8c1[_0x4465a2(0x106)]=_0x5de971,delete _0x29a8c1[_0x4465a2(0x187)],delete _0x29a8c1[_0x4465a2(0xdb)],delete _0x29a8c1['conditionSegmentId'],delete _0x29a8c1['conditionTimeoutDuration'],delete _0x29a8c1[_0x4465a2(0x178)];}}}function stripPendingIds(_0x2480aa){const _0x2eaf14=a140_0x47e9b3;_0x2480aa[_0x2eaf14(0x15b)]['goal']?.[_0x2eaf14(0x193)]&&isPendingSegmentId(_0x2480aa[_0x2eaf14(0x15b)][_0x2eaf14(0x12c)]['segmentId'])&&delete _0x2480aa[_0x2eaf14(0x15b)][_0x2eaf14(0x12c)];for(const _0x4e0523 of _0x2480aa[_0x2eaf14(0x15b)]['journeyStages']||[]){_0x4e0523['entryCriteria']?.[_0x2eaf14(0x193)]&&isPendingSegmentId(_0x4e0523['entryCriteria'][_0x2eaf14(0x193)])&&delete _0x4e0523[_0x2eaf14(0xd2)];_0x4e0523[_0x2eaf14(0x1bc)]?.['segmentId']&&isPendingSegmentId(_0x4e0523[_0x2eaf14(0x1bc)]['segmentId'])&&delete _0x4e0523['milestone'];_0x4e0523[_0x2eaf14(0x1bb)]&&(_0x4e0523[_0x2eaf14(0x1bb)]=_0x4e0523[_0x2eaf14(0x1bb)]['filter'](_0xc9b555=>!_0xc9b555['segmentId']||!isPendingSegmentId(_0xc9b555['segmentId'])));if(_0x4e0523['steps'])for(const _0x6dbdc4 of Object[_0x2eaf14(0x1ac)](_0x4e0523['steps'])){const _0x4dba67=_0x4e0523[_0x2eaf14(0x1b9)][_0x6dbdc4];_0x4dba67[_0x2eaf14(0xce)]===_0x2eaf14(0x15a)&&_0x4dba67[_0x2eaf14(0x17b)]&&isPendingActivationId(_0x4dba67[_0x2eaf14(0x17b)])&&(_0x4dba67[_0x2eaf14(0x17b)]='');if(_0x4dba67['type']===_0x2eaf14(0x113)&&_0x4dba67['branches'])for(const _0x304c0a of _0x4dba67[_0x2eaf14(0x11f)]){_0x304c0a['segmentId']&&isPendingSegmentId(_0x304c0a[_0x2eaf14(0x193)])&&(_0x304c0a['segmentId']='');}_0x4dba67[_0x2eaf14(0xce)]===_0x2eaf14(0x16a)&&stripWaitStepPendingIds(_0x4dba67);}}}function resolvePendingIdsInRequest(_0x24c423,_0x575746,_0x1f4276,_0x258243,_0x15dbf9,_0x36e6b0){const _0x22be72=a140_0x47e9b3,_0x10841b=(_0x36d459,_0x1e01ac)=>{const _0x47bfff=a140_0x564c;if(!isPendingSegmentId(_0x36d459))return _0x36d459;const _0x181bc7=extractPendingSegmentName(_0x36d459),_0x41c9c5=_0x258243[_0x47bfff(0x188)](_0x181bc7);return!_0x41c9c5&&_0x36e6b0[_0x47bfff(0x14b)]?.(_0x47bfff(0x116)+_0x181bc7+_0x47bfff(0x1a4)+_0x1e01ac),_0x41c9c5;};if(_0x24c423[_0x22be72(0x15b)][_0x22be72(0x12c)]?.[_0x22be72(0x193)]&&isPendingSegmentId(_0x24c423[_0x22be72(0x15b)][_0x22be72(0x12c)][_0x22be72(0x193)])){const _0x1427f5=_0x10841b(_0x24c423['attributes'][_0x22be72(0x12c)][_0x22be72(0x193)],'goal\x20criteria');_0x1427f5&&(_0x24c423[_0x22be72(0x15b)][_0x22be72(0x12c)][_0x22be72(0x193)]=_0x1427f5);}for(const _0xbcd668 of _0x24c423[_0x22be72(0x15b)][_0x22be72(0xca)]||[]){const _0x22e97d=_0x1f4276[_0x22be72(0x188)](_0xbcd668['name'][_0x22be72(0x147)]());_0x22e97d&&(_0xbcd668['id']=_0x22e97d);if(_0xbcd668[_0x22be72(0xd2)]?.[_0x22be72(0x193)]&&isPendingSegmentId(_0xbcd668['entryCriteria'][_0x22be72(0x193)])){const _0x4fb1ef=_0x10841b(_0xbcd668[_0x22be72(0xd2)][_0x22be72(0x193)],'stage\x20\x27'+_0xbcd668[_0x22be72(0x1ad)]+'\x27\x20entry\x20criteria');_0x4fb1ef&&(_0xbcd668[_0x22be72(0xd2)][_0x22be72(0x193)]=_0x4fb1ef);}if(_0xbcd668[_0x22be72(0x1bb)])for(const _0x35218e of _0xbcd668[_0x22be72(0x1bb)]){if(_0x35218e[_0x22be72(0x193)]&&isPendingSegmentId(_0x35218e[_0x22be72(0x193)])){const _0x2c0846=_0x10841b(_0x35218e[_0x22be72(0x193)],_0x22be72(0x125)+_0xbcd668['name']+_0x22be72(0xbb));_0x2c0846&&(_0x35218e[_0x22be72(0x193)]=_0x2c0846);}}if(_0xbcd668[_0x22be72(0x1bc)]?.[_0x22be72(0x193)]&&isPendingSegmentId(_0xbcd668['milestone']['segmentId'])){const _0x23b7b4=_0x10841b(_0xbcd668[_0x22be72(0x1bc)][_0x22be72(0x193)],_0x22be72(0x125)+_0xbcd668['name']+_0x22be72(0x167));_0x23b7b4&&(_0xbcd668[_0x22be72(0x1bc)][_0x22be72(0x193)]=_0x23b7b4);}if(_0xbcd668[_0x22be72(0x1b9)]){const _0x2db31d=_0x440b24=>_0x575746[_0x22be72(0x15b)][_0x22be72(0xca)]?.[_0x22be72(0x137)](_0x150f8f=>_0x150f8f['name'][_0x22be72(0x147)]()===_0xbcd668[_0x22be72(0x1ad)][_0x22be72(0x147)]())?.[_0x22be72(0x1b9)]?.[_0x440b24];for(const _0x443cf6 of Object['keys'](_0xbcd668['steps'])){const _0x526349=_0xbcd668[_0x22be72(0x1b9)][_0x443cf6],_0x1ea689=_0x2db31d(_0x443cf6);if(_0x526349[_0x22be72(0xce)]==='Activation'&&_0x526349['journeyActivationStepId']&&(isPendingActivationId(_0x526349[_0x22be72(0x17b)])||_0x526349['journeyActivationStepId']==='')){if(_0x1ea689?.[_0x22be72(0x17b)]&&isPendingActivationId(_0x1ea689[_0x22be72(0x17b)])){const _0xd4777=extractPendingActivationName(_0x1ea689['journeyActivationStepId']),_0x189a10=_0x15dbf9[_0x22be72(0x188)](_0xd4777);_0x189a10&&(_0x526349[_0x22be72(0x17b)]=_0x189a10);}}if(_0x526349[_0x22be72(0xce)]==='DecisionPoint'&&_0x526349[_0x22be72(0x11f)]&&_0x1ea689?.[_0x22be72(0x11f)])for(let _0x5c0c7c=0x0;_0x5c0c7c<_0x526349[_0x22be72(0x11f)][_0x22be72(0xf9)];_0x5c0c7c++){const _0x2fe76b=_0x526349['branches'][_0x5c0c7c],_0x27293f=_0x1ea689[_0x22be72(0x11f)][_0x5c0c7c];if(_0x27293f?.[_0x22be72(0x193)]&&isPendingSegmentId(_0x27293f[_0x22be72(0x193)])){const _0x166978=_0x10841b(_0x27293f[_0x22be72(0x193)],_0x22be72(0x125)+_0xbcd668['name']+_0x22be72(0x17d)+(_0x2fe76b[_0x22be72(0x1ad)]||_0x5c0c7c)+'\x27');_0x166978&&(_0x2fe76b[_0x22be72(0x193)]=_0x166978);}}_0x526349[_0x22be72(0xce)]===_0x22be72(0x16a)&&_0x1ea689?.['type']===_0x22be72(0x16a)&&resolveWaitStepPendingIds(_0x526349,_0x1ea689,_0x10841b,_0xbcd668['name']);}}}}
|
|
1
|
+
const a140_0x2bcd56=a140_0x275f;(function(_0x1633c1,_0x1be4f3){const _0x3dbe66=a140_0x275f,_0xf416a2=_0x1633c1();while(!![]){try{const _0xe11502=parseInt(_0x3dbe66(0x21f))/0x1*(-parseInt(_0x3dbe66(0x223))/0x2)+parseInt(_0x3dbe66(0x16a))/0x3+parseInt(_0x3dbe66(0x14b))/0x4*(parseInt(_0x3dbe66(0x1c0))/0x5)+-parseInt(_0x3dbe66(0x171))/0x6+parseInt(_0x3dbe66(0x1f7))/0x7*(parseInt(_0x3dbe66(0x144))/0x8)+-parseInt(_0x3dbe66(0x1ee))/0x9*(parseInt(_0x3dbe66(0x19b))/0xa)+parseInt(_0x3dbe66(0x1a0))/0xb;if(_0xe11502===_0x1be4f3)break;else _0xf416a2['push'](_0xf416a2['shift']());}catch(_0x1b3131){_0xf416a2['push'](_0xf416a2['shift']());}}}(a140_0x4a99,0x61e66));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a140_0x2bcd56(0x179));export const PENDING_SEGMENT_PREFIX=a140_0x2bcd56(0x226);export const PENDING_ACTIVATION_PREFIX=a140_0x2bcd56(0x16b);export function createPendingSegmentId(_0x581d58){return''+PENDING_SEGMENT_PREFIX+_0x581d58+'__';}export function isPendingSegmentId(_0x14f772){const _0x48685b=a140_0x2bcd56;return _0x14f772[_0x48685b(0x145)](PENDING_SEGMENT_PREFIX)&&!_0x14f772[_0x48685b(0x145)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0xea3d4b){const _0x145fc8=a140_0x2bcd56;return _0xea3d4b[_0x145fc8(0x235)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x2325ae){return''+PENDING_ACTIVATION_PREFIX+_0x2325ae+'__';}export function isPendingActivationId(_0x407fa8){const _0xbc5d7c=a140_0x2bcd56;return _0x407fa8[_0xbc5d7c(0x145)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0xe9d50){return _0xe9d50['replace'](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x5c91b6,_0x577f64){const _0x335e15=a140_0x2bcd56,_0x2781d2=_0x5c91b6+'::'+(_0x577f64['trim']()||_0x335e15(0x169)),_0x32bead=createHash(_0x335e15(0x20a))[_0x335e15(0x1d5)](_0x2781d2)[_0x335e15(0x207)](_0x335e15(0x1f2))[_0x335e15(0x18c)](0x0,0xc);return _0x335e15(0x1ab)+_0x32bead;}export function ensureJourneyDefaults(_0x2189e0){const _0x455247=a140_0x2bcd56;!_0x2189e0[_0x455247(0x1ad)]&&(_0x2189e0[_0x455247(0x1ad)]=''),!_0x2189e0[_0x455247(0x150)]&&(_0x2189e0[_0x455247(0x150)]=_0x455247(0x13f));}export function injectExistingStageIds(_0x1ef27a,_0x1cffd6){const _0x126d7f=a140_0x2bcd56,_0x5859c5=new Map(_0x1cffd6[_0x126d7f(0x185)](_0x1e8ec3=>[_0x1e8ec3[_0x126d7f(0x141)],_0x1e8ec3['id']]));for(const _0xb1a958 of _0x1ef27a){if(!_0xb1a958['id']){const _0x4a1a54=_0x5859c5[_0x126d7f(0x195)](_0xb1a958[_0x126d7f(0x141)]);_0x4a1a54&&(_0xb1a958['id']=_0x4a1a54);}}}function a140_0x275f(_0x4165d6,_0x2d9359){_0x4165d6=_0x4165d6-0x13e;const _0x4a99fc=a140_0x4a99();let _0x275f8c=_0x4a99fc[_0x4165d6];return _0x275f8c;}export function resolveTDFolderPath(_0x15d5f6,_0x37f119,_0x26cbca){if(!_0x37f119)return _0x15d5f6;if(_0x15d5f6===_0x26cbca||_0x15d5f6['startsWith'](_0x26cbca+'/'))return _0x15d5f6;return _0x15d5f6?_0x26cbca+'/'+_0x15d5f6:_0x26cbca;}export function addFoldersToCreate(_0x2d6763,_0x55015c,_0x29a9c7){const _0x236869=a140_0x2bcd56;if(!_0x2d6763)return;if(_0x55015c[_0x236869(0x15b)](_0x2d6763))return;const _0x48a660=_0x2d6763[_0x236869(0x180)]('/');let _0x3b5825='';for(const _0xcb25d2 of _0x48a660){_0x3b5825=_0x3b5825?_0x3b5825+'/'+_0xcb25d2:_0xcb25d2,!_0x55015c[_0x236869(0x15b)](_0x3b5825)&&_0x29a9c7[_0x236869(0x192)](_0x3b5825);}}export function sortFoldersByDepth(_0x3724b1){const _0x52452e=a140_0x2bcd56;return[..._0x3724b1][_0x52452e(0x160)]((_0x6316c2,_0x1e0ac8)=>{const _0x1c8020=_0x52452e,_0x1cb1f7=(_0x6316c2[_0x1c8020(0x170)](/\//g)||[])[_0x1c8020(0x1eb)],_0x1d0ebc=(_0x1e0ac8[_0x1c8020(0x170)](/\//g)||[])['length'];return _0x1cb1f7-_0x1d0ebc;});}import*as a140_0x3404f8 from'yaml';import{readFileSync}from'fs';import a140_0x4533d9 from'path';import{isJourneyDef,parseYamlString as a140_0x388d86,toYamlString as a140_0x26ca9c,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(_0xe01c33){const _0x2ef001=a140_0x2bcd56;if(Array['isArray'](_0xe01c33))return'['+_0xe01c33[_0x2ef001(0x185)](_0x17513a=>stableStringify(_0x17513a))[_0x2ef001(0x15d)](',')+']';if(_0xe01c33&&typeof _0xe01c33===_0x2ef001(0x1da)){const _0x5c3ce0=_0xe01c33,_0x58e220=Object['keys'](_0x5c3ce0)['sort'](),_0x1b91b2=_0x58e220[_0x2ef001(0x185)](_0x555201=>'\x22'+_0x555201+'\x22:'+stableStringify(_0x5c3ce0[_0x555201]));return'{'+_0x1b91b2[_0x2ef001(0x15d)](',')+'}';}const _0x30f3e1=JSON[_0x2ef001(0x1f0)](_0xe01c33);return _0x30f3e1===undefined?_0x2ef001(0x1a4):_0x30f3e1;}function activationSignature(_0x5cb0d2){const _0x108b93=a140_0x2bcd56,_0x4be7b8={'connection':_0x5cb0d2[_0x108b93(0x1ea)],..._0x5cb0d2[_0x108b93(0x1d1)]!==undefined&&{'all_columns':_0x5cb0d2[_0x108b93(0x1d1)]},..._0x5cb0d2['columns']!==undefined&&{'columns':_0x5cb0d2['columns']},..._0x5cb0d2[_0x108b93(0x1a9)]!==undefined&&{'behavior':_0x5cb0d2[_0x108b93(0x1a9)]},..._0x5cb0d2['schedule']!==undefined&&{'schedule':_0x5cb0d2[_0x108b93(0x1ae)]},..._0x5cb0d2[_0x108b93(0x17c)]!==undefined&&{'notification':_0x5cb0d2['notification']},..._0x5cb0d2[_0x108b93(0x1cf)]!==undefined&&{'connector_config':_0x5cb0d2[_0x108b93(0x1cf)]},..._0x5cb0d2[_0x108b93(0x21a)]!==undefined&&{'activation_template_id':_0x5cb0d2['activation_template_id']}};return stableStringify(_0x4be7b8);}async function fetchSegment(_0x277cce,_0x50db1b,_0x361ccf,_0xa86aeb){const _0xd33ef4=a140_0x2bcd56,_0x5024d8=_0xa86aeb?.[_0xd33ef4(0x1f9)](_0x1e0ad7=>_0x1e0ad7['id']===_0x361ccf);if(_0x5024d8)return _0x5024d8;try{return await _0x277cce[_0xd33ef4(0x169)][_0xd33ef4(0x148)](_0x50db1b,_0x361ccf);}catch(_0x3254ca){logger['debug']('getSegment\x20failed\x20for\x20'+_0x361ccf+_0xd33ef4(0x1ff)+_0x3254ca);try{return await _0x277cce[_0xd33ef4(0x169)][_0xd33ef4(0x23a)](_0x361ccf);}catch(_0x36e2de){return logger['debug'](_0xd33ef4(0x18f)+_0x361ccf+':\x20'+_0x36e2de),null;}}}function recoverSegmentIdsFromPushRecovery(_0xbacbab,_0x142e16,_0x5e2843){const _0x46459e=a140_0x2bcd56,_0x220c76=readPushRecovery(_0xbacbab['absolutePath']);if(_0x220c76?.['journeyName']===_0xbacbab[_0x46459e(0x1b2)][_0x46459e(0x141)])for(const [_0x4700db,_0x27ccb9]of Object[_0x46459e(0x1b3)](_0x220c76[_0x46459e(0x188)])){const _0x4f6f37=generateDeterministicJourneySegmentName(_0xbacbab['yamlConfig'][_0x46459e(0x141)],_0x4700db);_0x27ccb9[_0x46459e(0x1c9)]===_0x4f6f37&&(_0x142e16[_0x46459e(0x19e)](_0x4700db,_0x27ccb9['segmentId']),_0x5e2843[_0x46459e(0x19e)](_0x4700db,_0x27ccb9[_0x46459e(0x149)]));}}async function createOrRecoverEmbeddedSegment(_0x5d803e,_0x4b44b0,_0x33f670,_0x1619a2){const _0x4082f5=a140_0x2bcd56;let _0x4adbf6;try{_0x4adbf6=await _0x5d803e[_0x4082f5(0x169)][_0x4082f5(0x22a)]({'name':_0x33f670[_0x4082f5(0x1e1)],'description':_0x33f670[_0x4082f5(0x1ad)],'journeyId':_0x33f670[_0x4082f5(0x1bf)],'rule':_0x1619a2(_0x33f670['resolvedRule'],!![]),'countPopulation':!![],'parentFolderId':_0x33f670[_0x4082f5(0x229)],'audienceId':_0x33f670[_0x4082f5(0x200)]});}catch(_0x1409cd){const _0x403ffc=_0x1409cd instanceof Error&&_0x1409cd[_0x4082f5(0x21e)][_0x4082f5(0x14a)](_0x4082f5(0x1b0));if(_0x403ffc){const _0x1de811=readPushRecovery(_0x4b44b0[_0x4082f5(0x16c)]),_0x51f36a=_0x1de811?.[_0x4082f5(0x1aa)]===_0x4b44b0['yamlConfig'][_0x4082f5(0x141)]?_0x1de811[_0x4082f5(0x188)][_0x33f670[_0x4082f5(0x154)]]:undefined;if(_0x51f36a?.[_0x4082f5(0x1c9)]===_0x33f670[_0x4082f5(0x1e1)])await _0x5d803e[_0x4082f5(0x169)]['updateSegmentById'](_0x33f670[_0x4082f5(0x200)],_0x51f36a[_0x4082f5(0x149)],{'description':_0x33f670['description'],'rule':_0x1619a2(_0x33f670[_0x4082f5(0x17e)],!![]),'countPopulation':!![]}),_0x4adbf6=_0x51f36a[_0x4082f5(0x149)];else throw new SDKError(ErrorCode[_0x4082f5(0x1c6)],_0x4082f5(0x183)+_0x33f670['localName']+_0x4082f5(0x17f)+('Delete\x20the\x20push\x20recovery\x20file\x20('+_0x4b44b0[_0x4082f5(0x16c)][_0x4082f5(0x235)](/([^/]+)$/,_0x4082f5(0x1fb))+')\x20')+_0x4082f5(0x146),_0x1409cd);}else throw _0x1409cd;}return saveSegmentToPushRecovery(_0x4b44b0[_0x4082f5(0x16c)],_0x4b44b0[_0x4082f5(0x1b2)][_0x4082f5(0x141)],_0x33f670[_0x4082f5(0x154)],{'segmentId':_0x4adbf6,'uniqueServerName':_0x33f670[_0x4082f5(0x1e1)],'createdAt':new Date()[_0x4082f5(0x174)]()}),_0x4adbf6;}export async function prepareSegmentFiles(_0x49fd55,_0xbb7c19,_0x41081b,_0x399437,_0x1e396d){const _0x5679e7=a140_0x2bcd56,{activationDefToCreateRequest:_0x30c16a}=await import('./child-segment-yaml.js'),_0x4777ba=[],_0x252e01=new Set();for(const {yamlConfig:_0x43f0ed,folderPath:_0x48b923,sourcePath:_0x4b549e}of _0x49fd55){const _0x421651=resolveTDFolderPath(_0x48b923,_0x399437,_0x1e396d),_0x33ba46=_0x421651+':'+_0x43f0ed[_0x5679e7(0x141)],_0x5e5b3b=_0xbb7c19[_0x5679e7(0x1c1)][_0x5679e7(0x195)](_0x33ba46),_0x331a9c=_0x5e5b3b?_0xbb7c19[_0x5679e7(0x23f)]['get'](_0x5e5b3b['id'])||[]:[];addFoldersToCreate(_0x421651,_0xbb7c19[_0x5679e7(0x23e)],_0x252e01);const _0x256a23=calculateActivationActions(_0x43f0ed[_0x5679e7(0x161)]||[],_0x331a9c,_0xbb7c19[_0x5679e7(0x18a)],_0xbb7c19[_0x5679e7(0x177)]);for(const _0x4d70fb of _0x256a23){(_0x4d70fb[_0x5679e7(0x20c)]===_0x5679e7(0x172)||_0x4d70fb['type']===_0x5679e7(0x1d5))&&_0x4d70fb[_0x5679e7(0x1a1)]&&(_0x4d70fb[_0x5679e7(0x157)]=await _0x30c16a(_0x4d70fb[_0x5679e7(0x1a1)],_0x41081b));}const _0x58ec34=calculateSegmentDiff(_0x43f0ed,_0x5e5b3b,_0x331a9c,_0xbb7c19[_0x5679e7(0x18a)],_0xbb7c19[_0x5679e7(0x177)]);_0x4777ba['push']({'relativePath':_0x43f0ed[_0x5679e7(0x141)],'absolutePath':_0x4b549e,'yamlConfig':_0x43f0ed,'folderPath':_0x421651,'existingSegment':_0x5e5b3b,'existingActivations':_0x331a9c,'isNew':_0x58ec34[_0x5679e7(0x1cd)],'hasChanges':_0x58ec34[_0x5679e7(0x21c)],'diff':_0x58ec34[_0x5679e7(0x204)],'activationActions':_0x256a23});}return{'segmentFiles':_0x4777ba,'foldersToCreate':_0x252e01};}export async function prepareJourneyFiles(_0x11d784,_0x7180df,_0x116eb3,_0x13c831){const _0xf131f5=a140_0x2bcd56,_0x127c9e=[],_0x10f437=new Set();for(const {yamlConfig:_0x54370b,folderPath:_0x430091,sourcePath:_0x31e868}of _0x11d784){const _0x2eda22=resolveTDFolderPath(_0x430091,_0x116eb3,_0x13c831),_0x14ffd8=_0x2eda22+':'+_0x54370b[_0xf131f5(0x141)],_0x5e278e=_0x7180df[_0xf131f5(0x142)][_0xf131f5(0x195)](_0x14ffd8);let _0x5d891c,_0x1a2bc4;if(_0x5e278e&&_0x5e278e['length']>0x0){const _0x574a97=buildLocalExpandedRuleMappings(_0x54370b),{createYamlContext:_0x1024f4,prefetchJourneySegments:_0x37b332}=createPushYamlContextForBundle(_0x7180df['deps'],_0x7180df[_0xf131f5(0x200)],_0x7180df[_0xf131f5(0x1b7)],_0x574a97,_0x7180df[_0xf131f5(0x18a)],_0x7180df[_0xf131f5(0x177)],_0x7180df['activationStepsById'],_0x7180df[_0xf131f5(0x193)]);await _0x37b332(_0x5e278e[_0xf131f5(0x185)](_0x3b31e2=>_0x3b31e2['id']));const _0x27f28a=await _0x7180df[_0xf131f5(0x230)][_0xf131f5(0x1f4)][_0xf131f5(0x1fa)](_0x5e278e[0x0][_0xf131f5(0x166)]),_0x23fd6d=hasMultipleVersions(_0x54370b),_0x4288c9=async _0x48f6c4=>{const _0xec63e=_0xf131f5,_0x284293=_0x7180df[_0xec63e(0x193)]?.[_0xec63e(0x195)](_0x48f6c4);if(_0x284293)return _0x284293;return _0x7180df['fetchJourney']({'journeyId':_0x48f6c4,'journeyName':_0x54370b[_0xec63e(0x141)],'isMultiVersion':_0x5e278e['length']>0x1});};if(_0x23fd6d&&_0x5e278e[_0xf131f5(0x1eb)]>0x1){const _0x52cc9c=[];for(const _0x27c4d6 of _0x5e278e){const _0xc594c=_0x27c4d6[_0xf131f5(0x1d7)]||0x1;_0x7180df[_0xf131f5(0x1a5)]?.[_0xf131f5(0x1d5)]('Fetching\x20'+_0x54370b['name']+'\x20v'+_0xc594c);const _0x13be23=await _0x4288c9(_0x27c4d6['id']),_0x3d34f5=_0x1024f4(_0x27c4d6['id']),_0x5e2779=await journeyResponseToDef(_0x13be23,_0x3d34f5);_0x52cc9c[_0xf131f5(0x19d)]({'item':_0x27c4d6,'yaml':_0x5e2779});}const _0xa08c61=buildLocalRuleToNameMappingFromJourney(_0x54370b);_0x1a2bc4=buildMergedJourneyDef(_0x52cc9c,_0xa08c61,_0x27f28a);const _0x2e1009=Math['max'](..._0x52cc9c[_0xf131f5(0x185)](_0x1c1133=>_0x1c1133[_0xf131f5(0x187)][_0xf131f5(0x1d7)]||0x0)),_0x4b914c=_0x5e278e[_0xf131f5(0x1f9)](_0x3a3e92=>(_0x3a3e92[_0xf131f5(0x1d7)]||0x0)===_0x2e1009);_0x4b914c&&(_0x7180df[_0xf131f5(0x1a5)]?.[_0xf131f5(0x1d5)](_0xf131f5(0x1ba)+_0x54370b[_0xf131f5(0x141)]+'\x20v'+_0x2e1009),_0x5d891c=await _0x4288c9(_0x4b914c['id']));}else{const _0x16aedd=_0x5e278e[_0x5e278e[_0xf131f5(0x1eb)]-0x1];_0x7180df[_0xf131f5(0x1a5)]?.[_0xf131f5(0x1d5)](_0xf131f5(0x1ba)+_0x54370b[_0xf131f5(0x141)]),_0x5d891c=await _0x4288c9(_0x16aedd['id']);const _0x4da8d2=_0x1024f4(_0x16aedd['id']),_0x1fe267=await journeyResponseToDef(_0x5d891c,_0x4da8d2),_0xb69451=buildLocalRuleToNameMappingFromJourney(_0x54370b);_0x1a2bc4=buildMergedJourneyDef([{'item':_0x16aedd,'yaml':_0x1fe267}],_0xb69451,_0x27f28a);}}addFoldersToCreate(_0x2eda22,_0x7180df[_0xf131f5(0x23e)],_0x10f437);const _0x2eb69a=calculateJourneyDiff(_0x54370b,_0x1a2bc4);_0x127c9e[_0xf131f5(0x19d)]({'relativePath':_0x54370b[_0xf131f5(0x141)],'absolutePath':_0x31e868,'yamlConfig':_0x54370b,'folderPath':_0x2eda22,'existingJourney':_0x5d891c,'isNew':_0x2eb69a['isNew'],'hasChanges':_0x2eb69a[_0xf131f5(0x21c)],'diff':_0x2eb69a[_0xf131f5(0x204)]});}return{'journeyFiles':_0x127c9e,'foldersToCreate':_0x10f437};}export function calculateActivationActions(_0x41952d,_0xb2d13f,_0x1b465b,_0x149f38){const _0x443068=a140_0x2bcd56,_0x231ea3=[],_0x41bd5d=new Map();for(const _0x75075b of _0xb2d13f){_0x41bd5d[_0x443068(0x19e)](_0x75075b[_0x443068(0x141)],_0x75075b);}const _0x5a69d9=new Map();for(const _0x179893 of _0x41952d){_0x5a69d9[_0x443068(0x19e)](_0x179893[_0x443068(0x141)],_0x179893);}for(const _0x422290 of _0x41952d){const _0x166491=_0x41bd5d[_0x443068(0x195)](_0x422290[_0x443068(0x141)]);if(!_0x166491)_0x231ea3[_0x443068(0x19d)]({'type':_0x443068(0x172),'name':_0x422290[_0x443068(0x141)],'yamlActivation':_0x422290});else{const _0x2d717f=activationResponseToDef(_0x166491,_0x1b465b,_0x149f38),_0x2e4802=a140_0x3404f8[_0x443068(0x1f0)](_0x2d717f),_0xb856a9=a140_0x3404f8[_0x443068(0x1f0)](_0x422290);_0x2e4802!==_0xb856a9&&_0x231ea3['push']({'type':_0x443068(0x1d5),'name':_0x422290[_0x443068(0x141)],'yamlActivation':_0x422290,'existingActivation':_0x166491});}}for(const _0x3301f2 of _0xb2d13f){!_0x5a69d9[_0x443068(0x15b)](_0x3301f2['name'])&&_0x231ea3['push']({'type':_0x443068(0x167),'name':_0x3301f2[_0x443068(0x141)],'existingActivation':_0x3301f2});}return _0x231ea3;}function calculateYamlDiff(_0x59127d,_0x46b1c9){if(_0x46b1c9){const _0x327a7a=generateDiff(_0x46b1c9,_0x59127d),_0x2a9901=hasChanges(_0x327a7a);return{'isNew':![],'hasChanges':_0x2a9901,'diff':_0x2a9901?formatDiffWithColors(_0x327a7a):undefined};}const _0x567e67=generateDiff('',_0x59127d);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x567e67)};}export function calculateSegmentDiff(_0x2fa4b8,_0x598e76,_0x4f0e09,_0x3819c0,_0x174611){const _0x1f570a=segmentToYamlString(_0x2fa4b8),_0xde3604=_0x598e76?segmentToYamlString(segmentWithActivationsToYaml(_0x598e76,_0x4f0e09,undefined,_0x3819c0,_0x174611)):undefined;return calculateYamlDiff(_0x1f570a,_0xde3604);}export function calculateJourneyDiff(_0x13436a,_0x2357cd){const _0x1091ad=normalizeJourneyDef(_0x13436a,_0x13436a),_0x50b266=a140_0x26ca9c(_0x1091ad),_0x3f1440=_0x2357cd?a140_0x26ca9c(normalizeJourneyDef(_0x2357cd,_0x13436a)):undefined;return calculateYamlDiff(_0x50b266,_0x3f1440);}export function findSegmentsToDelete(_0x2a82fc,_0x4356f6,_0x144671,_0x3e3293,_0x30178d){const _0x1079c3=a140_0x2bcd56,_0x29e219=new Set();for(const {yamlConfig:_0x1c4d84,folderPath:_0x34a4bf}of _0x4356f6){_0x29e219[_0x1079c3(0x192)](_0x34a4bf+':'+_0x1c4d84['name']);}return _0x2a82fc[_0x1079c3(0x238)](_0x42cecf=>{const _0x19954c=_0x1079c3,_0x3ac842=_0x42cecf[_0x19954c(0x210)]?_0x144671[_0x19954c(0x195)](_0x42cecf[_0x19954c(0x210)]['toString']())||'':'',_0x225c57=_0x3ac842+':'+_0x42cecf[_0x19954c(0x141)];if(_0x29e219[_0x19954c(0x15b)](_0x225c57))return![];if(_0x30178d)return _0x3ac842===_0x3e3293||_0x3ac842[_0x19954c(0x145)](_0x3e3293+'/');return!![];});}export function findJourneysToDelete(_0x5b2545,_0x28252f,_0x5c2fac,_0x2e704c,_0xff9cfb){const _0x2357ba=a140_0x2bcd56,_0x3615ab=new Set();for(const {yamlConfig:_0x5f3e52,folderPath:_0x4f8fdc}of _0x28252f){_0x3615ab[_0x2357ba(0x192)](_0x4f8fdc+':'+_0x5f3e52[_0x2357ba(0x141)]);}return _0x5b2545[_0x2357ba(0x238)](_0x285115=>{const _0x55622f=_0x2357ba,_0x993a88=_0x285115[_0x55622f(0x229)]?_0x5c2fac['get'](_0x285115[_0x55622f(0x229)])||'':'',_0x33b130=_0x993a88+':'+_0x285115[_0x55622f(0x220)];if(_0x3615ab[_0x55622f(0x15b)](_0x33b130))return![];if(_0xff9cfb)return _0x993a88===_0x2e704c||_0x993a88[_0x55622f(0x145)](_0x2e704c+'/');return!![];});}export function buildSegmentLookupMap(_0x489c6f,_0x47abe5){const _0x2223f3=a140_0x2bcd56,_0x5be2ff=new Map();for(const _0x5cbcbe of _0x489c6f){const _0x3e69da=_0x5cbcbe[_0x2223f3(0x210)]?_0x47abe5[_0x2223f3(0x195)](_0x5cbcbe['segmentFolderId'][_0x2223f3(0x1e9)]())||'':'',_0x186788=_0x3e69da+':'+_0x5cbcbe[_0x2223f3(0x141)];_0x5be2ff[_0x2223f3(0x19e)](_0x186788,_0x5cbcbe);}return _0x5be2ff;}export function buildSegmentNameToIdMap(_0x46123){const _0x463ec7=a140_0x2bcd56,_0x29e02e=new Map();for(const _0x5bc145 of _0x46123){_0x29e02e[_0x463ec7(0x19e)](_0x5bc145[_0x463ec7(0x141)],_0x5bc145['id']);}return _0x29e02e;}export function buildJourneyBundleLookupMap(_0xb52f89,_0x45c5f4){const _0x208672=a140_0x2bcd56,_0x18d68f=new Map();for(const _0x8192d6 of _0xb52f89){const _0x3c039e=_0x8192d6[_0x208672(0x229)]?_0x45c5f4[_0x208672(0x195)](_0x8192d6['folderId'])||'':'',_0x32bf5e=_0x3c039e+':'+_0x8192d6[_0x208672(0x220)];!_0x18d68f[_0x208672(0x15b)](_0x32bf5e)&&_0x18d68f[_0x208672(0x19e)](_0x32bf5e,[]),_0x18d68f['get'](_0x32bf5e)[_0x208672(0x19d)](_0x8192d6);}for(const _0x3fd53c of _0x18d68f[_0x208672(0x19c)]()){_0x3fd53c['sort']((_0x51c11,_0x21e57c)=>(_0x51c11[_0x208672(0x1d7)]||0x0)-(_0x21e57c['versionNumber']||0x0));}return _0x18d68f;}export function collectFoldersToCreate(_0x3be38a,_0x346e6f){const _0x3e894b=a140_0x2bcd56,_0x30a02a=new Set();for(const _0x3d41b6 of _0x3be38a){if(!_0x3d41b6)continue;if(_0x346e6f['has'](_0x3d41b6))continue;const _0x2d2e21=_0x3d41b6[_0x3e894b(0x180)]('/');let _0xf0b343='';for(const _0x40d62c of _0x2d2e21){_0xf0b343=_0xf0b343?_0xf0b343+'/'+_0x40d62c:_0x40d62c,!_0x346e6f['has'](_0xf0b343)&&_0x30a02a[_0x3e894b(0x192)](_0xf0b343);}}return _0x30a02a;}export function parseAndClassifyYamlFiles(_0x5557bd,_0x5a85f2,_0x3cbbd5){const _0x4c0fc7=a140_0x2bcd56,_0x18b67c=[],_0x66eefb=[];for(const _0x44c217 of _0x5557bd){const _0x56c9c0=a140_0x4533d9[_0x4c0fc7(0x152)](_0x5a85f2,a140_0x4533d9[_0x4c0fc7(0x214)](_0x44c217)),_0x2b8718=_0x56c9c0==='.'?'':_0x56c9c0,_0x30b59c=readFileSync(_0x44c217,_0x4c0fc7(0x1be)),_0x36950b=a140_0x3404f8[_0x4c0fc7(0x1ef)](_0x30b59c);if(isJourneyDef(_0x36950b)){const _0x4fe776=a140_0x388d86(_0x30b59c);_0x66eefb[_0x4c0fc7(0x19d)]({'yamlConfig':_0x4fe776,'folderPath':_0x2b8718,'sourcePath':_0x44c217});}else{if(!_0x3cbbd5?.[_0x4c0fc7(0x1d0)]){const _0x4faa81=parseSegmentYamlFile(_0x30b59c),_0x348278=normalizeChildSegmentYaml(_0x4faa81);_0x18b67c[_0x4c0fc7(0x19d)]({'yamlConfig':_0x348278,'folderPath':_0x2b8718,'sourcePath':_0x44c217});}}}return{'segments':_0x18b67c,'journeys':_0x66eefb};}export function validateParsedFiles(_0x1d763e,_0x43f3ed){const _0x5f206b=a140_0x2bcd56,_0x200e01=[];for(const {yamlConfig:_0x3f7062,sourcePath:_0x297b59}of _0x1d763e[_0x5f206b(0x188)]){const _0x52830a=readFileSync(_0x297b59,'utf-8'),_0x2a4978=a140_0x3404f8['parseDocument'](_0x52830a),_0x1de571=validateSegmentDef(_0x3f7062,{'source':_0x52830a,'document':_0x2a4978},{'skipSchema':!![]});if(!_0x1de571[_0x5f206b(0x1cc)]){const _0x442193=a140_0x4533d9[_0x5f206b(0x152)](_0x43f3ed,_0x297b59);_0x200e01[_0x5f206b(0x19d)]({'filePath':_0x442193,'source':_0x52830a,'result':_0x1de571,'isJourney':![]});}}for(const {yamlConfig:_0x2c1b47,sourcePath:_0xd7cf57}of _0x1d763e['journeys']){const _0x19664b=readFileSync(_0xd7cf57,'utf-8'),_0x4551d7=a140_0x3404f8[_0x5f206b(0x20f)](_0x19664b),_0x1253ab=validateJourneyDef(_0x2c1b47,{'source':_0x19664b,'document':_0x4551d7},{'skipSchema':!![]});if(!_0x1253ab[_0x5f206b(0x1cc)]){const _0x605657=a140_0x4533d9[_0x5f206b(0x152)](_0x43f3ed,_0xd7cf57);_0x200e01[_0x5f206b(0x19d)]({'filePath':_0x605657,'source':_0x19664b,'result':_0x1253ab,'isJourney':!![]});}}return _0x200e01;}export function formatValidationErrors(_0x7da5a0){const _0x4808f0=a140_0x2bcd56,_0x5cc365=[];for(const {filePath:_0x2b1da3,source:_0x3ba2b5,result:_0x38fe70,isJourney:_0x5ed265}of _0x7da5a0){const _0x3e4e81=_0x5ed265?'journey':_0x4808f0(0x169);_0x5cc365[_0x4808f0(0x19d)]('\x0a'+_0x2b1da3+'\x20('+_0x3e4e81+'):\x20'+_0x38fe70[_0x4808f0(0x1f8)][_0x4808f0(0x1eb)]+_0x4808f0(0x212)),_0x5cc365[_0x4808f0(0x19d)](formatValidationResult(_0x38fe70,_0x3ba2b5,_0x2b1da3));}return _0x5cc365[_0x4808f0(0x15d)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x504e73){const _0x5429e0=a140_0x2bcd56,_0x3fd340=new Set(),_0x5d0097=new Map(),_0x5884ac=collectSegmentUsageCounts(_0x504e73);if(_0x504e73[_0x5429e0(0x188)])for(const [_0x504d1d,_0x4e08c0]of Object[_0x5429e0(0x1b3)](_0x504e73[_0x5429e0(0x188)])){_0x3fd340['add'](_0x504d1d);if(_0x4e08c0['rule']){const _0x5abd49=yamlRuleToApi(_0x4e08c0[_0x5429e0(0x156)]),_0x2c8797=apiRuleToYaml(_0x5abd49);_0x5d0097[_0x5429e0(0x19e)](_0x504d1d,_0x2c8797);}}const _0x17b02d=new Map();let _0x576562=0x0;for(const [_0x592e45,_0x1ae8e0]of _0x5d0097){const _0x49c3e3=serializeExpandedRule(_0x1ae8e0,_0x5d0097),_0x260ef5=_0x17b02d[_0x5429e0(0x195)](_0x49c3e3)||[];_0x260ef5['push']({'name':_0x592e45,'index':_0x576562}),_0x17b02d[_0x5429e0(0x19e)](_0x49c3e3,_0x260ef5),_0x576562++;}const _0x20060f=new Map();for(const [_0x208211,_0x56ca84]of _0x17b02d){const _0x1afc60=_0x56ca84[_0x5429e0(0x18c)]()[_0x5429e0(0x160)]((_0x2d9190,_0x2a0804)=>{const _0x753236=_0x5429e0,_0x2b6b0e=_0x5884ac[_0x753236(0x195)](_0x2d9190[_0x753236(0x141)])||0x0,_0x4c1e7b=_0x5884ac[_0x753236(0x195)](_0x2a0804[_0x753236(0x141)])||0x0;if(_0x2b6b0e!==_0x4c1e7b)return _0x4c1e7b-_0x2b6b0e;return _0x2d9190[_0x753236(0x13e)]-_0x2a0804[_0x753236(0x13e)];})[_0x5429e0(0x185)](_0x49ab43=>_0x49ab43[_0x5429e0(0x141)]),_0x43477a=[];for(const _0x4fec0b of _0x1afc60){const _0x50661a=_0x5884ac['get'](_0x4fec0b)||0x0,_0x29f65a=Math[_0x5429e0(0x21d)](_0x50661a,0x1);for(let _0x46a4e4=0x0;_0x46a4e4<_0x29f65a;_0x46a4e4++){_0x43477a[_0x5429e0(0x19d)](_0x4fec0b);}}_0x20060f[_0x5429e0(0x19e)](_0x208211,_0x43477a);}return{'existingLocalSegmentNames':_0x3fd340,'localSegmentRules':_0x5d0097,'localExpandedRuleToNames':_0x20060f};}export function createSegmentIdResolver(_0x387e6c,_0x5d46e9){return async _0x278ad7=>{const _0x385f88=a140_0x275f,_0x1459a3=_0x387e6c[_0x385f88(0x195)](_0x278ad7);if(!_0x1459a3)throw new SDKError(ErrorCode[_0x385f88(0x14c)],_0x385f88(0x1dc)+_0x278ad7+_0x385f88(0x203)+_0x5d46e9+'\x27)');return _0x1459a3;};}export function extractRootFolderId(_0x4c68cd){const _0x4815dc=a140_0x2bcd56;return _0x4c68cd[_0x4815dc(0x232)]?.[_0x4815dc(0x211)]?.[_0x4815dc(0x236)]?.['id']||_0x4c68cd[_0x4815dc(0x232)]?.[_0x4815dc(0x197)]?.[_0x4815dc(0x236)]?.['id'];}export function buildConnectionMaps(_0x36d9fa){const _0x4d2e99=a140_0x2bcd56,_0x5cd4cf=new Map(),_0xc201c4=new Map(),_0x237684=new Map();for(const _0x55c701 of _0x36d9fa){_0x5cd4cf['set'](_0x55c701[_0x4d2e99(0x141)],parseInt(_0x55c701['id'],0xa)),_0xc201c4[_0x4d2e99(0x19e)](_0x55c701['id'],_0x55c701[_0x4d2e99(0x141)]),_0x237684[_0x4d2e99(0x19e)](_0x55c701[_0x4d2e99(0x141)],_0x55c701[_0x4d2e99(0x20c)]);}return{'nameToId':_0x5cd4cf,'idToName':_0xc201c4,'nameToType':_0x237684};}function a140_0x4a99(){const _0x23c7bf=['Activation\x20not\x20found:\x20','branches','uniqueServerName','activationContext','embedded_activation_creating','valid','isNew','action','connector_config','skipSegments','all_columns','steps','activationParams','WaitStep','update','getJourney','versionNumber',').\x20','flatMap','object','updated','Segment\x20not\x20found:\x20','activation_','conditionTimeoutUnit','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','\x27\x20by\x20rule\x20content','uniqueSegmentName','\x0a\x20\x20','updateSegmentById','conditionTimeoutDuration','\x27\x20wait\x20condition','\x20(referenced\x20in\x20journey\x20','DecisionPoint','Created\x20journey\x20\x27','toString','connection','length','conditions','deleteSegment','470412mcoedL','parse','stringify','results','hex','embeddedSegmentNameToId','journey','withProgress','decision_point','532yiFzqh','errors','find','getLatestJourneyId','.$1.push-recovery.json','\x27\x20not\x20found\x20in\x20journey\x20\x27','entry','logDeleted',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','parentId','\x27\x20to\x20local\x20\x27','logWarning','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','diff','Creating\x20activation\x20\x27','segment_created','digest','list','./child-segment-yaml.js','sha1','existingSegment','type','exitCriterias','segmentNameToId','parseDocument','segmentFolderId','parentSegmentFolder','\x20error(s)','deleted','dirname','verbose','activation_deleting','logInfo','resolveJourneyId','some','activation_template_id','Condition','hasChanges','max','message','2yOgSyf','journeyBundleName','debug','journey_creating','371534rCdrWR','createdSegmentId','embedded_segment_creating','__pending_','./journey-yaml.js','logSuccess','folderId','createJourneySegment','folder','folderPath','Duration','createdSegmentIds','\x27\x20from\x20file:\x20','deps','NOT_FOUND','relationships','stage\x20\x27','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','replace','data','Created\x20folder\x20\x27','filter','SEGMENT_SYNTAX_ERROR','getSegmentEntity','\x27...','activation_creating','toLowerCase','folderPathToId','activationsBySegmentId','waitStepUnit','Updating\x20activation\x20\x27','idToName','from','ACTIVATION_SYNTAX_ERROR','index','draft','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','name','journeyBundlesByFolderAndName','onProgress','61768nwaJrp','startsWith','and\x20the\x20server\x20segment,\x20then\x20retry.','stages','getSegment','segmentId','includes','20EMjWby','SEGMENT_NOT_FOUND','listActivations','\x20segment\x20from\x20file:\x20','createFolder','state','\x27\x20for\x20','relative','getActivation','localName','Updating\x20segment\x20\x27','rule','validatedRequest','\x20activation\x20\x27','resolveSegment','journeyActivationStepId','has','all','join','rootFolderId','journeyStages','sort','activations','Creating\x20segment\x20\x27','../../utils/async.js','embedded_activation_created','existingJourney','journeyBundleId','delete','Updated\x20activation\x20\x27','segment','1031379KRpwtN','__pending_act_','absolutePath','goal\x20criteria','milestone','\x20journey\x20from\x20file:\x20','match','1465482RmTRRc','create','Updated\x20journey\x20\x27','toISOString','segment_creating','deleteActivation','connectionIdToNameMap','unchanged','tdx.sdk.push-workflow','Created\x20activation\x20\x27','entryCriteria','notification','createSegment','resolvedRule','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','split','Entry\x20criteria:\x20','journey_updated','Embedded\x20segment\x20\x27','goal','map','waitStepType','item','segments','segment_updating','idToEmailMap','Matched\x20server\x20segment\x20\x27','slice','embedded_segment_created','Segment\x20not\x20found','getSegmentEntity\x20also\x20failed\x20for\x20','nameToType','activation_updated','add','journeyById','Failed\x20to\x20','get','waitStep','parentFolder','journeyActivationNameToId','reduce','attributes','110fnIjBQ','values','push','set','keys','4885243PLkJVx','yamlActivation','existingActivation','size','null','progress','run_after_journey_refresh','INTERNAL','\x27\x20milestone','behavior','journeyName','journey_entry_criteria_','conditionSegmentId','description','schedule','ACTIVATION_UPDATE_ERROR','Name\x20has\x20already\x20been\x20taken','\x27\x20entry\x20criteria','yamlConfig','entries','kind','buildUserMaps','Activation','existingSegments','createActivation','activationActions','Fetching\x20','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','with','Deleting\x20activation\x20\x27','utf-8','journeyId','217025PFNKEf','segmentByFolderAndName','activation_created','created','segment_deleting','folder_created','SEGMENT_UPDATE_ERROR'];a140_0x4a99=function(){return _0x23c7bf;};return a140_0x4a99();}export function calculatePushStats(_0x146572,_0x469188,_0x57b3a8,_0x3fdc3f,_0x2e399c,_0x53c831,_0x50dcdc){const _0x2f950e=a140_0x2bcd56,_0x7e98c4=_0x146572['filter'](_0x13048e=>_0x13048e[_0x2f950e(0x1cd)]),_0x1b8717=_0x146572[_0x2f950e(0x238)](_0x2800a6=>!_0x2800a6[_0x2f950e(0x1cd)]&&_0x2800a6[_0x2f950e(0x21c)]),_0x5ae196=_0x146572['filter'](_0x37f936=>!_0x37f936['isNew']&&!_0x37f936[_0x2f950e(0x21c)]),_0x349e6d=_0x53c831?_0x3fdc3f:[],_0x4a9011=_0x469188[_0x2f950e(0x238)](_0x333e43=>_0x333e43[_0x2f950e(0x1cd)]),_0x11a173=_0x469188['filter'](_0x40489a=>!_0x40489a[_0x2f950e(0x1cd)]&&_0x40489a[_0x2f950e(0x21c)]),_0x2f28db=_0x469188[_0x2f950e(0x238)](_0x13cf56=>!_0x13cf56[_0x2f950e(0x1cd)]&&!_0x13cf56[_0x2f950e(0x21c)]),_0x304ad7=_0x53c831?_0x2e399c:[],_0x44a298=_0x146572[_0x2f950e(0x1d9)](_0x3556d8=>_0x3556d8[_0x2f950e(0x1b9)]),_0xd9565b=_0x44a298['filter'](_0x270d7f=>_0x270d7f['type']==='create'),_0x1b6d47=_0x44a298[_0x2f950e(0x238)](_0x27cfa0=>_0x27cfa0[_0x2f950e(0x20c)]===_0x2f950e(0x1d5)),_0x5690f0=_0x44a298['filter'](_0x426532=>_0x426532[_0x2f950e(0x20c)]==='delete'),_0x38081e=Array[_0x2f950e(0x243)](_0x57b3a8)[_0x2f950e(0x160)](),_0x4b9f23=_0x50dcdc?![]:_0x7e98c4[_0x2f950e(0x1eb)]>0x0||_0x1b8717[_0x2f950e(0x1eb)]>0x0||_0x349e6d['length']>0x0,_0x1d77ae=_0x4a9011[_0x2f950e(0x1eb)]>0x0||_0x11a173['length']>0x0||_0x304ad7['length']>0x0,_0x5ca393=_0x50dcdc?![]:_0x44a298[_0x2f950e(0x1eb)]>0x0,_0x29a447=_0x38081e['length']>0x0;return{'segments':{'new':_0x7e98c4,'changed':_0x1b8717,'unchanged':_0x5ae196,'toDelete':_0x349e6d},'journeys':{'new':_0x4a9011,'changed':_0x11a173,'unchanged':_0x2f28db,'toDelete':_0x304ad7},'activations':{'all':_0x44a298,'toCreate':_0xd9565b,'toUpdate':_0x1b6d47,'toDelete':_0x5690f0},'folders':{'toCreate':_0x38081e},'counts':{'segments':{'new':_0x7e98c4[_0x2f950e(0x1eb)],'changed':_0x1b8717[_0x2f950e(0x1eb)],'unchanged':_0x5ae196[_0x2f950e(0x1eb)],'toDelete':_0x349e6d['length']},'journeys':{'new':_0x4a9011[_0x2f950e(0x1eb)],'changed':_0x11a173[_0x2f950e(0x1eb)],'unchanged':_0x2f28db[_0x2f950e(0x1eb)],'toDelete':_0x304ad7[_0x2f950e(0x1eb)]},'activations':{'create':_0xd9565b[_0x2f950e(0x1eb)],'update':_0x1b6d47[_0x2f950e(0x1eb)],'delete':_0x5690f0['length']},'folders':_0x38081e[_0x2f950e(0x1eb)]},'hasChanges':_0x4b9f23||_0x1d77ae||_0x5ca393||_0x29a447};}export async function buildPushExecutionContext(_0x358c90,_0x1f9710,_0xa43b1e,_0x510a20,_0x2b6ebc,_0x42da28){const _0x938511=a140_0x2bcd56,_0x36e082=extractRootFolderId(_0xa43b1e),{pathToId:_0x20d1a7,idToPath:_0x552676}=buildFolderMaps(_0x2b6ebc),_0x5bc952=buildSegmentNameToIdMap(_0x510a20),_0x31ba0d=new Map(),{batchAsync:_0x34932e}=await import(_0x938511(0x163)),[_0x1c6062,_0x4cde4d]=await Promise[_0x938511(0x15c)]([_0x358c90['user'][_0x938511(0x1b5)](),_0x358c90[_0x938511(0x1ea)][_0x938511(0x208)](),((async()=>{const _0x56daa5=_0x938511;!_0x42da28&&_0x510a20[_0x56daa5(0x1eb)]>0x0&&await _0x34932e(_0x510a20,async _0x47f8ad=>{const _0x45be26=await _0x358c90['segment']['listActivations'](_0x1f9710,_0x47f8ad['id']);_0x31ba0d['set'](_0x47f8ad['id'],_0x45be26);});})())]),{emailToId:_0x2d0877,idToEmail:_0x25d695}=_0x1c6062,_0x2c2617=buildConnectionMaps(_0x4cde4d);return{'rootFolderId':_0x36e082,'folderPathToId':_0x20d1a7,'folderIdToPath':_0x552676,'segmentNameToId':_0x5bc952,'activationsBySegmentId':_0x31ba0d,'emailToIdMap':_0x2d0877,'idToEmailMap':_0x25d695,'connectionNameToIdMap':_0x2c2617['nameToId'],'connectionIdToNameMap':_0x2c2617[_0x938511(0x242)],'connectionNameToTypeMap':_0x2c2617[_0x938511(0x190)]};}export function createPushYamlContextForBundle(_0x473c98,_0xc93761,_0x4a34fa,_0x5d51c2,_0xb47c02,_0x518353,_0x5b1113,_0x84244c){const {existingLocalSegmentNames:_0x2a61cc,localExpandedRuleToNames:_0x165be8}=_0x5d51c2,_0x788d=new Set(),_0x19e026=new Map(),_0x1989b4=new Map(),_0x466ff3=new Map(),_0x259092=createJumpTargetCache(),_0xbd2f80=new Map(),_0x1f4d21=new Map(),_0x20d14f=new Set();let _0xc289bd;const _0x3394da=_0x45bc05=>{const _0x545973={'resolveSegment':async _0x4b5ed8=>{const _0x5af5f6=a140_0x275f,_0x5b26ff=_0x466ff3['get'](_0x4b5ed8);if(_0x5b26ff!==undefined)return{'name':_0x5b26ff,'isJourneyLocal':!![]};try{const _0x493610=await fetchSegment(_0x473c98,_0xc93761,_0x4b5ed8,_0x4a34fa);if(!_0x493610)throw new Error(_0x5af5f6(0x18e));const _0xd51846=generateJourneyLocalName(_0x493610['name']),_0x142e47=_0x493610[_0x5af5f6(0x1b4)]===SEGMENT_KIND_JOURNEY&&_0xd51846!==undefined;let _0x358c57=_0x493610[_0x5af5f6(0x141)],_0x15b3d4;if(_0x142e47&&_0x493610[_0x5af5f6(0x156)]){const _0x1a286f=apiRuleToYaml(_0x493610[_0x5af5f6(0x156)]);_0x1f4d21[_0x5af5f6(0x19e)](_0x4b5ed8,_0x1a286f);const _0x3075a7=async _0x2b8c38=>{const _0x2faf25=_0x5af5f6,_0x245fb8=collectSegmentRefsFromRule(_0x2b8c38);for(const _0x494673 of _0x245fb8){if(!_0x1f4d21['has'](_0x494673))try{const _0x2d0b3f=await fetchSegment(_0x473c98,_0xc93761,_0x494673,_0x4a34fa);if(_0x2d0b3f?.[_0x2faf25(0x156)]){const _0x134fc5=apiRuleToYaml(_0x2d0b3f['rule']);_0x1f4d21[_0x2faf25(0x19e)](_0x494673,_0x134fc5),await _0x3075a7(_0x134fc5);}}catch(_0x56c06c){logger[_0x2faf25(0x221)]('Failed\x20to\x20fetch\x20referenced\x20segment\x20'+_0x494673+':\x20'+_0x56c06c);}}};await _0x3075a7(_0x1a286f);const _0x5c825f=serializeExpandedRule(_0x1a286f,_0x1f4d21),_0x160f5c=_0x165be8['get'](_0x5c825f);if(_0x160f5c&&_0x160f5c['length']>0x0){const _0x1f0503=_0x19e026['get'](_0x5c825f)||0x0,_0x4236fd=_0x160f5c[_0x1f0503]||_0x160f5c[_0x160f5c[_0x5af5f6(0x1eb)]-0x1];_0x19e026['set'](_0x5c825f,_0x1f0503+0x1),_0x358c57=_0x4236fd,_0x788d[_0x5af5f6(0x192)](_0x358c57),_0x466ff3[_0x5af5f6(0x19e)](_0x4b5ed8,_0x358c57);const _0x58376a=await resolveRuleSegmentRefs(_0x1a286f,async _0x10a2ce=>{const _0x3f5039=_0x5af5f6,_0x35b5e9=_0x466ff3[_0x3f5039(0x195)](_0x10a2ce);if(_0x35b5e9)return _0x35b5e9;const _0x4e93f1=await _0xc289bd[_0x3f5039(0x159)](_0x10a2ce);return _0x4e93f1[_0x3f5039(0x141)];});_0x15b3d4={'description':_0x493610['description'],'rule':_0x58376a};}else{const _0x4907e3=_0xbd2f80[_0x5af5f6(0x195)](_0x5c825f);if(_0x4907e3)_0x358c57=_0x4907e3,_0x466ff3['set'](_0x4b5ed8,_0x358c57);else{if(_0xd51846){let _0x440c57=_0xd51846,_0x4eef75=0x2;while(_0x788d[_0x5af5f6(0x15b)](_0x440c57)||_0x2a61cc[_0x5af5f6(0x15b)](_0x440c57)){_0x440c57=_0xd51846+'_'+_0x4eef75,_0x4eef75++;}_0x788d[_0x5af5f6(0x192)](_0x440c57),_0x358c57=_0x440c57;}_0x466ff3[_0x5af5f6(0x19e)](_0x4b5ed8,_0x358c57),_0xbd2f80[_0x5af5f6(0x19e)](_0x5c825f,_0x358c57);const _0x4969ea=await resolveRuleSegmentRefs(_0x1a286f,async _0x2dc3f1=>{const _0x2b0e96=_0x5af5f6,_0x2b9e78=_0x466ff3[_0x2b0e96(0x195)](_0x2dc3f1);if(_0x2b9e78)return _0x2b9e78;const _0x1b2fd0=await _0xc289bd['resolveSegment'](_0x2dc3f1);return _0x1b2fd0[_0x2b0e96(0x141)];});_0x15b3d4={'description':_0x493610[_0x5af5f6(0x1ad)],'rule':_0x4969ea};}}}return{'name':_0x358c57,'isJourneyLocal':_0x142e47,'definition':_0x15b3d4};}catch(_0x2ba0d5){return logger[_0x5af5f6(0x221)]('Failed\x20to\x20resolve\x20segment\x20'+_0x4b5ed8+':\x20'+_0x2ba0d5),{'name':_0x4b5ed8,'isJourneyLocal':![]};}},'resolveActivation':async _0x5154f4=>{const _0x4b0750=a140_0x275f,_0x4ca7db=_0x1989b4[_0x4b0750(0x195)](_0x5154f4);if(_0x4ca7db!==undefined)return{'name':_0x4ca7db,'isJourneyLocal':!![]};try{let _0x2bc24f=_0x5b1113?.[_0x4b0750(0x195)](_0x5154f4);!_0x2bc24f&&(_0x2bc24f=await _0x473c98[_0x4b0750(0x1f4)][_0x4b0750(0x153)](_0x45bc05,_0x5154f4));const _0x3910f1=_0x2bc24f['attributes'][_0x4b0750(0x1d3)][_0x4b0750(0x141)]||_0x5154f4,_0x4d1a12=sanitizeYamlKey(_0x3910f1)||_0x4b0750(0x1dd)+_0x5154f4,_0x52b296=_0x4d1a12;_0x1989b4[_0x4b0750(0x19e)](_0x5154f4,_0x52b296);const _0x3010a1=journeyActivationStepToYaml(_0x2bc24f,_0xb47c02,_0x518353);return{'name':_0x52b296,'isJourneyLocal':!![],'definition':_0x3010a1};}catch(_0x54bb62){return logger[_0x4b0750(0x221)]('Failed\x20to\x20resolve\x20activation\x20'+_0x5154f4+':\x20'+_0x54bb62),{'name':_0x5154f4,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x4b7a54,_0x417d16)=>resolveJumpTarget(_0x4b7a54,_0x417d16,_0x259092,async _0x23846e=>{const _0x3730b4=a140_0x275f,_0x425783=_0x84244c?.[_0x3730b4(0x195)](_0x23846e);if(_0x425783)return _0x425783;return _0x473c98['journey'][_0x3730b4(0x1d6)](_0x23846e);})};return _0xc289bd=_0x545973,_0x545973;},_0x58f274=async _0x2e0aa9=>{const _0x31fef5=a140_0x275f,{collectSegmentIdsFromJourneyApi:_0x2914cb}=await import(_0x31fef5(0x227)),{batchAsync:_0x3e4eb0}=await import(_0x31fef5(0x163)),_0xb94efe=new Set();for(const _0x28e696 of _0x2e0aa9){let _0x399c7d=_0x84244c?.['get'](_0x28e696);!_0x399c7d&&(_0x399c7d=await _0x473c98[_0x31fef5(0x1f4)]['getJourney'](_0x28e696));const _0x3b87ef=_0x2914cb(_0x399c7d);for(const _0x2c9e1a of _0x3b87ef){_0xb94efe[_0x31fef5(0x192)](_0x2c9e1a);}}let _0xc24500=Array[_0x31fef5(0x243)](_0xb94efe);while(_0xc24500[_0x31fef5(0x1eb)]>0x0){const _0x4f7bb2=_0xc24500[_0x31fef5(0x238)](_0x24e483=>!_0x20d14f[_0x31fef5(0x15b)](_0x24e483));if(_0x4f7bb2[_0x31fef5(0x1eb)]===0x0)break;const _0x557d72=await _0x3e4eb0(_0x4f7bb2,async _0x1f87bd=>{_0x20d14f['add'](_0x1f87bd);const _0x311f9d=await fetchSegment(_0x473c98,_0xc93761,_0x1f87bd,_0x4a34fa);if(!_0x311f9d)return null;return{'segmentId':_0x1f87bd,'segment':_0x311f9d};},0xa),_0x7d0794=new Set();for(const _0x4926f0 of _0x557d72){if(!_0x4926f0?.[_0x31fef5(0x169)]?.[_0x31fef5(0x156)])continue;const _0x351213=apiRuleToYaml(_0x4926f0['segment'][_0x31fef5(0x156)]);_0x1f4d21[_0x31fef5(0x19e)](_0x4926f0[_0x31fef5(0x149)],_0x351213);const _0x2c5e1a=collectSegmentRefsFromRule(_0x351213);for(const _0xaad08a of _0x2c5e1a){!_0x20d14f['has'](_0xaad08a)&&_0x7d0794['add'](_0xaad08a);}}_0xc24500=Array['from'](_0x7d0794);}};return{'createYamlContext':_0x3394da,'prefetchJourneySegments':_0x58f274};}export async function executePushSegments(_0x2fcdd8,_0x5de0cf,_0x8617d5,_0x59390a,_0x374c3a){const _0x570023=a140_0x2bcd56,{segmentDefToCreateRequest:_0x3087cd,segmentDefToUpdateRequest:_0x52366d}=await import(_0x570023(0x209)),_0x46bb67=_0x8617d5['folderPathToId'],_0x2ee73c=0x5,_0x234f46=async _0x4c0a73=>{const _0x4a31ad=_0x570023,_0x250dc3=_0x4c0a73[_0x4a31ad(0x22c)]?_0x46bb67[_0x4a31ad(0x195)](_0x4c0a73[_0x4a31ad(0x22c)]):undefined;let _0x50178a;const _0x219e33={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x161853=_0x4c0a73[_0x4a31ad(0x1b2)];if(_0x4c0a73[_0x4a31ad(0x1b2)]['rule']){const _0x293536=createSegmentIdResolver(_0x8617d5[_0x4a31ad(0x20e)],_0x4c0a73[_0x4a31ad(0x1b2)][_0x4a31ad(0x141)]),_0xa1a510=await resolveRuleSegmentIds(_0x4c0a73[_0x4a31ad(0x1b2)][_0x4a31ad(0x156)],_0x293536);_0x161853={..._0x4c0a73[_0x4a31ad(0x1b2)],'rule':_0xa1a510};}try{if(_0x4c0a73[_0x4a31ad(0x1cd)]){_0x374c3a[_0x4a31ad(0x143)]?.({'type':_0x4a31ad(0x175),'name':_0x4c0a73[_0x4a31ad(0x1b2)][_0x4a31ad(0x141)]});const _0x316e91=_0x3087cd(_0x161853,_0x250dc3),_0x15719a=await _0x374c3a['withProgress'](_0x4a31ad(0x162)+_0x4c0a73['yamlConfig'][_0x4a31ad(0x141)]+_0x4a31ad(0x23b),()=>_0x2fcdd8['segment'][_0x4a31ad(0x17d)](_0x59390a['parentId'],_0x316e91));_0x50178a=_0x15719a[_0x4a31ad(0x236)]['id'],_0x8617d5[_0x4a31ad(0x20e)][_0x4a31ad(0x19e)](_0x4c0a73[_0x4a31ad(0x1b2)][_0x4a31ad(0x141)],_0x50178a),_0x219e33['createdSegmentId']={'name':_0x4c0a73[_0x4a31ad(0x1b2)][_0x4a31ad(0x141)],'id':_0x50178a},_0x374c3a[_0x4a31ad(0x143)]?.({'type':_0x4a31ad(0x206),'name':_0x4c0a73['yamlConfig']['name'],'segmentId':_0x50178a}),_0x374c3a[_0x4a31ad(0x228)]?.('Created\x20segment\x20\x27'+_0x4c0a73[_0x4a31ad(0x1b2)][_0x4a31ad(0x141)]+'\x27'),_0x219e33[_0x4a31ad(0x1c3)]=0x1;}else{if(_0x4c0a73[_0x4a31ad(0x21c)]){_0x374c3a[_0x4a31ad(0x143)]?.({'type':_0x4a31ad(0x189),'name':_0x4c0a73['yamlConfig'][_0x4a31ad(0x141)]});const _0x5941bc=_0x52366d(_0x161853);_0x250dc3!==_0x4c0a73[_0x4a31ad(0x20b)]?.['segmentFolderId']&&(_0x5941bc[_0x4a31ad(0x210)]=_0x250dc3?parseInt(_0x250dc3,0xa):undefined),await _0x374c3a['withProgress'](_0x4a31ad(0x155)+_0x4c0a73['yamlConfig'][_0x4a31ad(0x141)]+'\x27...',()=>_0x2fcdd8[_0x4a31ad(0x169)][_0x4a31ad(0x1e3)](_0x59390a[_0x4a31ad(0x200)],_0x4c0a73[_0x4a31ad(0x20b)]['id'],_0x5941bc)),_0x50178a=_0x4c0a73[_0x4a31ad(0x20b)]['id'],_0x374c3a[_0x4a31ad(0x143)]?.({'type':'segment_updated','name':_0x4c0a73[_0x4a31ad(0x1b2)][_0x4a31ad(0x141)]}),_0x374c3a[_0x4a31ad(0x228)]?.('Updated\x20segment\x20\x27'+_0x4c0a73[_0x4a31ad(0x1b2)][_0x4a31ad(0x141)]+'\x27'),_0x219e33[_0x4a31ad(0x1db)]=0x1;}else _0x50178a=_0x4c0a73[_0x4a31ad(0x20b)]['id'];}}catch(_0x4169b1){const _0x349133=isHttp400Error(_0x4169b1),_0x323618=_0x349133?ErrorCode[_0x4a31ad(0x239)]:ErrorCode['SEGMENT_UPDATE_ERROR'],_0xd91881=getErrorMessage(_0x4169b1);throw new SDKError(_0x323618,'Failed\x20to\x20'+(_0x4c0a73[_0x4a31ad(0x1cd)]?_0x4a31ad(0x172):_0x4a31ad(0x1d5))+_0x4a31ad(0x14e)+_0x4c0a73[_0x4a31ad(0x16c)]+_0x4a31ad(0x1e2)+_0xd91881,_0x4169b1);}try{const _0x303995=await syncActivationsForSegment(_0x2fcdd8,_0x59390a[_0x4a31ad(0x200)],_0x50178a,_0x4c0a73[_0x4a31ad(0x1b2)]['name'],_0x4c0a73[_0x4a31ad(0x1b9)],_0x374c3a,_0x4c0a73[_0x4a31ad(0x16c)]);_0x219e33[_0x4a31ad(0x161)]=_0x303995;}catch(_0x237402){if(_0x237402 instanceof SDKError)throw _0x237402;throw new SDKError(ErrorCode[_0x4a31ad(0x1af)],_0x4a31ad(0x234)+_0x4c0a73[_0x4a31ad(0x1b2)][_0x4a31ad(0x141)]+_0x4a31ad(0x22f)+_0x4c0a73[_0x4a31ad(0x16c)]+_0x4a31ad(0x1e2)+getErrorMessage(_0x237402),_0x237402);}return _0x219e33;},_0x162fb4=await batchAsync(_0x5de0cf,_0x234f46,_0x2ee73c),_0x87c7c3={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x3b72b8 of _0x162fb4){_0x87c7c3[_0x570023(0x1c3)]+=_0x3b72b8[_0x570023(0x1c3)],_0x87c7c3[_0x570023(0x1db)]+=_0x3b72b8[_0x570023(0x1db)],_0x3b72b8[_0x570023(0x224)]&&_0x87c7c3[_0x570023(0x22e)]['set'](_0x3b72b8[_0x570023(0x224)][_0x570023(0x141)],_0x3b72b8['createdSegmentId']['id']),_0x87c7c3[_0x570023(0x161)][_0x570023(0x1c3)]+=_0x3b72b8[_0x570023(0x161)][_0x570023(0x1c3)],_0x87c7c3[_0x570023(0x161)]['updated']+=_0x3b72b8[_0x570023(0x161)][_0x570023(0x1db)],_0x87c7c3['activations']['deleted']+=_0x3b72b8[_0x570023(0x161)][_0x570023(0x213)];}return _0x87c7c3;}async function syncActivationsForSegment(_0x911773,_0x4420d0,_0x25250d,_0x2ba399,_0x557198,_0x7aca9,_0xce03ad){const _0x457631=a140_0x2bcd56,_0x377253={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x305135 of _0x557198){try{if(_0x305135[_0x457631(0x20c)]==='create'&&_0x305135[_0x457631(0x157)])_0x7aca9[_0x457631(0x143)]?.({'type':_0x457631(0x23c),'segmentName':_0x2ba399,'activationName':_0x305135['name']}),await _0x7aca9[_0x457631(0x1f5)](_0x457631(0x205)+_0x305135[_0x457631(0x141)]+_0x457631(0x23b),()=>_0x911773[_0x457631(0x169)][_0x457631(0x1b8)](_0x4420d0,_0x25250d,_0x305135[_0x457631(0x157)])),_0x7aca9[_0x457631(0x143)]?.({'type':_0x457631(0x1c2),'segmentName':_0x2ba399,'activationName':_0x305135[_0x457631(0x141)]}),_0x7aca9[_0x457631(0x228)]?.(_0x457631(0x17a)+_0x305135[_0x457631(0x141)]+'\x27'),_0x377253[_0x457631(0x1c3)]++;else{if(_0x305135[_0x457631(0x20c)]===_0x457631(0x1d5)&&_0x305135['validatedRequest']&&_0x305135[_0x457631(0x1a2)])_0x7aca9[_0x457631(0x143)]?.({'type':'activation_updating','segmentName':_0x2ba399,'activationName':_0x305135[_0x457631(0x141)]}),await _0x7aca9[_0x457631(0x1f5)](_0x457631(0x241)+_0x305135['name']+_0x457631(0x23b),()=>_0x911773[_0x457631(0x169)]['updateActivation'](_0x4420d0,_0x25250d,_0x305135[_0x457631(0x1a2)]['id'],_0x305135[_0x457631(0x157)])),_0x7aca9[_0x457631(0x143)]?.({'type':_0x457631(0x191),'segmentName':_0x2ba399,'activationName':_0x305135[_0x457631(0x141)]}),_0x7aca9['logSuccess']?.(_0x457631(0x168)+_0x305135['name']+'\x27'),_0x377253[_0x457631(0x1db)]++;else _0x305135[_0x457631(0x20c)]==='delete'&&_0x305135[_0x457631(0x1a2)]&&(_0x7aca9[_0x457631(0x143)]?.({'type':_0x457631(0x216),'segmentName':_0x2ba399,'activationName':_0x305135[_0x457631(0x141)]}),await _0x7aca9[_0x457631(0x1f5)](_0x457631(0x1bd)+_0x305135[_0x457631(0x141)]+'\x27...',()=>_0x911773['segment'][_0x457631(0x176)](_0x4420d0,_0x25250d,_0x305135[_0x457631(0x1a2)]['id'])),_0x7aca9[_0x457631(0x143)]?.({'type':'activation_deleted','segmentName':_0x2ba399,'activationName':_0x305135[_0x457631(0x141)]}),_0x7aca9[_0x457631(0x1fe)]?.('Deleted\x20activation\x20\x27'+_0x305135[_0x457631(0x141)]+'\x27'),_0x377253[_0x457631(0x213)]++);}}catch(_0x50ba49){const _0x43ab59=isHttp400Error(_0x50ba49),_0x3ad22c=_0x43ab59?ErrorCode[_0x457631(0x244)]:ErrorCode[_0x457631(0x1af)],_0x75d1ba=getErrorMessage(_0x50ba49);throw new SDKError(_0x3ad22c,_0x457631(0x194)+_0x305135['type']+_0x457631(0x158)+_0x305135[_0x457631(0x141)]+'\x27\x20from\x20file:\x20'+_0xce03ad+_0x457631(0x1e2)+_0x75d1ba,_0x50ba49);}}return _0x377253;}export async function executePushFolders(_0x4a9da0,_0x3e6b76,_0x200012,_0x5b5174,_0x34e611){const _0x2280e8=a140_0x2bcd56,_0x271faa=new Map(_0x200012),_0x86af21=sortFoldersByDepth(_0x3e6b76);for(const _0xa187cd of _0x86af21){const _0x1d5700=_0xa187cd[_0x2280e8(0x180)]('/'),_0x5dbb85=_0x1d5700[_0x1d5700[_0x2280e8(0x1eb)]-0x1],_0x32816c=_0x1d5700[_0x2280e8(0x18c)](0x0,-0x1)[_0x2280e8(0x15d)]('/'),_0x3a04a9=_0x271faa[_0x2280e8(0x195)](_0x32816c);_0x34e611[_0x2280e8(0x143)]?.({'type':'folder_creating','folder':_0xa187cd});const _0xfdb2b8={'name':_0x5dbb85,'parentFolderId':_0x3a04a9},_0x159c26=await _0x34e611[_0x2280e8(0x1f5)]('Creating\x20folder\x20\x27'+_0xa187cd+_0x2280e8(0x23b),()=>_0x4a9da0[_0x2280e8(0x169)][_0x2280e8(0x14f)](_0x5b5174[_0x2280e8(0x200)],_0xfdb2b8));_0x271faa[_0x2280e8(0x19e)](_0xa187cd,_0x159c26[_0x2280e8(0x236)]['id']),_0x34e611[_0x2280e8(0x143)]?.({'type':_0x2280e8(0x1c5),'folder':_0xa187cd,'folderId':_0x159c26[_0x2280e8(0x236)]['id']}),_0x34e611[_0x2280e8(0x217)]?.(_0x2280e8(0x237)+_0xa187cd+'\x27');}return _0x271faa;}export async function executePushSegmentDeletions(_0x30da5e,_0x339a16,_0x1b8cda){const _0x46ec06=a140_0x2bcd56;if(_0x339a16[_0x46ec06(0x1eb)]===0x0)return 0x0;const {batchAsync:_0x47e1dd}=await import(_0x46ec06(0x163)),_0x28db0e=0x5,_0x5e2185=await _0x47e1dd(_0x339a16,async _0x1c9e4b=>{const _0xc81bb5=_0x46ec06;return _0x1b8cda[_0xc81bb5(0x143)]?.({'type':_0xc81bb5(0x1c4),'name':_0x1c9e4b[_0xc81bb5(0x141)]}),await _0x30da5e[_0xc81bb5(0x169)][_0xc81bb5(0x1ed)](_0x1c9e4b['id']),_0x1b8cda[_0xc81bb5(0x143)]?.({'type':'segment_deleted','name':_0x1c9e4b['name']}),_0x1b8cda[_0xc81bb5(0x1fe)]?.('Deleted\x20segment\x20\x27'+_0x1c9e4b['name']+'\x27'),0x1;},_0x28db0e);return _0x5e2185[_0x46ec06(0x199)]((_0x20126c,_0x1eae37)=>_0x20126c+_0x1eae37,0x0);}export async function executePushJourneys(_0x43c3b6,_0x2b89f6,_0x443d8b,_0x2b88bb,_0x5e9fb3){const _0x539e54=a140_0x2bcd56,{journeyDefToRequest:_0x4263a1}=await import(_0x539e54(0x227)),{activationDefToCreateRequest:_0x112d8b,yamlRuleToApi:_0x5f3279,validateSegmentRule:_0x1c3b50}=await import(_0x539e54(0x209)),_0xce6d95={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x3bf5d9=new Map(_0x443d8b[_0x539e54(0x20e)]),_0x11a98b=0x5;for(let _0x4faf4c=0x0;_0x4faf4c<_0x2b89f6[_0x539e54(0x1eb)];_0x4faf4c+=_0x11a98b){const _0x5be7a1=_0x2b89f6[_0x539e54(0x18c)](_0x4faf4c,_0x4faf4c+_0x11a98b),_0x424f0d=await Promise['all'](_0x5be7a1[_0x539e54(0x185)](async _0x88803b=>{const _0x516310=_0x539e54;if(!_0x88803b[_0x516310(0x1cd)]&&!_0x88803b[_0x516310(0x21c)])return{'action':_0x516310(0x178),'name':_0x88803b['yamlConfig']['name'],'journeyId':_0x88803b[_0x516310(0x165)]?.['id']};const _0x3652c4=_0x88803b['folderPath']?_0x443d8b['folderPathToId'][_0x516310(0x195)](_0x88803b['folderPath']):undefined;_0x5e9fb3[_0x516310(0x143)]?.({'type':_0x88803b[_0x516310(0x1cd)]?_0x516310(0x222):'journey_updating','name':_0x88803b['yamlConfig']['name']});try{const _0x5ede50=await executeSingleJourneyPush(_0x43c3b6,_0x88803b,{..._0x443d8b,'segmentNameToId':_0x3bf5d9},{'parentId':_0x2b88bb['parentId'],'rootFolderId':_0x2b88bb['rootFolderId'],'folderId':_0x3652c4,'verbose':_0x2b88bb[_0x516310(0x215)]},_0x5e9fb3,{'journeyDefToRequest':_0x4263a1,'activationDefToCreateRequest':_0x112d8b,'yamlRuleToApi':_0x5f3279,'validateSegmentRule':_0x1c3b50});for(const [_0x19c69b,_0x1623d8]of _0x5ede50[_0x516310(0x1f3)]){_0x3bf5d9[_0x516310(0x19e)](_0x19c69b,_0x1623d8),_0xce6d95[_0x516310(0x1f3)][_0x516310(0x19e)](_0x19c69b,_0x1623d8);}if(_0x5ede50[_0x516310(0x1ce)]===_0x516310(0x1c3))_0x5e9fb3[_0x516310(0x143)]?.({'type':'journey_created','name':_0x88803b['yamlConfig']['name'],'journeyId':_0x5ede50['journeyId']}),_0x5e9fb3[_0x516310(0x228)]?.(_0x516310(0x1e8)+_0x88803b['yamlConfig'][_0x516310(0x141)]+'\x27'),_0xce6d95[_0x516310(0x1c3)]++;else _0x5ede50[_0x516310(0x1ce)]===_0x516310(0x1db)&&(_0x5e9fb3[_0x516310(0x143)]?.({'type':_0x516310(0x182),'name':_0x88803b[_0x516310(0x1b2)][_0x516310(0x141)]}),_0x5e9fb3['logSuccess']?.(_0x516310(0x173)+_0x88803b['yamlConfig'][_0x516310(0x141)]+'\x27'),_0xce6d95['updated']++);return{'action':_0x5ede50[_0x516310(0x1ce)],'name':_0x88803b['yamlConfig'][_0x516310(0x141)],'journeyId':_0x5ede50['journeyId']};}catch(_0xf09d30){const _0x1d2b65=isHttp400Error(_0xf09d30),_0x2e71c2=_0x1d2b65?ErrorCode['JOURNEY_SYNTAX_ERROR']:ErrorCode['JOURNEY_UPDATE_ERROR'],_0xfcdb15=getErrorMessage(_0xf09d30);throw new SDKError(_0x2e71c2,_0x516310(0x194)+(_0x88803b[_0x516310(0x1cd)]?_0x516310(0x172):_0x516310(0x1d5))+_0x516310(0x16f)+_0x88803b[_0x516310(0x16c)]+_0x516310(0x1e2)+_0xfcdb15,_0xf09d30);}}));_0xce6d95[_0x539e54(0x1f1)]['push'](..._0x424f0d);}return _0xce6d95;}async function matchExistingJourneySegments(_0x11a0db,_0x2480c3,_0x4a0f0b,_0x40948f,_0x59bc83){const _0x2810a8=a140_0x2bcd56;if(!_0x2480c3['existingJourney']||!_0x2480c3[_0x2810a8(0x1b2)]['segments'])return;const _0x204a94=new Map(),_0x209ce7=new Set();for(const _0x450b9e of Object[_0x2810a8(0x19f)](_0x2480c3[_0x2810a8(0x1b2)][_0x2810a8(0x188)])){const _0x43586b=generateDeterministicJourneySegmentName(_0x2480c3['yamlConfig'][_0x2810a8(0x141)],_0x450b9e);_0x204a94['set'](_0x43586b,_0x450b9e),_0x209ce7[_0x2810a8(0x192)](_0x450b9e);}const _0x1fade3=[],_0x32e590=collectSegmentIdsFromJourneyApi(_0x2480c3[_0x2810a8(0x165)]);for(const _0x16f995 of _0x32e590){const _0x42ec00=await fetchSegment(_0x11a0db,_0x4a0f0b,_0x16f995,_0x40948f);if(!_0x42ec00?.[_0x2810a8(0x141)])continue;const _0x1cdf69=_0x204a94[_0x2810a8(0x195)](_0x42ec00[_0x2810a8(0x141)]);_0x1cdf69?(_0x59bc83[_0x2810a8(0x19e)](_0x1cdf69,_0x16f995),_0x209ce7[_0x2810a8(0x167)](_0x1cdf69)):_0x1fade3[_0x2810a8(0x19d)]({'id':_0x16f995,'seg':_0x42ec00});}if(_0x209ce7[_0x2810a8(0x1a3)]>0x0&&_0x1fade3[_0x2810a8(0x1eb)]>0x0){const {localExpandedRuleToNames:_0x2fab6f}=buildLocalExpandedRuleMappings(_0x2480c3[_0x2810a8(0x1b2)]),_0x4f40c8=new Map();for(const {id:_0x7bb351,seg:_0xf18985}of _0x1fade3){if(_0xf18985[_0x2810a8(0x156)]){const _0x2133b1=apiRuleToYaml(_0xf18985[_0x2810a8(0x156)]);_0x4f40c8[_0x2810a8(0x19e)](_0x7bb351,_0x2133b1);}}for(const {id:_0x12d3a4,seg:_0x5bf033}of _0x1fade3){if(!_0x5bf033['rule'])continue;const _0x50a3d2=_0x4f40c8[_0x2810a8(0x195)](_0x12d3a4);if(!_0x50a3d2)continue;const _0x3d3a91=serializeExpandedRule(_0x50a3d2,_0x4f40c8),_0x3a2e80=_0x2fab6f[_0x2810a8(0x195)](_0x3d3a91);if(_0x3a2e80){const _0x25a779=_0x3a2e80[_0x2810a8(0x1f9)](_0x5b503b=>_0x209ce7[_0x2810a8(0x15b)](_0x5b503b));_0x25a779&&(_0x59bc83[_0x2810a8(0x19e)](_0x25a779,_0x12d3a4),_0x209ce7['delete'](_0x25a779),logger[_0x2810a8(0x221)](_0x2810a8(0x18b)+_0x5bf033[_0x2810a8(0x141)]+_0x2810a8(0x201)+_0x25a779+_0x2810a8(0x1e0)));}}}}async function executeSingleJourneyPush(_0x2c6d96,_0xe83972,_0xeca2af,_0xcff551,_0xc3e81e,_0x206dd8){const _0x3281a1=a140_0x2bcd56,{journeyDefToRequest:_0x1ec4b7,activationDefToCreateRequest:_0x1f3103,yamlRuleToApi:_0x31bf63,validateSegmentRule:_0x499d2d}=_0x206dd8,_0x4a1e56=new Map(),_0x3178e4=new Map();recoverSegmentIdsFromPushRecovery(_0xe83972,_0x4a1e56,_0xeca2af[_0x3281a1(0x20e)]);const _0x6f4918=new Map(),_0x2d7258=new Map(),_0x49f0ea=new Map();let _0x19a5ab;const _0x39bcab=async()=>{const _0x4522bb=_0x3281a1;if(_0x19a5ab)return;_0x19a5ab=new Map();if(!_0xe83972[_0x4522bb(0x165)])return;const _0x54c943=await _0x2c6d96[_0x4522bb(0x1f4)][_0x4522bb(0x14d)](_0xe83972[_0x4522bb(0x165)]['id']);for(const _0x1a8d24 of _0x54c943){const _0x5efc34=journeyActivationStepToYaml(_0x1a8d24,_0xeca2af['idToEmailMap'],_0xeca2af['connectionIdToNameMap']),_0x8dd77a=activationSignature(_0x5efc34);!_0x19a5ab['has'](_0x8dd77a)&&_0x19a5ab[_0x4522bb(0x19e)](_0x8dd77a,_0x1a8d24['id']),_0x5efc34[_0x4522bb(0x141)]&&_0x3178e4[_0x4522bb(0x19e)](_0x5efc34[_0x4522bb(0x141)],_0x1a8d24['id']);}};await matchExistingJourneySegments(_0x2c6d96,_0xe83972,_0xcff551['parentId'],_0xeca2af[_0x3281a1(0x1b7)],_0xeca2af[_0x3281a1(0x20e)]);const _0x17d04a={'resolveSegmentId':async _0xc8a4a2=>{const _0x6f28a6=_0x3281a1,_0x55b6a4=_0xeca2af[_0x6f28a6(0x20e)][_0x6f28a6(0x195)](_0xc8a4a2);if(!_0x55b6a4)throw new SDKError(ErrorCode[_0x6f28a6(0x14c)],'Segment\x20not\x20found:\x20'+_0xc8a4a2+'\x20(referenced\x20in\x20journey\x20'+_0xe83972['yamlConfig']['name']+')');return _0x55b6a4;},'resolveEmbeddedSegmentId':async(_0x2a25cc,_0x1b3396)=>{const _0x50052b=_0x3281a1,_0x776c80=_0xeca2af[_0x50052b(0x20e)]['get'](_0x2a25cc);if(_0x776c80)return _0x776c80;const _0x1152b9=_0xeca2af[_0x50052b(0x1b7)][_0x50052b(0x1f9)](_0x3bd519=>_0x3bd519[_0x50052b(0x141)]===_0x2a25cc);if(_0x1152b9)return _0xeca2af[_0x50052b(0x20e)][_0x50052b(0x19e)](_0x2a25cc,_0x1152b9['id']),_0x1152b9['id'];if(_0xe83972['isNew']){const {stageName:_0x13d0a0,criteriaName:_0x1bd2b5}=findSegmentCriteriaLocation(_0xe83972['yamlConfig'],_0x2a25cc);return _0x499d2d(_0x2a25cc,_0x1b3396[_0x50052b(0x156)]),_0x2d7258[_0x50052b(0x19e)](_0x2a25cc,{'definition':_0x1b3396,'stageName':_0x13d0a0,'criteriaName':_0x1bd2b5}),createPendingSegmentId(_0x2a25cc);}const _0x532790=_0xe83972[_0x50052b(0x165)]?.['id'];if(!_0x532790)throw new SDKError(ErrorCode[_0x50052b(0x1a7)],_0x50052b(0x140));const _0x1cc478=_0x6f4918[_0x50052b(0x195)](_0x2a25cc);if(_0x1cc478)return _0x1cc478;const _0x229397=((async()=>{const _0xb1d713=_0x50052b;_0x499d2d(_0x2a25cc,_0x1b3396['rule']);const _0x27ee7b=generateDeterministicJourneySegmentName(_0xe83972[_0xb1d713(0x1b2)][_0xb1d713(0x141)],_0x2a25cc),_0x3ed2d9=_0xeca2af['existingSegments'][_0xb1d713(0x1f9)](_0x1a0fcc=>_0x1a0fcc[_0xb1d713(0x141)]===_0x27ee7b),_0x48571f=createSegmentIdResolver(_0xeca2af[_0xb1d713(0x20e)],_0x2a25cc),_0xcfe9af=await resolveRuleSegmentIds(_0x1b3396[_0xb1d713(0x156)],_0x48571f);let _0x3eee6d;return _0x3ed2d9?(await _0x2c6d96['segment']['updateSegmentById'](_0xcff551[_0xb1d713(0x200)],_0x3ed2d9['id'],{'description':_0x1b3396[_0xb1d713(0x1ad)]||_0xb1d713(0x181)+_0x2a25cc,'rule':_0x31bf63(_0xcfe9af,!![]),'countPopulation':!![]}),_0x3eee6d=_0x3ed2d9['id'],saveSegmentToPushRecovery(_0xe83972['absolutePath'],_0xe83972['yamlConfig'][_0xb1d713(0x141)],_0x2a25cc,{'segmentId':_0x3eee6d,'uniqueServerName':_0x27ee7b,'createdAt':new Date()[_0xb1d713(0x174)]()})):_0x3eee6d=await createOrRecoverEmbeddedSegment(_0x2c6d96,_0xe83972,{'localName':_0x2a25cc,'uniqueSegmentName':_0x27ee7b,'description':_0x1b3396[_0xb1d713(0x1ad)]||_0xb1d713(0x181)+_0x2a25cc,'journeyId':_0x532790,'resolvedRule':_0xcfe9af,'parentId':_0xcff551[_0xb1d713(0x200)],'folderId':_0xcff551['rootFolderId']||''},_0x31bf63),_0xeca2af[_0xb1d713(0x20e)][_0xb1d713(0x19e)](_0x2a25cc,_0x3eee6d),_0x4a1e56[_0xb1d713(0x19e)](_0x2a25cc,_0x3eee6d),_0x3eee6d;})());_0x6f4918[_0x50052b(0x19e)](_0x2a25cc,_0x229397);try{return await _0x229397;}finally{_0x6f4918['delete'](_0x2a25cc);}},'resolveActivationId':async _0x175bd4=>{const _0x538d97=_0x3281a1,_0x49825c=_0x3178e4[_0x538d97(0x195)](_0x175bd4);if(_0x49825c)return _0x49825c;if(_0xe83972[_0x538d97(0x165)]){await _0x39bcab();const _0x2ff560=_0x3178e4[_0x538d97(0x195)](_0x175bd4);if(_0x2ff560)return _0x2ff560;}throw new SDKError(ErrorCode[_0x538d97(0x231)],_0x538d97(0x1c7)+_0x175bd4+_0x538d97(0x1e6)+_0xe83972[_0x538d97(0x1b2)][_0x538d97(0x141)]+_0x538d97(0x1d8)+'Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.');},'resolveEmbeddedActivationId':async(_0x525ddd,_0x22f19e)=>{const _0x3e99f9=_0x3281a1,_0x158588=_0x3178e4['get'](_0x525ddd);if(_0x158588)return _0x158588;if(_0xe83972[_0x3e99f9(0x1cd)])return _0x49f0ea[_0x3e99f9(0x19e)](_0x525ddd,_0x22f19e),createPendingActivationId(_0x525ddd);if(_0xe83972['existingJourney']){await _0x39bcab();const _0x42ed6b=_0x3178e4[_0x3e99f9(0x195)](_0x22f19e[_0x3e99f9(0x141)]);if(_0x42ed6b)return _0x3178e4[_0x3e99f9(0x19e)](_0x525ddd,_0x42ed6b),_0x42ed6b;const _0x4ba0d2=activationSignature(_0x22f19e),_0x729bde=_0x19a5ab?.[_0x3e99f9(0x195)](_0x4ba0d2);if(_0x729bde)return _0x3178e4[_0x3e99f9(0x19e)](_0x525ddd,_0x729bde),_0x729bde;const _0x40df85=await _0x1f3103(_0x22f19e,_0xeca2af[_0x3e99f9(0x1ca)]),_0x29d95f={..._0x40df85,..._0x22f19e[_0x3e99f9(0x1a6)]!==undefined&&{'runAfterJourneyRefresh':_0x22f19e[_0x3e99f9(0x1a6)]}},_0x534c48=await _0x2c6d96[_0x3e99f9(0x1f4)][_0x3e99f9(0x1b8)](_0xe83972[_0x3e99f9(0x165)]['id'],_0x29d95f);return _0x3178e4[_0x3e99f9(0x19e)](_0x525ddd,_0x534c48['id']),_0x534c48['id'];}throw new SDKError(ErrorCode[_0x3e99f9(0x1a7)],_0x3e99f9(0x1df));},'resolveJourneyId':async _0x30b72f=>{const _0x51b739=_0x3281a1;try{return await _0x2c6d96[_0x51b739(0x1f4)][_0x51b739(0x218)](_0xcff551[_0x51b739(0x200)],_0x30b72f);}catch(_0x5ab9c7){throw new SDKError(ErrorCode['NOT_FOUND'],'Journey\x20\x27'+_0x30b72f+'\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27'+_0xe83972[_0x51b739(0x1b2)][_0x51b739(0x141)]+'\x27)',_0x5ab9c7);}},'resolveStageId':async(_0x1f89ea,_0x2cfa1b)=>{const _0x88ab48=_0x3281a1,_0x51ddd9=await _0x2c6d96[_0x88ab48(0x1f4)][_0x88ab48(0x1d6)](_0x1f89ea),_0x499b2c=_0x51ddd9[_0x88ab48(0x19a)][_0x88ab48(0x15f)][_0x88ab48(0x1f9)](_0x160856=>_0x160856[_0x88ab48(0x141)][_0x88ab48(0x23d)]()===_0x2cfa1b['toLowerCase']());if(!_0x499b2c?.['id'])throw new SDKError(ErrorCode['NOT_FOUND'],'Stage\x20\x27'+_0x2cfa1b+_0x88ab48(0x1fc)+(_0x51ddd9['attributes'][_0x88ab48(0x220)]||_0x51ddd9[_0x88ab48(0x19a)][_0x88ab48(0x141)])+'\x27');return _0x499b2c['id'];}},_0x5cd4f2=await _0x1ec4b7(_0xe83972[_0x3281a1(0x1b2)],_0xcff551[_0x3281a1(0x200)],_0x17d04a),_0x23fb8f=_0xcff551[_0x3281a1(0x229)]||_0xcff551[_0x3281a1(0x15e)];_0x23fb8f&&(_0x5cd4f2[_0x3281a1(0x232)]={'parentFolder':{'data':{'id':_0x23fb8f,'type':_0x3281a1(0x22b)}}});if(_0xe83972['isNew']){if(_0x2d7258[_0x3281a1(0x1a3)]>0x0||_0x49f0ea[_0x3281a1(0x1a3)]>0x0)return await executeThreeStepJourneyCreate(_0x2c6d96,_0xe83972,_0x5cd4f2,{'pendingEmbeddedSegments':_0x2d7258,'pendingEmbeddedActivations':_0x49f0ea,'embeddedSegmentNameToId':_0x4a1e56,'journeyActivationNameToId':_0x3178e4},{..._0xcff551,'effectiveFolderId':_0x23fb8f},_0xeca2af,_0xc3e81e,_0x206dd8);else{ensureJourneyDefaults(_0x5cd4f2[_0x3281a1(0x19a)]);const _0x4f9f75=await _0x2c6d96[_0x3281a1(0x1f4)][_0x3281a1(0x172)](_0x5cd4f2);return deletePushRecovery(_0xe83972['absolutePath']),{'action':_0x3281a1(0x1c3),'journeyId':_0x4f9f75['id'],'embeddedSegmentNameToId':_0x4a1e56};}}else{if(_0xe83972[_0x3281a1(0x21c)]&&_0xe83972[_0x3281a1(0x165)]){_0x5cd4f2['id']=_0xe83972[_0x3281a1(0x165)]['id'];const _0x2edf79=_0x5cd4f2[_0x3281a1(0x19a)];_0xe83972[_0x3281a1(0x165)][_0x3281a1(0x19a)]?.[_0x3281a1(0x220)]&&(_0x2edf79[_0x3281a1(0x220)]=_0xe83972[_0x3281a1(0x165)][_0x3281a1(0x19a)][_0x3281a1(0x220)]);const _0x392ac9=_0xe83972['existingJourney'][_0x3281a1(0x19a)]?.[_0x3281a1(0x15f)];return _0x392ac9&&_0x5cd4f2['attributes']['journeyStages']&&injectExistingStageIds(_0x5cd4f2[_0x3281a1(0x19a)][_0x3281a1(0x15f)],_0x392ac9),ensureJourneyDefaults(_0x2edf79),await _0x2c6d96['journey']['update'](_0xe83972[_0x3281a1(0x165)]['id'],_0x5cd4f2),deletePushRecovery(_0xe83972[_0x3281a1(0x16c)]),{'action':_0x3281a1(0x1db),'journeyId':_0xe83972[_0x3281a1(0x165)]['id'],'embeddedSegmentNameToId':_0x4a1e56};}}return deletePushRecovery(_0xe83972[_0x3281a1(0x16c)]),{'action':_0x3281a1(0x178),'journeyId':_0xe83972[_0x3281a1(0x165)]?.['id'],'embeddedSegmentNameToId':_0x4a1e56};}function findSegmentCriteriaLocation(_0x4aa158,_0x1dda76){const _0x14a5bc=a140_0x2bcd56,_0x38a5f9=_0x4aa158[_0x14a5bc(0x147)]||_0x4aa158['journeys']?.[0x0]?.[_0x14a5bc(0x147)]||[];let _0xde77c9=_0x14a5bc(0x1fd),_0x333c22=_0x1dda76;const _0xb48d92=_0x4aa158[_0x14a5bc(0x184)]||_0x4aa158['journeys']?.[0x0]?.['goal'];if(_0xb48d92?.['segment']===_0x1dda76)return{'stageName':'goal','criteriaName':_0xb48d92[_0x14a5bc(0x141)]||_0x1dda76};_0x7a8dc7:for(const _0x4f10ef of _0x38a5f9){if(_0x4f10ef['entry_criteria']?.[_0x14a5bc(0x169)]===_0x1dda76){_0xde77c9=_0x4f10ef[_0x14a5bc(0x141)],_0x333c22=_0x4f10ef['entry_criteria'][_0x14a5bc(0x141)]||_0x1dda76;break;}if(_0x4f10ef['steps'])for(const _0x3a1c30 of _0x4f10ef[_0x14a5bc(0x1d2)]){if(_0x3a1c30[_0x14a5bc(0x20c)]===_0x14a5bc(0x1f6)&&_0x3a1c30[_0x14a5bc(0x1bc)]?.[_0x14a5bc(0x1c8)])for(const _0x45c8eb of _0x3a1c30[_0x14a5bc(0x1bc)][_0x14a5bc(0x1c8)]){if(_0x45c8eb[_0x14a5bc(0x169)]===_0x1dda76){_0xde77c9=_0x4f10ef[_0x14a5bc(0x141)],_0x333c22=_0x45c8eb[_0x14a5bc(0x141)]||_0x1dda76;break _0x7a8dc7;}}}}return{'stageName':_0xde77c9,'criteriaName':_0x333c22};}async function executeThreeStepJourneyCreate(_0x3da9a9,_0x3279f3,_0x589401,_0x1c7d7a,_0x232682,_0x572eee,_0x42796a,_0x39f29d){const _0x15b8bb=a140_0x2bcd56,{activationDefToCreateRequest:_0x3e803a,yamlRuleToApi:_0x501ffa}=_0x39f29d,{pendingEmbeddedSegments:_0x42ced2,pendingEmbeddedActivations:_0x203893,embeddedSegmentNameToId:_0x395c89}=_0x1c7d7a,_0x2cf12b=JSON[_0x15b8bb(0x1ef)](JSON[_0x15b8bb(0x1f0)](_0x589401));ensureJourneyDefaults(_0x2cf12b[_0x15b8bb(0x19a)]),stripPendingIds(_0x2cf12b);const _0x554985=await _0x3da9a9[_0x15b8bb(0x1f4)][_0x15b8bb(0x172)](_0x2cf12b),_0x6863be=_0x554985['id'],_0x38b977=new Map();for(const _0x11368d of _0x554985['attributes'][_0x15b8bb(0x15f)]){_0x38b977[_0x15b8bb(0x19e)](_0x11368d[_0x15b8bb(0x141)][_0x15b8bb(0x23d)](),_0x11368d['id']);}recoverSegmentIdsFromPushRecovery(_0x3279f3,_0x395c89,_0x572eee['segmentNameToId']);for(const [_0x1dc4f6,{definition:_0x150915}]of _0x42ced2){if(_0x395c89['has'](_0x1dc4f6)){_0x42796a[_0x15b8bb(0x143)]?.({'type':_0x15b8bb(0x18d),'journeyName':_0x3279f3[_0x15b8bb(0x1b2)][_0x15b8bb(0x141)],'segmentName':_0x1dc4f6});continue;}const _0x27d573=generateDeterministicJourneySegmentName(_0x3279f3[_0x15b8bb(0x1b2)][_0x15b8bb(0x141)],_0x1dc4f6);_0x42796a[_0x15b8bb(0x143)]?.({'type':_0x15b8bb(0x225),'journeyName':_0x3279f3[_0x15b8bb(0x1b2)][_0x15b8bb(0x141)],'segmentName':_0x1dc4f6});const _0x53aa89=createSegmentIdResolver(_0x572eee[_0x15b8bb(0x20e)],_0x1dc4f6),_0x2b90b5=await resolveRuleSegmentIds(_0x150915['rule'],_0x53aa89),_0x9b20a0=await createOrRecoverEmbeddedSegment(_0x3da9a9,_0x3279f3,{'localName':_0x1dc4f6,'uniqueSegmentName':_0x27d573,'description':_0x150915['description']||_0x15b8bb(0x181)+_0x1dc4f6,'journeyId':_0x6863be,'resolvedRule':_0x2b90b5,'parentId':_0x232682['parentId'],'folderId':_0x232682['effectiveFolderId']||''},_0x501ffa);_0x395c89[_0x15b8bb(0x19e)](_0x1dc4f6,_0x9b20a0),_0x572eee[_0x15b8bb(0x20e)]['set'](_0x1dc4f6,_0x9b20a0),_0x42796a[_0x15b8bb(0x143)]?.({'type':_0x15b8bb(0x18d),'journeyName':_0x3279f3[_0x15b8bb(0x1b2)][_0x15b8bb(0x141)],'segmentName':_0x1dc4f6});}const _0x48c637=new Map();for(const [_0x28431f,_0x425d34]of _0x203893){_0x42796a[_0x15b8bb(0x143)]?.({'type':_0x15b8bb(0x1cb),'journeyName':_0x3279f3[_0x15b8bb(0x1b2)][_0x15b8bb(0x141)],'activationName':_0x28431f});const _0x9e2fde=await _0x3e803a(_0x425d34,_0x572eee[_0x15b8bb(0x1ca)]),_0x3804bb={..._0x9e2fde,..._0x425d34[_0x15b8bb(0x1a6)]!==undefined&&{'runAfterJourneyRefresh':_0x425d34[_0x15b8bb(0x1a6)]}},_0x3d7d8e=await _0x3da9a9[_0x15b8bb(0x1f4)][_0x15b8bb(0x1b8)](_0x6863be,_0x3804bb);_0x48c637[_0x15b8bb(0x19e)](_0x28431f,_0x3d7d8e['id']),_0x1c7d7a[_0x15b8bb(0x198)][_0x15b8bb(0x19e)](_0x28431f,_0x3d7d8e['id']),_0x42796a[_0x15b8bb(0x143)]?.({'type':_0x15b8bb(0x164),'journeyName':_0x3279f3['yamlConfig'][_0x15b8bb(0x141)],'activationName':_0x28431f});}const _0x132bd7=JSON['parse'](JSON['stringify'](_0x589401));return _0x132bd7['id']=_0x6863be,ensureJourneyDefaults(_0x132bd7[_0x15b8bb(0x19a)]),resolvePendingIdsInRequest(_0x132bd7,_0x589401,_0x38b977,_0x395c89,_0x48c637,_0x42796a),await _0x3da9a9[_0x15b8bb(0x1f4)][_0x15b8bb(0x1d5)](_0x6863be,_0x132bd7),deletePushRecovery(_0x3279f3['absolutePath']),{'action':_0x15b8bb(0x1c3),'journeyId':_0x6863be,'embeddedSegmentNameToId':_0x395c89};}export function stripWaitStepPendingIds(_0x3d97e6){const _0x336ebd=a140_0x2bcd56,_0x11db10=_0x3d97e6[_0x336ebd(0x1ac)]&&isPendingSegmentId(_0x3d97e6['conditionSegmentId']),_0x5add43=_0x3d97e6[_0x336ebd(0x1ec)]?.['some'](_0x1118af=>_0x1118af[_0x336ebd(0x149)]&&isPendingSegmentId(_0x1118af[_0x336ebd(0x149)]));(_0x11db10||_0x5add43)&&(_0x3d97e6[_0x336ebd(0x186)]=_0x336ebd(0x22d),_0x3d97e6[_0x336ebd(0x196)]=0x1,_0x3d97e6['waitStepUnit']='day',delete _0x3d97e6[_0x336ebd(0x1ac)],delete _0x3d97e6[_0x336ebd(0x1e4)],delete _0x3d97e6[_0x336ebd(0x1de)],delete _0x3d97e6[_0x336ebd(0x1ec)]);}export function resolveWaitStepPendingIds(_0x5f00f8,_0x5babb5,_0x35231d,_0x5dde92){const _0x38f8fd=a140_0x2bcd56;if(_0x5babb5[_0x38f8fd(0x1ac)]&&isPendingSegmentId(_0x5babb5[_0x38f8fd(0x1ac)])){const _0x4218f7=_0x35231d(_0x5babb5[_0x38f8fd(0x1ac)],'stage\x20\x27'+_0x5dde92+_0x38f8fd(0x1e5));_0x4218f7&&(_0x5f00f8[_0x38f8fd(0x186)]=_0x38f8fd(0x21b),_0x5f00f8['conditionSegmentId']=_0x4218f7,delete _0x5f00f8[_0x38f8fd(0x196)],delete _0x5f00f8[_0x38f8fd(0x240)],_0x5babb5[_0x38f8fd(0x1e4)]!==undefined&&(_0x5f00f8['conditionTimeoutDuration']=_0x5babb5[_0x38f8fd(0x1e4)]),_0x5babb5['conditionTimeoutUnit']&&(_0x5f00f8[_0x38f8fd(0x1de)]=_0x5babb5['conditionTimeoutUnit']));}if(_0x5babb5['conditions']){const _0x322930=_0x5babb5[_0x38f8fd(0x1ec)][_0x38f8fd(0x219)](_0x138096=>_0x138096[_0x38f8fd(0x149)]&&isPendingSegmentId(_0x138096[_0x38f8fd(0x149)]));if(_0x322930){const _0xd820cf=_0x5babb5[_0x38f8fd(0x1ec)][_0x38f8fd(0x185)](_0x5cd46d=>{const _0x30eb75=_0x38f8fd;if(_0x5cd46d[_0x30eb75(0x149)]&&isPendingSegmentId(_0x5cd46d[_0x30eb75(0x149)])){const _0x5da7f4=_0x35231d(_0x5cd46d[_0x30eb75(0x149)],_0x30eb75(0x233)+_0x5dde92+_0x30eb75(0x1e5));return{..._0x5cd46d,'segmentId':_0x5da7f4||_0x5cd46d['segmentId']};}return{..._0x5cd46d};});_0x5f00f8[_0x38f8fd(0x186)]=_0x38f8fd(0x21b),_0x5f00f8[_0x38f8fd(0x1ec)]=_0xd820cf,delete _0x5f00f8[_0x38f8fd(0x196)],delete _0x5f00f8['waitStepUnit'],delete _0x5f00f8[_0x38f8fd(0x1ac)],delete _0x5f00f8['conditionTimeoutDuration'],delete _0x5f00f8[_0x38f8fd(0x1de)];}}}function stripPendingIds(_0x52ef84){const _0xe747ae=a140_0x2bcd56;_0x52ef84[_0xe747ae(0x19a)]['goal']?.[_0xe747ae(0x149)]&&isPendingSegmentId(_0x52ef84[_0xe747ae(0x19a)][_0xe747ae(0x184)]['segmentId'])&&delete _0x52ef84[_0xe747ae(0x19a)][_0xe747ae(0x184)];for(const _0x9304d9 of _0x52ef84[_0xe747ae(0x19a)]['journeyStages']||[]){_0x9304d9[_0xe747ae(0x17b)]?.[_0xe747ae(0x149)]&&isPendingSegmentId(_0x9304d9[_0xe747ae(0x17b)][_0xe747ae(0x149)])&&delete _0x9304d9['entryCriteria'];_0x9304d9['milestone']?.[_0xe747ae(0x149)]&&isPendingSegmentId(_0x9304d9['milestone']['segmentId'])&&delete _0x9304d9[_0xe747ae(0x16e)];_0x9304d9[_0xe747ae(0x20d)]&&(_0x9304d9[_0xe747ae(0x20d)]=_0x9304d9['exitCriterias'][_0xe747ae(0x238)](_0x45ae7c=>!_0x45ae7c['segmentId']||!isPendingSegmentId(_0x45ae7c[_0xe747ae(0x149)])));if(_0x9304d9[_0xe747ae(0x1d2)])for(const _0x50e2d9 of Object['keys'](_0x9304d9[_0xe747ae(0x1d2)])){const _0x5915a2=_0x9304d9['steps'][_0x50e2d9];_0x5915a2[_0xe747ae(0x20c)]==='Activation'&&_0x5915a2[_0xe747ae(0x15a)]&&isPendingActivationId(_0x5915a2['journeyActivationStepId'])&&(_0x5915a2[_0xe747ae(0x15a)]='');if(_0x5915a2[_0xe747ae(0x20c)]===_0xe747ae(0x1e7)&&_0x5915a2[_0xe747ae(0x1c8)])for(const _0x1a972a of _0x5915a2[_0xe747ae(0x1c8)]){_0x1a972a['segmentId']&&isPendingSegmentId(_0x1a972a['segmentId'])&&(_0x1a972a['segmentId']='');}_0x5915a2[_0xe747ae(0x20c)]===_0xe747ae(0x1d4)&&stripWaitStepPendingIds(_0x5915a2);}}}function resolvePendingIdsInRequest(_0x77528f,_0x1d4ec2,_0x55086f,_0x179ad5,_0x26e1bc,_0x202914){const _0x255dbf=a140_0x2bcd56,_0x105568=(_0xfa9f03,_0x4350b7)=>{const _0x4f79e4=a140_0x275f;if(!isPendingSegmentId(_0xfa9f03))return _0xfa9f03;const _0x2f1d8c=extractPendingSegmentName(_0xfa9f03),_0x4ae419=_0x179ad5['get'](_0x2f1d8c);return!_0x4ae419&&_0x202914[_0x4f79e4(0x202)]?.(_0x4f79e4(0x1bb)+_0x2f1d8c+_0x4f79e4(0x151)+_0x4350b7),_0x4ae419;};if(_0x77528f['attributes'][_0x255dbf(0x184)]?.[_0x255dbf(0x149)]&&isPendingSegmentId(_0x77528f['attributes'][_0x255dbf(0x184)]['segmentId'])){const _0x138a60=_0x105568(_0x77528f[_0x255dbf(0x19a)][_0x255dbf(0x184)]['segmentId'],_0x255dbf(0x16d));_0x138a60&&(_0x77528f[_0x255dbf(0x19a)][_0x255dbf(0x184)]['segmentId']=_0x138a60);}for(const _0x280a5f of _0x77528f[_0x255dbf(0x19a)][_0x255dbf(0x15f)]||[]){const _0xe2754b=_0x55086f[_0x255dbf(0x195)](_0x280a5f['name'][_0x255dbf(0x23d)]());_0xe2754b&&(_0x280a5f['id']=_0xe2754b);if(_0x280a5f[_0x255dbf(0x17b)]?.['segmentId']&&isPendingSegmentId(_0x280a5f['entryCriteria'][_0x255dbf(0x149)])){const _0x460ee0=_0x105568(_0x280a5f[_0x255dbf(0x17b)][_0x255dbf(0x149)],_0x255dbf(0x233)+_0x280a5f[_0x255dbf(0x141)]+_0x255dbf(0x1b1));_0x460ee0&&(_0x280a5f[_0x255dbf(0x17b)]['segmentId']=_0x460ee0);}if(_0x280a5f[_0x255dbf(0x20d)])for(const _0x3bd0df of _0x280a5f['exitCriterias']){if(_0x3bd0df[_0x255dbf(0x149)]&&isPendingSegmentId(_0x3bd0df[_0x255dbf(0x149)])){const _0x2c4173=_0x105568(_0x3bd0df[_0x255dbf(0x149)],_0x255dbf(0x233)+_0x280a5f['name']+'\x27\x20exit\x20criteria');_0x2c4173&&(_0x3bd0df['segmentId']=_0x2c4173);}}if(_0x280a5f['milestone']?.[_0x255dbf(0x149)]&&isPendingSegmentId(_0x280a5f[_0x255dbf(0x16e)][_0x255dbf(0x149)])){const _0x4e20f0=_0x105568(_0x280a5f[_0x255dbf(0x16e)][_0x255dbf(0x149)],_0x255dbf(0x233)+_0x280a5f[_0x255dbf(0x141)]+_0x255dbf(0x1a8));_0x4e20f0&&(_0x280a5f[_0x255dbf(0x16e)]['segmentId']=_0x4e20f0);}if(_0x280a5f[_0x255dbf(0x1d2)]){const _0x5c01a6=_0x4460bd=>_0x1d4ec2[_0x255dbf(0x19a)]['journeyStages']?.[_0x255dbf(0x1f9)](_0x2359a8=>_0x2359a8[_0x255dbf(0x141)][_0x255dbf(0x23d)]()===_0x280a5f['name'][_0x255dbf(0x23d)]())?.[_0x255dbf(0x1d2)]?.[_0x4460bd];for(const _0x7cf702 of Object[_0x255dbf(0x19f)](_0x280a5f[_0x255dbf(0x1d2)])){const _0x47b592=_0x280a5f['steps'][_0x7cf702],_0x1c1619=_0x5c01a6(_0x7cf702);if(_0x47b592[_0x255dbf(0x20c)]===_0x255dbf(0x1b6)&&_0x47b592[_0x255dbf(0x15a)]&&(isPendingActivationId(_0x47b592[_0x255dbf(0x15a)])||_0x47b592[_0x255dbf(0x15a)]==='')){if(_0x1c1619?.[_0x255dbf(0x15a)]&&isPendingActivationId(_0x1c1619[_0x255dbf(0x15a)])){const _0x14db5f=extractPendingActivationName(_0x1c1619[_0x255dbf(0x15a)]),_0x441187=_0x26e1bc[_0x255dbf(0x195)](_0x14db5f);_0x441187&&(_0x47b592[_0x255dbf(0x15a)]=_0x441187);}}if(_0x47b592['type']===_0x255dbf(0x1e7)&&_0x47b592[_0x255dbf(0x1c8)]&&_0x1c1619?.[_0x255dbf(0x1c8)])for(let _0x427715=0x0;_0x427715<_0x47b592[_0x255dbf(0x1c8)]['length'];_0x427715++){const _0x259557=_0x47b592[_0x255dbf(0x1c8)][_0x427715],_0x295c39=_0x1c1619['branches'][_0x427715];if(_0x295c39?.[_0x255dbf(0x149)]&&isPendingSegmentId(_0x295c39[_0x255dbf(0x149)])){const _0x1480ad=_0x105568(_0x295c39['segmentId'],'stage\x20\x27'+_0x280a5f['name']+'\x27\x20decision\x20point\x20branch\x20\x27'+(_0x259557[_0x255dbf(0x141)]||_0x427715)+'\x27');_0x1480ad&&(_0x259557[_0x255dbf(0x149)]=_0x1480ad);}}_0x47b592['type']==='WaitStep'&&_0x1c1619?.[_0x255dbf(0x20c)]===_0x255dbf(0x1d4)&&resolveWaitStepPendingIds(_0x47b592,_0x1c1619,_0x105568,_0x280a5f[_0x255dbf(0x141)]);}}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x5dbaa4,_0x317a90){const _0x1658d4=a141_0x3a25,_0x4e3e2a=_0x5dbaa4();while(!![]){try{const _0x30aaa7=parseInt(_0x1658d4(0x17d))/0x1+-parseInt(_0x1658d4(0x17f))/0x2*(parseInt(_0x1658d4(0x17e))/0x3)+-parseInt(_0x1658d4(0x17c))/0x4*(parseInt(_0x1658d4(0x176))/0x5)+parseInt(_0x1658d4(0x17b))/0x6*(parseInt(_0x1658d4(0x184))/0x7)+parseInt(_0x1658d4(0x178))/0x8*(parseInt(_0x1658d4(0x177))/0x9)+-parseInt(_0x1658d4(0x181))/0xa+parseInt(_0x1658d4(0x185))/0xb;if(_0x30aaa7===_0x317a90)break;else _0x4e3e2a['push'](_0x4e3e2a['shift']());}catch(_0x40518e){_0x4e3e2a['push'](_0x4e3e2a['shift']());}}}(a141_0xdb91,0x7975e));function a141_0x3a25(_0xb0b1d9,_0x4c3928){_0xb0b1d9=_0xb0b1d9-0x176;const _0xdb9117=a141_0xdb91();let _0x3a25c0=_0xdb9117[_0xb0b1d9];return _0x3a25c0;}export function buildFolderIdToPathMap(_0x49ab88){const _0x197c8e=a141_0x3a25,_0x100ac0=new Map(),_0x3702ff=new Map();for(const _0x4e94df of _0x49ab88){_0x3702ff[_0x197c8e(0x179)](_0x4e94df['id'],_0x4e94df);}const _0xbb5564=new Set();for(const _0x267d5e of _0x49ab88){!_0x267d5e[_0x197c8e(0x186)]&&_0xbb5564['add'](_0x267d5e['id']);}function _0x10391e(_0x468e08){const _0x12c1da=_0x197c8e;if(_0x100ac0['has'](_0x468e08['id']))return _0x100ac0['get'](_0x468e08['id']);if(_0xbb5564[_0x12c1da(0x17a)](_0x468e08['id']))return _0x100ac0[_0x12c1da(0x179)](_0x468e08['id'],''),'';if(_0x468e08[_0x12c1da(0x186)]){const _0x1cc16f=_0x3702ff['get'](_0x468e08[_0x12c1da(0x186)]);if(_0x1cc16f){const _0x1b3e63=_0x10391e(_0x1cc16f),_0x3505c0=_0x1b3e63?_0x1b3e63+'/'+_0x468e08[_0x12c1da(0x182)]:_0x468e08[_0x12c1da(0x182)];return _0x100ac0[_0x12c1da(0x179)](_0x468e08['id'],_0x3505c0),_0x3505c0;}}const _0x338835=_0x468e08['name'];return _0x100ac0[_0x12c1da(0x179)](_0x468e08['id'],_0x338835),_0x338835;}for(const _0x417688 of _0x49ab88){_0x10391e(_0x417688);}return _0x100ac0;}export function buildFolderPathToIdMap(_0x2fad46){const _0x499ca4=a141_0x3a25,_0x4df4bd=new Map(),_0x272013=new Map();for(const _0x370377 of _0x2fad46){_0x272013[_0x499ca4(0x179)](_0x370377['id'],_0x370377);}const _0xd228ea=new Set();for(const _0x2c9a12 of _0x2fad46){!_0x2c9a12[_0x499ca4(0x186)]&&_0xd228ea[_0x499ca4(0x183)](_0x2c9a12['id']);}function _0xd70b(_0xa2a7f2){const _0x228597=_0x499ca4;if(_0xd228ea[_0x228597(0x17a)](_0xa2a7f2['id']))return'';if(_0xa2a7f2[_0x228597(0x186)]){const _0xb05136=_0x272013[_0x228597(0x180)](_0xa2a7f2[_0x228597(0x186)]);if(_0xb05136){const _0x1589a0=_0xd70b(_0xb05136);return _0x1589a0?_0x1589a0+'/'+_0xa2a7f2[_0x228597(0x182)]:_0xa2a7f2['name'];}}return _0xa2a7f2['name'];}for(const _0x2b2332 of _0x2fad46){const _0x4d0666=_0xd70b(_0x2b2332);_0x4df4bd[_0x499ca4(0x179)](_0x4d0666,_0x2b2332['id']);}return _0x4df4bd;}function a141_0xdb91(){const _0x2881cc=['10947761WYOlvb','parentFolderId','205ISWvtg','380223GvlkHJ','32QmaiRF','set','has','16494bixlEC','50156rcAWVl','407790dilqib','283914lpzVjv','12KPEJqA','get','4022010dEimkV','name','add','1043MyXdhk'];a141_0xdb91=function(){return _0x2881cc;};return a141_0xdb91();}export function buildFolderMaps(_0x1bfab9){const _0x55ac06=buildFolderIdToPathMap(_0x1bfab9),_0x205764=new Map();for(const [_0x46df65,_0xfc3f8a]of _0x55ac06){_0x205764['set'](_0xfc3f8a,_0x46df65);}return{'idToPath':_0x55ac06,'pathToId':_0x205764};}export function getFolderPath(_0x388f5c,_0x738004){const _0x20b03b=a141_0x3a25;if(!_0x388f5c)return'';return _0x738004[_0x20b03b(0x180)](_0x388f5c)??'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x5ce5fd,_0x120717){const _0x5571f1=a142_0x5d42,_0x45d0cf=_0x5ce5fd();while(!![]){try{const _0x52e5bd=parseInt(_0x5571f1(0x1ef))/0x1*(-parseInt(_0x5571f1(0x20e))/0x2)+-parseInt(_0x5571f1(0x1f0))/0x3+-parseInt(_0x5571f1(0x1ee))/0x4*(parseInt(_0x5571f1(0x1fa))/0x5)+parseInt(_0x5571f1(0x216))/0x6+-parseInt(_0x5571f1(0x218))/0x7+parseInt(_0x5571f1(0x1fd))/0x8*(parseInt(_0x5571f1(0x208))/0x9)+parseInt(_0x5571f1(0x1f3))/0xa*(parseInt(_0x5571f1(0x214))/0xb);if(_0x52e5bd===_0x120717)break;else _0x45d0cf['push'](_0x45d0cf['shift']());}catch(_0x49f04e){_0x45d0cf['push'](_0x45d0cf['shift']());}}}(a142_0x9ca3,0x3a872));import a142_0x282c3c from'path';import{parse as a142_0x31ae3e}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x8cefe0){const _0x3b267a=a142_0x5d42;if(!_0x8cefe0||_0x8cefe0[_0x3b267a(0x217)]()==='')throw new Error(_0x3b267a(0x201));const _0x5d4dcf=_0x8cefe0[_0x3b267a(0x217)]();if(_0x5d4dcf==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x8cefe0};const _0x148064=_0x5d4dcf[_0x3b267a(0x203)]('/')?_0x5d4dcf['substring'](0x1):_0x5d4dcf,_0x3b7094=_0x148064['split']('/')['filter'](_0x67781b=>_0x67781b!=='');if(_0x3b7094[_0x3b267a(0x20c)]===0x0)throw new Error('Path\x20must\x20contain\x20at\x20least\x20one\x20segment');const _0x3d9bab=_0x5d4dcf[_0x3b267a(0x203)]('/')||!isRelativePathSegment(_0x3b7094[0x0]);for(const _0x5dd255 of _0x3b7094){validatePathSegment(_0x5dd255);}return{'segments':_0x3b7094,'isAbsolute':_0x3d9bab,'raw':_0x8cefe0};}function isRelativePathSegment(_0x4860d4){return _0x4860d4==='.'||_0x4860d4==='..';}function validatePathSegment(_0x36ff42){const _0x53de52=a142_0x5d42;if(_0x36ff42==='')throw new Error(_0x53de52(0x1fc));if(_0x36ff42==='.'||_0x36ff42==='..')return;if(/[\x00-\x1F\x7F]/[_0x53de52(0x206)](_0x36ff42))throw new Error(_0x53de52(0x211)+_0x36ff42);if(_0x36ff42!==_0x36ff42['trim']()){}}export function validatePath(_0x949655){const _0x14d4d2=a142_0x5d42;if(_0x949655['segments']['length']===0x0&&!_0x949655['isAbsolute'])throw new Error(_0x14d4d2(0x21a));if(_0x949655[_0x14d4d2(0x1f8)]){if(_0x949655[_0x14d4d2(0x204)][0x0]==='..')throw new Error(_0x14d4d2(0x21c));let _0xa37bc9=0x0;for(const _0x20d3c4 of _0x949655[_0x14d4d2(0x204)]){if(_0x20d3c4==='..'){if(_0xa37bc9===0x0)throw new Error(_0x14d4d2(0x1f5));_0xa37bc9--;}else _0x20d3c4!=='.'&&_0xa37bc9++;}}}export function joinPaths(_0x39d890,_0x1f262f){const _0x2ebd12=a142_0x5d42;if(!_0x39d890||_0x39d890==='/')return _0x1f262f;if(!_0x1f262f||_0x1f262f==='.')return _0x39d890;if(_0x1f262f[_0x2ebd12(0x203)]('/'))return _0x1f262f;const _0x2d56ef=parsePath(_0x39d890),_0x140b4d=parsePath(_0x1f262f),_0x1b2301=[..._0x2d56ef[_0x2ebd12(0x204)]];for(const _0x37adff of _0x140b4d[_0x2ebd12(0x204)]){if(_0x37adff==='.')continue;else{if(_0x37adff==='..'){if(_0x1b2301['length']===0x0)throw new Error(_0x2ebd12(0x20b));_0x1b2301[_0x2ebd12(0x1f2)]();}else _0x1b2301[_0x2ebd12(0x1fe)](_0x37adff);}}const _0x2770e4=_0x1b2301[_0x2ebd12(0x219)]('/');return _0x2d56ef['raw']['startsWith']('/')?'/'+_0x2770e4:_0x2770e4;}export function normalizePath(_0x17abfc){const _0x15ae7d=a142_0x5d42,_0x105a68=parsePath(_0x17abfc),_0x574dc2=[];for(const _0x2031ee of _0x105a68['segments']){if(_0x2031ee==='.')continue;else{if(_0x2031ee==='..'){if(_0x574dc2[_0x15ae7d(0x20c)]===0x0){if(_0x105a68[_0x15ae7d(0x1f8)])throw new Error(_0x15ae7d(0x20b));_0x574dc2[_0x15ae7d(0x1fe)]('..');}else _0x574dc2[_0x574dc2[_0x15ae7d(0x20c)]-0x1]==='..'?_0x574dc2[_0x15ae7d(0x1fe)]('..'):_0x574dc2['pop']();}else _0x574dc2[_0x15ae7d(0x1fe)](_0x2031ee);}}if(_0x574dc2[_0x15ae7d(0x20c)]===0x0)return _0x105a68[_0x15ae7d(0x1f8)]?'/':'.';const _0x259114=_0x574dc2['join']('/');return _0x105a68[_0x15ae7d(0x20f)]['startsWith']('/')?'/'+_0x259114:_0x259114;}export function getParentPath(_0x4c0bf4){const _0x3bfdb4=a142_0x5d42,_0x2c876f=parsePath(_0x4c0bf4);if(_0x2c876f[_0x3bfdb4(0x204)]['length']<=0x1)return'/';const _0x225def=_0x2c876f[_0x3bfdb4(0x204)]['slice'](0x0,-0x1)[_0x3bfdb4(0x219)]('/');return _0x2c876f['raw'][_0x3bfdb4(0x203)]('/')?'/'+_0x225def:_0x225def;}export function getBaseName(_0x3e926b){const _0x2e7824=a142_0x5d42,_0x120140=parsePath(_0x3e926b);return _0x120140[_0x2e7824(0x204)][_0x120140[_0x2e7824(0x204)][_0x2e7824(0x20c)]-0x1]||'';}function a142_0x5d42(_0x508945,_0x509716){_0x508945=_0x508945-0x1ed;const _0x9ca3c=a142_0x9ca3();let _0x5d420a=_0x9ca3c[_0x508945];return _0x5d420a;}export function isChildPath(_0x413654,_0x27ebed){const _0x1771ad=a142_0x5d42,_0xfecad=parsePath(_0x413654),_0x1996b6=parsePath(_0x27ebed);if(_0xfecad[_0x1771ad(0x204)][_0x1771ad(0x20c)]<=_0x1996b6[_0x1771ad(0x204)]['length'])return![];for(let _0x27101f=0x0;_0x27101f<_0x1996b6[_0x1771ad(0x204)][_0x1771ad(0x20c)];_0x27101f++){if(_0xfecad[_0x1771ad(0x204)][_0x27101f]!==_0x1996b6[_0x1771ad(0x204)][_0x27101f])return![];}return!![];}export function splitPath(_0x57e701){const _0x20a8d6=a142_0x5d42,_0x154315=parsePath(_0x57e701);if(_0x154315[_0x20a8d6(0x204)][_0x20a8d6(0x20c)]===0x0)throw new Error(_0x20a8d6(0x213));if(_0x154315[_0x20a8d6(0x204)][_0x20a8d6(0x20c)]===0x1)return{'parent':_0x154315['segments'][0x0]};return{'parent':_0x154315[_0x20a8d6(0x204)][0x0],'child':_0x154315[_0x20a8d6(0x204)]['slice'](0x1)[_0x20a8d6(0x219)]('/')};}function a142_0x9ca3(){const _0xdb4739=['startsWith','segments','name','test','endsWith','45BGklCR','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','root','Cannot\x20navigate\x20above\x20root','length','replace','402958xCFCpw','raw','Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','parent_segment','Cannot\x20split\x20empty\x20path','77352vYjeew','segment','332220xvGRtj','trim','3300696MdJrvM','join','Relative\x20path\x20cannot\x20be\x20empty','readFile','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','parse','292FiZKTx','2uAwsVq','357741YTwwTN','exists','pop','1770slSdVm','type','Path\x20attempts\x20to\x20navigate\x20above\x20root','No\x20tdx.json\x20found\x20for\x20file:\x20','relative','isAbsolute','journey','32760xoVBKE','tdx.json','Path\x20segment\x20cannot\x20be\x20empty','658760qRphvJ','push','dirname','.yml','Path\x20cannot\x20be\x20empty','File\x20not\x20found:\x20'];a142_0x9ca3=function(){return _0xdb4739;};return a142_0x9ca3();}export function isYamlFilePath(_0x3d7a3c){const _0x1906fb=a142_0x5d42;return _0x3d7a3c[_0x1906fb(0x207)](_0x1906fb(0x200))||_0x3d7a3c[_0x1906fb(0x207)]('.yaml');}export async function resolveYamlFilePath(_0x1798e7,_0x432faa=nodeFileSystem){const _0x22a1ce=a142_0x5d42,_0x5019b2=a142_0x282c3c['resolve'](_0x1798e7);if(!await _0x432faa['exists'](_0x5019b2))throw new Error(_0x22a1ce(0x202)+_0x1798e7);let _0x1e8751=a142_0x282c3c[_0x22a1ce(0x1ff)](_0x5019b2),_0x91b74=null,_0x24086f=null;const _0x286f91=a142_0x282c3c[_0x22a1ce(0x1ed)](_0x1e8751)[_0x22a1ce(0x20a)];while(_0x1e8751!==_0x286f91){const _0x1e3bd4=a142_0x282c3c[_0x22a1ce(0x219)](_0x1e8751,_0x22a1ce(0x1fb));if(await _0x432faa[_0x22a1ce(0x1f1)](_0x1e3bd4)){_0x91b74=_0x1e3bd4,_0x24086f=_0x1e8751;break;}_0x1e8751=a142_0x282c3c[_0x22a1ce(0x1ff)](_0x1e8751);}if(!_0x91b74||!_0x24086f)throw new Error(_0x22a1ce(0x1f6)+_0x1798e7+'\x0a'+_0x22a1ce(0x210));const _0x16e6d7=await _0x432faa[_0x22a1ce(0x21b)](_0x91b74),_0x15f98c=JSON[_0x22a1ce(0x1ed)](_0x16e6d7),_0x4f0650=_0x15f98c[_0x22a1ce(0x212)];if(!_0x4f0650)throw new Error(_0x22a1ce(0x209));const _0x30551d=await _0x432faa['readFile'](_0x5019b2),_0x48bfa6=a142_0x31ae3e(_0x30551d),_0xf9b9ef=_0x48bfa6[_0x22a1ce(0x205)];if(!_0xf9b9ef)throw new Error('Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20'+_0x1798e7);const _0xfea5fc=_0x48bfa6[_0x22a1ce(0x1f4)]===_0x22a1ce(0x1f9)?_0x22a1ce(0x1f9):_0x22a1ce(0x215),_0x272348=a142_0x282c3c[_0x22a1ce(0x1f7)](_0x24086f,_0x5019b2),_0x4d459b=a142_0x282c3c['dirname'](_0x272348),_0x377e18=_0x4d459b==='.'?'':_0x4d459b[_0x22a1ce(0x20d)](/\\/g,'/'),_0x117cad=_0x377e18?_0x4f0650+'/'+_0x377e18+'/'+_0xf9b9ef:_0x4f0650+'/'+_0xf9b9ef;return{'parentSegment':_0x4f0650,'segmentName':_0xf9b9ef,'folderPath':_0x377e18,'fullPath':_0x117cad,'resourceType':_0xfea5fc,'content':_0x30551d};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x54ac09,_0x362afe){const _0x509b3c=a143_0x5821,_0x5057d1=_0x54ac09();while(!![]){try{const _0x84cbe1=parseInt(_0x509b3c(0x174))/0x1*(parseInt(_0x509b3c(0x178))/0x2)+parseInt(_0x509b3c(0x180))/0x3*(-parseInt(_0x509b3c(0x17f))/0x4)+parseInt(_0x509b3c(0x176))/0x5+parseInt(_0x509b3c(0x172))/0x6+parseInt(_0x509b3c(0x173))/0x7*(-parseInt(_0x509b3c(0x17b))/0x8)+-parseInt(_0x509b3c(0x17a))/0x9+-parseInt(_0x509b3c(0x17d))/0xa*(-parseInt(_0x509b3c(0x17c))/0xb);if(_0x84cbe1===_0x362afe)break;else _0x5057d1['push'](_0x5057d1['shift']());}catch(_0xdcd0c8){_0x5057d1['push'](_0x5057d1['shift']());}}}(a143_0x4177,0x66db2));function a143_0x5821(_0x28b541,_0x17cb86){_0x28b541=_0x28b541-0x172;const _0x417740=a143_0x4177();let _0x5821bf=_0x417740[_0x28b541];return _0x5821bf;}export function parseSegmentRef(_0x2dcda0){const _0x5414a6=a143_0x5821,_0x2750e4=_0x2dcda0[_0x5414a6(0x175)]('/');if(_0x2750e4===-0x1)return{'parentId':_0x2dcda0};if(_0x2750e4===0x0)throw new Error(_0x5414a6(0x179)+_0x2dcda0+_0x5414a6(0x17e));const _0x30fac3=_0x2dcda0[_0x5414a6(0x177)](0x0,_0x2750e4),_0x4b33b6=_0x2dcda0[_0x5414a6(0x177)](_0x2750e4+0x1);if(_0x4b33b6==='')throw new Error(_0x5414a6(0x179)+_0x2dcda0+'.\x20Child\x20name\x20cannot\x20be\x20empty');return{'parentId':_0x30fac3,'childId':_0x4b33b6};}function a143_0x4177(){const _0x4d319d=['287iyoRAk','191hvJCMs','indexOf','2200930fmpdCo','substring','3666amFYTs','Invalid\x20segment\x20reference\x20format:\x20','3038175XgkXbj','20392ASyYWl','33ZLffOm','428020nbkrbI','.\x20Parent\x20name\x20cannot\x20be\x20empty','1353584xnmKve','3JHsEpC','1698498QMNocl'];a143_0x4177=function(){return _0x4d319d;};return a143_0x4177();}
|