@treasuredata/tdx 2026.4.10 → 2026.4.12
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/cas-command.js +1 -1
- package/dist/commands/cas-segment-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/policy-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/work-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.d.ts +1 -0
- package/dist/core/profile.d.ts.map +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/profile.js.map +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/tools/work-create-item.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/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.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.d.ts +6 -0
- package/dist/sdk/journey.d.ts.map +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/journey.js.map +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/policy.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.js +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/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/types/workspace.d.ts +2 -0
- package/dist/sdk/types/workspace.d.ts.map +1 -1
- package/dist/sdk/types/workspace.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/sdk/workspace/access-tracker.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.d.ts.map +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/index.js.map +1 -1
- package/dist/sdk/workspace/templates.d.ts.map +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/templates.js.map +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.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
|
-
const a152_0xd184d4=a152_0x2210;(function(_0x2b5654,_0x577280){const _0x2069ad=a152_0x2210,_0x4b0adb=_0x2b5654();while(!![]){try{const _0x75bedb=-parseInt(_0x2069ad(0x104))/0x1+-parseInt(_0x2069ad(0x11f))/0x2+-parseInt(_0x2069ad(0x1d6))/0x3*(parseInt(_0x2069ad(0x150))/0x4)+-parseInt(_0x2069ad(0x193))/0x5+-parseInt(_0x2069ad(0x1ae))/0x6*(-parseInt(_0x2069ad(0x1d7))/0x7)+parseInt(_0x2069ad(0x11b))/0x8+parseInt(_0x2069ad(0x1b7))/0x9;if(_0x75bedb===_0x577280)break;else _0x4b0adb['push'](_0x4b0adb['shift']());}catch(_0x1ef6c7){_0x4b0adb['push'](_0x4b0adb['shift']());}}}(a152_0x3907,0x9984c));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of']('tdx.sdk.push-workflow');export const PENDING_SEGMENT_PREFIX=a152_0xd184d4(0x126);export const PENDING_ACTIVATION_PREFIX=a152_0xd184d4(0x1d9);export function createPendingSegmentId(_0x272b50){return''+PENDING_SEGMENT_PREFIX+_0x272b50+'__';}export function isPendingSegmentId(_0x340cef){const _0x5bb866=a152_0xd184d4;return _0x340cef['startsWith'](PENDING_SEGMENT_PREFIX)&&!_0x340cef[_0x5bb866(0x12a)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0xa34d91){const _0x5453ea=a152_0xd184d4;return _0xa34d91[_0x5453ea(0x1c2)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x2efe9a){return''+PENDING_ACTIVATION_PREFIX+_0x2efe9a+'__';}export function isPendingActivationId(_0x48ade3){const _0x4be14e=a152_0xd184d4;return _0x48ade3[_0x4be14e(0x12a)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x5627b0){const _0x4b83b1=a152_0xd184d4;return _0x5627b0[_0x4b83b1(0x1c2)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x181c69,_0x14663e){const _0x11cfc3=a152_0xd184d4,_0x27179f=_0x181c69+'::'+(_0x14663e[_0x11cfc3(0x154)]()||_0x11cfc3(0x109)),_0xcae514=createHash(_0x11cfc3(0x135))['update'](_0x27179f)[_0x11cfc3(0x11e)](_0x11cfc3(0x1ed))[_0x11cfc3(0x175)](0x0,0xc);return'journey_entry_criteria_'+_0xcae514;}export function ensureJourneyDefaults(_0x4ea397){const _0xb42c35=a152_0xd184d4;!_0x4ea397['description']&&(_0x4ea397[_0xb42c35(0x168)]=''),!_0x4ea397[_0xb42c35(0x139)]&&(_0x4ea397[_0xb42c35(0x139)]=_0xb42c35(0x10c));}export function injectExistingStageIds(_0xbe44bc,_0x2a32fe){const _0x332185=a152_0xd184d4,_0x491cfc=new Map(_0x2a32fe[_0x332185(0x1b6)](_0xc5c1a5=>[_0xc5c1a5['name'],_0xc5c1a5['id']]));for(const _0x32fee9 of _0xbe44bc){if(!_0x32fee9['id']){const _0x3edba1=_0x491cfc[_0x332185(0x181)](_0x32fee9['name']);_0x3edba1&&(_0x32fee9['id']=_0x3edba1);}}}export function resolveTDFolderPath(_0x286ae0,_0x297e59,_0x1da58e){const _0x980e1d=a152_0xd184d4;if(!_0x297e59)return _0x286ae0;if(_0x286ae0===_0x1da58e||_0x286ae0[_0x980e1d(0x12a)](_0x1da58e+'/'))return _0x286ae0;return _0x286ae0?_0x1da58e+'/'+_0x286ae0:_0x1da58e;}export function addFoldersToCreate(_0x33d631,_0x87c0b8,_0x4c9337){const _0x5503e2=a152_0xd184d4;if(!_0x33d631)return;if(_0x87c0b8[_0x5503e2(0x18e)](_0x33d631))return;const _0x2e90aa=_0x33d631['split']('/');let _0xc3dc08='';for(const _0x3b4142 of _0x2e90aa){_0xc3dc08=_0xc3dc08?_0xc3dc08+'/'+_0x3b4142:_0x3b4142,!_0x87c0b8[_0x5503e2(0x18e)](_0xc3dc08)&&_0x4c9337[_0x5503e2(0x1e4)](_0xc3dc08);}}export function sortFoldersByDepth(_0x25cd22){const _0xc4379=a152_0xd184d4;return[..._0x25cd22][_0xc4379(0x18d)]((_0x48ee71,_0x5352f0)=>{const _0xa0de62=_0xc4379,_0x2f203c=(_0x48ee71['match'](/\//g)||[])['length'],_0x2e476d=(_0x5352f0[_0xa0de62(0x177)](/\//g)||[])[_0xa0de62(0x169)];return _0x2f203c-_0x2e476d;});}import*as a152_0x2564d2 from'yaml';import{readFileSync}from'fs';import a152_0x430c61 from'path';import{isJourneyDef,parseYamlString as a152_0x52920e,toYamlString as a152_0x34e891,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(_0x38f7bb){const _0x242b20=a152_0xd184d4;if(Array[_0x242b20(0x1bb)](_0x38f7bb))return'['+_0x38f7bb['map'](_0x588b58=>stableStringify(_0x588b58))[_0x242b20(0x13b)](',')+']';if(_0x38f7bb&&typeof _0x38f7bb===_0x242b20(0x1d1)){const _0x52a74c=_0x38f7bb,_0x24226f=Object[_0x242b20(0x1a2)](_0x52a74c)[_0x242b20(0x18d)](),_0x3feba2=_0x24226f[_0x242b20(0x1b6)](_0x147195=>'\x22'+_0x147195+'\x22:'+stableStringify(_0x52a74c[_0x147195]));return'{'+_0x3feba2[_0x242b20(0x13b)](',')+'}';}const _0x1130d1=JSON[_0x242b20(0x142)](_0x38f7bb);return _0x1130d1===undefined?_0x242b20(0x1ba):_0x1130d1;}function activationSignature(_0x692b64){const _0x57c356=a152_0xd184d4,_0x817dd6={'connection':_0x692b64['connection'],..._0x692b64['all_columns']!==undefined&&{'all_columns':_0x692b64[_0x57c356(0x14e)]},..._0x692b64['columns']!==undefined&&{'columns':_0x692b64['columns']},..._0x692b64[_0x57c356(0x1f8)]!==undefined&&{'behavior':_0x692b64[_0x57c356(0x1f8)]},..._0x692b64[_0x57c356(0x11d)]!==undefined&&{'schedule':_0x692b64[_0x57c356(0x11d)]},..._0x692b64[_0x57c356(0x1c6)]!==undefined&&{'notification':_0x692b64[_0x57c356(0x1c6)]},..._0x692b64['connector_config']!==undefined&&{'connector_config':_0x692b64['connector_config']},..._0x692b64[_0x57c356(0x14c)]!==undefined&&{'activation_template_id':_0x692b64['activation_template_id']}};return stableStringify(_0x817dd6);}async function fetchSegment(_0xb26b5a,_0x44a854,_0x469d03,_0x168551){const _0x55a188=a152_0xd184d4,_0x5a66cf=_0x168551?.[_0x55a188(0x179)](_0x475640=>_0x475640['id']===_0x469d03);if(_0x5a66cf)return _0x5a66cf;try{return await _0xb26b5a[_0x55a188(0x109)][_0x55a188(0x13d)](_0x44a854,_0x469d03);}catch(_0xb2c80c){logger[_0x55a188(0x17c)]('getSegment\x20failed\x20for\x20'+_0x469d03+_0x55a188(0x1df)+_0xb2c80c);try{return await _0xb26b5a['segment'][_0x55a188(0x188)](_0x469d03);}catch(_0x3cb47c){return logger[_0x55a188(0x17c)](_0x55a188(0x1ce)+_0x469d03+':\x20'+_0x3cb47c),null;}}}function recoverSegmentIdsFromPushRecovery(_0x186d10,_0x2a5e2f,_0x3dd7a0){const _0x5a6919=a152_0xd184d4,_0x364b96=readPushRecovery(_0x186d10[_0x5a6919(0x10b)]);if(_0x364b96?.['journeyName']===_0x186d10[_0x5a6919(0x106)]['name'])for(const [_0x438ff9,_0x50c47b]of Object[_0x5a6919(0x1f1)](_0x364b96[_0x5a6919(0x17e)])){const _0x4c2a1d=generateDeterministicJourneySegmentName(_0x186d10['yamlConfig'][_0x5a6919(0x13a)],_0x438ff9);_0x50c47b[_0x5a6919(0x194)]===_0x4c2a1d&&(_0x2a5e2f[_0x5a6919(0x1e9)](_0x438ff9,_0x50c47b[_0x5a6919(0x18c)]),_0x3dd7a0[_0x5a6919(0x1e9)](_0x438ff9,_0x50c47b[_0x5a6919(0x18c)]));}}function a152_0x2210(_0x339565,_0x37c8b8){_0x339565=_0x339565-0x103;const _0x390710=a152_0x3907();let _0x221094=_0x390710[_0x339565];return _0x221094;}async function createOrRecoverEmbeddedSegment(_0x3127a6,_0x19faa8,_0x25ee72,_0x26bc66){const _0x79042b=a152_0xd184d4;let _0xad2855;try{_0xad2855=await _0x3127a6['segment']['createJourneySegment']({'name':_0x25ee72[_0x79042b(0x1a5)],'description':_0x25ee72[_0x79042b(0x168)],'journeyId':_0x25ee72[_0x79042b(0x1ee)],'rule':_0x26bc66(_0x25ee72[_0x79042b(0x1b9)],!![]),'countPopulation':!![],'parentFolderId':_0x25ee72['folderId'],'audienceId':_0x25ee72[_0x79042b(0x192)]});}catch(_0x1e81b7){const _0x4f7750=_0x1e81b7 instanceof Error&&_0x1e81b7[_0x79042b(0x189)][_0x79042b(0x20a)](_0x79042b(0x151));if(_0x4f7750){const _0x45e7e3=readPushRecovery(_0x19faa8[_0x79042b(0x10b)]),_0xb5cf7e=_0x45e7e3?.[_0x79042b(0x1ab)]===_0x19faa8[_0x79042b(0x106)][_0x79042b(0x13a)]?_0x45e7e3[_0x79042b(0x17e)][_0x25ee72['localName']]:undefined;if(_0xb5cf7e?.[_0x79042b(0x194)]===_0x25ee72[_0x79042b(0x1a5)])await _0x3127a6[_0x79042b(0x109)][_0x79042b(0x124)](_0x25ee72[_0x79042b(0x192)],_0xb5cf7e[_0x79042b(0x18c)],{'description':_0x25ee72[_0x79042b(0x168)],'rule':_0x26bc66(_0x25ee72[_0x79042b(0x1b9)],!![]),'countPopulation':!![]}),_0xad2855=_0xb5cf7e['segmentId'];else throw new SDKError(ErrorCode[_0x79042b(0x161)],_0x79042b(0x18f)+_0x25ee72[_0x79042b(0x205)]+_0x79042b(0x182)+(_0x79042b(0x207)+_0x19faa8['absolutePath'][_0x79042b(0x1c2)](/([^/]+)$/,_0x79042b(0x17a))+')\x20')+'and\x20the\x20server\x20segment,\x20then\x20retry.',_0x1e81b7);}else throw _0x1e81b7;}return saveSegmentToPushRecovery(_0x19faa8[_0x79042b(0x10b)],_0x19faa8[_0x79042b(0x106)][_0x79042b(0x13a)],_0x25ee72[_0x79042b(0x205)],{'segmentId':_0xad2855,'uniqueServerName':_0x25ee72[_0x79042b(0x1a5)],'createdAt':new Date()[_0x79042b(0x15f)]()}),_0xad2855;}export async function prepareSegmentFiles(_0x546ccc,_0x327d32,_0x1dab39,_0x543381,_0x4b712e){const _0x3e2a92=a152_0xd184d4,{activationDefToCreateRequest:_0x50b7d3}=await import(_0x3e2a92(0x1cd)),_0x5eef19=[],_0x14f23e=new Set();for(const {yamlConfig:_0x4b33f9,folderPath:_0x2de1cf,sourcePath:_0x2a4d5c}of _0x546ccc){const _0x13048d=resolveTDFolderPath(_0x2de1cf,_0x543381,_0x4b712e),_0x1a5c6c=_0x13048d+':'+_0x4b33f9[_0x3e2a92(0x13a)],_0x36171b=_0x327d32[_0x3e2a92(0x105)][_0x3e2a92(0x181)](_0x1a5c6c),_0x37240a=_0x36171b?_0x327d32['activationsBySegmentId'][_0x3e2a92(0x181)](_0x36171b['id'])||[]:[];addFoldersToCreate(_0x13048d,_0x327d32[_0x3e2a92(0x1c4)],_0x14f23e);const _0x1d35bc=calculateActivationActions(_0x4b33f9[_0x3e2a92(0x1dd)]||[],_0x37240a,_0x327d32[_0x3e2a92(0x12c)],_0x327d32['connectionIdToNameMap']);for(const _0x579dac of _0x1d35bc){(_0x579dac[_0x3e2a92(0x1e5)]===_0x3e2a92(0x128)||_0x579dac[_0x3e2a92(0x1e5)]==='update')&&_0x579dac['yamlActivation']&&(_0x579dac[_0x3e2a92(0x1a9)]=await _0x50b7d3(_0x579dac[_0x3e2a92(0x16d)],_0x1dab39));}const _0x54c190=calculateSegmentDiff(_0x4b33f9,_0x36171b,_0x37240a,_0x327d32['idToEmailMap'],_0x327d32[_0x3e2a92(0x12e)]);_0x5eef19[_0x3e2a92(0x1f4)]({'relativePath':_0x4b33f9[_0x3e2a92(0x13a)],'absolutePath':_0x2a4d5c,'yamlConfig':_0x4b33f9,'folderPath':_0x13048d,'existingSegment':_0x36171b,'existingActivations':_0x37240a,'isNew':_0x54c190['isNew'],'hasChanges':_0x54c190[_0x3e2a92(0x1d2)],'diff':_0x54c190[_0x3e2a92(0x19c)],'activationActions':_0x1d35bc});}return{'segmentFiles':_0x5eef19,'foldersToCreate':_0x14f23e};}export async function prepareJourneyFiles(_0x5e27c4,_0x16625a,_0x258edf,_0x3367eb){const _0x364019=a152_0xd184d4,_0x3f7ccc=[],_0x5defd5=new Set();for(const {yamlConfig:_0x787083,folderPath:_0x419aef,sourcePath:_0x15e667}of _0x5e27c4){const _0x502480=resolveTDFolderPath(_0x419aef,_0x258edf,_0x3367eb),_0x319a1a=_0x502480+':'+_0x787083[_0x364019(0x13a)],_0x59e755=_0x16625a[_0x364019(0x155)][_0x364019(0x181)](_0x319a1a);let _0x5f2dc0,_0x5c390f;if(_0x59e755&&_0x59e755[_0x364019(0x169)]>0x0){const _0x5f3e3e=buildLocalExpandedRuleMappings(_0x787083),{createYamlContext:_0x2a1bbd,prefetchJourneySegments:_0x206d51}=createPushYamlContextForBundle(_0x16625a[_0x364019(0x146)],_0x16625a['parentId'],_0x16625a[_0x364019(0x140)],_0x5f3e3e,_0x16625a['idToEmailMap'],_0x16625a[_0x364019(0x12e)],_0x16625a[_0x364019(0x10e)],_0x16625a['journeyById']);await _0x206d51(_0x59e755[_0x364019(0x1b6)](_0xdbc058=>_0xdbc058['id']));const _0x2cb554=await _0x16625a['deps'][_0x364019(0x1d4)][_0x364019(0x148)](_0x59e755[0x0][_0x364019(0x10f)]),_0x6fbda8=hasMultipleVersions(_0x787083),_0x5044fe=async _0x11897b=>{const _0x390d13=_0x364019,_0x1a0801=_0x16625a[_0x390d13(0x1af)]?.[_0x390d13(0x181)](_0x11897b);if(_0x1a0801)return _0x1a0801;return _0x16625a[_0x390d13(0x1ca)]({'journeyId':_0x11897b,'journeyName':_0x787083[_0x390d13(0x13a)],'isMultiVersion':_0x59e755[_0x390d13(0x169)]>0x1});};if(_0x6fbda8&&_0x59e755[_0x364019(0x169)]>0x1){const _0x2a6550=[];for(const _0x574bfa of _0x59e755){const _0x57e7d5=_0x574bfa[_0x364019(0x1c8)]||0x1;_0x16625a[_0x364019(0x1fc)]?.[_0x364019(0x159)]('Fetching\x20'+_0x787083['name']+'\x20v'+_0x57e7d5);const _0x328627=await _0x5044fe(_0x574bfa['id']),_0x3f30dd=_0x2a1bbd(_0x574bfa['id']),_0x509fea=await journeyResponseToDef(_0x328627,_0x3f30dd);_0x2a6550[_0x364019(0x1f4)]({'item':_0x574bfa,'yaml':_0x509fea});}const _0x1b2ba0=buildLocalRuleToNameMappingFromJourney(_0x787083);_0x5c390f=buildMergedJourneyDef(_0x2a6550,_0x1b2ba0,_0x2cb554);const _0x5c2627=Math['max'](..._0x2a6550['map'](_0x474bd5=>_0x474bd5[_0x364019(0x15c)][_0x364019(0x1c8)]||0x0)),_0x36a40c=_0x59e755['find'](_0x158609=>(_0x158609[_0x364019(0x1c8)]||0x0)===_0x5c2627);_0x36a40c&&(_0x16625a[_0x364019(0x1fc)]?.[_0x364019(0x159)](_0x364019(0x1d0)+_0x787083[_0x364019(0x13a)]+'\x20v'+_0x5c2627),_0x5f2dc0=await _0x5044fe(_0x36a40c['id']));}else{const _0x23d675=_0x59e755[_0x59e755[_0x364019(0x169)]-0x1];_0x16625a[_0x364019(0x1fc)]?.[_0x364019(0x159)](_0x364019(0x1d0)+_0x787083[_0x364019(0x13a)]),_0x5f2dc0=await _0x5044fe(_0x23d675['id']);const _0x58d668=_0x2a1bbd(_0x23d675['id']),_0x34f2b4=await journeyResponseToDef(_0x5f2dc0,_0x58d668),_0xd2a02d=buildLocalRuleToNameMappingFromJourney(_0x787083);_0x5c390f=buildMergedJourneyDef([{'item':_0x23d675,'yaml':_0x34f2b4}],_0xd2a02d,_0x2cb554);}}addFoldersToCreate(_0x502480,_0x16625a[_0x364019(0x1c4)],_0x5defd5);const _0x1709ba=calculateJourneyDiff(_0x787083,_0x5c390f);_0x3f7ccc[_0x364019(0x1f4)]({'relativePath':_0x787083['name'],'absolutePath':_0x15e667,'yamlConfig':_0x787083,'folderPath':_0x502480,'existingJourney':_0x5f2dc0,'isNew':_0x1709ba[_0x364019(0x1da)],'hasChanges':_0x1709ba[_0x364019(0x1d2)],'diff':_0x1709ba[_0x364019(0x19c)]});}return{'journeyFiles':_0x3f7ccc,'foldersToCreate':_0x5defd5};}export function calculateActivationActions(_0x3ac590,_0x137a33,_0xbb8bde,_0x27d506){const _0x1d5643=a152_0xd184d4,_0x5406d0=[],_0xca9673=new Map();for(const _0x516726 of _0x137a33){_0xca9673[_0x1d5643(0x1e9)](_0x516726[_0x1d5643(0x13a)],_0x516726);}const _0x45c069=new Map();for(const _0x858639 of _0x3ac590){_0x45c069[_0x1d5643(0x1e9)](_0x858639[_0x1d5643(0x13a)],_0x858639);}for(const _0x43a2e7 of _0x3ac590){const _0x10ab7d=_0xca9673[_0x1d5643(0x181)](_0x43a2e7['name']);if(!_0x10ab7d)_0x5406d0[_0x1d5643(0x1f4)]({'type':'create','name':_0x43a2e7['name'],'yamlActivation':_0x43a2e7});else{const _0x3f1bb8=activationResponseToDef(_0x10ab7d,_0xbb8bde,_0x27d506),_0x3a515b=a152_0x2564d2['stringify'](_0x3f1bb8),_0x283205=a152_0x2564d2['stringify'](_0x43a2e7);_0x3a515b!==_0x283205&&_0x5406d0[_0x1d5643(0x1f4)]({'type':_0x1d5643(0x159),'name':_0x43a2e7['name'],'yamlActivation':_0x43a2e7,'existingActivation':_0x10ab7d});}}for(const _0x5921c8 of _0x137a33){!_0x45c069[_0x1d5643(0x18e)](_0x5921c8['name'])&&_0x5406d0[_0x1d5643(0x1f4)]({'type':'delete','name':_0x5921c8[_0x1d5643(0x13a)],'existingActivation':_0x5921c8});}return _0x5406d0;}function calculateYamlDiff(_0x32f74c,_0x338263){if(_0x338263){const _0x1f649b=generateDiff(_0x338263,_0x32f74c),_0xf4bd46=hasChanges(_0x1f649b);return{'isNew':![],'hasChanges':_0xf4bd46,'diff':_0xf4bd46?formatDiffWithColors(_0x1f649b):undefined};}const _0x5d8d88=generateDiff('',_0x32f74c);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x5d8d88)};}export function calculateSegmentDiff(_0x13a527,_0x2fa690,_0x42c871,_0xcaa69,_0x599fac){const _0x78cebc=segmentToYamlString(_0x13a527),_0x12a255=_0x2fa690?segmentToYamlString(segmentWithActivationsToYaml(_0x2fa690,_0x42c871,undefined,_0xcaa69,_0x599fac)):undefined;return calculateYamlDiff(_0x78cebc,_0x12a255);}export function calculateJourneyDiff(_0x499796,_0x1939f2){const _0x4078d0=normalizeJourneyDef(_0x499796,_0x499796),_0x54c6ee=a152_0x34e891(_0x4078d0),_0x52ed0b=_0x1939f2?a152_0x34e891(normalizeJourneyDef(_0x1939f2,_0x499796)):undefined;return calculateYamlDiff(_0x54c6ee,_0x52ed0b);}export function findSegmentsToDelete(_0x1f22ae,_0x336be7,_0x3ee544,_0x33787d,_0x4f2d41){const _0x345c12=a152_0xd184d4,_0x7a9b27=new Set();for(const {yamlConfig:_0x59b031,folderPath:_0xcbd4d2}of _0x336be7){_0x7a9b27[_0x345c12(0x1e4)](_0xcbd4d2+':'+_0x59b031[_0x345c12(0x13a)]);}return _0x1f22ae[_0x345c12(0x206)](_0x496b13=>{const _0x420b55=_0x345c12,_0x411e67=_0x496b13[_0x420b55(0x160)]?_0x3ee544[_0x420b55(0x181)](_0x496b13[_0x420b55(0x160)][_0x420b55(0x1f5)]())||'':'',_0x2ab4af=_0x411e67+':'+_0x496b13[_0x420b55(0x13a)];if(_0x7a9b27[_0x420b55(0x18e)](_0x2ab4af))return![];if(_0x4f2d41)return _0x411e67===_0x33787d||_0x411e67[_0x420b55(0x12a)](_0x33787d+'/');return!![];});}export function findJourneysToDelete(_0x36eea0,_0x4cfc45,_0x13b5a9,_0x5842e6,_0x33bed2){const _0x3977bd=a152_0xd184d4,_0x109f83=new Set();for(const {yamlConfig:_0x412e7b,folderPath:_0x44b2f9}of _0x4cfc45){_0x109f83[_0x3977bd(0x1e4)](_0x44b2f9+':'+_0x412e7b[_0x3977bd(0x13a)]);}return _0x36eea0[_0x3977bd(0x206)](_0x140216=>{const _0x30e8b2=_0x3977bd,_0x295f58=_0x140216[_0x30e8b2(0x19a)]?_0x13b5a9[_0x30e8b2(0x181)](_0x140216[_0x30e8b2(0x19a)])||'':'',_0x45e169=_0x295f58+':'+_0x140216['journeyBundleName'];if(_0x109f83[_0x30e8b2(0x18e)](_0x45e169))return![];if(_0x33bed2)return _0x295f58===_0x5842e6||_0x295f58['startsWith'](_0x5842e6+'/');return!![];});}export function buildSegmentLookupMap(_0x1bb9d9,_0x3edb03){const _0x251c9e=a152_0xd184d4,_0x53a8e0=new Map();for(const _0x2faf2d of _0x1bb9d9){const _0x19d75b=_0x2faf2d[_0x251c9e(0x160)]?_0x3edb03['get'](_0x2faf2d['segmentFolderId'][_0x251c9e(0x1f5)]())||'':'',_0x4e4e7a=_0x19d75b+':'+_0x2faf2d[_0x251c9e(0x13a)];_0x53a8e0[_0x251c9e(0x1e9)](_0x4e4e7a,_0x2faf2d);}return _0x53a8e0;}export function buildSegmentNameToIdMap(_0x1575d0){const _0x547853=a152_0xd184d4,_0x41533e=new Map();for(const _0x2bcb22 of _0x1575d0){_0x41533e[_0x547853(0x1e9)](_0x2bcb22[_0x547853(0x13a)],_0x2bcb22['id']);}return _0x41533e;}export function buildJourneyBundleLookupMap(_0x2c507c,_0x40a707){const _0x3d15c3=a152_0xd184d4,_0x118ed3=new Map();for(const _0x29eff7 of _0x2c507c){const _0x3c4cda=_0x29eff7['folderId']?_0x40a707[_0x3d15c3(0x181)](_0x29eff7[_0x3d15c3(0x19a)])||'':'',_0x111a9c=_0x3c4cda+':'+_0x29eff7[_0x3d15c3(0x1a4)];!_0x118ed3['has'](_0x111a9c)&&_0x118ed3['set'](_0x111a9c,[]),_0x118ed3[_0x3d15c3(0x181)](_0x111a9c)[_0x3d15c3(0x1f4)](_0x29eff7);}for(const _0x280dde of _0x118ed3[_0x3d15c3(0x203)]()){_0x280dde[_0x3d15c3(0x18d)]((_0x3eee30,_0x52a4e0)=>(_0x3eee30['versionNumber']||0x0)-(_0x52a4e0[_0x3d15c3(0x1c8)]||0x0));}return _0x118ed3;}export function collectFoldersToCreate(_0x5bc891,_0x343538){const _0x4df34f=a152_0xd184d4,_0x4949ae=new Set();for(const _0x53c2ba of _0x5bc891){if(!_0x53c2ba)continue;if(_0x343538[_0x4df34f(0x18e)](_0x53c2ba))continue;const _0x48cc63=_0x53c2ba['split']('/');let _0xe18dfa='';for(const _0x471c35 of _0x48cc63){_0xe18dfa=_0xe18dfa?_0xe18dfa+'/'+_0x471c35:_0x471c35,!_0x343538[_0x4df34f(0x18e)](_0xe18dfa)&&_0x4949ae[_0x4df34f(0x1e4)](_0xe18dfa);}}return _0x4949ae;}export function parseAndClassifyYamlFiles(_0x1dadc4,_0xbc6e91,_0x261d80){const _0x7051aa=a152_0xd184d4,_0x4944df=[],_0x532101=[];for(const _0x3a2833 of _0x1dadc4){const _0x705419=a152_0x430c61['relative'](_0xbc6e91,a152_0x430c61[_0x7051aa(0x163)](_0x3a2833)),_0xfb92a7=_0x705419==='.'?'':_0x705419[_0x7051aa(0x1c2)](/\\/g,'/'),_0x491199=readFileSync(_0x3a2833,_0x7051aa(0x1ea)),_0x1539e9=a152_0x2564d2[_0x7051aa(0x111)](_0x491199);if(isJourneyDef(_0x1539e9)){const _0x3d2e48=a152_0x52920e(_0x491199);_0x532101['push']({'yamlConfig':_0x3d2e48,'folderPath':_0xfb92a7,'sourcePath':_0x3a2833});}else{if(!_0x261d80?.[_0x7051aa(0x13f)]){const _0x4e990e=parseSegmentYamlFile(_0x491199),_0x1fc00e=normalizeChildSegmentYaml(_0x4e990e);_0x4944df['push']({'yamlConfig':_0x1fc00e,'folderPath':_0xfb92a7,'sourcePath':_0x3a2833});}}}return{'segments':_0x4944df,'journeys':_0x532101};}export function validateParsedFiles(_0x36fccb,_0x5d753e){const _0xc40f22=a152_0xd184d4,_0x559670=[];for(const {yamlConfig:_0x19e4a8,sourcePath:_0x20e5be}of _0x36fccb[_0xc40f22(0x17e)]){const _0x184fc7=readFileSync(_0x20e5be,_0xc40f22(0x1ea)),_0x263107=a152_0x2564d2[_0xc40f22(0x195)](_0x184fc7),_0x1aed91=validateSegmentDef(_0x19e4a8,{'source':_0x184fc7,'document':_0x263107},{'skipSchema':!![]});if(!_0x1aed91['valid']){const _0x15a4de=a152_0x430c61['relative'](_0x5d753e,_0x20e5be);_0x559670[_0xc40f22(0x1f4)]({'filePath':_0x15a4de,'source':_0x184fc7,'result':_0x1aed91,'isJourney':![]});}}for(const {yamlConfig:_0x13381c,sourcePath:_0x53fdcb}of _0x36fccb[_0xc40f22(0x1a7)]){const _0x2fa315=readFileSync(_0x53fdcb,_0xc40f22(0x1ea)),_0xc1e4f2=a152_0x2564d2[_0xc40f22(0x195)](_0x2fa315),_0x579fba=validateJourneyDef(_0x13381c,{'source':_0x2fa315,'document':_0xc1e4f2},{'skipSchema':!![]});if(!_0x579fba[_0xc40f22(0x1fa)]){const _0x1c4435=a152_0x430c61['relative'](_0x5d753e,_0x53fdcb);_0x559670[_0xc40f22(0x1f4)]({'filePath':_0x1c4435,'source':_0x2fa315,'result':_0x579fba,'isJourney':!![]});}}return _0x559670;}export function formatValidationErrors(_0x2c1091){const _0x23d6c7=a152_0xd184d4,_0x48934c=[];for(const {filePath:_0x434827,source:_0x590af0,result:_0x233a49,isJourney:_0x5c180c}of _0x2c1091){const _0x15b7a7=_0x5c180c?'journey':_0x23d6c7(0x109);_0x48934c[_0x23d6c7(0x1f4)]('\x0a'+_0x434827+'\x20('+_0x15b7a7+_0x23d6c7(0x1cf)+_0x233a49[_0x23d6c7(0x1f2)][_0x23d6c7(0x169)]+'\x20error(s)'),_0x48934c[_0x23d6c7(0x1f4)](formatValidationResult(_0x233a49,_0x590af0,_0x434827));}return _0x48934c[_0x23d6c7(0x13b)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x1b3dbf){const _0x5e8c3b=a152_0xd184d4,_0x30a692=new Set(),_0x1a7066=new Map(),_0x17af43=collectSegmentUsageCounts(_0x1b3dbf);if(_0x1b3dbf[_0x5e8c3b(0x17e)])for(const [_0x49585b,_0x2e9695]of Object[_0x5e8c3b(0x1f1)](_0x1b3dbf[_0x5e8c3b(0x17e)])){_0x30a692[_0x5e8c3b(0x1e4)](_0x49585b);if(_0x2e9695[_0x5e8c3b(0x202)]){const _0x57e1bd=yamlRuleToApi(_0x2e9695[_0x5e8c3b(0x202)]),_0x4b99f0=apiRuleToYaml(_0x57e1bd);_0x1a7066[_0x5e8c3b(0x1e9)](_0x49585b,_0x4b99f0);}}const _0x5565a4=new Map();let _0x2d35a3=0x0;for(const [_0x1a0f68,_0x5c28af]of _0x1a7066){const _0x343d94=serializeExpandedRule(_0x5c28af,_0x1a7066),_0x51b689=_0x5565a4['get'](_0x343d94)||[];_0x51b689[_0x5e8c3b(0x1f4)]({'name':_0x1a0f68,'index':_0x2d35a3}),_0x5565a4[_0x5e8c3b(0x1e9)](_0x343d94,_0x51b689),_0x2d35a3++;}const _0x8ac6a7=new Map();for(const [_0x4b1f4c,_0x13b46a]of _0x5565a4){const _0x1e7815=_0x13b46a[_0x5e8c3b(0x175)]()[_0x5e8c3b(0x18d)]((_0x4c9d93,_0x51506a)=>{const _0x2ae600=_0x5e8c3b,_0x590eef=_0x17af43[_0x2ae600(0x181)](_0x4c9d93['name'])||0x0,_0x450d92=_0x17af43[_0x2ae600(0x181)](_0x51506a[_0x2ae600(0x13a)])||0x0;if(_0x590eef!==_0x450d92)return _0x450d92-_0x590eef;return _0x4c9d93[_0x2ae600(0x136)]-_0x51506a['index'];})[_0x5e8c3b(0x1b6)](_0x2a35a0=>_0x2a35a0[_0x5e8c3b(0x13a)]),_0x25cdbb=[];for(const _0x47110e of _0x1e7815){const _0x4bae32=_0x17af43[_0x5e8c3b(0x181)](_0x47110e)||0x0,_0x15191f=Math[_0x5e8c3b(0x112)](_0x4bae32,0x1);for(let _0x1bd50c=0x0;_0x1bd50c<_0x15191f;_0x1bd50c++){_0x25cdbb[_0x5e8c3b(0x1f4)](_0x47110e);}}_0x8ac6a7[_0x5e8c3b(0x1e9)](_0x4b1f4c,_0x25cdbb);}return{'existingLocalSegmentNames':_0x30a692,'localSegmentRules':_0x1a7066,'localExpandedRuleToNames':_0x8ac6a7};}export function createSegmentIdResolver(_0x43fd79,_0x32ecc1){return async _0x38ec7e=>{const _0x141318=a152_0x2210,_0xd00424=_0x43fd79[_0x141318(0x181)](_0x38ec7e);if(!_0xd00424)throw new SDKError(ErrorCode[_0x141318(0x1d3)],_0x141318(0x1dc)+_0x38ec7e+_0x141318(0x17d)+_0x32ecc1+'\x27)');return _0xd00424;};}export function extractRootFolderId(_0x342fa8){const _0x3d7b42=a152_0xd184d4;return _0x342fa8[_0x3d7b42(0x1b1)]?.[_0x3d7b42(0x1f6)]?.['data']?.['id']||_0x342fa8[_0x3d7b42(0x1b1)]?.['parentFolder']?.[_0x3d7b42(0x114)]?.['id'];}export function buildConnectionMaps(_0x34bdd4){const _0x10177a=a152_0xd184d4,_0x25844d=new Map(),_0x1cd445=new Map(),_0x383c4a=new Map();for(const _0x38a222 of _0x34bdd4){_0x25844d[_0x10177a(0x1e9)](_0x38a222[_0x10177a(0x13a)],parseInt(_0x38a222['id'],0xa)),_0x1cd445['set'](_0x38a222['id'],_0x38a222[_0x10177a(0x13a)]),_0x383c4a[_0x10177a(0x1e9)](_0x38a222['name'],_0x38a222[_0x10177a(0x1e5)]);}return{'nameToId':_0x25844d,'idToName':_0x1cd445,'nameToType':_0x383c4a};}export function calculatePushStats(_0x5f543a,_0xcfc920,_0x3216c8,_0xcdeb9c,_0x9f9073,_0x4da4e1,_0x4e6a23){const _0x6509dd=a152_0xd184d4,_0x1aa578=_0x5f543a[_0x6509dd(0x206)](_0x266122=>_0x266122[_0x6509dd(0x1da)]),_0x459c75=_0x5f543a[_0x6509dd(0x206)](_0x3686e1=>!_0x3686e1[_0x6509dd(0x1da)]&&_0x3686e1['hasChanges']),_0x4de8d5=_0x5f543a['filter'](_0x5e1188=>!_0x5e1188[_0x6509dd(0x1da)]&&!_0x5e1188[_0x6509dd(0x1d2)]),_0x524608=_0x4da4e1?_0xcdeb9c:[],_0x2a294e=_0xcfc920['filter'](_0x3ec405=>_0x3ec405[_0x6509dd(0x1da)]),_0x404421=_0xcfc920['filter'](_0x4c8010=>!_0x4c8010[_0x6509dd(0x1da)]&&_0x4c8010['hasChanges']),_0x2141f0=_0xcfc920['filter'](_0x2e4745=>!_0x2e4745[_0x6509dd(0x1da)]&&!_0x2e4745['hasChanges']),_0x51cd99=_0x4da4e1?_0x9f9073:[],_0x52adec=_0x5f543a[_0x6509dd(0x1bd)](_0x63725d=>_0x63725d['activationActions']),_0x583cd5=_0x52adec[_0x6509dd(0x206)](_0x9ebfd6=>_0x9ebfd6[_0x6509dd(0x1e5)]===_0x6509dd(0x128)),_0x43488e=_0x52adec[_0x6509dd(0x206)](_0x113590=>_0x113590[_0x6509dd(0x1e5)]===_0x6509dd(0x159)),_0x185f1d=_0x52adec[_0x6509dd(0x206)](_0x1cf06b=>_0x1cf06b['type']===_0x6509dd(0x1b4)),_0x53720b=Array['from'](_0x3216c8)[_0x6509dd(0x18d)](),_0x2c7754=_0x4e6a23?![]:_0x1aa578[_0x6509dd(0x169)]>0x0||_0x459c75[_0x6509dd(0x169)]>0x0||_0x524608[_0x6509dd(0x169)]>0x0,_0x1f15cc=_0x2a294e[_0x6509dd(0x169)]>0x0||_0x404421['length']>0x0||_0x51cd99[_0x6509dd(0x169)]>0x0,_0x2cbe49=_0x4e6a23?![]:_0x52adec[_0x6509dd(0x169)]>0x0,_0x7cfc29=_0x53720b[_0x6509dd(0x169)]>0x0;return{'segments':{'new':_0x1aa578,'changed':_0x459c75,'unchanged':_0x4de8d5,'toDelete':_0x524608},'journeys':{'new':_0x2a294e,'changed':_0x404421,'unchanged':_0x2141f0,'toDelete':_0x51cd99},'activations':{'all':_0x52adec,'toCreate':_0x583cd5,'toUpdate':_0x43488e,'toDelete':_0x185f1d},'folders':{'toCreate':_0x53720b},'counts':{'segments':{'new':_0x1aa578[_0x6509dd(0x169)],'changed':_0x459c75[_0x6509dd(0x169)],'unchanged':_0x4de8d5[_0x6509dd(0x169)],'toDelete':_0x524608[_0x6509dd(0x169)]},'journeys':{'new':_0x2a294e[_0x6509dd(0x169)],'changed':_0x404421[_0x6509dd(0x169)],'unchanged':_0x2141f0['length'],'toDelete':_0x51cd99['length']},'activations':{'create':_0x583cd5[_0x6509dd(0x169)],'update':_0x43488e['length'],'delete':_0x185f1d[_0x6509dd(0x169)]},'folders':_0x53720b[_0x6509dd(0x169)]},'hasChanges':_0x2c7754||_0x1f15cc||_0x2cbe49||_0x7cfc29};}export async function buildPushExecutionContext(_0x4ad881,_0x176d94,_0x17afb4,_0x3507a1,_0x1be9d8,_0x54ccbb){const _0x1b50e5=a152_0xd184d4,_0xb4c5ad=extractRootFolderId(_0x17afb4),{pathToId:_0x3948a6,idToPath:_0x17c814}=buildFolderMaps(_0x1be9d8),_0x3a7bd6=buildSegmentNameToIdMap(_0x3507a1),_0x388cd3=new Map(),{batchAsync:_0x4af893}=await import(_0x1b50e5(0x132)),[_0x38611f,_0x5adac9]=await Promise[_0x1b50e5(0x121)]([_0x4ad881[_0x1b50e5(0x1e1)]['buildUserMaps'](),_0x4ad881[_0x1b50e5(0x11a)]['list'](),((async()=>{!_0x54ccbb&&_0x3507a1['length']>0x0&&await _0x4af893(_0x3507a1,async _0x183281=>{const _0x498447=a152_0x2210,_0x4d755a=await _0x4ad881[_0x498447(0x109)][_0x498447(0x133)](_0x176d94,_0x183281['id']);_0x388cd3[_0x498447(0x1e9)](_0x183281['id'],_0x4d755a);});})())]),{emailToId:_0x5b6597,idToEmail:_0x1ee214}=_0x38611f,_0x3e5173=buildConnectionMaps(_0x5adac9);return{'rootFolderId':_0xb4c5ad,'folderPathToId':_0x3948a6,'folderIdToPath':_0x17c814,'segmentNameToId':_0x3a7bd6,'activationsBySegmentId':_0x388cd3,'emailToIdMap':_0x5b6597,'idToEmailMap':_0x1ee214,'connectionNameToIdMap':_0x3e5173['nameToId'],'connectionIdToNameMap':_0x3e5173[_0x1b50e5(0x14b)],'connectionNameToTypeMap':_0x3e5173['nameToType']};}export function createPushYamlContextForBundle(_0x5786d4,_0x2711b3,_0x3c9882,_0x4a41b3,_0x8d7cba,_0x50d3bf,_0x1cf607,_0x4b4f94){const {existingLocalSegmentNames:_0x73d62,localExpandedRuleToNames:_0x5aeb09}=_0x4a41b3,_0xfba02c=new Set(),_0x1293fc=new Map(),_0x2f0cdb=new Map(),_0x5a4d5d=new Map(),_0x489fbe=createJumpTargetCache(),_0x253b06=new Map(),_0x5a01ee=new Map(),_0x34e240=new Set();let _0x2cbfb2;const _0x487340=_0x2930bf=>{const _0x1c09eb={'resolveSegment':async _0x154384=>{const _0x42859b=a152_0x2210,_0x4245cf=_0x5a4d5d['get'](_0x154384);if(_0x4245cf!==undefined)return{'name':_0x4245cf,'isJourneyLocal':!![]};try{const _0x31cd72=await fetchSegment(_0x5786d4,_0x2711b3,_0x154384,_0x3c9882);if(!_0x31cd72)throw new Error('Segment\x20not\x20found');const _0x47a692=generateJourneyLocalName(_0x31cd72[_0x42859b(0x13a)]),_0x32eab1=_0x31cd72[_0x42859b(0x1fd)]===SEGMENT_KIND_JOURNEY&&_0x47a692!==undefined;let _0x33602c=_0x31cd72[_0x42859b(0x13a)],_0x20361c;if(_0x32eab1&&_0x31cd72['rule']){const _0xef4098=apiRuleToYaml(_0x31cd72['rule']);_0x5a01ee[_0x42859b(0x1e9)](_0x154384,_0xef4098);const _0x52b916=async _0x526366=>{const _0x90f628=_0x42859b,_0x25030d=collectSegmentRefsFromRule(_0x526366);for(const _0x24a4dc of _0x25030d){if(!_0x5a01ee[_0x90f628(0x18e)](_0x24a4dc))try{const _0x6bcbc1=await fetchSegment(_0x5786d4,_0x2711b3,_0x24a4dc,_0x3c9882);if(_0x6bcbc1?.[_0x90f628(0x202)]){const _0x3d6bda=apiRuleToYaml(_0x6bcbc1['rule']);_0x5a01ee[_0x90f628(0x1e9)](_0x24a4dc,_0x3d6bda),await _0x52b916(_0x3d6bda);}}catch(_0x15ed97){logger[_0x90f628(0x17c)](_0x90f628(0x1b3)+_0x24a4dc+':\x20'+_0x15ed97);}}};await _0x52b916(_0xef4098);const _0x4e5f5e=serializeExpandedRule(_0xef4098,_0x5a01ee),_0x5c1e1c=_0x5aeb09[_0x42859b(0x181)](_0x4e5f5e);if(_0x5c1e1c&&_0x5c1e1c['length']>0x0){const _0x3c062a=_0x1293fc['get'](_0x4e5f5e)||0x0,_0x337434=_0x5c1e1c[_0x3c062a]||_0x5c1e1c[_0x5c1e1c[_0x42859b(0x169)]-0x1];_0x1293fc[_0x42859b(0x1e9)](_0x4e5f5e,_0x3c062a+0x1),_0x33602c=_0x337434,_0xfba02c['add'](_0x33602c),_0x5a4d5d[_0x42859b(0x1e9)](_0x154384,_0x33602c);const _0x5c6cd6=await resolveRuleSegmentRefs(_0xef4098,async _0x314ccf=>{const _0xd3b918=_0x42859b,_0x13e1d6=_0x5a4d5d[_0xd3b918(0x181)](_0x314ccf);if(_0x13e1d6)return _0x13e1d6;const _0x2b6518=await _0x2cbfb2[_0xd3b918(0x1c5)](_0x314ccf);return _0x2b6518['name'];});_0x20361c={'description':_0x31cd72[_0x42859b(0x168)],'rule':_0x5c6cd6};}else{const _0x81c580=_0x253b06[_0x42859b(0x181)](_0x4e5f5e);if(_0x81c580)_0x33602c=_0x81c580,_0x5a4d5d[_0x42859b(0x1e9)](_0x154384,_0x33602c);else{if(_0x47a692){let _0x1cfcbe=_0x47a692,_0xd128a7=0x2;while(_0xfba02c[_0x42859b(0x18e)](_0x1cfcbe)||_0x73d62[_0x42859b(0x18e)](_0x1cfcbe)){_0x1cfcbe=_0x47a692+'_'+_0xd128a7,_0xd128a7++;}_0xfba02c[_0x42859b(0x1e4)](_0x1cfcbe),_0x33602c=_0x1cfcbe;}_0x5a4d5d[_0x42859b(0x1e9)](_0x154384,_0x33602c),_0x253b06[_0x42859b(0x1e9)](_0x4e5f5e,_0x33602c);const _0x96e1e1=await resolveRuleSegmentRefs(_0xef4098,async _0x53e6a2=>{const _0x19723a=_0x42859b,_0x7f55aa=_0x5a4d5d[_0x19723a(0x181)](_0x53e6a2);if(_0x7f55aa)return _0x7f55aa;const _0x26d73c=await _0x2cbfb2[_0x19723a(0x1c5)](_0x53e6a2);return _0x26d73c[_0x19723a(0x13a)];});_0x20361c={'description':_0x31cd72[_0x42859b(0x168)],'rule':_0x96e1e1};}}}return{'name':_0x33602c,'isJourneyLocal':_0x32eab1,'definition':_0x20361c};}catch(_0x3757e8){return logger[_0x42859b(0x17c)](_0x42859b(0x180)+_0x154384+':\x20'+_0x3757e8),{'name':_0x154384,'isJourneyLocal':![]};}},'resolveActivation':async _0x1ecfe4=>{const _0xa454aa=a152_0x2210,_0x4abb3e=_0x2f0cdb[_0xa454aa(0x181)](_0x1ecfe4);if(_0x4abb3e!==undefined)return{'name':_0x4abb3e,'isJourneyLocal':!![]};try{let _0x5482f4=_0x1cf607?.['get'](_0x1ecfe4);!_0x5482f4&&(_0x5482f4=await _0x5786d4[_0xa454aa(0x1d4)][_0xa454aa(0x123)](_0x2930bf,_0x1ecfe4));const _0x2f0233=_0x5482f4[_0xa454aa(0x171)][_0xa454aa(0x19b)][_0xa454aa(0x13a)]||_0x1ecfe4,_0x50fe19=sanitizeYamlKey(_0x2f0233)||'activation_'+_0x1ecfe4,_0x9135b1=_0x50fe19;_0x2f0cdb[_0xa454aa(0x1e9)](_0x1ecfe4,_0x9135b1);const _0x53b0b3=journeyActivationStepToYaml(_0x5482f4,_0x8d7cba,_0x50d3bf);return{'name':_0x9135b1,'isJourneyLocal':!![],'definition':_0x53b0b3};}catch(_0x10809e){return logger[_0xa454aa(0x17c)]('Failed\x20to\x20resolve\x20activation\x20'+_0x1ecfe4+':\x20'+_0x10809e),{'name':_0x1ecfe4,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0xb384f3,_0x1710fb)=>resolveJumpTarget(_0xb384f3,_0x1710fb,_0x489fbe,async _0x13b864=>{const _0x5d91cd=a152_0x2210,_0x2bb4e0=_0x4b4f94?.['get'](_0x13b864);if(_0x2bb4e0)return _0x2bb4e0;return _0x5786d4['journey'][_0x5d91cd(0x198)](_0x13b864);})};return _0x2cbfb2=_0x1c09eb,_0x1c09eb;},_0x489198=async _0x1c72e0=>{const _0x2f6453=a152_0x2210,{collectSegmentIdsFromJourneyApi:_0xabf63e}=await import(_0x2f6453(0x204)),{batchAsync:_0xde6569}=await import(_0x2f6453(0x132)),_0x7225a3=new Set();for(const _0x379ed4 of _0x1c72e0){let _0x41c17d=_0x4b4f94?.[_0x2f6453(0x181)](_0x379ed4);!_0x41c17d&&(_0x41c17d=await _0x5786d4['journey']['getJourney'](_0x379ed4));const _0x3df64c=_0xabf63e(_0x41c17d);for(const _0x5d4d3c of _0x3df64c){_0x7225a3[_0x2f6453(0x1e4)](_0x5d4d3c);}}let _0x369b20=Array[_0x2f6453(0x199)](_0x7225a3);while(_0x369b20[_0x2f6453(0x169)]>0x0){const _0x183341=_0x369b20[_0x2f6453(0x206)](_0x32ef4e=>!_0x34e240['has'](_0x32ef4e));if(_0x183341['length']===0x0)break;const _0x333489=await _0xde6569(_0x183341,async _0x457d0f=>{const _0x2f921f=_0x2f6453;_0x34e240[_0x2f921f(0x1e4)](_0x457d0f);const _0x50643e=await fetchSegment(_0x5786d4,_0x2711b3,_0x457d0f,_0x3c9882);if(!_0x50643e)return null;return{'segmentId':_0x457d0f,'segment':_0x50643e};},0xa),_0x24bacd=new Set();for(const _0xb140ba of _0x333489){if(!_0xb140ba?.[_0x2f6453(0x109)]?.[_0x2f6453(0x202)])continue;const _0x3c1908=apiRuleToYaml(_0xb140ba[_0x2f6453(0x109)][_0x2f6453(0x202)]);_0x5a01ee[_0x2f6453(0x1e9)](_0xb140ba[_0x2f6453(0x18c)],_0x3c1908);const _0x483fbf=collectSegmentRefsFromRule(_0x3c1908);for(const _0x2a89f0 of _0x483fbf){!_0x34e240[_0x2f6453(0x18e)](_0x2a89f0)&&_0x24bacd[_0x2f6453(0x1e4)](_0x2a89f0);}}_0x369b20=Array['from'](_0x24bacd);}};return{'createYamlContext':_0x487340,'prefetchJourneySegments':_0x489198};}export async function executePushSegments(_0x11e340,_0x2008cb,_0x114ace,_0x512e96,_0x105633){const _0x3a6a81=a152_0xd184d4,{segmentDefToCreateRequest:_0x567296,segmentDefToUpdateRequest:_0x258dff}=await import(_0x3a6a81(0x1cd)),_0x1db944=_0x114ace[_0x3a6a81(0x1c4)],_0x17a4f8=0x5,_0x38df6a=async _0x43bb9d=>{const _0x50d5ae=_0x3a6a81,_0x4d8d09=_0x43bb9d[_0x50d5ae(0x1cb)]?_0x1db944[_0x50d5ae(0x181)](_0x43bb9d['folderPath']):undefined;let _0x19e427;const _0x5e41a2={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x19ab7c=_0x43bb9d[_0x50d5ae(0x106)];if(_0x43bb9d[_0x50d5ae(0x106)]['rule']){const _0x5a55bd=createSegmentIdResolver(_0x114ace[_0x50d5ae(0x1b5)],_0x43bb9d[_0x50d5ae(0x106)][_0x50d5ae(0x13a)]),_0xc16eb4=await resolveRuleSegmentIds(_0x43bb9d[_0x50d5ae(0x106)]['rule'],_0x5a55bd);_0x19ab7c={..._0x43bb9d[_0x50d5ae(0x106)],'rule':_0xc16eb4};}try{if(_0x43bb9d[_0x50d5ae(0x1da)]){_0x105633['onProgress']?.({'type':_0x50d5ae(0x1de),'name':_0x43bb9d['yamlConfig']['name']});const _0xf80e61=_0x567296(_0x19ab7c,_0x4d8d09),_0x438801=await _0x105633[_0x50d5ae(0x13e)]('Creating\x20segment\x20\x27'+_0x43bb9d[_0x50d5ae(0x106)]['name']+_0x50d5ae(0x13c),()=>_0x11e340['segment'][_0x50d5ae(0x19f)](_0x512e96['parentId'],_0xf80e61));_0x19e427=_0x438801['data']['id'],_0x114ace[_0x50d5ae(0x1b5)]['set'](_0x43bb9d[_0x50d5ae(0x106)][_0x50d5ae(0x13a)],_0x19e427),_0x5e41a2[_0x50d5ae(0x125)]={'name':_0x43bb9d[_0x50d5ae(0x106)]['name'],'id':_0x19e427},_0x105633['onProgress']?.({'type':_0x50d5ae(0x1a0),'name':_0x43bb9d[_0x50d5ae(0x106)][_0x50d5ae(0x13a)],'segmentId':_0x19e427}),_0x105633['logSuccess']?.(_0x50d5ae(0x19d)+_0x43bb9d[_0x50d5ae(0x106)][_0x50d5ae(0x13a)]+'\x27'),_0x5e41a2[_0x50d5ae(0x1b2)]=0x1;}else{if(_0x43bb9d['hasChanges']){_0x105633[_0x50d5ae(0x167)]?.({'type':_0x50d5ae(0x108),'name':_0x43bb9d[_0x50d5ae(0x106)][_0x50d5ae(0x13a)]});const _0x29a749=_0x258dff(_0x19ab7c);_0x4d8d09!==_0x43bb9d[_0x50d5ae(0x129)]?.['segmentFolderId']&&(_0x29a749['segmentFolderId']=_0x4d8d09?parseInt(_0x4d8d09,0xa):undefined),await _0x105633[_0x50d5ae(0x13e)](_0x50d5ae(0x201)+_0x43bb9d[_0x50d5ae(0x106)][_0x50d5ae(0x13a)]+_0x50d5ae(0x13c),()=>_0x11e340[_0x50d5ae(0x109)][_0x50d5ae(0x124)](_0x512e96[_0x50d5ae(0x192)],_0x43bb9d['existingSegment']['id'],_0x29a749)),_0x19e427=_0x43bb9d[_0x50d5ae(0x129)]['id'],_0x105633[_0x50d5ae(0x167)]?.({'type':_0x50d5ae(0x116),'name':_0x43bb9d['yamlConfig'][_0x50d5ae(0x13a)]}),_0x105633[_0x50d5ae(0x1f3)]?.(_0x50d5ae(0x158)+_0x43bb9d['yamlConfig'][_0x50d5ae(0x13a)]+'\x27'),_0x5e41a2[_0x50d5ae(0x1a8)]=0x1;}else _0x19e427=_0x43bb9d[_0x50d5ae(0x129)]['id'];}}catch(_0x49e07e){const _0x2388c4=isHttp400Error(_0x49e07e),_0x5e295f=_0x2388c4?ErrorCode['SEGMENT_SYNTAX_ERROR']:ErrorCode['SEGMENT_UPDATE_ERROR'],_0x490df9=getErrorMessage(_0x49e07e);throw new SDKError(_0x5e295f,_0x50d5ae(0x1e8)+(_0x43bb9d[_0x50d5ae(0x1da)]?'create':_0x50d5ae(0x159))+_0x50d5ae(0x149)+_0x43bb9d[_0x50d5ae(0x10b)]+'\x0a\x20\x20'+_0x490df9,_0x49e07e);}try{const _0x7469f8=await syncActivationsForSegment(_0x11e340,_0x512e96['parentId'],_0x19e427,_0x43bb9d[_0x50d5ae(0x106)][_0x50d5ae(0x13a)],_0x43bb9d[_0x50d5ae(0x11c)],_0x105633,_0x43bb9d[_0x50d5ae(0x10b)]);_0x5e41a2[_0x50d5ae(0x1dd)]=_0x7469f8;}catch(_0x250d97){if(_0x250d97 instanceof SDKError)throw _0x250d97;throw new SDKError(ErrorCode[_0x50d5ae(0x1a6)],_0x50d5ae(0x144)+_0x43bb9d[_0x50d5ae(0x106)][_0x50d5ae(0x13a)]+_0x50d5ae(0x137)+_0x43bb9d[_0x50d5ae(0x10b)]+_0x50d5ae(0x107)+getErrorMessage(_0x250d97),_0x250d97);}return _0x5e41a2;},_0x4b0966=await batchAsync(_0x2008cb,_0x38df6a,_0x17a4f8),_0x1b6d57={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x595b7d of _0x4b0966){_0x1b6d57[_0x3a6a81(0x1b2)]+=_0x595b7d[_0x3a6a81(0x1b2)],_0x1b6d57[_0x3a6a81(0x1a8)]+=_0x595b7d[_0x3a6a81(0x1a8)],_0x595b7d[_0x3a6a81(0x125)]&&_0x1b6d57[_0x3a6a81(0x1a3)][_0x3a6a81(0x1e9)](_0x595b7d[_0x3a6a81(0x125)][_0x3a6a81(0x13a)],_0x595b7d[_0x3a6a81(0x125)]['id']),_0x1b6d57[_0x3a6a81(0x1dd)]['created']+=_0x595b7d[_0x3a6a81(0x1dd)][_0x3a6a81(0x1b2)],_0x1b6d57['activations'][_0x3a6a81(0x1a8)]+=_0x595b7d[_0x3a6a81(0x1dd)]['updated'],_0x1b6d57[_0x3a6a81(0x1dd)]['deleted']+=_0x595b7d[_0x3a6a81(0x1dd)][_0x3a6a81(0x16b)];}return _0x1b6d57;}async function syncActivationsForSegment(_0x390196,_0x547951,_0x9ebf62,_0x504165,_0x26e8ea,_0x19dfc9,_0x51a9f7){const _0x56f002=a152_0xd184d4,_0xb6414={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x249bc6 of _0x26e8ea){try{if(_0x249bc6[_0x56f002(0x1e5)]===_0x56f002(0x128)&&_0x249bc6[_0x56f002(0x1a9)])_0x19dfc9[_0x56f002(0x167)]?.({'type':_0x56f002(0x120),'segmentName':_0x504165,'activationName':_0x249bc6[_0x56f002(0x13a)]}),await _0x19dfc9[_0x56f002(0x13e)](_0x56f002(0x1ff)+_0x249bc6[_0x56f002(0x13a)]+_0x56f002(0x13c),()=>_0x390196[_0x56f002(0x109)]['createActivation'](_0x547951,_0x9ebf62,_0x249bc6[_0x56f002(0x1a9)])),_0x19dfc9[_0x56f002(0x167)]?.({'type':'activation_created','segmentName':_0x504165,'activationName':_0x249bc6[_0x56f002(0x13a)]}),_0x19dfc9[_0x56f002(0x1f3)]?.(_0x56f002(0x113)+_0x249bc6[_0x56f002(0x13a)]+'\x27'),_0xb6414[_0x56f002(0x1b2)]++;else{if(_0x249bc6['type']==='update'&&_0x249bc6[_0x56f002(0x1a9)]&&_0x249bc6[_0x56f002(0x152)])_0x19dfc9['onProgress']?.({'type':'activation_updating','segmentName':_0x504165,'activationName':_0x249bc6[_0x56f002(0x13a)]}),await _0x19dfc9['withProgress'](_0x56f002(0x1b8)+_0x249bc6['name']+_0x56f002(0x13c),()=>_0x390196[_0x56f002(0x109)][_0x56f002(0x1be)](_0x547951,_0x9ebf62,_0x249bc6['existingActivation']['id'],_0x249bc6[_0x56f002(0x1a9)])),_0x19dfc9[_0x56f002(0x167)]?.({'type':_0x56f002(0x15a),'segmentName':_0x504165,'activationName':_0x249bc6['name']}),_0x19dfc9['logSuccess']?.(_0x56f002(0x10a)+_0x249bc6['name']+'\x27'),_0xb6414[_0x56f002(0x1a8)]++;else _0x249bc6[_0x56f002(0x1e5)]==='delete'&&_0x249bc6['existingActivation']&&(_0x19dfc9[_0x56f002(0x167)]?.({'type':'activation_deleting','segmentName':_0x504165,'activationName':_0x249bc6[_0x56f002(0x13a)]}),await _0x19dfc9[_0x56f002(0x13e)](_0x56f002(0x1ad)+_0x249bc6[_0x56f002(0x13a)]+_0x56f002(0x13c),()=>_0x390196[_0x56f002(0x109)][_0x56f002(0x1c3)](_0x547951,_0x9ebf62,_0x249bc6[_0x56f002(0x152)]['id'])),_0x19dfc9[_0x56f002(0x167)]?.({'type':_0x56f002(0x16e),'segmentName':_0x504165,'activationName':_0x249bc6[_0x56f002(0x13a)]}),_0x19dfc9[_0x56f002(0x170)]?.('Deleted\x20activation\x20\x27'+_0x249bc6[_0x56f002(0x13a)]+'\x27'),_0xb6414[_0x56f002(0x16b)]++);}}catch(_0x4ff354){const _0x3ad8f1=isHttp400Error(_0x4ff354),_0x956302=_0x3ad8f1?ErrorCode[_0x56f002(0x156)]:ErrorCode[_0x56f002(0x1a6)],_0x2d805a=getErrorMessage(_0x4ff354);throw new SDKError(_0x956302,_0x56f002(0x1e8)+_0x249bc6[_0x56f002(0x1e5)]+_0x56f002(0x118)+_0x249bc6['name']+_0x56f002(0x137)+_0x51a9f7+_0x56f002(0x107)+_0x2d805a,_0x4ff354);}}return _0xb6414;}export async function executePushFolders(_0x1e6aca,_0x235dd1,_0x26115d,_0x5f4a02,_0x10bf3c){const _0x2850f7=a152_0xd184d4,_0x4d3c72=new Map(_0x26115d),_0xbf76dd=sortFoldersByDepth(_0x235dd1);for(const _0x5c4c4a of _0xbf76dd){const _0x31af12=_0x5c4c4a[_0x2850f7(0x1f7)]('/'),_0x384356=_0x31af12[_0x31af12[_0x2850f7(0x169)]-0x1],_0x312ba2=_0x31af12['slice'](0x0,-0x1)[_0x2850f7(0x13b)]('/'),_0x25cc02=_0x4d3c72[_0x2850f7(0x181)](_0x312ba2);_0x10bf3c['onProgress']?.({'type':_0x2850f7(0x174),'folder':_0x5c4c4a});const _0x1433b9={'name':_0x384356,'parentFolderId':_0x25cc02},_0x28c54c=await _0x10bf3c[_0x2850f7(0x13e)](_0x2850f7(0x141)+_0x5c4c4a+_0x2850f7(0x13c),()=>_0x1e6aca[_0x2850f7(0x109)]['createFolder'](_0x5f4a02['parentId'],_0x1433b9));_0x4d3c72[_0x2850f7(0x1e9)](_0x5c4c4a,_0x28c54c['data']['id']),_0x10bf3c[_0x2850f7(0x167)]?.({'type':'folder_created','folder':_0x5c4c4a,'folderId':_0x28c54c[_0x2850f7(0x114)]['id']}),_0x10bf3c[_0x2850f7(0x1f9)]?.(_0x2850f7(0x1cc)+_0x5c4c4a+'\x27');}return _0x4d3c72;}export async function executePushSegmentDeletions(_0x390f93,_0x5f027e,_0x672a6a){const _0x4dd317=a152_0xd184d4;if(_0x5f027e[_0x4dd317(0x169)]===0x0)return 0x0;const {batchAsync:_0xab4ecc}=await import(_0x4dd317(0x132)),_0x18ab31=0x5,_0x2cf664=await _0xab4ecc(_0x5f027e,async _0x4014e0=>{const _0x194f25=_0x4dd317;return _0x672a6a[_0x194f25(0x167)]?.({'type':_0x194f25(0x186),'name':_0x4014e0[_0x194f25(0x13a)]}),await _0x390f93['segment'][_0x194f25(0x147)](_0x4014e0['id']),_0x672a6a['onProgress']?.({'type':_0x194f25(0x1aa),'name':_0x4014e0['name']}),_0x672a6a[_0x194f25(0x170)]?.(_0x194f25(0x1bf)+_0x4014e0[_0x194f25(0x13a)]+'\x27'),0x1;},_0x18ab31);return _0x2cf664[_0x4dd317(0x145)]((_0x1615d3,_0x1d4cef)=>_0x1615d3+_0x1d4cef,0x0);}export async function executePushJourneys(_0x16a9ca,_0xb28120,_0x5694c6,_0x627012,_0x3573fb){const _0x3e2668=a152_0xd184d4,{journeyDefToRequest:_0x1fe269}=await import(_0x3e2668(0x204)),{activationDefToCreateRequest:_0x45368f,yamlRuleToApi:_0x20c9c4,validateSegmentRule:_0x1bf686}=await import(_0x3e2668(0x1cd)),_0x4ca4e7={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x196f38=new Map(_0x5694c6[_0x3e2668(0x1b5)]),_0x267981=0x5;for(let _0x17249a=0x0;_0x17249a<_0xb28120[_0x3e2668(0x169)];_0x17249a+=_0x267981){const _0x4a6991=_0xb28120[_0x3e2668(0x175)](_0x17249a,_0x17249a+_0x267981),_0x2a2932=await Promise['all'](_0x4a6991[_0x3e2668(0x1b6)](async _0x1a57c9=>{const _0x47c9ea=_0x3e2668;if(!_0x1a57c9[_0x47c9ea(0x1da)]&&!_0x1a57c9[_0x47c9ea(0x1d2)])return{'action':_0x47c9ea(0x103),'name':_0x1a57c9[_0x47c9ea(0x106)][_0x47c9ea(0x13a)],'journeyId':_0x1a57c9[_0x47c9ea(0x1e3)]?.['id']};const _0x5deeee=_0x1a57c9[_0x47c9ea(0x1cb)]?_0x5694c6[_0x47c9ea(0x1c4)][_0x47c9ea(0x181)](_0x1a57c9[_0x47c9ea(0x1cb)]):undefined;_0x3573fb[_0x47c9ea(0x167)]?.({'type':_0x1a57c9[_0x47c9ea(0x1da)]?_0x47c9ea(0x1ef):_0x47c9ea(0x17b),'name':_0x1a57c9['yamlConfig'][_0x47c9ea(0x13a)]});try{const _0x7260a=await executeSingleJourneyPush(_0x16a9ca,_0x1a57c9,{..._0x5694c6,'segmentNameToId':_0x196f38},{'parentId':_0x627012[_0x47c9ea(0x192)],'rootFolderId':_0x627012[_0x47c9ea(0x1e2)],'folderId':_0x5deeee,'verbose':_0x627012['verbose']},_0x3573fb,{'journeyDefToRequest':_0x1fe269,'activationDefToCreateRequest':_0x45368f,'yamlRuleToApi':_0x20c9c4,'validateSegmentRule':_0x1bf686});for(const [_0x581e80,_0x4e8717]of _0x7260a[_0x47c9ea(0x1c9)]){_0x196f38['set'](_0x581e80,_0x4e8717),_0x4ca4e7[_0x47c9ea(0x1c9)]['set'](_0x581e80,_0x4e8717);}if(_0x7260a['action']===_0x47c9ea(0x1b2))_0x3573fb[_0x47c9ea(0x167)]?.({'type':_0x47c9ea(0x143),'name':_0x1a57c9[_0x47c9ea(0x106)]['name'],'journeyId':_0x7260a[_0x47c9ea(0x1ee)]}),_0x3573fb[_0x47c9ea(0x1f3)]?.(_0x47c9ea(0x184)+_0x1a57c9[_0x47c9ea(0x106)][_0x47c9ea(0x13a)]+'\x27'),_0x4ca4e7['created']++;else _0x7260a['action']===_0x47c9ea(0x1a8)&&(_0x3573fb[_0x47c9ea(0x167)]?.({'type':_0x47c9ea(0x19e),'name':_0x1a57c9['yamlConfig'][_0x47c9ea(0x13a)]}),_0x3573fb[_0x47c9ea(0x1f3)]?.(_0x47c9ea(0x127)+_0x1a57c9['yamlConfig'][_0x47c9ea(0x13a)]+'\x27'),_0x4ca4e7[_0x47c9ea(0x1a8)]++);return{'action':_0x7260a[_0x47c9ea(0x18b)],'name':_0x1a57c9[_0x47c9ea(0x106)][_0x47c9ea(0x13a)],'journeyId':_0x7260a[_0x47c9ea(0x1ee)]};}catch(_0x29b1d8){const _0x1f2a53=isHttp400Error(_0x29b1d8),_0x2e2ab7=_0x1f2a53?ErrorCode[_0x47c9ea(0x173)]:ErrorCode[_0x47c9ea(0x197)],_0x39d632=getErrorMessage(_0x29b1d8);throw new SDKError(_0x2e2ab7,'Failed\x20to\x20'+(_0x1a57c9['isNew']?'create':_0x47c9ea(0x159))+'\x20journey\x20from\x20file:\x20'+_0x1a57c9[_0x47c9ea(0x10b)]+'\x0a\x20\x20'+_0x39d632,_0x29b1d8);}}));_0x4ca4e7[_0x3e2668(0x16a)][_0x3e2668(0x1f4)](..._0x2a2932);}return _0x4ca4e7;}async function matchExistingJourneySegments(_0x4cf040,_0x5d9d2d,_0x591d8d,_0x2aa1b2,_0x1cb24){const _0x54214f=a152_0xd184d4;if(!_0x5d9d2d[_0x54214f(0x1e3)]||!_0x5d9d2d[_0x54214f(0x106)][_0x54214f(0x17e)])return;const _0x5cb616=new Map(),_0x6eded0=new Set();for(const _0x539311 of Object[_0x54214f(0x1a2)](_0x5d9d2d[_0x54214f(0x106)][_0x54214f(0x17e)])){const _0x815db7=generateDeterministicJourneySegmentName(_0x5d9d2d[_0x54214f(0x106)]['name'],_0x539311);_0x5cb616[_0x54214f(0x1e9)](_0x815db7,_0x539311),_0x6eded0[_0x54214f(0x1e4)](_0x539311);}const _0x4893df=[],_0x1c0b7b=collectSegmentIdsFromJourneyApi(_0x5d9d2d[_0x54214f(0x1e3)]);for(const _0x1f710a of _0x1c0b7b){const _0x36a14f=await fetchSegment(_0x4cf040,_0x591d8d,_0x1f710a,_0x2aa1b2);if(!_0x36a14f?.[_0x54214f(0x13a)])continue;const _0x584e03=_0x5cb616['get'](_0x36a14f[_0x54214f(0x13a)]);_0x584e03?(_0x1cb24[_0x54214f(0x1e9)](_0x584e03,_0x1f710a),_0x6eded0['delete'](_0x584e03)):_0x4893df[_0x54214f(0x1f4)]({'id':_0x1f710a,'seg':_0x36a14f});}if(_0x6eded0[_0x54214f(0x1e7)]>0x0&&_0x4893df[_0x54214f(0x169)]>0x0){const {localExpandedRuleToNames:_0x395f11}=buildLocalExpandedRuleMappings(_0x5d9d2d[_0x54214f(0x106)]),_0x393735=new Map();for(const {id:_0xbeb679,seg:_0x52abe6}of _0x4893df){if(_0x52abe6['rule']){const _0x1485e3=apiRuleToYaml(_0x52abe6[_0x54214f(0x202)]);_0x393735['set'](_0xbeb679,_0x1485e3);}}for(const {id:_0x34e76a,seg:_0x5dbde1}of _0x4893df){if(!_0x5dbde1['rule'])continue;const _0x4e688d=_0x393735[_0x54214f(0x181)](_0x34e76a);if(!_0x4e688d)continue;const _0x1f06e7=serializeExpandedRule(_0x4e688d,_0x393735),_0x599262=_0x395f11['get'](_0x1f06e7);if(_0x599262){const _0x2c5fca=_0x599262[_0x54214f(0x179)](_0xdd4156=>_0x6eded0[_0x54214f(0x18e)](_0xdd4156));_0x2c5fca&&(_0x1cb24[_0x54214f(0x1e9)](_0x2c5fca,_0x34e76a),_0x6eded0[_0x54214f(0x1b4)](_0x2c5fca),logger[_0x54214f(0x17c)]('Matched\x20server\x20segment\x20\x27'+_0x5dbde1[_0x54214f(0x13a)]+'\x27\x20to\x20local\x20\x27'+_0x2c5fca+'\x27\x20by\x20rule\x20content'));}}}}async function executeSingleJourneyPush(_0x4a2454,_0x424962,_0x5db0d3,_0x483355,_0x5eb053,_0x43abda){const _0x31f72c=a152_0xd184d4,{journeyDefToRequest:_0x4f0860,activationDefToCreateRequest:_0x56e4f6,yamlRuleToApi:_0x52a130,validateSegmentRule:_0x230770}=_0x43abda,_0x1c7e1d=new Map(),_0x549b9f=new Map();recoverSegmentIdsFromPushRecovery(_0x424962,_0x1c7e1d,_0x5db0d3[_0x31f72c(0x1b5)]);const _0x4d249e=new Map(),_0x4b7eb0=new Map(),_0x50508f=new Map();let _0xb6ade0;const _0x4cf3e1=async()=>{const _0x313d94=_0x31f72c;if(_0xb6ade0)return;_0xb6ade0=new Map();if(!_0x424962['existingJourney'])return;const _0x4e32ac=await _0x4a2454[_0x313d94(0x1d4)][_0x313d94(0x133)](_0x424962[_0x313d94(0x1e3)]['id']);for(const _0x2d55de of _0x4e32ac){const _0x208c9c=journeyActivationStepToYaml(_0x2d55de,_0x5db0d3[_0x313d94(0x12c)],_0x5db0d3[_0x313d94(0x12e)]),_0x164fab=activationSignature(_0x208c9c);!_0xb6ade0['has'](_0x164fab)&&_0xb6ade0[_0x313d94(0x1e9)](_0x164fab,_0x2d55de['id']),_0x208c9c[_0x313d94(0x13a)]&&_0x549b9f[_0x313d94(0x1e9)](_0x208c9c[_0x313d94(0x13a)],_0x2d55de['id']);}};await matchExistingJourneySegments(_0x4a2454,_0x424962,_0x483355[_0x31f72c(0x192)],_0x5db0d3[_0x31f72c(0x140)],_0x5db0d3[_0x31f72c(0x1b5)]);const _0x5c068e={'resolveSegmentId':async _0x363e33=>{const _0x5ed6f4=_0x31f72c,_0x5647bd=_0x5db0d3[_0x5ed6f4(0x1b5)][_0x5ed6f4(0x181)](_0x363e33);if(!_0x5647bd)throw new SDKError(ErrorCode[_0x5ed6f4(0x1d3)],'Segment\x20not\x20found:\x20'+_0x363e33+_0x5ed6f4(0x190)+_0x424962[_0x5ed6f4(0x106)][_0x5ed6f4(0x13a)]+')');return _0x5647bd;},'resolveEmbeddedSegmentId':async(_0x55a64d,_0x1d525b)=>{const _0x431820=_0x31f72c,_0x515030=_0x5db0d3['segmentNameToId'][_0x431820(0x181)](_0x55a64d);if(_0x515030)return _0x515030;const _0x591cb9=_0x5db0d3['existingSegments']['find'](_0x2fae0d=>_0x2fae0d['name']===_0x55a64d);if(_0x591cb9)return _0x5db0d3[_0x431820(0x1b5)][_0x431820(0x1e9)](_0x55a64d,_0x591cb9['id']),_0x591cb9['id'];if(_0x424962[_0x431820(0x1da)]){const {stageName:_0x46b74a,criteriaName:_0x18e80c}=findSegmentCriteriaLocation(_0x424962[_0x431820(0x106)],_0x55a64d);return _0x230770(_0x55a64d,_0x1d525b[_0x431820(0x202)]),_0x4b7eb0['set'](_0x55a64d,{'definition':_0x1d525b,'stageName':_0x46b74a,'criteriaName':_0x18e80c}),createPendingSegmentId(_0x55a64d);}const _0x22b0e7=_0x424962[_0x431820(0x1e3)]?.['id'];if(!_0x22b0e7)throw new SDKError(ErrorCode[_0x431820(0x15d)],_0x431820(0x1d5));const _0xa09ef4=_0x4d249e['get'](_0x55a64d);if(_0xa09ef4)return _0xa09ef4;const _0x40c4ee=((async()=>{const _0x557ef5=_0x431820;_0x230770(_0x55a64d,_0x1d525b[_0x557ef5(0x202)]);const _0x15f74d=generateDeterministicJourneySegmentName(_0x424962[_0x557ef5(0x106)][_0x557ef5(0x13a)],_0x55a64d),_0x236c3c=_0x5db0d3[_0x557ef5(0x140)][_0x557ef5(0x179)](_0x352818=>_0x352818[_0x557ef5(0x13a)]===_0x15f74d),_0x39bec4=createSegmentIdResolver(_0x5db0d3['segmentNameToId'],_0x55a64d),_0x55cd4d=await resolveRuleSegmentIds(_0x1d525b[_0x557ef5(0x202)],_0x39bec4);let _0x327b97;return _0x236c3c?(await _0x4a2454[_0x557ef5(0x109)][_0x557ef5(0x124)](_0x483355['parentId'],_0x236c3c['id'],{'description':_0x1d525b[_0x557ef5(0x168)]||'Entry\x20criteria:\x20'+_0x55a64d,'rule':_0x52a130(_0x55cd4d),'countPopulation':!![]}),_0x327b97=_0x236c3c['id'],saveSegmentToPushRecovery(_0x424962[_0x557ef5(0x10b)],_0x424962['yamlConfig']['name'],_0x55a64d,{'segmentId':_0x327b97,'uniqueServerName':_0x15f74d,'createdAt':new Date()[_0x557ef5(0x15f)]()})):_0x327b97=await createOrRecoverEmbeddedSegment(_0x4a2454,_0x424962,{'localName':_0x55a64d,'uniqueSegmentName':_0x15f74d,'description':_0x1d525b[_0x557ef5(0x168)]||_0x557ef5(0x1a1)+_0x55a64d,'journeyId':_0x22b0e7,'resolvedRule':_0x55cd4d,'parentId':_0x483355[_0x557ef5(0x192)],'folderId':_0x483355['rootFolderId']||''},_0x52a130),_0x5db0d3[_0x557ef5(0x1b5)]['set'](_0x55a64d,_0x327b97),_0x1c7e1d[_0x557ef5(0x1e9)](_0x55a64d,_0x327b97),_0x327b97;})());_0x4d249e[_0x431820(0x1e9)](_0x55a64d,_0x40c4ee);try{return await _0x40c4ee;}finally{_0x4d249e['delete'](_0x55a64d);}},'resolveActivationId':async _0x2cd766=>{const _0x2c6c57=_0x31f72c,_0x22e73e=_0x549b9f[_0x2c6c57(0x181)](_0x2cd766);if(_0x22e73e)return _0x22e73e;if(_0x424962[_0x2c6c57(0x1e3)]){await _0x4cf3e1();const _0x1a9680=_0x549b9f[_0x2c6c57(0x181)](_0x2cd766);if(_0x1a9680)return _0x1a9680;}throw new SDKError(ErrorCode['NOT_FOUND'],_0x2c6c57(0x12b)+_0x2cd766+_0x2c6c57(0x190)+_0x424962[_0x2c6c57(0x106)]['name']+_0x2c6c57(0x1e0)+_0x2c6c57(0x1eb));},'resolveEmbeddedActivationId':async(_0x279269,_0x24ebba)=>{const _0x47f4c4=_0x31f72c,_0x3c6fe6=_0x549b9f[_0x47f4c4(0x181)](_0x279269);if(_0x3c6fe6)return _0x3c6fe6;if(_0x424962[_0x47f4c4(0x1da)])return _0x50508f[_0x47f4c4(0x1e9)](_0x279269,_0x24ebba),createPendingActivationId(_0x279269);if(_0x424962[_0x47f4c4(0x1e3)]){await _0x4cf3e1();const _0x2a0a73=_0x549b9f[_0x47f4c4(0x181)](_0x24ebba[_0x47f4c4(0x13a)]);if(_0x2a0a73)return _0x549b9f[_0x47f4c4(0x1e9)](_0x279269,_0x2a0a73),_0x2a0a73;const _0x1c5398=activationSignature(_0x24ebba),_0x5eb017=_0xb6ade0?.[_0x47f4c4(0x181)](_0x1c5398);if(_0x5eb017)return _0x549b9f['set'](_0x279269,_0x5eb017),_0x5eb017;const _0x3f66d8=await _0x56e4f6(_0x24ebba,_0x5db0d3[_0x47f4c4(0x1bc)]),_0x248f1b={..._0x3f66d8,..._0x24ebba[_0x47f4c4(0x153)]!==undefined&&{'runAfterJourneyRefresh':_0x24ebba['run_after_journey_refresh']}},_0x1827ca=await _0x4a2454[_0x47f4c4(0x1d4)][_0x47f4c4(0x209)](_0x424962[_0x47f4c4(0x1e3)]['id'],_0x248f1b);return _0x549b9f['set'](_0x279269,_0x1827ca['id']),_0x1827ca['id'];}throw new SDKError(ErrorCode[_0x47f4c4(0x15d)],_0x47f4c4(0x122));},'resolveJourneyId':async _0x3ae68f=>{const _0x570e6e=_0x31f72c;try{return await _0x4a2454[_0x570e6e(0x1d4)]['resolveJourneyId'](_0x483355[_0x570e6e(0x192)],_0x3ae68f);}catch(_0x28bb98){throw new SDKError(ErrorCode[_0x570e6e(0x1c0)],_0x570e6e(0x1c7)+_0x3ae68f+_0x570e6e(0x17f)+_0x424962[_0x570e6e(0x106)][_0x570e6e(0x13a)]+'\x27)',_0x28bb98);}},'resolveStageId':async(_0x359f90,_0x22f14e)=>{const _0xf4d9b6=_0x31f72c,_0x5e409f=await _0x4a2454[_0xf4d9b6(0x1d4)][_0xf4d9b6(0x198)](_0x359f90),_0x2555dd=_0x5e409f[_0xf4d9b6(0x171)][_0xf4d9b6(0x131)][_0xf4d9b6(0x179)](_0x5bc8d2=>_0x5bc8d2['name'][_0xf4d9b6(0x12f)]()===_0x22f14e[_0xf4d9b6(0x12f)]());if(!_0x2555dd?.['id'])throw new SDKError(ErrorCode[_0xf4d9b6(0x1c0)],_0xf4d9b6(0x130)+_0x22f14e+_0xf4d9b6(0x1fe)+(_0x5e409f[_0xf4d9b6(0x171)][_0xf4d9b6(0x1a4)]||_0x5e409f[_0xf4d9b6(0x171)]['name'])+'\x27');return _0x2555dd['id'];}},_0x366bd7=await _0x4f0860(_0x424962[_0x31f72c(0x106)],_0x483355[_0x31f72c(0x192)],_0x5c068e),_0x436501=_0x483355['folderId']||_0x483355[_0x31f72c(0x1e2)];_0x436501&&(_0x366bd7[_0x31f72c(0x1b1)]={'parentFolder':{'data':{'id':_0x436501,'type':_0x31f72c(0x1db)}}});if(_0x424962['isNew']){if(_0x4b7eb0['size']>0x0||_0x50508f['size']>0x0)return await executeThreeStepJourneyCreate(_0x4a2454,_0x424962,_0x366bd7,{'pendingEmbeddedSegments':_0x4b7eb0,'pendingEmbeddedActivations':_0x50508f,'embeddedSegmentNameToId':_0x1c7e1d,'journeyActivationNameToId':_0x549b9f},{..._0x483355,'effectiveFolderId':_0x436501},_0x5db0d3,_0x5eb053,_0x43abda);else{ensureJourneyDefaults(_0x366bd7[_0x31f72c(0x171)]);const _0x2d4cbc=await _0x4a2454[_0x31f72c(0x1d4)]['create'](_0x366bd7);return deletePushRecovery(_0x424962[_0x31f72c(0x10b)]),{'action':_0x31f72c(0x1b2),'journeyId':_0x2d4cbc['id'],'embeddedSegmentNameToId':_0x1c7e1d};}}else{if(_0x424962[_0x31f72c(0x1d2)]&&_0x424962['existingJourney']){_0x366bd7['id']=_0x424962[_0x31f72c(0x1e3)]['id'];const _0x5b35ff=_0x366bd7[_0x31f72c(0x171)];_0x424962['existingJourney']['attributes']?.[_0x31f72c(0x1a4)]&&(_0x5b35ff['journeyBundleName']=_0x424962[_0x31f72c(0x1e3)][_0x31f72c(0x171)][_0x31f72c(0x1a4)]);const _0x13b51a=_0x424962['existingJourney'][_0x31f72c(0x171)]?.[_0x31f72c(0x131)];return _0x13b51a&&_0x366bd7[_0x31f72c(0x171)]['journeyStages']&&injectExistingStageIds(_0x366bd7[_0x31f72c(0x171)]['journeyStages'],_0x13b51a),ensureJourneyDefaults(_0x5b35ff),await _0x4a2454[_0x31f72c(0x1d4)][_0x31f72c(0x159)](_0x424962[_0x31f72c(0x1e3)]['id'],_0x366bd7),deletePushRecovery(_0x424962['absolutePath']),{'action':_0x31f72c(0x1a8),'journeyId':_0x424962['existingJourney']['id'],'embeddedSegmentNameToId':_0x1c7e1d};}}return deletePushRecovery(_0x424962[_0x31f72c(0x10b)]),{'action':_0x31f72c(0x103),'journeyId':_0x424962[_0x31f72c(0x1e3)]?.['id'],'embeddedSegmentNameToId':_0x1c7e1d};}function findSegmentCriteriaLocation(_0x5ea51d,_0x1a7c46){const _0x1844b4=a152_0xd184d4,_0x462f3f=_0x5ea51d[_0x1844b4(0x110)]||_0x5ea51d[_0x1844b4(0x1a7)]?.[0x0]?.[_0x1844b4(0x110)]||[];let _0x17253f=_0x1844b4(0x12d),_0xc5ace=_0x1a7c46;const _0x65c30a=_0x5ea51d['goal']||_0x5ea51d[_0x1844b4(0x1a7)]?.[0x0]?.[_0x1844b4(0x1f0)];if(_0x65c30a?.['segment']===_0x1a7c46)return{'stageName':_0x1844b4(0x1f0),'criteriaName':_0x65c30a['name']||_0x1a7c46};_0x51b577:for(const _0x1c10f0 of _0x462f3f){if(_0x1c10f0[_0x1844b4(0x117)]?.[_0x1844b4(0x109)]===_0x1a7c46){_0x17253f=_0x1c10f0[_0x1844b4(0x13a)],_0xc5ace=_0x1c10f0[_0x1844b4(0x117)][_0x1844b4(0x13a)]||_0x1a7c46;break;}if(_0x1c10f0[_0x1844b4(0x14d)])for(const _0x2ae9a3 of _0x1c10f0[_0x1844b4(0x14d)]){if(_0x2ae9a3[_0x1844b4(0x1e5)]===_0x1844b4(0x14a)&&_0x2ae9a3[_0x1844b4(0x164)]?.[_0x1844b4(0x196)])for(const _0x36d023 of _0x2ae9a3[_0x1844b4(0x164)][_0x1844b4(0x196)]){if(_0x36d023['segment']===_0x1a7c46){_0x17253f=_0x1c10f0[_0x1844b4(0x13a)],_0xc5ace=_0x36d023[_0x1844b4(0x13a)]||_0x1a7c46;break _0x51b577;}}}}return{'stageName':_0x17253f,'criteriaName':_0xc5ace};}async function executeThreeStepJourneyCreate(_0x428729,_0x373b10,_0x5dcc0f,_0xdfaba,_0x5b8c01,_0x4a3416,_0x464907,_0x4792dc){const _0x4fe394=a152_0xd184d4,{activationDefToCreateRequest:_0x278e4a,yamlRuleToApi:_0x1c1c3c}=_0x4792dc,{pendingEmbeddedSegments:_0x385f20,pendingEmbeddedActivations:_0x591144,embeddedSegmentNameToId:_0xdb4e1d}=_0xdfaba,_0x5f2bd5=JSON[_0x4fe394(0x111)](JSON[_0x4fe394(0x142)](_0x5dcc0f));ensureJourneyDefaults(_0x5f2bd5[_0x4fe394(0x171)]),stripPendingIds(_0x5f2bd5);const _0x3f3df0=await _0x428729[_0x4fe394(0x1d4)][_0x4fe394(0x128)](_0x5f2bd5),_0x396783=_0x3f3df0['id'],_0x275c16=new Map();for(const _0xe2c5c6 of _0x3f3df0[_0x4fe394(0x171)][_0x4fe394(0x131)]){_0x275c16[_0x4fe394(0x1e9)](_0xe2c5c6[_0x4fe394(0x13a)][_0x4fe394(0x12f)](),_0xe2c5c6['id']);}recoverSegmentIdsFromPushRecovery(_0x373b10,_0xdb4e1d,_0x4a3416[_0x4fe394(0x1b5)]);for(const [_0x17bd56,{definition:_0xb127ae}]of _0x385f20){if(_0xdb4e1d[_0x4fe394(0x18e)](_0x17bd56)){_0x464907['onProgress']?.({'type':'embedded_segment_created','journeyName':_0x373b10['yamlConfig'][_0x4fe394(0x13a)],'segmentName':_0x17bd56});continue;}const _0x9b52de=generateDeterministicJourneySegmentName(_0x373b10['yamlConfig'][_0x4fe394(0x13a)],_0x17bd56);_0x464907[_0x4fe394(0x167)]?.({'type':_0x4fe394(0x16c),'journeyName':_0x373b10[_0x4fe394(0x106)]['name'],'segmentName':_0x17bd56});const _0x5c3398=createSegmentIdResolver(_0x4a3416[_0x4fe394(0x1b5)],_0x17bd56),_0x2118a5=await resolveRuleSegmentIds(_0xb127ae[_0x4fe394(0x202)],_0x5c3398),_0x151348=await createOrRecoverEmbeddedSegment(_0x428729,_0x373b10,{'localName':_0x17bd56,'uniqueSegmentName':_0x9b52de,'description':_0xb127ae['description']||_0x4fe394(0x1a1)+_0x17bd56,'journeyId':_0x396783,'resolvedRule':_0x2118a5,'parentId':_0x5b8c01[_0x4fe394(0x192)],'folderId':_0x5b8c01['effectiveFolderId']||''},_0x1c1c3c);_0xdb4e1d[_0x4fe394(0x1e9)](_0x17bd56,_0x151348),_0x4a3416[_0x4fe394(0x1b5)][_0x4fe394(0x1e9)](_0x17bd56,_0x151348),_0x464907[_0x4fe394(0x167)]?.({'type':_0x4fe394(0x15b),'journeyName':_0x373b10[_0x4fe394(0x106)][_0x4fe394(0x13a)],'segmentName':_0x17bd56});}const _0x77ba05=new Map();for(const [_0x4bde27,_0x12d130]of _0x591144){_0x464907['onProgress']?.({'type':'embedded_activation_creating','journeyName':_0x373b10[_0x4fe394(0x106)][_0x4fe394(0x13a)],'activationName':_0x4bde27});const _0x2eb684=await _0x278e4a(_0x12d130,_0x4a3416[_0x4fe394(0x1bc)]),_0x2d1a00={..._0x2eb684,..._0x12d130[_0x4fe394(0x153)]!==undefined&&{'runAfterJourneyRefresh':_0x12d130['run_after_journey_refresh']}},_0x30a56c=await _0x428729[_0x4fe394(0x1d4)][_0x4fe394(0x209)](_0x396783,_0x2d1a00);_0x77ba05[_0x4fe394(0x1e9)](_0x4bde27,_0x30a56c['id']),_0xdfaba[_0x4fe394(0x1b0)][_0x4fe394(0x1e9)](_0x4bde27,_0x30a56c['id']),_0x464907['onProgress']?.({'type':_0x4fe394(0x208),'journeyName':_0x373b10[_0x4fe394(0x106)][_0x4fe394(0x13a)],'activationName':_0x4bde27});}const _0x1503c2=JSON['parse'](JSON[_0x4fe394(0x142)](_0x5dcc0f));return _0x1503c2['id']=_0x396783,ensureJourneyDefaults(_0x1503c2[_0x4fe394(0x171)]),resolvePendingIdsInRequest(_0x1503c2,_0x5dcc0f,_0x275c16,_0xdb4e1d,_0x77ba05,_0x464907),await _0x428729[_0x4fe394(0x1d4)][_0x4fe394(0x159)](_0x396783,_0x1503c2),deletePushRecovery(_0x373b10[_0x4fe394(0x10b)]),{'action':_0x4fe394(0x1b2),'journeyId':_0x396783,'embeddedSegmentNameToId':_0xdb4e1d};}export function stripWaitStepPendingIds(_0xbc464a){const _0x420ff2=a152_0xd184d4,_0x37c292=_0xbc464a['conditionSegmentId']&&isPendingSegmentId(_0xbc464a[_0x420ff2(0x14f)]),_0x597144=_0xbc464a[_0x420ff2(0x138)]?.[_0x420ff2(0x166)](_0x54eade=>_0x54eade['segmentId']&&isPendingSegmentId(_0x54eade[_0x420ff2(0x18c)]));(_0x37c292||_0x597144)&&(_0xbc464a[_0x420ff2(0x1e6)]=_0x420ff2(0x176),_0xbc464a[_0x420ff2(0x119)]=0x1,_0xbc464a[_0x420ff2(0x191)]=_0x420ff2(0x1ec),delete _0xbc464a[_0x420ff2(0x14f)],delete _0xbc464a['conditionTimeoutDuration'],delete _0xbc464a[_0x420ff2(0x15e)],delete _0xbc464a[_0x420ff2(0x138)]);}function a152_0x3907(){const _0x14cbd3=['filter','Delete\x20the\x20push\x20recovery\x20file\x20(','embedded_activation_created','createActivation','includes','unchanged','124326SyiXYS','segmentByFolderAndName','yamlConfig','\x0a\x20\x20','segment_updating','segment','Updated\x20activation\x20\x27','absolutePath','draft','Activation','activationStepsById','journeyBundleId','stages','parse','max','Created\x20activation\x20\x27','data','stage\x20\x27','segment_updated','entry_criteria','\x20activation\x20\x27','waitStep','connection','1114320QhxsMn','activationActions','schedule','digest','265406YpAOJr','activation_creating','all','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','getActivation','updateSegmentById','createdSegmentId','__pending_','Updated\x20journey\x20\x27','create','existingSegment','startsWith','Activation\x20not\x20found:\x20','idToEmailMap','entry','connectionIdToNameMap','toLowerCase','Stage\x20\x27','journeyStages','../../utils/async.js','listActivations','conditionTimeoutDuration','sha1','index','\x27\x20from\x20file:\x20','conditions','state','name','join','\x27...','getSegment','withProgress','skipSegments','existingSegments','Creating\x20folder\x20\x27','stringify','journey_created','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','reduce','deps','deleteSegment','getLatestJourneyId','\x20segment\x20from\x20file:\x20','decision_point','idToName','activation_template_id','steps','all_columns','conditionSegmentId','30964RkHmDS','Name\x20has\x20already\x20been\x20taken','existingActivation','run_after_journey_refresh','trim','journeyBundlesByFolderAndName','ACTIVATION_SYNTAX_ERROR','milestone','Updated\x20segment\x20\x27','update','activation_updated','embedded_segment_created','item','INTERNAL','conditionTimeoutUnit','toISOString','segmentFolderId','SEGMENT_UPDATE_ERROR','entryCriteria','dirname','with','logWarning','some','onProgress','description','length','results','deleted','embedded_segment_creating','yamlActivation','activation_deleted','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','logDeleted','attributes','\x27\x20milestone','JOURNEY_SYNTAX_ERROR','folder_creating','slice','Duration','match','Condition','find','.$1.push-recovery.json','journey_updating','debug','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','segments','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','Failed\x20to\x20resolve\x20segment\x20','get','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','\x27\x20decision\x20point\x20branch\x20\x27','Created\x20journey\x20\x27','\x27\x20exit\x20criteria','segment_deleting','exitCriterias','getSegmentEntity','message','journeyActivationStepId','action','segmentId','sort','has','Embedded\x20segment\x20\x27','\x20(referenced\x20in\x20journey\x20','waitStepUnit','parentId','3774570YuBdnS','uniqueServerName','parseDocument','branches','JOURNEY_UPDATE_ERROR','getJourney','from','folderId','activationParams','diff','Created\x20segment\x20\x27','journey_updated','createSegment','segment_created','Entry\x20criteria:\x20','keys','createdSegmentIds','journeyBundleName','uniqueSegmentName','ACTIVATION_UPDATE_ERROR','journeys','updated','validatedRequest','segment_deleted','journeyName','\x27\x20entry\x20criteria','Deleting\x20activation\x20\x27','192QWjvoo','journeyById','journeyActivationNameToId','relationships','created','Failed\x20to\x20fetch\x20referenced\x20segment\x20','delete','segmentNameToId','map','14027562lpRiZl','Updating\x20activation\x20\x27','resolvedRule','null','isArray','activationContext','flatMap','updateActivation','Deleted\x20segment\x20\x27','NOT_FOUND','DecisionPoint','replace','deleteActivation','folderPathToId','resolveSegment','notification','Journey\x20\x27','versionNumber','embeddedSegmentNameToId','fetchJourney','folderPath','Created\x20folder\x20\x27','./child-segment-yaml.js','getSegmentEntity\x20also\x20failed\x20for\x20','):\x20','Fetching\x20','object','hasChanges','SEGMENT_NOT_FOUND','journey','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','351yHDKUZ','185619OcmzpY','\x27\x20for\x20','__pending_act_','isNew','folder','Segment\x20not\x20found:\x20','activations','segment_creating',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20',').\x20','user','rootFolderId','existingJourney','add','type','waitStepType','size','Failed\x20to\x20','set','utf-8','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','day','hex','journeyId','journey_creating','goal','entries','errors','logSuccess','push','toString','parentSegmentFolder','split','behavior','logInfo','valid','\x27\x20wait\x20condition','progress','kind','\x27\x20not\x20found\x20in\x20journey\x20\x27','Creating\x20activation\x20\x27','WaitStep','Updating\x20segment\x20\x27','rule','values','./journey-yaml.js','localName'];a152_0x3907=function(){return _0x14cbd3;};return a152_0x3907();}export function resolveWaitStepPendingIds(_0x488fa9,_0xd6aa1f,_0x1bac2a,_0x5b48e0){const _0x218645=a152_0xd184d4;if(_0xd6aa1f[_0x218645(0x14f)]&&isPendingSegmentId(_0xd6aa1f[_0x218645(0x14f)])){const _0x462e23=_0x1bac2a(_0xd6aa1f[_0x218645(0x14f)],_0x218645(0x115)+_0x5b48e0+'\x27\x20wait\x20condition');_0x462e23&&(_0x488fa9[_0x218645(0x1e6)]=_0x218645(0x178),_0x488fa9[_0x218645(0x14f)]=_0x462e23,delete _0x488fa9['waitStep'],delete _0x488fa9[_0x218645(0x191)],_0xd6aa1f[_0x218645(0x134)]!==undefined&&(_0x488fa9[_0x218645(0x134)]=_0xd6aa1f['conditionTimeoutDuration']),_0xd6aa1f[_0x218645(0x15e)]&&(_0x488fa9['conditionTimeoutUnit']=_0xd6aa1f[_0x218645(0x15e)]));}if(_0xd6aa1f['conditions']){const _0x48d44b=_0xd6aa1f[_0x218645(0x138)][_0x218645(0x166)](_0x5acb48=>_0x5acb48[_0x218645(0x18c)]&&isPendingSegmentId(_0x5acb48[_0x218645(0x18c)]));if(_0x48d44b){const _0x293400=_0xd6aa1f[_0x218645(0x138)][_0x218645(0x1b6)](_0x991454=>{const _0x866212=_0x218645;if(_0x991454[_0x866212(0x18c)]&&isPendingSegmentId(_0x991454[_0x866212(0x18c)])){const _0x4e72bd=_0x1bac2a(_0x991454[_0x866212(0x18c)],_0x866212(0x115)+_0x5b48e0+_0x866212(0x1fb));return{..._0x991454,'segmentId':_0x4e72bd||_0x991454[_0x866212(0x18c)]};}return{..._0x991454};});_0x488fa9[_0x218645(0x1e6)]='Condition',_0x488fa9['conditions']=_0x293400,delete _0x488fa9[_0x218645(0x119)],delete _0x488fa9[_0x218645(0x191)],delete _0x488fa9[_0x218645(0x14f)],delete _0x488fa9[_0x218645(0x134)],delete _0x488fa9[_0x218645(0x15e)];}}}function stripPendingIds(_0x91ef68){const _0xdda16f=a152_0xd184d4;_0x91ef68['attributes'][_0xdda16f(0x1f0)]?.['segmentId']&&isPendingSegmentId(_0x91ef68['attributes'][_0xdda16f(0x1f0)][_0xdda16f(0x18c)])&&delete _0x91ef68['attributes']['goal'];for(const _0x3bc338 of _0x91ef68[_0xdda16f(0x171)][_0xdda16f(0x131)]||[]){_0x3bc338[_0xdda16f(0x162)]?.[_0xdda16f(0x18c)]&&isPendingSegmentId(_0x3bc338[_0xdda16f(0x162)][_0xdda16f(0x18c)])&&delete _0x3bc338[_0xdda16f(0x162)];_0x3bc338[_0xdda16f(0x157)]?.[_0xdda16f(0x18c)]&&isPendingSegmentId(_0x3bc338['milestone'][_0xdda16f(0x18c)])&&delete _0x3bc338[_0xdda16f(0x157)];_0x3bc338[_0xdda16f(0x187)]&&(_0x3bc338[_0xdda16f(0x187)]=_0x3bc338[_0xdda16f(0x187)][_0xdda16f(0x206)](_0x456299=>!_0x456299[_0xdda16f(0x18c)]||!isPendingSegmentId(_0x456299[_0xdda16f(0x18c)])));if(_0x3bc338[_0xdda16f(0x14d)])for(const _0x369dd7 of Object['keys'](_0x3bc338[_0xdda16f(0x14d)])){const _0x4fdf89=_0x3bc338[_0xdda16f(0x14d)][_0x369dd7];_0x4fdf89[_0xdda16f(0x1e5)]===_0xdda16f(0x10d)&&_0x4fdf89[_0xdda16f(0x18a)]&&isPendingActivationId(_0x4fdf89['journeyActivationStepId'])&&(_0x4fdf89[_0xdda16f(0x18a)]='');if(_0x4fdf89[_0xdda16f(0x1e5)]===_0xdda16f(0x1c1)&&_0x4fdf89['branches'])for(const _0x1d5e11 of _0x4fdf89[_0xdda16f(0x196)]){_0x1d5e11[_0xdda16f(0x18c)]&&isPendingSegmentId(_0x1d5e11[_0xdda16f(0x18c)])&&(_0x1d5e11['segmentId']='');}_0x4fdf89['type']===_0xdda16f(0x200)&&stripWaitStepPendingIds(_0x4fdf89);}}}function resolvePendingIdsInRequest(_0x2a4a12,_0x1004c8,_0x190b14,_0x5f1601,_0x1a4e1a,_0x412015){const _0x4ddd0d=a152_0xd184d4,_0x1bbfc3=(_0x3ce23b,_0x22d76d)=>{const _0x3d45ac=a152_0x2210;if(!isPendingSegmentId(_0x3ce23b))return _0x3ce23b;const _0x545b18=extractPendingSegmentName(_0x3ce23b),_0x17e604=_0x5f1601[_0x3d45ac(0x181)](_0x545b18);return!_0x17e604&&_0x412015[_0x3d45ac(0x165)]?.(_0x3d45ac(0x16f)+_0x545b18+_0x3d45ac(0x1d8)+_0x22d76d),_0x17e604;};if(_0x2a4a12[_0x4ddd0d(0x171)][_0x4ddd0d(0x1f0)]?.[_0x4ddd0d(0x18c)]&&isPendingSegmentId(_0x2a4a12[_0x4ddd0d(0x171)][_0x4ddd0d(0x1f0)][_0x4ddd0d(0x18c)])){const _0x8b037c=_0x1bbfc3(_0x2a4a12['attributes']['goal'][_0x4ddd0d(0x18c)],'goal\x20criteria');_0x8b037c&&(_0x2a4a12[_0x4ddd0d(0x171)][_0x4ddd0d(0x1f0)][_0x4ddd0d(0x18c)]=_0x8b037c);}for(const _0x149ac2 of _0x2a4a12[_0x4ddd0d(0x171)][_0x4ddd0d(0x131)]||[]){const _0x20fa36=_0x190b14[_0x4ddd0d(0x181)](_0x149ac2[_0x4ddd0d(0x13a)][_0x4ddd0d(0x12f)]());_0x20fa36&&(_0x149ac2['id']=_0x20fa36);if(_0x149ac2['entryCriteria']?.[_0x4ddd0d(0x18c)]&&isPendingSegmentId(_0x149ac2['entryCriteria'][_0x4ddd0d(0x18c)])){const _0xb758e0=_0x1bbfc3(_0x149ac2['entryCriteria'][_0x4ddd0d(0x18c)],_0x4ddd0d(0x115)+_0x149ac2[_0x4ddd0d(0x13a)]+_0x4ddd0d(0x1ac));_0xb758e0&&(_0x149ac2[_0x4ddd0d(0x162)]['segmentId']=_0xb758e0);}if(_0x149ac2[_0x4ddd0d(0x187)])for(const _0xae8e79 of _0x149ac2[_0x4ddd0d(0x187)]){if(_0xae8e79[_0x4ddd0d(0x18c)]&&isPendingSegmentId(_0xae8e79[_0x4ddd0d(0x18c)])){const _0x3fdd42=_0x1bbfc3(_0xae8e79[_0x4ddd0d(0x18c)],_0x4ddd0d(0x115)+_0x149ac2['name']+_0x4ddd0d(0x185));_0x3fdd42&&(_0xae8e79['segmentId']=_0x3fdd42);}}if(_0x149ac2[_0x4ddd0d(0x157)]?.['segmentId']&&isPendingSegmentId(_0x149ac2['milestone']['segmentId'])){const _0x37c59f=_0x1bbfc3(_0x149ac2[_0x4ddd0d(0x157)]['segmentId'],_0x4ddd0d(0x115)+_0x149ac2[_0x4ddd0d(0x13a)]+_0x4ddd0d(0x172));_0x37c59f&&(_0x149ac2[_0x4ddd0d(0x157)][_0x4ddd0d(0x18c)]=_0x37c59f);}if(_0x149ac2[_0x4ddd0d(0x14d)]){const _0x588fc9=_0x200d1d=>_0x1004c8['attributes'][_0x4ddd0d(0x131)]?.[_0x4ddd0d(0x179)](_0x3d6b82=>_0x3d6b82[_0x4ddd0d(0x13a)][_0x4ddd0d(0x12f)]()===_0x149ac2[_0x4ddd0d(0x13a)][_0x4ddd0d(0x12f)]())?.[_0x4ddd0d(0x14d)]?.[_0x200d1d];for(const _0x5382ae of Object['keys'](_0x149ac2[_0x4ddd0d(0x14d)])){const _0x345939=_0x149ac2['steps'][_0x5382ae],_0x2f8eb3=_0x588fc9(_0x5382ae);if(_0x345939[_0x4ddd0d(0x1e5)]==='Activation'&&_0x345939[_0x4ddd0d(0x18a)]&&(isPendingActivationId(_0x345939[_0x4ddd0d(0x18a)])||_0x345939['journeyActivationStepId']==='')){if(_0x2f8eb3?.[_0x4ddd0d(0x18a)]&&isPendingActivationId(_0x2f8eb3[_0x4ddd0d(0x18a)])){const _0x2654d7=extractPendingActivationName(_0x2f8eb3['journeyActivationStepId']),_0x5d5040=_0x1a4e1a[_0x4ddd0d(0x181)](_0x2654d7);_0x5d5040&&(_0x345939[_0x4ddd0d(0x18a)]=_0x5d5040);}}if(_0x345939[_0x4ddd0d(0x1e5)]===_0x4ddd0d(0x1c1)&&_0x345939[_0x4ddd0d(0x196)]&&_0x2f8eb3?.[_0x4ddd0d(0x196)])for(let _0x4dd0d2=0x0;_0x4dd0d2<_0x345939[_0x4ddd0d(0x196)][_0x4ddd0d(0x169)];_0x4dd0d2++){const _0x39fc92=_0x345939['branches'][_0x4dd0d2],_0x286cd6=_0x2f8eb3[_0x4ddd0d(0x196)][_0x4dd0d2];if(_0x286cd6?.[_0x4ddd0d(0x18c)]&&isPendingSegmentId(_0x286cd6[_0x4ddd0d(0x18c)])){const _0x4008c5=_0x1bbfc3(_0x286cd6[_0x4ddd0d(0x18c)],_0x4ddd0d(0x115)+_0x149ac2[_0x4ddd0d(0x13a)]+_0x4ddd0d(0x183)+(_0x39fc92[_0x4ddd0d(0x13a)]||_0x4dd0d2)+'\x27');_0x4008c5&&(_0x39fc92[_0x4ddd0d(0x18c)]=_0x4008c5);}}_0x345939['type']===_0x4ddd0d(0x200)&&_0x2f8eb3?.[_0x4ddd0d(0x1e5)]==='WaitStep'&&resolveWaitStepPendingIds(_0x345939,_0x2f8eb3,_0x1bbfc3,_0x149ac2[_0x4ddd0d(0x13a)]);}}}}
|
|
1
|
+
const a152_0x25b375=a152_0x29c9;(function(_0xfad751,_0x220df0){const _0x120421=a152_0x29c9,_0x3b1e3c=_0xfad751();while(!![]){try{const _0x331980=-parseInt(_0x120421(0xf3))/0x1*(-parseInt(_0x120421(0x14a))/0x2)+parseInt(_0x120421(0x192))/0x3+-parseInt(_0x120421(0xf5))/0x4+-parseInt(_0x120421(0x189))/0x5*(parseInt(_0x120421(0x1ba))/0x6)+parseInt(_0x120421(0x193))/0x7+-parseInt(_0x120421(0xfe))/0x8*(-parseInt(_0x120421(0x12c))/0x9)+parseInt(_0x120421(0x157))/0xa;if(_0x331980===_0x220df0)break;else _0x3b1e3c['push'](_0x3b1e3c['shift']());}catch(_0x558abf){_0x3b1e3c['push'](_0x3b1e3c['shift']());}}}(a152_0x1aa8,0x71101));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a152_0x25b375(0x124));export const PENDING_SEGMENT_PREFIX=a152_0x25b375(0x162);export const PENDING_ACTIVATION_PREFIX='__pending_act_';export function createPendingSegmentId(_0x3feda8){return''+PENDING_SEGMENT_PREFIX+_0x3feda8+'__';}export function isPendingSegmentId(_0x19e921){const _0x525f3e=a152_0x25b375;return _0x19e921[_0x525f3e(0xda)](PENDING_SEGMENT_PREFIX)&&!_0x19e921[_0x525f3e(0xda)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x21abe5){const _0x25e765=a152_0x25b375;return _0x21abe5[_0x25e765(0x195)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x35e4e6){return''+PENDING_ACTIVATION_PREFIX+_0x35e4e6+'__';}export function isPendingActivationId(_0xebf503){return _0xebf503['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x192bdf){const _0x27a2e4=a152_0x25b375;return _0x192bdf[_0x27a2e4(0x195)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x4231c,_0xf3c77){const _0x47cd05=a152_0x25b375,_0x2c5833=_0x4231c+'::'+(_0xf3c77[_0x47cd05(0xfb)]()||_0x47cd05(0x14f)),_0x52b40e=createHash(_0x47cd05(0xbf))['update'](_0x2c5833)[_0x47cd05(0x159)](_0x47cd05(0x123))[_0x47cd05(0xc5)](0x0,0xc);return _0x47cd05(0x1bc)+_0x52b40e;}export function ensureJourneyDefaults(_0x1fa303){const _0x3c0ccc=a152_0x25b375;!_0x1fa303['description']&&(_0x1fa303[_0x3c0ccc(0x1a4)]=''),!_0x1fa303['state']&&(_0x1fa303[_0x3c0ccc(0x164)]=_0x3c0ccc(0x112));}export function injectExistingStageIds(_0x42fbcf,_0x43674a){const _0x54c7cb=a152_0x25b375,_0x3f1812=new Map(_0x43674a[_0x54c7cb(0x11f)](_0x3b7bb3=>[_0x3b7bb3[_0x54c7cb(0x1ad)],_0x3b7bb3['id']]));for(const _0x753ee1 of _0x42fbcf){if(!_0x753ee1['id']){const _0x3024ad=_0x3f1812[_0x54c7cb(0x18f)](_0x753ee1['name']);_0x3024ad&&(_0x753ee1['id']=_0x3024ad);}}}export function resolveTDFolderPath(_0x484e58,_0x29d160,_0x5e6f7b){const _0x1d1d0a=a152_0x25b375;if(!_0x29d160)return _0x484e58;if(_0x484e58===_0x5e6f7b||_0x484e58[_0x1d1d0a(0xda)](_0x5e6f7b+'/'))return _0x484e58;return _0x484e58?_0x5e6f7b+'/'+_0x484e58:_0x5e6f7b;}export function addFoldersToCreate(_0x96676e,_0x5dc3c6,_0x692fb3){const _0x3c2e7e=a152_0x25b375;if(!_0x96676e)return;if(_0x5dc3c6[_0x3c2e7e(0x16e)](_0x96676e))return;const _0x210e6b=_0x96676e['split']('/');let _0x3e838a='';for(const _0xdfaf53 of _0x210e6b){_0x3e838a=_0x3e838a?_0x3e838a+'/'+_0xdfaf53:_0xdfaf53,!_0x5dc3c6['has'](_0x3e838a)&&_0x692fb3[_0x3c2e7e(0xf0)](_0x3e838a);}}export function sortFoldersByDepth(_0x1c40de){const _0x53e9bd=a152_0x25b375;return[..._0x1c40de][_0x53e9bd(0x145)]((_0x3c4976,_0x27c8db)=>{const _0x2dc20c=_0x53e9bd,_0x58aeef=(_0x3c4976['match'](/\//g)||[])[_0x2dc20c(0x1a2)],_0x4a0da0=(_0x27c8db['match'](/\//g)||[])[_0x2dc20c(0x1a2)];return _0x58aeef-_0x4a0da0;});}import*as a152_0x2379d5 from'yaml';import{readFileSync}from'fs';import a152_0x54ad4c from'path';import{isJourneyDef,parseYamlString as a152_0x24e7c2,toYamlString as a152_0x2eb8f7,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(_0x169464){const _0x42a886=a152_0x25b375;if(Array['isArray'](_0x169464))return'['+_0x169464['map'](_0x68747a=>stableStringify(_0x68747a))[_0x42a886(0x12d)](',')+']';if(_0x169464&&typeof _0x169464===_0x42a886(0xf9)){const _0x210d8a=_0x169464,_0x53642a=Object[_0x42a886(0xfc)](_0x210d8a)[_0x42a886(0x145)](),_0x59473a=_0x53642a[_0x42a886(0x11f)](_0x223d3d=>'\x22'+_0x223d3d+'\x22:'+stableStringify(_0x210d8a[_0x223d3d]));return'{'+_0x59473a['join'](',')+'}';}const _0x5036f4=JSON[_0x42a886(0xcc)](_0x169464);return _0x5036f4===undefined?'null':_0x5036f4;}function activationSignature(_0x58f669){const _0x5f1157=a152_0x25b375,_0x2118d5={'connection':_0x58f669[_0x5f1157(0xea)],..._0x58f669[_0x5f1157(0x117)]!==undefined&&{'all_columns':_0x58f669[_0x5f1157(0x117)]},..._0x58f669[_0x5f1157(0x13e)]!==undefined&&{'columns':_0x58f669[_0x5f1157(0x13e)]},..._0x58f669[_0x5f1157(0x116)]!==undefined&&{'behavior':_0x58f669['behavior']},..._0x58f669[_0x5f1157(0xf4)]!==undefined&&{'schedule':_0x58f669[_0x5f1157(0xf4)]},..._0x58f669['notification']!==undefined&&{'notification':_0x58f669[_0x5f1157(0xc8)]},..._0x58f669['connector_config']!==undefined&&{'connector_config':_0x58f669['connector_config']},..._0x58f669[_0x5f1157(0x158)]!==undefined&&{'activation_template_id':_0x58f669[_0x5f1157(0x158)]}};return stableStringify(_0x2118d5);}async function fetchSegment(_0x421b11,_0x3474fb,_0x5e4256,_0x3d9469){const _0x10d896=a152_0x25b375,_0x645e39=_0x3d9469?.['find'](_0x1de2f1=>_0x1de2f1['id']===_0x5e4256);if(_0x645e39)return _0x645e39;try{return await _0x421b11[_0x10d896(0x14f)][_0x10d896(0x179)](_0x3474fb,_0x5e4256);}catch(_0x286d1c){logger['debug'](_0x10d896(0x165)+_0x5e4256+_0x10d896(0x16f)+_0x286d1c);try{return await _0x421b11[_0x10d896(0x14f)][_0x10d896(0xd0)](_0x5e4256);}catch(_0x1ced33){return logger[_0x10d896(0x127)](_0x10d896(0x1b2)+_0x5e4256+':\x20'+_0x1ced33),null;}}}function recoverSegmentIdsFromPushRecovery(_0x5f50d7,_0x48fb0a,_0x787469){const _0x1c00f6=a152_0x25b375,_0x24b2dd=readPushRecovery(_0x5f50d7[_0x1c00f6(0x144)]);if(_0x24b2dd?.[_0x1c00f6(0xbd)]===_0x5f50d7[_0x1c00f6(0x171)][_0x1c00f6(0x1ad)])for(const [_0x578fd1,_0x10ef37]of Object[_0x1c00f6(0x184)](_0x24b2dd['segments'])){const _0x44d3ef=generateDeterministicJourneySegmentName(_0x5f50d7[_0x1c00f6(0x171)][_0x1c00f6(0x1ad)],_0x578fd1);_0x10ef37[_0x1c00f6(0x151)]===_0x44d3ef&&(_0x48fb0a[_0x1c00f6(0x188)](_0x578fd1,_0x10ef37[_0x1c00f6(0xf2)]),_0x787469[_0x1c00f6(0x188)](_0x578fd1,_0x10ef37['segmentId']));}}async function createOrRecoverEmbeddedSegment(_0x263766,_0x478246,_0x2b0a2d,_0x40d77f){const _0x23c047=a152_0x25b375;let _0x3f91c3;try{_0x3f91c3=await _0x263766[_0x23c047(0x14f)][_0x23c047(0x156)]({'name':_0x2b0a2d[_0x23c047(0x109)],'description':_0x2b0a2d[_0x23c047(0x1a4)],'journeyId':_0x2b0a2d[_0x23c047(0x1ac)],'rule':_0x40d77f(_0x2b0a2d[_0x23c047(0x104)],!![]),'countPopulation':!![],'parentFolderId':_0x2b0a2d['folderId'],'audienceId':_0x2b0a2d['parentId']});}catch(_0x35c763){const _0x3995e5=_0x35c763 instanceof Error&&_0x35c763[_0x23c047(0x103)][_0x23c047(0x132)]('Name\x20has\x20already\x20been\x20taken');if(_0x3995e5){const _0x425d53=readPushRecovery(_0x478246['absolutePath']),_0x70986=_0x425d53?.[_0x23c047(0xbd)]===_0x478246[_0x23c047(0x171)]['name']?_0x425d53['segments'][_0x2b0a2d['localName']]:undefined;if(_0x70986?.['uniqueServerName']===_0x2b0a2d[_0x23c047(0x109)])await _0x263766[_0x23c047(0x14f)]['updateSegmentById'](_0x2b0a2d['parentId'],_0x70986[_0x23c047(0xf2)],{'description':_0x2b0a2d['description'],'rule':_0x40d77f(_0x2b0a2d[_0x23c047(0x104)],!![]),'countPopulation':!![]}),_0x3f91c3=_0x70986[_0x23c047(0xf2)];else throw new SDKError(ErrorCode[_0x23c047(0xf1)],_0x23c047(0xc1)+_0x2b0a2d[_0x23c047(0xf6)]+_0x23c047(0x115)+(_0x23c047(0xd7)+_0x478246['absolutePath']['replace'](/([^/]+)$/,'.$1.push-recovery.json')+')\x20')+'and\x20the\x20server\x20segment,\x20then\x20retry.',_0x35c763);}else throw _0x35c763;}return saveSegmentToPushRecovery(_0x478246['absolutePath'],_0x478246['yamlConfig'][_0x23c047(0x1ad)],_0x2b0a2d['localName'],{'segmentId':_0x3f91c3,'uniqueServerName':_0x2b0a2d['uniqueSegmentName'],'createdAt':new Date()[_0x23c047(0x161)]()}),_0x3f91c3;}export async function prepareSegmentFiles(_0x3ec657,_0x33bab9,_0x26077f,_0x3f20f1,_0x3b1689){const _0x56ceeb=a152_0x25b375,{activationDefToCreateRequest:_0x5b15b8}=await import('./child-segment-yaml.js'),_0x963b08=[],_0x5ba76e=new Set();for(const {yamlConfig:_0x5640ec,folderPath:_0x5190bf,sourcePath:_0x4fe987}of _0x3ec657){const _0x111429=resolveTDFolderPath(_0x5190bf,_0x3f20f1,_0x3b1689),_0x5c7add=_0x111429+':'+_0x5640ec[_0x56ceeb(0x1ad)],_0x26e7a4=_0x33bab9[_0x56ceeb(0xc6)]['get'](_0x5c7add),_0xac924e=_0x26e7a4?_0x33bab9[_0x56ceeb(0x14e)][_0x56ceeb(0x18f)](_0x26e7a4['id'])||[]:[];addFoldersToCreate(_0x111429,_0x33bab9['folderPathToId'],_0x5ba76e);const _0x4ea9a0=calculateActivationActions(_0x5640ec[_0x56ceeb(0xba)]||[],_0xac924e,_0x33bab9[_0x56ceeb(0x1aa)],_0x33bab9[_0x56ceeb(0x168)]);for(const _0x4908bf of _0x4ea9a0){(_0x4908bf[_0x56ceeb(0xd9)]===_0x56ceeb(0x10b)||_0x4908bf[_0x56ceeb(0xd9)]===_0x56ceeb(0x11e))&&_0x4908bf[_0x56ceeb(0xca)]&&(_0x4908bf[_0x56ceeb(0x160)]=await _0x5b15b8(_0x4908bf[_0x56ceeb(0xca)],_0x26077f));}const _0x4539e7=calculateSegmentDiff(_0x5640ec,_0x26e7a4,_0xac924e,_0x33bab9[_0x56ceeb(0x1aa)],_0x33bab9[_0x56ceeb(0x168)]);_0x963b08[_0x56ceeb(0x12a)]({'relativePath':_0x5640ec['name'],'absolutePath':_0x4fe987,'yamlConfig':_0x5640ec,'folderPath':_0x111429,'existingSegment':_0x26e7a4,'existingActivations':_0xac924e,'isNew':_0x4539e7['isNew'],'hasChanges':_0x4539e7[_0x56ceeb(0x146)],'diff':_0x4539e7[_0x56ceeb(0xfd)],'activationActions':_0x4ea9a0});}return{'segmentFiles':_0x963b08,'foldersToCreate':_0x5ba76e};}export async function prepareJourneyFiles(_0x7fee84,_0x4bcbd0,_0x1c9db4,_0x219be4){const _0xa03f27=a152_0x25b375,_0x25e2a8=[],_0x35e269=new Set();for(const {yamlConfig:_0x366bfb,folderPath:_0x193b2a,sourcePath:_0x38041d}of _0x7fee84){const _0xbe92dd=resolveTDFolderPath(_0x193b2a,_0x1c9db4,_0x219be4),_0x823293=_0xbe92dd+':'+_0x366bfb['name'],_0x4f78d0=_0x4bcbd0['journeyBundlesByFolderAndName'][_0xa03f27(0x18f)](_0x823293);let _0x24d6c4,_0x45cb4e;if(_0x4f78d0&&_0x4f78d0[_0xa03f27(0x1a2)]>0x0){const _0x51488e=buildLocalExpandedRuleMappings(_0x366bfb),{createYamlContext:_0x5e782a,prefetchJourneySegments:_0x4998e1}=createPushYamlContextForBundle(_0x4bcbd0[_0xa03f27(0xe6)],_0x4bcbd0['parentId'],_0x4bcbd0['existingSegments'],_0x51488e,_0x4bcbd0['idToEmailMap'],_0x4bcbd0[_0xa03f27(0x168)],_0x4bcbd0[_0xa03f27(0x197)],_0x4bcbd0[_0xa03f27(0x10f)]);await _0x4998e1(_0x4f78d0['map'](_0x64a0c0=>_0x64a0c0['id']));const _0x5394c8=await _0x4bcbd0[_0xa03f27(0xe6)][_0xa03f27(0x17a)][_0xa03f27(0x19c)](_0x4f78d0[0x0][_0xa03f27(0xbe)]),_0x535729=hasMultipleVersions(_0x366bfb),_0x1ea7fc=async _0x5c7ec7=>{const _0x26d88d=_0xa03f27,_0xe593f1=_0x4bcbd0[_0x26d88d(0x10f)]?.[_0x26d88d(0x18f)](_0x5c7ec7);if(_0xe593f1)return _0xe593f1;return _0x4bcbd0[_0x26d88d(0xfa)]({'journeyId':_0x5c7ec7,'journeyName':_0x366bfb[_0x26d88d(0x1ad)],'isMultiVersion':_0x4f78d0[_0x26d88d(0x1a2)]>0x1});};if(_0x535729&&_0x4f78d0[_0xa03f27(0x1a2)]>0x1){const _0x175884=[];for(const _0x3019f0 of _0x4f78d0){const _0x17452b=_0x3019f0[_0xa03f27(0x15b)]||0x1;_0x4bcbd0[_0xa03f27(0xd1)]?.[_0xa03f27(0x11e)](_0xa03f27(0x15c)+_0x366bfb[_0xa03f27(0x1ad)]+'\x20v'+_0x17452b);const _0x568c12=await _0x1ea7fc(_0x3019f0['id']),_0x1a57ad=_0x5e782a(_0x3019f0['id']),_0x2b467d=await journeyResponseToDef(_0x568c12,_0x1a57ad);_0x175884['push']({'item':_0x3019f0,'yaml':_0x2b467d});}const _0x21a332=buildLocalRuleToNameMappingFromJourney(_0x366bfb);_0x45cb4e=buildMergedJourneyDef(_0x175884,_0x21a332,_0x5394c8);const _0x1898a1=Math[_0xa03f27(0xe0)](..._0x175884[_0xa03f27(0x11f)](_0x22178c=>_0x22178c[_0xa03f27(0x1ab)]['versionNumber']||0x0)),_0x60ad9e=_0x4f78d0[_0xa03f27(0x106)](_0x5f1959=>(_0x5f1959[_0xa03f27(0x15b)]||0x0)===_0x1898a1);_0x60ad9e&&(_0x4bcbd0[_0xa03f27(0xd1)]?.[_0xa03f27(0x11e)](_0xa03f27(0x15c)+_0x366bfb[_0xa03f27(0x1ad)]+'\x20v'+_0x1898a1),_0x24d6c4=await _0x1ea7fc(_0x60ad9e['id']));}else{const _0x4ddeb8=_0x4f78d0[_0x4f78d0[_0xa03f27(0x1a2)]-0x1];_0x4bcbd0[_0xa03f27(0xd1)]?.[_0xa03f27(0x11e)]('Fetching\x20'+_0x366bfb['name']),_0x24d6c4=await _0x1ea7fc(_0x4ddeb8['id']);const _0x2d5bbe=_0x5e782a(_0x4ddeb8['id']),_0x2eb713=await journeyResponseToDef(_0x24d6c4,_0x2d5bbe),_0x50efdd=buildLocalRuleToNameMappingFromJourney(_0x366bfb);_0x45cb4e=buildMergedJourneyDef([{'item':_0x4ddeb8,'yaml':_0x2eb713}],_0x50efdd,_0x5394c8);}}addFoldersToCreate(_0xbe92dd,_0x4bcbd0[_0xa03f27(0xc7)],_0x35e269);const _0x1024d=calculateJourneyDiff(_0x366bfb,_0x45cb4e);_0x25e2a8[_0xa03f27(0x12a)]({'relativePath':_0x366bfb[_0xa03f27(0x1ad)],'absolutePath':_0x38041d,'yamlConfig':_0x366bfb,'folderPath':_0xbe92dd,'existingJourney':_0x24d6c4,'isNew':_0x1024d['isNew'],'hasChanges':_0x1024d[_0xa03f27(0x146)],'diff':_0x1024d['diff']});}return{'journeyFiles':_0x25e2a8,'foldersToCreate':_0x35e269};}function a152_0x29c9(_0x235f4d,_0x52d7bc){_0x235f4d=_0x235f4d-0xb8;const _0x1aa8a5=a152_0x1aa8();let _0x29c9f0=_0x1aa8a5[_0x235f4d];return _0x29c9f0;}export function calculateActivationActions(_0x4b0793,_0x436791,_0xd2870d,_0x425914){const _0x2f149d=a152_0x25b375,_0x15bdb4=[],_0x4c61d4=new Map();for(const _0x1ac960 of _0x436791){_0x4c61d4['set'](_0x1ac960[_0x2f149d(0x1ad)],_0x1ac960);}const _0x150a57=new Map();for(const _0x3a754b of _0x4b0793){_0x150a57[_0x2f149d(0x188)](_0x3a754b[_0x2f149d(0x1ad)],_0x3a754b);}for(const _0x21de14 of _0x4b0793){const _0x8617e7=_0x4c61d4[_0x2f149d(0x18f)](_0x21de14[_0x2f149d(0x1ad)]);if(!_0x8617e7)_0x15bdb4[_0x2f149d(0x12a)]({'type':'create','name':_0x21de14[_0x2f149d(0x1ad)],'yamlActivation':_0x21de14});else{const _0x30fda6=activationResponseToDef(_0x8617e7,_0xd2870d,_0x425914),_0x5d29fa=a152_0x2379d5[_0x2f149d(0xcc)](_0x30fda6),_0x269ad4=a152_0x2379d5[_0x2f149d(0xcc)](_0x21de14);_0x5d29fa!==_0x269ad4&&_0x15bdb4[_0x2f149d(0x12a)]({'type':_0x2f149d(0x11e),'name':_0x21de14[_0x2f149d(0x1ad)],'yamlActivation':_0x21de14,'existingActivation':_0x8617e7});}}for(const _0x2f8e0a of _0x436791){!_0x150a57[_0x2f149d(0x16e)](_0x2f8e0a[_0x2f149d(0x1ad)])&&_0x15bdb4['push']({'type':_0x2f149d(0xbb),'name':_0x2f8e0a[_0x2f149d(0x1ad)],'existingActivation':_0x2f8e0a});}return _0x15bdb4;}function calculateYamlDiff(_0x20edba,_0x4332ef){if(_0x4332ef){const _0x29e01c=generateDiff(_0x4332ef,_0x20edba),_0x4ae370=hasChanges(_0x29e01c);return{'isNew':![],'hasChanges':_0x4ae370,'diff':_0x4ae370?formatDiffWithColors(_0x29e01c):undefined};}const _0x44c40e=generateDiff('',_0x20edba);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x44c40e)};}export function calculateSegmentDiff(_0x38d406,_0x39a40d,_0x55d4cf,_0x2da6f7,_0x2cd1aa){const _0x40cd5b=segmentToYamlString(_0x38d406),_0xc188fa=_0x39a40d?segmentToYamlString(segmentWithActivationsToYaml(_0x39a40d,_0x55d4cf,undefined,_0x2da6f7,_0x2cd1aa)):undefined;return calculateYamlDiff(_0x40cd5b,_0xc188fa);}export function calculateJourneyDiff(_0x4cd5c9,_0x960eb1){const _0x419500=normalizeJourneyDef(_0x4cd5c9,_0x4cd5c9),_0x1a6e36=a152_0x2eb8f7(_0x419500),_0x40eb0f=_0x960eb1?a152_0x2eb8f7(normalizeJourneyDef(_0x960eb1,_0x4cd5c9)):undefined;return calculateYamlDiff(_0x1a6e36,_0x40eb0f);}export function findSegmentsToDelete(_0x89bd66,_0xc51cca,_0x42d062,_0x512f77,_0x124ebf){const _0x278109=a152_0x25b375,_0x515a66=new Set();for(const {yamlConfig:_0x325aca,folderPath:_0x2466ec}of _0xc51cca){_0x515a66[_0x278109(0xf0)](_0x2466ec+':'+_0x325aca[_0x278109(0x1ad)]);}return _0x89bd66[_0x278109(0x15f)](_0x58816f=>{const _0x2a487b=_0x278109,_0x36bf5a=_0x58816f['segmentFolderId']?_0x42d062[_0x2a487b(0x18f)](_0x58816f[_0x2a487b(0xc4)][_0x2a487b(0x166)]())||'':'',_0x5ef139=_0x36bf5a+':'+_0x58816f[_0x2a487b(0x1ad)];if(_0x515a66[_0x2a487b(0x16e)](_0x5ef139))return![];if(_0x124ebf)return _0x36bf5a===_0x512f77||_0x36bf5a[_0x2a487b(0xda)](_0x512f77+'/');return!![];});}export function findJourneysToDelete(_0x5f04e9,_0x2cbfe9,_0xf6bc40,_0x28fe31,_0x3c8075){const _0x50a9a8=a152_0x25b375,_0x5d9e1f=new Set();for(const {yamlConfig:_0x5b3a36,folderPath:_0x321f34}of _0x2cbfe9){_0x5d9e1f[_0x50a9a8(0xf0)](_0x321f34+':'+_0x5b3a36[_0x50a9a8(0x1ad)]);}return _0x5f04e9['filter'](_0x4698af=>{const _0x149e89=_0x50a9a8,_0x1f07de=_0x4698af[_0x149e89(0x199)]?_0xf6bc40[_0x149e89(0x18f)](_0x4698af['folderId'])||'':'',_0x1744b5=_0x1f07de+':'+_0x4698af[_0x149e89(0xf8)];if(_0x5d9e1f['has'](_0x1744b5))return![];if(_0x3c8075)return _0x1f07de===_0x28fe31||_0x1f07de[_0x149e89(0xda)](_0x28fe31+'/');return!![];});}export function buildSegmentLookupMap(_0x34d0df,_0x2b915d){const _0x29606c=a152_0x25b375,_0x222470=new Map();for(const _0x2d41dd of _0x34d0df){const _0x5188b5=_0x2d41dd[_0x29606c(0xc4)]?_0x2b915d['get'](_0x2d41dd[_0x29606c(0xc4)][_0x29606c(0x166)]())||'':'',_0x3ec81a=_0x5188b5+':'+_0x2d41dd[_0x29606c(0x1ad)];_0x222470['set'](_0x3ec81a,_0x2d41dd);}return _0x222470;}export function buildSegmentNameToIdMap(_0x5d9f5b){const _0x557d8a=a152_0x25b375,_0x5b777f=new Map();for(const _0x12e3e5 of _0x5d9f5b){_0x5b777f[_0x557d8a(0x188)](_0x12e3e5['name'],_0x12e3e5['id']);}return _0x5b777f;}function a152_0x1aa8(){const _0x29260c=['Creating\x20activation\x20\x27','connection','skipSegments','created','nameToType','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','Created\x20activation\x20\x27','add','SEGMENT_UPDATE_ERROR','segmentId','1coCQYW','schedule','3534872miGMmF','localName','./journey-yaml.js','journeyBundleName','object','fetchJourney','trim','keys','diff','1410824ojSchJ','embedded_activation_creating','journey_updated','toLowerCase','activationActions','message','resolvedRule','segment_creating','find','embeddedSegmentNameToId','parentSegmentFolder','uniqueSegmentName','deleteSegment','create','entryCriteria','milestone','existingJourney','journeyById','../../utils/async.js','Updated\x20journey\x20\x27','draft','withProgress','parentId','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','behavior','all_columns','onProgress','waitStep','results','Segment\x20not\x20found','journey_creating','Deleted\x20activation\x20\x27','update','map','listActivations','\x27\x20entry\x20criteria','Matched\x20server\x20segment\x20\x27','hex','tdx.sdk.push-workflow','updated','journeys','debug','Stage\x20\x27','conditionTimeoutDuration','push','deleted','45lGDmhF','join','rule','Failed\x20to\x20','effectiveFolderId','waitStepUnit','includes','existingSegment','activationContext','rootFolderId','embedded_segment_creating','Created\x20segment\x20\x27','Duration','isNew','data','from','DecisionPoint','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','columns','stage\x20\x27','activation_creating','JOURNEY_UPDATE_ERROR','activationParams','with','absolutePath','sort','hasChanges','createSegment','\x27...','Updating\x20activation\x20\x27','468394FTFXIm','conditionSegmentId','Entry\x20criteria:\x20','dirname','activationsBySegmentId','segment','Segment\x20not\x20found:\x20','uniqueServerName','segments','Activation','entry_criteria','ACTIVATION_SYNTAX_ERROR','createJourneySegment','4723860XamxVs','activation_template_id','digest','Journey\x20\x27','versionNumber','Fetching\x20','journey_updating','conditionTimeoutUnit','filter','validatedRequest','toISOString','__pending_','WaitStep','state','getSegment\x20failed\x20for\x20','toString','Created\x20folder\x20\x27','connectionIdToNameMap','list','activation_','values','unchanged','SEGMENT_SYNTAX_ERROR','has',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','\x27\x20from\x20file:\x20','yamlConfig','\x0a\x20\x20','user','parseDocument','parse','action','kind','index','getSegment','journey','some','segment_deleting','logSuccess','folderPath','decision_point','\x20(referenced\x20in\x20journey\x20','segment_updated','\x20activation\x20\x27','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','entries','INTERNAL','Creating\x20folder\x20\x27','day','set','1462915JkUOMR','\x27\x20milestone','segment_updating','segmentNameToId','\x27\x20to\x20local\x20\x27','):\x20','get','activation_updating','relative','898356NQshJg','309323rjtckf','attributes','replace','./child-segment-yaml.js','activationStepsById','branches','folderId','deleteActivation','split','getLatestJourneyId','embedded_segment_created','size','parentFolder','journey_created','stages','length','\x27\x20not\x20found\x20in\x20journey\x20\x27','description','journeyActivationNameToId','folder_creating','goal','conditions','utf-8','idToEmailMap','item','journeyId','name','journeyStages','resolveSegment','waitStepType','\x27\x20wait\x20condition','getSegmentEntity\x20also\x20failed\x20for\x20','existingActivation','relationships','Created\x20journey\x20\x27','embedded_activation_created','Failed\x20to\x20resolve\x20segment\x20','updateSegmentById','verbose','12incElq','ACTIVATION_UPDATE_ERROR','journey_entry_criteria_','createActivation','existingSegments','valid','SEGMENT_NOT_FOUND','activations','delete','getJourney','journeyName','journeyBundleId','sha1','nameToId','Embedded\x20segment\x20\x27','errors','Creating\x20segment\x20\x27','segmentFolderId','slice','segmentByFolderAndName','folderPathToId','notification','Condition','yamlActivation','Updating\x20segment\x20\x27','stringify','entry','Deleting\x20activation\x20\x27','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','getSegmentEntity','progress','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','\x27\x20by\x20rule\x20content','Updated\x20segment\x20\x27','\x20segment\x20from\x20file:\x20','exitCriterias','Delete\x20the\x20push\x20recovery\x20file\x20(','run_after_journey_refresh','type','startsWith','\x27\x20decision\x20point\x20branch\x20\x27','createdSegmentId','steps','createdSegmentIds','NOT_FOUND','max','\x27\x20exit\x20criteria','Failed\x20to\x20resolve\x20activation\x20','logDeleted','journeyActivationStepId','all','deps','getActivation','Deleted\x20segment\x20\x27'];a152_0x1aa8=function(){return _0x29260c;};return a152_0x1aa8();}export function buildJourneyBundleLookupMap(_0x145b09,_0x3afe60){const _0x87ba78=a152_0x25b375,_0x218cab=new Map();for(const _0x449a06 of _0x145b09){const _0x4f0206=_0x449a06['folderId']?_0x3afe60[_0x87ba78(0x18f)](_0x449a06[_0x87ba78(0x199)])||'':'',_0x3dd208=_0x4f0206+':'+_0x449a06['journeyBundleName'];!_0x218cab['has'](_0x3dd208)&&_0x218cab[_0x87ba78(0x188)](_0x3dd208,[]),_0x218cab[_0x87ba78(0x18f)](_0x3dd208)[_0x87ba78(0x12a)](_0x449a06);}for(const _0x3ae4ec of _0x218cab[_0x87ba78(0x16b)]()){_0x3ae4ec[_0x87ba78(0x145)]((_0x25b391,_0x147090)=>(_0x25b391[_0x87ba78(0x15b)]||0x0)-(_0x147090[_0x87ba78(0x15b)]||0x0));}return _0x218cab;}export function collectFoldersToCreate(_0x1c85c4,_0x4cccd4){const _0x2dbdae=a152_0x25b375,_0x1eef49=new Set();for(const _0x3c01aa of _0x1c85c4){if(!_0x3c01aa)continue;if(_0x4cccd4[_0x2dbdae(0x16e)](_0x3c01aa))continue;const _0x5a0e6c=_0x3c01aa[_0x2dbdae(0x19b)]('/');let _0x44b9e6='';for(const _0x39ffa5 of _0x5a0e6c){_0x44b9e6=_0x44b9e6?_0x44b9e6+'/'+_0x39ffa5:_0x39ffa5,!_0x4cccd4[_0x2dbdae(0x16e)](_0x44b9e6)&&_0x1eef49[_0x2dbdae(0xf0)](_0x44b9e6);}}return _0x1eef49;}export function parseAndClassifyYamlFiles(_0x43b409,_0x15f2f6,_0x348278){const _0x2c8a5e=a152_0x25b375,_0x53c09e=[],_0x38ce66=[];for(const _0x3a6e63 of _0x43b409){const _0x1b2acb=a152_0x54ad4c[_0x2c8a5e(0x191)](_0x15f2f6,a152_0x54ad4c[_0x2c8a5e(0x14d)](_0x3a6e63)),_0x4f948d=_0x1b2acb==='.'?'':_0x1b2acb[_0x2c8a5e(0x195)](/\\/g,'/'),_0x378208=readFileSync(_0x3a6e63,_0x2c8a5e(0x1a9)),_0x595344=a152_0x2379d5[_0x2c8a5e(0x175)](_0x378208);if(isJourneyDef(_0x595344)){const _0x26a6ca=a152_0x24e7c2(_0x378208);_0x38ce66[_0x2c8a5e(0x12a)]({'yamlConfig':_0x26a6ca,'folderPath':_0x4f948d,'sourcePath':_0x3a6e63});}else{if(!_0x348278?.[_0x2c8a5e(0xeb)]){const _0x4286b8=parseSegmentYamlFile(_0x378208),_0x2f716a=normalizeChildSegmentYaml(_0x4286b8);_0x53c09e[_0x2c8a5e(0x12a)]({'yamlConfig':_0x2f716a,'folderPath':_0x4f948d,'sourcePath':_0x3a6e63});}}}return{'segments':_0x53c09e,'journeys':_0x38ce66};}export function validateParsedFiles(_0x5d1a6c,_0x4f8ce9){const _0x550e96=a152_0x25b375,_0x22fb1d=[];for(const {yamlConfig:_0x422416,sourcePath:_0x497952}of _0x5d1a6c[_0x550e96(0x152)]){const _0x167b8c=readFileSync(_0x497952,'utf-8'),_0x3bed17=a152_0x2379d5[_0x550e96(0x174)](_0x167b8c),_0x436b8c=validateSegmentDef(_0x422416,{'source':_0x167b8c,'document':_0x3bed17},{'skipSchema':!![]});if(!_0x436b8c['valid']){const _0x156ff7=a152_0x54ad4c[_0x550e96(0x191)](_0x4f8ce9,_0x497952);_0x22fb1d['push']({'filePath':_0x156ff7,'source':_0x167b8c,'result':_0x436b8c,'isJourney':![]});}}for(const {yamlConfig:_0x532d63,sourcePath:_0xdf26b6}of _0x5d1a6c[_0x550e96(0x126)]){const _0xe9cb54=readFileSync(_0xdf26b6,_0x550e96(0x1a9)),_0x1466f=a152_0x2379d5[_0x550e96(0x174)](_0xe9cb54),_0x53d679=validateJourneyDef(_0x532d63,{'source':_0xe9cb54,'document':_0x1466f},{'skipSchema':!![]});if(!_0x53d679[_0x550e96(0xb8)]){const _0x3dc320=a152_0x54ad4c['relative'](_0x4f8ce9,_0xdf26b6);_0x22fb1d['push']({'filePath':_0x3dc320,'source':_0xe9cb54,'result':_0x53d679,'isJourney':!![]});}}return _0x22fb1d;}export function formatValidationErrors(_0xf59d88){const _0x115a5b=a152_0x25b375,_0x4a8437=[];for(const {filePath:_0x8a2b30,source:_0x49edfb,result:_0x4bfb47,isJourney:_0x1201d1}of _0xf59d88){const _0x21b03c=_0x1201d1?_0x115a5b(0x17a):_0x115a5b(0x14f);_0x4a8437[_0x115a5b(0x12a)]('\x0a'+_0x8a2b30+'\x20('+_0x21b03c+_0x115a5b(0x18e)+_0x4bfb47[_0x115a5b(0xc2)]['length']+'\x20error(s)'),_0x4a8437[_0x115a5b(0x12a)](formatValidationResult(_0x4bfb47,_0x49edfb,_0x8a2b30));}return _0x4a8437[_0x115a5b(0x12d)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x4f322c){const _0x265231=a152_0x25b375,_0x524f9b=new Set(),_0x36ce18=new Map(),_0xed31d=collectSegmentUsageCounts(_0x4f322c);if(_0x4f322c[_0x265231(0x152)])for(const [_0x3863f8,_0x4e16f0]of Object[_0x265231(0x184)](_0x4f322c[_0x265231(0x152)])){_0x524f9b[_0x265231(0xf0)](_0x3863f8);if(_0x4e16f0['rule']){const _0x130fab=yamlRuleToApi(_0x4e16f0['rule']),_0x1e0feb=apiRuleToYaml(_0x130fab);_0x36ce18[_0x265231(0x188)](_0x3863f8,_0x1e0feb);}}const _0x224687=new Map();let _0x417c99=0x0;for(const [_0x27cd9d,_0x26c1a2]of _0x36ce18){const _0x319d67=serializeExpandedRule(_0x26c1a2,_0x36ce18),_0x4fafaf=_0x224687[_0x265231(0x18f)](_0x319d67)||[];_0x4fafaf[_0x265231(0x12a)]({'name':_0x27cd9d,'index':_0x417c99}),_0x224687[_0x265231(0x188)](_0x319d67,_0x4fafaf),_0x417c99++;}const _0x53af7d=new Map();for(const [_0x5a33e7,_0x429f85]of _0x224687){const _0x25dcfb=_0x429f85[_0x265231(0xc5)]()[_0x265231(0x145)]((_0x50ed9b,_0x4dc446)=>{const _0x344635=_0x265231,_0x227d5e=_0xed31d[_0x344635(0x18f)](_0x50ed9b[_0x344635(0x1ad)])||0x0,_0x2785dd=_0xed31d[_0x344635(0x18f)](_0x4dc446[_0x344635(0x1ad)])||0x0;if(_0x227d5e!==_0x2785dd)return _0x2785dd-_0x227d5e;return _0x50ed9b[_0x344635(0x178)]-_0x4dc446[_0x344635(0x178)];})[_0x265231(0x11f)](_0x54e3d7=>_0x54e3d7[_0x265231(0x1ad)]),_0x113af4=[];for(const _0x25196a of _0x25dcfb){const _0xdb13af=_0xed31d[_0x265231(0x18f)](_0x25196a)||0x0,_0x816043=Math[_0x265231(0xe0)](_0xdb13af,0x1);for(let _0x168892=0x0;_0x168892<_0x816043;_0x168892++){_0x113af4[_0x265231(0x12a)](_0x25196a);}}_0x53af7d[_0x265231(0x188)](_0x5a33e7,_0x113af4);}return{'existingLocalSegmentNames':_0x524f9b,'localSegmentRules':_0x36ce18,'localExpandedRuleToNames':_0x53af7d};}export function createSegmentIdResolver(_0x46489b,_0x4b481c){return async _0x48833b=>{const _0x482bea=a152_0x29c9,_0x2eb54b=_0x46489b['get'](_0x48833b);if(!_0x2eb54b)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x482bea(0x150)+_0x48833b+_0x482bea(0xee)+_0x4b481c+'\x27)');return _0x2eb54b;};}export function extractRootFolderId(_0x375b65){const _0x292d03=a152_0x25b375;return _0x375b65[_0x292d03(0x1b4)]?.[_0x292d03(0x108)]?.[_0x292d03(0x13a)]?.['id']||_0x375b65['relationships']?.[_0x292d03(0x19f)]?.['data']?.['id'];}export function buildConnectionMaps(_0x3fc57e){const _0x513fd9=a152_0x25b375,_0x4d145d=new Map(),_0x63429=new Map(),_0x32fdae=new Map();for(const _0x17b83d of _0x3fc57e){_0x4d145d[_0x513fd9(0x188)](_0x17b83d[_0x513fd9(0x1ad)],parseInt(_0x17b83d['id'],0xa)),_0x63429[_0x513fd9(0x188)](_0x17b83d['id'],_0x17b83d[_0x513fd9(0x1ad)]),_0x32fdae[_0x513fd9(0x188)](_0x17b83d[_0x513fd9(0x1ad)],_0x17b83d[_0x513fd9(0xd9)]);}return{'nameToId':_0x4d145d,'idToName':_0x63429,'nameToType':_0x32fdae};}export function calculatePushStats(_0x268bd1,_0x27dc8e,_0x296619,_0x167562,_0x4e469b,_0xb66dc7,_0x155d55){const _0x55857f=a152_0x25b375,_0x18aafa=_0x268bd1[_0x55857f(0x15f)](_0x1382fd=>_0x1382fd[_0x55857f(0x139)]),_0x4c6f23=_0x268bd1[_0x55857f(0x15f)](_0x2498e7=>!_0x2498e7[_0x55857f(0x139)]&&_0x2498e7[_0x55857f(0x146)]),_0x59206b=_0x268bd1['filter'](_0x4b5359=>!_0x4b5359[_0x55857f(0x139)]&&!_0x4b5359['hasChanges']),_0x180509=_0xb66dc7?_0x167562:[],_0x1c0bc5=_0x27dc8e[_0x55857f(0x15f)](_0x1b224d=>_0x1b224d['isNew']),_0xc4f6dc=_0x27dc8e[_0x55857f(0x15f)](_0x34881f=>!_0x34881f[_0x55857f(0x139)]&&_0x34881f[_0x55857f(0x146)]),_0x472d5=_0x27dc8e[_0x55857f(0x15f)](_0x3babb7=>!_0x3babb7[_0x55857f(0x139)]&&!_0x3babb7[_0x55857f(0x146)]),_0x361e1a=_0xb66dc7?_0x4e469b:[],_0x2e84dd=_0x268bd1['flatMap'](_0x32637d=>_0x32637d[_0x55857f(0x102)]),_0x250e07=_0x2e84dd[_0x55857f(0x15f)](_0x26830e=>_0x26830e[_0x55857f(0xd9)]===_0x55857f(0x10b)),_0x3aaafe=_0x2e84dd[_0x55857f(0x15f)](_0x384e68=>_0x384e68[_0x55857f(0xd9)]===_0x55857f(0x11e)),_0x5102b4=_0x2e84dd[_0x55857f(0x15f)](_0x11272a=>_0x11272a[_0x55857f(0xd9)]===_0x55857f(0xbb)),_0xdd1ff4=Array[_0x55857f(0x13b)](_0x296619)[_0x55857f(0x145)](),_0x48610d=_0x155d55?![]:_0x18aafa['length']>0x0||_0x4c6f23[_0x55857f(0x1a2)]>0x0||_0x180509[_0x55857f(0x1a2)]>0x0,_0x2c5ed7=_0x1c0bc5['length']>0x0||_0xc4f6dc[_0x55857f(0x1a2)]>0x0||_0x361e1a[_0x55857f(0x1a2)]>0x0,_0x3b54eb=_0x155d55?![]:_0x2e84dd[_0x55857f(0x1a2)]>0x0,_0x5a2843=_0xdd1ff4[_0x55857f(0x1a2)]>0x0;return{'segments':{'new':_0x18aafa,'changed':_0x4c6f23,'unchanged':_0x59206b,'toDelete':_0x180509},'journeys':{'new':_0x1c0bc5,'changed':_0xc4f6dc,'unchanged':_0x472d5,'toDelete':_0x361e1a},'activations':{'all':_0x2e84dd,'toCreate':_0x250e07,'toUpdate':_0x3aaafe,'toDelete':_0x5102b4},'folders':{'toCreate':_0xdd1ff4},'counts':{'segments':{'new':_0x18aafa[_0x55857f(0x1a2)],'changed':_0x4c6f23[_0x55857f(0x1a2)],'unchanged':_0x59206b[_0x55857f(0x1a2)],'toDelete':_0x180509[_0x55857f(0x1a2)]},'journeys':{'new':_0x1c0bc5[_0x55857f(0x1a2)],'changed':_0xc4f6dc['length'],'unchanged':_0x472d5['length'],'toDelete':_0x361e1a[_0x55857f(0x1a2)]},'activations':{'create':_0x250e07[_0x55857f(0x1a2)],'update':_0x3aaafe[_0x55857f(0x1a2)],'delete':_0x5102b4[_0x55857f(0x1a2)]},'folders':_0xdd1ff4[_0x55857f(0x1a2)]},'hasChanges':_0x48610d||_0x2c5ed7||_0x3b54eb||_0x5a2843};}export async function buildPushExecutionContext(_0x24e975,_0x5f1409,_0x5e0fd7,_0x488e8f,_0x25b1da,_0x234200){const _0x2077a4=a152_0x25b375,_0x14b186=extractRootFolderId(_0x5e0fd7),{pathToId:_0x381082,idToPath:_0x115d40}=buildFolderMaps(_0x25b1da),_0x1d0e82=buildSegmentNameToIdMap(_0x488e8f),_0x4e3773=new Map(),{batchAsync:_0x59d78d}=await import(_0x2077a4(0x110)),[_0x4b1608,_0x17d84a]=await Promise['all']([_0x24e975[_0x2077a4(0x173)]['buildUserMaps'](),_0x24e975[_0x2077a4(0xea)][_0x2077a4(0x169)](),((async()=>{const _0x3a11a7=_0x2077a4;!_0x234200&&_0x488e8f[_0x3a11a7(0x1a2)]>0x0&&await _0x59d78d(_0x488e8f,async _0x3bb77f=>{const _0x3881c2=_0x3a11a7,_0x2336ac=await _0x24e975[_0x3881c2(0x14f)][_0x3881c2(0x120)](_0x5f1409,_0x3bb77f['id']);_0x4e3773[_0x3881c2(0x188)](_0x3bb77f['id'],_0x2336ac);});})())]),{emailToId:_0x58981d,idToEmail:_0x30d4cf}=_0x4b1608,_0x5c6ccb=buildConnectionMaps(_0x17d84a);return{'rootFolderId':_0x14b186,'folderPathToId':_0x381082,'folderIdToPath':_0x115d40,'segmentNameToId':_0x1d0e82,'activationsBySegmentId':_0x4e3773,'emailToIdMap':_0x58981d,'idToEmailMap':_0x30d4cf,'connectionNameToIdMap':_0x5c6ccb[_0x2077a4(0xc0)],'connectionIdToNameMap':_0x5c6ccb['idToName'],'connectionNameToTypeMap':_0x5c6ccb[_0x2077a4(0xed)]};}export function createPushYamlContextForBundle(_0x1b5278,_0x278753,_0x321806,_0x478af8,_0x38635e,_0x584440,_0x439409,_0x205197){const {existingLocalSegmentNames:_0x37eb11,localExpandedRuleToNames:_0xf0cc66}=_0x478af8,_0x585607=new Set(),_0x4eadb9=new Map(),_0xcc9512=new Map(),_0x1cf02d=new Map(),_0x159573=createJumpTargetCache(),_0x6bf954=new Map(),_0x289319=new Map(),_0x20b4ad=new Set();let _0x1fe088;const _0x13fb21=_0x41d1eb=>{const _0x3b11e1={'resolveSegment':async _0x579401=>{const _0x43123f=a152_0x29c9,_0x219e3b=_0x1cf02d['get'](_0x579401);if(_0x219e3b!==undefined)return{'name':_0x219e3b,'isJourneyLocal':!![]};try{const _0x50edf8=await fetchSegment(_0x1b5278,_0x278753,_0x579401,_0x321806);if(!_0x50edf8)throw new Error(_0x43123f(0x11b));const _0x238077=generateJourneyLocalName(_0x50edf8['name']),_0x59c138=_0x50edf8[_0x43123f(0x177)]===SEGMENT_KIND_JOURNEY&&_0x238077!==undefined;let _0x16bcaf=_0x50edf8[_0x43123f(0x1ad)],_0x251935;if(_0x59c138&&_0x50edf8[_0x43123f(0x12e)]){const _0x57cf67=apiRuleToYaml(_0x50edf8[_0x43123f(0x12e)]);_0x289319[_0x43123f(0x188)](_0x579401,_0x57cf67);const _0x3d2ac2=async _0x1fdb84=>{const _0x273b88=_0x43123f,_0x522c58=collectSegmentRefsFromRule(_0x1fdb84);for(const _0x418245 of _0x522c58){if(!_0x289319[_0x273b88(0x16e)](_0x418245))try{const _0x140825=await fetchSegment(_0x1b5278,_0x278753,_0x418245,_0x321806);if(_0x140825?.[_0x273b88(0x12e)]){const _0x5ab5ca=apiRuleToYaml(_0x140825[_0x273b88(0x12e)]);_0x289319[_0x273b88(0x188)](_0x418245,_0x5ab5ca),await _0x3d2ac2(_0x5ab5ca);}}catch(_0x3e0ea8){logger['debug']('Failed\x20to\x20fetch\x20referenced\x20segment\x20'+_0x418245+':\x20'+_0x3e0ea8);}}};await _0x3d2ac2(_0x57cf67);const _0x2b22a3=serializeExpandedRule(_0x57cf67,_0x289319),_0x12875e=_0xf0cc66[_0x43123f(0x18f)](_0x2b22a3);if(_0x12875e&&_0x12875e[_0x43123f(0x1a2)]>0x0){const _0x12464e=_0x4eadb9[_0x43123f(0x18f)](_0x2b22a3)||0x0,_0x4997c3=_0x12875e[_0x12464e]||_0x12875e[_0x12875e[_0x43123f(0x1a2)]-0x1];_0x4eadb9['set'](_0x2b22a3,_0x12464e+0x1),_0x16bcaf=_0x4997c3,_0x585607[_0x43123f(0xf0)](_0x16bcaf),_0x1cf02d['set'](_0x579401,_0x16bcaf);const _0x2ba9a8=await resolveRuleSegmentRefs(_0x57cf67,async _0x47aac2=>{const _0x287b0d=_0x43123f,_0x56dce6=_0x1cf02d[_0x287b0d(0x18f)](_0x47aac2);if(_0x56dce6)return _0x56dce6;const _0x1fb3f8=await _0x1fe088[_0x287b0d(0x1af)](_0x47aac2);return _0x1fb3f8['name'];});_0x251935={'description':_0x50edf8[_0x43123f(0x1a4)],'rule':_0x2ba9a8};}else{const _0x588d97=_0x6bf954[_0x43123f(0x18f)](_0x2b22a3);if(_0x588d97)_0x16bcaf=_0x588d97,_0x1cf02d['set'](_0x579401,_0x16bcaf);else{if(_0x238077){let _0x18689c=_0x238077,_0xd46847=0x2;while(_0x585607[_0x43123f(0x16e)](_0x18689c)||_0x37eb11[_0x43123f(0x16e)](_0x18689c)){_0x18689c=_0x238077+'_'+_0xd46847,_0xd46847++;}_0x585607[_0x43123f(0xf0)](_0x18689c),_0x16bcaf=_0x18689c;}_0x1cf02d[_0x43123f(0x188)](_0x579401,_0x16bcaf),_0x6bf954[_0x43123f(0x188)](_0x2b22a3,_0x16bcaf);const _0x5cf7ee=await resolveRuleSegmentRefs(_0x57cf67,async _0x1853b9=>{const _0x6f9c49=_0x43123f,_0x2e05d2=_0x1cf02d[_0x6f9c49(0x18f)](_0x1853b9);if(_0x2e05d2)return _0x2e05d2;const _0x4e615e=await _0x1fe088[_0x6f9c49(0x1af)](_0x1853b9);return _0x4e615e['name'];});_0x251935={'description':_0x50edf8[_0x43123f(0x1a4)],'rule':_0x5cf7ee};}}}return{'name':_0x16bcaf,'isJourneyLocal':_0x59c138,'definition':_0x251935};}catch(_0x7d167d){return logger[_0x43123f(0x127)](_0x43123f(0x1b7)+_0x579401+':\x20'+_0x7d167d),{'name':_0x579401,'isJourneyLocal':![]};}},'resolveActivation':async _0x5c58b7=>{const _0xaae2=a152_0x29c9,_0x1ebbe9=_0xcc9512[_0xaae2(0x18f)](_0x5c58b7);if(_0x1ebbe9!==undefined)return{'name':_0x1ebbe9,'isJourneyLocal':!![]};try{let _0x3d5fd7=_0x439409?.[_0xaae2(0x18f)](_0x5c58b7);!_0x3d5fd7&&(_0x3d5fd7=await _0x1b5278[_0xaae2(0x17a)][_0xaae2(0xe7)](_0x41d1eb,_0x5c58b7));const _0x3cc8ba=_0x3d5fd7[_0xaae2(0x194)][_0xaae2(0x142)][_0xaae2(0x1ad)]||_0x5c58b7,_0x1ae882=sanitizeYamlKey(_0x3cc8ba)||_0xaae2(0x16a)+_0x5c58b7,_0x4d6232=_0x1ae882;_0xcc9512['set'](_0x5c58b7,_0x4d6232);const _0x2a2673=journeyActivationStepToYaml(_0x3d5fd7,_0x38635e,_0x584440);return{'name':_0x4d6232,'isJourneyLocal':!![],'definition':_0x2a2673};}catch(_0x4007c2){return logger[_0xaae2(0x127)](_0xaae2(0xe2)+_0x5c58b7+':\x20'+_0x4007c2),{'name':_0x5c58b7,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x2c52ae,_0x3366fb)=>resolveJumpTarget(_0x2c52ae,_0x3366fb,_0x159573,async _0x1533e9=>{const _0x22644f=a152_0x29c9,_0x1b5d2c=_0x205197?.[_0x22644f(0x18f)](_0x1533e9);if(_0x1b5d2c)return _0x1b5d2c;return _0x1b5278[_0x22644f(0x17a)][_0x22644f(0xbc)](_0x1533e9);})};return _0x1fe088=_0x3b11e1,_0x3b11e1;},_0x410a29=async _0x1e9096=>{const _0x1d1cee=a152_0x29c9,{collectSegmentIdsFromJourneyApi:_0x327e66}=await import('./journey-yaml.js'),{batchAsync:_0x152f13}=await import('../../utils/async.js'),_0x515c5c=new Set();for(const _0x447c58 of _0x1e9096){let _0x5b12a6=_0x205197?.[_0x1d1cee(0x18f)](_0x447c58);!_0x5b12a6&&(_0x5b12a6=await _0x1b5278[_0x1d1cee(0x17a)][_0x1d1cee(0xbc)](_0x447c58));const _0x1e2323=_0x327e66(_0x5b12a6);for(const _0x5c88b1 of _0x1e2323){_0x515c5c[_0x1d1cee(0xf0)](_0x5c88b1);}}let _0x4478a9=Array['from'](_0x515c5c);while(_0x4478a9['length']>0x0){const _0x25fff5=_0x4478a9['filter'](_0x53c5ef=>!_0x20b4ad[_0x1d1cee(0x16e)](_0x53c5ef));if(_0x25fff5[_0x1d1cee(0x1a2)]===0x0)break;const _0x54083a=await _0x152f13(_0x25fff5,async _0x2861a4=>{const _0x27e5c2=_0x1d1cee;_0x20b4ad[_0x27e5c2(0xf0)](_0x2861a4);const _0xdb7f9=await fetchSegment(_0x1b5278,_0x278753,_0x2861a4,_0x321806);if(!_0xdb7f9)return null;return{'segmentId':_0x2861a4,'segment':_0xdb7f9};},0xa),_0x5303e1=new Set();for(const _0x3b04ed of _0x54083a){if(!_0x3b04ed?.['segment']?.[_0x1d1cee(0x12e)])continue;const _0x46a7fe=apiRuleToYaml(_0x3b04ed[_0x1d1cee(0x14f)][_0x1d1cee(0x12e)]);_0x289319[_0x1d1cee(0x188)](_0x3b04ed[_0x1d1cee(0xf2)],_0x46a7fe);const _0xc80bb9=collectSegmentRefsFromRule(_0x46a7fe);for(const _0x5a8a50 of _0xc80bb9){!_0x20b4ad[_0x1d1cee(0x16e)](_0x5a8a50)&&_0x5303e1[_0x1d1cee(0xf0)](_0x5a8a50);}}_0x4478a9=Array[_0x1d1cee(0x13b)](_0x5303e1);}};return{'createYamlContext':_0x13fb21,'prefetchJourneySegments':_0x410a29};}export async function executePushSegments(_0x175acd,_0x4eb553,_0x3be075,_0x4b152c,_0x527b56){const _0x572e4f=a152_0x25b375,{segmentDefToCreateRequest:_0x204ff6,segmentDefToUpdateRequest:_0x19974a}=await import(_0x572e4f(0x196)),_0x104e60=_0x3be075[_0x572e4f(0xc7)],_0x285c19=0x5,_0x5c3569=async _0x655954=>{const _0x387c4e=_0x572e4f,_0x28aed8=_0x655954[_0x387c4e(0x17e)]?_0x104e60[_0x387c4e(0x18f)](_0x655954[_0x387c4e(0x17e)]):undefined;let _0x105346;const _0x3fe450={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x4a16bd=_0x655954['yamlConfig'];if(_0x655954[_0x387c4e(0x171)][_0x387c4e(0x12e)]){const _0x3e379f=createSegmentIdResolver(_0x3be075[_0x387c4e(0x18c)],_0x655954[_0x387c4e(0x171)][_0x387c4e(0x1ad)]),_0x43ad42=await resolveRuleSegmentIds(_0x655954[_0x387c4e(0x171)][_0x387c4e(0x12e)],_0x3e379f);_0x4a16bd={..._0x655954[_0x387c4e(0x171)],'rule':_0x43ad42};}try{if(_0x655954['isNew']){_0x527b56[_0x387c4e(0x118)]?.({'type':_0x387c4e(0x105),'name':_0x655954['yamlConfig'][_0x387c4e(0x1ad)]});const _0x337d5a=_0x204ff6(_0x4a16bd,_0x28aed8),_0x4775b6=await _0x527b56['withProgress'](_0x387c4e(0xc3)+_0x655954['yamlConfig'][_0x387c4e(0x1ad)]+'\x27...',()=>_0x175acd[_0x387c4e(0x14f)][_0x387c4e(0x147)](_0x4b152c[_0x387c4e(0x114)],_0x337d5a));_0x105346=_0x4775b6[_0x387c4e(0x13a)]['id'],_0x3be075[_0x387c4e(0x18c)][_0x387c4e(0x188)](_0x655954[_0x387c4e(0x171)][_0x387c4e(0x1ad)],_0x105346),_0x3fe450[_0x387c4e(0xdc)]={'name':_0x655954[_0x387c4e(0x171)]['name'],'id':_0x105346},_0x527b56['onProgress']?.({'type':'segment_created','name':_0x655954[_0x387c4e(0x171)]['name'],'segmentId':_0x105346}),_0x527b56[_0x387c4e(0x17d)]?.(_0x387c4e(0x137)+_0x655954[_0x387c4e(0x171)]['name']+'\x27'),_0x3fe450[_0x387c4e(0xec)]=0x1;}else{if(_0x655954['hasChanges']){_0x527b56[_0x387c4e(0x118)]?.({'type':_0x387c4e(0x18b),'name':_0x655954[_0x387c4e(0x171)]['name']});const _0x4d3b13=_0x19974a(_0x4a16bd);_0x28aed8!==_0x655954[_0x387c4e(0x133)]?.[_0x387c4e(0xc4)]&&(_0x4d3b13[_0x387c4e(0xc4)]=_0x28aed8?parseInt(_0x28aed8,0xa):undefined),await _0x527b56['withProgress'](_0x387c4e(0xcb)+_0x655954['yamlConfig'][_0x387c4e(0x1ad)]+_0x387c4e(0x148),()=>_0x175acd['segment'][_0x387c4e(0x1b8)](_0x4b152c[_0x387c4e(0x114)],_0x655954[_0x387c4e(0x133)]['id'],_0x4d3b13)),_0x105346=_0x655954[_0x387c4e(0x133)]['id'],_0x527b56[_0x387c4e(0x118)]?.({'type':_0x387c4e(0x181),'name':_0x655954['yamlConfig'][_0x387c4e(0x1ad)]}),_0x527b56['logSuccess']?.(_0x387c4e(0xd4)+_0x655954[_0x387c4e(0x171)][_0x387c4e(0x1ad)]+'\x27'),_0x3fe450[_0x387c4e(0x125)]=0x1;}else _0x105346=_0x655954[_0x387c4e(0x133)]['id'];}}catch(_0x189e33){const _0x2b16f4=isHttp400Error(_0x189e33),_0x2becfe=_0x2b16f4?ErrorCode[_0x387c4e(0x16d)]:ErrorCode[_0x387c4e(0xf1)],_0x4c05f6=getErrorMessage(_0x189e33);throw new SDKError(_0x2becfe,'Failed\x20to\x20'+(_0x655954[_0x387c4e(0x139)]?_0x387c4e(0x10b):'update')+_0x387c4e(0xd5)+_0x655954[_0x387c4e(0x144)]+_0x387c4e(0x172)+_0x4c05f6,_0x189e33);}try{const _0x33c946=await syncActivationsForSegment(_0x175acd,_0x4b152c['parentId'],_0x105346,_0x655954[_0x387c4e(0x171)][_0x387c4e(0x1ad)],_0x655954[_0x387c4e(0x102)],_0x527b56,_0x655954[_0x387c4e(0x144)]);_0x3fe450[_0x387c4e(0xba)]=_0x33c946;}catch(_0x1ea355){if(_0x1ea355 instanceof SDKError)throw _0x1ea355;throw new SDKError(ErrorCode[_0x387c4e(0x1bb)],'Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27'+_0x655954[_0x387c4e(0x171)][_0x387c4e(0x1ad)]+_0x387c4e(0x170)+_0x655954[_0x387c4e(0x144)]+_0x387c4e(0x172)+getErrorMessage(_0x1ea355),_0x1ea355);}return _0x3fe450;},_0x528f91=await batchAsync(_0x4eb553,_0x5c3569,_0x285c19),_0x2ddd3f={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x3ee93d of _0x528f91){_0x2ddd3f[_0x572e4f(0xec)]+=_0x3ee93d[_0x572e4f(0xec)],_0x2ddd3f['updated']+=_0x3ee93d[_0x572e4f(0x125)],_0x3ee93d[_0x572e4f(0xdc)]&&_0x2ddd3f[_0x572e4f(0xde)]['set'](_0x3ee93d['createdSegmentId'][_0x572e4f(0x1ad)],_0x3ee93d['createdSegmentId']['id']),_0x2ddd3f[_0x572e4f(0xba)]['created']+=_0x3ee93d[_0x572e4f(0xba)][_0x572e4f(0xec)],_0x2ddd3f[_0x572e4f(0xba)]['updated']+=_0x3ee93d[_0x572e4f(0xba)]['updated'],_0x2ddd3f[_0x572e4f(0xba)][_0x572e4f(0x12b)]+=_0x3ee93d[_0x572e4f(0xba)]['deleted'];}return _0x2ddd3f;}async function syncActivationsForSegment(_0xeae6d3,_0x33caa8,_0x19803a,_0x50115a,_0x1842bb,_0x4688f0,_0x43d22c){const _0x3894ab=a152_0x25b375,_0x380c96={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x101cd0 of _0x1842bb){try{if(_0x101cd0[_0x3894ab(0xd9)]===_0x3894ab(0x10b)&&_0x101cd0[_0x3894ab(0x160)])_0x4688f0['onProgress']?.({'type':_0x3894ab(0x140),'segmentName':_0x50115a,'activationName':_0x101cd0[_0x3894ab(0x1ad)]}),await _0x4688f0[_0x3894ab(0x113)](_0x3894ab(0xe9)+_0x101cd0[_0x3894ab(0x1ad)]+_0x3894ab(0x148),()=>_0xeae6d3[_0x3894ab(0x14f)][_0x3894ab(0x1bd)](_0x33caa8,_0x19803a,_0x101cd0[_0x3894ab(0x160)])),_0x4688f0['onProgress']?.({'type':'activation_created','segmentName':_0x50115a,'activationName':_0x101cd0[_0x3894ab(0x1ad)]}),_0x4688f0[_0x3894ab(0x17d)]?.(_0x3894ab(0xef)+_0x101cd0[_0x3894ab(0x1ad)]+'\x27'),_0x380c96[_0x3894ab(0xec)]++;else{if(_0x101cd0[_0x3894ab(0xd9)]===_0x3894ab(0x11e)&&_0x101cd0['validatedRequest']&&_0x101cd0[_0x3894ab(0x1b3)])_0x4688f0[_0x3894ab(0x118)]?.({'type':_0x3894ab(0x190),'segmentName':_0x50115a,'activationName':_0x101cd0[_0x3894ab(0x1ad)]}),await _0x4688f0[_0x3894ab(0x113)](_0x3894ab(0x149)+_0x101cd0[_0x3894ab(0x1ad)]+_0x3894ab(0x148),()=>_0xeae6d3[_0x3894ab(0x14f)]['updateActivation'](_0x33caa8,_0x19803a,_0x101cd0['existingActivation']['id'],_0x101cd0[_0x3894ab(0x160)])),_0x4688f0['onProgress']?.({'type':'activation_updated','segmentName':_0x50115a,'activationName':_0x101cd0[_0x3894ab(0x1ad)]}),_0x4688f0[_0x3894ab(0x17d)]?.('Updated\x20activation\x20\x27'+_0x101cd0[_0x3894ab(0x1ad)]+'\x27'),_0x380c96[_0x3894ab(0x125)]++;else _0x101cd0['type']==='delete'&&_0x101cd0[_0x3894ab(0x1b3)]&&(_0x4688f0[_0x3894ab(0x118)]?.({'type':'activation_deleting','segmentName':_0x50115a,'activationName':_0x101cd0[_0x3894ab(0x1ad)]}),await _0x4688f0[_0x3894ab(0x113)](_0x3894ab(0xce)+_0x101cd0[_0x3894ab(0x1ad)]+'\x27...',()=>_0xeae6d3[_0x3894ab(0x14f)][_0x3894ab(0x19a)](_0x33caa8,_0x19803a,_0x101cd0[_0x3894ab(0x1b3)]['id'])),_0x4688f0[_0x3894ab(0x118)]?.({'type':'activation_deleted','segmentName':_0x50115a,'activationName':_0x101cd0[_0x3894ab(0x1ad)]}),_0x4688f0[_0x3894ab(0xe3)]?.(_0x3894ab(0x11d)+_0x101cd0[_0x3894ab(0x1ad)]+'\x27'),_0x380c96['deleted']++);}}catch(_0x1e796b){const _0x2fb477=isHttp400Error(_0x1e796b),_0x4b14f6=_0x2fb477?ErrorCode[_0x3894ab(0x155)]:ErrorCode[_0x3894ab(0x1bb)],_0x42a18a=getErrorMessage(_0x1e796b);throw new SDKError(_0x4b14f6,_0x3894ab(0x12f)+_0x101cd0[_0x3894ab(0xd9)]+_0x3894ab(0x182)+_0x101cd0[_0x3894ab(0x1ad)]+_0x3894ab(0x170)+_0x43d22c+'\x0a\x20\x20'+_0x42a18a,_0x1e796b);}}return _0x380c96;}export async function executePushFolders(_0x2c4d07,_0x2cb8ae,_0x3d2da3,_0x1b76a3,_0x2d6c9d){const _0x2c7346=a152_0x25b375,_0x39af67=new Map(_0x3d2da3),_0x53c08d=sortFoldersByDepth(_0x2cb8ae);for(const _0x3a70e1 of _0x53c08d){const _0x47b478=_0x3a70e1[_0x2c7346(0x19b)]('/'),_0x161b91=_0x47b478[_0x47b478[_0x2c7346(0x1a2)]-0x1],_0x22c407=_0x47b478['slice'](0x0,-0x1)[_0x2c7346(0x12d)]('/'),_0x106696=_0x39af67[_0x2c7346(0x18f)](_0x22c407);_0x2d6c9d[_0x2c7346(0x118)]?.({'type':_0x2c7346(0x1a6),'folder':_0x3a70e1});const _0x3e8845={'name':_0x161b91,'parentFolderId':_0x106696},_0x2292c9=await _0x2d6c9d[_0x2c7346(0x113)](_0x2c7346(0x186)+_0x3a70e1+_0x2c7346(0x148),()=>_0x2c4d07[_0x2c7346(0x14f)]['createFolder'](_0x1b76a3['parentId'],_0x3e8845));_0x39af67['set'](_0x3a70e1,_0x2292c9[_0x2c7346(0x13a)]['id']),_0x2d6c9d[_0x2c7346(0x118)]?.({'type':'folder_created','folder':_0x3a70e1,'folderId':_0x2292c9['data']['id']}),_0x2d6c9d['logInfo']?.(_0x2c7346(0x167)+_0x3a70e1+'\x27');}return _0x39af67;}export async function executePushSegmentDeletions(_0xfdb52e,_0xe88081,_0xc483da){const _0x34155c=a152_0x25b375;if(_0xe88081[_0x34155c(0x1a2)]===0x0)return 0x0;const {batchAsync:_0x4952ce}=await import(_0x34155c(0x110)),_0x4a8871=0x5,_0x370635=await _0x4952ce(_0xe88081,async _0x343ea1=>{const _0x1bcb51=_0x34155c;return _0xc483da[_0x1bcb51(0x118)]?.({'type':_0x1bcb51(0x17c),'name':_0x343ea1['name']}),await _0xfdb52e[_0x1bcb51(0x14f)][_0x1bcb51(0x10a)](_0x343ea1['id']),_0xc483da['onProgress']?.({'type':'segment_deleted','name':_0x343ea1[_0x1bcb51(0x1ad)]}),_0xc483da[_0x1bcb51(0xe3)]?.(_0x1bcb51(0xe8)+_0x343ea1[_0x1bcb51(0x1ad)]+'\x27'),0x1;},_0x4a8871);return _0x370635['reduce']((_0x4767c9,_0x117063)=>_0x4767c9+_0x117063,0x0);}export async function executePushJourneys(_0x3c2e37,_0x1dc704,_0x14b5b8,_0x48540a,_0x3ddce9){const _0x17c44a=a152_0x25b375,{journeyDefToRequest:_0xfacf6e}=await import(_0x17c44a(0xf7)),{activationDefToCreateRequest:_0x493414,yamlRuleToApi:_0xfed4e1,validateSegmentRule:_0x423e23}=await import(_0x17c44a(0x196)),_0x36a6e9={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x2cde05=new Map(_0x14b5b8['segmentNameToId']),_0x8cf3a2=0x5;for(let _0x2553c3=0x0;_0x2553c3<_0x1dc704[_0x17c44a(0x1a2)];_0x2553c3+=_0x8cf3a2){const _0x10d69f=_0x1dc704[_0x17c44a(0xc5)](_0x2553c3,_0x2553c3+_0x8cf3a2),_0xf4a2b0=await Promise[_0x17c44a(0xe5)](_0x10d69f[_0x17c44a(0x11f)](async _0x20c261=>{const _0x533ba6=_0x17c44a;if(!_0x20c261[_0x533ba6(0x139)]&&!_0x20c261[_0x533ba6(0x146)])return{'action':_0x533ba6(0x16c),'name':_0x20c261['yamlConfig'][_0x533ba6(0x1ad)],'journeyId':_0x20c261[_0x533ba6(0x10e)]?.['id']};const _0x2c3396=_0x20c261[_0x533ba6(0x17e)]?_0x14b5b8[_0x533ba6(0xc7)][_0x533ba6(0x18f)](_0x20c261[_0x533ba6(0x17e)]):undefined;_0x3ddce9[_0x533ba6(0x118)]?.({'type':_0x20c261['isNew']?_0x533ba6(0x11c):_0x533ba6(0x15d),'name':_0x20c261[_0x533ba6(0x171)][_0x533ba6(0x1ad)]});try{const _0x308d7c=await executeSingleJourneyPush(_0x3c2e37,_0x20c261,{..._0x14b5b8,'segmentNameToId':_0x2cde05},{'parentId':_0x48540a[_0x533ba6(0x114)],'rootFolderId':_0x48540a[_0x533ba6(0x135)],'folderId':_0x2c3396,'verbose':_0x48540a[_0x533ba6(0x1b9)]},_0x3ddce9,{'journeyDefToRequest':_0xfacf6e,'activationDefToCreateRequest':_0x493414,'yamlRuleToApi':_0xfed4e1,'validateSegmentRule':_0x423e23});for(const [_0x52df6a,_0xbe4775]of _0x308d7c['embeddedSegmentNameToId']){_0x2cde05['set'](_0x52df6a,_0xbe4775),_0x36a6e9[_0x533ba6(0x107)][_0x533ba6(0x188)](_0x52df6a,_0xbe4775);}if(_0x308d7c[_0x533ba6(0x176)]===_0x533ba6(0xec))_0x3ddce9[_0x533ba6(0x118)]?.({'type':_0x533ba6(0x1a0),'name':_0x20c261[_0x533ba6(0x171)][_0x533ba6(0x1ad)],'journeyId':_0x308d7c[_0x533ba6(0x1ac)]}),_0x3ddce9[_0x533ba6(0x17d)]?.(_0x533ba6(0x1b5)+_0x20c261['yamlConfig'][_0x533ba6(0x1ad)]+'\x27'),_0x36a6e9[_0x533ba6(0xec)]++;else _0x308d7c['action']===_0x533ba6(0x125)&&(_0x3ddce9[_0x533ba6(0x118)]?.({'type':_0x533ba6(0x100),'name':_0x20c261[_0x533ba6(0x171)][_0x533ba6(0x1ad)]}),_0x3ddce9[_0x533ba6(0x17d)]?.(_0x533ba6(0x111)+_0x20c261[_0x533ba6(0x171)][_0x533ba6(0x1ad)]+'\x27'),_0x36a6e9[_0x533ba6(0x125)]++);return{'action':_0x308d7c['action'],'name':_0x20c261[_0x533ba6(0x171)][_0x533ba6(0x1ad)],'journeyId':_0x308d7c[_0x533ba6(0x1ac)]};}catch(_0x49857c){const _0x43b68e=isHttp400Error(_0x49857c),_0x33f321=_0x43b68e?ErrorCode['JOURNEY_SYNTAX_ERROR']:ErrorCode[_0x533ba6(0x141)],_0x3d9082=getErrorMessage(_0x49857c);throw new SDKError(_0x33f321,_0x533ba6(0x12f)+(_0x20c261['isNew']?_0x533ba6(0x10b):_0x533ba6(0x11e))+'\x20journey\x20from\x20file:\x20'+_0x20c261[_0x533ba6(0x144)]+_0x533ba6(0x172)+_0x3d9082,_0x49857c);}}));_0x36a6e9[_0x17c44a(0x11a)]['push'](..._0xf4a2b0);}return _0x36a6e9;}async function matchExistingJourneySegments(_0x2409cb,_0x3c5f16,_0x53bc53,_0x362e04,_0x3f4746){const _0x449735=a152_0x25b375;if(!_0x3c5f16[_0x449735(0x10e)]||!_0x3c5f16['yamlConfig'][_0x449735(0x152)])return;const _0x1b1daf=new Map(),_0x24b79f=new Set();for(const _0x217a99 of Object[_0x449735(0xfc)](_0x3c5f16[_0x449735(0x171)][_0x449735(0x152)])){const _0x41a397=generateDeterministicJourneySegmentName(_0x3c5f16[_0x449735(0x171)][_0x449735(0x1ad)],_0x217a99);_0x1b1daf['set'](_0x41a397,_0x217a99),_0x24b79f[_0x449735(0xf0)](_0x217a99);}const _0x36e824=[],_0x5779aa=collectSegmentIdsFromJourneyApi(_0x3c5f16['existingJourney']);for(const _0x52d3de of _0x5779aa){const _0x424fc1=await fetchSegment(_0x2409cb,_0x53bc53,_0x52d3de,_0x362e04);if(!_0x424fc1?.[_0x449735(0x1ad)])continue;const _0x112bde=_0x1b1daf[_0x449735(0x18f)](_0x424fc1['name']);_0x112bde?(_0x3f4746[_0x449735(0x188)](_0x112bde,_0x52d3de),_0x24b79f[_0x449735(0xbb)](_0x112bde)):_0x36e824['push']({'id':_0x52d3de,'seg':_0x424fc1});}if(_0x24b79f[_0x449735(0x19e)]>0x0&&_0x36e824[_0x449735(0x1a2)]>0x0){const {localExpandedRuleToNames:_0x301b7b}=buildLocalExpandedRuleMappings(_0x3c5f16[_0x449735(0x171)]),_0x1a64cb=new Map();for(const {id:_0x1e4194,seg:_0x228bd9}of _0x36e824){if(_0x228bd9[_0x449735(0x12e)]){const _0x83332c=apiRuleToYaml(_0x228bd9[_0x449735(0x12e)]);_0x1a64cb['set'](_0x1e4194,_0x83332c);}}for(const {id:_0x574a7e,seg:_0x38e24d}of _0x36e824){if(!_0x38e24d[_0x449735(0x12e)])continue;const _0x3fdd13=_0x1a64cb[_0x449735(0x18f)](_0x574a7e);if(!_0x3fdd13)continue;const _0x47f1ee=serializeExpandedRule(_0x3fdd13,_0x1a64cb),_0x219170=_0x301b7b[_0x449735(0x18f)](_0x47f1ee);if(_0x219170){const _0x1ba63f=_0x219170[_0x449735(0x106)](_0x31861b=>_0x24b79f[_0x449735(0x16e)](_0x31861b));_0x1ba63f&&(_0x3f4746[_0x449735(0x188)](_0x1ba63f,_0x574a7e),_0x24b79f[_0x449735(0xbb)](_0x1ba63f),logger[_0x449735(0x127)](_0x449735(0x122)+_0x38e24d[_0x449735(0x1ad)]+_0x449735(0x18d)+_0x1ba63f+_0x449735(0xd3)));}}}}async function executeSingleJourneyPush(_0x4b2109,_0x324315,_0x4ccae5,_0x34ac1e,_0x12e46b,_0x5e6769){const _0x3a17f3=a152_0x25b375,{journeyDefToRequest:_0x472f47,activationDefToCreateRequest:_0x2408ff,yamlRuleToApi:_0x2f953a,validateSegmentRule:_0x449b5c}=_0x5e6769,_0x44235b=new Map(),_0xf67060=new Map();recoverSegmentIdsFromPushRecovery(_0x324315,_0x44235b,_0x4ccae5[_0x3a17f3(0x18c)]);const _0x5bf23e=new Map(),_0x336257=new Map(),_0x4abec2=new Map();let _0x5cdb97;const _0x4f7b04=async()=>{const _0x50a851=_0x3a17f3;if(_0x5cdb97)return;_0x5cdb97=new Map();if(!_0x324315[_0x50a851(0x10e)])return;const _0x37fdba=await _0x4b2109[_0x50a851(0x17a)][_0x50a851(0x120)](_0x324315[_0x50a851(0x10e)]['id']);for(const _0xc0ad76 of _0x37fdba){const _0x553993=journeyActivationStepToYaml(_0xc0ad76,_0x4ccae5[_0x50a851(0x1aa)],_0x4ccae5[_0x50a851(0x168)]),_0x3e0ce4=activationSignature(_0x553993);!_0x5cdb97[_0x50a851(0x16e)](_0x3e0ce4)&&_0x5cdb97[_0x50a851(0x188)](_0x3e0ce4,_0xc0ad76['id']),_0x553993['name']&&_0xf67060[_0x50a851(0x188)](_0x553993[_0x50a851(0x1ad)],_0xc0ad76['id']);}};await matchExistingJourneySegments(_0x4b2109,_0x324315,_0x34ac1e[_0x3a17f3(0x114)],_0x4ccae5[_0x3a17f3(0x1be)],_0x4ccae5[_0x3a17f3(0x18c)]);const _0x2b3397={'resolveSegmentId':async _0x260002=>{const _0x350920=_0x3a17f3,_0x4194af=_0x4ccae5[_0x350920(0x18c)]['get'](_0x260002);if(!_0x4194af)throw new SDKError(ErrorCode[_0x350920(0xb9)],'Segment\x20not\x20found:\x20'+_0x260002+_0x350920(0x180)+_0x324315[_0x350920(0x171)]['name']+')');return _0x4194af;},'resolveEmbeddedSegmentId':async(_0x10623c,_0x4a2ed4)=>{const _0x12cef3=_0x3a17f3,_0x18f2a7=_0x4ccae5[_0x12cef3(0x18c)]['get'](_0x10623c);if(_0x18f2a7)return _0x18f2a7;const _0x276af6=_0x4ccae5['existingSegments']['find'](_0x5632c9=>_0x5632c9['name']===_0x10623c);if(_0x276af6)return _0x4ccae5[_0x12cef3(0x18c)][_0x12cef3(0x188)](_0x10623c,_0x276af6['id']),_0x276af6['id'];if(_0x324315[_0x12cef3(0x139)]){const {stageName:_0x2a43a1,criteriaName:_0x4e8679}=findSegmentCriteriaLocation(_0x324315[_0x12cef3(0x171)],_0x10623c);return _0x449b5c(_0x10623c,_0x4a2ed4[_0x12cef3(0x12e)]),_0x336257['set'](_0x10623c,{'definition':_0x4a2ed4,'stageName':_0x2a43a1,'criteriaName':_0x4e8679}),createPendingSegmentId(_0x10623c);}const _0x1c7f29=_0x324315[_0x12cef3(0x10e)]?.['id'];if(!_0x1c7f29)throw new SDKError(ErrorCode['INTERNAL'],'Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID');const _0xa505c3=_0x5bf23e[_0x12cef3(0x18f)](_0x10623c);if(_0xa505c3)return _0xa505c3;const _0x213f90=((async()=>{const _0x3de1b8=_0x12cef3;_0x449b5c(_0x10623c,_0x4a2ed4[_0x3de1b8(0x12e)]);const _0x48c181=generateDeterministicJourneySegmentName(_0x324315[_0x3de1b8(0x171)][_0x3de1b8(0x1ad)],_0x10623c),_0x4a4bc2=_0x4ccae5[_0x3de1b8(0x1be)][_0x3de1b8(0x106)](_0x430085=>_0x430085[_0x3de1b8(0x1ad)]===_0x48c181),_0x23772a=createSegmentIdResolver(_0x4ccae5['segmentNameToId'],_0x10623c),_0x2bb58d=await resolveRuleSegmentIds(_0x4a2ed4[_0x3de1b8(0x12e)],_0x23772a);let _0x36651e;return _0x4a4bc2?(await _0x4b2109['segment'][_0x3de1b8(0x1b8)](_0x34ac1e[_0x3de1b8(0x114)],_0x4a4bc2['id'],{'description':_0x4a2ed4[_0x3de1b8(0x1a4)]||_0x3de1b8(0x14c)+_0x10623c,'rule':_0x2f953a(_0x2bb58d),'countPopulation':!![]}),_0x36651e=_0x4a4bc2['id'],saveSegmentToPushRecovery(_0x324315['absolutePath'],_0x324315[_0x3de1b8(0x171)][_0x3de1b8(0x1ad)],_0x10623c,{'segmentId':_0x36651e,'uniqueServerName':_0x48c181,'createdAt':new Date()['toISOString']()})):_0x36651e=await createOrRecoverEmbeddedSegment(_0x4b2109,_0x324315,{'localName':_0x10623c,'uniqueSegmentName':_0x48c181,'description':_0x4a2ed4['description']||_0x3de1b8(0x14c)+_0x10623c,'journeyId':_0x1c7f29,'resolvedRule':_0x2bb58d,'parentId':_0x34ac1e[_0x3de1b8(0x114)],'folderId':_0x34ac1e[_0x3de1b8(0x135)]||''},_0x2f953a),_0x4ccae5[_0x3de1b8(0x18c)][_0x3de1b8(0x188)](_0x10623c,_0x36651e),_0x44235b[_0x3de1b8(0x188)](_0x10623c,_0x36651e),_0x36651e;})());_0x5bf23e[_0x12cef3(0x188)](_0x10623c,_0x213f90);try{return await _0x213f90;}finally{_0x5bf23e[_0x12cef3(0xbb)](_0x10623c);}},'resolveActivationId':async _0x114d44=>{const _0x4e3382=_0x3a17f3,_0x4a7b7a=_0xf67060[_0x4e3382(0x18f)](_0x114d44);if(_0x4a7b7a)return _0x4a7b7a;if(_0x324315['existingJourney']){await _0x4f7b04();const _0x3ce7b7=_0xf67060['get'](_0x114d44);if(_0x3ce7b7)return _0x3ce7b7;}throw new SDKError(ErrorCode[_0x4e3382(0xdf)],'Activation\x20not\x20found:\x20'+_0x114d44+_0x4e3382(0x180)+_0x324315[_0x4e3382(0x171)][_0x4e3382(0x1ad)]+').\x20'+_0x4e3382(0xd2));},'resolveEmbeddedActivationId':async(_0x5c332f,_0x431d6a)=>{const _0x1052ca=_0x3a17f3,_0x329c99=_0xf67060[_0x1052ca(0x18f)](_0x5c332f);if(_0x329c99)return _0x329c99;if(_0x324315[_0x1052ca(0x139)])return _0x4abec2[_0x1052ca(0x188)](_0x5c332f,_0x431d6a),createPendingActivationId(_0x5c332f);if(_0x324315[_0x1052ca(0x10e)]){await _0x4f7b04();const _0x565f55=_0xf67060['get'](_0x431d6a['name']);if(_0x565f55)return _0xf67060['set'](_0x5c332f,_0x565f55),_0x565f55;const _0x55106d=activationSignature(_0x431d6a),_0x4f549c=_0x5cdb97?.[_0x1052ca(0x18f)](_0x55106d);if(_0x4f549c)return _0xf67060[_0x1052ca(0x188)](_0x5c332f,_0x4f549c),_0x4f549c;const _0x19032c=await _0x2408ff(_0x431d6a,_0x4ccae5[_0x1052ca(0x134)]),_0x34e5f3={..._0x19032c,..._0x431d6a[_0x1052ca(0xd8)]!==undefined&&{'runAfterJourneyRefresh':_0x431d6a[_0x1052ca(0xd8)]}},_0x1ce369=await _0x4b2109['journey']['createActivation'](_0x324315[_0x1052ca(0x10e)]['id'],_0x34e5f3);return _0xf67060[_0x1052ca(0x188)](_0x5c332f,_0x1ce369['id']),_0x1ce369['id'];}throw new SDKError(ErrorCode[_0x1052ca(0x185)],_0x1052ca(0x183));},'resolveJourneyId':async _0x1c4cb1=>{const _0x4d8284=_0x3a17f3;try{return await _0x4b2109[_0x4d8284(0x17a)]['resolveJourneyId'](_0x34ac1e[_0x4d8284(0x114)],_0x1c4cb1);}catch(_0x23acf7){throw new SDKError(ErrorCode[_0x4d8284(0xdf)],_0x4d8284(0x15a)+_0x1c4cb1+_0x4d8284(0x13d)+_0x324315[_0x4d8284(0x171)][_0x4d8284(0x1ad)]+'\x27)',_0x23acf7);}},'resolveStageId':async(_0x104595,_0x2628e5)=>{const _0x308ff8=_0x3a17f3,_0x5d570a=await _0x4b2109['journey'][_0x308ff8(0xbc)](_0x104595),_0x1e230b=_0x5d570a['attributes'][_0x308ff8(0x1ae)][_0x308ff8(0x106)](_0x195f50=>_0x195f50['name'][_0x308ff8(0x101)]()===_0x2628e5[_0x308ff8(0x101)]());if(!_0x1e230b?.['id'])throw new SDKError(ErrorCode[_0x308ff8(0xdf)],_0x308ff8(0x128)+_0x2628e5+_0x308ff8(0x1a3)+(_0x5d570a[_0x308ff8(0x194)][_0x308ff8(0xf8)]||_0x5d570a[_0x308ff8(0x194)][_0x308ff8(0x1ad)])+'\x27');return _0x1e230b['id'];}},_0x3ec5ff=await _0x472f47(_0x324315[_0x3a17f3(0x171)],_0x34ac1e[_0x3a17f3(0x114)],_0x2b3397),_0x2b1e7d=_0x34ac1e[_0x3a17f3(0x199)]||_0x34ac1e[_0x3a17f3(0x135)];_0x2b1e7d&&(_0x3ec5ff[_0x3a17f3(0x1b4)]={'parentFolder':{'data':{'id':_0x2b1e7d,'type':'folder'}}});if(_0x324315['isNew']){if(_0x336257[_0x3a17f3(0x19e)]>0x0||_0x4abec2['size']>0x0)return await executeThreeStepJourneyCreate(_0x4b2109,_0x324315,_0x3ec5ff,{'pendingEmbeddedSegments':_0x336257,'pendingEmbeddedActivations':_0x4abec2,'embeddedSegmentNameToId':_0x44235b,'journeyActivationNameToId':_0xf67060},{..._0x34ac1e,'effectiveFolderId':_0x2b1e7d},_0x4ccae5,_0x12e46b,_0x5e6769);else{ensureJourneyDefaults(_0x3ec5ff[_0x3a17f3(0x194)]);const _0x22c716=await _0x4b2109[_0x3a17f3(0x17a)][_0x3a17f3(0x10b)](_0x3ec5ff);return deletePushRecovery(_0x324315['absolutePath']),{'action':'created','journeyId':_0x22c716['id'],'embeddedSegmentNameToId':_0x44235b};}}else{if(_0x324315[_0x3a17f3(0x146)]&&_0x324315[_0x3a17f3(0x10e)]){_0x3ec5ff['id']=_0x324315[_0x3a17f3(0x10e)]['id'];const _0x55a54a=_0x3ec5ff[_0x3a17f3(0x194)];_0x324315['existingJourney'][_0x3a17f3(0x194)]?.[_0x3a17f3(0xf8)]&&(_0x55a54a['journeyBundleName']=_0x324315['existingJourney'][_0x3a17f3(0x194)][_0x3a17f3(0xf8)]);const _0x165359=_0x324315[_0x3a17f3(0x10e)][_0x3a17f3(0x194)]?.['journeyStages'];return _0x165359&&_0x3ec5ff['attributes'][_0x3a17f3(0x1ae)]&&injectExistingStageIds(_0x3ec5ff['attributes'][_0x3a17f3(0x1ae)],_0x165359),ensureJourneyDefaults(_0x55a54a),await _0x4b2109[_0x3a17f3(0x17a)][_0x3a17f3(0x11e)](_0x324315['existingJourney']['id'],_0x3ec5ff),deletePushRecovery(_0x324315[_0x3a17f3(0x144)]),{'action':_0x3a17f3(0x125),'journeyId':_0x324315['existingJourney']['id'],'embeddedSegmentNameToId':_0x44235b};}}return deletePushRecovery(_0x324315[_0x3a17f3(0x144)]),{'action':_0x3a17f3(0x16c),'journeyId':_0x324315[_0x3a17f3(0x10e)]?.['id'],'embeddedSegmentNameToId':_0x44235b};}function findSegmentCriteriaLocation(_0x551f82,_0xefbc13){const _0x4fd584=a152_0x25b375,_0x30428a=_0x551f82[_0x4fd584(0x1a1)]||_0x551f82[_0x4fd584(0x126)]?.[0x0]?.[_0x4fd584(0x1a1)]||[];let _0x46835c=_0x4fd584(0xcd),_0x59c62f=_0xefbc13;const _0x165be8=_0x551f82[_0x4fd584(0x1a7)]||_0x551f82[_0x4fd584(0x126)]?.[0x0]?.[_0x4fd584(0x1a7)];if(_0x165be8?.[_0x4fd584(0x14f)]===_0xefbc13)return{'stageName':'goal','criteriaName':_0x165be8['name']||_0xefbc13};_0x13d8a5:for(const _0x48aab1 of _0x30428a){if(_0x48aab1[_0x4fd584(0x154)]?.['segment']===_0xefbc13){_0x46835c=_0x48aab1[_0x4fd584(0x1ad)],_0x59c62f=_0x48aab1['entry_criteria'][_0x4fd584(0x1ad)]||_0xefbc13;break;}if(_0x48aab1[_0x4fd584(0xdd)])for(const _0x301eb9 of _0x48aab1['steps']){if(_0x301eb9['type']===_0x4fd584(0x17f)&&_0x301eb9['with']?.[_0x4fd584(0x198)])for(const _0x55dc5d of _0x301eb9[_0x4fd584(0x143)]['branches']){if(_0x55dc5d[_0x4fd584(0x14f)]===_0xefbc13){_0x46835c=_0x48aab1['name'],_0x59c62f=_0x55dc5d[_0x4fd584(0x1ad)]||_0xefbc13;break _0x13d8a5;}}}}return{'stageName':_0x46835c,'criteriaName':_0x59c62f};}async function executeThreeStepJourneyCreate(_0x825910,_0x24f576,_0x33cbe2,_0x3bad70,_0x218c04,_0x54405d,_0x40cdc7,_0x1a979c){const _0x48c2b9=a152_0x25b375,{activationDefToCreateRequest:_0x3f2900,yamlRuleToApi:_0x350d4e}=_0x1a979c,{pendingEmbeddedSegments:_0x34ce27,pendingEmbeddedActivations:_0x52bee5,embeddedSegmentNameToId:_0x9a7036}=_0x3bad70,_0x54e58b=JSON['parse'](JSON[_0x48c2b9(0xcc)](_0x33cbe2));ensureJourneyDefaults(_0x54e58b[_0x48c2b9(0x194)]),stripPendingIds(_0x54e58b);const _0x362972=await _0x825910[_0x48c2b9(0x17a)][_0x48c2b9(0x10b)](_0x54e58b),_0x133c54=_0x362972['id'],_0x980767=new Map();for(const _0x2d46dc of _0x362972['attributes'][_0x48c2b9(0x1ae)]){_0x980767['set'](_0x2d46dc[_0x48c2b9(0x1ad)][_0x48c2b9(0x101)](),_0x2d46dc['id']);}recoverSegmentIdsFromPushRecovery(_0x24f576,_0x9a7036,_0x54405d[_0x48c2b9(0x18c)]);for(const [_0x2f5de8,{definition:_0x1889a1}]of _0x34ce27){if(_0x9a7036[_0x48c2b9(0x16e)](_0x2f5de8)){_0x40cdc7[_0x48c2b9(0x118)]?.({'type':'embedded_segment_created','journeyName':_0x24f576[_0x48c2b9(0x171)]['name'],'segmentName':_0x2f5de8});continue;}const _0x465917=generateDeterministicJourneySegmentName(_0x24f576['yamlConfig'][_0x48c2b9(0x1ad)],_0x2f5de8);_0x40cdc7[_0x48c2b9(0x118)]?.({'type':_0x48c2b9(0x136),'journeyName':_0x24f576[_0x48c2b9(0x171)]['name'],'segmentName':_0x2f5de8});const _0x49cade=createSegmentIdResolver(_0x54405d[_0x48c2b9(0x18c)],_0x2f5de8),_0xbc55f9=await resolveRuleSegmentIds(_0x1889a1['rule'],_0x49cade),_0x8d3a81=await createOrRecoverEmbeddedSegment(_0x825910,_0x24f576,{'localName':_0x2f5de8,'uniqueSegmentName':_0x465917,'description':_0x1889a1[_0x48c2b9(0x1a4)]||_0x48c2b9(0x14c)+_0x2f5de8,'journeyId':_0x133c54,'resolvedRule':_0xbc55f9,'parentId':_0x218c04['parentId'],'folderId':_0x218c04[_0x48c2b9(0x130)]||''},_0x350d4e);_0x9a7036[_0x48c2b9(0x188)](_0x2f5de8,_0x8d3a81),_0x54405d[_0x48c2b9(0x18c)][_0x48c2b9(0x188)](_0x2f5de8,_0x8d3a81),_0x40cdc7[_0x48c2b9(0x118)]?.({'type':_0x48c2b9(0x19d),'journeyName':_0x24f576['yamlConfig'][_0x48c2b9(0x1ad)],'segmentName':_0x2f5de8});}const _0x420b7d=new Map();for(const [_0x116205,_0x3ab479]of _0x52bee5){_0x40cdc7[_0x48c2b9(0x118)]?.({'type':_0x48c2b9(0xff),'journeyName':_0x24f576[_0x48c2b9(0x171)][_0x48c2b9(0x1ad)],'activationName':_0x116205});const _0x45fe2a=await _0x3f2900(_0x3ab479,_0x54405d[_0x48c2b9(0x134)]),_0xa89233={..._0x45fe2a,..._0x3ab479[_0x48c2b9(0xd8)]!==undefined&&{'runAfterJourneyRefresh':_0x3ab479['run_after_journey_refresh']}},_0x2b0b23=await _0x825910[_0x48c2b9(0x17a)]['createActivation'](_0x133c54,_0xa89233);_0x420b7d['set'](_0x116205,_0x2b0b23['id']),_0x3bad70[_0x48c2b9(0x1a5)][_0x48c2b9(0x188)](_0x116205,_0x2b0b23['id']),_0x40cdc7['onProgress']?.({'type':_0x48c2b9(0x1b6),'journeyName':_0x24f576['yamlConfig'][_0x48c2b9(0x1ad)],'activationName':_0x116205});}const _0x84caf0=JSON[_0x48c2b9(0x175)](JSON[_0x48c2b9(0xcc)](_0x33cbe2));return _0x84caf0['id']=_0x133c54,ensureJourneyDefaults(_0x84caf0[_0x48c2b9(0x194)]),resolvePendingIdsInRequest(_0x84caf0,_0x33cbe2,_0x980767,_0x9a7036,_0x420b7d,_0x40cdc7),await _0x825910['journey']['update'](_0x133c54,_0x84caf0),deletePushRecovery(_0x24f576[_0x48c2b9(0x144)]),{'action':_0x48c2b9(0xec),'journeyId':_0x133c54,'embeddedSegmentNameToId':_0x9a7036};}export function stripWaitStepPendingIds(_0x1534bc){const _0x14025a=a152_0x25b375,_0x20ac78=_0x1534bc['conditionSegmentId']&&isPendingSegmentId(_0x1534bc[_0x14025a(0x14b)]),_0x2bf874=_0x1534bc[_0x14025a(0x1a8)]?.['some'](_0x3b5362=>_0x3b5362[_0x14025a(0xf2)]&&isPendingSegmentId(_0x3b5362['segmentId']));(_0x20ac78||_0x2bf874)&&(_0x1534bc[_0x14025a(0x1b0)]=_0x14025a(0x138),_0x1534bc[_0x14025a(0x119)]=0x1,_0x1534bc['waitStepUnit']=_0x14025a(0x187),delete _0x1534bc['conditionSegmentId'],delete _0x1534bc[_0x14025a(0x129)],delete _0x1534bc[_0x14025a(0x15e)],delete _0x1534bc[_0x14025a(0x1a8)]);}export function resolveWaitStepPendingIds(_0x590a4f,_0x505581,_0x190cb4,_0x5aee1a){const _0x1a6604=a152_0x25b375;if(_0x505581[_0x1a6604(0x14b)]&&isPendingSegmentId(_0x505581[_0x1a6604(0x14b)])){const _0xb0fa6c=_0x190cb4(_0x505581[_0x1a6604(0x14b)],'stage\x20\x27'+_0x5aee1a+_0x1a6604(0x1b1));_0xb0fa6c&&(_0x590a4f['waitStepType']='Condition',_0x590a4f[_0x1a6604(0x14b)]=_0xb0fa6c,delete _0x590a4f[_0x1a6604(0x119)],delete _0x590a4f[_0x1a6604(0x131)],_0x505581[_0x1a6604(0x129)]!==undefined&&(_0x590a4f[_0x1a6604(0x129)]=_0x505581['conditionTimeoutDuration']),_0x505581[_0x1a6604(0x15e)]&&(_0x590a4f[_0x1a6604(0x15e)]=_0x505581[_0x1a6604(0x15e)]));}if(_0x505581[_0x1a6604(0x1a8)]){const _0x121239=_0x505581['conditions'][_0x1a6604(0x17b)](_0x1f35ec=>_0x1f35ec[_0x1a6604(0xf2)]&&isPendingSegmentId(_0x1f35ec[_0x1a6604(0xf2)]));if(_0x121239){const _0x3117b4=_0x505581[_0x1a6604(0x1a8)][_0x1a6604(0x11f)](_0x43e1b1=>{const _0x2f938d=_0x1a6604;if(_0x43e1b1[_0x2f938d(0xf2)]&&isPendingSegmentId(_0x43e1b1[_0x2f938d(0xf2)])){const _0x3b2e2e=_0x190cb4(_0x43e1b1[_0x2f938d(0xf2)],_0x2f938d(0x13f)+_0x5aee1a+_0x2f938d(0x1b1));return{..._0x43e1b1,'segmentId':_0x3b2e2e||_0x43e1b1[_0x2f938d(0xf2)]};}return{..._0x43e1b1};});_0x590a4f[_0x1a6604(0x1b0)]=_0x1a6604(0xc9),_0x590a4f[_0x1a6604(0x1a8)]=_0x3117b4,delete _0x590a4f[_0x1a6604(0x119)],delete _0x590a4f[_0x1a6604(0x131)],delete _0x590a4f[_0x1a6604(0x14b)],delete _0x590a4f[_0x1a6604(0x129)],delete _0x590a4f[_0x1a6604(0x15e)];}}}function stripPendingIds(_0x2b053d){const _0x1fa92a=a152_0x25b375;_0x2b053d[_0x1fa92a(0x194)][_0x1fa92a(0x1a7)]?.[_0x1fa92a(0xf2)]&&isPendingSegmentId(_0x2b053d[_0x1fa92a(0x194)][_0x1fa92a(0x1a7)][_0x1fa92a(0xf2)])&&delete _0x2b053d[_0x1fa92a(0x194)]['goal'];for(const _0xbf4ba2 of _0x2b053d['attributes'][_0x1fa92a(0x1ae)]||[]){_0xbf4ba2[_0x1fa92a(0x10c)]?.['segmentId']&&isPendingSegmentId(_0xbf4ba2[_0x1fa92a(0x10c)]['segmentId'])&&delete _0xbf4ba2[_0x1fa92a(0x10c)];_0xbf4ba2[_0x1fa92a(0x10d)]?.[_0x1fa92a(0xf2)]&&isPendingSegmentId(_0xbf4ba2[_0x1fa92a(0x10d)][_0x1fa92a(0xf2)])&&delete _0xbf4ba2[_0x1fa92a(0x10d)];_0xbf4ba2['exitCriterias']&&(_0xbf4ba2[_0x1fa92a(0xd6)]=_0xbf4ba2[_0x1fa92a(0xd6)]['filter'](_0x44ec1c=>!_0x44ec1c[_0x1fa92a(0xf2)]||!isPendingSegmentId(_0x44ec1c[_0x1fa92a(0xf2)])));if(_0xbf4ba2[_0x1fa92a(0xdd)])for(const _0x4111a6 of Object[_0x1fa92a(0xfc)](_0xbf4ba2[_0x1fa92a(0xdd)])){const _0x129ceb=_0xbf4ba2['steps'][_0x4111a6];_0x129ceb[_0x1fa92a(0xd9)]===_0x1fa92a(0x153)&&_0x129ceb[_0x1fa92a(0xe4)]&&isPendingActivationId(_0x129ceb[_0x1fa92a(0xe4)])&&(_0x129ceb[_0x1fa92a(0xe4)]='');if(_0x129ceb[_0x1fa92a(0xd9)]===_0x1fa92a(0x13c)&&_0x129ceb['branches'])for(const _0x448173 of _0x129ceb[_0x1fa92a(0x198)]){_0x448173[_0x1fa92a(0xf2)]&&isPendingSegmentId(_0x448173[_0x1fa92a(0xf2)])&&(_0x448173[_0x1fa92a(0xf2)]='');}_0x129ceb[_0x1fa92a(0xd9)]===_0x1fa92a(0x163)&&stripWaitStepPendingIds(_0x129ceb);}}}function resolvePendingIdsInRequest(_0x55e742,_0x186a74,_0x1daca0,_0x18091b,_0x427646,_0x6aa76d){const _0x3efe4a=a152_0x25b375,_0x122790=(_0x543627,_0x2f333c)=>{const _0x50443a=a152_0x29c9;if(!isPendingSegmentId(_0x543627))return _0x543627;const _0x24bcfc=extractPendingSegmentName(_0x543627),_0x14e7da=_0x18091b[_0x50443a(0x18f)](_0x24bcfc);return!_0x14e7da&&_0x6aa76d['logWarning']?.(_0x50443a(0xcf)+_0x24bcfc+'\x27\x20for\x20'+_0x2f333c),_0x14e7da;};if(_0x55e742['attributes'][_0x3efe4a(0x1a7)]?.[_0x3efe4a(0xf2)]&&isPendingSegmentId(_0x55e742['attributes'][_0x3efe4a(0x1a7)][_0x3efe4a(0xf2)])){const _0x2ad038=_0x122790(_0x55e742[_0x3efe4a(0x194)][_0x3efe4a(0x1a7)][_0x3efe4a(0xf2)],'goal\x20criteria');_0x2ad038&&(_0x55e742[_0x3efe4a(0x194)][_0x3efe4a(0x1a7)][_0x3efe4a(0xf2)]=_0x2ad038);}for(const _0x34ecd3 of _0x55e742[_0x3efe4a(0x194)][_0x3efe4a(0x1ae)]||[]){const _0x587a0e=_0x1daca0[_0x3efe4a(0x18f)](_0x34ecd3[_0x3efe4a(0x1ad)][_0x3efe4a(0x101)]());_0x587a0e&&(_0x34ecd3['id']=_0x587a0e);if(_0x34ecd3[_0x3efe4a(0x10c)]?.['segmentId']&&isPendingSegmentId(_0x34ecd3[_0x3efe4a(0x10c)][_0x3efe4a(0xf2)])){const _0x1060bb=_0x122790(_0x34ecd3['entryCriteria']['segmentId'],_0x3efe4a(0x13f)+_0x34ecd3[_0x3efe4a(0x1ad)]+_0x3efe4a(0x121));_0x1060bb&&(_0x34ecd3[_0x3efe4a(0x10c)][_0x3efe4a(0xf2)]=_0x1060bb);}if(_0x34ecd3['exitCriterias'])for(const _0x335f77 of _0x34ecd3[_0x3efe4a(0xd6)]){if(_0x335f77[_0x3efe4a(0xf2)]&&isPendingSegmentId(_0x335f77[_0x3efe4a(0xf2)])){const _0xb03965=_0x122790(_0x335f77['segmentId'],_0x3efe4a(0x13f)+_0x34ecd3[_0x3efe4a(0x1ad)]+_0x3efe4a(0xe1));_0xb03965&&(_0x335f77['segmentId']=_0xb03965);}}if(_0x34ecd3[_0x3efe4a(0x10d)]?.[_0x3efe4a(0xf2)]&&isPendingSegmentId(_0x34ecd3[_0x3efe4a(0x10d)][_0x3efe4a(0xf2)])){const _0x1e1ec3=_0x122790(_0x34ecd3[_0x3efe4a(0x10d)]['segmentId'],_0x3efe4a(0x13f)+_0x34ecd3['name']+_0x3efe4a(0x18a));_0x1e1ec3&&(_0x34ecd3[_0x3efe4a(0x10d)][_0x3efe4a(0xf2)]=_0x1e1ec3);}if(_0x34ecd3[_0x3efe4a(0xdd)]){const _0x1cd653=_0x29f532=>_0x186a74[_0x3efe4a(0x194)][_0x3efe4a(0x1ae)]?.[_0x3efe4a(0x106)](_0x39620c=>_0x39620c['name'][_0x3efe4a(0x101)]()===_0x34ecd3[_0x3efe4a(0x1ad)][_0x3efe4a(0x101)]())?.[_0x3efe4a(0xdd)]?.[_0x29f532];for(const _0x46ad77 of Object[_0x3efe4a(0xfc)](_0x34ecd3['steps'])){const _0xe912c3=_0x34ecd3[_0x3efe4a(0xdd)][_0x46ad77],_0x13376e=_0x1cd653(_0x46ad77);if(_0xe912c3[_0x3efe4a(0xd9)]===_0x3efe4a(0x153)&&_0xe912c3['journeyActivationStepId']&&(isPendingActivationId(_0xe912c3['journeyActivationStepId'])||_0xe912c3[_0x3efe4a(0xe4)]==='')){if(_0x13376e?.[_0x3efe4a(0xe4)]&&isPendingActivationId(_0x13376e[_0x3efe4a(0xe4)])){const _0x1ada63=extractPendingActivationName(_0x13376e[_0x3efe4a(0xe4)]),_0x563b24=_0x427646['get'](_0x1ada63);_0x563b24&&(_0xe912c3[_0x3efe4a(0xe4)]=_0x563b24);}}if(_0xe912c3['type']==='DecisionPoint'&&_0xe912c3[_0x3efe4a(0x198)]&&_0x13376e?.[_0x3efe4a(0x198)])for(let _0x24ad69=0x0;_0x24ad69<_0xe912c3['branches'][_0x3efe4a(0x1a2)];_0x24ad69++){const _0x446562=_0xe912c3['branches'][_0x24ad69],_0x23a625=_0x13376e[_0x3efe4a(0x198)][_0x24ad69];if(_0x23a625?.[_0x3efe4a(0xf2)]&&isPendingSegmentId(_0x23a625['segmentId'])){const _0x54cb7f=_0x122790(_0x23a625[_0x3efe4a(0xf2)],'stage\x20\x27'+_0x34ecd3[_0x3efe4a(0x1ad)]+_0x3efe4a(0xdb)+(_0x446562[_0x3efe4a(0x1ad)]||_0x24ad69)+'\x27');_0x54cb7f&&(_0x446562[_0x3efe4a(0xf2)]=_0x54cb7f);}}_0xe912c3[_0x3efe4a(0xd9)]==='WaitStep'&&_0x13376e?.['type']===_0x3efe4a(0x163)&&resolveWaitStepPendingIds(_0xe912c3,_0x13376e,_0x122790,_0x34ecd3[_0x3efe4a(0x1ad)]);}}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a153_0x3eaa(){const _0x1a58ed=['908298aGPmLE','add','872084mjXHYv','get','3zggXmI','2800240bYazCf','21732dQnHsj','name','14VqGvPM','49163FZRPNb','set','2484330XGYaHn','has','1193375VcAlih','483eIKuIz','44DmPHHA','parentFolderId'];a153_0x3eaa=function(){return _0x1a58ed;};return a153_0x3eaa();}function a153_0x2a46(_0x34513d,_0x268d60){_0x34513d=_0x34513d-0x104;const _0x3eaa42=a153_0x3eaa();let _0x2a460e=_0x3eaa42[_0x34513d];return _0x2a460e;}(function(_0x5d19ff,_0x46980e){const _0x115ded=a153_0x2a46,_0x200d9e=_0x5d19ff();while(!![]){try{const _0x3b99ea=-parseInt(_0x115ded(0x104))/0x1*(-parseInt(_0x115ded(0x114))/0x2)+-parseInt(_0x115ded(0x110))/0x3*(parseInt(_0x115ded(0x10e))/0x4)+-parseInt(_0x115ded(0x108))/0x5+parseInt(_0x115ded(0x112))/0x6*(-parseInt(_0x115ded(0x109))/0x7)+-parseInt(_0x115ded(0x111))/0x8+-parseInt(_0x115ded(0x10c))/0x9+parseInt(_0x115ded(0x106))/0xa*(parseInt(_0x115ded(0x10a))/0xb);if(_0x3b99ea===_0x46980e)break;else _0x200d9e['push'](_0x200d9e['shift']());}catch(_0x5693ad){_0x200d9e['push'](_0x200d9e['shift']());}}}(a153_0x3eaa,0x2c053));export function buildFolderIdToPathMap(_0x5d10f0){const _0x2ad411=a153_0x2a46,_0x1413c0=new Map(),_0x18e1d5=new Map();for(const _0x1997cc of _0x5d10f0){_0x18e1d5['set'](_0x1997cc['id'],_0x1997cc);}const _0x36ae06=new Set();for(const _0x12bd28 of _0x5d10f0){!_0x12bd28[_0x2ad411(0x10b)]&&_0x36ae06[_0x2ad411(0x10d)](_0x12bd28['id']);}function _0x3e759e(_0x56fe21){const _0x5c6a77=_0x2ad411;if(_0x1413c0['has'](_0x56fe21['id']))return _0x1413c0['get'](_0x56fe21['id']);if(_0x36ae06[_0x5c6a77(0x107)](_0x56fe21['id']))return _0x1413c0[_0x5c6a77(0x105)](_0x56fe21['id'],''),'';if(_0x56fe21[_0x5c6a77(0x10b)]){const _0x27e01c=_0x18e1d5[_0x5c6a77(0x10f)](_0x56fe21['parentFolderId']);if(_0x27e01c){const _0x21cd2e=_0x3e759e(_0x27e01c),_0x4d7681=_0x21cd2e?_0x21cd2e+'/'+_0x56fe21[_0x5c6a77(0x113)]:_0x56fe21['name'];return _0x1413c0[_0x5c6a77(0x105)](_0x56fe21['id'],_0x4d7681),_0x4d7681;}}const _0x48dc30=_0x56fe21[_0x5c6a77(0x113)];return _0x1413c0[_0x5c6a77(0x105)](_0x56fe21['id'],_0x48dc30),_0x48dc30;}for(const _0x4212d5 of _0x5d10f0){_0x3e759e(_0x4212d5);}return _0x1413c0;}export function buildFolderPathToIdMap(_0xed667d){const _0x3bddec=a153_0x2a46,_0x82b93d=new Map(),_0x2348f1=new Map();for(const _0x48f403 of _0xed667d){_0x2348f1[_0x3bddec(0x105)](_0x48f403['id'],_0x48f403);}const _0xbee9f1=new Set();for(const _0x1e0c5e of _0xed667d){!_0x1e0c5e[_0x3bddec(0x10b)]&&_0xbee9f1['add'](_0x1e0c5e['id']);}function _0x508733(_0x102531){const _0x3bf2bd=_0x3bddec;if(_0xbee9f1['has'](_0x102531['id']))return'';if(_0x102531[_0x3bf2bd(0x10b)]){const _0x5374dd=_0x2348f1[_0x3bf2bd(0x10f)](_0x102531['parentFolderId']);if(_0x5374dd){const _0x5e59cd=_0x508733(_0x5374dd);return _0x5e59cd?_0x5e59cd+'/'+_0x102531[_0x3bf2bd(0x113)]:_0x102531[_0x3bf2bd(0x113)];}}return _0x102531[_0x3bf2bd(0x113)];}for(const _0x40571d of _0xed667d){const _0x425b7d=_0x508733(_0x40571d);_0x82b93d[_0x3bddec(0x105)](_0x425b7d,_0x40571d['id']);}return _0x82b93d;}export function buildFolderMaps(_0x22364b){const _0x2d1ee9=a153_0x2a46,_0xdf8144=buildFolderIdToPathMap(_0x22364b),_0x5966ad=new Map();for(const [_0x450725,_0x4a5d33]of _0xdf8144){_0x5966ad[_0x2d1ee9(0x105)](_0x4a5d33,_0x450725);}return{'idToPath':_0xdf8144,'pathToId':_0x5966ad};}export function getFolderPath(_0x2d4a00,_0x3e87fd){if(!_0x2d4a00)return'';return _0x3e87fd['get'](_0x2d4a00)??'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a154_0x5f14(_0x15b0fe,_0x1c5b9e){_0x15b0fe=_0x15b0fe-0x126;const _0x4995d7=a154_0x4995();let _0x5f14e2=_0x4995d7[_0x15b0fe];return _0x5f14e2;}(function(_0x31b404,_0x29d6a5){const _0x47f359=a154_0x5f14,_0x2e52ba=_0x31b404();while(!![]){try{const _0x16a2fb=-parseInt(_0x47f359(0x129))/0x1*(parseInt(_0x47f359(0x127))/0x2)+-parseInt(_0x47f359(0x13f))/0x3+parseInt(_0x47f359(0x137))/0x4+parseInt(_0x47f359(0x12f))/0x5*(parseInt(_0x47f359(0x12c))/0x6)+parseInt(_0x47f359(0x150))/0x7+-parseInt(_0x47f359(0x146))/0x8+parseInt(_0x47f359(0x147))/0x9;if(_0x16a2fb===_0x29d6a5)break;else _0x2e52ba['push'](_0x2e52ba['shift']());}catch(_0x5b0c7d){_0x2e52ba['push'](_0x2e52ba['shift']());}}}(a154_0x4995,0x3eb65));import a154_0x4b36a7 from'path';import{parse as a154_0x4d5357}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x839c3e){const _0x45e020=a154_0x5f14;if(!_0x839c3e||_0x839c3e[_0x45e020(0x12b)]()==='')throw new Error(_0x45e020(0x141));const _0x3b5eeb=_0x839c3e[_0x45e020(0x12b)]();if(_0x3b5eeb==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x839c3e};const _0x19b4cd=_0x3b5eeb[_0x45e020(0x145)]('/')?_0x3b5eeb[_0x45e020(0x156)](0x1):_0x3b5eeb,_0x3e7985=_0x19b4cd[_0x45e020(0x148)]('/')[_0x45e020(0x13d)](_0x425310=>_0x425310!=='');if(_0x3e7985[_0x45e020(0x13b)]===0x0)throw new Error(_0x45e020(0x153));const _0x23250e=_0x3b5eeb[_0x45e020(0x145)]('/')||!isRelativePathSegment(_0x3e7985[0x0]);for(const _0x52172f of _0x3e7985){validatePathSegment(_0x52172f);}return{'segments':_0x3e7985,'isAbsolute':_0x23250e,'raw':_0x839c3e};}function isRelativePathSegment(_0x275520){return _0x275520==='.'||_0x275520==='..';}function validatePathSegment(_0x314d6f){const _0x4888a4=a154_0x5f14;if(_0x314d6f==='')throw new Error(_0x4888a4(0x152));if(_0x314d6f==='.'||_0x314d6f==='..')return;if(/[\x00-\x1F\x7F]/[_0x4888a4(0x14d)](_0x314d6f))throw new Error(_0x4888a4(0x151)+_0x314d6f);if(_0x314d6f!==_0x314d6f[_0x4888a4(0x12b)]()){}}export function validatePath(_0x320fc6){const _0xd248a7=a154_0x5f14;if(_0x320fc6['segments'][_0xd248a7(0x13b)]===0x0&&!_0x320fc6['isAbsolute'])throw new Error(_0xd248a7(0x12d));if(_0x320fc6['isAbsolute']){if(_0x320fc6[_0xd248a7(0x132)][0x0]==='..')throw new Error(_0xd248a7(0x142));let _0x2d0d32=0x0;for(const _0x199d66 of _0x320fc6[_0xd248a7(0x132)]){if(_0x199d66==='..'){if(_0x2d0d32===0x0)throw new Error(_0xd248a7(0x135));_0x2d0d32--;}else _0x199d66!=='.'&&_0x2d0d32++;}}}export function joinPaths(_0x22ecf1,_0x316c90){const _0x5f1a58=a154_0x5f14;if(!_0x22ecf1||_0x22ecf1==='/')return _0x316c90;if(!_0x316c90||_0x316c90==='.')return _0x22ecf1;if(_0x316c90[_0x5f1a58(0x145)]('/'))return _0x316c90;const _0x48ecc8=parsePath(_0x22ecf1),_0x1d0bd7=parsePath(_0x316c90),_0x309333=[..._0x48ecc8[_0x5f1a58(0x132)]];for(const _0x5b3808 of _0x1d0bd7[_0x5f1a58(0x132)]){if(_0x5b3808==='.')continue;else{if(_0x5b3808==='..'){if(_0x309333[_0x5f1a58(0x13b)]===0x0)throw new Error(_0x5f1a58(0x154));_0x309333[_0x5f1a58(0x126)]();}else _0x309333['push'](_0x5b3808);}}const _0x216864=_0x309333[_0x5f1a58(0x133)]('/');return _0x48ecc8['raw'][_0x5f1a58(0x145)]('/')?'/'+_0x216864:_0x216864;}function a154_0x4995(){const _0x2a1003=['type','1958838zwOgZd','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','Path\x20segment\x20cannot\x20be\x20empty','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','Cannot\x20navigate\x20above\x20root','segment','substring','push','pop','426070wCopun','root','1YCnpEG','isAbsolute','trim','138HVPUgx','Relative\x20path\x20cannot\x20be\x20empty','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','79775ERwmlL','exists','tdx.json','segments','join','name','Path\x20attempts\x20to\x20navigate\x20above\x20root','journey','1332360HFKEhX','readFile','dirname','parent_segment','length','replace','filter','Cannot\x20split\x20empty\x20path','682926cQDEgD','raw','Path\x20cannot\x20be\x20empty','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','relative','parse','startsWith','3770944pvcwjC','1701225gzTnDv','split','resolve','endsWith','slice','File\x20not\x20found:\x20','test','.yaml'];a154_0x4995=function(){return _0x2a1003;};return a154_0x4995();}export function normalizePath(_0x3f5160){const _0x5c7f11=a154_0x5f14,_0x3705dd=parsePath(_0x3f5160),_0x5529bd=[];for(const _0x4e54b5 of _0x3705dd['segments']){if(_0x4e54b5==='.')continue;else{if(_0x4e54b5==='..'){if(_0x5529bd[_0x5c7f11(0x13b)]===0x0){if(_0x3705dd[_0x5c7f11(0x12a)])throw new Error('Cannot\x20navigate\x20above\x20root');_0x5529bd[_0x5c7f11(0x157)]('..');}else _0x5529bd[_0x5529bd[_0x5c7f11(0x13b)]-0x1]==='..'?_0x5529bd['push']('..'):_0x5529bd['pop']();}else _0x5529bd[_0x5c7f11(0x157)](_0x4e54b5);}}if(_0x5529bd[_0x5c7f11(0x13b)]===0x0)return _0x3705dd[_0x5c7f11(0x12a)]?'/':'.';const _0x549ace=_0x5529bd[_0x5c7f11(0x133)]('/');return _0x3705dd[_0x5c7f11(0x140)][_0x5c7f11(0x145)]('/')?'/'+_0x549ace:_0x549ace;}export function getParentPath(_0x41869a){const _0x287d18=a154_0x5f14,_0x940a10=parsePath(_0x41869a);if(_0x940a10['segments'][_0x287d18(0x13b)]<=0x1)return'/';const _0xc2456d=_0x940a10[_0x287d18(0x132)]['slice'](0x0,-0x1)[_0x287d18(0x133)]('/');return _0x940a10[_0x287d18(0x140)][_0x287d18(0x145)]('/')?'/'+_0xc2456d:_0xc2456d;}export function getBaseName(_0x18c623){const _0x38611d=a154_0x5f14,_0x3a6310=parsePath(_0x18c623);return _0x3a6310[_0x38611d(0x132)][_0x3a6310[_0x38611d(0x132)][_0x38611d(0x13b)]-0x1]||'';}export function isChildPath(_0x324bd6,_0x4b572b){const _0x1ca858=a154_0x5f14,_0x36968c=parsePath(_0x324bd6),_0x492be0=parsePath(_0x4b572b);if(_0x36968c[_0x1ca858(0x132)][_0x1ca858(0x13b)]<=_0x492be0[_0x1ca858(0x132)][_0x1ca858(0x13b)])return![];for(let _0x2b337d=0x0;_0x2b337d<_0x492be0['segments'][_0x1ca858(0x13b)];_0x2b337d++){if(_0x36968c[_0x1ca858(0x132)][_0x2b337d]!==_0x492be0[_0x1ca858(0x132)][_0x2b337d])return![];}return!![];}export function splitPath(_0x54afa2){const _0x27bcd5=a154_0x5f14,_0x30ee39=parsePath(_0x54afa2);if(_0x30ee39[_0x27bcd5(0x132)]['length']===0x0)throw new Error(_0x27bcd5(0x13e));if(_0x30ee39[_0x27bcd5(0x132)][_0x27bcd5(0x13b)]===0x1)return{'parent':_0x30ee39[_0x27bcd5(0x132)][0x0]};return{'parent':_0x30ee39['segments'][0x0],'child':_0x30ee39[_0x27bcd5(0x132)][_0x27bcd5(0x14b)](0x1)['join']('/')};}export function isYamlFilePath(_0x32974c){const _0x4bdc26=a154_0x5f14;return _0x32974c[_0x4bdc26(0x14a)]('.yml')||_0x32974c[_0x4bdc26(0x14a)](_0x4bdc26(0x14e));}export async function resolveYamlFilePath(_0x6a35b5,_0x22fedf=nodeFileSystem){const _0x4d6308=a154_0x5f14,_0xd2552b=a154_0x4b36a7[_0x4d6308(0x149)](_0x6a35b5);if(!await _0x22fedf[_0x4d6308(0x130)](_0xd2552b))throw new Error(_0x4d6308(0x14c)+_0x6a35b5);let _0x29f9e5=a154_0x4b36a7[_0x4d6308(0x139)](_0xd2552b),_0x408ef6=null,_0x532f19=null;const _0x339781=a154_0x4b36a7[_0x4d6308(0x144)](_0x29f9e5)[_0x4d6308(0x128)];while(_0x29f9e5!==_0x339781){const _0x71fe48=a154_0x4b36a7[_0x4d6308(0x133)](_0x29f9e5,_0x4d6308(0x131));if(await _0x22fedf[_0x4d6308(0x130)](_0x71fe48)){_0x408ef6=_0x71fe48,_0x532f19=_0x29f9e5;break;}_0x29f9e5=a154_0x4b36a7['dirname'](_0x29f9e5);}if(!_0x408ef6||!_0x532f19)throw new Error('No\x20tdx.json\x20found\x20for\x20file:\x20'+_0x6a35b5+'\x0a'+'Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.');const _0x57bb3a=await _0x22fedf['readFile'](_0x408ef6),_0x209ca7=JSON['parse'](_0x57bb3a),_0xd815d2=_0x209ca7[_0x4d6308(0x13a)];if(!_0xd815d2)throw new Error('Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field');const _0x1cf070=await _0x22fedf[_0x4d6308(0x138)](_0xd2552b),_0x53ccee=a154_0x4d5357(_0x1cf070),_0x3c433f=_0x53ccee[_0x4d6308(0x134)];if(!_0x3c433f)throw new Error(_0x4d6308(0x12e)+_0x6a35b5);const _0x28e66a=_0x53ccee[_0x4d6308(0x14f)]===_0x4d6308(0x136)?_0x4d6308(0x136):_0x4d6308(0x155),_0x39cca0=a154_0x4b36a7[_0x4d6308(0x143)](_0x532f19,_0xd2552b),_0x49af8d=a154_0x4b36a7[_0x4d6308(0x139)](_0x39cca0),_0x242caa=_0x49af8d==='.'?'':_0x49af8d[_0x4d6308(0x13c)](/\\/g,'/'),_0x5e11e4=_0x242caa?_0xd815d2+'/'+_0x242caa+'/'+_0x3c433f:_0xd815d2+'/'+_0x3c433f;return{'parentSegment':_0xd815d2,'segmentName':_0x3c433f,'folderPath':_0x242caa,'fullPath':_0x5e11e4,'resourceType':_0x28e66a,'content':_0x1cf070};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a155_0xa217(_0x1fe35c,_0x53fad2){_0x1fe35c=_0x1fe35c-0x17c;const _0x1f4f87=a155_0x1f4f();let _0xa217a6=_0x1f4f87[_0x1fe35c];return _0xa217a6;}function a155_0x1f4f(){const _0x511ba2=['21923uSPBnC','676sWfhsB','.\x20Parent\x20name\x20cannot\x20be\x20empty','8xrppeN','substring','347013itnZNU','113lfIDmq','1766448gRcqbT','4TYiwip','577703MyRnsw','Invalid\x20segment\x20reference\x20format:\x20','792864Asfwzy','3140ftHpyF','901050vEQJWT'];a155_0x1f4f=function(){return _0x511ba2;};return a155_0x1f4f();}(function(_0x40a4b5,_0xadc03a){const _0x2e94a7=a155_0xa217,_0x58ea12=_0x40a4b5();while(!![]){try{const _0x542018=parseInt(_0x2e94a7(0x17d))/0x1*(-parseInt(_0x2e94a7(0x186))/0x2)+parseInt(_0x2e94a7(0x17c))/0x3*(parseInt(_0x2e94a7(0x17f))/0x4)+-parseInt(_0x2e94a7(0x184))/0x5+-parseInt(_0x2e94a7(0x182))/0x6+parseInt(_0x2e94a7(0x180))/0x7*(-parseInt(_0x2e94a7(0x188))/0x8)+-parseInt(_0x2e94a7(0x17e))/0x9+parseInt(_0x2e94a7(0x183))/0xa*(parseInt(_0x2e94a7(0x185))/0xb);if(_0x542018===_0xadc03a)break;else _0x58ea12['push'](_0x58ea12['shift']());}catch(_0x548e5e){_0x58ea12['push'](_0x58ea12['shift']());}}}(a155_0x1f4f,0x1b5fc));export function parseSegmentRef(_0x1cd171){const _0x4256c8=a155_0xa217,_0x26a700=_0x1cd171['indexOf']('/');if(_0x26a700===-0x1)return{'parentId':_0x1cd171};if(_0x26a700===0x0)throw new Error(_0x4256c8(0x181)+_0x1cd171+_0x4256c8(0x187));const _0x1f5f7c=_0x1cd171[_0x4256c8(0x189)](0x0,_0x26a700),_0x2229c8=_0x1cd171[_0x4256c8(0x189)](_0x26a700+0x1);if(_0x2229c8==='')throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x1cd171+'.\x20Child\x20name\x20cannot\x20be\x20empty');return{'parentId':_0x1f5f7c,'childId':_0x2229c8};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2506d7,_0xcbb1a0){const _0x35446e=a156_0x5970,_0x86b5b6=_0x2506d7();while(!![]){try{const _0x11fa72=-parseInt(_0x35446e(0xec))/0x1*(-parseInt(_0x35446e(0xd7))/0x2)+-parseInt(_0x35446e(0x10b))/0x3+parseInt(_0x35446e(0xf3))/0x4+parseInt(_0x35446e(0x10a))/0x5*(parseInt(_0x35446e(0x115))/0x6)+-parseInt(_0x35446e(0x11a))/0x7*(parseInt(_0x35446e(0xf9))/0x8)+parseInt(_0x35446e(0xeb))/0x9+-parseInt(_0x35446e(0xf7))/0xa;if(_0x11fa72===_0xcbb1a0)break;else _0x86b5b6['push'](_0x86b5b6['shift']());}catch(_0x356157){_0x86b5b6['push'](_0x86b5b6['shift']());}}}(a156_0x2160,0x18d05));import{SegmentDefSchema,RuleDefSchema}from'./types/segment-schema.js';function a156_0x2160(){const _0x4e0555=['Attribute\x20\x27','\x27\x20with\x20attribute\x20\x27','warning','rule','MISSING_OPERATOR_VALUE','BEHAVIOR_SOURCE_WITH_ATTRIBUTE','condition\x20groups\x20correctly.\x20Segment\x20execution\x20is\x20unaffected.\x20For\x20same-attribute\x20Or\x20','requires\x20a\x20nested\x20\x27filter\x27.\x20Without\x20filter,\x20the\x20source\x20is\x20silently\x20ignored\x20and\x20','MISSING_TIME_UNIT','.operator.value','.source','NESTED_CONDITION_GROUP','INVALID_RULE_TYPE','safeParse','\x27\x20with\x20behavior\x20source\x20may\x20cause\x20unexpected\x20behavior.\x20','symbol','INVALID_OPERATOR_TYPE','1154349tvEioU','981wGUtAf','MISSING_BETWEEN_BOUNDS','custom','arrayMatching','Behavior','For\x20behavior\x20aggregations,\x20use\x20\x27attribute:\x20\x22\x22\x27\x20with\x20Column\x20conditions\x20in\x20filter.','.conditions[','115988COhjJz','source','success','.conditions','2521330UaxFHW','MISSING_CONDITIONS','8luUHfo','filter','.segment','skipSchema','data','map','.type','code','BEHAVIOR_SOURCE_MISSING_FILTER','conditions','INVALID_ARRAY_MATCHING','push','Behavior\x20source\x20\x27','includes','type','\x20condition\x20cannot\x20have\x20an\x20empty\x20conditions\x20array','path','5BmiKPt','163611POtMqk','.attribute','Rule\x20conditions\x20array\x20cannot\x20be\x20empty.\x20Add\x20at\x20least\x20one\x20condition.','rule.type','Attribute\x20name\x20cannot\x20be\x20empty','EMPTY_ATTRIBUTE','document','message','level','endsWith','632118rsnaci','description','aggregation','invalid_value','.filter','387863OdhAdQ','And','name','attribute','error','validationCode','410hRFKIZ','length','Value'];a156_0x2160=function(){return _0x4e0555;};return a156_0x2160();}import{formatZodPath,flattenZodIssues,getLocationFromPath,pathToArray}from'./yaml-validator.js';export function validateSegmentDef(_0xe94ce5,_0x594d67={},_0x1af7cb={}){const _0x53af68=a156_0x5970;if(_0x1af7cb[_0x53af68(0xfc)])return runSemanticChecks(_0xe94ce5,_0x594d67);const _0x2777bb=SegmentDefSchema[_0x53af68(0xe7)](_0xe94ce5);if(_0x2777bb[_0x53af68(0xf5)])return runSemanticChecks(_0x2777bb['data'],_0x594d67);return zodErrorsToValidationResult(_0x2777bb[_0x53af68(0xd5)],_0x594d67);}export function validateRuleDef(_0xea4bea,_0x4031b9,_0x3219e9){const _0x1135a1=a156_0x5970;if(!_0xea4bea)return[];const _0x495573=RuleDefSchema['safeParse'](_0xea4bea);if(_0x495573['success'])return checkRule(_0x495573[_0x1135a1(0xfd)],_0x4031b9,_0x3219e9);const _0x283d72=flattenZodIssues(_0x495573['error']['issues']);return _0x283d72[_0x1135a1(0xfe)](_0x5d811e=>{const _0x4db2b2=_0x1135a1,_0x19cfe8=formatZodPath(_0x5d811e[_0x4db2b2(0x109)]),_0x1057e6=_0x19cfe8?_0x4031b9+'.'+_0x19cfe8:_0x4031b9,_0x1afb82=mapZodIssueToCode(_0x5d811e,_0x19cfe8),_0x534f43=getLocationFromPath(_0x3219e9['document'],_0x3219e9['source'],pathToArray(_0x1057e6));return{'level':_0x4db2b2(0xd5),'path':_0x1057e6,'code':_0x1afb82,'message':_0x5d811e[_0x4db2b2(0x112)],..._0x534f43&&{'location':_0x534f43}};});}function zodErrorsToValidationResult(_0x5bf32a,_0x3bb401){const _0x1b0abe=a156_0x5970,_0x3220b9=flattenZodIssues(_0x5bf32a['issues']),_0x12af75=_0x3220b9[_0x1b0abe(0xfe)](_0x395a7f=>{const _0x3e8f28=_0x1b0abe,_0x3255a2=formatZodPath(_0x395a7f['path']),_0xc15d7b=mapZodIssueToCode(_0x395a7f,_0x3255a2),_0x2f2022=getLocationFromPath(_0x3bb401[_0x3e8f28(0x111)],_0x3bb401[_0x3e8f28(0xf4)],_0x395a7f[_0x3e8f28(0x109)][_0x3e8f28(0xfe)](_0x21759c=>typeof _0x21759c===_0x3e8f28(0xe9)?String(_0x21759c):_0x21759c));return{'level':_0x3e8f28(0xd5),'path':_0x3255a2,'code':_0xc15d7b,'message':_0x395a7f[_0x3e8f28(0x112)],..._0x2f2022&&{'location':_0x2f2022}};});return{'valid':![],'errors':_0x12af75,'warnings':[]};}function a156_0x5970(_0x8ad27f,_0x305fb1){_0x8ad27f=_0x8ad27f-0xd2;const _0x216010=a156_0x2160();let _0x5970e4=_0x216010[_0x8ad27f];return _0x5970e4;}function mapZodIssueToCode(_0x40e9fa,_0x3c33f0){const _0x54bc40=a156_0x5970,_0x42f575=_0x40e9fa[_0x54bc40(0x100)]===_0x54bc40(0xee)?_0x40e9fa['params']:undefined;if(_0x3c33f0===_0x54bc40(0xd3))return'MISSING_NAME';if(_0x3c33f0==='rule.type'||_0x3c33f0[_0x54bc40(0x114)](_0x54bc40(0xff))){if(_0x40e9fa[_0x54bc40(0x100)]===_0x54bc40(0x118)){if(_0x3c33f0===_0x54bc40(0x10e)||_0x3c33f0['match'](/\.conditions\[\d+\]\.type$/))return _0x54bc40(0xe6);}}if(_0x3c33f0[_0x54bc40(0x114)]('.operator.type'))return _0x54bc40(0xea);if(_0x3c33f0[_0x54bc40(0x114)](_0x54bc40(0xe3)))return _0x54bc40(0xde);if(_0x42f575?.[_0x54bc40(0xd6)]===_0x54bc40(0xed))return'MISSING_BETWEEN_BOUNDS';if(_0x42f575?.[_0x54bc40(0xd6)]===_0x54bc40(0xe2))return _0x54bc40(0xe2);if(_0x3c33f0['endsWith']('.conditions')||_0x3c33f0===_0x54bc40(0x102))return _0x54bc40(0xf8);if(_0x3c33f0[_0x54bc40(0x106)](_0x54bc40(0xef)))return _0x54bc40(0x103);if(_0x3c33f0[_0x54bc40(0x114)](_0x54bc40(0xfb)))return'MISSING_SEGMENT_REFERENCE';return'SEGMENT_SCHEMA_ERROR';}function runSemanticChecks(_0x4fe684,_0x1a4f03){const _0x226d07=a156_0x5970,_0x3c0cf1=[];_0x4fe684[_0x226d07(0xdd)]&&_0x3c0cf1[_0x226d07(0x104)](...checkRule(_0x4fe684[_0x226d07(0xdd)],_0x226d07(0xdd),_0x1a4f03));const _0x8161d2=_0x3c0cf1[_0x226d07(0xfa)](_0x1e0850=>_0x1e0850[_0x226d07(0x113)]===_0x226d07(0xd5)),_0x5f2dd4=_0x3c0cf1[_0x226d07(0xfa)](_0x4cb267=>_0x4cb267[_0x226d07(0x113)]===_0x226d07(0xdc));return{'valid':_0x8161d2[_0x226d07(0xd8)]===0x0,'errors':_0x8161d2,'warnings':_0x5f2dd4};}function checkRule(_0x1df7e2,_0x7d2a8d,_0x4805e0){const _0x12b8dd=a156_0x5970,_0x53708f=[];if(_0x1df7e2[_0x12b8dd(0x102)][_0x12b8dd(0xd8)]===0x0)return _0x53708f[_0x12b8dd(0x104)]({'level':'error','path':_0x7d2a8d+_0x12b8dd(0xf6),'code':'EMPTY_CONDITIONS','message':_0x12b8dd(0x10d),'location':getLocationFromPath(_0x4805e0[_0x12b8dd(0x111)],_0x4805e0[_0x12b8dd(0xf4)],pathToArray(_0x7d2a8d+_0x12b8dd(0xf6)))}),_0x53708f;return _0x53708f[_0x12b8dd(0x104)](...checkConditions(_0x1df7e2[_0x12b8dd(0x102)],_0x7d2a8d,_0x4805e0)),_0x53708f;}function checkConditions(_0x38256d,_0x2cb2ca,_0x1bb849){const _0x54720c=a156_0x5970,_0x2d94d1=[];for(let _0x384d7c=0x0;_0x384d7c<_0x38256d[_0x54720c(0xd8)];_0x384d7c++){const _0x25404d=_0x38256d[_0x384d7c],_0x2204e1=_0x2cb2ca+_0x54720c(0xf2)+_0x384d7c+']';_0x2d94d1[_0x54720c(0x104)](...checkCondition(_0x25404d,_0x2204e1,_0x1bb849));}return _0x2d94d1;}function checkCondition(_0xbc1975,_0x2e17d8,_0x1988b6){const _0x5200a5=a156_0x5970,_0x1b4167=[];if(_0xbc1975[_0x5200a5(0x107)]===_0x5200a5(0xd2)||_0xbc1975['type']==='Or'){if(_0xbc1975[_0x5200a5(0x102)]['length']===0x0)_0x1b4167['push']({'level':'error','path':_0x2e17d8+_0x5200a5(0xf6),'code':'EMPTY_CONDITIONS','message':_0xbc1975[_0x5200a5(0x107)]+_0x5200a5(0x108),'location':getLocationFromPath(_0x1988b6[_0x5200a5(0x111)],_0x1988b6['source'],pathToArray(_0x2e17d8+'.conditions'))});else{const _0x2e8b0f=_0xbc1975[_0x5200a5(0x116)]!==undefined;!_0x2e8b0f&&_0x1b4167[_0x5200a5(0x104)]({'level':_0x5200a5(0xdc),'path':_0x2e17d8,'code':_0x5200a5(0xe5),'message':_0xbc1975[_0x5200a5(0x107)]+'\x20condition\x20group:\x20Console\x20UI\x20SQL\x20preview\x20does\x20not\x20display\x20nested\x20'+_0x5200a5(0xe0)+'conditions,\x20consider\x20using\x20\x27In\x27\x20operator:\x20operator:\x20{\x20type:\x20In,\x20value:\x20[\x22val1\x22,\x20\x22val2\x22]\x20}','location':getLocationFromPath(_0x1988b6['document'],_0x1988b6[_0x5200a5(0xf4)],pathToArray(_0x2e17d8))}),_0x1b4167[_0x5200a5(0x104)](...checkConditions(_0xbc1975[_0x5200a5(0x102)],_0x2e17d8,_0x1988b6));}return _0x1b4167;}if(_0xbc1975[_0x5200a5(0x107)]===_0x5200a5(0xd9)||_0xbc1975['type']===_0x5200a5(0xf0)){const _0x306869=_0xbc1975,_0x345301=_0x306869[_0x5200a5(0xf4)],_0x534dbc=_0x306869[_0x5200a5(0x117)],_0x2a8d30=_0x345301||_0x534dbc;(!_0x306869[_0x5200a5(0xd4)]||_0x306869[_0x5200a5(0xd4)]==='')&&(!_0x2a8d30&&_0x1b4167['push']({'level':_0x5200a5(0xd5),'path':_0x2e17d8+_0x5200a5(0x10c),'code':_0x5200a5(0x110),'message':_0x5200a5(0x10f),'location':getLocationFromPath(_0x1988b6[_0x5200a5(0x111)],_0x1988b6[_0x5200a5(0xf4)],pathToArray(_0x2e17d8+'.attribute'))}));_0x306869[_0x5200a5(0xfa)]&&_0x1b4167[_0x5200a5(0x104)](...checkRule(_0x306869['filter'],_0x2e17d8+_0x5200a5(0x119),_0x1988b6));if(_0x306869[_0x5200a5(0xf4)]){const _0xe6f96f=_0x306869['attribute']&&_0x306869[_0x5200a5(0xd4)]!=='';_0xe6f96f&&!_0x306869['filter']&&_0x1b4167[_0x5200a5(0x104)]({'level':_0x5200a5(0xd5),'path':_0x2e17d8+_0x5200a5(0xe4),'code':_0x5200a5(0x101),'message':_0x5200a5(0x105)+_0x306869['source']+_0x5200a5(0xdb)+_0x306869[_0x5200a5(0xd4)]+'\x27\x20'+_0x5200a5(0xe1)+'the\x20condition\x20queries\x20the\x20master\x20table\x20instead.\x20'+'Use\x20\x27attribute:\x20\x22\x22\x27\x20with\x20\x27filter.type:\x20And\x27\x20containing\x20\x27type:\x20Column\x27\x20conditions.','location':getLocationFromPath(_0x1988b6[_0x5200a5(0x111)],_0x1988b6['source'],pathToArray(_0x2e17d8+'.source'))}),_0xe6f96f&&_0x306869['filter']&&_0x1b4167[_0x5200a5(0x104)]({'level':_0x5200a5(0xdc),'path':_0x2e17d8+_0x5200a5(0x10c),'code':_0x5200a5(0xdf),'message':_0x5200a5(0xda)+_0x306869[_0x5200a5(0xd4)]+_0x5200a5(0xe8)+_0x5200a5(0xf1),'location':getLocationFromPath(_0x1988b6[_0x5200a5(0x111)],_0x1988b6['source'],pathToArray(_0x2e17d8+_0x5200a5(0x10c)))});}}return _0x1b4167;}
|